introduce variable: allow introduction of expression from inside for loop if independent from loop vars (IDEA-162911)

This commit is contained in:
Anna.Kozlova
2016-10-21 14:52:31 +02:00
parent cf9d8cd25b
commit 8a276d0bf4
4 changed files with 33 additions and 12 deletions
@@ -0,0 +1,9 @@
class Foo {
void foo(String[] input) {
int temp = input.length;
char[][] board = new char[temp][];
for (int i = 0; i < temp; i++) {
System.out.println(temp);
}
}
}
@@ -0,0 +1,8 @@
class Foo {
void foo(String[] input) {
char[][] board = new char[input.length][];
for (int i = 0; i < input.length; i++) {
System.out.println(<selection>input.length</selection>);
}
}
}