private static int compareSignatures(Class<?>[] lhs, Class<?>[] rhs) {
      if (lhs.length < rhs.length) {
        return -1;
      }
      if (lhs.length > rhs.length) {
        return 1;
      }
      int cmp = 0;
      // lhs.length == rhs.length
      final int length = lhs.length;
      for (int p = 0; p < length; ++p) {
        Class<?> actual = lhs[p];
        Class<?> formal = rhs[p];
        if (formal != null && actual != null && !formal.isAssignableFrom(actual)) {
          // if formal parameter is primitive and actual argument is compatible
          int dist;
          if (formal.isPrimitive() && (dist = CONVERTIBLES.get(formal).indexOf(actual)) >= 0) {
            cmp +=  dist;
            continue;
          }
          dist = formal.getName().compareTo(actual.getName());
          if (dist != 0) {
            return dist * (length - p);
          }
        }
      }
      return cmp;
    }
Compare executables parameter signatures.
@param lhs left-hand side executable
@param rhs right-hand side executable
@return 0 if equal, +/- 1 if left &lt;/&gt; than right
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/properties/SerializationProxy.java