Merge branch 'issue-206'

Closes #210 (rebased onto pmd/5.4.x)
This commit is contained in:
Andreas Dangel
2017-01-27 19:50:50 +01:00
3 changed files with 16 additions and 1 deletions
+6 -1
View File
@@ -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