Create a simple default formatted string.

@param key which would look up the message in a resource bundle.
@param objects which would be inserted into the message.
@return String the formatted String.
328134
String objectsToString(String key, Object objects) {
        java.io.StringWriter stringWriter = new java.io.StringWriter();
        stringWriter.write(key);
        stringWriter.write(":");

        if (objects == null) {
            stringWriter.write("\n");

        } else if (objects instanceof Object[]) {
            for (int i = 0; i < ((Object[]) objects).length; i++) {
                Object object = ((Object[]) objects)[i];
                if (object == null)
                    stringWriter.write("null\n");
                else {
                    stringWriter.write(((Object[]) objects)[i].toString());
                    stringWriter.write("\n");
                }
            }

        } else {
            stringWriter.write(objects.toString());
            stringWriter.write("\n");
        }

        return stringWriter.toString();
    }
1265660
private String getMessage(String key, Object... args) {
        String message = messages.getString(key);
        return (args.length == 0) ? message : MessageFormat.format(message, args);
    }
889369
protected final <T> String getString(final IKey<T> key) {
        final Object value = config.get(key.key());

        return String.valueOf(value != null ? value : key.getDefaultValue());
    }
342533
public static String getString(final ResourceBundle source, final String key, final String defaultValue)
	{
		try
		{
			return source.getString(key);
		}
		catch (Exception _exception)
		{
			return defaultValue;
		}
	}
441770
public String getAsNullableString(String key) {
		Object value = getAsObject(key);
		return StringConverter.toNullableString(value);
	}
561684
@Override
    public String key(String key, Object arg0) {

        if (hasConfigValue(key)) {
            return getConfigValue(key, new Object[] {arg0});
        }
        return m_messages.key(key, arg0);
    }
751089
public String[] getStringsWithDefault(String key, String[] defaultValue) {
		String[] value = getStrings(key, null);
		if (null == value) {
			value = defaultValue;
		}

		return value;
	}
99414
public static String get(String key, Object... args) {
        try {
            String msg = MessageFormat.format(bundle.getString(key), args);
            if (REPLACE_LINESEP) {
                msg = msg.replace("\n", System.lineSeparator());
            }
            return msg;
        } catch (MissingResourceException e) {
            throw new InternalError("Missing message: " + key, e);
        }
    }
984579
public String formatMessage(String key, Object[] args) {
		try {
			String raw = this.getMessage(key);
			return MessageFormat.format(raw, args);
		} catch (MissingResourceException ex) {
			return "???!"+key+"!???";
		}
	}
502409
public static String getString(String key)
    {
        if (RESOURCE_BUNDLE == null)
            throw new RuntimeException("Localized messages from resource bundle '" + BUNDLE_NAME + "' not loaded during initialization of driver.");

        try
        {
            if (key == null)
                throw new IllegalArgumentException("Message key can not be null");

            String message = RESOURCE_BUNDLE.getString(key);
            if (message == null)
                message = "Missing error message for key '" + key + "'";

            return message;
        }
        catch (MissingResourceException e)
        {
            return '!' + key + '!';
        }
    }
1228459
@Override
    public final String format(String key, ClassAnnotation primaryClass) {
        if ("class.givenClass".equals(key)) {
            return shorten(primaryClass.getPackageName(), className);
        }
        if ("simpleClass".equals(key)) {
            return ClassName.extractSimpleName(className);
        }
        if ("class".equals(key)) {
            return className;
        }
        if ("package".equals(key)) {
            return getPackageName();
        }
        if ("".equals(key) && FindBugsDisplayFeatures.isAbridgedMessages() && primaryClass != null) {
            return formatPackageMember("givenClass", primaryClass);
        }
        return formatPackageMember(key, primaryClass);
    }
711093
public static String message(String key, Object... params) {
        return message(key, null, params);
    }
346046
public String getString(String key) throws MissingResourceException {
        // Error Checking Trace.  Ensure that we got a valid key
        if (key == null) {
            if (tc.isEventEnabled()) {

                // DGH20040823: Begin fix for defect 218797 - Source provided by Tom Musta
                // String msg = messages.getString("NLS.nullKey",
                //                                 "Null lookup key passed to NLS");
                String msg = getMessages().getString("NLS.nullKey",
                                                     "Null lookup key passed to NLS");
                // DGH20040823: End fix for defect 218797 - Source provided by Tom Musta
                Tr.warning(tc, msg);
            }
            return null;
        }
        // Error Checking Trace.  Ensure that we got a valid bundle.
        if (bundle == null) {
            if (tc.isEventEnabled()) {
                // DGH20040823: Begin fix for defect 218797 - Source provided by Tom Musta
                // String msg = messages.getString("NLS.noBundles",
                //                                 "Encountered an internal error. No valid bundles.");
                String msg = getMessages().getString("NLS.noBundles",
                                                     "Encountered an internal error. No valid bundles.");
                // DGH20040823: End fix for defect 218797 - Source provided by Tom Musta
                Tr.warning(tc, msg);
            }
            throw new MissingResourceException(bundleName, bundleName, key);
        }
        // Return Code.
        String rtn = null;
        // Get the resource (string).
        rtn = bundle.getString(key);
        return rtn;
    }
532905
public static String getString(String key, Object... params) {
		String message = getStringSafely(key);
		if (params != null && params.length > 0) {
			return MessageFormat.format(message, params);
		} else {
			return message;
		}
	}
744057
public static String getMessage(String key, Object... args) {
        if (messages == null) {
            if (locale == null)
                locale = Locale.getDefault();
            messages = ResourceBundle.getBundle("com.ibm.ws.install.internal.resources.Repository", locale);
        }
        String message = messages.getString(key);
        if (args.length == 0)
            return message;
        MessageFormat messageFormat = new MessageFormat(message, locale);
        return messageFormat.format(args);
    }
1106614
public String getFormatted(String key, Object... arguments) {
        return MessageFormat.format(resource.getString(key), arguments);
    }
440521
@Override
    public String remove(Object key) {

        String result = m_configurationStrings.remove(key);
        m_configurationObjects.remove(key);
        return result;
    }