diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index fefd84165f..f3d9cdba16 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -1593,9 +1593,7 @@ void TypeArguments(): void TypeArgument(): {} { - (Annotation() {checkForBadTypeAnnotations();})* ReferenceType() - | - "?" [ WildcardBounds() ] + (Annotation() {checkForBadTypeAnnotations();})* (ReferenceType() | "?" [ WildcardBounds() ]) } void WildcardBounds(): 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 113360f18e..7818b6f8f7 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 @@ -67,17 +67,17 @@ public class ParserCornerCases18 { } Runnable r1 = () -> { System.out.println(this); }; - + public Runnable toDoLater() { return () -> { System.out.println("later"); }; } - + private String doPrivileged(PrivilegedAction action) { return action.run(); } - + private void filterFiles(FileFilter[] filters) { } @@ -165,6 +165,10 @@ public class ParserCornerCases18 { } } + public List<@AnnotatedUsage ?> testWildCardWithAnnotation() { + return null; + } + /** * Explicit receiver Parameters * see: http://blog.joda.org/2015/12/explicit-receiver-parameters.html