You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. See attached beans Tree and Monkey
2. Run this test:
Tree tree = new Tree();
tree.getMonkeys().add(new Monkey());
tree.getMonkeys().add(new Monkey());
String serialised = json.toJson(tree);
Tree newTree = json.fromJson(serialised, Tree.class);
What is the expected output? What do you see instead?
Deserialize fails, Caused by: java.lang.ClassCastException:
com.jpmorgan.ibmlbus.beans.serialise.Monkey cannot be cast to
java.lang.Comparable
at java.util.TreeMap.put(Unknown Source)
at java.util.TreeSet.add(Unknown Source)
at
com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter.deserialize(DefaultTyp
eAdapters.java:404)
at
com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter.deserialize(DefaultTyp
eAdapters.java:369)
at
com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExc
eptionWrapper.java:50)
... 27 more
The point is that Monkeys have no natural ordering. We should be able to
use them in a Set though, because uniqueness is fine.
What version of the product are you using? On what operating system?
1.2.3
Please provide any additional information below.
Original issue reported on code.google.com by aaron.b...@gmail.com on 12 Feb 2009 at 4:08
Original issue reported on code.google.com by
aaron.b...@gmail.com
on 12 Feb 2009 at 4:08Attachments:
The text was updated successfully, but these errors were encountered: