Browse Source

Fix to correctly determine component type for non-generic arrays.

pull/2/head
Oliver Gierke 15 years ago
parent
commit
f00bfb82bd
  1. 4
      spring-data-commons-core/src/main/java/org/springframework/data/util/ClassTypeInformation.java

4
spring-data-commons-core/src/main/java/org/springframework/data/util/ClassTypeInformation.java

@ -60,6 +60,10 @@ public class ClassTypeInformation extends TypeDiscoverer { @@ -60,6 +60,10 @@ public class ClassTypeInformation extends TypeDiscoverer {
*/
@Override
public TypeInformation getComponentType() {
if (type.isArray()) {
return createInfo(type.getComponentType());
}
TypeVariable<?>[] typeParameters = type.getTypeParameters();
return typeParameters.length > 0 ? new TypeVariableTypeInformation(typeParameters[0], this.getType(), this) : null;

Loading…
Cancel
Save