mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
VariableAccessFromInnerClassJava10: fix review issues: IDEA-CR-31797
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// "Convert 'x' to field in anonymous class" "true"
|
||||
// "Move 'x' into anonymous object" "true"
|
||||
class Test {
|
||||
public void test() {
|
||||
var ref = new Object() {
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
// "Convert 'x' to field in anonymous class" "true"
|
||||
// "Move 'x' into anonymous object" "true"
|
||||
class Test {
|
||||
public void test() {
|
||||
var ref = new Object() {
|
||||
int x = 12;
|
||||
var /*1*/ ref /*4*/ = new Object() {
|
||||
int /*6*/ x = 12;//2
|
||||
// 3
|
||||
int y = 23;
|
||||
//5
|
||||
};
|
||||
Runnable r = () -> {
|
||||
ref.x++;
|
||||
ref.x/*7*/++;
|
||||
ref.y++;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
// "Convert 'x' to field in anonymous class" "true"
|
||||
class Test {
|
||||
public void test() {
|
||||
var ref1 = new Object() {
|
||||
int x = 12;
|
||||
};
|
||||
var ref = new Object() {
|
||||
int y = 23;
|
||||
}
|
||||
ref.y++;
|
||||
Runnable r = () -> {
|
||||
ref1.x++;
|
||||
ref.y++;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Convert 'x' to field in anonymous class" "true"
|
||||
// "Move 'x' into anonymous object" "true"
|
||||
class Test {
|
||||
public void test() {
|
||||
var ref = new Object() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Convert 'x' to field in anonymous class" "true"
|
||||
// "Move 'x' into anonymous object" "true"
|
||||
class Test {
|
||||
public void test() {
|
||||
var ref = new Object() {
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
// "Convert 'x' to field in anonymous class" "true"
|
||||
// "Move 'x' into anonymous object" "true"
|
||||
class Test {
|
||||
public void test() {
|
||||
int x = 12;
|
||||
var ref = new Object() {
|
||||
int /*6*/ x = 12;
|
||||
var /*1*/ ref /*4*/ = new Object() {//2
|
||||
// 3
|
||||
int y = 23;
|
||||
//5
|
||||
}
|
||||
Runnable r = () -> {
|
||||
<caret>x++;
|
||||
<caret>x/*7*/++;
|
||||
ref.y++;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
// "Convert 'x' to field in anonymous class" "true"
|
||||
class Test {
|
||||
public void test() {
|
||||
int x = 12;
|
||||
var ref = new Object() {
|
||||
int y = 23;
|
||||
}
|
||||
ref.y++;
|
||||
Runnable r = () -> {
|
||||
<caret>x++;
|
||||
ref.y++;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Convert 'x' to field in anonymous class" "true"
|
||||
// "Move 'x' into anonymous object" "true"
|
||||
class Test {
|
||||
public void test() {
|
||||
int x = 12;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Move 'x' into anonymous object" "false"
|
||||
class Test {
|
||||
public void test() {
|
||||
int x = 12;
|
||||
Runnable r = () -> {
|
||||
x<caret>++;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Move 'x' into anonymous object" "false"
|
||||
class Test {
|
||||
public void test() {
|
||||
var x = new Object() {
|
||||
int y = 12;
|
||||
}
|
||||
Runnable r = () -> {
|
||||
x<caret> = null;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Convert 'x' to field in anonymous class" "false"
|
||||
// "Move 'x' into anonymous object" "false"
|
||||
class Test {
|
||||
public void test(int x) {
|
||||
Runnable r = () -> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Convert 'x' to field in anonymous class" "false"
|
||||
// "Move 'x' into anonymous object" "false"
|
||||
class Test {
|
||||
public void test() {
|
||||
Runnable r = () -> {
|
||||
|
||||
Reference in New Issue
Block a user