code: protected String protectSpecialChars(String str, boolean debugPrint) {
          String result = str.replace("\\", "\\\\").replace("$", "\\$");
          if (debugPrint) {
              System.out.println("    In NonVoltDBBackend.protectSpecialChars:");
              System.out.println("      str   : " + str);
              System.out.println("      result: " + result);
          }
          return result;
      }
docs: Convenience method: certain methods (e.g. String.replace(...),
  String.replaceFirst(...), Matcher.appendReplacement(...)) will remove
  certain special characters (e.g., '\', '$'); this method adds additional
  backslash characters (\) so that the special characters will be retained
  in the end result, as they originally appeared.