You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2010/01/27 18:50:33 UTC
svn commit: r903760 -
/cxf/trunk/common/common/src/main/java/org/apache/cxf/jaxb/JAXBUtils.java
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;
}
}