History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XSTR-444
Type: Bug Bug
Status: Closed Closed
Resolution: Duplicate
Priority: Major Major
Assignee: Unassigned
Reporter: Felix LJ Mayer
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
XStream

@XStreamAlias ignored for fields in super classes

Created: 18/Oct/07 11:25 PM   Updated: 19/Oct/07 01:20 AM
Component/s: Annotations
Affects Version/s: 1.2.2
Fix Version/s: None

Issue Links:
Duplicate
 

JDK version and platform: JDK 1.6.0 WIndows


 Description  « Hide
Suppose you have two classes A and B like this which are both declared with Annotations.configureAliases():

public abstract class A {
@XStreamAlias("test")
@XStreamAsAttribute
private String bug;
}

@XStreamAlias("concrete")
public class B extends A {
@XStreamAlias("firstName")
@XStreamAsAttribute
private String name;
}

Then XStream persists an instance of B like this:
<concrete firstName="michael" test="whatever"/>

Then XStream will not read the attribute 'test' from the XML document into the class since it expects the attribute name to be 'bug'. Basically the @XStreamAlias annotation is ignored in (abstract) super classes and the actual field name is used instead when the XML document is read; when an object is persisted, however, the @XStreamAlias annotation is used correctly.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Joerg Schaible - 19/Oct/07 01:20 AM
See linked issue.