Affects PMD Version:
6.36.0
Rule:
InvalidLogMessageFormat
Please provide the rule name and a link to the rule documentation:
https://pmd.github.io/latest/pmd_rules_java_errorprone.html#invalidlogmessageformat
Description:
When using Brooklyn util exception's
getFirstInteresting(java.lang.Throwable throwable) method,
it returns java.lang.Throwable.
Ref. https://brooklyn.apache.org/v/0.6.0/use/api/brooklyn/util/exceptions/Exceptions.html
However, PMD detects it as an argument connected to a placeholder.
Code Sample demonstrating the issue:
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class InvalidLogMessageFormat{
private static final Logger log = LoggerFactory.getLogger(InvalidLogMessageFormat.class);
public void test(){
//detected
log.error("Error starting " + app + ": "+ Exceptions.collapseText(e),Exceptions.getFirstInteresting(e));
}
}
Expected outcome:
PMD should not report any warnings.
That's a false positive because there is no placeholder and the argument is Throwable.
Running PMD through: [CLI]
Affects PMD Version:
6.36.0
Rule:
InvalidLogMessageFormat
Please provide the rule name and a link to the rule documentation:
https://pmd.github.io/latest/pmd_rules_java_errorprone.html#invalidlogmessageformat
Description:
When using
Brooklyn util exception'sgetFirstInteresting(java.lang.Throwable throwable)method,it returns java.lang.Throwable.
Ref. https://brooklyn.apache.org/v/0.6.0/use/api/brooklyn/util/exceptions/Exceptions.html
However, PMD detects it as an argument connected to a placeholder.
Code Sample demonstrating the issue:
Expected outcome:
PMD should not report any warnings.
That's a false positive because there is no
placeholderand the argument isThrowable.Running PMD through: [CLI]