cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r903760 - /cxf/trunk/common/common/src/main/java/org/apache/cxf/jaxb/JAXBUtils.java
Date Wed, 27 Jan 2010 17:50:33 GMT
Author: dkulp
Date: Wed Jan 27 17:50:33 2010
New Revision: 903760

URL: http://svn.apache.org/viewvc?rev=903760&view=rev
Log:
[CXF-2635] JAXB can use non-public default constructors.  Check for
that.

Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/jaxb/JAXBUtils.java

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/jaxb/JAXBUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/jaxb/JAXBUtils.java?rev=903760&r1=903759&r2=903760&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/jaxb/JAXBUtils.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/jaxb/JAXBUtils.java Wed Jan 27 17:50:33
2010
@@ -26,6 +26,7 @@
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.Type;
@@ -493,11 +494,17 @@
             if (cls.getName().equals("javax.xml.ws.wsaddressing.W3CEndpointReference")) {
                 return cls;
             }
+            Constructor cons = null;
             try {
-                if (cls.getConstructor(new Class[0]) == null) {
-                    cls = null;
-                }
+                cons = cls.getDeclaredConstructor(new Class[0]);
             } catch (NoSuchMethodException ex) {
+                try {
+                    cons = cls.getConstructor(new Class[0]);
+                } catch (NoSuchMethodException ex2) {
+                    cons = null;
+                }
+            }
+            if (cons == null) {
                 cls = null;
             }
         }



Mime
View raw message