Permalink
Browse files

CMP-912 Wrong handling of annotations on fields which are collections…

… of parametrized type
  • Loading branch information...
1 parent d413749 commit 72daa67b234198fce0a758aa15e28ae86e27cea5 @kimchy committed Jan 8, 2010
@@ -52,7 +52,12 @@ public static Class getCollectionParameterClass(Class<?> clazz, Type type) {
ParameterizedType paramType = (ParameterizedType) type;
Type[] actualTypeArguments = paramType.getActualTypeArguments();
if (actualTypeArguments != null && actualTypeArguments.length == 1) {
- return (Class) actualTypeArguments[0];
+ Type actualType = actualTypeArguments[0];
+ if (actualType instanceof Class) {
+ return (Class) actualTypeArguments[0];
+ } else if (actualType instanceof ParameterizedType) {
+ return (Class) ((ParameterizedType) actualType).getRawType();
+ }
}
}
}

0 comments on commit 72daa67

Please sign in to comment.