nus-yam/ex-repair huggingface dataset:
Program: 72772
Project: 72772
Buggy source:
/** 
 * Initializes the pipe connecting to Metro-SystemC.
 */
@Override public void initialize() throws IllegalActionException {
  super.initialize();
  path=System.getenv("String_Node_Str");
  path=path + "String_Node_Str";
  if (path == null) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
  m2event_out_pipe_name=path + "String_Node_Str";
  m2event_in_pipe_name=path + "String_Node_Str";
  System.out.println("String_Node_Str");
  List execCommands=new LinkedList();
  execCommands.add("String_Node_Str" + m2event_out_pipe_name);
  execCommands.add("String_Node_Str" + m2event_out_pipe_name);
  execCommands.add("String_Node_Str" + m2event_in_pipe_name);
  execCommands.add("String_Node_Str" + m2event_in_pipe_name);
  final StringBufferExec exec=new StringBufferExec();
  exec.setCommands(execCommands);
  exec.start();
  File pipe1=new File(m2event_out_pipe_name);
  File pipe2=new File(m2event_in_pipe_name);
  if (!pipe1.exists() || !pipe2.exists()) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
  events=new LinkedList<Event.Builder>();
  createProcess=false;
}

Fixed version (ground truth):
/** 
 * Initializes the pipe connecting to Metro-SystemC.
 */
@Override public void initialize() throws IllegalActionException {
  super.initialize();
  path=System.getenv("String_Node_Str");
  if (path == null) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
  path=path + "String_Node_Str";
  m2event_out_pipe_name=path + "String_Node_Str";
  m2event_in_pipe_name=path + "String_Node_Str";
  System.out.println("String_Node_Str");
  List execCommands=new LinkedList();
  execCommands.add("String_Node_Str" + m2event_out_pipe_name);
  execCommands.add("String_Node_Str" + m2event_out_pipe_name);
  execCommands.add("String_Node_Str" + m2event_in_pipe_name);
  execCommands.add("String_Node_Str" + m2event_in_pipe_name);
  final StringBufferExec exec=new StringBufferExec();
  exec.setCommands(execCommands);
  exec.start();
  File pipe1=new File(m2event_out_pipe_name);
  if (!pipe1.exists()) {
    throw new IllegalActionException(this,"String_Node_Str" + m2event_out_pipe_name + "String_Node_Str");
  }
  File pipe2=new File(m2event_in_pipe_name);
  if (!pipe1.exists()) {
    throw new IllegalActionException(this,"String_Node_Str" + m2event_in_pipe_name + "String_Node_Str");
  }
  events=new LinkedList<Event.Builder>();
  createProcess=false;
}
Program: 72777
Project: 72777
Buggy source:
private void _initializeTableContent(){
  if (_tableContent == null) {
    _tableContent=new ArrayList();
    for (int i=0; i < (getColumnCount() - 1) * (getRowCount() + 1); i++) {
      _tableContent.add("String_Node_Str");
    }
    for (int rowIndex=0; rowIndex < getRowCount() - 1; rowIndex++) {
      State state=(State)_model.getEntity((String)getValueAt(rowIndex,0));
      boolean parsedInmode=false;
      if (state.incomingPort.linkedRelationList().size() > 0) {
        for (        Object object : state.incomingPort.linkedRelationList()) {
          Transition transition=(Transition)object;
          String expression=null;
          try {
            if (transition.setActions.getDestinations().contains(_parameter)) {
              expression=transition.setActions.getExpression(_parameter.getName());
            }
 else {
              expression="String_Node_Str";
            }
          }
 catch (          IllegalActionException e) {
            e.printStackTrace();
          }
          if (!expression.equals("String_Node_Str")) {
            if (state.outgoingPort.linkedRelationList().contains(transition)) {
              _parseExpression(expression,rowIndex,false);
            }
 else             if (!parsedInmode) {
              _parseExpression(expression,rowIndex,true);
              parsedInmode=true;
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void _initializeTableContent(){
  if (_tableContent == null) {
    _tableContent=new ArrayList();
    for (int i=0; i < (getColumnCount() - 1) * (getRowCount() + 1); i++) {
      _tableContent.add("String_Node_Str");
    }
    for (int rowIndex=0; rowIndex < getRowCount() - 1; rowIndex++) {
      State state=(State)_model.getEntity((String)getValueAt(rowIndex,0));
      boolean parsedInmode=false;
      if (state.incomingPort.linkedRelationList().size() > 0) {
        for (        Object object : state.incomingPort.linkedRelationList()) {
          Transition transition=(Transition)object;
          String expression=null;
          try {
            if (transition.setActions.getDestinations().contains(_parameter)) {
              expression=transition.setActions.getExpression(_parameter.getName());
            }
 else {
              expression="String_Node_Str";
            }
          }
 catch (          IllegalActionException e) {
            expression="String_Node_Str";
          }
          if (!expression.equals("String_Node_Str")) {
            if (state.outgoingPort.linkedRelationList().contains(transition)) {
              _parseExpression(expression,rowIndex,false);
            }
 else             if (!parsedInmode) {
              _parseExpression(expression,rowIndex,true);
              parsedInmode=true;
            }
          }
        }
      }
    }
  }
}
Program: 72780
Project: 72780
Buggy source:
private JComponent _getModeTransitionPanel(){
  JPanel modeTransitionTablePanel=new JPanel(new BorderLayout());
  final ModeTransitionTableModel tableModel=new ModeTransitionTableModel(_model);
  final JTable table=new JTable(tableModel);
  table.setGridColor(Color.black);
  JButton addModeButton=new JButton("String_Node_Str");
  addModeButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      Vector vector=new Vector<String>();
      vector.add("String_Node_Str");
      vector.add("String_Node_Str");
      vector.add("String_Node_Str");
      tableModel.addRow(vector);
    }
  }
);
  JButton saveButton=new JButton("String_Node_Str");
  saveButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      try {
        tableModel.saveModel();
      }
 catch (      IllegalActionException e1) {
        MessageHandler.error(e1.getMessage(),e1);
      }
catch (      NameDuplicationException e1) {
        MessageHandler.error(e1.getMessage(),e1);
      }
    }
  }
);
  modeTransitionTablePanel.add(table.getTableHeader(),BorderLayout.PAGE_START);
  modeTransitionTablePanel.add(table,BorderLayout.CENTER);
  JPanel buttons=new JPanel();
  buttons.add(addModeButton);
  buttons.add(saveButton);
  modeTransitionTablePanel.add(buttons,BorderLayout.SOUTH);
  return modeTransitionTablePanel;
}

Fixed version (ground truth):
private JComponent _getModeTransitionPanel(){
  JPanel modeTransitionTablePanel=new JPanel(new BorderLayout());
  final ModeTransitionTableModel tableModel=new ModeTransitionTableModel(_model);
  final JTable table=new JTable(tableModel);
  table.setGridColor(Color.black);
  JButton addModeButton=new JButton("String_Node_Str");
  addModeButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      Vector<String> vector=new Vector<String>();
      vector.add("String_Node_Str");
      vector.add("String_Node_Str");
      vector.add("String_Node_Str");
      tableModel.addRow(vector);
    }
  }
);
  JButton saveButton=new JButton("String_Node_Str");
  saveButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      try {
        tableModel.saveModel();
      }
 catch (      IllegalActionException e1) {
        MessageHandler.error(e1.getMessage(),e1);
      }
