diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/optimizations/UseStringBufferForStringAppendsRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/optimizations/UseStringBufferForStringAppendsRule.java index a3a96a556b..401936593d 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/optimizations/UseStringBufferForStringAppendsRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/optimizations/UseStringBufferForStringAppendsRule.java @@ -58,10 +58,7 @@ public class UseStringBufferForStringAppendsRule extends AbstractJavaRule { addViolation(data, assignmentOperator); } } else if(astName.getImage().equals(name.getImage())){ - ASTAssignmentOperator assignmentOperator = statement.getFirstDescendantOfType(ASTAssignmentOperator.class); - if (astName.jjtGetParent().jjtGetParent().jjtGetParent().getClass() == ASTEqualityExpression.class) { - continue; - } + ASTAssignmentOperator assignmentOperator = statement.getFirstDescendantOfType(ASTAssignmentOperator.class); if (assignmentOperator != null && !assignmentOperator.isCompound()) { addViolation(data, astName); }