Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fromJSON: java.lang.NumberFormatException: For input string: "154520162480046080" [moved] #659

Closed
lvca opened this issue Dec 10, 2012 · 0 comments

Comments

@lvca
Copy link
Member

lvca commented Dec 10, 2012

This is Issue 659 moved from a Google Code project.
Added by 2012-01-05T05:53:58.000Z by thilopl...@gmail.com.
Please review that bug for more context and additional comments, but update this bug.
Closed (Fixed).

Original labels: Type-Defect, Priority-Medium, v1.0rc8

Original description

I am storing JSON returned by Twitter (via twitter4j). The JSON includes a numeric id, that is too large for an Integer (twitter4j has it as a long). As a result I am getting a java.lang.NumberFormatException: For input string: "154520162480046080".

I am not sure if Twitter/twitter4j are 100% spec-compliant and if Long is technically allowed in JSON, but it would be nice to be able to parse this somehow. This probably needs some configuration to get reliable results (not sometimes Integer, sometimes Long). 

    java.lang.NumberFormatException: For input string: "154520162480046080"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:461)
    at java.lang.Integer.<init>(Integer.java:660)
    at com.orientechnologies.orient.core.serialization.serializer.OStringSerializerHelper.fieldTypeFromStream(OStringSerializerHelper.java:76)
    at com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerJSON.getValue(ORecordSerializerJSON.java:357)
    at com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerJSON.fromString(ORecordSerializerJSON.java:160)
    at com.orientechnologies.orient.core.record.ORecordAbstract.fromJSON(ORecordAbstract.java:190)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant