コード例 #1
0
  private Collection<IMethod> findCorrespondingMethodsInClasses(
      CorrespondingMemberRequest request, Collection<IType> classes) {
    Collection<IMethod> proposedMethods = new LinkedHashSet<IMethod>();

    if (request.shouldReturn(MemberType.TYPE_OR_METHOD)) {
      IMethod currentMethod = request.getCurrentMethod();
      if (currentMethod != null && !classes.isEmpty()) {
        if (request.getMethodSearchMode().searchByName) {
          proposedMethods.addAll(getCorrespondingMethodsInClasses(currentMethod, classes));
        }
        if (request.getMethodSearchMode().searchByCall) {
          proposedMethods.addAll(
              getCallRelationshipFinder(currentMethod, classes)
                  .getMatches(new NullProgressMonitor()));
        }
      }
    }

    return proposedMethods;
  }