diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 9affcbfaa5..0030797848 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -1416,7 +1416,7 @@ void TypeParameter(): void TypeBound(): {} { - "extends" ClassOrInterfaceType() ( "&" ClassOrInterfaceType() )* + "extends" ((Annotation() {checkForBadTypeAnnotations();})*) ClassOrInterfaceType() ( "&" ((Annotation() {checkForBadTypeAnnotations();})*) ClassOrInterfaceType() )* } void ClassOrInterfaceBody(): diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/ast/ParserCornerCases18.java b/pmd-java/src/test/resources/net/sourceforge/pmd/ast/ParserCornerCases18.java index ad7ea6f0a1..70e4fd4c92 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/ast/ParserCornerCases18.java +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/ast/ParserCornerCases18.java @@ -176,6 +176,10 @@ public class ParserCornerCases18 { private byte @Nullable [] getBytes(){ return null; } + + public static > getEnum() { + return null; + } /**