DfType (@NotNull DfaVariableValue thisValue, @Nullable PsiElement context) { DfType dfType = getDfType(thisValue.getQualifier()); // In class initializer this variable is local until escaped if (context != null) { PsiMethod method = ObjectUtils.tryCast(context.getParent(), PsiMethod.class); if (method != null && myQualifier.equals(method.getContainingClass())) { if (myQualifier instanceof PsiEnumConstantInitializer) { PsiEnumConstant constant = ((PsiEnumConstantInitializer)myQualifier).getEnumConstant(); return DfTypes.referenceConstant(constant, TypeConstraints.exactClass(myQualifier)); } if (!method.isConstructor() && MutationSignature.fromMethod(method).preservesThis()) { return dfType.meet(Mutability.UNMODIFIABLE_VIEW.asDfType()); } if (method.isConstructor()) { return dfType.meet(DfTypes.LOCAL_OBJECT); } } if (myQualifier.equals(context)) { return dfType.meet(DfTypes.LOCAL_OBJECT); } } return dfType; }