copy to temp/array for non-effectively final variables used in lambda expressions

This commit is contained in:
Anna Kozlova
2014-04-23 16:33:47 +02:00
parent 265f0dca89
commit c160fc5adf
8 changed files with 63 additions and 50 deletions
@@ -0,0 +1,11 @@
// "Copy 'a' to temp final variable" "true"
class Test {
public void test() {
int a = 1;
a = 2;
final int finalA = a;
Runnable r = () -> {
System.out.println(finalA);
};
}
}
@@ -0,0 +1,10 @@
// "Copy 'a' to temp final variable" "true"
class Test {
public void test() {
int a = 1;
a = 2;
Runnable r = () -> {
System.out.println(<caret>a);
};
}
}