From 40bf82244f9925f9aed57f275bd5ca6b039a2887 Mon Sep 17 00:00:00 2001 From: albfernandez Date: Sat, 27 Feb 2016 13:06:15 +0100 Subject: [PATCH] Fix the fix for #1340 --- .../optimizations/UseStringBufferForStringAppendsRule.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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); }