cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asold...@apache.org
Subject cxf git commit: [CXF-6799] handle arrays of generics - patch by Chris Dolphy
Date Wed, 02 Mar 2016 14:38:54 GMT
Repository: cxf
Updated Branches:
  refs/heads/master a9fe8470c -> 02d826d7a


[CXF-6799] handle arrays of generics - patch by Chris Dolphy


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/02d826d7
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/02d826d7
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/02d826d7

Branch: refs/heads/master
Commit: 02d826d7ad223c75ad706c7b5443bd06ee6e2589
Parents: a9fe847
Author: Alessio Soldano <asoldano@redhat.com>
Authored: Wed Mar 2 15:35:17 2016 +0100
Committer: Alessio Soldano <asoldano@redhat.com>
Committed: Wed Mar 2 15:38:31 2016 +0100

----------------------------------------------------------------------
 .../apache/cxf/jaxb/JAXBContextInitializer.java    | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/02d826d7/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
----------------------------------------------------------------------
diff --git a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
index b7814d8..8415f0e 100644
--- a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
+++ b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
@@ -251,6 +251,21 @@ class JAXBContextInitializer extends ServiceModelVisitor {
             Type componentType = gt.getGenericComponentType();
             if (componentType instanceof Class) {
                 ct = (Class<?>)componentType;
+            } else if (componentType instanceof ParameterizedType) {
+                final ParameterizedType parameterizedType = (ParameterizedType)componentType;
+                final Type rawType = parameterizedType.getRawType();
+                if (rawType instanceof Class) {
+                    ct = (Class<?>)rawType;
+                } else {
+                    throw new IllegalArgumentException("Unable to determine type for " +
rawType);
+                }
+                if (!parameterizedType.getRawType().equals(Enum.class)) {
+                    for (Type t2 : parameterizedType.getActualTypeArguments()) {
+                        if (shouldTypeBeAdded(t2, parameterizedType)) {
+                            addType(t2);
+                        }
+                    }
+                }
             } else {
                 TypeVariable<?> tv = (TypeVariable<?>)componentType;
                 Type[] bounds = tv.getBounds();
@@ -592,4 +607,4 @@ class JAXBContextInitializer extends ServiceModelVisitor {
     }
     
     
-}
\ No newline at end of file
+}


Mime
View raw message