boolean (PsiElement element) { PsiTryStatement tryStatement = getTryStatementIfKeyword(element); if (tryStatement == null) { tryStatement = getTryStatementIfParameter(element); } if (tryStatement == null) { return false; } final PsiCodeBlock tryBlock = tryStatement.getTryBlock(); final Set<PsiClassType> exceptionsThrown = ExceptionUtils.calculateExceptionsThrown(tryBlock); ExceptionUtils.calculateExceptionsThrown(tryStatement.getResourceList(), exceptionsThrown); final Set<PsiType> exceptionsCaught = ExceptionUtils.getExceptionTypesHandled(tryStatement); for (PsiType typeThrown : exceptionsThrown) { if (exceptionsCaught.contains(typeThrown)) { continue; } for (PsiType typeCaught : exceptionsCaught) { if (typeCaught.isAssignableFrom(typeThrown)) { return true; } } } return false; }