XStream

Annotations are not inherited from parent classes

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.3
  • Component/s: None
  • Labels:
    None
  • JDK version and platform:
    Sun 1.5.0_06 / Win XP

Description

When a parent class has annotations on it's fields and the child class is serialized, the fields inherited from the parents are not named correctly. This should be corrected by adding a @Inherited annotation to the @XStreamAlias annotation definition.

Issue Links

Activity

Hide
Mark Reynolds added a comment -

The @Inherit annotation does not have any effect for field level annotations.

I think the correct solution is to get inherited fields and their annotations when processing a class for it's annotations. Here is a patch which also includes a test case (this patch also includes my test case from XSTR-297).

Show
Mark Reynolds added a comment - The @Inherit annotation does not have any effect for field level annotations. I think the correct solution is to get inherited fields and their annotations when processing a class for it's annotations. Here is a patch which also includes a test case (this patch also includes my test case from XSTR-297).
Hide
Joerg Schaible added a comment -

Annotations are now always inherited. You may give the head revision a try.

Show
Joerg Schaible added a comment - Annotations are now always inherited. You may give the head revision a try.
Hide
Joerg Schaible added a comment -

Closing issues before next release.

Show
Joerg Schaible added a comment - Closing issues before next release.

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: