Program: 76366
Project: 76366
Buggy source:
/** 
 * This method provides the recursive functionality of  hasToken() for general receivers.
 */
private synchronized boolean _hasOutsideToken(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) {
      IOPort port=(IOPort)getContainer();
      Director insideDir=((Actor)port.getContainer()).getDirector();
      if (insideDir instanceof DDEDirector) {
        Receiver[][] rcvrs=null;
        try {
          rcvrs=port.deepGetReceivers();
        }
 catch (        IllegalActionException e) {
        }
        for (int i=0; i < rcvrs.length; i++) {
          for (int j=0; j < rcvrs[i].length; j++) {
            DDEReceiver rcvr=(DDEReceiver)rcvrs[i][j];
            rcvr.put(new Token(),TimedQueueReceiver.IGNORE);
          }
        }
      }
      _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 _hasOutsideToken(Workspace workspace,DDEDirector director,TimeKeeper timeKeeper,boolean _hideNullTokens){
  String actorName=((Nameable)getContainer().getContainer()).getName();
  String portName=((Nameable)getContainer()).getName();
  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");
    }
    IOPort port=(IOPort)getContainer();
    Director insideDir=((Actor)port.getContainer()).getDirector();
    if (insideDir instanceof DDEDirector) {
      Receiver[][] rcvrs=null;
      try {
        rcvrs=port.deepGetReceivers();
      }
 catch (      IllegalActionException e) {
      }
      for (int i=0; i < rcvrs.length; i++) {
        for (int j=0; j < rcvrs[i].length; j++) {
          DDEReceiver rcvr=(DDEReceiver)rcvrs[i][j];
          rcvr.put(new Token(),TimedQueueReceiver.IGNORE);
        }
      }
    }
    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);
  }
}