mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-17 20:11:25 +07:00
add fix to create field in anonymous class for lambdas: IDEA-189928
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// "Convert 'x' to field in anonymous class" "true"
|
||||
class Test {
|
||||
public void test() {
|
||||
var ref = new Object() {
|
||||
int y = 23;
|
||||
int x = 12;
|
||||
};
|
||||
Runnable r = () -> {
|
||||
ref.x++;
|
||||
ref.y++;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Convert 'x' to field in anonymous class" "true"
|
||||
class Test {
|
||||
public void test() {
|
||||
var ref = new Object() {
|
||||
int x = 12;
|
||||
int y = 23;
|
||||
};
|
||||
Runnable r = () -> {
|
||||
ref.x++;
|
||||
ref.y++;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// "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++;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Convert 'x' to field in anonymous class" "true"
|
||||
class Test {
|
||||
public void test() {
|
||||
var ref = new Object() {
|
||||
int x = 12;
|
||||
};
|
||||
Runnable r = () -> {
|
||||
ref.x++;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Convert 'x' to field in anonymous class" "true"
|
||||
class Test {
|
||||
public void test() {
|
||||
var ref = new Object() {
|
||||
int y = 23;
|
||||
}
|
||||
int x = 12;
|
||||
Runnable r = () -> {
|
||||
<caret>x++;
|
||||
ref.y++;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Convert 'x' to field in anonymous class" "true"
|
||||
class Test {
|
||||
public void test() {
|
||||
int x = 12;
|
||||
var ref = new Object() {
|
||||
int y = 23;
|
||||
}
|
||||
Runnable r = () -> {
|
||||
<caret>x++;
|
||||
ref.y++;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "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++;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Convert 'x' to field in anonymous class" "true"
|
||||
class Test {
|
||||
public void test() {
|
||||
int x = 12;
|
||||
Runnable r = () -> {
|
||||
x<caret>++;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Convert 'x' to field in anonymous class" "false"
|
||||
class Test {
|
||||
public void test(int x) {
|
||||
Runnable r = () -> {
|
||||
x<caret>++;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Convert 'x' to field in anonymous class" "false"
|
||||
class Test {
|
||||
public void test() {
|
||||
Runnable r = () -> {
|
||||
x<caret>++;
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user