used variable before static initializer (IDEA-166270)

This commit is contained in:
Anna.Kozlova
2017-01-09 18:15:16 +01:00
parent bee91c8d66
commit 7356d1d8c3
2 changed files with 23 additions and 17 deletions
@@ -301,11 +301,20 @@ class DefiniteAssignmentInFinally {
}
class StaticInitializerUsedInAnotherInstanceField {
private final int myEnumerationCacheConstant = ENUMERATION_CACHE_SIZE;
private static final int ourEnumerationCacheConstant = <error descr="Illegal forward reference">ENUMERATION_CACHE_SIZE</error>;
private static final int ourEnumerationCacheConstant = <error descr="Variable 'ENUMERATION_CACHE_SIZE' might not have been initialized">ENUMERATION_CACHE_SIZE</error>;
private static final int ENUMERATION_CACHE_SIZE;
static {
ENUMERATION_CACHE_SIZE = 0;
}
}
class StaticInitializedUsedInAnotherStaticField {
private static final String STRINGS1;
private static final String STRINGS2 = <error descr="Variable 'STRINGS1' might not have been initialized">STRINGS1</error>;
static {
STRINGS1 = "";
}
}