definitely initialized should check order (IDEA-181149)

missed for field initialization; similar to class initializers
This commit is contained in:
Anna.Kozlova
2017-10-25 19:50:25 +02:00
parent 0a88a925c9
commit c415cde83e
3 changed files with 32 additions and 5 deletions
@@ -0,0 +1,21 @@
class TestStaticBlockFinalInitializer {
public static final String BAR;
public static final String XYZ_BEFORE;
public static final String XYZ_BEFORE_1 = <error descr="Variable 'BAR' might not have been initialized">BAR</error>;
static {
XYZ_BEFORE = <error descr="Variable 'BAR' might not have been initialized">BAR</error>;
}
public static final String BAZ = (BAR = "Test");
public static final String XYZ_AFTER;
public static final String XYZ_AFTER_1 = BAR;
static {
XYZ_AFTER = BAR;
}
}