Fix the rule xml WhileLoopWithLiteralBoolean

This commit is contained in:
HoshiNoMei committed 2022-05-28 20:35:19 +08:00
1 parent 459c23a8b6
commit ca562fc133
1 file changed
+4
@@ -2171,13 +2171,16 @@ a block `{}` is sufficient.
<properties>
<property name="xpath">
<value>
<![CDATA[
//DoStatement[Expression/PrimaryExpression/PrimaryPrefix/Literal/BooleanLiteral] |
//WhileStatement[Expression/PrimaryExpression/PrimaryPrefix/Literal/BooleanLiteral[@True = false()]]
]]>
</value>
</property>
<property name="version" value="2.0" />
</properties>
<example>
<![CDATA[
public class Example {
{
while (true) { } // allowed
@@ -2186,6 +2189,7 @@ public class Example {
do { } while (false); // disallowed
}
}
]]>
</example>
</rule>