Program: 72601
Project: 72601
Buggy source:
/** 
 * Perform co-simulation using the named Functional Mock-up Unit (FMU) file.
 * @param fmuFileName The pathname of the co-simulation .fmu file
 * @param endTime The ending time in seconds.
 * @param stepSize The step size in seconds.
 * @param enableLogging True if logging is enabled.
 * @param csvSeparator The character used for separating fields.Note that sometimes the decimal point in floats is converted to ','.
 * @param outputFileName The output file.
 * @exception Exception If there is a problem parsing the .fmu file or invokingthe methods in the shared library.
 */
@Override public void simulate(String fmuFileName,double endTime,double stepSize,boolean enableLogging,char csvSeparator,String outputFileName) throws Exception {
  _setEnableLogging(enableLogging);
  FMIModelDescription fmiModelDescription=FMUFile.parseFMUFile(fmuFileName);
  _nativeLibrary=fmiModelDescription.getNativeLibrary();
  _modelIdentifier=fmiModelDescription.modelIdentifier;
  String fmuLocation=new File(fmuFileName).toURI().toURL().toString();
  String mimeType="String_Node_Str";
  double timeout=1000;
  byte visible=0;
  int toBeVisibleFMI2=0;
  byte interactive=0;
  byte loggingOn=enableLogging ? (byte)1 : (byte)0;
  int loggingOnFMI2=_enableLogging ? 1 : 0;
  _fmiVersion=Double.valueOf(fmiModelDescription.fmiVersion);
  Pointer fmiComponent=null;
  if (_fmiVersion < 1.5) {
    FMICallbackFunctions.ByValue callbacks=new FMICallbackFunctions.ByValue(new FMULibrary.FMULogger(fmiModelDescription),fmiModelDescription.getFMUAllocateMemory(),new FMULibrary.FMUFreeMemory(),new FMULibrary.FMUStepFinished());
    Function instantiateSlave=fmiModelDescription.getFmiFunction("String_Node_Str");
    System.out.println("String_Node_Str" + instantiateSlave);
    fmiComponent=(Pointer)instantiateSlave.invoke(Pointer.class,new Object[]{_modelIdentifier,fmiModelDescription.guid,fmuLocation,mimeType,timeout,visible,interactive,callbacks,loggingOn});
  }
 else {
    FMICallbackFunctions callbacks=new FMICallbackFunctions(new FMULibrary.FMULogger(fmiModelDescription),new FMULibrary.FMUAllocateMemory(),new FMULibrary.FMUFreeMemory(),new FMULibrary.FMUStepFinished());
    Function fmiInstantiateFunction=fmiModelDescription.getFmiFunction("String_Node_Str");
    byte toBeVisible=0;
    int fmiType=1;
    if (fmiModelDescription.modelExchange) {
      fmiType=0;
    }
    fmiComponent=(Pointer)fmiInstantiateFunction.invoke(Pointer.class,new Object[]{_modelIdentifier,fmiType,fmiModelDescription.guid,fmiModelDescription.fmuResourceLocation,callbacks,toBeVisibleFMI2,loggingOnFMI2});
  }
  if (fmiComponent.equals(Pointer.NULL)) {
    throw new RuntimeException("String_Node_Str");
  }
  if (enableLogging) {
    System.out.println("String_Node_Str");
  }
  double startTime=0;
  if (enableLogging) {
    System.out.println("String_Node_Str");
  }
  if (_fmiVersion < 1.5) {
    invoke(fmiModelDescription,"String_Node_Str",new Object[]{fmiComponent,startTime,(byte)1,endTime},"String_Node_Str");
  }
 else {
    double relativeTolerance=1e-4;
    byte _toleranceControlled=(byte)0;
    invoke(fmiModelDescription,"String_Node_Str",new Object[]{fmiComponent,_toleranceControlled,relativeTolerance,startTime,(byte)1,endTime},"String_Node_Str");
    invoke(fmiModelDescription,"String_Node_Str",new Object[]{fmiComponent},"String_Node_Str");
    invoke(fmiModelDescription,"String_Node_Str",new Object[]{fmiComponent},"String_Node_Str");
  }
  File outputFile=new File(outputFileName);
  PrintStream file=null;
  try {
    file=new PrintStream(outputFileName);
    if (enableLogging) {
      System.out.println("String_Node_Str");
    }
    OutputRow.outputRow(_nativeLibrary,fmiModelDescription,fmiComponent,startTime,file,csvSeparator,Boolean.TRUE);
    OutputRow.outputRow(_nativeLibrary,fmiModelDescription,fmiComponent,startTime,file,csvSeparator,Boolean.FALSE);
    double time=startTime;
    Function doStep=fmiModelDescription.getFmiFunction("String_Node_Str");
    while (time < endTime) {
      if (enableLogging) {
        System.out.println("String_Node_Str" + _modelIdentifier + "String_Node_Str"+ time+ "String_Node_Str"+ stepSize+ "String_Node_Str");
      }
      invoke(doStep,new Object[]{fmiComponent,time,stepSize,(byte)1},"String_Node_Str" + time + "String_Node_Str");
      time+=stepSize;
      OutputRow.outputRow(_nativeLibrary,fmiModelDescription,fmiComponent,time,file,csvSeparator,Boolean.FALSE);
    }
    if (_fmiVersion < 2.0) {
      invoke(fmiModelDescription,"String_Node_Str",new Object[]{fmiComponent},"String_Node_Str");
      Function freeSlave=fmiModelDescription.getFmiFunction("String_Node_Str");
      int fmiFlag=((Integer)freeSlave.invoke(Integer.class,new Object[]{fmiComponent})).intValue();
      if (fmiFlag >= FMILibrary.FMIStatus.fmiWarning) {
        new Exception("String_Node_Str" + fmiFlag).printStackTrace();
      }
    }
 else {
      invoke(fmiModelDescription,"String_Node_Str",new Object[]{fmiComponent},"String_Node_Str");
      invoke(fmiModelDescription,"String_Node_Str",new Object[]{fmiComponent},"String_Node_Str");
    }
  }
  finally {
    if (file != null) {
      file.close();
    }
    if (fmiModelDescription != null) {
      fmiModelDescription.dispose();
    }
  }
  if (enableLogging) {
    System.out.println("String_Node_Str" + outputFile.getCanonicalPath());
    System.out.flush();
  }
}

