Repository: cxf Updated Branches: refs/heads/3.0.x-fixes e4ae45023 -> 85e82f6f7
[CXF-7441] Type from extended XmlAdapter isn't resolved correctly Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/397cffd0 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/397cffd0 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/397cffd0 Branch: refs/heads/3.0.x-fixes Commit: 397cffd07b6e625d3328e560024ba93b956b73d6 Parents: e4ae450 Author: Dennis Kieselhorst <[email protected]> Authored: Mon Jul 10 20:24:17 2017 +0200 Committer: Daniel Kulp <[email protected]> Committed: Fri Jul 28 12:18:07 2017 -0400 ---------------------------------------------------------------------- .../main/java/org/apache/cxf/jaxrs/utils/JAXBUtils.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/397cffd0/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXBUtils.java ---------------------------------------------------------------------- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXBUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXBUtils.java index aba95d2..4cc91ec 100644 --- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXBUtils.java +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXBUtils.java @@ -89,7 +89,16 @@ public final class JAXBUtils { if (adapter.type() != XmlJavaTypeAdapter.DEFAULT.class) { theType = adapter.type(); } else { - Type[] types = InjectionUtils.getActualTypes(adapter.value().getGenericSuperclass()); + Type topAdapterType = adapter.value().getGenericSuperclass(); + Class<?> superClass = adapter.value().getSuperclass(); + while (superClass != null) { + Class<?> nextSuperClass = superClass.getSuperclass(); + if (nextSuperClass != null && !Object.class.equals(nextSuperClass)) { + topAdapterType = superClass.getGenericSuperclass(); + } + superClass = nextSuperClass; + } + Type[] types = InjectionUtils.getActualTypes(topAdapterType); if (types != null && types.length == 2) { int index = boundType ? 1 : 0; theType = InjectionUtils.getActualType(types[index]);
