[ 
https://issues.apache.org/jira/browse/SLING-2937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13694976#comment-13694976
 ] 

Justin Edelson commented on SLING-2937:
---------------------------------------

Don't you mean
{code}
String jsonStr1 = "{\"longvalue\":13857270119014401}"; 
{code}

?
                
> Sling JSONObject getlong incorrect parsing
> ------------------------------------------
>
>                 Key: SLING-2937
>                 URL: https://issues.apache.org/jira/browse/SLING-2937
>             Project: Sling
>          Issue Type: Bug
>          Components: General
>    Affects Versions: Commons JSON 2.0.6
>            Reporter: Nirmal
>            Priority: Critical
>
> 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

Reply via email to