boolean (PsiExpression expression, PsiElement body) { List<DfaMemoryState> endOfInitializerStates = new ArrayList<>(); var interceptor = new JavaDfaListener() { @Override public void beforeInstanceInitializerEnd(@NotNull DfaMemoryState state) { endOfInitializerStates.add(state.createCopy()); } }; RunnerResult result = analyzeMethodRecursively(body, interceptor); if (result != RunnerResult.OK) return false; if (body instanceof PsiClass) { PsiMethod ctor = PsiTreeUtil.getParentOfType(expression, PsiMethod.class, true, PsiClass.class, PsiLambdaExpression.class); if (ctor != null && ctor.isConstructor()) { List<DfaMemoryState> initialStates; PsiCodeBlock ctorBody = ctor.getBody(); if (ctorBody != null) { PsiMethodCallExpression call = JavaPsiConstructorUtil.findThisOrSuperCallInConstructor(ctor); if (JavaPsiConstructorUtil.isChainedConstructorCall(call) || (call == null && hasImplicitImpureSuperCall((PsiClass)body, ctor))) { initialStates = Collections.singletonList(createMemoryState()); } else { initialStates = ContainerUtil.map(endOfInitializerStates, DfaMemoryState::createCopy); } return analyzeBlockRecursively(ctorBody, initialStates, interceptor) == RunnerResult.OK; } } } return true; }