public static String updateLabels(String instList,LocalVariableMap labelValueMapping) throws DMLRuntimeException {
  if (!instList.contains(Lop.VARIABLE_NAME_PLACEHOLDER))   return instList;
  StringBuilder updateInstList=new StringBuilder();
  String[] ilist=instList.split(Lop.INSTRUCTION_DELIMITOR);
  for (int i=0; i < ilist.length; i++) {
    if (i > 0)     updateInstList.append(Lop.INSTRUCTION_DELIMITOR);
    updateInstList.append(updateInstLabels(ilist[i],labelValueMapping));
  }
  return updateInstList.toString();
}

public static String updateLabels ( String instList , LocalVariableMap labelValueMapping ) throws DMLRuntimeException { if ( ! instList . contains ( Lop . VARIABLE_NAME_PLACEHOLDER ) ) return instList ; StringBuilder updateInstList = new StringBuilder ( ) ; String [ ] ilist = instList . split ( Lop . INSTRUCTION_DELIMITOR ) ; for ( int i = 0 ; i < ilist . length ; i ++ ) { if ( i > 0 ) updateInstList . append ( Lop . INSTRUCTION_DELIMITOR ) ; updateInstList . append ( updateInstLabels ( ilist [ i ] , labelValueMapping ) ) ; } return updateInstList . toString ( ) ; }
takes a delimited string of instructions , and replaces all placeholder labels ( such as # # mvar2 # # and # # var5 # # ) in all instructions .
