Attempts to determine the argument types based on the passed in object instances.
@param args assumed not <code>null</code>.
@return array of argument types.
769750
private Class<?>[] getTypes(Object[] args) {
        if (args == null || args.length == 0) {
            return null;
        }
        List<Class<?>> classList = new ArrayList<Class<?>>();
        for (Object obj : args) {
            classList.add(obj == null ? Object.class : obj.getClass());
        }
        return classList.toArray(new Class[] {});
    }
340769
private static Class<?>[] getParamTypes(Context context, Object... arguments)
    {
        final Collection<Object> params = new ArrayList<>();
        params.add(context);
        params.addAll(Arrays.asList(arguments));
        return UtilReflection.getParamTypes(params.toArray());
    }
1186139
private Object[] getArgumentsValues()
	{
		Argument[] args = getArguments();
		Object[] result = new Object[args.length];
		for (int i = 0; i < args.length; ++i)
		{
			result[i] = args[i].getValue();
		}
		return result;
	}
431508
public static SkbShellArgument[] newArgumentArray(SkbShellArgument ... args){
		if(args==null){
			return null;
		}
		Set<SkbShellArgument> ret = new HashSet<>();
		for(SkbShellArgument arg : args){
			if(arg!=null){
				ret.add(arg);
			}
		}
		return ret.toArray(new SkbShellArgument[args.length]);
	}
444251
public boolean matches(Class<?>[] args) {
        int i;
        Class<?>[] paras;

        paras = getParameterTypes();
        if (args.length != paras.length) {
            return false;
        }
        for (i = 0; i < args.length; i++) {
            if (!paras[i].isAssignableFrom(args[i])) {
                return false;
            }
        }
        return true;
    }
674911
public String[] parse(final String[] args) {
    parsed = new HashMap<String, String>(options.size());
    ArrayList<String> unparsed = null;
    for (int i = 0; i < args.length; i++) {
      final String arg = args[i];
      String[] opt = options.get(arg);
      if (opt != null) {  // Perfect match: got --foo
        if (opt[0] != null) {  // This option requires an argument.
          if (++i < args.length) {
            parsed.put(arg, args[i]);
          } else {
            throw new IllegalArgumentException("Missing argument for " + arg);
          }
        } else {
          parsed.put(arg, null);
        }
        continue;
      }
      // Is it a --foo=blah?
      final int equal = arg.indexOf('=', 1);
      if (equal > 0) {  // Looks like so.
        final String name = arg.substring(0, equal);
        opt = options.get(name);
        if (opt != null) {
          parsed.put(name, arg.substring(equal + 1, arg.length()));
          continue;
        }
      }
      // Not a flag.
      if (unparsed == null) {
        unparsed = new ArrayList<String>(args.length - i);
      }
      if (!arg.isEmpty() && arg.charAt(0) == '-') {
        if (arg.length() == 2 && arg.charAt(1) == '-') {  // `--'
          for (i++; i < args.length; i++) {
            unparsed.add(args[i]);
          }
          break;
        }
        throw new IllegalArgumentException("Unrecognized option " + arg);
      }
      unparsed.add(arg);
    }
    if (unparsed != null) {
      return unparsed.toArray(new String[unparsed.size()]);
    } else {
      return new String[0];
    }
  }
978400
public JType []getActualTypeArguments()
  {
    Type []rawArgs = _type.getActualTypeArguments();

    JType []args = new JType[rawArgs.length];
    for (int i = 0; i < args.length; i++) {
      Type type = rawArgs[i];

      if (type instanceof Class) {
        args[i] = _loader.forName(((Class) type).getName());
      }
      else if (type instanceof ParameterizedType)
        args[i] = new JTypeWrapper(_loader, (ParameterizedType) type);
      else {
        args[i] = _loader.forName("java.lang.Object");
        // jpa/0gg0
        // throw new IllegalStateException(type.toString());
      }
    }

    return args;
  }
589167
public static Type[] getTypeArguments(Type type) {
        if (!(type instanceof ParameterizedType)) {
            return new Type[0];
        }
        return ((ParameterizedType) type).getActualTypeArguments();
    }