Fixed version (ground truth):
/** 
 * Perform co-simulation using the named Functional Mock-up Unit (FMU) file.
 * @param fmuFileName The pathname of the co-simulation .fmu file
 * @param endTime The ending time in seconds.
 * @param stepSize The step size in seconds.
 * @param enableLogging True if logging is enabled.
 * @param csvSeparator The character used for separating fields.Note that sometimes the decimal point in floats is converted to ','.
 * @param outputFileName The output file.
 * @exception Exception If there is a problem parsing the .fmu file or invokingthe methods in the shared library.
 */
@Override public void simulate(String fmuFileName,double endTime,double stepSize,boolean enableLogging,char csvSeparator,String outputFileName) throws Exception {
  _setEnableLogging(enableLogging);
  FMIModelDescription fmiModelDescription=FMUFile.parseFMUFile(fmuFileName);
  _nativeLibrary=fmiModelDescription.getNativeLibrary();
  _modelIdentifier=fmiModelDescription.modelIdentifier;
  String fmuLocation=new File(fmuFileName).toURI().toURL().toString();
  String mimeType="String_Node_Str";
  double timeout=1000;
  byte visible=0;
  int toBeVisibleFMI2=0;
  byte interactive=0;
  byte loggingOn=enableLogging ? (byte)1 : (byte)0;
  int loggingOnFMI2=_enableLogging ? 1 : 0;
  _fmiVersion=Double.valueOf(fmiModelDescription.fmiVersion);
  Pointer fmiComponent=null;
  if (_fmiVersion < 1.5) {
    FMICallbackFunctions.ByValue callbacks=new FMICallbackFunctions.ByValue(new FMULibrary.FMULogger(fmiModelDescription),fmiModelDescription.getFMUAllocateMemory(),new FMULibrary.FMUFreeMemory(),new FMULibrary.FMUStepFinished());
    Function instantiateSlave=fmiModelDescription.getFmiFunction("String_Node_Str");
    fmiComponent=(Pointer)instantiateSlave.invoke(Pointer.class,new Object[]{_modelIdentifier,fmiModelDescription.guid,fmuLocation,mimeType,timeout,visible,interactive,callbacks,loggingOn});
  }
 else {
    FMI20CallbackFunctions callbacks20=new FMI20CallbackFunctions(new FMULibrary.FMULogger(fmiModelDescription),fmiModelDescription.getFMUAllocateMemory(),new FMULibrary.FMUFreeMemory(),new FMULibrary.FMUStepFinished(),fmiComponent);
    Function fmiInstantiateFunction=fmiModelDescription.getFmiFunction("String_Node_Str");
    int fmiType=1;
    if (fmiModelDescription.modelExchange) {
      fmiType=0;
    }
    fmiComponent=(Pointer)fmiInstantiateFunction.invoke(Pointer.class,new Object[]{_modelIdentifier,fmiType,fmiModelDescription.guid,fmiModelDescription.fmuResourceLocation,callbacks20,toBeVisibleFMI2,loggingOnFMI2});
  }
  if (fmiComponent.equals(Pointer.NULL)) {
    throw new RuntimeException("String_Node_Str");
  }
  if (enableLogging) {
    System.out.println("String_Node_Str");
  }
  double startTime=0;
  if (enableLogging) {
    System.out.println("String_Node_Str");
  }
  if (_fmiVersion < 1.5) {
    invoke(fmiModelDescription,"String_Node_Str",new Object[]{fmiComponent,startTime,(byte)1,endTime},"String_Node_Str");
  }
 else {
    double relativeTolerance=1e-4;
    byte _toleranceControlled=(byte)0;
    invoke(fmiModelDescription,"String_Node_Str",new Object[]{fmiComponent,_toleranceControlled,relativeTolerance,startTime,(byte)1,endTime},"String_Node_Str");
    invoke(fmiModelDescription,"String_Node_Str",new Object[]{fmiComponent},"String_Node_Str");
    invoke(fmiModelDescription,"String_Node_Str",new Object[]{fmiComponent},"String_Node_Str");
  }
  File outputFile=new File(outputFileName);
  PrintStream file=null;
  try {
    file=new PrintStream(outputFileName);
    if (enableLogging) {
      System.out.println("String_Node_Str");
    }
    OutputRow.outputRow(_nativeLibrary,fmiModelDescription,fmiComponent,startTime,file,csvSeparator,Boolean.TRUE);
    OutputRow.outputRow(_nativeLibrary,fmiModelDescription,fmiComponent,startTime,file,csvSeparator,Boolean.FALSE);
    double time=startTime;
    Function doStep=fmiModelDescription.getFmiFunction("String_Node_Str");
    while (time < endTime) {
      if (enableLogging) {
        System.out.println("String_Node_Str" + _modelIdentifier + "String_Node_Str"+ time+ "String_Node_Str"+ stepSize+ "String_Node_Str");
      }
      invoke(doStep,new Object[]{fmiComponent,time,stepSize,(byte)1},"String_Node_Str" + time + "String_Node_Str");
      time+=stepSize;
      OutputRow.outputRow(_nativeLibrary,fmiModelDescription,fmiComponent,time,file,csvSeparator,Boolean.FALSE);
    }
    if (_fmiVersion < 2.0) {
      invoke(fmiModelDescription,"String_Node_Str",new Object[]{fmiComponent},"String_Node_Str");
      Function freeSlave=fmiModelDescription.getFmiFunction("String_Node_Str");
      int fmiFlag=((Integer)freeSlave.invoke(Integer.class,new Object[]{fmiComponent})).intValue();
      if (fmiFlag >= FMILibrary.FMIStatus.fmiWarning) {
        new Exception("String_Node_Str" + fmiFlag).printStackTrace();
      }
    }
 else {
      invoke(fmiModelDescription,"String_Node_Str",new Object[]{fmiComponent},"String_Node_Str");
      invoke(fmiModelDescription,"String_Node_Str",new Object[]{fmiComponent},"String_Node_Str");
    }
  }
  finally {
    if (file != null) {
      file.close();
    }
    if (fmiModelDescription != null) {
      fmiModelDescription.dispose();
    }
  }
  if (enableLogging) {
    System.out.println("String_Node_Str" + outputFile.getCanonicalPath());
    System.out.flush();
  }
}