Merge branch 'simplify-variable-declarator-id-parsing' of https://github.com/Monits/pmd into pr-118

# Conflicts:
#	pmd-java/etc/grammar/Java.jjt
This commit is contained in:
Andreas Dangel
2016-10-30 18:51:44 +01:00

View File

@ -1,4 +1,9 @@
/**
* Simplify VariableDeclaratorId, forbidding illegal sequences such as
* this[] and MyClass.this[]
*
* Juan Martin Sotuyo Dodero 10/2016
*====================================================================
* Improve lambda detection in PrimaryPrefix to improve parsing performance.
*
* Juan Martin Sotuyo Dodero 10/2016
@ -1429,9 +1434,8 @@ void VariableDeclaratorId() :
{
(LOOKAHEAD(2) t=<IDENTIFIER> "." <THIS> { checkforBadExplicitReceiverParameter(); jjtThis.setExplicitReceiverParameter(); image=t.image + ".this"; }
| t=<THIS> { checkforBadExplicitReceiverParameter(); jjtThis.setExplicitReceiverParameter(); image = t.image;}
| t=<IDENTIFIER> { image = t.image; }
| t=<IDENTIFIER> { image = t.image; } ( "[" "]" { jjtThis.bumpArrayDepth(); })*
)
( "[" "]" { jjtThis.bumpArrayDepth(); })*
{
checkForBadAssertUsage(image, "a variable name");
checkForBadEnumUsage(image, "a variable name");