798025
public final int getNumberOfCommandLineArgs() {
        if (commandLine == null) {
            return 0;
        }
        List<?> args = commandLine.getArgList();
        if (args == null) {
            return 0;
        }
        return args.size();
    }
307630
static String getArgumentTypesAsString(Object... arguments) {
        StringBuilder argumentsAsString = new StringBuilder();
        final String noParameters = "<none>";
        if (arguments != null && arguments.length != 0) {
            for (int i = 0; i < arguments.length; i++) {
                String argumentName = null;
                Object argument = arguments[i];

                if (argument instanceof Class<?>) {
                    argumentName = ((Class<?>) argument).getName();
                } else if (argument instanceof Class<?>[] && arguments.length == 1) {
                    Class<?>[] argumentArray = (Class<?>[]) argument;
                    if (argumentArray.length > 0) {
                        for (int j = 0; j < argumentArray.length; j++) {
                            appendArgument(argumentsAsString, j,
                                    argumentArray[j] == null ? "null" : getUnproxyType(argumentArray[j]).getName(),
                                    argumentArray);
                        }
                        return argumentsAsString.toString();
                    } else {
                        argumentName = noParameters;
                    }
                } else if (argument == null) {
                    argumentName = "null";
                } else {
                    argumentName = getUnproxyType(argument).getName();
                }
                appendArgument(argumentsAsString, i, argumentName, arguments);
            }
        } else {
            argumentsAsString.append("<none>");
        }
        return argumentsAsString.toString();
    }
419003
public static Class<?>[] toParameterTypes(Object argument)
	{
		if(!(argument instanceof Object[]))
		{
			Class<?>[] classArgs = {argument.getClass()};
			
			return classArgs;
		}
		
		Object[] arguments = (Object[])argument;
		
		int len = arguments.length;
		
		Class<?>[] parameterTypes = new Class[len];
		
		//get array of inputs

		for (int i = 0; i < len; i++)
		{

			parameterTypes[i] = arguments[i].getClass();   
		}
		return parameterTypes;
	}
682875
public void setArgs(java.util.Collection<CodeGenNodeArg> args) {
        if (args == null) {
            this.args = null;
            return;
        }

        this.args = new java.util.ArrayList<CodeGenNodeArg>(args);
    }
234712
@SafeVarargs
  public final QueryBuilder arguments(Object...args) {
    set(Param.QUERY_ARGS, "");
    queryArgs = args.clone();
    return this;
  }
534082
private static Type[] extractTypeArgumentsFrom(final Map<TypeVariable<?>, Type> mappings, final TypeVariable<?>[] variables) {
        final Type[] result = new Type[variables.length];
        int index = 0;
        for (final TypeVariable<?> var : variables) {
            Validate.isTrue(mappings.containsKey(var), "missing argument mapping for %s", toString(var));
            result[index++] = mappings.get(var);
        }
        return result;
    }
573847
public com.sun.javadoc.Type[] typeArguments() {
        return TypeMaker.getTypes(env, type.getTypeArguments());
    }
341235
protected String getParameters(Object[] args) {
    if (args == null)
      return "";
    StringBuilder sbd = new StringBuilder();
    if (args.length > 0) {
      for (Object i : args) {
        if (i == null) {
          sbd.append("null");
        } else {
          Class clz = i.getClass();
          if (isPrimitive(clz)) {
            sbd.append(evalPrimitive(i));
          } else if (clz.isArray()) {
            evalArray(i, sbd);
          } else if (Collection.class.isAssignableFrom(clz)) {
            Object[] arr = ((Collection<?>) i).toArray();
            evalArray(arr, sbd);
          } else if (i instanceof Date) {
            sbd.append('"').append(formatYmdHis(((Date) i))).append('"');
          } else if (i instanceof IdEntity) {
            sbd.append(i.getClass().getSimpleName()).append("[id=").append(((IdEntity) i).getId()).append(']');
          }else {
            sbd.append(clz.getSimpleName()).append(":OBJ");
          }
        }
        sbd.append(',');
      }
      sbd.setLength(sbd.length() - 1);
    }
    return sbd.toString();
  }
1318444
public static Method[] candidateMethods(Method[] methods, Class<?>[] argTypes) {
        return candidates(methods, collectSignatures(methods), collectVarArgs(methods), argTypes);
    }