GuardLogStatementJavaUtil should not apply to SLF4J Logger
A source code analyzer
Brought to you by:
adangel,
juansotuyo
This will be fixed with PMD 5.3.2 (commit: https://github.com/pmd/pmd/commit/a0d116ca6d205a1ef65bbf02c50ceec84277a2f7)
The rule will ignore any classes, which import something from slf4j. Please note, that your statement is only true, if you use message parameters ("{}") - otherwise you would fall back to string concatenation and this would be done before calling the log method - and then a guard would be necessary.