code: public static String format( String messagePattern, Object argument )
      {
          int j = messagePattern.indexOf( DELIM_START );
          int len = messagePattern.length();
          char escape = 'x';
  
          // if there are no { characters or { is the last character of the messsage
          // then we just return messagePattern
          if( j == -1 || ( j + 1 == len ) )
          {
              return messagePattern;
          }
          else
          {
              if( j + 1 == len )
              {
              }
  
              char delimStop = messagePattern.charAt( j + 1 );
              if( j > 0 )
              {
                  escape = messagePattern.charAt( j - 1 );
              }
              if( ( delimStop != DELIM_STOP ) || ( escape == '\\' ) )
              {
                  // invalid DELIM_START/DELIM_STOP pair or espace character is
                  // present
                  return messagePattern;
              }
              else
              {
                  StringBuffer sbuf = new StringBuffer( len + 20 );
                  sbuf.append( messagePattern.substring( 0, j ) );
                  sbuf.append( argument );
                  sbuf.append( messagePattern.substring( j + 2 ) );
                  return sbuf.toString();
              }
          }
      }
docs: Performs single argument substitution for the 'messagePattern' passed as
  parameter.
  <p>
  For example, <code>MessageFormatter.format("Hi {}.", "there");</code> will
  return the string "Hi there.".
  <p>
  The {} pair is called the formatting element. It serves to designate the
  location where the argument needs to be inserted within the pattern.
  
  @param messagePattern The message pattern which will be parsed and formatted
  @param argument       The argument to be inserted instead of the formatting element
  
  @return The formatted message