From ebeab0f445e653a7b2ba6960ad67501ac6fc31c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Wed, 25 Oct 2017 12:57:35 -0300 Subject: [PATCH] [java] Simplify ForLoopShouldBeWhileLoop - Remove checks that will always be true (a node can't be a Type and a Statement and an Expression at the same time) - Simplify count(*) > 1 checks (expensive) for an Expression check (the one node we actually care about) --- pmd-java/src/main/resources/rulesets/java/basic.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pmd-java/src/main/resources/rulesets/java/basic.xml b/pmd-java/src/main/resources/rulesets/java/basic.xml index 05709ec878..8c3fd17259 100644 --- a/pmd-java/src/main/resources/rulesets/java/basic.xml +++ b/pmd-java/src/main/resources/rulesets/java/basic.xml @@ -59,11 +59,10 @@ Some for loops can be simplified to while loops, this makes them more concise. 1] [not(LocalVariableDeclaration)] [not(ForInit)] [not(ForUpdate)] - [not(Type and Expression and Statement)] + [Expression] ]]>