diff --git a/pmd/src/net/sourceforge/pmd/symboltable/NameOccurrence.java b/pmd/src/net/sourceforge/pmd/symboltable/NameOccurrence.java index ade27ee221..632d4c8e4b 100644 --- a/pmd/src/net/sourceforge/pmd/symboltable/NameOccurrence.java +++ b/pmd/src/net/sourceforge/pmd/symboltable/NameOccurrence.java @@ -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; }