StreamApiMigration: disallow reassigning counting loop variable

This commit is contained in:
Tagir Valeev
2017-02-20 13:29:52 +07:00
parent c8b6209acf
commit 909f89ab6e
4 changed files with 45 additions and 1 deletions
@@ -0,0 +1,14 @@
// "Replace with collect" "false"
public class Test {
public void test(int n) {
for(int <caret>i=0; i<n; i++) {
i = i * 2;
System.out.println(i);
}
}
public static void main(String[] args) {
new Test().test(20);
}
}
@@ -0,0 +1,16 @@
// "Replace with collect" "false"
public class Test {
public void test(int n) {
for(int <caret>i=0; i<n; i++) {
for(int j=0; j<i; j++) {
j = j * 2;
System.out.println(j);
}
}
}
public static void main(String[] args) {
new Test().test(20);
}
}