Author: mmusaji
Date: 2013-02-28 06:50:46 -0500 (Thu, 28 Feb 2013)
New Revision: 17369
Modified:
thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10657/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10657/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java
Log:
[JBPAPP-10657] Commited changes to ensure parameterized types are populated correctly in
the WSDL
Modified:
thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10657/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10657/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java 2013-02-28
11:31:41 UTC (rev 17368)
+++
thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10657/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java 2013-02-28
11:50:46 UTC (rev 17369)
@@ -580,6 +580,12 @@
for (Method m : Utils.getGetters(cls, accessType)) {
//map method
Type type = Utils.getMethodReturnType(m);
+ //we want to return the right type for collections so if we get null
+ //from the return type we check if it's ParameterizedType and get the
+ //generic return type.
+ if((type==null) && (m.getGenericReturnType() instanceof
ParameterizedType)) {
+ type = m.getGenericReturnType();
+ }
JAXBBeanInfo beanInfo = getBeanInfo(type);
if (beanInfo != null) {
int idx = m.getName().startsWith("get") ? 3 : 2;
Modified:
thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10657/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10657/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java 2013-02-28
11:31:41 UTC (rev 17368)
+++
thirdparty/cxf/branches/cxf-2.2.12-patch-04_JBPAPP-10657/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java 2013-02-28
11:50:46 UTC (rev 17369)
@@ -209,9 +209,17 @@
}
static Class<?> getMethodReturnType(Method m) {
- XmlJavaTypeAdapter adapter = getMethodXJTA(m);
- Class<?> adapterType = getTypeFromXmlAdapter(adapter);
- return adapterType != null ? adapterType : m.getReturnType();
+ XmlJavaTypeAdapter adapter = getMethodXJTA(m);
+ //if there is no adapter, yet we have a collection make sure
+ //we return the Generic type; if there is an annotation let the
+ //adapter handle what gets populated
+ if(adapter==null) {
+ if(m.getGenericReturnType() instanceof ParameterizedType) {
+ return null;
+ }
+ }
+ Class<?> adapterType = getTypeFromXmlAdapter(adapter);
+ return adapterType != null ? adapterType : m.getReturnType();
}
@SuppressWarnings({ "rawtypes", "unchecked" })
Show replies by date