Program: 73784
Project: 73784
Buggy source:
/** 
 * Instantiate the analysis model from the core model.
 * @param firingVector contains repetition vector information
 * @throws IllegalActionException if model information inconsistent
 */
protected void _instantiateAnalysisModel(Map firingVector) throws IllegalActionException {
}

Fixed version (ground truth):
/** 
 * Instantiate the analysis model from the core model.
 * @param firingVector contains repetition vector information
 * @throws IllegalActionException if model information inconsistent
 */
protected void _instantiateAnalysisModel(Map firingVector) throws IllegalActionException {
  _actors=new _ListOfActors();
  _actorMap=new _TwoWayHashMap();
  _channels=new _ListOfChannels();
  _channelMap=new _TwoWayHashMap();
  Iterator actorIterator=firingVector.entrySet().iterator();
  while (actorIterator.hasNext()) {
    int sharedBuffers, exclusiveBuffers, sharedExecutionTime, exclusiveExecutionTime;
    Map.Entry pair=(Map.Entry)actorIterator.next();
    ptolemy.actor.Actor actor=(ptolemy.actor.Actor)pair.getKey();
    if (actor instanceof BufferingProfile) {
      BufferingProfile actorWithBufferingProfile=(BufferingProfile)actor;
      sharedBuffers=actorWithBufferingProfile.sharedBuffers();
      exclusiveBuffers=actorWithBufferingProfile.exclusiveBuffers();
      sharedExecutionTime=actorWithBufferingProfile.sharedExecutionTime();
      exclusiveExecutionTime=actorWithBufferingProfile.exclusiveExecutionTime();
    }
 else {
      sharedBuffers=0;
      exclusiveBuffers=0;
      sharedExecutionTime=0;
      exclusiveExecutionTime=0;
    }
    _Actor modelActor=new _Actor(actor.getName(),(Integer)pair.getValue(),sharedBuffers,exclusiveBuffers,sharedExecutionTime,exclusiveExecutionTime);
    _actors.add(modelActor);
    _actorMap.put(modelActor,actor);
    List portList=actor.outputPortList();
    Iterator portIterator=portList.iterator();
    while (portIterator.hasNext()) {
      TypedIOPort port=(TypedIOPort)portIterator.next();
      _Channel channel=new _Channel();
      channel.initialTokens=DFUtilities.getTokenInitProduction(port);
      _channels.add(channel);
      _channelMap.put(port,channel);
    }
  }
  actorIterator=firingVector.keySet().iterator();
  while (actorIterator.hasNext()) {
    ptolemy.actor.Actor actor=(ptolemy.actor.Actor)actorIterator.next();
    _Actor modelActor=(_Actor)_actorMap.getBW(actor);
    List portList=actor.outputPortList();
    Iterator portIterator=portList.iterator();
    while (portIterator.hasNext()) {
      TypedIOPort port=(TypedIOPort)portIterator.next();
      int rate=DFUtilities.getRate(port);
      _Channel channel=(_Channel)_channelMap.getFW(port);
      _Port modelPort=new _Port(rate,channel);
      modelActor.addPort(modelPort);
    }
    portList=actor.inputPortList();
    portIterator=portList.iterator();
    while (portIterator.hasNext()) {
      TypedIOPort port=(TypedIOPort)portIterator.next();
      int rate=DFUtilities.getRate(port);
      List sourcePortList=port.sourcePortList();
      for (int i=0; i < sourcePortList.size(); i++) {
        _Channel channel=(_Channel)_channelMap.getFW(sourcePortList.get(i));
        if (channel != null) {
          _Port modelPort=new _Port(-rate,channel);
          modelActor.addPort(modelPort);
        }
      }
    }
  }
}