public static String nonStrictFormat(String message, Object... formatArgs)
  {
    if (formatArgs == null || formatArgs.length == 0) {
      return message;
    }
    try {
      return String.format(Locale.ENGLISH, message, formatArgs);
    }
    catch (IllegalFormatException e) {
      StringBuilder bob = new StringBuilder(message);
      for (Object formatArg : formatArgs) {
        bob.append("; ").append(formatArg);
      }
      return bob.toString();
    }
  }
public static String nonStrictFormat ( String message , Object ... formatArgs ) { if ( formatArgs == null || formatArgs . length == 0 ) { return message ; } try { return String . format ( Locale . ENGLISH , message , formatArgs ) ; } catch ( IllegalFormatException e ) { StringBuilder bob = new StringBuilder ( message ) ; for ( Object formatArg : formatArgs ) { bob . append ( "; " ) . append ( formatArg ) ; } return bob . toString ( ) ; } }
Formats the string as {@link #format(String, Object...)}, but instead of failing on illegal format, returns the
concatenated format string and format arguments. Should be used for unimportant formatting like logging,
exception messages, typically not directly.