effectively final check (IDEA-128196)

This commit is contained in:
Anna Kozlova
2014-08-04 15:05:01 +02:00
parent 4d9fed225d
commit 457091952f
2 changed files with 25 additions and 8 deletions

View File

@@ -39,7 +39,7 @@ public class XXX {
void m3(int x, boolean cond) {
int y;
if (cond) y = 1;
foo(() -> x+<error descr="Variable used in lambda expression should be effectively final">y</error>);
foo(() -> x+<error descr="Variable 'y' might not have been initialized">y</error>);
}
void m4(int x, boolean cond) {
@@ -128,3 +128,17 @@ class IDEA114737 {
};
}
}
class IDEA128196 {
void a() {
int value;
try {
value = 1;
} catch (Exception e) {
return;
}
new Thread(() -> System.out.println(value));
}
}