private String formatArgs(String format,Object... args){
  if (format != null) {
    return String.format(format,args);
  }
 else {
    StringBuilder sb=new StringBuilder();
    for (int i=0, N=args.length; i < N; i++) {
      if (i != 0) {
        sb.append(", ");
      }
      sb.append(args[i]);
    }
    return sb.toString();
  }
}

private String formatArgs ( String format , Object ... args ) { if ( format != null ) { return String . format ( format , args ) ; } else { StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 , N = args . length ; i < N ; i ++ ) { if ( i != 0 ) { sb . append ( ", " ) ; } sb . append ( args [ i ] ) ; } return sb . toString ( ) ; } }
format a string with arguments .
