Program: 76367
Project: 76367
Buggy source:
/** 
 * This method provides the recursive functionality of  hasToken() for general receivers.
 */
private synchronized boolean _hasToken(Workspace workspace,DDEDirector director,TimeKeeper timeKeeper,boolean _hideNullTokens){
  timeKeeper.resortRcvrList();
  if (timeKeeper.getNextTime() == INACTIVE) {
    requestFinish();
  }
  if (getRcvrTime() == INACTIVE && !_terminate) {
    return false;
  }
  if (getRcvrTime() == IGNORE && !_terminate) {
    if (_ignoreNotSeen) {
      _ignoreNotSeen=false;
      return false;
    }
 else {
      _ignoreNotSeen=true;
      clearIgnoredTokens();
      timeKeeper.setIgnoredTokens(false);
      return false;
    }
  }
  if (getRcvrTime() > timeKeeper.getNextTime() && !_terminate) {
    return false;
  }
  if (super.hasToken() && !_terminate) {
    if (!timeKeeper.hasMinRcvrTime()) {
      if (hasNullToken()) {
        if (timeKeeper.getHighestPriorityReal() != null) {
          return false;
        }
 else         if (this != timeKeeper.getHighestPriorityNull()) {
          return false;
        }
 else         if (!_hideNullTokens) {
          return true;
        }
 else {
          super.get();
          timeKeeper.sendOutNullTokens(this);
          return _hasToken(workspace,director,timeKeeper,_hideNullTokens);
        }
      }
 else {
        return true;
      }
    }
 else {
      if (hasNullToken()) {
        if (!_hideNullTokens) {
          return true;
        }
        super.get();
        timeKeeper.sendOutNullTokens(this);
        return _hasToken(workspace,director,timeKeeper,_hideNullTokens);
      }
      return true;
    }
  }
  if (!super.hasToken() && !_terminate) {
    _readPending=true;
    if (isConnectedToBoundary()) {
      director.addExternalReadBlock();
    }
 else {
      director.addInternalReadBlock();
    }
    while (_readPending && !_terminate) {
      workspace.wait(this);
    }
  }
  if (_terminate) {
    if (_readPending) {
      _readPending=false;
      if (isConnectedToBoundary()) {
        director.removeExternalReadBlock();
      }
 else {
        director.removeInternalReadBlock();
      }
    }
    throw new TerminateProcessException("String_Node_Str");
  }
 else {
    return _hasToken(workspace,director,timeKeeper,_hideNullTokens);
  }
}

Fixed version (ground truth):
/** 
 * This method provides the recursive functionality of  hasToken() for general receivers.
 */
private synchronized boolean _hasToken(Workspace workspace,DDEDirector director,TimeKeeper timeKeeper,boolean _hideNullTokens){
  String actorName=((Nameable)getContainer().getContainer()).getName();
  String portName=((Nameable)getContainer()).getName();
  if (actorName.equals("String_Node_Str")) {
  }
  timeKeeper.resortRcvrList();
  if (timeKeeper.getNextTime() == INACTIVE) {
    requestFinish();
  }
  if (getRcvrTime() == INACTIVE && !_terminate) {
    return false;
  }
  if (getRcvrTime() == IGNORE && !_terminate) {
    if (actorName.equals("String_Node_Str")) {
      System.out.println(actorName + "String_Node_Str");
    }
    if (_ignoreNotSeen) {
      _ignoreNotSeen=false;
      return false;
    }
 else {
      _ignoreNotSeen=true;
      clearIgnoredTokens();
      timeKeeper.setIgnoredTokens(false);
      return false;
    }
  }
  if (getRcvrTime() > timeKeeper.getNextTime() && !_terminate) {
    return false;
  }
  if (super.hasToken() && !_terminate) {
    if (!timeKeeper.hasMinRcvrTime()) {
      if (hasNullToken()) {
        if (timeKeeper.getHighestPriorityReal() != null) {
          return false;
        }
 else         if (this != timeKeeper.getHighestPriorityNull()) {
          return false;
        }
 else         if (!_hideNullTokens) {
          return true;
        }
 else {
          super.get();
          timeKeeper.sendOutNullTokens(this);
          return _hasToken(workspace,director,timeKeeper,_hideNullTokens);
        }
      }
 else {
        if (this == timeKeeper.getHighestPriorityReal()) {
          return true;
        }
        return false;
      }
    }
 else {
      if (hasNullToken()) {
        if (!_hideNullTokens) {
          return true;
        }
        super.get();
        timeKeeper.sendOutNullTokens(this);
        return _hasToken(workspace,director,timeKeeper,_hideNullTokens);
      }
      return true;
    }
  }
  if (!super.hasToken() && !_terminate) {
    _readPending=true;
    if (isConnectedToBoundary()) {
      director.addExternalReadBlock();
    }
 else {
      director.addInternalReadBlock();
    }
    while (_readPending && !_terminate) {
      workspace.wait(this);
    }
  }
  if (_terminate) {
    if (_readPending) {
      _readPending=false;
      if (isConnectedToBoundary()) {
        director.removeExternalReadBlock();
      }
 else {
        director.removeInternalReadBlock();
      }
    }
    throw new TerminateProcessException("String_Node_Str");
  }
 else {
    return _hasToken(workspace,director,timeKeeper,_hideNullTokens);
  }
}