Convert method parameters to a string.

@param args argument for the invoked method
@return message string
977644
protected String getArguments(Object[] args) {

        if (args == null || args.length == 0) {
            return "";
        }

        StringBuilder sb = new StringBuilder();

        if (args.length == 1) {
            Object arg = args[0];
            String param = getSingleArgParameterAsString(arg);
            String displayParam = getSingleArgDisplayParameter(param);
            if (arg instanceof String) {
                sb.append("\"");
                sb.append(displayParam);
                sb.append("\"");
            } else {
                sb.append(displayParam);
            }
        } else {
            for (int i = 0; i < args.length; i++) {
                Object arg = args[i];
                boolean lastArg = i == args.length - 1;
                String param = getParameterAsString(arg);
                String displayParam = getDisplayParameter(param);
                if (arg instanceof String) {
                    sb.append("\"");
                    sb.append(displayParam);
                    sb.append("\"");
                } else {
                    sb.append(displayParam);
                }

                if (!lastArg) {
                    sb.append(",");
                }
            }
        }

        return sb.toString();
    }
1186150
protected String getArgString(Object arg) {
        //if (arg instanceof LatLong) {
        //    return ((LatLong) arg).getVariableName();
        //} else 
        if (arg instanceof JavascriptObject) {
             return ((JavascriptObject) arg).getVariableName();
           // return ((JavascriptObject) arg).getPropertiesAsString();
        } else if( arg instanceof JavascriptEnum ) {
            return ((JavascriptEnum) arg).getEnumValue().toString();
        } else {
            return arg.toString();
        }
    }
872521
public static String format (Object message, Object... args)
    {
        return new LogBuilder(message, args).toString();
    }
1265660
private String getMessage(String key, Object... args) {
        String message = messages.getString(key);
        return (args.length == 0) ? message : MessageFormat.format(message, args);
    }
770798
public String formatMessage(String key, Object[] args) {
        assert _resourceProvider != null : "Received a null resource provider";
        return _resourceProvider.formatMessage(key, args);
    }
1225094
protected String format(String format, Object... args) {

    if (format == null) {
      return null;
    }
    if (args == null) {
      return format;
    }
    StringBuilder buffer = new StringBuilder();
    int argumentIndex = 0;
    int formatStartIndex = 0;
    while (formatStartIndex >= 0) {
      if (argumentIndex >= args.length) {
        // too few arguments given - append the rest of the format string
        buffer.append(format.substring(formatStartIndex));
        formatStartIndex = -1;
      } else {
        int formatEndIndex = format.indexOf("{}");
        if (formatEndIndex == -1) {
          buffer.append(format.substring(formatStartIndex));
          formatStartIndex = -1;
        } else {
          buffer.append(format.substring(formatStartIndex, formatEndIndex));
          formatStartIndex = formatEndIndex + 2;
          buffer.append(args[argumentIndex++]);
        }
      }
    }
    return buffer.toString();
  }
843384
String format(final String message, final Object[] arguments) {
		StringBuilder builder = new StringBuilder(INITIAL_STRING_BUFFER_CAPACITY);

		int argumentIndex = 0;
		int start = 0;
		int openingCurlyBrackets = 0;

		for (int index = 0; index < message.length(); ++index) {
			char character = message.charAt(index);
			if (character == '{') {
				if (openingCurlyBrackets++ == 0 && start < index) {
					builder.append(message, start, index);
					start = index;
				}
			} else if (character == '}' && openingCurlyBrackets > 0) {
				if (--openingCurlyBrackets == 0) {
					if (argumentIndex < arguments.length) {
						Object argument = arguments[argumentIndex++];
						if (argument instanceof Supplier) {
							argument = ((Supplier<?>) argument).get();
						}

						if (index == start + 1) {
							builder.append(argument);
						} else {
							builder.append(format(message.substring(start + 1, index), argument));
						}
					} else {
						builder.append(message, start, index + 1);
					}

					start = index + 1;
				}
			}
		}

		if (start < message.length()) {
			builder.append(message, start, message.length());
		}

		return builder.toString();
	}
356524
public static void main(String[] args) {
		if (args.length > 0) {
			System.out.printf("%s\n", getFullVersion());
		} else {
			System.out.println(VERSION);
		}
	}
972365
public static String getString(String aKey, Object arg)
    {
        return getString(aKey,new Object[]{arg});
    }
