示例#1
0
 private MethodInformation findMatching(String fqn, ArgumentList al, MethodFinder mf)
     throws IOException {
   Deque<String> typesToCheck = new ArrayDeque<>();
   typesToCheck.addLast(fqn);
   Set<String> visitedTypes = new HashSet<>();
   while (!typesToCheck.isEmpty()) {
     String clz = typesToCheck.removeFirst();
     if (visitedTypes.contains(clz)) continue;
     visitedTypes.add(clz);
     List<MethodInformation> ls = mf.getAlternatives(clz);
     if (ls != null) {
       for (MethodInformation mi : ls) if (match(al, mi)) return mi;
     }
     // not found in current class, try super class
     Optional<List<String>> o = cip.getSuperTypes(clz);
     if (o.isPresent() && mf.mayUseSuperclassMethods()) typesToCheck.addAll(o.get());
   }
   return null;
 }