cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r888599 - in /cxf/branches/2.2.x-fixes: ./ rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
Date Tue, 08 Dec 2009 22:18:52 GMT
Author: dkulp
Date: Tue Dec  8 22:18:52 2009
New Revision: 888599

URL: http://svn.apache.org/viewvc?rev=888599&view=rev
Log:
Merged revisions 888569 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r888569 | dkulp | 2009-12-08 16:00:45 -0500 (Tue, 08 Dec 2009) | 2 lines
  
  [CXF-2569] Fix an issue trying to determine the ObjectFactory method to
  call.
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java?rev=888599&r1=888598&r2=888599&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
Tue Dec  8 22:18:52 2009
@@ -24,6 +24,8 @@
 import java.io.OutputStream;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -826,11 +828,23 @@
             if (setMethod != null
                 && JAXBElement.class.isAssignableFrom(setMethod.getParameterTypes()[0]))
{
                 
+                Type t = setMethod.getGenericParameterTypes()[0];
+                Class<?> pcls = null;
+                if (t instanceof ParameterizedType) {
+                    t = ((ParameterizedType)t).getActualTypeArguments()[0];
+                }
+                if (t instanceof Class) {
+                    pcls = (Class)t;
+                }
+                
                 String methodName = "create" + wrapperType.getSimpleName()
                     + setMethod.getName().substring(3);
 
                 for (Method m : allOFMethods) {
-                    if (m.getName().equals(methodName)) {
+                    if (m.getName().equals(methodName)
+                        && m.getParameterTypes().length == 1
+                        && (pcls == null
+                            || pcls.equals(m.getParameterTypes()[0]))) {
                         jaxbMethods.add(m);
                     }
                 }



Mime
View raw message