Andrey Loskutov
-
2017-10-22
- Status: open --> closed-rejected
We are getting this with FindBugs 3.0.1. Here is a minimal test case:
public class Foo {
public static void main(String... args) {
Integer foo = 100;
foo--;
String bar = "bar"; // If this is inlined the warning vanishes
for (int i = 0; i < foo; i++) {
System.err.println(bar);
}
}
}
$ javac -g Foo.java
$ findbugs -low Foo.class
L D DLS: Dead store to i in Foo.main(String[]) At Foo.java:[line 4]
Warnings generated: 1