private boolean applyEquivalenceRelation( @NotNull DfaRelationValue dfaRelation, DfaValue dfaLeft, DfaValue dfaRight) { boolean isNegated = dfaRelation.isNonEquality(); if (!isNegated && !dfaRelation.isEquality()) { return true; } final boolean containsCalls = dfaLeft instanceof DfaVariableValue && ((DfaVariableValue) dfaLeft).containsCalls(); // track "x" property state only inside "if (getX() != null) ..." if (containsCalls && !isNotNull(dfaLeft) && isNull(dfaRight) && !isNegated) { return true; } if (dfaLeft == dfaRight) { return containsCalls || !isNegated; } if (isNull(dfaLeft) && isNotNull(dfaRight) || isNull(dfaRight) && isNotNull(dfaLeft)) { return isNegated; } if (!isNegated) { if (dfaLeft instanceof DfaVariableValue) { updateVarStateOnComparison((DfaVariableValue) dfaLeft, dfaRight); } if (dfaRight instanceof DfaVariableValue) { updateVarStateOnComparison((DfaVariableValue) dfaRight, dfaLeft); } } if (!applyRelation(dfaLeft, dfaRight, isNegated)) { return false; } if (!checkCompareWithBooleanLiteral(dfaLeft, dfaRight, isNegated)) { return false; } if (dfaLeft instanceof DfaVariableValue) { if (!applyUnboxedRelation((DfaVariableValue) dfaLeft, dfaRight, isNegated)) { return false; } if (!applyBoxedRelation((DfaVariableValue) dfaLeft, dfaRight, isNegated)) { return false; } } return true; }