[ http://jira.codehaus.org/browse/XFIRE-765?page=comments#action_82418 ]
Devon Berry commented on XFIRE-765:
-----------------------------------
Here's my fix that appears to work on my system. Note that because the
following map related methods are scoped protected, Java5TypeCreator could not
properly delegate to the nextCreator. A proper version of this fix would
change the scope of the getOrCreateMapKeyType and getOrCreateMapKeyValue
methods to public, but I will leave that up to someone with commit rights to
decide.
{code:title=XMLTypeCreator.java|borderStyle=solid}
protected Type getOrCreateMapKeyType(TypeClassInfo info)
{
Type type = null;
if (info.getKeyType() != null)
type = createTypeFromGeneric(info.getKeyType());
if (type == null)
type = nextCreator.getOrCreateMapKeyType(info); // Give the next
creator a shot
return type;
}
protected Type getOrCreateMapValueType(TypeClassInfo info)
{
Type type = null;
if (info.getGenericType() != null)
type = createTypeFromGeneric(info.getGenericType());
if (type == null)
type = nextCreator.getOrCreateMapValueType(info); // Give the next
creator a shot
return type;
}
{code}
{code:title=Java5TypeCreator.java|borderStyle=solid}
protected Type getOrCreateMapKeyType(TypeClassInfo info)
{
if (info.getGenericType() != null) {
return getOrCreateParameterizedType(info.getGenericType(), 0);
} else {
return super.getOrCreateMapKeyType(info); // Because this
method is protected & in a different package we can't delegate
}
}
protected Type getOrCreateMapValueType(TypeClassInfo info)
{
if (info.getGenericType() != null) {
return getOrCreateParameterizedType(info.getGenericType(), 1);
} else {
return super.getOrCreateMapValueType(info); // Because this
method is protected & in a different package we can't delegate
}
}
{code}
> Service interface generics map generates anyType2anyTypeMap WSDL
> ----------------------------------------------------------------
>
> Key: XFIRE-765
> URL: http://jira.codehaus.org/browse/XFIRE-765
> Project: XFire
> Issue Type: Bug
> Components: Aegis Module
> Affects Versions: 1.2.2
> Environment: xbean-spring-2.7-20061026.103714-1.jar
> Tomcat 5.5.17
> Java 1.5
> Reporter: Wesley Miaw
> Assigned To: Dan Diephouse
> Priority: Minor
>
> I have the following two interface signatures:
> HashMap<Integer,Source> findMostRecentSources(int[] ids) throws SQLException;
> boolean createTask(ArrayList<Task> tasks) throws SQLException;
> The ArrayList<Task> is correctly turned into an ArrayOfTask, but for some
> reason the returned HashMap is turned into anyType2anyTypeMap from the WSDL.
> e.g.
> <xsd:complexType name="anyType2anyTypeMap">
> <xsd:sequence>
> <xsd:element maxOccurs="unbounded" minOccurs="0" name="entry">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element maxOccurs="1" minOccurs="0" name="key"
> type="xsd:anyType"/>
> <xsd:element maxOccurs="1" minOccurs="0" name="value"
> type="xsd:anyType"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> </xsd:sequence>
> </xsd:complexType>
> I was able to make it generate the correct int2TaskMap by treating it as a
> Java 1.4 collection and explicitly specifying the key and component types in
> the Interface.aegis.xml file.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email