XStreamImplicit annotations in subclass screen annotations in superclass

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

XStreamImplicit annotations in subclass screen annotations in superclass

depstein
Hello,

I have a problem with XStreamImplicit annotations in derived classes. It seems that an @XStreamImplicit annotation in a subclass screens all @XStreamImplicit annotations in its superclass.

Example 1:

public class SuperClass {
        @XStreamImplicit(itemFieldName="superItem")
        private List<String> superList;
}

public class SubClass extends SuperClass {
        private List<String> subList;
}

<SubClass>
    <superItem>A</superItem>
    <superItem>B</superItem>
    <subList class="java.util.Arrays$ArrayList">
      <a class="string-array">
        <string>a</string>
        <string>b</string>
      </a>
    </subList>
</SubClass>

- this works.

Example 2:

public class SuperClass {
        @XStreamImplicit(itemFieldName="superItem")
        private List<String> superList;
}

public class SubClass extends SuperClass {
        @XStreamImplicit(itemFieldName="subItem")
        private List<String> subList;
}

<SubClass>
    <superItem>A</superItem>
    <superItem>B</superItem>
    <subItem>a</subItem>
    <subItem>b</subItem>
</SubClass>

- this will trigger an exception, because superItem will not be recognized (no mapping for this annotation).

XStream v. 1.4.1

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: XStreamImplicit annotations in subclass screen annotations in superclass

Jörg Schaible-2
Hi,

[hidden email] wrote:

> Hello,
>
> I have a problem with XStreamImplicit annotations in derived classes. It
> seems that an @XStreamImplicit annotation in a subclass screens all
> @XStreamImplicit annotations in its superclass.
>
> Example 1:
>
> public class SuperClass {
> @XStreamImplicit(itemFieldName="superItem")
> private List<String> superList;
> }
>
> public class SubClass extends SuperClass {
> private List<String> subList;
> }
>
> <SubClass>
>     <superItem>A</superItem>
>     <superItem>B</superItem>
>     <subList class="java.util.Arrays$ArrayList">
>       <a class="string-array">
>         <string>a</string>
>         <string>b</string>
>       </a>
>     </subList>
> </SubClass>
>
> - this works.
>
> Example 2:
>
> public class SuperClass {
> @XStreamImplicit(itemFieldName="superItem")
> private List<String> superList;
> }
>
> public class SubClass extends SuperClass {
> @XStreamImplicit(itemFieldName="subItem")
> private List<String> subList;
> }
>
> <SubClass>
>     <superItem>A</superItem>
>     <superItem>B</superItem>
>     <subItem>a</subItem>
>     <subItem>b</subItem>
> </SubClass>
>
> - this will trigger an exception, because superItem will not be recognized
> (no mapping for this annotation).
>
> XStream v. 1.4.1

Please give the latest SNAPSHOT a try and report back. You might have hit
XSTR-733.

- Jörg


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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

RE: XStreamImplicit annotations in subclass screen annotations in superclass

depstein
In reply to this post by depstein
> Please give the latest SNAPSHOT a try and report back. You might have hit
> XSTR-733.
>
> - Jörg

No issues with release 1.4.4_2. I didn't realize we were so far behind. (One reason is that we use OSGi bundles, which are not available from XStream directly.)

Thanks!

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

RE: XStreamImplicit annotations in subclass screen annotations in superclass

Jörg Schaible-2
[hidden email] wrote:

>> Please give the latest SNAPSHOT a try and report back. You might have hit
>> XSTR-733.
>>
>> - Jörg
>
> No issues with release 1.4.4_2. I didn't realize we were so far behind.
> (One reason is that we use OSGi bundles, which are not available from
> XStream directly.)

This is actually XSTR-729 also available in the latest SNAPSHOT.

;-)

- Jörg


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

    http://xircles.codehaus.org/manage_email