This commit is contained in:
Bas Leijdekkers
2011-02-22 21:03:35 +01:00
parent 5fa72a60da
commit 766b4e4739
@@ -84,11 +84,14 @@ public class TryWithIdenticalCatchesInspection extends BaseInspection {
boolean[] duplicates = new boolean[catchSections.length];
for (int i = 0; i < catchSections.length; i++) {
if (duplicates[i]) continue;
InputVariables inputVariables = new InputVariables(Collections.singletonList(catchSections[i].getParameter()),
final PsiCatchSection catchSection = catchSections[i];
final PsiCodeBlock catchBlock = catchSection.getCatchBlock();
if (catchBlock == null) continue;
InputVariables inputVariables = new InputVariables(Collections.singletonList(catchSection.getParameter()),
statement.getProject(),
new LocalSearchScope(catchSections[i].getCatchBlock()),
new LocalSearchScope(catchBlock),
false);
DuplicatesFinder finder = new DuplicatesFinder(new PsiElement[] { catchSections [i].getCatchBlock() },
DuplicatesFinder finder = new DuplicatesFinder(new PsiElement[] {catchBlock},
inputVariables, null, Collections.<PsiVariable>emptyList());
for (int j = 0; j < catchSections.length; j++) {
if (i == j || duplicates[j]) continue;