Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.3.1
-
Fix Version/s: None
-
Component/s: Converters
-
Labels:None
Description
Many xstream converters use class equality when determining if they can convert an object of a given type. This is undesirable, as it prevents users from easily serializing classes that extend these objects. Under the current implementation, users are forced to implement a custom converter in order to support this scenario. Instead, Class.isAssignableFrom should be use when checking "canConvert", so that the converters will properly convert subclasses as well. If a user still needs custom functionality they can then fall-back to creating their own converter.
So far I have found the following converters to be affected:
CollectionConverter
MapConverter
TreeMapConverter
TreeSetConverter
Here's a patch fixing most occurances of .equals use.