code: public static String escapeValueString(String propValue) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "escapeValueString", propValue);
  
      if(propValue != null) {
        // check for unescaped '\' chars
        int nextIndex = 0;
        while((nextIndex = propValue.indexOf('\\', nextIndex)) != -1) {
          char nextChar = (char)-1;
          if ((nextIndex+1)<propValue.length()) nextChar = propValue.charAt(nextIndex + 1);
          if(nextChar != CHAR_BACKSLASH) {
            // add in an escape char
            propValue = propValue.substring(0, nextIndex) + STRING_BACKSLASH + propValue.substring(nextIndex);
          }
          nextIndex += 2; // need to move on by two
        }
  
        // check for unescaped '&' chars
        int startValueAmp = 0;
        int indexOfAmpInValue;
        while((indexOfAmpInValue = propValue.indexOf(STRING_AMPERSAND, startValueAmp)) != -1) {
          int newStartFrom = indexOfAmpInValue;
          char previousAtChar = (char)-1;
          if (indexOfAmpInValue>0) previousAtChar = propValue.charAt(indexOfAmpInValue - 1);
          if(previousAtChar != CHAR_BACKSLASH) {
            // add in an escape char
            propValue = propValue.substring(0, newStartFrom) + STRING_BACKSLASH + propValue.substring(newStartFrom);
          }
          startValueAmp = newStartFrom + 1;
        }
      }
  
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "escapeValueString",  propValue);
      return propValue;
    }
docs: This method is used by encodeMap() to escape &s in the value