Lovelyxredxpanda / json-simple

Automatically exported from code.google.com/p/json-simple
Apache License 2.0
0 stars 0 forks source link

Failure to parse a json string that contains UUID #61

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a json string by converting a POJO that contains a UUID field, 
without converting the UUID to string.
2. Try to parse the json string using JSONParser.
3. The parser get an exception. See attached test case.

What is the expected output? What do you see instead?
The parser should not get an exception. The value should be returned.
Instead you get an exception of the following type:
Unexpected character (c) at position 8.
This is the stack trace:
at org.json.simple.parser.Yylex.yylex(Unknown Source)
    at org.json.simple.parser.JSONParser.nextToken(Unknown Source)
    at org.json.simple.parser.JSONParser.parse(Unknown Source)
    at org.json.simple.parser.JSONParser.parse(Unknown Source)
    at org.json.simple.parser.JSONParser.parse(Unknown Source)
    at com.tonian.director.dm.json.JSonSimpleUUIDTest.testFail(JSonSimpleUUIDTest.java:32)

What version of the product are you using? On what operating system?
Version 1.1.
OS - Linux Fedora 15.

Please provide any additional information below.

Original issue reported on code.google.com by e...@primarydata.com on 28 Nov 2011 at 4:29

Attachments:

GoogleCodeExporter commented 9 years ago
Method testPass() in your class is the right way to use JSON.simple.
See more details on the following link:
http://code.google.com/p/json-simple/wiki/MappingBetweenJSONAndJavaEntities

Original comment by fangyid...@gmail.com on 29 Nov 2011 at 2:40