Program: 74311
Project: 74311
Buggy source:
/** 
 * If there are platforms to unblock without increasing the physical time, notify all platforms. Otherwise, resolve the deadlock. This method is reached if all platforms are stalled in the fireAt() method of this director because they are waiting for a future physical time.
 * @return true if a real deadlock (see super class) is detected, false otherwise.
 * @exception IllegalActionException Not thrown in this base class. This might be thrown by derived classes.
 */
protected boolean _resolveDeadlock() throws IllegalActionException {
  if (_platformsToUnblock.size() > 0) {
    notifyAll();
    return true;
  }
 else {
    return super._resolveDeadlock();
  }
}

Fixed version (ground truth):
/** 
 * If there are platforms to unblock without increasing the physical time, notify all platforms. Otherwise, resolve the deadlock. This method is reached if all platforms are stalled in the fireAt() method of this director because they are waiting for a future physical time.
 * @return true if a real deadlock (see super class) is detected, false otherwise.
 * @exception IllegalActionException Not thrown in this base class. This might be thrown by derived classes.
 */
protected boolean _resolveDeadlock() throws IllegalActionException {
  if (_platformsToUnblock.size() > 0) {
    notifyAll();
    return true;
  }
 else {
    if (_writeBlockedQueues.size() != 0) {
      _incrementLowestWriteCapacityPort();
      return true;
    }
 else     if (_delayBlockCount == 0) {
      return false;
    }
 else {
synchronized (this) {
        List unblockedActors=new ArrayList();
        if (!_eventQueue.isEmpty()) {
          TimedEvent event=(TimedEvent)_eventQueue.take();
          unblockedActors.add(event.contents);
          if (_synchronizeToRealTime) {
            Time currentTime;
synchronized (this) {
              while (!_stopRequested && !_stopFireRequested) {
                currentTime=getModelTime();
                long elapsedTime=System.currentTimeMillis() - _realStartTime;
                double elapsedTimeInSeconds=elapsedTime / 1000.0;
                ptolemy.actor.util.Time elapsed=new ptolemy.actor.util.Time(this,elapsedTimeInSeconds);
                if (currentTime.compareTo(elapsed) <= 0) {
                  break;
                }
                long timeToWait=(long)(currentTime.subtract(elapsed).getDoubleValue() * 1000.0);
                if (timeToWait > 0) {
                  if (_debugging) {
                    _debug("String_Node_Str" + timeToWait);
                  }
                  try {
                    _workspace.wait(this,timeToWait);
                  }
 catch (                  InterruptedException ex) {
                    throw new IllegalActionException(this,ex,"String_Node_Str" + "String_Node_Str");
                  }
                }
              }
            }
          }
          setModelTime(event.timeStamp);
          _informOfDelayUnblock();
        }
 else {
          throw new InternalErrorException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
        }
        boolean sameTime=true;
        while (sameTime) {
          if (!_eventQueue.isEmpty()) {
            TimedEvent event=(TimedEvent)_eventQueue.take();
            Actor actor=(Actor)event.contents;
            Time newTime=event.timeStamp;
            if (newTime.equals(getModelTime())) {
              if (unblockedActors.contains(actor))               continue;
 else               unblockedActors.add(actor);
              _informOfDelayUnblock();
            }
 else {
              _eventQueue.put(new TimedEvent(newTime,actor));
              sameTime=false;
            }
          }
 else {
            sameTime=false;
          }
        }
        notifyAll();
      }
    }
    return true;
  }
}