code: public void applyPattern(String pttrn) {
          try {
              if (msgPattern == null) {
                  msgPattern = new MessagePattern(pttrn);
              } else {
                  msgPattern.parse(pttrn);
              }
              // Cache the formats that are explicitly mentioned in the message pattern.
              cacheExplicitFormats();
          } catch(RuntimeException e) {
              resetPattern();
              throw e;
          }
      }
docs: Sets the pattern used by this message format.
  Parses the pattern and caches Format objects for simple argument types.
  Patterns and their interpretation are specified in the
  <a href="#patterns">class description</a>.
  
  @param pttrn the pattern for this message format
  @throws IllegalArgumentException if the pattern is invalid