[
https://issues.apache.org/jira/browse/SLING-2937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13695039#comment-13695039
]
Nirmal commented on SLING-2937:
-------------------------------
Yes, you are correct. Yet if this is long parsable string, we can address it
rather than returning an incorrect value. Thanks for the fix Justin.
> Sling JSONObject getlong incorrect parsing
> ------------------------------------------
>
> Key: SLING-2937
> URL: https://issues.apache.org/jira/browse/SLING-2937
> Project: Sling
> Issue Type: Bug
> Components: Commons
> Affects Versions: Commons JSON 2.0.6
> Reporter: Nirmal
> Assignee: Justin Edelson
> Priority: Minor
> Fix For: Commons JSON 2.0.8
>
>
> org.apache.sling.commons.json.JSONObject
> try {
> String jsonStr1 = "{\"longvalue\":\"13857270119014401\"}";
> JSONObject json1 = new JSONObject(jsonStr1);
> System.out.println(json1.getLong("longvalue"));
> } catch (JSONException e) {
> e.printStackTrace();
> }
> returns
> 13857270119014400
> Expected value:13857270119014401
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira