Java: fix "Move into anonymous object" quick fix problems (EA-139632)

This commit is contained in:
Bas Leijdekkers
2019-03-14 17:08:04 +01:00
parent 0b3062a59f
commit 5f578b9250
5 changed files with 105 additions and 90 deletions

View File

@@ -0,0 +1,11 @@
// "Move 'x' into anonymous object" "true"
class Test {
public void test() {
var ref = new /*1*/ Object() {
int x = 12;
};
Runnable r = () -> {
ref.x++;
};s
}
}

View File

@@ -0,0 +1,11 @@
// "Move 'x' into anonymous object" "true"
class Test {
public void test() {
Object ref = new /*1*/ Object() {
};
int x = 12;
Runnable r = () -> {
<caret>x++;
};s
}
}

View File

@@ -3,7 +3,7 @@ class Test {
public void test() {
var ref = new Object() {
int y = 23;
}
};
int x = 12;
Runnable r = () -> {
<caret>x++;

View File

@@ -6,7 +6,7 @@ class Test {
// 3
int y = 23;
//5
}
};
Runnable r = () -> {
<caret>x/*7*/++;
ref.y++;