private static <T> Constructor<T>[] typeConstructors(Class<T> clazz) {
      // find the constructors that use a derived DataInput instance as first parameter
      @SuppressWarnings("unchecked")
      Constructor<T>[] mctor = (Constructor<T>[]) clazz.getConstructors();
      List<Constructor<T>> keepers = new ArrayList<>(mctor.length);
      for (Constructor<T> kctor : mctor) {
        Class<?>[] parms = kctor.getParameterTypes();
        if (parms.length > 0 && DataInput.class.isAssignableFrom(parms[0])) {
          kctor.setAccessible(true);
          keepers.add(kctor);
        }
      }
      if (keepers.isEmpty()) {
        throw new ProxyException(clazz + ": serialization proxy can not find suitable constructor");
      }
      // order the array of ctors by comparing their number of parameters
      @SuppressWarnings("unchecked")
      Constructor<T>[] kctors = keepers.toArray((Constructor<T>[]) new Constructor<?>[0]);
      Arrays.sort(kctors, Type::compareSignatures);
      return kctors;
    }
Determines the constructors that take at least a DataInput (as superclass) as first argument.
@param clazz the class whose constructors we seek
@return the constructors
@param <T> the class type
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/properties/SerializationProxy.java