Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.1.2
-
Fix Version/s: 1.2.1
-
Component/s: Aegis Module
-
Labels:None
-
Environment:Xfire 1.1.2
-
Number of attachments :
Description
If I have a Service that returns an array of Collections / Map XFire fails saying that the keytype and componentType are not defined.
The problem seems to be that when an array is returned, XFire creates a new TypeInfo for the nested List / Map which does not inherit the keyType and componentType defined in the aegis mapping.
Here is an example
interface ArrayService{ public Map[] getMapArray(); public List[] getArrayOfListsOfDoubles(); }
<mappings>
<mapping>
<method name="getMapArray">
<return-type keyType="java.lang.Double" componentType="java.lang.Double" />
</method>
<method name="getArrayOfListsOfDoubles">
<return-type componentType="java.lang.Double" />
</method>
</mapping>
</mappings>
The problem was found at AbstractTypeCreator line 310. This was modified so now it looks like the following:
TypeClassInfo nestedInfo = createBasicClassInfo(componentType);
nestedInfo.setKeyType(info.getKeyType());
nestedInfo.setGenericType(info.getGenericType());
type = createTypeForClass(nestedInfo);
getTypeMapping().register(type);
We will try to add the testcase for these scenarios.
Patch to fix the current Issue.