Program: 73077
Project: 73077
Buggy source:
/** 
 * Load the model from the file in the first step. Then, build the model. Finally, run the simulation executable result of buildModel() in order to generate the simulation result.
 * @param fileName File which the model should be loaded from.
 * @param modelicaScript Modelica command.
 * @param modelName Name of the model which should be built.
 * @param fileNamePrefix User preferable name for the result file.
 * @param startTime The start time of simulation.
 * @param stopTime The stop time of simulation.
 * @param numberOfIntervals Number of intervals in the result file.
 * @param tolerance Tolerance used by the integration method.
 * @param method Integration method used for simulation.
 * @param outputFormat Format of the result file.
 * @param variableFilter Filter for variables that should be stored in the result file.
 * @param cflags Any standard C language flags.
 * @param simflags Simulation flags.
 * @throws ConnectException If commands couldn'tbe sent to the (OpenModelic Compiler)OMC.
 * @throws IOException If the executable result of buildModel()couldn't be executed.
 * @throws IllegalActionException 
 */
public void simulateModel(String fileName,String modelicaScript,String modelName,String fileNamePrefix,String startTime,String stopTime,int numberOfIntervals,String tolerance,String method,String outputFormat,String variableFilter,String cflags,String simflags) throws ConnectException, IOException, IllegalActionException {
  String commands=null;
  String systemPath=StringUtilities.getProperty("String_Node_Str");
  String testFilePath=null;
  testFilePath=systemPath + "String_Node_Str" + fileName;
  File file=new File(testFilePath);
  if (file.exists()) {
    if (_omcLogger == null) {
      throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    }
    String loggerInfo="String_Node_Str" + testFilePath + "String_Node_Str";
    _omcLogger.getInfo(loggerInfo);
    _omcCommand=OMCCommand.getInstance();
    _result=_omcCommand.loadFile(testFilePath);
    if (_result.getFirstResult().compareTo("String_Node_Str") != 0 && _result.getError().compareTo("String_Node_Str") == 0) {
      loggerInfo="String_Node_Str" + modelicaScript + "String_Node_Str";
      _omcLogger.getInfo(loggerInfo);
    }
    if (_result.getError().compareTo("String_Node_Str") != 0) {
      loggerInfo="String_Node_Str";
      _omcLogger.getInfo(loggerInfo);
      throw new ConnectException(loggerInfo);
    }
    _omcCommand=OMCCommand.getInstance();
    _result=_omcCommand.loadModelicaModel(modelicaScript);
    if (_result.getFirstResult().compareTo("String_Node_Str") == 0) {
      loggerInfo="String_Node_Str";
      _omcLogger.getInfo(loggerInfo);
    }
    if (_result.getError().compareTo("String_Node_Str") != 0) {
      loggerInfo="String_Node_Str";
      _omcLogger.getInfo(loggerInfo);
      throw new ConnectException(loggerInfo);
    }
    if (fileNamePrefix.compareTo("String_Node_Str") == 0) {
      commands=modelName + "String_Node_Str" + Float.valueOf(startTime).floatValue()+ "String_Node_Str"+ Float.valueOf(stopTime).floatValue()+ "String_Node_Str"+ numberOfIntervals+ "String_Node_Str"+ Float.valueOf(tolerance).floatValue()+ "String_Node_Str"+ method+ "String_Node_Str"+ outputFormat+ "String_Node_Str"+ variableFilter+ "String_Node_Str"+ cflags+ "String_Node_Str"+ simflags+ "String_Node_Str";
    }
 else {
      commands=modelName + "String_Node_Str" + Float.valueOf(startTime).floatValue()+ "String_Node_Str"+ Float.valueOf(stopTime).floatValue()+ "String_Node_Str"+ numberOfIntervals+ "String_Node_Str"+ Float.valueOf(tolerance).floatValue()+ "String_Node_Str"+ method+ "String_Node_Str"+ fileNamePrefix+ "String_Node_Str"+ outputFormat+ "String_Node_Str"+ variableFilter+ "String_Node_Str"+ cflags+ "String_Node_Str"+ simflags+ "String_Node_Str";
    }
    _omcCommand=OMCCommand.getInstance();
    _result=_omcCommand.buildModel(commands);
    if (_result.getFirstResult().compareTo("String_Node_Str") != 0 && _result.getError().compareTo("String_Node_Str") == 0) {
      loggerInfo=modelName + "String_Node_Str";
      _omcLogger.getInfo(loggerInfo);
    }
    if (_result.getError().compareTo("String_Node_Str") != 0) {
      loggerInfo="String_Node_Str";
      _omcLogger.getInfo(loggerInfo);
      throw new ConnectException(loggerInfo);
    }
    String command=null;
switch (OMCProxy.getOs()) {
case WINDOWS:
      command=OMCProxy.workDir.getPath() + "String_Node_Str" + modelName+ "String_Node_Str";
    break;
case UNIX:
  command=OMCProxy.workDir.getPath() + "String_Node_Str" + modelName;
break;
case MAC:
command=OMCProxy.workDir.getPath() + "String_Node_Str" + modelName;
break;
}
Runtime.getRuntime().exec(command,OMCProxy.environmentalVariables,OMCProxy.workDir);
if (fileNamePrefix.compareTo("String_Node_Str") == 0) {
loggerInfo="String_Node_Str" + modelName + "String_Node_Str";
_omcLogger.getInfo(loggerInfo);
}
 else {
loggerInfo="String_Node_Str" + fileNamePrefix + "String_Node_Str";
_omcLogger.getInfo(loggerInfo);
}
}
 else {
String loggerInfo="String_Node_Str" + testFilePath + "String_Node_Str";
_omcLogger.getInfo(loggerInfo);
throw new ConnectException("String_Node_Str" + testFilePath + "String_Node_Str");
}
}

