PhiloSophical Member Licensed User Longtime User Oct 24, 2017 #1 I was parsing this JSON and puzzled for a while over an exception that complained of an "infinite number" org.json.JSONException: Forbidden numeric value: Infinity [ { "Description": "John", "object-Id": "656B5023-DBC9-B831-FFA9-E0913160400" } ] This when Code: Dim JP As JSONParser Dim s As String s=$"[ { "Description": "John", "object-Id": "656B5023-DBC9-B831-FFA9-E0913160400" } ]"$ Dim l As List Dim m As Map JP.initialize(s) l=JP.nextarray JP.initialize(l.get(0)) m=JP.NextObject I've come up with an answer. The "-E" is being interpreted as an exponential operator for some reason. Would appreciate confirmation from @Erel and look forward to a bug fix if this is confirmed. Thanks
I was parsing this JSON and puzzled for a while over an exception that complained of an "infinite number" org.json.JSONException: Forbidden numeric value: Infinity [ { "Description": "John", "object-Id": "656B5023-DBC9-B831-FFA9-E0913160400" } ] This when Code: Dim JP As JSONParser Dim s As String s=$"[ { "Description": "John", "object-Id": "656B5023-DBC9-B831-FFA9-E0913160400" } ]"$ Dim l As List Dim m As Map JP.initialize(s) l=JP.nextarray JP.initialize(l.get(0)) m=JP.NextObject I've come up with an answer. The "-E" is being interpreted as an exponential operator for some reason. Would appreciate confirmation from @Erel and look forward to a bug fix if this is confirmed. Thanks
Erel B4X founder Staff member Licensed User Longtime User Oct 25, 2017 #2 It works fine here, tested on Android 8.0. The json parser is part of the OS. I guess that Google has fixed this issue in one of the updates. Last edited: Oct 25, 2017
It works fine here, tested on Android 8.0. The json parser is part of the OS. I guess that Google has fixed this issue in one of the updates.
PhiloSophical Member Licensed User Longtime User Oct 25, 2017 #3 Thank you Erel - I didn't realise that the JSON parser was part of the Android OS. I can confirm now that the above code also works on Android 7.0 also but fails on 4.2.2
Thank you Erel - I didn't realise that the JSON parser was part of the Android OS. I can confirm now that the above code also works on Android 7.0 also but fails on 4.2.2