boolean (PsiMethod method, PsiDocTag docTag) { final PsiDocTagValue valueElement = docTag.getValueElement(); final PsiJavaCodeReferenceElement referenceElement = PsiTreeUtil.findChildOfType(valueElement, PsiJavaCodeReferenceElement.class); if (referenceElement != null) { final PsiElement target = referenceElement.resolve(); if (!(target instanceof PsiClass aClass)) { return false; } if (!InheritanceUtil.isInheritor(aClass, CommonClassNames.JAVA_LANG_EXCEPTION) || InheritanceUtil.isInheritor(aClass, CommonClassNames.JAVA_LANG_RUNTIME_EXCEPTION)) { return false; } final PsiReferenceList throwsList = method.getThrowsList(); final PsiJavaCodeReferenceElement[] elements = throwsList.getReferenceElements(); boolean found = false; for (PsiJavaCodeReferenceElement element : elements) { if (target.equals(element.resolve())) { found = true; } } if (!found){ return false; } } return true; }