Hi Philippe

Philippe Mouawad wrote:

> Hello,
> I was wondering if the Javadoc of XStream regarding mode was still
> accurate regarding mode
> 
>    -
>    
http://xstream.codehaus.org/javadoc/com/thoughtworks/xstream/XStream.html
> 
> 
> xstream.setMode(XStream.NO_REFERENCES); This disables object graph support
> and treats the object structure like a tree. Duplicate references are
> treated as two separate objects and circular references cause an
> exception. This is slightly faster and uses less memory than the other two
> modes.
> 
> 
> What seems strange is :
> 
> 
> *This is slightly faster and uses less memory than the other two modes.*

Originally we had only 3 modes: ID, XPATH and no references at all. Then we 
introduced relative and absolute XPATHs and some time later the single 
reference modes for the two XAPTH variants. Seems not all documentation is 
up-to-date ...

> It mentions 2 modes while javadoc shows 5 modes, is it really faster and
> uses less memory or the new modes are better.

The comments for NO_REFERENCES still applies. XStream does then not have to 
keep track of the unmarshalled objects just because they might be referenced 
somewhere later on.

> I am concerned about the issues related to NO_REFERENCES mode as per:
> http://xstream.10960.n7.nabble.com/Hints-for-Tracking-down-a-CircularReferenceException-td4531.html

If your object graph contains no circles, you cannot get this exception ;-)
Otherwise you would end up in an endless loop.

> Thanks for help, and by the way GREAT PROJECT !

Thanks for the feedback,
Jörg 



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

    http://xircles.codehaus.org/manage_email


Reply via email to