StreamToLoopInspection: reuse existing variable if we should reassign it in loop, but it's possible to use it as non-final

This commit is contained in:
Tagir Valeev
2016-12-23 13:30:08 +07:00
parent 4a2a11c85f
commit 1e33755e09
12 changed files with 147 additions and 27 deletions
@@ -4,11 +4,10 @@ import java.util.List;
public class Main {
public void test(List<String> list) {
long count = 0;
long x = 0;
for (String s : list) {
count++;
x++;
}
long x = count;
System.out.println(x);
System.out.println(x);
}
}