boolean (@NotNull GrField field) { if (field instanceof GrEnumConstant) return true; if (field.getInitializerGroovy() != null) return true; if (isImmutableField(field)) return true; if (isInitializedInTupleConstructor(field)) return true; final boolean isStatic = field.hasModifierProperty(PsiModifier.STATIC); final GrTypeDefinition aClass = ((GrTypeDefinition)field.getContainingClass()); if (aClass == null) return true; GrClassInitializer[] initializers = aClass.getInitializers(); for (GrClassInitializer initializer : initializers) { if (initializer.isStatic() != isStatic) continue; final GrOpenBlock block = initializer.getBlock(); final GroovyControlFlow initializerFlow = buildFlowForField(block); if (VariableInitializationChecker.isVariableDefinitelyInitializedCached(field, block, initializerFlow)) { return true; } } if (isStatic) return false; final GrMethod[] constructors = aClass.getCodeConstructors(); if (constructors.length == 0) return false; Set<GrMethod> initializedConstructors = new HashSet<>(); Set<GrMethod> notInitializedConstructors = new HashSet<>(); NEXT_CONSTR: for (GrMethod constructor : constructors) { if (constructor.getBlock() == null) return false; final List<GrMethod> chained = getChainedConstructors(constructor); NEXT_CHAINED: for (GrMethod method : chained) { if (initializedConstructors.contains(method)) { continue NEXT_CONSTR; } else if (notInitializedConstructors.contains(method)) { continue NEXT_CHAINED; } final GrOpenBlock block = method.getBlock(); assert block != null; final boolean initialized = VariableInitializationChecker.isVariableDefinitelyInitializedCached(field, block, buildFlowForField(block)); if (initialized) { initializedConstructors.add(method); continue NEXT_CONSTR; } else { notInitializedConstructors.add(method); } } return false; } return true; }