Bug in Sun14ReflectionProvider

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug in Sun14ReflectionProvider

Enno Thieleke

Hello,

 

first of all I'd like to thank you for creating and maintaining XStream. It helps us a great deal in most of our unit tests.

 

We're using XStream 1.4.4 and as we switched from Sun14ReflectionProvider to its superclass PureJavaReflectionProvider I noticed breaking tests. After some debugging I found out that objects read from XML have properties set, which are not part of the XML documents. I took a closer look at those properties and realized that they're being initialized on object creation. Nothing special so far. So I debugged again with Sun14ReflectionProvider and realized that those properties, which should be initialized on object creation, remain null.

 

Long story short I think the Sun14ReflectionProvider is broken. It does not behave the same as its superclass although it should, but only in a more efficient way. It does not invoke the public default constructor as expected.

 

I've provided a unit test and resources to reproduce this behaviour.

 

Best regards

Enno



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

    http://xircles.codehaus.org/manage_email

Sun14ReflectionProviderTest.java (932 bytes) Download Attachment
Something.java (390 bytes) Download Attachment
Sun14ReflectionProviderTest.testGetMungedConstructor.xml (36 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Bug in Sun14ReflectionProvider

Jörg Schaible-2
Hi Enno,

Enno Thieleke wrote:

> Hello,
>
>
>
> first of all I'd like to thank you for creating and maintaining XStream.
> It helps us a great deal in most of our unit tests.
>
>
>
> We're using XStream 1.4.4 and as we switched from Sun14ReflectionProvider
> to its superclass PureJavaReflectionProvider I noticed breaking tests.
> After some debugging I found out that objects read from XML have
> properties set, which are not part of the XML documents. I took a closer
> look at those properties and realized that they're being initialized on
> object creation. Nothing special so far. So I debugged again with
> Sun14ReflectionProvider and realized that those properties, which should
> be initialized on object creation, remain null.
>
>
>
> Long story short I think the Sun14ReflectionProvider is broken. It does
> not behave the same as its superclass although it should, but only in a
> more efficient way. It does not invoke the public default constructor as
> expected.

http://xstream.codehaus.org/faq.html#Serialization

If you have further questions about this, please use the user's list.

- Jörg


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

    http://xircles.codehaus.org/manage_email