wecoppens / json-smart

Automatically exported from code.google.com/p/json-smart
0 stars 0 forks source link

Parser throws unexpected StringIndexOutOfBoundsException #15

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Parsing the following incomplete JSON strings throws an unexpected 
StringIndexOutOfBoundsException instead of a regular ParseException.

{"key":{}

{"key":

{"key":123

java.lang.StringIndexOutOfBoundsException: String index out of range: 10
        at java.lang.String.substring(String.java:1946)
        at net.minidev.json.parser.JSONParser.readNQString(JSONParser.java:216)
        at net.minidev.json.parser.JSONParser.readObject(JSONParser.java:341)
        at net.minidev.json.parser.JSONParser.readMain(JSONParser.java:132)
        at net.minidev.json.parser.JSONParser.parse(JSONParser.java:54)
        at net.minidev.json.JSONValue.parseWithException(JSONValue.java:183)
        at TestParseError.main(TestParseError.java:12)

Observed in JSON Smart 1.0.9.

See Java attachment for test case.

Original issue reported on code.google.com by vladimir...@gmail.com on 14 Oct 2011 at 10:50

Attachments:

GoogleCodeExporter commented 8 years ago
Thanths for report vladimr,
this bug is fixed.

a new minor version is now planed for the next days.

Original comment by uriel.chemouni on 18 Oct 2011 at 8:43

GoogleCodeExporter commented 8 years ago

Original comment by uriel.chemouni on 18 Oct 2011 at 8:45

GoogleCodeExporter commented 8 years ago
Great, I thank you too! 

Original comment by vladimir...@gmail.com on 18 Oct 2011 at 8:48

GoogleCodeExporter commented 8 years ago
Fixed

Original comment by uriel.chemouni on 24 Oct 2011 at 10:24

GoogleCodeExporter commented 8 years ago

Original comment by uriel.chemouni on 24 Oct 2011 at 10:25