field can be local: group by top level blocks (IDEA-121490)

This commit is contained in:
Anna Kozlova
2014-03-18 20:00:56 +01:00
parent f2c905de9a
commit 6af1d4e49a
3 changed files with 44 additions and 1 deletions
@@ -0,0 +1,21 @@
// "Convert to local" "true"
import java.util.ArrayList;
class ITest {
public IntelliJBugConvertToLocal(int x, int z) {
ArrayList<String> mayBeLocal = new ArrayList<String>();
if (x == 5) {
mayBeLocal.add("jjj");
}
if (x > z) {
useIt(mayBeLocal);
}
}
@SuppressWarnings("UnusedParameters")
private void useIt(Object data) {
System.out.println(data);
}
}
@@ -0,0 +1,22 @@
// "Convert to local" "true"
import java.util.ArrayList;
class ITest {
private ArrayList<String> may<caret>BeLocal = new ArrayList<String>();
public IntelliJBugConvertToLocal(int x, int z) {
if (x == 5) {
mayBeLocal.add("jjj");
}
if (x > z) {
useIt(mayBeLocal);
}
}
@SuppressWarnings("UnusedParameters")
private void useIt(Object data) {
System.out.println(data);
}
}