ContractFailExceptionProblem (PsiExpression expression) { if (expression instanceof PsiCallExpression call) { PsiMethod method = call.resolveMethod(); List<? extends MethodContract> contracts = DfaUtil.addRangeContracts(method, JavaMethodContractUtil.getMethodCallContracts(call)); contracts = ContainerUtil.filter(contracts, c -> c.getReturnValue().isFail() && c.getConditions().size() == 1); if (contracts.isEmpty()) return null; DfaValueFactory factory = new DfaValueFactory(expression.getProject()); List<DfaRelation> conditions = new ArrayList<>(); for (MethodContract contract : contracts) { ContractValue condition = contract.getConditions().get(0); DfaCondition conditionValue = condition.fromCall(factory, call); if (conditionValue instanceof DfaRelation) { conditions.add((DfaRelation)conditionValue); } } return new ContractFailExceptionProblem(factory, conditions); } return null; }