catch (      NameDuplicationException e1) {
        MessageHandler.error(e1.getMessage(),e1);
      }
    }
  }
);
  modeTransitionTablePanel.add(table.getTableHeader(),BorderLayout.PAGE_START);
  modeTransitionTablePanel.add(table,BorderLayout.CENTER);
  JPanel buttons=new JPanel();
  buttons.add(addModeButton);
  buttons.add(saveButton);
  modeTransitionTablePanel.add(buttons,BorderLayout.SOUTH);
  return modeTransitionTablePanel;
}
Program: 72781
Project: 72781
Buggy source:
/** 
 * Construct a frame associated with an SCR Model. 
 * @param model The model to put in this frame, or null if none.
 * @param tableau The tableau responsible for this frame, or null if none.
 */
public SCRTableFrame(NamedObj model,Tableau tableau){
  super(tableau);
  _model=(FSMActor)model;
  _init();
}

Fixed version (ground truth):
/** 
 * Construct a frame associated with an SCR Model. 
 * @param model The model to put in this frame, or null if none.
 * @param tableau The tableau responsible for this frame, or null if none.
 */
public SCRTableFrame(NamedObj model,Tableau tableau){
  super(tableau);
  if (model instanceof FSMActor) {
    _model=(FSMActor)model;
  }
 else {
    MessageHandler.error("String_Node_Str" + model.getClassName());
  }
  _init();
}
Program: 72782
Project: 72782
Buggy source:
/** 
 * Create a tableau for the specified effigy, which is assumed to be an effigy for an instance of ModalModel.  This class defers to the configuration containing the specified effigy to open a tableau for the embedded controller.
 * @param effigy The model effigy.
 * @return A tableau for the effigy, or null if one cannot be created.
 * @exception Exception If the factory should be able to create aTableau for the effigy, but something goes wrong.
 */
public Tableau createTableau(Effigy effigy) throws Exception {
  Configuration configuration=(Configuration)effigy.toplevel();
  SCRModel model=(SCRModel)((PtolemyEffigy)effigy).getModel();
  FSMActor controller=((FSMDirector)model.getDirector()).getController();
  Tableau tableau=configuration.openModel(controller);
  tableau.setContainer(effigy);
  return tableau;
}

Fixed version (ground truth):
/** 
 * Create a tableau for the specified effigy, which is assumed to be an effigy for an instance of ModalModel.  This class defers to the configuration containing the specified effigy to open a tableau for the embedded controller.
 * @param effigy The model effigy.
 * @return A tableau for the effigy, or null if one cannot be created.
 * @exception Exception If the factory should be able to create aTableau for the effigy, but something goes wrong.
 */
public Tableau createTableau(Effigy effigy) throws Exception {
  Configuration configuration=(Configuration)effigy.toplevel();
  SCRModel model=null;
  if (effigy instanceof PtolemyEffigy) {
    PtolemyEffigy ptolemyEffigy=(PtolemyEffigy)effigy;
    if (ptolemyEffigy.getModel() instanceof SCRModel) {
      model=(SCRModel)ptolemyEffigy.getModel();
    }
 else {
      throw new IllegalActionException("String_Node_Str");
    }
  }
  FSMActor controller=((FSMDirector)model.getDirector()).getController();
  Tableau tableau=configuration.openModel(controller);
  tableau.setContainer(effigy);
  return tableau;
}
Program: 72783
Project: 72783
Buggy source:
private void _init(){
  JTabbedPane pane=new JTabbedPane();
  pane.addTab("String_Node_Str",_getModeTransitionPanel());
  pane.addTab("String_Node_Str",_getEventTablePanel());
  pane.addTab("String_Node_Str",_getConditionTablePanel());
  getContentPane().add(pane,BorderLayout.CENTER);
  this.setMinimumSize(new Dimension(700,400));
  super.show();
}

