mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 14:25:04 +07:00
copy to final: ensure to walk up through nested lambdas (IDEA-177496)
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// "Copy 'a' to effectively final temp variable" "true"
|
||||
class Test {
|
||||
public void test() {
|
||||
int a = 1;
|
||||
a = 2;
|
||||
int finalA = a;
|
||||
Runnable r = () -> {
|
||||
Runnable rr = () -> System.out.println(finalA);
|
||||
};
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Copy 'a' to effectively final temp variable" "true"
|
||||
class Test {
|
||||
public void test() {
|
||||
int a = 1;
|
||||
a = 2;
|
||||
Runnable r = () -> {
|
||||
Runnable rr = () -> System.out.println(<caret>a);
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user