List<PsiClassType> (@Nullable PsiElement element, PsiElement topElement, PsiMethod targetMethod) { if (element == null || element == topElement && !(topElement instanceof PsiMethodReferenceExpression)) return null; List<PsiClassType> unhandledExceptions = ExceptionUtil.getUnhandledExceptions(element); if (!filterInProjectExceptions(targetMethod, unhandledExceptions).isEmpty()) { return unhandledExceptions; } if (topElement instanceof PsiMethodReferenceExpression) { return null; } return getUnhandledExceptions(element.getParent(), topElement, targetMethod); }