HighlightUsagesHandlerBase<PsiClass> (@NotNull Editor editor, @NotNull PsiFile file, @NotNull PsiElement target, @NotNull PsiElement parent) { FeatureUsageTracker.getInstance().triggerFeatureUsed("codeassists.highlight.throws"); PsiTryStatement tryStatement = ((PsiCatchSection)parent).getTryStatement(); PsiParameter parameter = ((PsiCatchSection)parent).getParameter(); PsiCodeBlock tryBlock = tryStatement.getTryBlock(); PsiResourceList resourceList = tryStatement.getResourceList(); if (parameter == null || tryBlock == null) return null; PsiParameter[] parameters = tryStatement.getCatchBlockParameters(); Predicate<PsiType> filter = type -> { for (PsiParameter p : parameters) { boolean isAssignable = p.getType().isAssignableFrom(type); if (p == parameter) return isAssignable; else if (isAssignable) return false; } return false; }; Stream<PsiClassType> unhandled = ExceptionUtil.collectUnhandledExceptions(tryBlock, tryBlock).stream(); if (resourceList != null) { unhandled = Stream.concat(unhandled, ExceptionUtil.collectUnhandledExceptions(resourceList, resourceList).stream()); } PsiClassType[] types = unhandled.filter(filter).toArray(PsiClassType[]::new); return new HighlightExceptionsHandler(editor, file, target, types, tryBlock, resourceList, filter); }