pmd: fixed #1107 PMD 5.0.4 couldn't parse call of parent outer java class method from inner class

This commit is contained in:
Andreas Dangel committed 2013-08-03 21:38:16 +02:00
1 parent 2ad3e5152b
commit 8a32b8e8c4
3 files changed
+26

No files matched your search

+1
View File
@@ -30,6 +30,7 @@ Fixed bug 991: AvoidSynchronizedAtMethodLevel for static methods
Fixed bug 1084: NPE at UselessStringValueOfRule.java:36
Fixed bug 1092: Wrong Attribute "excludemarker" in Ant Task Documentation
Fixed bug 1104: IdempotentOperation false positive
Fixed bug 1107: PMD 5.0.4 couldn't parse call of parent outer java class method from inner class
Fixed bug 1111: False positive: Useless parentheses
Fixed bug 1114: CPD - Tokenizer not initialized with requested properties
Fixed bug 1118: ClassCastException in pmd.lang.ecmascript.ast.ASTElementGet
+1
View File
@@ -1726,6 +1726,7 @@ void PrimaryPrefix() :
void PrimarySuffix() :
{Token t;}
{ LOOKAHEAD(2) "." "this"
| LOOKAHEAD(2) "." "super"
| LOOKAHEAD(2) "." AllocationExpression()
| LOOKAHEAD(3) MemberSelector()
| "[" Expression() "]" {jjtThis.setIsArrayDereference();}
@@ -19,6 +19,30 @@ import org.junit.Test;
public class ParserCornersTest extends ParserTst {
/**
* #1107 PMD 5.0.4 couldn't parse call of parent outer java class method from inner class
* @throws Exception any error
*/
@Test
public void testInnerOuterClass() throws Exception {
parseJava17("/**\n" +
" * @author azagorulko\n" +
" *\n" +
" */\n" +
"public class TestInnerClassCallsOuterParent {\n" +
"\n" +
" public void test() {\n" +
" new Runnable() {\n" +
" @Override\n" +
" public void run() {\n" +
" TestInnerClassCallsOuterParent.super.toString();\n" +
" }\n" +
" };\n" +
" }\n" +
"}\n"
);
}
@Test
public final void testGetFirstASTNameImageNull() throws Throwable {
parseJava14(ABSTRACT_METHOD_LEVEL_CLASS_DECL);