forked from phoedos/pmd
Fixed parsing bug: constant fields in annotation classes
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6071 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
parent
99348a8582
commit
411cf2826f
@ -1,6 +1,7 @@
|
||||
???? - 4.2.2:
|
||||
|
||||
Fixed false positive in UnusedImports: javadoc comments are parsed to check @see and other tags
|
||||
Fixed parsing bug: constant fields in annotation classes
|
||||
|
||||
April 11, 2008 - 4.2.1:
|
||||
|
||||
|
@ -2076,7 +2076,7 @@ void AnnotationTypeMemberDeclaration():
|
||||
|
|
||||
ClassOrInterfaceDeclaration(modifiers)
|
||||
|
|
||||
LOOKAHEAD (<IDENTIFIER> <IDENTIFIER>) EnumDeclaration(modifiers)
|
||||
LOOKAHEAD(3) EnumDeclaration(modifiers)
|
||||
|
|
||||
AnnotationTypeDeclaration(modifiers)
|
||||
|
|
||||
|
@ -117,6 +117,8 @@ public class JDKVersionTest {
|
||||
p.CompilationUnit();
|
||||
p = new TargetJDK1_5().createParser(new StringReader(ANNOTATIONS_BUG));
|
||||
p.CompilationUnit();
|
||||
p = new TargetJDK1_5().createParser(new StringReader(CONSTANT_FIELD_IN_ANNOTATION_BUG));
|
||||
p.CompilationUnit();
|
||||
p = new TargetJDK1_5().createParser(new StringReader(GENERIC_IN_FIELD));
|
||||
p.CompilationUnit();
|
||||
}
|
||||
@ -286,6 +288,11 @@ public class JDKVersionTest {
|
||||
"public @interface Foo {" + PMD.EOL +
|
||||
"}";
|
||||
|
||||
private static final String CONSTANT_FIELD_IN_ANNOTATION_BUG =
|
||||
"public @interface Foo {" + PMD.EOL +
|
||||
" String CONST = \"foo\";" + PMD.EOL +
|
||||
"}";
|
||||
|
||||
private static final String GENERIC_IN_FIELD =
|
||||
"public class Foo {" + PMD.EOL +
|
||||
" Class<Double> foo = (Class<Double>)clazz;" + PMD.EOL +
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user