public String format(){
  String result=message;
  for (  Object object : objects) {
    String s=result.replaceFirst("%%",Matcher.quoteReplacement(stringify(object)));
    if (result.equals(s)) {
      throw new IllegalStateException("Too many parameters");
    }
    result=s;
  }
  if (result.contains("%%")) {
    throw new IllegalStateException("Not enough parameters");
  }
  return result;
}

public String format ( ) { String result = message ; for ( Object object : objects ) { String s = result . replaceFirst ( "%%" , Matcher . quoteReplacement ( stringify ( object ) ) ) ; if ( result . equals ( s ) ) { throw new IllegalStateException ( "Too many parameters" ) ; } result = s ; } if ( result . contains ( "%%" ) ) { throw new IllegalStateException ( "Not enough parameters" ) ; } return result ; }
formats the message with the given objects .
