spotbugs / spotbugs

SpotBugs is FindBugs' successor. A tool for static analysis to look for bugs in Java code.

Home Page:https://spotbugs.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't spot forgotten or wrong-type arguments to String.format() and similar functions

doublep opened this issue · comments

I fairly often forget to pass values to String.format() that I intended to format. This results in exceptions at runtime, but could certainly be cought by static code analysis.

In other words, SpotBugs currently sees no problems in the following code:

    System.out.printf ("x = %d");  // forgot to pass 'x'
    System.out.println (String.format ("x = %d"));  // forgot to pass 'x'

Thanks for opening your first issue here! 😃
Please check our contributing guideline. Especially when you report a problem, make sure you share a Minimal, Complete, and Verifiable example to reproduce it in this issue.