Skip to content

Commit

Permalink
Fix some issues introduced in 2.7.1 that caused extra classes to be a…
Browse files Browse the repository at this point in the history
…dded to the JAXBContext that shouldn't be.

git-svn-id: https://svn.apache.org/repos/asf/cxf/trunk@1424005 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
dkulp committed Dec 19, 2012
1 parent 622b482 commit 8e0147d
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,9 @@ static boolean isMethodAccepted(Method method, XmlAccessType accessType) {
// 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;
Expand All @@ -410,19 +406,23 @@ static boolean isMethodAccepted(Method method, XmlAccessType accessType) {
} 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;
}

/**
Expand Down

0 comments on commit 8e0147d

Please sign in to comment.