void (@NotNull PsiParameter parameter, @NotNull Collection<? extends PsiClassType> thrownTypes, @NotNull Consumer<? super HighlightInfo.Builder> errorSink) { List<PsiTypeElement> typeElements = PsiUtil.getParameterTypeElements(parameter); for (PsiTypeElement typeElement : typeElements) { PsiType catchType = typeElement.getType(); if (catchType instanceof PsiClassType && ExceptionUtil.isUncheckedExceptionOrSuperclass((PsiClassType)catchType)) continue; boolean used = false; for (PsiClassType exceptionType : thrownTypes) { if (exceptionType.isAssignableFrom(catchType) || catchType.isAssignableFrom(exceptionType)) { used = true; break; } } if (!used) { String description = JavaErrorBundle.message("exception.never.thrown.try", JavaHighlightUtil.formatType(catchType)); HighlightInfo.Builder builder = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(typeElement).descriptionAndTooltip(description); IntentionAction action = getFixFactory().createDeleteMultiCatchFix(typeElement); builder.registerFix(action, null, null, null, null); errorSink.accept(builder); } } }