PsiSubstitutor () { boolean foundErrorMessage = false; Iterator<List<InferenceVariable>> iterator = InferenceVariablesOrder.resolveOrderIterator(myInferenceVariables, this); while (iterator.hasNext()) { final List<InferenceVariable> variables = iterator.next(); for (InferenceVariable inferenceVariable : variables) { final PsiTypeParameter typeParameter = inferenceVariable.getParameter(); PsiType instantiation = inferenceVariable.getInstantiation(); //failed inference if (instantiation == PsiTypes.nullType()) { if (!foundErrorMessage) { foundErrorMessage = checkBoundsConsistency(mySiteSubstitutor, inferenceVariable) == PsiTypes.nullType(); } mySiteSubstitutor = mySiteSubstitutor .put(typeParameter, JavaPsiFacade.getElementFactory(myManager.getProject()).createType(typeParameter)); } } } return mySiteSubstitutor; }