String (@NotNull PsiElement element) { final PsiReferenceList referenceList = (PsiReferenceList)element; final PsiClassType[] types = referenceList.getReferencedTypes(); final PsiClass commonSuperClass = findCommonSuperClass(types); if (commonSuperClass == null || !InheritanceUtil.isInheritor(commonSuperClass, CommonClassNames.JAVA_LANG_THROWABLE)) { return null; } return CommonQuickFixBundle.message("fix.replace.with.x", "throws " + commonSuperClass.getName()); }