bug fix: detection of extra parenthesis was not correct, selfassigned returned true for more than cases such as '(i)++'

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4852 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Xavier Le Vourch
2006-12-01 07:10:26 +00:00
parent 21ef1a3012
commit 8b527ccfe4

View File

@ -146,7 +146,8 @@ public class NameOccurrence {
// deal with extra parenthesis: "(i)++"
if (p instanceof ASTPrimaryPrefix && p.jjtGetNumChildren() == 1 &&
gp instanceof ASTPrimaryExpression && gp.jjtGetNumChildren() == 1&&
node instanceof ASTExpression && node.jjtGetNumChildren() == 1) {
node instanceof ASTExpression && node.jjtGetNumChildren() == 1 &&
node.jjtGetParent() instanceof ASTPrimaryPrefix && node.jjtGetParent().jjtGetNumChildren() == 1) {
l = node;
continue;
}