Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
Tuan Nguyen wrote:
> Hi,
>
> Does XStream support the primitive data type array like long[] . int[] .....
> When I try to serialize the java.util.BitSet and I have the following result
> <entry>
> <string>node-permission</string>
> <exo.services.cms.model.NodePermission>
> <bitset class="java.util.BitSet">
> <bits class="long-array">
> <long>3</long>
> </bits>
> </bitset>
> </exo.services.cms.model.NodePermission>
> </entry>
>
> But when I deserialize , I have an exception. It looks like XStream does not recomize the long[] in BitSet.
>
> Thank !
>
> Tuan Nguyen
> www.exoplatform.org
>
> [junit] ------------- ---------------- ---------------
> [junit] ------------- Standard Error -----------------
> [junit] com.thoughtworks.xstream.alias.CannotResolveClassException: bits
> [junit] at com.thoughtworks.xstream.alias.DefaultClassMapper.lookupType(DefaultCla
> sMapper.java:70)
> [junit] at com.thoughtworks.xstream.converters.collections.ArrayConverter.fromXML(
> rrayConverter.java:32)
> [junit] at com.thoughtworks.xstream.converters.composite.ObjectWithFieldsConverter
> fromXML(ObjectWithFieldsConverter.java:66)
> [junit] at com.thoughtworks.xstream.converters.composite.ObjectWithFieldsConverter
> fromXML(ObjectWithFieldsConverter.java:66)
> [junit] at com.thoughtworks.xstream.converters.collections.AbstractCollectionConve
> ter.readItem(AbstractCollectionConverter.java:42)
> [junit] at com.thoughtworks.xstream.converters.collections.MapConverter.fromXML(Ma
> Converter.java:42)
> [junit] at com.thoughtworks.xstream.converters.composite.ObjectWithFieldsConverter
> fromXML(ObjectWithFieldsConverter.java:66)
> [junit] at com.thoughtworks.xstream.XStream.fromXML(XStream.java:112)
> [junit] at com.thoughtworks.xstream.XStream.fromXML(XStream.java:104)
> [junit] at exo.services.cms.model.impl.ObjectNodeConverterImpl.fromXml(ObjectNodeC
This should be done in this way to save space if possible:
<int array> 1,2,34,4,5,66,... </int>