664686
public int parseParameters(String[] args) {

		// check for action
		if (args.length < 1) {
			CliFrontendParser.printHelp(customCommandLines);
			System.out.println("Please specify an action.");
			return 1;
		}

		// get action
		String action = args[0];

		// remove action from parameters
		final String[] params = Arrays.copyOfRange(args, 1, args.length);

		try {
			// do action
			switch (action) {
				case ACTION_RUN:
					run(params);
					return 0;
				case ACTION_LIST:
					list(params);
					return 0;
				case ACTION_INFO:
					info(params);
					return 0;
				case ACTION_CANCEL:
					cancel(params);
					return 0;
				case ACTION_STOP:
					stop(params);
					return 0;
				case ACTION_SAVEPOINT:
					savepoint(params);
					return 0;
				case "-h":
				case "--help":
					CliFrontendParser.printHelp(customCommandLines);
					return 0;
				case "-v":
				case "--version":
					String version = EnvironmentInformation.getVersion();
					String commitID = EnvironmentInformation.getRevisionInformation().commitId;
					System.out.print("Version: " + version);
					System.out.println(commitID.equals(EnvironmentInformation.UNKNOWN) ? "" : ", Commit ID: " + commitID);
					return 0;
				default:
					System.out.printf("\"%s\" is not a valid action.\n", action);
					System.out.println();
					System.out.println("Valid actions are \"run\", \"list\", \"info\", \"savepoint\", \"stop\", or \"cancel\".");
					System.out.println();
					System.out.println("Specify the version option (-v or --version) to print Flink version.");
					System.out.println();
					System.out.println("Specify the help option (-h or --help) to get help on the command.");
					return 1;
			}
		} catch (CliArgsException ce) {
			return handleArgException(ce);
		} catch (ProgramParametrizationException ppe) {
			return handleParametrizationException(ppe);
		} catch (ProgramMissingJobException pmje) {
			return handleMissingJobException();
		} catch (Exception e) {
			return handleError(e);
		}
	}
710558
String messageFormat(String key, Object... args) {
        String rs = getResourceString(key);
        return MessageFormat.format(rs, args);
    }
442128
static public String getString(String msg, char arg)
	{
		return getString(msg, new Object[] { String.valueOf(arg) });
	}
1100178
private Object[] getMethodArgumentValues(WampMessage message, Object... providedArgs)
			throws Exception {

		MethodParameter[] parameters = getMethodParameters();
		Object[] args = new Object[parameters.length];
		int argIndex = 0;
		for (int i = 0; i < parameters.length; i++) {
			MethodParameter parameter = parameters[i];
			parameter.initParameterNameDiscovery(this.parameterNameDiscoverer);
			GenericTypeResolver.resolveParameterType(parameter, getBean().getClass());

			if (this.argumentResolvers.supportsParameter(parameter)) {
				try {
					args[i] = this.argumentResolvers.resolveArgument(parameter, message);
					continue;
				}
				catch (Exception ex) {
					if (this.logger.isTraceEnabled()) {
						this.logger.trace(getArgumentResolutionErrorMessage(
								"Error resolving argument", i), ex);
					}
					throw ex;
				}
			}

			if (providedArgs != null) {
				args[i] = this.methodParameterConverter.convert(parameter,
						providedArgs[argIndex]);
				if (args[i] != null) {
					argIndex++;
					continue;
				}
			}

			if (args[i] == null) {
				String error = getArgumentResolutionErrorMessage(
						"No suitable resolver for argument", i);
				throw new IllegalStateException(error);
			}
		}
		return args;
	}
353636
public static String getString(String aKey, Object[] args)
    {
        assert (aKey != null);

        String pattern = getBundle().getString(aKey);
        if (args == null)
            return pattern;

        MessageFormat format = new MessageFormat(pattern);
        return format.format(args).toString();
    }
204411
public static String format(String msg, Object... args) {

        if (args == null || args.length == 0)
            return msg;

        StringBuilder sb = new StringBuilder();
        int argId = 0;
        for (int i = 0; i < msg.length(); i++) {

            final char c = msg.charAt(i);
            if (c == '{' && msg.charAt(i + 1) == '}') {
                if (args.length > argId) {
                    Object val = args[argId++];
                    if (val == null)
                        sb.append("null");
                    else
                        sb.append(val.toString());
                } else {
                    sb.append("{{MISSING ARG}}");
                }
                i++;
            } else {
                sb.append(c);
            }
        }
        return sb.toString();
    }
198149
protected String generateParameterString(List<Parameter> parameters) {
    if (parameters == null) {
      return "";
    }

    StringBuilder parameterStringBuilder = new StringBuilder();
    boolean first = true;

    for (Parameter parameter : parameters) {
      if (first) {
        first = false;
      } else {
        parameterStringBuilder.append("&");
      }

      parameterStringBuilder.append(urlEncode(parameter.name));
      parameterStringBuilder.append("=");
      parameterStringBuilder.append(urlEncode(parameter.value));
    }

    return parameterStringBuilder.toString();
  }
83338
public static <T> String argsToString(String separator, T... args) {
    StringBuilder sb = new StringBuilder();
    for (T s : args) {
      if (sb.length() != 0) {
        sb.append(separator);
      }
      sb.append(s);
    }
    return sb.toString();
  }