boolean (@NotNull PsiMethod method, @Nullable PsiSubstitutor substitutorForMethod, @NotNull PsiType exception, @NotNull PsiSubstitutor substitutorForDerivedClass) { PsiClassType[] thrownExceptions = method.getThrowsList().getReferencedTypes(); for (PsiClassType thrownException1 : thrownExceptions) { PsiType thrownException = substitutorForMethod != null ? substitutorForMethod.substitute(thrownException1) : TypeConversionUtil.erasure(thrownException1); thrownException = substitutorForDerivedClass.substitute(thrownException); if (TypeConversionUtil.isAssignable(thrownException, exception)) return true; } return false; }