From f8e9adf2c55a8f01f85966ba25351792862a18f2 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 1 Jul 2022 14:56:33 +0200 Subject: [PATCH] [java] Fix WhileLoopWithLiteralBoolean tests --- pmd-java/src/main/resources/category/java/bestpractices.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index 2ef92f8b99..7b023fe06d 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -1837,7 +1837,7 @@ a block `{}` is sufficient. [count(BooleanLiteral[@True = false()]) >= 1]] | (: while loops with conditional and'ed boolean literals, maybe parenthesized :) -//WhileStatement[(.|InfixExpression[@Operator=('&', '&&')]) +//WhileStatement[(InfixExpression[@Operator=('&', '&&')]) (: at least one false literal :) [count(BooleanLiteral[@True = false()]) >= 1]] | @@ -1846,7 +1846,7 @@ a block `{}` is sufficient. [count(BooleanLiteral) = 2]] | (: do-while loops with conditional and'ed boolean literals, maybe parenthesized :) -//DoStatement[(.|InfixExpression[@Operator=('&', '&&')]) +//DoStatement[(InfixExpression[@Operator=('&', '&&')]) (: at least one false literal :) [count(BooleanLiteral[@True = false()]) >= 1]] ]]>