mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
+3
-4
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user