The problem is this section of code for collections. The annotation property is a
collection, and there is no XmlType annotation, so this gets executed:
| // a collection may be bound as a value of a complex type
| // and this is checked with the XmlType annotation
| else if (propertyType.isCollection() && ((ClassInfo)
propertyType).getUnderlyingAnnotation(XmlType.class) == null)
| {
| isCol = true;
| propertyHandler = new CollectionPropertyHandler(property,
propertyType);
| ClassInfo typeArg = (ClassInfo) findComponentType(property);
|
| //if (((ClassInfo) typeArg).getUnderlyingAnnotation(XmlType.class)
!= null)
| if (typeArg != null &&
typeArg.getUnderlyingAnnotation(JBossXmlModelGroup.class) == null)
| {// it may be a model group in which case we don't want to
change the type
|
| // TODO yes, this is another hack with collections
| JBossXmlChild xmlChild = ((ClassInfo)
propertyType).getUnderlyingAnnotation(JBossXmlChild.class);
| if (xmlChild == null)
| {
| localPropertyType = typeArg;
| }
| }
| }
|
This ends up overriding the localPropertyType (that has been correctly set previously from
the XmlElement) to the interface class. The typeArg is a collection of the interface class
when it should be a collection of the overriden localPropertyType.
I guess the findComponentType(property) call needs to take the localPropertyType as well
as the CollectionPropertyHandler ctor.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088237#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...