-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting SLF4J_FORMAT_SHOULD_BE_CONST on error(String msg) #32
Comments
Yes, and currently I have no plan to fix this problem, because it's hard to judge value of argument is CONST or not. |
But it is still a problem! On Fri, Apr 17, 2015 at 6:51 PM, Kengo TODA notifications@github.com
|
A class constant will cause this issue too when passed into a method. This is a serious bug. |
Remove the findbugs warning if you can't apply it accurately, otherwise developers are failing builds which should pass. |
@robertandrewbain @jeffjensen |
Yes, we've already been using the FindBugs exclude filters for the specific On Sat, Apr 18, 2015 at 11:35 PM, Kengo TODA notifications@github.com
|
@jeffjensen @robertandrewbain Note that I tested |
Just verified it still has false positive on Java 7. |
Got it, thanks for your verification. I have a question: is it acceptable for you, to limit scope (visibility) of method to support? I mean, can I keep current behaviour for public & package-private methods? class Foo {
:
:
:
private void log(String string) {
logger.info(string); // VALID; we can verify that all caller do not use dynamically constructed string
}
void packagePrivateLog(String string) {
logger.info(string); // INVALID; we cannot verify that all caller do not use dynamically constructed string
}
public void publicLog(String string) {
logger.info(string); // INVALID; we cannot verify that all caller do not use dynamically constructed string
}
} If so, I will handle this issue in #35. |
Yes, this idea is a much better workaround than using FindBugs filters. I like this rule very much, but it gives too much false positive yet. |
The following code will reproduce the issue:
Maven output to follow:
[INFO] Done FindBugs Analysis....
[INFO]
[INFO] <<< findbugs-maven-plugin:3.0.1:check (default-cli) < :findbugs @ *********** <<<
[INFO]
[INFO] --- findbugs-maven-plugin:3.0.1:check (default-cli) @ * ---
[INFO] BugInstance size is 1
[INFO] Error size is 0
[INFO] Total bugs: 1
[INFO] Format should be constant [.IssueDemonstrator] At IssueDemonstrator.java:[line 13]
[INFO]
The text was updated successfully, but these errors were encountered: