public static String formatMessage(String msg, Object... params) {
		try {
			// required by MessageFormat, single quotes break string interpolation!
			msg = StringUtils.replace(msg, "'", "''");
			return StringUtils.isBlank(msg) ? "" : MessageFormat.format(msg, params);
		} catch (IllegalArgumentException e) {
			return msg;
		}
	}
public static String formatMessage ( String msg , Object ... params ) { try { msg = StringUtils . replace ( msg , "'" , "''" ) ; return StringUtils . isBlank ( msg ) ? "" : MessageFormat . format ( msg , params ) ; } catch ( IllegalArgumentException e ) { return msg ; } }
Formats a messages containing {0}, {1}... etc. Used for translation.
@param msg a message with placeholders
@param params objects used to populate the placeholders
@return a formatted message