Program: 75327
Project: 75327
Buggy source:
/** 
 * The main function
 * @exception IllegalActionException If an error occurs readingor writing inputs or outputs.
 */
public void fire() throws IllegalActionException {
  super.fire();
  Director director=getDirector();
  _currentTime=director.getCurrentTime();
  int kind=whoTimeout();
  if (kind == -1) {
    if (fromValidateMpdu.hasToken(0)) {
      _inputMessage=(RecordToken)fromValidateMpdu.get(0);
      _messageType=((IntToken)_inputMessage.get("String_Node_Str")).intValue();
      if (_messageType == UseDifs || _messageType == UseEifs) {
        if (_messageType == UseDifs) {
          _dIfs=_dDIfs - _aRxTxTurnaroundTime;
        }
 else         if (_messageType == UseEifs) {
          _dIfs=_dEIfs - _aRxTxTurnaroundTime;
        }
        if (_debugging) {
          _debug("String_Node_Str" + _inputMessage.toString());
        }
        DoubleToken t=(DoubleToken)_inputMessage.get("String_Node_Str");
        double tRxEnd=t.doubleValue();
        _IfsTimer=setTimer(IfsTimeOut,_currentTime + tRxEnd + _dIfs * 1e-6);
      }
    }
 else     if (channelStatus.hasToken(0)) {
      _inputMessage=(RecordToken)channelStatus.get(0);
    }
 else     if (fromFilterMpdu.hasToken(0)) {
      _inputMessage=(RecordToken)fromFilterMpdu.get(0);
    }
    if (_inputMessage != null) {
      _messageType=((IntToken)_inputMessage.get("String_Node_Str")).intValue();
    }
  }
switch (_state) {
case Cs_noNav:
switch (_messageType) {
case Idle:
      _IfsTimer=setTimer(IfsTimeOut,_currentTime + _dIfs * 1e-6);
    _state=Wait_Ifs;
  break;
case SetNav:
if (_setNav()) {
  _state=Cs_Nav;
}
break;
}
break;
case Wait_Ifs:
if (kind == IfsTimeOut) {
_changeStatus(Idle);
_state=noCs_noNav;
}
 else {
switch (_messageType) {
case Busy:
_state=Cs_noNav;
break;
case SetNav:
if (_setNav()) {
_state=noCs_Nav;
}
break;
}
}
break;
case noCs_noNav:
switch (_messageType) {
case Busy:
_changeStatus(Busy);
_state=Cs_noNav;
break;
case SetNav:
if (_setNav()) {
_changeStatus(Busy);
_state=noCs_Nav;
}
break;
}
break;
case Cs_Nav:
if (kind == NavTimeOut) {
_state=Cs_noNav;
}
 else {
if (_messageType == Idle) _state=noCs_Nav;
 else _updateNav();
}
break;
case noCs_Nav:
if (kind == NavTimeOut) {
_IfsTimer=setTimer(IfsTimeOut,_currentTime + _dIfs * 1e-6);
_state=Wait_Ifs;
}
 else {
if (_messageType == Busy) _state=Cs_Nav;
 else _updateNav();
}
break;
}
_inputMessage=null;
_messageType=UNKNOWN;
kind=-1;
}

Fixed version (ground truth):
/** 
 * The main function
 * @exception IllegalActionException If an error occurs readingor writing inputs or outputs.
 */
public void fire() throws IllegalActionException {
  super.fire();
  Director director=getDirector();
  _currentTime=director.getCurrentTime();
  int kind=whoTimeout();
  if (kind == -1) {
    if (fromValidateMpdu.hasToken(0)) {
      _inputMessage=(RecordToken)fromValidateMpdu.get(0);
      _messageType=((IntToken)_inputMessage.get("String_Node_Str")).intValue();
      if (_messageType == UseDifs || _messageType == UseEifs) {
        if (_messageType == UseDifs) {
          _dIfs=_dDIfs - _aRxTxTurnaroundTime;
        }
 else         if (_messageType == UseEifs) {
          _dIfs=_dEIfs - _aRxTxTurnaroundTime;
        }
        if (_debugging) {
          _debug("String_Node_Str" + _inputMessage.toString());
        }
        DoubleToken t=(DoubleToken)_inputMessage.get("String_Node_Str");
        double tRxEnd=t.doubleValue();
        if (_IfsTimer != null)         cancelTimer(_IfsTimer);
        _IfsTimer=setTimer(IfsTimeOut,_currentTime + tRxEnd + _dIfs * 1e-6);
      }
    }
 else     if (channelStatus.hasToken(0)) {
      _inputMessage=(RecordToken)channelStatus.get(0);
    }
 else     if (fromFilterMpdu.hasToken(0)) {
      _inputMessage=(RecordToken)fromFilterMpdu.get(0);
    }
    if (_inputMessage != null) {
      _messageType=((IntToken)_inputMessage.get("String_Node_Str")).intValue();
    }
  }
switch (_state) {
case Cs_noNav:
switch (_messageType) {
case Idle:
      if (_IfsTimer != null)       cancelTimer(_IfsTimer);
    _IfsTimer=setTimer(IfsTimeOut,_currentTime + _dIfs * 1e-6);
  _state=Wait_Ifs;
break;
case SetNav:
if (_setNav()) {
_state=Cs_Nav;
}
break;
}
break;
case Wait_Ifs:
if (kind == IfsTimeOut) {
_changeStatus(Idle);
_state=noCs_noNav;
}
 else {
switch (_messageType) {
case Busy:
_state=Cs_noNav;
break;
case SetNav:
if (_setNav()) {
_state=noCs_Nav;
}
break;
}
}
break;
case noCs_noNav:
switch (_messageType) {
case Busy:
_changeStatus(Busy);
_state=Cs_noNav;
break;
case SetNav:
if (_setNav()) {
_changeStatus(Busy);
_state=noCs_Nav;
}
break;
}
break;
case Cs_Nav:
if (kind == NavTimeOut) {
_state=Cs_noNav;
}
 else {
if (_messageType == Idle) _state=noCs_Nav;
 else _updateNav();
}
break;
case noCs_Nav:
if (kind == NavTimeOut) {
if (_IfsTimer != null) cancelTimer(_IfsTimer);
_IfsTimer=setTimer(IfsTimeOut,_currentTime + _dIfs * 1e-6);
_state=Wait_Ifs;
}
 else {
if (_messageType == Busy) _state=Cs_Nav;
 else _updateNav();
}
break;
}
_inputMessage=null;
_messageType=UNKNOWN;
kind=-1;
}