private static boolean parametersAreEquivalent( @Nullable GrParameter parameter1, @Nullable GrParameter parameter2) { if (parameter1 == null || parameter2 == null) { return false; } final PsiType type1 = parameter1.getType(); final PsiType type2 = parameter2.getType(); if (!typesAreEquivalent(type1, type2)) { return false; } final String name1 = parameter1.getName(); final String name2 = parameter2.getName(); if (name1 == null) { return name2 == null; } return name1.equals(name2); }
@Nullable private ExceptionInfo findCatch(PsiType thrownType) { final Iterator<ExceptionInfo> iterator = myCaughtExceptionInfos.descendingIterator(); while (iterator.hasNext()) { final ExceptionInfo info = iterator.next(); final GrCatchClause clause = info.myClause; final GrParameter parameter = clause.getParameter(); if (parameter != null) { final PsiType type = parameter.getType(); if (type.isAssignableFrom(thrownType)) return info; } } return null; }