public int compareTo(final MethodHandler that) {
    if (this == that) {
      return 0;
    }

    int res = methName.compareTo(that.methName);
    if (res != 0) {
      return res;
    }

    if (pars.size() < that.pars.size()) {
      return -1;
    }

    if (pars.size() > that.pars.size()) {
      return 1;
    }

    Iterator<VariableElement> it = that.pars.iterator();
    for (VariableElement pd : pars) {
      VariableElement thatPd = it.next();

      if (!pd.equals(thatPd)) {
        return 1;
      }
    }

    return 0;
  }
示例#2
0
 private static boolean hasAnyParameterAutoTypeAnnotation(
     ExecutableElement method, VariableElement target_param) {
   for (VariableElement param : method.getParameters()) {
     AutoType auto_type_annotation = param.getAnnotation(AutoType.class);
     if (auto_type_annotation != null) {
       VariableElement type_target_param =
           Utils.findParameter(method, auto_type_annotation.value());
       if (target_param.equals(type_target_param)) {
         return true;
       }
     }
   }
   return false;
 }