copy to final: ensure to walk up through nested lambdas (IDEA-177496)

This commit is contained in:
Anna.Kozlova
2017-08-16 15:35:15 +02:00
parent d98b7936e0
commit dc7edd84fa
3 changed files with 22 additions and 1 deletions
@@ -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);
};
}
}
@@ -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);
};
}
}