Program: 133747
Project: 133747
Buggy source:
/** 
 * <!-- begin-UML-doc --> <p> This operation fixes the name of the executable that will be launched. It replaces ${inputFile}, ${installDir} and other keys from the dictionary according to the specification. It also configures the commands to setup the parallel execution environment if indicated by the number of processors or threads. </p> <!-- end-UML-doc -->
 * @return <p>The name of the executable with all variable references and required string replacements fixed. </p>
 * @generated "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
 */
private String fixExecutableName(){
  int numProcs=Math.max(1,Integer.parseInt(execDictionary.get("String_Node_Str")));
  int numTBBThreads=Math.max(1,Integer.parseInt(execDictionary.get("String_Node_Str")));
  String fixedExecutableName=execDictionary.get("String_Node_Str");
  String installDir=execDictionary.get("String_Node_Str");
  String workingDir=execDictionary.get("String_Node_Str");
  String separator="String_Node_Str";
  String shortInputName=null;
  System.out.println("String_Node_Str" + fixedExecutableName);
  if (appendInput) {
    fixedExecutableName+="String_Node_Str";
  }
  fullCMD=fixedExecutableName;
  if (installDir != null && installDir.contains("String_Node_Str")) {
    separator="String_Node_Str";
  }
  if (installDir != null && !installDir.endsWith(separator)) {
    installDir=installDir + separator;
  }
  Enumeration<String> keys=execDictionary.keys();
  String fixedFileName;
  while (keys.hasMoreElements()) {
    String key=keys.nextElement();
    if (key.toLowerCase().endsWith("String_Node_Str")) {
      fixedFileName=execDictionary.get(key);
      if (!isLocal.get()) {
        shortInputName=execDictionary.get(key);
        if (shortInputName.contains("String_Node_Str")) {
          shortInputName=shortInputName.substring(shortInputName.lastIndexOf("String_Node_Str") + 1);
        }
 else         if (shortInputName.contains("String_Node_Str")) {
          shortInputName=shortInputName.substring(shortInputName.lastIndexOf("String_Node_Str") + 1);
        }
        fixedFileName=shortInputName;
        fileMap.put(shortInputName,execDictionary.get(key));
      }
      fixedExecutableName=fixedExecutableName.replace("String_Node_Str" + key + "String_Node_Str",fixedFileName);
    }
  }
  if (fixedExecutableName.contains("String_Node_Str") && installDir != null) {
    fixedExecutableName=fixedExecutableName.replace("String_Node_Str",installDir);
  }
  if (fixedExecutableName.contains("String_Node_Str") && workingDir != null) {
    fixedExecutableName=fixedExecutableName.replace("String_Node_Str",workingDir);
  }
  if (numProcs > 1) {
    if (!execDictionary.get("String_Node_Str").equals("String_Node_Str")) {
      fixedExecutableName="String_Node_Str" + numProcs + "String_Node_Str"+ fixedExecutableName;
    }
 else {
      fixedExecutableName="String_Node_Str" + numProcs + "String_Node_Str"+ fixedExecutableName;
    }
  }
  if (numTBBThreads > 1) {
    fixedExecutableName=fixedExecutableName + "String_Node_Str" + numTBBThreads;
  }
  fixedExecutableName=fixedExecutableName.trim();
  if (!fixedExecutableName.contains("String_Node_Str")) {
    splitCMD.add(fixedExecutableName);
  }
 else {
    for (    String stage : fixedExecutableName.split("String_Node_Str")) {
      splitCMD.add(stage);
    }
  }
  for (int i=0; i < splitCMD.size(); i++) {
    String cmd=splitCMD.get(i);
    System.out.println("String_Node_Str" + i + "String_Node_Str"+ cmd);
  }
  return fixedExecutableName;
}

Fixed version (ground truth):
/** 
 * <!-- begin-UML-doc --> <p> This operation fixes the name of the executable that will be launched. It replaces ${inputFile}, ${installDir} and other keys from the dictionary according to the specification. It also configures the commands to setup the parallel execution environment if indicated by the number of processors or threads. </p> <!-- end-UML-doc -->
 * @return <p>The name of the executable with all variable references and required string replacements fixed. </p>
 * @generated "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
 */
private String fixExecutableName(){
  int numProcs=Math.max(1,Integer.parseInt(execDictionary.get("String_Node_Str")));
  int numTBBThreads=Math.max(1,Integer.parseInt(execDictionary.get("String_Node_Str")));
  String fixedExecutableName=execDictionary.get("String_Node_Str");
  String installDir=execDictionary.get("String_Node_Str");
  String workingDir=execDictionary.get("String_Node_Str");
  String separator="String_Node_Str";
  String shortInputName=null;
  System.out.println("String_Node_Str" + fixedExecutableName);
  if (appendInput) {
    fixedExecutableName+="String_Node_Str";
  }
  fullCMD=fixedExecutableName;
  if (installDir != null && installDir.contains("String_Node_Str")) {
    separator="String_Node_Str";
  }
  if (installDir != null && !installDir.endsWith(separator)) {
    installDir=installDir + separator;
  }
  Enumeration<String> keys=execDictionary.keys();
  String fixedFileName;
  while (keys.hasMoreElements()) {
    String key=keys.nextElement();
    if (key.toLowerCase().endsWith("String_Node_Str")) {
      fixedFileName=execDictionary.get(key);
      shortInputName=execDictionary.get(key);
      if (shortInputName.contains("String_Node_Str")) {
        shortInputName=shortInputName.substring(shortInputName.lastIndexOf("String_Node_Str") + 1);
      }
 else       if (shortInputName.contains("String_Node_Str")) {
        shortInputName=shortInputName.substring(shortInputName.lastIndexOf("String_Node_Str") + 1);
      }
      fixedFileName=shortInputName;
      fileMap.put(shortInputName,execDictionary.get(key));
      fixedExecutableName=fixedExecutableName.replace("String_Node_Str" + key + "String_Node_Str",fixedFileName);
    }
  }
  if (fixedExecutableName.contains("String_Node_Str") && installDir != null) {
    fixedExecutableName=fixedExecutableName.replace("String_Node_Str",installDir);
  }
  if (fixedExecutableName.contains("String_Node_Str") && workingDir != null) {
    fixedExecutableName=fixedExecutableName.replace("String_Node_Str",workingDir);
  }
  if (numProcs > 1) {
    if (!execDictionary.get("String_Node_Str").equals("String_Node_Str")) {
      fixedExecutableName="String_Node_Str" + numProcs + "String_Node_Str"+ fixedExecutableName;
    }
 else {
      fixedExecutableName="String_Node_Str" + numProcs + "String_Node_Str"+ fixedExecutableName;
    }
  }
  if (numTBBThreads > 1) {
    fixedExecutableName=fixedExecutableName + "String_Node_Str" + numTBBThreads;
  }
  fixedExecutableName=fixedExecutableName.trim();
  if (!fixedExecutableName.contains("String_Node_Str")) {
    splitCMD.add(fixedExecutableName);
  }
 else {
    for (    String stage : fixedExecutableName.split("String_Node_Str")) {
      splitCMD.add(stage);
    }
  }
  for (int i=0; i < splitCMD.size(); i++) {
    String cmd=splitCMD.get(i);
    System.out.println("String_Node_Str" + i + "String_Node_Str"+ cmd);
  }
  return fixedExecutableName;
}