What steps will reproduce the problem?
Gson g = new GsonBuilder().registerTypeAdapter(String.class, new
JsonSerializer<String>() {
public JsonElement serialize(String src, Type typeOfSrc, JsonSerializationContext context) {
return new JsonPrimitive(src.toUpperCase());
}
}).create();
System.out.println(g.toJson("test"));
What is the expected output? What do you see instead?
I expect that an exception should be thrown. Instead i see:
"test"
What version of the product are you using? On what operating system?
2.1 on Ubuntu 11.10 x64
Original issue reported on code.google.com by Ash2kk@gmail.com on 1 Apr 2012 at 9:02
Original issue reported on code.google.com by
Ash2kk@gmail.com
on 1 Apr 2012 at 9:02