Remove TryStatement from parent blocks

- We should treat appends over the try edge as consecutive, it's only
   catch / finally that maye break the linear execution flow
This commit is contained in:
Juan Martín Sotuyo Dodero
2019-02-05 22:50:11 -03:00
parent 58b52a4fd8
commit 2165fb056c

View File

@ -28,7 +28,6 @@ import net.sourceforge.pmd.lang.java.ast.ASTPrimaryExpression;
import net.sourceforge.pmd.lang.java.ast.ASTPrimarySuffix;
import net.sourceforge.pmd.lang.java.ast.ASTSwitchLabel;
import net.sourceforge.pmd.lang.java.ast.ASTSwitchStatement;
import net.sourceforge.pmd.lang.java.ast.ASTTryStatement;
import net.sourceforge.pmd.lang.java.ast.ASTVariableDeclaratorId;
import net.sourceforge.pmd.lang.java.ast.ASTVariableInitializer;
import net.sourceforge.pmd.lang.java.ast.ASTWhileStatement;
@ -77,7 +76,6 @@ public class ConsecutiveLiteralAppendsRule extends AbstractJavaRule {
BLOCK_PARENTS.add(ASTIfStatement.class);
BLOCK_PARENTS.add(ASTSwitchStatement.class);
BLOCK_PARENTS.add(ASTMethodDeclaration.class);
BLOCK_PARENTS.add(ASTTryStatement.class);
BLOCK_PARENTS.add(ASTCatchStatement.class);
BLOCK_PARENTS.add(ASTFinallyStatement.class);
}