Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.2-RC
-
Fix Version/s: 1.2.1
-
Component/s: Aegis Module
-
Labels:None
-
Environment:Using Java5 annotations and thus Java5TypeCreator.
-
Number of attachments :
Description
When attempting to provide concrete implementations of interfaces, as described in the last section of http://xfire.codehaus.org/Aegis+Binding, the service picked up the override types correctly. However, when it comes to writing out the types, a bean that contains a List (say) of the overridden interface wasn't overriding these types correctly. What happened was that the outer bean would call AegisBindingProvider.getWriteType(), passing in the List itself. Since this function doesn't inspect the component type of the list, it wasn't possible at this stage for it to notice the types that should be overridden. So off we go into CollectionType.writeObject(), and here it assumes that the Type of all the elements in the list is the same as the declared type.
This is incorrect; my bean had a List<IDataColumn>, so actual members of the List may be SQLColumns, DataAggregateColumns, etc. What was needed was to call AegisBindingProvider.getWriteType(), passing in each element of the list. As it turns out, the superclass ArrayType already did the right thing with its writeValue() method, so the solution seems to be to defer the actual write to this method. I attach a patch that does this, and worked perfectly for me.
I'm marking this as a duplicate of
XFIRE-545, but I will be applying this patch. Thanks!XFIRE-545, but I will be applying this patch. Thanks!