Fixed version (ground truth):
private void _init(){
  JTabbedPane pane=new JTabbedPane();
  pane.addTab("String_Node_Str",_getModeTransitionPanel());
  pane.addTab("String_Node_Str",_getEventTablePanel());
  pane.addTab("String_Node_Str",_getConditionTablePanel());
  getContentPane().add(pane,BorderLayout.CENTER);
  this.setSize(new Dimension(700,400));
  super.show();
}
Program: 72787
Project: 72787
Buggy source:
/** 
 * If the <i>initialValue</i> parameter is the argument, then reset the current output to match the new value.
 * @param attribute The attribute that changed.
 * @exception IllegalActionException If the change is not acceptableto this container (not thrown in this base class).
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute == initialValue) {
    if (initialValue.getToken() != null) {
      _lastInputs=new Token[input.getWidth()];
      for (int i=0; i < input.getWidth(); i++) {
        _lastInputs[i]=initialValue.getToken();
      }
    }
 else {
      _lastInputs=null;
    }
  }
 else {
    super.attributeChanged(attribute);
  }
}

Fixed version (ground truth):
/** 
 * If the <i>initialValue</i> parameter is the argument, then reset the current output to match the new value.
 * @param attribute The attribute that changed.
 * @exception IllegalActionException If the change is not acceptableto this container (not thrown in this base class).
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute == initialValue) {
    if (initialValue.getToken() != null) {
      int width=1;
      if (_initializeDone) {
        width=input.getWidth();
      }
      if (width < 1) {
        width=1;
      }
      _lastInputs=new Token[width];
      for (int i=0; i < width; i++) {
        _lastInputs[i]=initialValue.getToken();
      }
    }
 else {
      _lastInputs=null;
    }
  }
 else {
    super.attributeChanged(attribute);
  }
}
Program: 72788
Project: 72788
Buggy source:
/** 
 * Clear the cached input tokens.
 * @exception IllegalActionException If there is no director.
 */
public void initialize() throws IllegalActionException {
  if (initialValue.getToken() != null) {
    _lastInputs=new Token[input.getWidth()];
    for (int i=0; i < input.getWidth(); i++) {
      _lastInputs[i]=initialValue.getToken();
    }
  }
 else {
    _lastInputs=null;
  }
  super.initialize();
}

Fixed version (ground truth):
/** 
 * Clear the cached input tokens.
 * @exception IllegalActionException If there is no director.
 */
public void initialize() throws IllegalActionException {
  if (initialValue.getToken() != null) {
    _lastInputs=new Token[input.getWidth()];
    for (int i=0; i < input.getWidth(); i++) {
      _lastInputs[i]=initialValue.getToken();
    }
  }
 else {
    _lastInputs=null;
  }
  _initializeDone=true;
  super.initialize();
}
Program: 72792
Project: 72792
Buggy source:
/** 
 * Resume the execution of an actor that was previously blocked because it didn't have all the resources it needed for execution. This method puts an event into the queue for the current time.
 * @param actor The actor that resumes execution.
 * @exception IllegalActionException Not thrown here but in derived classes.
 */
public void resumeActor(Actor actor) throws IllegalActionException {
  List<DEEvent> events=_actorsInExecution.get(actor);
  Time time=((CompositeActor)_getExecutionAspect(actor).getContainer()).getDirector().getModelTime();
  if (events == null || events.size() == 0) {
    events=null;
  }
  DEEvent event=events.get(0);
  events.remove(event);
  _actorsInExecution.put(actor,events);
  if (event.ioPort() != null) {
    _enqueueTriggerEvent(event.ioPort(),time);
  }
 else {
    _enqueueEvent(actor,time,1);
  }
  fireContainerAt(time);
  if (_actorsFinished == null) {
    _actorsFinished=new ArrayList();
  }
  _actorsFinished.add(actor);
}

Fixed version (ground truth):
/** 
 * Resume the execution of an actor that was previously blocked because it didn't have all the resources it needed for execution. This method puts an event into the queue for the current time.
 * @param actor The actor that resumes execution.
 * @exception IllegalActionException Not thrown here but in derived classes.
 */
public void resumeActor(Actor actor) throws IllegalActionException {
  List<DEEvent> events=_actorsInExecution.get(actor);
  Time time=((CompositeActor)_getExecutionAspect(actor).getContainer()).getDirector().getModelTime();
  if (events == null || events.size() == 0) {
    events=null;
  }
  DEEvent event=events.get(0);
  events.remove(event);
  _actorsInExecution.put(actor,events);
  System.out.println(actor + "String_Node_Str" + events.size());
  if (event.ioPort() != null) {
    _enqueueTriggerEvent(event.ioPort(),time);
  }
 else {
    _enqueueEvent(actor,time,1);
  }
  fireContainerAt(time);
  if (_actorsFinished == null) {
    _actorsFinished=new ArrayList();
  }
  _actorsFinished.add(actor);
}
Program: 72796
Project: 72796
Buggy source:
/** 
 * Look up and return the attribute with the specified name in the scope. Return null if such an attribute does not exist.
 * @param name The name of the attribute.
 * @return The attribute with the specified name in the scope.
 * @exception IllegalActionException If a value in the scopeexists with the given name, but cannot be evaluated.
 */
