Repository: cxf Updated Branches: refs/heads/3.1.x-fixes f116182ef -> 585927421
handle arrays of generics Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/5e7b2c17 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/5e7b2c17 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/5e7b2c17 Branch: refs/heads/3.1.x-fixes Commit: 5e7b2c1700dde193391f994b47abba10dcc0d2b1 Parents: 1c17a94 Author: Chris Dolphy <[email protected]> Authored: Thu Feb 25 22:33:32 2016 -0600 Committer: Chris Dolphy <[email protected]> Committed: Thu Feb 25 22:33:32 2016 -0600 ---------------------------------------------------------------------- .../apache/cxf/jaxb/JAXBContextInitializer.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/5e7b2c17/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 +}
