Hello Dale,

sorry, I was busy yesterday.

Dale Ellis wrote:

> Still can't get this working and have spent a day on it. It's definitely
> to do with the way the StageDefinition/StageTransition Sets, if I blank
> them the fromXml will work.

It's a general problem with TreeSet/TreeMap (sets use internally typically 
maps). If the optimized addAll/putAll does not work, the order of every 
element has to be recalculated when they are inserted. This is even worse 
for deserialization frameworks, if the compareTo method accesses all kind of 
other members that might have not yet been deserialized and operates 
therefor on incomplete objects.

The JDK has typically an optimization if you try to put an already sorted 
map into an empty one. From the stack trace below, it is visible, that the 
condition for the optimization was not met, but I do not understand why. 

> I'm just beaten now, so as a workaround I'm going to change this...
> 
>         String originalXml = parser.toXML(contentObject);
>         String idPattern = "<id>(.+?)</id>";
>         String xml = originalXml.replaceAll(idPattern, "");
> 
> To this
> 
>         String originalXml = parser.toXML(contentObject);
>         String idPattern = "<id>(.+?)</id>";
>         String xml = originalXml.replaceAll(idPattern, "<id>-1</id>");
> 
> Just going to have to write a method to loop through and null the id's

You may try to use omitField instead.

- Jörg


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to