boolean (PsiClass tClass, PsiClassType s, InferenceSession session) { final PsiClassType.ClassResolveResult sResult = s.resolveGenerics(); final PsiClass sClass = sResult.getElement(); if (tClass != null && sClass != null && !(sClass instanceof InferenceVariable)) { final PsiSubstitutor sSubstitutor = TypeConversionUtil.getClassSubstitutor(tClass, sClass, sResult.getSubstitutor()); if (sSubstitutor != null) { if (PsiUtil.isRawSubstitutor(tClass, sSubstitutor)) { return true; } } else if (tClass instanceof InferenceVariable && s.isRaw()) { for (PsiType bound : ((InferenceVariable)tClass).getBounds(InferenceBound.UPPER)) { if (!session.isProperType(bound)) { PsiClass boundClass = PsiUtil.resolveClassInClassTypeOnly(bound); if (InheritanceUtil.isInheritorOrSelf(boundClass, sClass, true)) { return true; } } } } } return false; }