Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 7bfb4fd35 -> af13152a7
[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/a0ce7bae Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a0ce7bae Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a0ce7bae Branch: refs/heads/3.1.x-fixes Commit: a0ce7bae7656ce3b595404ff3c93160f72bc1c26 Parents: 7bfb4fd Author: Dennis Kieselhorst <d...@apache.org> Authored: Mon Jul 10 20:24:17 2017 +0200 Committer: Dennis Kieselhorst <d...@apache.org> Committed: Mon Jul 10 20:42:17 2017 +0200 ---------------------------------------------------------------------- .../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/a0ce7bae/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]);