Program: 72564
Project: 72564
Buggy source:
/** 
 * Initialize this FMU wrapper. <p>According to "System Design, Modeling, and Simulation Using Ptolemy II", version 1.02, section 12.3.1 "Execution Control": "The initialize action of the setup phase initializes parameters, resets local state, and sends out any initial messages."</p>
 * @exception IllegalActionException If the slave FMU cannot be initialized.
 */
public void initialize() throws IllegalActionException {
  if (_debugging) {
    _debug("String_Node_Str");
  }
  if (_initializables != null) {
    for (    Initializable initializable : _initializables) {
      initializable.initialize();
    }
  }
  if (_debugging) {
    _debugToStdOut(String.format("String_Node_Str",System.identityHashCode(this)));
  }
  int fmiFlag;
  _firstRound=true;
  if (((BooleanToken)initFMUParameters.getToken()).booleanValue()) {
    _initializeFMUParameters();
  }
  _fmiInitialize();
  _checkStateEvents();
  int newDiscreteStatesNeeded=1;
  int terminateSimulation=0;
  int nominalsOfContinuousStatesChanged=0;
  int valuesOfContinuousStatesChanged=0;
  int nextEventTimeDefined=0;
  double nextEventTime=0;
  _eventInfo=new FMI20EventInfo(newDiscreteStatesNeeded,terminateSimulation,nominalsOfContinuousStatesChanged,valuesOfContinuousStatesChanged,nextEventTimeDefined,nextEventTime);
  fmiFlag=((Integer)_fmiNewDiscreteStatesFunction.invoke(Integer.class,new Object[]{_fmiComponent,_eventInfo})).intValue();
  if (fmiFlag != FMILibrary.FMIStatus.fmiOK) {
    throw new IllegalActionException(this,"String_Node_Str" + _fmiStatusDescription(fmiFlag));
  }
  if (_eventInfo.newDiscreteStatesNeeded != 0) {
    new Exception("String_Node_Str").printStackTrace();
  }
  if (_eventInfo.terminateSimulation != 0) {
    getDirector().finish();
  }
  fmiFlag=((Integer)_fmiEnterContinuousTimeModeFunction.invokeInt(new Object[]{_fmiComponent})).intValue();
  if (fmiFlag != FMILibrary.FMIStatus.fmiOK) {
    throw new IllegalActionException(this,"String_Node_Str" + _fmiStatusDescription(fmiFlag));
  }
  _createQSSSolver();
  return;
}

Fixed version (ground truth):
/** 
 * Initialize this FMU wrapper. <p>According to "System Design, Modeling, and Simulation Using Ptolemy II", version 1.02, section 12.3.1 "Execution Control": "The initialize action of the setup phase initializes parameters, resets local state, and sends out any initial messages."</p>
 * @exception IllegalActionException If the slave FMU cannot be initialized.
 */
public void initialize() throws IllegalActionException {
  if (_debugging) {
    _debug("String_Node_Str");
  }
  if (_initializables != null) {
    for (    Initializable initializable : _initializables) {
      initializable.initialize();
    }
  }
  if (_debugging) {
    _debugToStdOut(String.format("String_Node_Str",System.identityHashCode(this)));
  }
  int fmiFlag;
  _firstRound=true;
  if (((BooleanToken)initFMUParameters.getToken()).booleanValue()) {
    _initializeFMUParameters();
  }
  _fmiInitialize();
  _checkStateEvents();
  int newDiscreteStatesNeeded=1;
  int terminateSimulation=0;
  int nominalsOfContinuousStatesChanged=0;
  int valuesOfContinuousStatesChanged=0;
  int nextEventTimeDefined=0;
  double nextEventTime=0;
  _eventInfo=new FMI20EventInfo(newDiscreteStatesNeeded,terminateSimulation,nominalsOfContinuousStatesChanged,valuesOfContinuousStatesChanged,nextEventTimeDefined,nextEventTime);
  if (_fmiNewDiscreteStatesFunction == null) {
    throw new InternalErrorException(this,null,"String_Node_Str" + "String_Node_Str" + "String_Node_Str" + modelExchange + "String_Node_Str"+ _fmiModelDescription.modelExchange);
  }
  fmiFlag=((Integer)_fmiNewDiscreteStatesFunction.invoke(Integer.class,new Object[]{_fmiComponent,_eventInfo})).intValue();
  if (fmiFlag != FMILibrary.FMIStatus.fmiOK) {
    throw new IllegalActionException(this,"String_Node_Str" + _fmiStatusDescription(fmiFlag));
  }
  if (_eventInfo.newDiscreteStatesNeeded != 0) {
    new Exception("String_Node_Str").printStackTrace();
  }
  if (_eventInfo.terminateSimulation != 0) {
    getDirector().finish();
  }
  fmiFlag=((Integer)_fmiEnterContinuousTimeModeFunction.invokeInt(new Object[]{_fmiComponent})).intValue();
  if (fmiFlag != FMILibrary.FMIStatus.fmiOK) {
    throw new IllegalActionException(this,"String_Node_Str" + _fmiStatusDescription(fmiFlag));
  }
  _createQSSSolver();
  return;
}