cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [1/6] cxf git commit: [CXF-7441] Type from extended XmlAdapter isn't resolved correctly
Date Fri, 28 Jul 2017 16:20:58 GMT
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 <deki@apache.org>
Authored: Mon Jul 10 20:24:17 2017 +0200
Committer: Daniel Kulp <dkulp@apache.org>
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]);


Mime
View raw message