redundant throws: e.g. take different jdks into account

This commit is contained in:
Anna Kozlova
2012-11-04 14:26:16 +01:00
parent 8cc8efd683
commit 9ec8fc3404
@@ -72,6 +72,7 @@ public class RedundantThrows extends GlobalJavaInspectionTool {
PsiJavaCodeReferenceElement[] throwsRefs = psiMethod.getThrowsList().getReferenceElements();
ArrayList<ProblemDescriptor> 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<ProblemDescriptor>(1);
if (refMethod.isAbstract() || refMethod.getOwnerClass().isInterface()) {