boolean (@NotNull PsiField field) { if (field.hasInitializer()) return true; boolean isFieldStatic = field.hasModifierProperty(PsiModifier.STATIC); PsiClass aClass = field.getContainingClass(); if (aClass != null) { // field might be assigned in the other field initializers if (isFieldInitializedInOtherFieldInitializer(aClass, field, isFieldStatic, Predicates.alwaysTrue())) return true; } PsiClassInitializer[] initializers; if (aClass != null) { initializers = aClass.getInitializers(); } else { return false; } if (isFieldInitializedInClassInitializer(field, isFieldStatic, initializers)) return true; if (isFieldStatic) { return false; } else { // instance field should be initialized at the end of each constructor PsiMethod[] constructors = aClass.getConstructors(); if (constructors.length == 0) return false; nextConstructor: for (PsiMethod constructor : constructors) { PsiCodeBlock ctrBody = constructor.getBody(); if (ctrBody == null) return false; List<PsiMethod> redirectedConstructors = JavaHighlightUtil.getChainedConstructors(constructor); for (PsiMethod redirectedConstructor : redirectedConstructors) { PsiCodeBlock body = redirectedConstructor.getBody(); if (body != null && variableDefinitelyAssignedIn(field, body)) continue nextConstructor; } if (!ctrBody.isValid() || variableDefinitelyAssignedIn(field, ctrBody)) { continue; } return false; } return true; } }