code: public static String getMessageString(String msgKey) {
  
          assert (msgKey != null);
  
          try {
  
              return bundle.getString(msgKey);
  
          } catch (MissingResourceException mre) {
              throw new CompilerError(mre.getLocalizedMessage());
          } catch (ClassCastException cce) {
              throw new CompilerError("bundle contains non-string object for key '" + msgKey + "'");
          }
      }
docs: Look up a localized message in the message bundle and return a MessageFormat for it.
  
  @param msgKey key that identifies which message to retrieve
  @return MessageFormat corresponding to the given key