Closed GoogleCodeExporter closed 9 years ago
I've attached a JUnit test file that shows the issue. I've confirmed that the following patch fixes this. Existing method in Gson.java: public String toJson(Object src) { if (src == null) { return serializeNulls ? NULL_STRING : ""; } return toJson(src, src.getClass()); } Patched version of above method: public String toJson(Object src) { if (src == null) { return serializeNulls ? NULL_STRING : ""; } Type typeOfSrc; if (src instanceof Enum) { typeOfSrc = ((Enum) src).getDeclaringClass(); } else { typeOfSrc = src.getClass(); } return toJson(src, typeOfSrc); }
Original issue reported on code.google.com by MarceliN...@gmail.com on 29 Sep 2010 at 10:20
MarceliN...@gmail.com
Attachments:
Already fixed in SVN.
Original comment by limpbizkit on 3 Oct 2010 at 6:41
limpbizkit
Original issue reported on code.google.com by
MarceliN...@gmail.com
on 29 Sep 2010 at 10:20Attachments: