boolean (PsiField field) { PsiClass containingClass = field.getContainingClass(); if (containingClass == null) return false; boolean staticField = field.hasModifierProperty(PsiModifier.STATIC); for (PsiClassInitializer initializer : containingClass.getInitializers()) { if (initializer.getLanguage().isKindOf(JavaLanguage.INSTANCE) && initializer.hasModifierProperty(PsiModifier.STATIC) == staticField && getBlockNotNullFields(initializer.getBody()).contains(field)) { return true; } } if (staticField) return false; PsiMethod[] constructors = containingClass.getConstructors(); if (constructors.length == 0) return false; for (PsiMethod method : constructors) { if (!method.getLanguage().isKindOf(JavaLanguage.INSTANCE) || !getBlockNotNullFields(method.getBody()).contains(field)) { return false; } } return true; }