DfaValue (@NotNull DataFlowInterpreter interpreter, @NotNull DfaMemoryState memState, DfaValue @Nullable [] argValues) { DfaValue value = memState.pop(); if (getContext() instanceof PsiMethodReferenceExpression context && MethodReferenceInstruction.isQualifierDereferenced(context)) { value = CheckNotNullInstruction.dereference( interpreter, memState, value, NullabilityProblemKind.callMethodRefNPE.problem(context, null)); } DfType dfType = memState.getDfType(value); if (getMutationSignature().mutatesThis() && !Mutability.fromDfType(dfType).canBeModified()) { PsiMethod method = getTargetMethod(); // Inferred mutation annotation may infer mutates="this" if invisible state is mutated (e.g. cached hashCode is stored). // So let's conservatively skip the warning here. Such contract is still useful because it assures that nothing else is mutated. if (method != null && JavaMethodContractUtil.hasExplicitContractAnnotation(method)) { interpreter.getListener().onCondition(new MutabilityProblem(getContext(), true), value, ThreeState.YES, memState); memState.updateDfType( value, type -> type instanceof DfReferenceType refType ? refType.dropMutability().meet(Mutability.MUTABLE.asDfType()) : type); } } TypeConstraint constraint = TypeConstraint.fromDfType(dfType); if (!HardcodedContracts.isKnownNoQualifierLeak(getTargetMethod()) && !constraint.isArray() && (constraint.isComparedByEquals() || mayLeakThis(memState, argValues))) { value = JavaDfaHelpers.dropLocality(value, memState); } return value; }