Program: 73099
Project: 73099
Buggy source:
public void fire() throws IllegalActionException {
  try {
    if (_debugging) {
      _debug("String_Node_Str");
    }
    Nameable container=getContainer();
    Iterator<?> actors=((CompositeActor)container).deepEntityList().iterator();
    LinkedList<MetroIIActorThread> actor_thread_list=new LinkedList<MetroIIActorThread>();
    while (actors.hasNext()) {
      Actor actor=(Actor)actors.next();
      if (actor instanceof MetroIIEventHandler) {
        actor_thread_list.add(new MetroIIActorThread(actor,MetroIIActorThread.Type.Metropolis,MetroIIActorThread.State.WAITING,null));
      }
 else {
        actor_thread_list.add(new MetroIIActorThread(actor,MetroIIActorThread.Type.Ptolemy,MetroIIActorThread.State.WAITING,null));
      }
    }
    boolean stable=false;
    while (!_stopRequested) {
      LinkedList<Event.Builder> m2event_list=new LinkedList<Event.Builder>();
      stable=true;
      for (      MetroIIActorThread actor_thread : actor_thread_list) {
        if (actor_thread._actor.prefire()) {
          if (actor_thread._type == MetroIIActorThread.Type.Metropolis) {
            if (actor_thread._state == MetroIIActorThread.State.WAITING) {
              final YieldAdapterIterable<Iterable<Event.Builder>> results=((MetroIIEventHandler)actor_thread._actor).adapter();
              actor_thread._thread=results.iterator();
              actor_thread._state=MetroIIActorThread.State.ACTIVE;
            }
          }
 else           if (actor_thread._type == MetroIIActorThread.Type.Ptolemy) {
            actor_thread._state=MetroIIActorThread.State.ACTIVE;
          }
        }
      }
      for (      MetroIIActorThread actor_thread : actor_thread_list) {
        if (actor_thread._type == MetroIIActorThread.Type.Metropolis && actor_thread._state == MetroIIActorThread.State.ACTIVE) {
          Actor actor=actor_thread._actor;
          Iterator<Iterable<Event.Builder>> thread=actor_thread._thread;
          if (thread.hasNext()) {
            Iterable<Event.Builder> result=thread.next();
            for (            Builder builder : result) {
              Event.Builder etb=builder;
              String event_name=etb.getName();
              if (!eventname2id.containsKey(event_name)) {
                eventname2id.put(event_name,next_avail_id);
                next_avail_id++;
              }
              etb.setStatus(Event.Status.WAITING);
              m2event_list.add(etb);
              stable=false;
            }
          }
 else {
            boolean pfire=actor.postfire();
            actor_thread._state=MetroIIActorThread.State.WAITING;
            if (!pfire) {
              if (_debugging) {
                _debug("String_Node_Str" + ((Nameable)actor).getFullName());
              }
            }
            if (_stopRequested) {
              if (_debugging) {
                _debug("String_Node_Str" + ((Nameable)actor).getFullName());
              }
            }
          }
        }
      }
      for (      MetroIIActorThread actor_thread : actor_thread_list) {
        if (actor_thread._type == MetroIIActorThread.Type.Ptolemy && actor_thread._state == MetroIIActorThread.State.ACTIVE) {
          actor_thread._actor.fire();
          boolean pfire=actor_thread._actor.postfire();
          actor_thread._state=MetroIIActorThread.State.WAITING;
          if (!pfire) {
            if (_debugging) {
              _debug("String_Node_Str" + ((Nameable)actor_thread._actor).getFullName());
            }
          }
        }
      }
      for (      Event.Builder etb : m2event_list) {
        String event_name=etb.getName();
        _mapping_constraint_solver.presentM2Event(eventname2id.get(event_name));
      }
      System.out.println(_mapping_constraint_solver);
      System.out.println("String_Node_Str");
      for (      Event.Builder etb : m2event_list) {
        System.out.println(eventname2id.get(etb.getName()) + etb.getName() + "String_Node_Str"+ etb.getStatus().toString());
      }
      for (      Event.Builder etb : m2event_list) {
        String event_name=etb.getName();
        if (_mapping_constraint_solver.isSatisfied(eventname2id.get(event_name))) {
          etb.setStatus(Event.Status.NOTIFIED);
        }
      }
      System.out.println("String_Node_Str");
      for (      Event.Builder etb : m2event_list) {
        System.out.println(eventname2id.get(etb.getName()) + etb.getName() + "String_Node_Str"+ etb.getStatus().toString());
      }
      _mapping_constraint_solver.reset();
    }
    if (_stopRequested) {
      for (      MetroIIActorThread actor_thread : actor_thread_list) {
        if (actor_thread._type == MetroIIActorThread.Type.Metropolis && actor_thread._state == MetroIIActorThread.State.ACTIVE) {
          actor_thread._thread.dispose();
        }
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    System.err.println("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Tries to call prefire(), fire(), and postfire() of each actor in the model. If the actor  is a CompositeActor that has a MetroII compatible director, the getfire() is called instead of fire().  In addition to do everything fire() does, getfire() proposes events in firing. And when proposing events, the CompositeActor is blocked.  Tries to resolve the mapping constraints. The MetroIIDirector collects all the events and reset the  statuses of events based on the mapping constraints. In the next iteration, CompositeActor executes  based on the updated statuses of events.  
 */
public void fire() throws IllegalActionException {
  try {
    if (_debugging) {
      _debug("String_Node_Str");
    }
    Nameable container=getContainer();
    Iterator<?> actors=((CompositeActor)container).deepEntityList().iterator();
    LinkedList<MetroIIActorThread> actor_thread_list=new LinkedList<MetroIIActorThread>();
    while (actors.hasNext()) {
      Actor actor=(Actor)actors.next();
      if (actor instanceof MetroIIEventHandler) {
        actor_thread_list.add(new MetroIIActorThread(actor,MetroIIActorThread.Type.Metropolis,MetroIIActorThread.State.WAITING,null));
      }
 else {
        actor_thread_list.add(new MetroIIActorThread(actor,MetroIIActorThread.Type.Ptolemy,MetroIIActorThread.State.WAITING,null));
      }
    }
    boolean stable=false;
    while (!_stopRequested) {
      LinkedList<Event.Builder> m2event_list=new LinkedList<Event.Builder>();
      stable=true;
      for (      MetroIIActorThread actor_thread : actor_thread_list) {
        if (actor_thread._actor.prefire()) {
          if (actor_thread._type == MetroIIActorThread.Type.Metropolis) {
            if (actor_thread._state == MetroIIActorThread.State.WAITING) {
              final YieldAdapterIterable<Iterable<Event.Builder>> results=((MetroIIEventHandler)actor_thread._actor).adapter();
              actor_thread._thread=results.iterator();
              actor_thread._state=MetroIIActorThread.State.ACTIVE;
            }
          }
 else           if (actor_thread._type == MetroIIActorThread.Type.Ptolemy) {
            actor_thread._state=MetroIIActorThread.State.ACTIVE;
          }
        }
      }
      for (      MetroIIActorThread actor_thread : actor_thread_list) {
        if (actor_thread._type == MetroIIActorThread.Type.Metropolis && actor_thread._state == MetroIIActorThread.State.ACTIVE) {
          Actor actor=actor_thread._actor;
          Iterator<Iterable<Event.Builder>> thread=actor_thread._thread;
          if (thread.hasNext()) {
            Iterable<Event.Builder> result=thread.next();
            for (            Builder builder : result) {
              Event.Builder etb=builder;
              String event_name=etb.getName();
              if (!_eventName2ID.containsKey(event_name)) {
                _eventName2ID.put(event_name,_nextAvailID);
                _nextAvailID++;
              }
              etb.setStatus(Event.Status.WAITING);
              m2event_list.add(etb);
              stable=false;
            }
          }
 else {
            boolean pfire=actor.postfire();
            actor_thread._state=MetroIIActorThread.State.WAITING;
            if (!pfire) {
              if (_debugging) {
                _debug("String_Node_Str" + ((Nameable)actor).getFullName());
              }
            }
            if (_stopRequested) {
              if (_debugging) {
                _debug("String_Node_Str" + ((Nameable)actor).getFullName());
              }
            }
          }
        }
      }
      for (      MetroIIActorThread actor_thread : actor_thread_list) {
        if (actor_thread._type == MetroIIActorThread.Type.Ptolemy && actor_thread._state == MetroIIActorThread.State.ACTIVE) {
          actor_thread._actor.fire();
          boolean pfire=actor_thread._actor.postfire();
          actor_thread._state=MetroIIActorThread.State.WAITING;
          if (!pfire) {
            if (_debugging) {
              _debug("String_Node_Str" + ((Nameable)actor_thread._actor).getFullName());
            }
          }
        }
      }
      for (      Event.Builder etb : m2event_list) {
        String event_name=etb.getName();
        _mappingConstraintSolver.presentM2Event(_eventName2ID.get(event_name));
      }
      System.out.println(_mappingConstraintSolver);
      System.out.println("String_Node_Str");
      for (      Event.Builder etb : m2event_list) {
        System.out.println(_eventName2ID.get(etb.getName()) + etb.getName() + "String_Node_Str"+ etb.getStatus().toString());
      }
      for (      Event.Builder etb : m2event_list) {
        String event_name=etb.getName();
        if (_mappingConstraintSolver.isSatisfied(_eventName2ID.get(event_name))) {
          etb.setStatus(Event.Status.NOTIFIED);
        }
      }
      System.out.println("String_Node_Str");
      for (      Event.Builder etb : m2event_list) {
        System.out.println(_eventName2ID.get(etb.getName()) + etb.getName() + "String_Node_Str"+ etb.getStatus().toString());
      }
      _mappingConstraintSolver.reset();
    }
    if (_stopRequested) {
      for (      MetroIIActorThread actor_thread : actor_thread_list) {
        if (actor_thread._type == MetroIIActorThread.Type.Metropolis && actor_thread._state == MetroIIActorThread.State.ACTIVE) {
          actor_thread._thread.dispose();
        }
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    System.err.println("String_Node_Str" + e.getMessage());
  }
}