public synchronized Variable getVariable(String name) throws IllegalActionException {
  if (_variablesDependentOn == null) {
    _variablesDependentOn=new HashMap<String,Variable>();
  }
 else {
    if (_variablesDependentOnVersion == workspace().getVersion()) {
      Variable result=(Variable)_variablesDependentOn.get(name);
      if (result != null) {
        return result;
      }
    }
 else {
      _variablesDependentOn.clear();
    }
  }
  _variablesDependentOnVersion=workspace().getVersion();
  NamedObj reference=_reference;
  if (_reference == null) {
    reference=Variable.this.getContainer();
  }
  Variable result=getScopedVariable(Variable.this,reference,name);
  if (result != null) {
    if (!_variablesDependentOn.containsValue(result)) {
      result.addValueListener(Variable.this);
      _variablesDependentOn.put(name,result);
    }
    return result;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Look up and return the attribute with the specified name in the scope. Return null if such an attribute does not exist. This method acquires read permission on the workspace.
 * @param name The name of the attribute.
 * @return The attribute with the specified name in the scope.
 * @exception IllegalActionException If a value in the scopeexists with the given name, but cannot be evaluated.
 */
public Variable getVariable(String name) throws IllegalActionException {
  workspace().getReadAccess();
  try {
    NamedObj reference=_reference;
    if (_reference == null) {
      reference=Variable.this.getContainer();
    }
    Variable result=getScopedVariable(Variable.this,reference,name);
    if (result != null) {
      result.addValueListener(Variable.this);
synchronized (Variable.this) {
        if (_variablesDependentOn == null) {
          _variablesDependentOn=new HashMap<String,Variable>();
        }
        _variablesDependentOn.put(name,result);
      }
    }
    return result;
  }
  finally {
    workspace().doneReading();
  }
}
Program: 72797
Project: 72797
Buggy source:
/** 
 * Invoke the wrapup() of the super class. Then, quit OpenModelica environment.
 * @exception IllegalActionException If OMC server is unable to stop.
 */
public void wrapup() throws IllegalActionException {
  super.wrapup();
  try {
    _omcCommand.stopServer();
    String loggerInfo="String_Node_Str";
    _omcLogger.getInfo(loggerInfo);
    _omcLogger.destroy();
  }
 catch (  ConnectException e) {
    new IllegalActionException("String_Node_Str" + e.getMessage()).printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Invoke the wrapup() of the super class. Then, quit OpenModelica environment.
 * @exception IllegalActionException If OMC server is unable to stop.
 */
public void wrapup() throws IllegalActionException {
  super.wrapup();
  try {
    _omcCommand.stopServer();
    String loggerInfo="String_Node_Str";
    _omcLogger.getInfo(loggerInfo);
  }
 catch (  ConnectException e) {
    e.printStackTrace();
  }
}
Program: 72800
Project: 72800
Buggy source:
/** 
 * Leave OpenModelica environment, destroy the OMC process and deallocate OMCCommand object.
 * @exception ConnectException If quit command couldn't be sent to OMC.
 */
public void stopServer() throws ConnectException {
  if (hasInitialized) {
    sendCommand("String_Node_Str");
    _omcCommandInstance=null;
    if (_omcProcess != null) {
      _omcProcess.destroy();
    }
  }
}

Fixed version (ground truth):
/** 
 * Leave OpenModelica environment, destroy the OMC process and deallocate OMCCommand object.
 * @exception ConnectException If quit command couldn't be sent to OMC.
 */
public void stopServer() throws ConnectException {
  if (hasInitialized) {
    sendCommand("String_Node_Str");
    _omcCommandInstance=null;
    _omcLogger=null;
  }
}
Program: 72802
Project: 72802
Buggy source:
/** 
 * Find the OpenModelica Compiler(OMC) executable file by using path variables.
 * @param executableName The name of the executable file
 * @return File The OMC executable file
 */
private File _findExecutableOnPath(String executableName){
  String systemPath=System.getenv("String_Node_Str");
  if (systemPath == null) {
    systemPath=System.getenv("String_Node_Str");
  }
  String[] pathDirs=systemPath.split(File.pathSeparator);
  File fullyQualifiedExecutable=null;
  for (  String pathDir : pathDirs) {
    File file=new File(pathDir,executableName);
    if (file.isFile()) {
      fullyQualifiedExecutable=file;
      break;
    }
  }
  return fullyQualifiedExecutable;
}

Fixed version (ground truth):
/** 
 * Find the OpenModelica Compiler(OMC) executable file by using path variables.
 * @param executableName The name of the executable file
 * @return File The OMC executable file
 */
private File _findExecutableOnPath(String executableName){
  if (_openModelicaSystemPath == null) {
    _openModelicaSystemPath=System.getenv("String_Node_Str");
  }
  String[] pathDirs=_openModelicaSystemPath.split(File.pathSeparator);
  File fullyQualifiedExecutable=null;
  for (  String pathDir : pathDirs) {
    File file=new File(pathDir,executableName);
    if (file.isFile()) {
      fullyQualifiedExecutable=file;
      break;
    }
  }
  return fullyQualifiedExecutable;
}
Program: 72805
Project: 72805
Buggy source:
/** 
 * Check if the (base-)model inherits from other classes.
 * @param modelName The (base-)model that should be built.
 * @return Check Return true, if the number of inherited classes is more than zero.
 */
public boolean getInheritanceCount(String modelName){
  CompilerResult getInheritanceCountResult=null;
  String inheritanceCount=null;
  try {
    getInheritanceCountResult=sendCommand("String_Node_Str" + modelName + "String_Node_Str");
  }
 catch (  ConnectException e) {
    new ConnectException(e.getMessage()).printStackTrace();
  }
  if (getInheritanceCountResult.getError().isEmpty()) {
    inheritanceCount=getInheritanceCountResult.getFirstResult().toString();
  }
  if (!(inheritanceCount.compareTo("String_Node_Str") == 0)) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Check if the (base-)model inherits from other classes.
 * @param modelName The (base-)model that should be built.
 * @return Check Return true, if the number of inherited classes is more than zero.
 */
public boolean getInheritanceCount(String modelName){
  CompilerResult getInheritanceCountResult=null;
  String inheritanceCount=null;
  try {
    getInheritanceCountResult=sendCommand("String_Node_Str" + modelName + "String_Node_Str");
  }
 catch (  ConnectException e) {
    new ConnectException(e.getMessage()).printStackTrace();
  }
  if (getInheritanceCountResult.getError().isEmpty())   inheritanceCount=getInheritanceCountResult.getFirstResult().toString();
  if (!(inheritanceCount.compareTo("String_Node_Str") == 0))   return true;
 else   return false;
}
Program: 72806
Project: 72806
Buggy source:
/** 
 * Create an instance of OMCLogger object in order to provide a global point of access to the instance. It provides a unique source of OMCLogger instance.
 * @return An OMCLogger object representing the instance value.
 */
public static OMCLogger getInstance(){
  if (_omcLoggerInstance == null) {
    try {
      _omcLoggerInstance=new OMCLogger();
    }
 catch (    IllegalActionException e) {
      new IllegalActionException("String_Node_Str" + e.getMessage());
    }
  }
  return _omcLoggerInstance;
}

Fixed version (ground truth):
/** 
 * Create an instance of OMCLogger object in order to provide a global point of access to the instance. It provides a unique source of OMCLogger instance.
 * @return An OMCLogger object representing the instance value.
 */
public static OMCLogger getInstance(){
  if (_omcLoggerInstance == null) {
    try {
      _omcLoggerInstance=new OMCLogger();
    }
 catch (    IllegalActionException e) {
      e.printStackTrace();
    }
  }
  return _omcLoggerInstance;
}
Program: 72807
Project: 72807
Buggy source:
/** 
 * Clone this actor into the specified workspace. The new actor is <i>not</i> added to the directory of that workspace (you must do this yourself if you want it there). The result is a new actor with the same ports as the original, but no connections and no container.  A container must be set before much can be done with this actor.
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException If cloned ports cannot haveas their container the cloned entity (this should not occur), or if one of the attributes cannot be cloned.
 * @return A new CanBus.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  CanBus newObject=(CanBus)super.clone(workspace);
  _ioPortToCanPriority=new HashMap<Port,Integer>();
  newObject._tokenTree=new TreeMap<Integer,LinkedList<Object[]>>();
  newObject._multiCast=new HashMap<Integer,Integer>();
  newObject._frameSize=_frameSize;
  newObject._nextTokenSize=_nextTokenSize;
  newObject._nextTokenFiringTime=null;
  newObject._startingTime=null;
  newObject._channelUsed=_channelUsed;
  newObject._bitRate=_bitRate;
  newObject._mostRecentFrame=_mostRecentFrame;
  return newObject;
}

Fixed version (ground truth):
/** 
 * Clone this actor into the specified workspace. The new actor is <i>not</i> added to the directory of that workspace (you must do this yourself if you want it there). The result is a new actor with the same ports as the original, but no connections and no container.  A container must be set before much can be done with this actor.
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException If cloned ports cannot haveas their container the cloned entity (this should not occur), or if one of the attributes cannot be cloned.
 * @return A new CanBus.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  CanBus newObject=(CanBus)super.clone(workspace);
  newObject._ioPortToCanPriority=new HashMap<Port,Integer>();
  newObject._tokenTree=new TreeMap<Integer,LinkedList<Object[]>>();
  newObject._multiCast=new HashMap<Integer,Integer>();
  newObject._frameSize=_frameSize;
  newObject._nextTokenSize=_nextTokenSize;
  newObject._nextTokenFiringTime=null;
  newObject._startingTime=null;
  newObject._channelUsed=_channelUsed;
  newObject._bitRate=_bitRate;
  newObject._mostRecentFrame=_mostRecentFrame;
  return newObject;
}
Program: 72809
Project: 72809
Buggy source:
/** 
 * Create a sensor with the given type, units of measurement, and  time interval between measurements, which has no readings.
 * @param type  The type of measurement, for example, temperature
 * @param unit  The units of measurement, for example, degC
 * @param interval  The time interval between measurements
 */
Sensor(String type,String unit,String interval){
  setType(type);
  _unit=unit;
  _interval=interval;
  _readings=new ArrayList<Double>();
  _readings.add(new Double.valueOf(5.67));
  _readings.add(new Double.valueOf(7.89));
}

Fixed version (ground truth):
/** 
 * Create a sensor with the given type, units of measurement, and  time interval between measurements, which has no readings.
 * @param type  The type of measurement, for example, temperature
 * @param unit  The units of measurement, for example, degC
 * @param interval  The time interval between measurements
 */
Sensor(String type,String unit,String interval){
  setType(type);
  _unit=unit;
  _interval=interval;
  _readings=new ArrayList<Double>();
  _readings.add(Double.valueOf(5.67));
  _readings.add(Double.valueOf(7.89));
}
Program: 72810
Project: 72810
Buggy source:
/** 
 * Set the name of the port that will receive scheduling requests for the actor.
 * @param actor The actor.
 * @param portName The request port.
 */
public void setRequestPort(Actor actor,String portName){
  if (_requestPorts == null) {
    _requestPorts=new HashMap<Actor,String>();
  }
  _requestPorts.put(actor,portName);
}

Fixed version (ground truth):
/** 
 * Set the name of the port that will receive scheduling requests for the actor.
 * @param actor The actor.
 * @param portName The request port.
 */
public void setRequestPort(Actor actor,String portName){
  if (portName != null) {
    if (_requestPorts == null) {
      _requestPorts=new HashMap<Actor,String>();
    }
    _requestPorts.put(actor,portName);
  }
}
Program: 72813
Project: 72813
Buggy source:
/** 
 * Return a list of the entities deeply contained by the container of this resource scheduler.
 * @return A list of the objects decorated by this decorator.
 */
public List<NamedObj> decoratedObjects(){
  List<NamedObj> list=new ArrayList();
  CompositeEntity container=(CompositeEntity)getContainer();
  for (  Object object : container.deepEntityList()) {
    if (object instanceof Actor) {
      for (      Object port : ((Actor)object).inputPortList()) {
        list.add((NamedObj)port);
      }
    }
  }
  return list;
}

Fixed version (ground truth):
/** 
 * Return a list of the entities deeply contained by the container of this resource scheduler.
 * @return A list of the objects decorated by this decorator.
 */
public List<NamedObj> decoratedObjects(){
  if (workspace().getVersion() == _decoratedObjectsVersion) {
    return _decoratedObjects;
  }
  _decoratedObjectsVersion=workspace().getVersion();
  List<NamedObj> list=new ArrayList();
  CompositeEntity container=(CompositeEntity)getContainer();
  for (  Object object : container.deepEntityList()) {
    if (object instanceof Actor) {
      for (      Object port : ((Actor)object).inputPortList()) {
        list.add((NamedObj)port);
      }
    }
  }
  _decoratedObjects=list;
  return list;
}
Program: 72814
Project: 72814
Buggy source:
/** 
 * Clone the object into the specified workspace.
 * @param workspace The workspace for the new object.
 * @return A new NamedObj.
 * @exception CloneNotSupportedException If any of the attributescannot be cloned.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  AtomicCommunicationAspect newObject=(AtomicCommunicationAspect)super.clone(workspace);
  newObject._listeners=null;
  newObject._parameters=null;
  return newObject;
}

Fixed version (ground truth):
/** 
 * Clone the object into the specified workspace.
 * @param workspace The workspace for the new object.
 * @return A new NamedObj.
 * @exception CloneNotSupportedException If any of the attributescannot be cloned.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  AtomicCommunicationAspect newObject=(AtomicCommunicationAspect)super.clone(workspace);
  newObject._listeners=null;
  newObject._parameters=null;
  newObject._decoratedObjects=null;
  newObject._decoratedObjectsVersion=-1L;
  return newObject;
}
Program: 72815
Project: 72815
Buggy source:
/** 
 * Make sure that this communication aspect is only used in the DE domain. 
 * @param container The container of this actor.
 * @exception IllegalActionException If thrown by the super class or if thedirector of this actor is not a DEDirector.
 * @exception NameDuplicationException If thrown by the super class.
 */
public void setContainer(CompositeEntity container) throws IllegalActionException, NameDuplicationException {
  super.setContainer(container);
  if (getDirector() != null && !(getDirector() instanceof DEDirector)) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Make sure that this communication aspect is only used in the DE domain. 
 * @param container The container of this actor.
 * @exception IllegalActionException If thrown by the super class or if thedirector of this actor is not a DEDirector.
 * @exception NameDuplicationException If thrown by the super class.
 */
public void setContainer(CompositeEntity container) throws IllegalActionException, NameDuplicationException {
  super.setContainer(container);
  if (getDirector() != null && !(getDirector() instanceof DEDirector)) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
  if (container != null) {
    List<NamedObj> decoratedObjects=decoratedObjects();
    for (    NamedObj decoratedObject : decoratedObjects) {
      BasicSwitchAttributes decoratorAttributes=(BasicSwitchAttributes)decoratedObject.getDecoratorAttributes(this);
      setPortIn((IOPort)decoratedObject,decoratorAttributes._portIn);
      setPortOut((IOPort)decoratedObject,decoratorAttributes._portOut);
    }
  }
}
Program: 72816
Project: 72816
Buggy source:
/** 
 * Create the parameters.
 */
private void _init(){
  try {
    messageLength=new Parameter(this,"String_Node_Str");
    messageLength.setExpression("String_Node_Str");
  }
 catch (  KernelException ex) {
    throw new InternalErrorException(ex);
  }
}

Fixed version (ground truth):
/** 
 * Create the parameters.
 */
private void _init(){
  try {
    messageLength=new Parameter(this,"String_Node_Str");
    messageLength.setExpression("String_Node_Str");
    _messageLength=1;
  }
 catch (  KernelException ex) {
    throw new InternalErrorException(ex);
  }
}
Program: 72817
Project: 72817
Buggy source:
/** 
 * If attribute is <i>messageLength</i> report the new value  to the communication aspect. 
 * @param attribute The changed parameter.
 * @exception IllegalActionException If the parameter set is not valid.Not thrown in this class.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute == messageLength) {
    if (((BooleanToken)enable.getToken()).booleanValue()) {
      IOPort port=(IOPort)getContainer();
      Bus bus=(Bus)getDecorator();
      if (bus != null) {
        Token token=messageLength.getToken();
        if (token != null) {
          bus.setMessageLength(port,((ScalarToken)token).doubleValue());
        }
      }
    }
  }
 else {
    super.attributeChanged(attribute);
  }
}

Fixed version (ground truth):
/** 
 * If attribute is <i>messageLength</i> report the new value  to the communication aspect. 
 * @param attribute The changed parameter.
 * @exception IllegalActionException If the parameter set is not valid.Not thrown in this class.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute == messageLength) {
    if (((BooleanToken)enable.getToken()).booleanValue()) {
      IOPort port=(IOPort)getContainer();
      Bus bus=(Bus)getDecorator();
      if (bus != null) {
        Token token=messageLength.getToken();
        if (token != null) {
          _messageLength=((ScalarToken)token).doubleValue();
          bus.setMessageLength(port,_messageLength);
        }
      }
    }
  }
 else {
    super.attributeChanged(attribute);
  }
}
Program: 72818
Project: 72818
Buggy source:
/** 
 * Return a list of the entities deeply contained by the container of this resource scheduler.
 * @return A list of the objects decorated by this decorator.
 */
public List<NamedObj> decoratedObjects(){
  List<NamedObj> list=new ArrayList<NamedObj>();
  CompositeEntity container=(CompositeEntity)getContainer();
  for (  Object object : container.deepEntityList()) {
    if (object instanceof Actor) {
      for (      Object port : ((Actor)object).inputPortList()) {
        list.add((NamedObj)port);
      }
    }
  }
  return list;
}

Fixed version (ground truth):
/** 
 * Return a list of the entities deeply contained by the container of this resource scheduler.
 * @return A list of the objects decorated by this decorator.
 */
public List<NamedObj> decoratedObjects(){
  if (workspace().getVersion() == _decoratedObjectsVersion) {
    return _decoratedObjects;
  }
  _decoratedObjectsVersion=workspace().getVersion();
  List<NamedObj> list=new ArrayList<NamedObj>();
  CompositeEntity container=(CompositeEntity)getContainer();
  for (  Object object : container.deepEntityList()) {
    if (object instanceof Actor) {
      for (      Object port : ((Actor)object).inputPortList()) {
        list.add((NamedObj)port);
      }
    }
  }
  _decoratedObjects=list;
  return list;
}
Program: 72819
Project: 72819
Buggy source:
/** 
 * Clone the actor into the specified workspace.
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException Not thrown here.
 * @return A new CompositeQM.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  CompositeCommunicationAspect newObject=(CompositeCommunicationAspect)super.clone(workspace);
  newObject._parameters=new HashMap<IOPort,List<Attribute>>();
  return newObject;
}

Fixed version (ground truth):
/** 
 * Clone the actor into the specified workspace.
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException Not thrown here.
 * @return A new CompositeQM.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  CompositeCommunicationAspect newObject=(CompositeCommunicationAspect)super.clone(workspace);
  newObject._parameters=new HashMap<IOPort,List<Attribute>>();
  newObject._decoratedObjects=null;
  newObject._decoratedObjectsVersion=-1L;
  return newObject;
}
Program: 72820
Project: 72820
Buggy source:
/** 
 * Override the base class to first set the container, then establish a connection with any decorated objects it finds in scope in the new container.
 * @param container The container to attach this attribute to..
 * @exception IllegalActionException If this attribute is not of theexpected class for the container, or it has no name, or the attribute and container are not in the same workspace, or the proposed container would result in recursive containment.
 * @exception NameDuplicationException If the container already hasan attribute with the name of this attribute.
 * @see #getContainer()
 */
public void setContainer(CompositeEntity container) throws IllegalActionException, NameDuplicationException {
  super.setContainer(container);
  if (container != null) {
    List<NamedObj> decoratedObjects=decoratedObjects();
    for (    NamedObj decoratedObject : decoratedObjects) {
      decoratedObject.getDecoratorAttributes(this);
    }
  }
}

Fixed version (ground truth):
/** 
 * Override the base class to first set the container, then establish a connection with any decorated objects it finds in scope in the new container.
 * @param container The container to attach this attribute to..
 * @exception IllegalActionException If this attribute is not of theexpected class for the container, or it has no name, or the attribute and container are not in the same workspace, or the proposed container would result in recursive containment.
 * @exception NameDuplicationException If the container already hasan attribute with the name of this attribute.
 * @see #getContainer()
 */
public void setContainer(CompositeEntity container) throws IllegalActionException, NameDuplicationException {
  super.setContainer(container);
  if (container != null) {
    List<NamedObj> decoratedObjects=decoratedObjects();
    for (    NamedObj decoratedObject : decoratedObjects) {
      CompositeCommunicationAspectAttributes decoratorAttributes=(CompositeCommunicationAspectAttributes)decoratedObject.getDecoratorAttributes(this);
      setInputPortName((Port)decoratedObject,decoratorAttributes._inputPort);
    }
  }
}
Program: 72821
Project: 72821
Buggy source:
/** 
 * If attribute <i>requestPort</i> report the new value  to the ExecutionAspect. 
 * @param attribute The changed parameter.
 * @exception IllegalActionException If the parameter set is not valid.Not thrown in this class.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute == requestPort) {
    Actor actor=(Actor)getContainer();
    CompositeExecutionAspect aspect=(CompositeExecutionAspect)getDecorator();
    String portName=((StringToken)((Parameter)attribute).getToken()).stringValue();
    if (aspect != null && !portName.equals("String_Node_Str")) {
      aspect.setRequestPort(actor,portName);
    }
  }
 else {
    super.attributeChanged(attribute);
  }
}

Fixed version (ground truth):
/** 
 * If attribute <i>requestPort</i> report the new value  to the ExecutionAspect. 
 * @param attribute The changed parameter.
 * @exception IllegalActionException If the parameter set is not valid.Not thrown in this class.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute == requestPort) {
    Actor actor=(Actor)getContainer();
    CompositeExecutionAspect aspect=(CompositeExecutionAspect)getDecorator();
    String portName=((StringToken)((Parameter)attribute).getToken()).stringValue();
    if (aspect != null && !portName.equals("String_Node_Str") && enabled()) {
      _requestPortName=portName;
      aspect.setRequestPort(actor,_requestPortName);
    }
  }
 else {
    super.attributeChanged(attribute);
  }
}
Program: 72822
Project: 72822
Buggy source:
/** 
 * Create a new actor in the specified container with the specified name.  The name must be unique within the container or an exception is thrown. The container argument must not be null, or a NullPointerException will be thrown.
 * @param container The container.
 * @param name The name of this actor within the container.
 * @exception IllegalActionException If this actor cannot be containedby the proposed container (see the setContainer() method).
 * @exception NameDuplicationException If the name coincides withan entity already in the container.
 */
public CompositeExecutionAspect(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  ColorAttribute attribute=new ColorAttribute(this,"String_Node_Str");
  attribute.setExpression("String_Node_Str");
  _requestPorts=new HashMap<Actor,String>();
  _previousY=new HashMap<NamedObj,Double>();
  justMonitor=new Parameter(this,"String_Node_Str");
  justMonitor.setTypeEquals(BaseType.BOOLEAN);
  justMonitor.setExpression("String_Node_Str");
  _justMonitor=false;
  _lastTimeScheduled=new HashMap<Actor,Time>();
  _executionAspectListeners=new ArrayList<ExecutionAspectListener>();
}

Fixed version (ground truth):
/** 
 * Create a new actor in the specified container with the specified name.  The name must be unique within the container or an exception is thrown. The container argument must not be null, or a NullPointerException will be thrown.
 * @param container The container.
 * @param name The name of this actor within the container.
 * @exception IllegalActionException If this actor cannot be containedby the proposed container (see the setContainer() method).
 * @exception NameDuplicationException If the name coincides withan entity already in the container.
 */
public CompositeExecutionAspect(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  ColorAttribute attribute=new ColorAttribute(this,"String_Node_Str");
  attribute.setExpression("String_Node_Str");
  _previousY=new HashMap<NamedObj,Double>();
  justMonitor=new Parameter(this,"String_Node_Str");
  justMonitor.setTypeEquals(BaseType.BOOLEAN);
  justMonitor.setExpression("String_Node_Str");
  _justMonitor=false;
  _lastTimeScheduled=new HashMap<Actor,Time>();
  _executionAspectListeners=new ArrayList<ExecutionAspectListener>();
}
Program: 72823
Project: 72823
Buggy source:
/** 
 * Set the name of the port that will receive scheduling requests for the actor.
 * @param actor The actor.
 * @param portName The request port.
 */
public void setRequestPort(Actor actor,String portName){
  _requestPorts.put(actor,portName);
}

Fixed version (ground truth):
/** 
 * Set the name of the port that will receive scheduling requests for the actor.
 * @param actor The actor.
 * @param portName The request port.
 */
public void setRequestPort(Actor actor,String portName){
  if (_requestPorts == null) {
    _requestPorts=new HashMap<Actor,String>();
  }
  _requestPorts.put(actor,portName);
}
Program: 72824
Project: 72824
Buggy source:
/** 
 * Override the base class to first set the container, then establish a connection with any decorated objects it finds in scope in the new container.
 * @param container The container to attach this attribute to..
 * @exception IllegalActionException If this attribute is not of theexpected class for the container, or it has no name, or the attribute and container are not in the same workspace, or the proposed container would result in recursive containment.
 * @exception NameDuplicationException If the container already hasan attribute with the name of this attribute.
 * @see #getContainer()
 */
@Override public void setContainer(CompositeEntity container) throws IllegalActionException, NameDuplicationException {
  super.setContainer((CompositeEntity)container);
  if (container != null) {
    List<NamedObj> decoratedObjects=decoratedObjects();
    for (    NamedObj decoratedObject : decoratedObjects) {
      decoratedObject.getDecoratorAttributes(this);
    }
  }
}

Fixed version (ground truth):
/** 
 * Override the base class to first set the container, then establish a connection with any decorated objects it finds in scope in the new container.
 * @param container The container to attach this attribute to..
 * @exception IllegalActionException If this attribute is not of theexpected class for the container, or it has no name, or the attribute and container are not in the same workspace, or the proposed container would result in recursive containment.
 * @exception NameDuplicationException If the container already hasan attribute with the name of this attribute.
 * @see #getContainer()
 */
@Override public void setContainer(CompositeEntity container) throws IllegalActionException, NameDuplicationException {
  super.setContainer((CompositeEntity)container);
  if (container != null) {
    List<NamedObj> decoratedObjects=decoratedObjects();
    for (    NamedObj decoratedObject : decoratedObjects) {
      CompositeExecutionAspectAttributes decoratorAttributes=(CompositeExecutionAspectAttributes)decoratedObject.getDecoratorAttributes(this);
      if (decoratedObject instanceof Actor) {
        setRequestPort((Actor)decoratedObject,decoratorAttributes._requestPortName);
      }
    }
  }
}
Program: 72827
Project: 72827
Buggy source:
/** 
 * Trim the model name from a full name of an actor or an event. 
 * @param name A full name of an actor or an event.
 * @return The trimmed name.
 */
private String _trimModelName(String name){
}

Fixed version (ground truth):
/** 
 * Trim the model name from a full name of an actor or an event.
 * @param name A full name of an actor or an event.
 * @return The trimmed name.
 */
private String _trimModelName(String name){
}
Program: 72828
Project: 72828
Buggy source:
/** 
 * Get the MetroII event associated with the current state and  set the state of the event to be PROPOSED.
 * @return the MetroII event associated with the current state
 */
protected Builder proposeStateEvent(){
  Builder event=getStateEvent();
  event.setStatus(Status.PROPOSED);
  event.clearTime();
  return event;
}

Fixed version (ground truth):
/** 
 * Get the MetroII event associated with the current state and set the state of the event to be PROPOSED.
 * @return the MetroII event associated with the current state
 */
protected Builder proposeStateEvent(){
  Builder event=getStateEvent();
  event.setStatus(Status.PROPOSED);
  event.clearTime();
  return event;
}
Program: 72829
Project: 72829
Buggy source:
/** 
 * Get the MetroII event associated with the current state. 
 * @return the MetroII event associated with the current state.
 */
public Builder getStateEvent(){
}

Fixed version (ground truth):
/** 
 * Get the MetroII event associated with the current state.
 * @return the MetroII event associated with the current state.
 */
public Builder getStateEvent(){
}