[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)
This commit is contained in:
Juan Martín Sotuyo Dodero
2017-10-25 12:57:35 -03:00
parent 2d15c6dba6
commit ebeab0f445

View File

@ -59,11 +59,10 @@ Some for loops can be simplified to while loops, this makes them more concise.
<property name="xpath">
<value><![CDATA[
//ForStatement
[count(*) > 1]
[not(LocalVariableDeclaration)]
[not(ForInit)]
[not(ForUpdate)]
[not(Type and Expression and Statement)]
[Expression]
]]></value>
</property>
</properties>