cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r888689 - in /cxf/branches/2.1.x-fixes: ./ rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
Date Wed, 09 Dec 2009 03:25:46 GMT
Author: dkulp
Date: Wed Dec  9 03:25:44 2009
New Revision: 888689

URL: http://svn.apache.org/viewvc?rev=888689&view=rev
Log:
Merged revisions 888599 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes

................
  r888599 | dkulp | 2009-12-08 17:18:52 -0500 (Tue, 08 Dec 2009) | 10 lines
  
  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.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java

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

Modified: cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java?rev=888689&r1=888688&r2=888689&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
Wed Dec  9 03:25:44 2009
@@ -27,6 +27,8 @@
 import java.lang.ref.WeakReference;
 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;
@@ -939,11 +941,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