void (@NotNull PsiMethod method) { super.visitMethod(method); if (ignoreLibraryOverrides && LibraryUtil.isOverrideOfLibraryMethod(method)) { return; } final PsiReferenceList throwsList = method.getThrowsList(); final PsiJavaCodeReferenceElement[] references = throwsList.getReferenceElements(); for (PsiJavaCodeReferenceElement reference : references) { final PsiElement element = reference.resolve(); if (!(element instanceof PsiClass thrownClass)) { continue; } final String qualifiedName = thrownClass.getQualifiedName(); if (qualifiedName != null && exceptions.contains(qualifiedName)) { registerError(reference, reference); } } }