@ -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
|
||||
|
@ -235,6 +235,7 @@ to avoid XSS attacks.
|
||||
* [#183](https://github.com/pmd/pmd/issues/183): \[apex] NCSS Method length is incorrect when using method chaining
|
||||
* java
|
||||
* [#185](https://github.com/pmd/pmd/issues/185): \[java] CPD runs into NPE when analyzing Lucene
|
||||
* [#206](https://github.com/pmd/pmd/issues/206): \[java] Parse error on annotation fields with generics
|
||||
* [#207](https://github.com/pmd/pmd/issues/207): \[java] Parse error on method reference with generics
|
||||
* [#213](https://github.com/pmd/pmd/issues/213): \[java] CPD: OutOfMemory when analyzing Lucene
|
||||
* [#1542](https://sourceforge.net/p/pmd/bugs/1542/): \[java] CPD throws an NPE when parsing enums with -ignore-identifiers
|
||||
|
Reference in New Issue
Block a user