Closed GoogleCodeExporter closed 9 years ago
The correction is line 154 of org.json.simple.JSONValue.
Replace :
out.write(value.toString());
By :
out.write('\"');
out.write(value.toString());
out.write('\"');
Hope it helps.
Regards,
Original comment by lemaire....@gmail.com
on 5 Jan 2012 at 11:22
Only mappings described in the following page are supported:
http://code.google.com/p/json-simple/wiki/MappingBetweenJSONAndJavaEntities
The purpose of not quoting toString() by default is to let user override it to
provide their own literals, but it seems that user often has issues here.
Considering making an enhancement on it.
Original comment by fangyid...@gmail.com
on 21 Feb 2012 at 5:25
I've experienced this in my own code - it would appear to make sense to make a
special case for "instance of java.lang.Enum" and wrap the ".toString" value in
quotes.
Original comment by ray.bellis
on 11 Jul 2013 at 9:00
Original comment by jon.cham...@gmail.com
on 10 Aug 2013 at 4:56
Original issue reported on code.google.com by
lemaire....@gmail.com
on 5 Jan 2012 at 10:18