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

Key: XFIRE-170
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dan Diephouse
Reporter: Tony Culshaw
Votes: 0
Watchers: 0
Operations

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

Java5 Aegis/Generics fails to recognize correct member type on second and subsequent collections

Created: 13/Nov/05 04:39 PM   Updated: 12/Dec/05 05:20 PM
Component/s: Aegis Module
Affects Version/s: 1.0-M5, 1.0-M6
Fix Version/s: 1.0-M6

Time Tracking:
Not Specified

Environment: All Java5 updates, all platforms


 Description  « Hide
The generics on collections seems to cache the first member type.

For example, if I have a POJO containing...

private List<Athing> athings;
private List<Bthing> bthings;

The wsdl will tend to show both as ArrayOfAthing...

<xsd:sequence>
<xsd:element name="athings" type="tns:ArrayOfAthing" nillable="true"/>
</xsd:sequence>
<xsd:sequence>
<xsd:element name="bthings" type="tns:ArrayOfAthing" nillable="true"/>
</xsd:sequence>

This is a serious problem. It even occurs if athings and bthings arer in separate POJOs.

My temporary workaround is to use different collection classes List, ArrayList, Collection, but this kind of defeats the whole point because I'm hacking my POJOs and (ii) I'm running out of collection classes!

Any ideas/suggestions? Can I force the type using java5 annotations (XmlElement) ?



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Dan Diephouse - 13/Nov/05 05:07 PM
You've tried an M6 snapshot? I recall fixing this problem once before.... http://xfire.codehaus.org/Download

Tony Culshaw - 13/Nov/05 05:35 PM
Hi Dan - first let me say that's a really quick response. I'm impressed!

I am using the M6 jars (as of yesterday when I retried it and got the same result).

It is picking up the first List<xxx> okay, becuase the type is correct, but anything after that eg. List<yyy> List<zzz> ends up as ArrayOfXxx. As I said this is even across different POJOs.

I'd be happy if I could force the type using the XmlElement annotation, but I'm not sure of the syntax for the "type" argument.


Tony Culshaw - 13/Nov/05 05:51 PM
Update: Sorry Dan I inadvertantly had both M5 and M6 on my classpath. M6 causes another problem which I'll have to look at.

If you reckon it's fixed in M6 - awesome!

I'll let you know how I go.