DfaInstructionState[] (@NotNull DataFlowInterpreter interpreter, @NotNull DfaMemoryState stateBefore) { DfaValue dfaRight = stateBefore.pop(); DfaValue dfaLeft = stateBefore.pop(); DfaValueFactory factory = interpreter.getFactory(); boolean unknownTargetType = false; DfaCondition condition = null; if (myClassObjectCheck) { PsiType type = stateBefore.getDfType(dfaRight).getConstantOfType(PsiType.class); if (type == null || type instanceof PsiPrimitiveType) { // Unknown/primitive class: just execute contract "null -> false" condition = dfaLeft.cond(RelationType.NE, NULL); unknownTargetType = true; } else { dfaRight = factory.fromDfType(typedObject(type, Nullability.NOT_NULL)); } } if (condition == null) { condition = dfaLeft.cond(RelationType.IS, dfaRight); } ArrayList<DfaInstructionState> states = new ArrayList<>(2); DfType leftType = stateBefore.getDfType(dfaLeft); if (condition.isUnknown()) { pushResult(interpreter, stateBefore, BOOLEAN, dfaLeft, dfaRight); states.add(nextState(interpreter, stateBefore)); } else { final DfaMemoryState trueState = stateBefore.createCopy(); if (trueState.applyCondition(condition)) { pushResult(interpreter, trueState, unknownTargetType ? BOOLEAN : TRUE, dfaLeft, dfaRight); states.add(nextState(interpreter, trueState)); } DfaCondition negated = condition.negate(); if (unknownTargetType ? stateBefore.applyContractCondition(negated) : stateBefore.applyCondition(negated)) { pushResult(interpreter, stateBefore, FALSE, dfaLeft, dfaRight); states.add(nextState(interpreter, stateBefore)); DfaNullability oldNullability = DfaNullability.fromDfType(leftType); DfaNullability newNullability = DfaNullability.fromDfType(stateBefore.getDfType(dfaLeft)); if (newNullability == DfaNullability.NULL && oldNullability == DfaNullability.UNKNOWN) { // Not-instanceof check leaves only "null" possible value in some state: likely the state is ephemeral stateBefore.markEphemeral(); } } } return states.toArray(DfaInstructionState.EMPTY_ARRAY); }