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 2012/12/19 19:28:05 UTC
svn commit: r1424005 -
/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
Author: dkulp
Date: Wed Dec 19 18:28:05 2012
New Revision: 1424005
URL: http://svn.apache.org/viewvc?rev=1424005&view=rev
Log:
Fix some issues introduced in 2.7.1 that caused extra classes to be added to the JAXBContext that shouldn't be.
Modified:
cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
Modified: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java?rev=1424005&r1=1424004&r2=1424005&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java (original)
+++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java Wed Dec 19 18:28:05 2012
@@ -388,13 +388,9 @@ class JAXBContextInitializer extends Ser
// must not have parameters and return type must not be void
if (method.getReturnType() == Void.class
|| method.getParameterTypes().length != 0
- || method.getDeclaringClass().equals(Throwable.class)) {
- return false;
- }
- if (method.getName().startsWith("get")
- || method.getName().startsWith("is")) {
- //continue with below check.
- } else {
+ || method.getDeclaringClass().equals(Throwable.class)
+ || !(method.getName().startsWith("get")
+ || method.getName().startsWith("is"))) {
return false;
}
int beginIndex = 3;
@@ -410,19 +406,23 @@ class JAXBContextInitializer extends Ser
} catch (Exception e) {
//getter, but no setter
}
- if ((setter != null)
- && ((setter.isAnnotationPresent(XmlTransient.class)
- || !Modifier.isPublic(setter.getModifiers())))) {
+ if (setter != null) {
+ if (setter.isAnnotationPresent(XmlTransient.class)
+ || !Modifier.isPublic(setter.getModifiers())) {
+ return false;
+ }
+ } else if (!Collection.class.isAssignableFrom(method.getReturnType())
+ && !Throwable.class.isAssignableFrom(method.getDeclaringClass())) {
+ //no setter, it's not a collection (thus getter().add(...)), and
+ //not an Exception,
return false;
-
}
if (accessType == XmlAccessType.NONE
|| accessType == XmlAccessType.FIELD) {
return checkJaxbAnnotation(method.getAnnotations());
- } else {
- return true;
}
+ return true;
}
/**