List<PsiClassType> (PsiSubstitutor substitutor, PsiClassType[] thrownExceptions, GlobalSearchScope scope) { final List<PsiClassType> ex = new ArrayList<>(); for (PsiClassType thrownException : thrownExceptions) { final PsiType psiType = PsiClassImplUtil.correctType(substitutor.substitute(thrownException), scope); if (psiType instanceof PsiClassType) { ex.add((PsiClassType)psiType); } else if (psiType instanceof PsiCapturedWildcardType) { final PsiCapturedWildcardType capturedWildcardType = (PsiCapturedWildcardType)psiType; final PsiType upperBound = capturedWildcardType.getUpperBound(); if (upperBound instanceof PsiClassType) { ex.add((PsiClassType)upperBound); } } } return ex; }