diff --git a/java/java-impl/src/com/intellij/codeInspection/unneededThrows/RedundantThrows.java b/java/java-impl/src/com/intellij/codeInspection/unneededThrows/RedundantThrows.java index 3bf4a4a8f113..11e81f2d6024 100644 --- a/java/java-impl/src/com/intellij/codeInspection/unneededThrows/RedundantThrows.java +++ b/java/java-impl/src/com/intellij/codeInspection/unneededThrows/RedundantThrows.java @@ -72,6 +72,7 @@ public class RedundantThrows extends GlobalJavaInspectionTool { PsiJavaCodeReferenceElement[] throwsRefs = psiMethod.getThrowsList().getReferenceElements(); ArrayList problems = null; + final PsiManager psiManager = psiMethod.getManager(); for (int i = 0; i < throwsList.length; i++) { final PsiClassType throwsType = throwsList[i]; final String throwsClassName = throwsType.getClassName(); @@ -81,7 +82,7 @@ public class RedundantThrows extends GlobalJavaInspectionTool { for (PsiClass s : unThrown) { final PsiClass throwsResolvedType = throwsType.resolve(); - if (Comparing.equal(s, throwsResolvedType)) { + if (psiManager.areElementsEquivalent(s, throwsResolvedType)) { if (problems == null) problems = new ArrayList(1); if (refMethod.isAbstract() || refMethod.getOwnerClass().isInterface()) {