Skip to content

JsonIterator.deserialize long is converted to double #147

@tomcashman

Description

@tomcashman

I'm currently having an issue that JsonIterator.deserialize converts long values to doubles. See test below to reproduce.

public void test_long_value() throws IOException {
    	final long timestamp = System.currentTimeMillis();
    	Map<String, Object> map = JsonIterator.deserialize("{\"timestamp\":" + timestamp + "}", new TypeLiteral<Map<String, Object>>() {
        });
        assertEquals(new HashMap<String, Object>() {{
            put("timestamp", timestamp);
        }}, map);
    }

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