@@ -1,4 +1,9 @@
|
||||
/**
|
||||
* Change lookahead for AnnotationMethodDeclaration in AnnotationTypeMemberDeclaration.
|
||||
* Bug #206
|
||||
*
|
||||
* Juan Martin Sotuyo Dodero 01/2017
|
||||
*====================================================================
|
||||
* Allow method references to specify generics.
|
||||
* Bug #207
|
||||
*
|
||||
@@ -2284,7 +2289,7 @@ void AnnotationTypeMemberDeclaration():
|
||||
{
|
||||
modifiers = Modifiers()
|
||||
(
|
||||
LOOKAHEAD(3) AnnotationMethodDeclaration(modifiers)
|
||||
LOOKAHEAD(Type() <IDENTIFIER> "(") AnnotationMethodDeclaration(modifiers)
|
||||
|
|
||||
ClassOrInterfaceDeclaration(modifiers)
|
||||
|
|
||||
|
||||
@@ -143,6 +143,15 @@ public class ParserCornersTest extends ParserTst {
|
||||
parseJava18(c);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBug206() throws Exception {
|
||||
String code = "public @interface Foo {" + PMD.EOL
|
||||
+ "static final ThreadLocal<Interner<Integer>> interner =" + PMD.EOL
|
||||
+ " ThreadLocal.withInitial(Interners::newStrongInterner);" + PMD.EOL
|
||||
+ "}";
|
||||
parseJava18(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* This triggered bug #1484 UnusedLocalVariable - false positive -
|
||||
* parenthesis
|
||||
|
||||
Reference in New Issue
Block a user