Fixed version (ground truth):
/** 
 * Load the model from the file in the first step. Then, build the model. Finally, run the simulation executable result of buildModel() in order to generate the simulation result.
 * @param fileName File which the model should be loaded from.
 * @param modelicaScript Modelica command.
 * @param modelName Name of the model which should be built.
 * @param fileNamePrefix User preferable name for the result file.
 * @param startTime The start time of simulation.
 * @param stopTime The stop time of simulation.
 * @param numberOfIntervals Number of intervals in the result file.
 * @param tolerance Tolerance used by the integration method.
 * @param method Integration method used for simulation.
 * @param outputFormat Format of the result file.
 * @param variableFilter Filter for variables that should be stored in the result file.
 * @param cflags Any standard C language flags.
 * @param simflags Simulation flags.
 * @throws ConnectException If commands couldn'tbe sent to the (OpenModelic Compiler)OMC.
 * @throws IOException If the executable result of buildModel()couldn't be executed.
 * @throws IllegalActionException 
 */
public void simulateModel(String fileName,String modelicaScript,String modelName,String fileNamePrefix,String startTime,String stopTime,int numberOfIntervals,String tolerance,String method,String outputFormat,String variableFilter,String cflags,String simflags) throws ConnectException, IOException, IllegalActionException {
  String commands=null;
  String systemPath=StringUtilities.getProperty("String_Node_Str");
  String testFilePath=null;
  testFilePath=systemPath + "String_Node_Str" + fileName;
  File file=new File(testFilePath);
  if (file.exists()) {
    if (_omcLogger == null) {
      throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    }
    String loggerInfo="String_Node_Str" + testFilePath + "String_Node_Str";
    _omcLogger.getInfo(loggerInfo);
    _omcCommand=OMCCommand.getInstance();
    _result=_omcCommand.loadFile(testFilePath);
    if (_result.getFirstResult().compareTo("String_Node_Str") != 0 && _result.getError().compareTo("String_Node_Str") == 0) {
      loggerInfo="String_Node_Str" + modelicaScript + "String_Node_Str";
      _omcLogger.getInfo(loggerInfo);
    }
    if (_result.getError().compareTo("String_Node_Str") != 0) {
      loggerInfo="String_Node_Str";
      _omcLogger.getInfo(loggerInfo);
      throw new ConnectException(loggerInfo);
    }
    _result=_omcCommand.loadModelicaModel(modelicaScript);
    if (_result.getFirstResult().compareTo("String_Node_Str") == 0) {
      loggerInfo="String_Node_Str";
      _omcLogger.getInfo(loggerInfo);
    }
    if (_result.getError().compareTo("String_Node_Str") != 0) {
      loggerInfo="String_Node_Str";
      _omcLogger.getInfo(loggerInfo);
      throw new ConnectException(loggerInfo);
    }
    if (fileNamePrefix.compareTo("String_Node_Str") == 0) {
      commands=modelName + "String_Node_Str" + Float.valueOf(startTime).floatValue()+ "String_Node_Str"+ Float.valueOf(stopTime).floatValue()+ "String_Node_Str"+ numberOfIntervals+ "String_Node_Str"+ Float.valueOf(tolerance).floatValue()+ "String_Node_Str"+ method+ "String_Node_Str"+ outputFormat+ "String_Node_Str"+ variableFilter+ "String_Node_Str"+ cflags+ "String_Node_Str"+ simflags+ "String_Node_Str";
    }
 else {
      commands=modelName + "String_Node_Str" + Float.valueOf(startTime).floatValue()+ "String_Node_Str"+ Float.valueOf(stopTime).floatValue()+ "String_Node_Str"+ numberOfIntervals+ "String_Node_Str"+ Float.valueOf(tolerance).floatValue()+ "String_Node_Str"+ method+ "String_Node_Str"+ fileNamePrefix+ "String_Node_Str"+ outputFormat+ "String_Node_Str"+ variableFilter+ "String_Node_Str"+ cflags+ "String_Node_Str"+ simflags+ "String_Node_Str";
    }
    _result=_omcCommand.buildModel(commands);
    if (_result.getFirstResult().compareTo("String_Node_Str") != 0 && _result.getError().compareTo("String_Node_Str") == 0) {
      loggerInfo=modelName + "String_Node_Str";
      _omcLogger.getInfo(loggerInfo);
    }
    if (_result.getError().compareTo("String_Node_Str") != 0) {
      loggerInfo="String_Node_Str";
      _omcLogger.getInfo(loggerInfo);
      throw new ConnectException(loggerInfo);
    }
    String command=null;
switch (OMCProxy.getOs()) {
case WINDOWS:
      command=OMCProxy.workDir.getPath() + "String_Node_Str" + modelName+ "String_Node_Str";
    break;
case UNIX:
  command=OMCProxy.workDir.getPath() + "String_Node_Str" + modelName;
break;
case MAC:
command=OMCProxy.workDir.getPath() + "String_Node_Str" + modelName;
break;
}
Runtime.getRuntime().exec(command,OMCProxy.environmentalVariables,OMCProxy.workDir);
if (fileNamePrefix.compareTo("String_Node_Str") == 0) {
loggerInfo="String_Node_Str" + modelName + "String_Node_Str";
_omcLogger.getInfo(loggerInfo);
}
 else {
loggerInfo="String_Node_Str" + fileNamePrefix + "String_Node_Str";
_omcLogger.getInfo(loggerInfo);
}
}
 else {
String loggerInfo="String_Node_Str" + testFilePath + "String_Node_Str";
_omcLogger.getInfo(loggerInfo);
throw new ConnectException("String_Node_Str" + testFilePath + "String_Node_Str");
}
}