Final field referenced from anonymous class argument list: continue search instead of return

Fixed: IDEA-208030 False positive Variable might not have been initialized
This commit is contained in:
Tagir Valeev
2019-03-01 19:02:48 +07:00
parent 3c3705da9a
commit eefd518316
3 changed files with 21 additions and 5 deletions
@@ -0,0 +1,15 @@
import java.util.Date;
class C {
private final String s;
C(String s) {
this.s = s;
}
Object m() {
return new Object() {
private final Date d = new Date(s) {}; // reference to s is legal
};
}
}