Skip to content

Support reading java.util.Calendar / java.util.Date from textual serialization #48

@Marty

Description

@Marty

Hi,

I'm writing a list of instances of my class that has a calendar field.

File file = new File(context.getFilesDir(), fileName);
try {
    JSON.std.write(listOfObjects, file);

Writing works just fine, but when reading the created json, I receive the following exception:

com.fasterxml.jackson.jr.ob.JSONObjectException: Can not get long numeric value from JSON (to construct java.util.Calendar) from JSON String

I can fix this easily by adding the JSON.Feature.WRITE_DATES_AS_TIMESTAMPto the writer, but I find it rather odd that jackson-jr is not able to read what it has written with complete default configuration.

I'm using 'com.fasterxml.jackson.jr:jackson-jr-objects:2.7.4'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions