SSR: Match multi-catch correctly

This commit is contained in:
Bas Leijdekkers
2015-04-22 18:58:29 +02:00
parent d966c2eb07
commit 75afac2e7a
2 changed files with 19 additions and 1 deletions
@@ -1614,7 +1614,16 @@ public class JavaMatchingVisitor extends JavaElementVisitor {
myMatchingVisitor.setResult(annotations2 != null && myMatchingVisitor.matchInAnyOrder(annotations, annotations2));
if (!myMatchingVisitor.getResult()) return;
}
myMatchingVisitor.setResult(matchType(typeElement, other));
final PsiTypeElement[] typeElementChildren = PsiTreeUtil.getChildrenOfType(typeElement, PsiTypeElement.class);
if (typeElementChildren != null && typeElementChildren.length > 1) {
// multi catch type element
final PsiTypeElement[] typeElementChildren2 = PsiTreeUtil.getChildrenOfType(other, PsiTypeElement.class);
myMatchingVisitor.setResult(
typeElementChildren2 != null && myMatchingVisitor.matchInAnyOrder(typeElementChildren, typeElementChildren2));
}
else {
myMatchingVisitor.setResult(matchType(typeElement, other));
}
}
@Override