Is there a way to configure the Checkstyle, PMD, or FindBugs Maven plugins to detect code like this:
logger.debug("string" + stringVariable);
Instead of:
logger.debug("format string {}", stringVariable);
Excellent question!
I' ve just found a collection of additional rules for findbugs which covers your case (and some more): https://github.com/eller86/findbugs-slf4j
Check SLF4J_FORMAT_SHOULD_BE_CONST
should allow you to find string concatenation inside format string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With