boolean (PsiExpression call) { String exception = null; if (call instanceof PsiMethodCallExpression) { exception = KNOWN_EXCEPTIONAL_SIDE_EFFECTS.mapFirst((PsiMethodCallExpression)call); } else if (call instanceof PsiMethodReferenceExpression) { exception = KNOWN_EXCEPTIONAL_SIDE_EFFECTS.mapFirst((PsiMethodReferenceExpression)call); } if (exception == null) return false; PsiClass exceptionClass = JavaPsiFacade.getInstance(call.getProject()).findClass(exception, call.getResolveScope()); if (exceptionClass == null) return false; PsiTryStatement parentTry = PsiTreeUtil.getParentOfType(call, PsiTryStatement.class); if (parentTry == null || !PsiTreeUtil.isAncestor(parentTry.getTryBlock(), call, true)) return false; return ContainerUtil.exists(ExceptionUtils.getExceptionTypesHandled(parentTry), type -> InheritanceUtil.isInheritor(exceptionClass, type.getCanonicalText())); }