What steps will reproduce the problem?
TreeSet<String> strings = new TreeSet<String>();
strings.add("Happy");
Gson gson = new Gson();
String json = gson.toJson(strings);
strings = gson.fromJson(json, new TypeToken<TreeSet<String>>() {}.getType());
What is the expected output? What do you see instead?
I would expect it to run without exceptions.
I am getting the following:
Exception in thread "main" java.lang.ClassCastException:
java.util.LinkedList cannot be cast to java.util.TreeSet
What version of the product are you using? On what operating system?
gson-1.3.jar and gson-1.4.jar
Running on OSX 10.6
Please provide any additional information below.
Original issue reported on code.google.com by gciar...@gmail.com on 23 Oct 2009 at 1:32
Original issue reported on code.google.com by
gciar...@gmail.com
on 23 Oct 2009 at 1:32