diff --git a/pmd/regress/test/net/sourceforge/pmd/rules/loggingjakartacommons/xml/GuardDebugLogging.xml b/pmd/regress/test/net/sourceforge/pmd/rules/loggingjakartacommons/xml/GuardDebugLogging.xml index 60195704bc..65e3f3a4f1 100644 --- a/pmd/regress/test/net/sourceforge/pmd/rules/loggingjakartacommons/xml/GuardDebugLogging.xml +++ b/pmd/regress/test/net/sourceforge/pmd/rules/loggingjakartacommons/xml/GuardDebugLogging.xml @@ -49,6 +49,25 @@ public class Test { __log.debug("bla" + "",e ); } } +} + ]]> + + + + 1 + diff --git a/pmd/rulesets/logging-jakarta-commons.xml b/pmd/rulesets/logging-jakarta-commons.xml index 14afbf300f..0914f09d18 100644 --- a/pmd/rulesets/logging-jakarta-commons.xml +++ b/pmd/rulesets/logging-jakarta-commons.xml @@ -103,7 +103,7 @@ around, with the restriction that the logger needs to be passed into the constru 0 and count(ancestor::IfStatement/descendant::PrimaryExpression[ends-with(descendant::PrimaryPrefix/Name/@Image, 'isDebugEnabled')]) = 0] + //PrimaryPrefix[ends-with(Name/@Image, '.debug') and count(../descendant::AdditiveExpression) > 0 and count(ancestor::IfStatement/Expression/descendant::PrimaryExpression[ends-with(descendant::PrimaryPrefix/Name/@Image, 'isDebugEnabled')]) = 0] ]]>