code: public String autoQuoteApostropheDeep() {
          if(!needsAutoQuoting) {
              return msg;
          }
          StringBuilder modified=null;
          // Iterate backward so that the insertion indexes do not change.
          int count=countParts();
          for(int i=count; i>0;) {
              Part part;
              if((part=getPart(--i)).getType()==Part.Type.INSERT_CHAR) {
                  if(modified==null) {
                      modified=new StringBuilder(msg.length()+10).append(msg);
                  }
                  modified.insert(part.index, (char)part.value);
              }
          }
          if(modified==null) {
              return msg;
          } else {
              return modified.toString();
          }
      }
docs: Returns a version of the parsed pattern string where each ASCII apostrophe
  is doubled (escaped) if it is not already, and if it is not interpreted as quoting syntax.
  <p>
  For example, this turns "I don't '{know}' {gender,select,female{h''er}other{h'im}}."
  into "I don''t '{know}' {gender,select,female{h''er}other{h''im}}."
  @return the deep-auto-quoted version of the parsed pattern string.
  @see MessageFormat#autoQuoteApostrophe(String)