diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/typeresolution/typedefinition/JavaTypeDefinition.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/typeresolution/typedefinition/JavaTypeDefinition.java index e119d55e95..2bc06b2cba 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/typeresolution/typedefinition/JavaTypeDefinition.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/typeresolution/typedefinition/JavaTypeDefinition.java @@ -27,6 +27,7 @@ public class JavaTypeDefinition implements TypeDefinition { final TypeVariable[] typeParameters; if (clazz.isAnonymousClass()) { + // the anonymous class can't have generics, but we may be bounding generics from super classes typeParameters = resolveTypeDefinition(clazz.getGenericSuperclass()).clazz.getTypeParameters(); } else { typeParameters = clazz.getTypeParameters();