### Question:
VarPoolUtils { public static String convertPythonScriptPlaceholders(String rawScript) throws StringIndexOutOfBoundsException { int len = "${setShareVar(${".length(); int scriptStart = 0; while ((scriptStart = rawScript.indexOf("${setShareVar(${", scriptStart)) != -1) { int start = -1; int end = rawScript.indexOf('}', scriptStart + len); String prop = rawScript.substring(scriptStart + len, end); start = rawScript.indexOf(',', end); end = rawScript.indexOf(')', start); String value = rawScript.substring(start + 1, end); start = rawScript.indexOf('}', start) + 1; end = rawScript.length(); String replaceScript = String.format("print(\"${{setValue({},{})}}\".format(\"%s\",%s))", prop, value); rawScript = rawScript.substring(0, scriptStart) + replaceScript + rawScript.substring(start, end); scriptStart += replaceScript.length(); } return rawScript; }  static Object getTaskNodeLocalParam(TaskNode taskNode, String prop); static void setTaskNodeLocalParams(TaskNode taskNode, String prop, Object value); static void setTaskNodeLocalParams(TaskNode taskNode, Map<String, Object> propToValue); static void convertVarPoolToMap(Map<String, Object> propToValue, String varPool); static String convertPythonScriptPlaceholders(String rawScript);  }### Answer:
@Test public void testConvertPythonScriptPlaceholders() throws Exception { String rawScript = "print(${p1});\n${setShareVar(${p1},3)};\n${setShareVar(${p2},4)};"; rawScript = VarPoolUtils.convertPythonScriptPlaceholders(rawScript); Assert.assertEquals(rawScript, "print(${p1});\n" + "print(\"${{setValue({},{})}}\".format(\"p1\",3));\n" + "print(\"${{setValue({},{})}}\".format(\"p2\",4));"); logger.info(rawScript); }