protected void checkArgsSize(ObjectInspector[] arguments, int min, int max)
      throws UDFArgumentLengthException {
    if (arguments.length < min || arguments.length > max) {
      StringBuilder sb = new StringBuilder();
      sb.append(getFuncName());
      sb.append(" requires ");
      if (min == max) {
        sb.append(min);
      } else {
        sb.append(min).append("..").append(max);
      }
      sb.append(" argument(s), got ");
      sb.append(arguments.length);
      throw new UDFArgumentLengthException(sb.toString());
    }
  }
Some information may be set during initialize() which needs to be saved when the UDF is copied.
This will be called by FunctionRegistry.cloneGenericUDF()
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDF.java