nus-yam/ex-repair huggingface dataset:
Program: 74574
Project: 74574
Buggy source:
/** 
 * Read at most one token from the input port and issue a change request to update variables as indicated by the input.
 * @exception IllegalActionException If thrown reading the input.
 */
public boolean postfire() throws IllegalActionException {
  if (input.hasToken(0)) {
    final Token value=input.get(0);
    if (delayed.getToken().equals(BooleanToken.TRUE)) {
      ChangeRequest request=new ChangeRequest(this,"String_Node_Str"){
        protected void _execute() throws IllegalActionException {
          _setValue(value);
        }
      }
;
      request.setPersistent(false);
      request.addChangeListener(this);
      requestChange(request);
    }
 else {
      _setValue(value);
    }
    if (output.getWidth() > 0) {
      output.send(0,value);
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Read at most one token from the input port and issue a change request to update variables as indicated by the input.
 * @exception IllegalActionException If thrown reading the input.
 */
public boolean postfire() throws IllegalActionException {
  if (input.hasToken(0)) {
    final Token value=input.get(0);
    if (delayed.getToken().equals(BooleanToken.TRUE)) {
      if (_setFailed) {
        return false;
      }
      ChangeRequest request=new ChangeRequest(this,"String_Node_Str"){
        protected void _execute() throws IllegalActionException {
          _setValue(value);
        }
      }
;
      request.setPersistent(false);
      request.addChangeListener(this);
      requestChange(request);
    }
 else {
      _setValue(value);
    }
    if (output.getWidth() > 0) {
      output.send(0,value);
    }
  }
  return true;
}
Program: 74575
Project: 74575
Buggy source:
/** 
 * If there is no variable with the specified name, then create one. This is done in preinitialize() so that we can set up a type constraint that ensures that the type of the variable is at least that of the input port.
 * @exception IllegalActionException If the superclass throws it,or if there is no container.
 */
public void preinitialize() throws IllegalActionException {
  super.preinitialize();
  Attribute attribute=getModifiedVariable();
  if (attribute instanceof Variable) {
    ((Variable)attribute).setTypeAtLeast(input);
  }
}

Fixed version (ground truth):
/** 
 * If there is no variable with the specified name, then create one. This is done in preinitialize() so that we can set up a type constraint that ensures that the type of the variable is at least that of the input port.
 * @exception IllegalActionException If the superclass throws it,or if there is no container.
 */
public void preinitialize() throws IllegalActionException {
  super.preinitialize();
  Attribute attribute=getModifiedVariable();
  if (attribute instanceof Variable) {
    ((Variable)attribute).setTypeAtLeast(input);
  }
  _setFailed=false;
}
Program: 74576
Project: 74576
Buggy source:
/** 
 * React to the fact that a change failed by setting a flag that causes an exception to be thrown in next call to prefire() or wrapup().
 * @param change The change request.
 * @param exception The exception that resulted.
 */
public void changeFailed(ChangeRequest change,java.lang.Exception exception){
  MessageHandler.error("String_Node_Str",exception);
}

Fixed version (ground truth):
/** 
 * React to the fact that a change failed by setting a flag that causes an exception to be thrown in next call to prefire() or wrapup().
 * @param change The change request.
 * @param exception The exception that resulted.
 */
public void changeFailed(ChangeRequest change,java.lang.Exception exception){
  _setFailed=true;
  MessageHandler.error("String_Node_Str",exception);
}
Program: 74577
Project: 74577
Buggy source:
/** 
 * Test whether the composite entity is opaque or not. Return <tt>true</tt> if the composite entity is an instance of   {@link CompositeActor} and itis opaque. A composite actor is opaque if it has a director inside, which means the new level of hierarchy that it creates cannot be flattened.
 * @param entity The composite entity to be tested.
 * @return <tt>true</tt> if the composite entity is an instance of {@link CompositeActor} and it is opaque.
 */
private boolean _isOpaque(CompositeEntity entity){
  if (entity instanceof CompositeActor && ((CompositeActor)entity).isOpaque()) {
    return true;
  }
 else {
    NamedObj container=entity.getContainer();
    boolean isOpaque=false;
    while (container != null) {
      List<?> attributeList=container.attributeList(HierarchyFlatteningAttribute.class);
      if (attributeList.isEmpty() && _match.containsValue(container)) {
        attributeList=((NamedObj)_match.getKey(container)).attributeList(HierarchyFlatteningAttribute.class);
      }
      if (!attributeList.isEmpty()) {
        HierarchyFlatteningAttribute attribute=(HierarchyFlatteningAttribute)attributeList.get(0);
        try {
          BooleanToken token=(BooleanToken)attribute.flatteningAttribute.getToken();
          isOpaque=!token.booleanValue();
          break;
        }
 catch (        IllegalActionException e) {
          return false;
        }
      }
      container=container.getContainer();
    }
    return isOpaque;
  }
}

Fixed version (ground truth):
/** 
 * Test whether the composite entity is opaque or not. Return <tt>true</tt> if the composite entity is an instance of   {@link CompositeActor} and itis opaque. A composite actor is opaque if it has a director inside, which means the new level of hierarchy that it creates cannot be flattened.
 * @param entity The composite entity to be tested.
 * @return <tt>true</tt> if the composite entity is an instance of {@link CompositeActor} and it is opaque.
 */
private boolean _isOpaque(CompositeEntity entity){
  if (entity instanceof CompositeActor && ((CompositeActor)entity).isOpaque()) {
    return true;
  }
 else {
    if (entity.getName().equals("String_Node_Str")) {
      boolean x=false;
      x=!x;
    }
    NamedObj container=entity.getContainer();
    boolean isOpaque=false;
    while (container != null) {
      if (_match.containsValue(container)) {
        container=(NamedObj)_match.getKey(container);
      }
 else       if (_temporaryMatch.containsValue(container)) {
        container=(NamedObj)_temporaryMatch.getKey(container);
      }
      List<?> attributeList=container.attributeList(HierarchyFlatteningAttribute.class);
      if (!attributeList.isEmpty()) {
        HierarchyFlatteningAttribute attribute=(HierarchyFlatteningAttribute)attributeList.get(0);
        try {
          BooleanToken token=(BooleanToken)attribute.flatteningAttribute.getToken();
          isOpaque=!token.booleanValue();
          break;
        }
 catch (        IllegalActionException e) {
          return false;
        }
      }
      container=container.getContainer();
    }
    return isOpaque;
  }
}
Program: 74578
Project: 74578
Buggy source:
private boolean _matchPort(Port lhsPort,Port hostPort){
  int matchSize=_match.size();
  boolean success=true;
  _match.put(lhsPort,hostPort);
  if (!_shallowMatchPort(lhsPort,hostPort)) {
    success=false;
  }
  if (success) {
    ObjectList lhsList=new ObjectList();
    lhsList.add(lhsPort.getContainer());
    Path lhsPath=new Path(lhsPort);
    Set<Relation> visitedRelations=new HashSet<Relation>();
    Set<Port> visitedPorts=new HashSet<Port>();
    boolean foundPath=_findFirstPath(lhsPort,lhsPath,visitedRelations,visitedPorts);
    while (foundPath) {
      lhsList.add(lhsPath.clone());
      foundPath=_findNextPath(lhsPath,visitedRelations,visitedPorts);
    }
    ObjectList hostList=new ObjectList();
    hostList.add(hostPort.getContainer());
    Path hostPath=new Path(hostPort);
    visitedRelations=new HashSet<Relation>();
    visitedPorts=new HashSet<Port>();
    foundPath=_findFirstPath(hostPort,hostPath,visitedRelations,visitedPorts);
    while (foundPath) {
      hostList.add(hostPath.clone());
      foundPath=_findNextPath(hostPath,visitedRelations,visitedPorts);
    }
    success=_matchObject(lhsList,hostList);
  }
  if (!success) {
    _match.retain(matchSize);
  }
  return success;
}

Fixed version (ground truth):
private boolean _matchPort(Port lhsPort,Port hostPort){
  int matchSize=_match.size();
  boolean success=true;
  NamedObj lhsContainer=null;
  NamedObj hostContainer=null;
  _match.put(lhsPort,hostPort);
  if (!_shallowMatchPort(lhsPort,hostPort)) {
    success=false;
  }
  if (success) {
    lhsContainer=lhsPort.getContainer();
    hostContainer=hostPort.getContainer();
    Object lhsMatch=_match.get(lhsContainer);
    if (lhsMatch != null && lhsMatch != hostContainer) {
      success=false;
    }
 else {
      Object hostMatch=_match.getKey(hostContainer);
      if (hostMatch != null && hostMatch != lhsContainer) {
        success=false;
      }
    }
  }
  if (success) {
    _temporaryMatch.put(lhsContainer,hostContainer);
    ObjectList lhsList=new ObjectList();
    lhsList.add(lhsContainer);
    Path lhsPath=new Path(lhsPort);
    Set<Relation> visitedRelations=new HashSet<Relation>();
    Set<Port> visitedPorts=new HashSet<Port>();
    boolean foundPath=_findFirstPath(lhsPort,lhsPath,visitedRelations,visitedPorts);
    while (foundPath) {
      lhsList.add(lhsPath.clone());
      foundPath=_findNextPath(lhsPath,visitedRelations,visitedPorts);
    }
    ObjectList hostList=new ObjectList();
    hostList.add(hostContainer);
    Path hostPath=new Path(hostPort);
    visitedRelations=new HashSet<Relation>();
    visitedPorts=new HashSet<Port>();
    foundPath=_findFirstPath(hostPort,hostPath,visitedRelations,visitedPorts);
    while (foundPath) {
      hostList.add(hostPath.clone());
      foundPath=_findNextPath(hostPath,visitedRelations,visitedPorts);
    }
    _temporaryMatch.remove(lhsContainer);
    success=_matchObject(lhsList,hostList);
  }
  if (!success) {
    _match.retain(matchSize);
  }
  return success;
}
Program: 74579
Project: 74579
Buggy source:
private void _removeEditorIcons(){
  for (  Object editorIconObject : attributeList(EditorIcon.class)) {
    EditorIcon editorIcon=(EditorIcon)editorIconObject;
    String moml="String_Node_Str" + editorIcon.getName() + "String_Node_Str";
    MoMLChangeRequest request=new MoMLChangeRequest(this,AtomicActorMatcher.this,moml);
    request.execute();
  }
}

Fixed version (ground truth):
private void _removeEditorIcons(){
  for (  Object editorIconObject : attributeList(EditorIcon.class)) {
    EditorIcon editorIcon=(EditorIcon)editorIconObject;
    String moml="String_Node_Str" + editorIcon.getName() + "String_Node_Str";
    MoMLChangeRequest request=new MoMLChangeRequest(this,this,moml);
    request.execute();
  }
}
Program: 74581
Project: 74581
Buggy source:
/** 
 * Return a new matrix that is a sub-matrix of this matrix.
 * @param rowStart The row to start on.
 * @param colStart The column to start on.
 * @param rowSpan The number of rows to copy.
 * @param colSpan The number of columns to copy.
 * @return a sub-matrix of this matrix.
 * @exception If the returned matrix is empty or if the specifiedparameters result in out of bounds accesses.
 */
public MatrixToken crop(int rowStart,int colStart,int rowSpan,int colSpan) throws IllegalActionException {
  FixPoint[][] value=this.fixMatrix();
  try {
    FixPoint[][] result=new FixPoint[rowSpan][colSpan];
    for (int i=0; i < rowSpan; i++) {
      System.arraycopy(value[rowStart + i],colStart,result[i],0,colSpan);
    }
    return new FixMatrixToken(result);
  }
 catch (  ArrayIndexOutOfBoundsException ex) {
    throw new IllegalActionException("String_Node_Str" + rowStart + "String_Node_Str"+ colStart+ "String_Node_Str"+ rowSpan+ "String_Node_Str"+ colSpan+ "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Return a new matrix that is a sub-matrix of this matrix.
 * @param rowStart The row to start on.
 * @param colStart The column to start on.
 * @param rowSpan The number of rows to copy.
 * @param colSpan The number of columns to copy.
 * @return a sub-matrix of this matrix.
 * @exception IllegalActionException If the returned matrix isempty or if the specified parameters result in out of bounds accesses.
 */
public MatrixToken crop(int rowStart,int colStart,int rowSpan,int colSpan) throws IllegalActionException {
  FixPoint[][] value=this.fixMatrix();
  try {
    FixPoint[][] result=new FixPoint[rowSpan][colSpan];
    for (int i=0; i < rowSpan; i++) {
      System.arraycopy(value[rowStart + i],colStart,result[i],0,colSpan);
    }
    return new FixMatrixToken(result);
  }
 catch (  ArrayIndexOutOfBoundsException ex) {
    throw new IllegalActionException("String_Node_Str" + rowStart + "String_Node_Str"+ colStart+ "String_Node_Str"+ rowSpan+ "String_Node_Str"+ colSpan+ "String_Node_Str");
  }
}
Program: 74582
Project: 74582
Buggy source:
private boolean _loadActorIcon(String actorClassName){
  CompositeActor container=new CompositeActor();
  String moml="String_Node_Str" + actorClassName + "String_Node_Str";
  container.requestChange(new LoadActorIconChangeRequest(container,moml));
  return true;
}

Fixed version (ground truth):
private void _loadActorIcon(String actorClassName){
  CompositeActor container=new CompositeActor();
  String moml="String_Node_Str" + actorClassName + "String_Node_Str";
  container.requestChange(new LoadActorIconChangeRequest(container,moml));
}
Program: 74583
Project: 74583
Buggy source:
public AtomicActorMatcher(CompositeEntity container,String name) throws NameDuplicationException, IllegalActionException {
  super(container,name);
  ruleListAttribute=new RuleListAttribute(this,"String_Node_Str");
  ruleListAttribute.setExpression("String_Node_Str");
  _attachText("String_Node_Str",_ICON_DESCRIPTION);
}

Fixed version (ground truth):
public AtomicActorMatcher(CompositeEntity container,String name) throws NameDuplicationException, IllegalActionException {
  super(container,name);
  ruleListAttribute=new RuleListAttribute(this,"String_Node_Str");
  ruleListAttribute.setExpression("String_Node_Str");
}
Program: 74585
Project: 74585
Buggy source:
private void _removeEditorIcons(){
  for (  Object editorIconObject : attributeList(EditorIcon.class)) {
    EditorIcon editorIcon=(EditorIcon)editorIconObject;
    String moml="String_Node_Str" + editorIcon.getName() + "String_Node_Str";
    new MoMLChangeRequest(this,AtomicActorMatcher.this,moml).execute();
  }
}

Fixed version (ground truth):
private void _removeEditorIcons(){
  for (  Object editorIconObject : attributeList(EditorIcon.class)) {
    EditorIcon editorIcon=(EditorIcon)editorIconObject;
    String moml="String_Node_Str" + editorIcon.getName() + "String_Node_Str";
    MoMLChangeRequest request=new MoMLChangeRequest(this,AtomicActorMatcher.this,moml);
    request.execute();
  }
}
Program: 74586
Project: 74586
Buggy source:
private void _setIconDescription(String iconDescription){
  String moml="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + iconDescription + "String_Node_Str"+ "String_Node_Str";
  new MoMLChangeRequest(this,AtomicActorMatcher.this,moml).execute();
}

Fixed version (ground truth):
private void _setIconDescription(String iconDescription){
  String moml="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + iconDescription + "String_Node_Str"+ "String_Node_Str";
  MoMLChangeRequest request=new MoMLChangeRequest(this,AtomicActorMatcher.this,moml);
  request.execute();
}
Program: 74587
Project: 74587
Buggy source:
protected void _execute(){
  try {
    super._execute();
    ComponentEntity actor=(ComponentEntity)_container.entityList().get(0);
    ConfigurableAttribute actorAttribute=(ConfigurableAttribute)actor.getAttribute("String_Node_Str");
    String iconDescription=actorAttribute.getConfigureText();
    _setIconDescription(iconDescription);
    List<?> editorIconList=actor.attributeList(EditorIcon.class);
    _removeEditorIcons();
    for (    Object editorIconObject : editorIconList) {
      EditorIcon editorIcon=(EditorIcon)editorIconObject;
      editorIcon.setName("String_Node_Str");
      String iconMoML=editorIcon.exportMoML();
      new MoMLChangeRequest(this,AtomicActorMatcher.this,iconMoML).execute();
    }
  }
 catch (  Exception e) {
    _removeEditorIcons();
    _setIconDescription(_ICON_DESCRIPTION);
  }
}

Fixed version (ground truth):
protected void _execute() throws Exception {
  _removeEditorIcons();
  _setIconDescription(_ICON_DESCRIPTION);
}
Program: 74588
Project: 74588
Buggy source:
private boolean _loadActorIcon(String actorClassName){
  try {
    Class<?> actorClass=Class.forName(actorClassName);
    CompositeActor container=new CompositeActor();
    String moml="String_Node_Str" + "String_Node_Str" + actorClassName + "String_Node_Str"+ "String_Node_Str";
    container.requestChange(new MoMLChangeRequest(this,container,moml));
    ComponentEntity actor=(ComponentEntity)container.entityList(actorClass).get(0);
    ConfigurableAttribute actorAttribute=(ConfigurableAttribute)actor.getAttribute("String_Node_Str");
    String iconDescription=actorAttribute.getConfigureText();
    _setIconDescription(iconDescription);
    List<?> editorIconList=actor.attributeList(EditorIcon.class);
    if (editorIconList.isEmpty()) {
      _removeEditorIcons();
    }
 else {
      for (      Object editorIconObject : editorIconList) {
        if (!editorIconObject.getClass().getName().equals("String_Node_Str")) {
          continue;
        }
        EditorIcon editorIcon=(EditorIcon)editorIconObject;
        requestChange(new MoMLChangeRequest(this,this,editorIcon.exportMoML()));
      }
    }
    return true;
  }
 catch (  ClassNotFoundException e) {
    return false;
  }
}

Fixed version (ground truth):
private boolean _loadActorIcon(String actorClassName){
  CompositeActor container=new CompositeActor();
  String moml="String_Node_Str" + actorClassName + "String_Node_Str";
  container.requestChange(new LoadActorIconChangeRequest(container,moml));
  return true;
}
Program: 74590
Project: 74590
Buggy source:
private void _removeEditorIcons(){
  for (  Object editorIconObject : attributeList(EditorIcon.class)) {
    EditorIcon editorIcon=(EditorIcon)editorIconObject;
    String moml="String_Node_Str" + editorIcon.getName() + "String_Node_Str";
    requestChange(new MoMLChangeRequest(this,this,moml));
  }
}

Fixed version (ground truth):
private void _removeEditorIcons(){
  for (  Object editorIconObject : attributeList(EditorIcon.class)) {
    EditorIcon editorIcon=(EditorIcon)editorIconObject;
    String moml="String_Node_Str" + editorIcon.getName() + "String_Node_Str";
    new MoMLChangeRequest(this,AtomicActorMatcher.this,moml).execute();
  }
}
Program: 74591
Project: 74591
Buggy source:
private void _setIconDescription(String iconDescription){
  String moml="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + iconDescription + "String_Node_Str"+ "String_Node_Str";
  requestChange(new MoMLChangeRequest(this,this,moml));
}

Fixed version (ground truth):
private void _setIconDescription(String iconDescription){
  String moml="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + iconDescription + "String_Node_Str"+ "String_Node_Str";
  new MoMLChangeRequest(this,AtomicActorMatcher.this,moml).execute();
}
Program: 74592
Project: 74592
Buggy source:
public AtomicActorMatcher(CompositeEntity container,String name) throws NameDuplicationException, IllegalActionException {
  super(container,name);
  ruleListAttribute=new RuleListAttribute(this,"String_Node_Str");
  ruleListAttribute.setExpression("String_Node_Str");
}

Fixed version (ground truth):
public AtomicActorMatcher(CompositeEntity container,String name) throws NameDuplicationException, IllegalActionException {
  super(container,name);
  ruleListAttribute=new RuleListAttribute(this,"String_Node_Str");
  ruleListAttribute.setExpression("String_Node_Str");
  _attachText("String_Node_Str",_ICON_DESCRIPTION);
}
Program: 74593
Project: 74593
Buggy source:
public void focusLost(FocusEvent e){
  if (_textField.isEnabled()) {
    hidePopup();
    if (_textField.isEditable()) {
      setSelectedItem(_textField.getText());
    }
  }
}

Fixed version (ground truth):
public void focusLost(FocusEvent e){
  hidePopup();
  if (_textField.isEditable()) {
    setSelectedItem(_textField.getText());
    _textField.getCaret().setVisible(false);
  }
}
Program: 74594
Project: 74594
Buggy source:
public void focusGained(FocusEvent e){
}

Fixed version (ground truth):
public void focusGained(FocusEvent e){
  if (_textField.isEditable()) {
    _textField.getCaret().setVisible(true);
  }
}
Program: 74595
Project: 74595
Buggy source:
public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
  JPanel panel=(JPanel)value;
  _setCaretForAllJTextFields(panel,false);
  return panel;
}

Fixed version (ground truth):
public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
  JPanel panel=(JPanel)value;
  _setCaretForAllTextFields(panel,false);
  return panel;
}
Program: 74596
Project: 74596
Buggy source:
public Component getTableCellEditorComponent(JTable table,Object value,boolean isSelected,int row,int column){
  JPanel panel=(JPanel)value;
  _setCaretForAllJTextFields(panel,true);
  _currentValue=panel;
  return panel;
}

Fixed version (ground truth):
public Component getTableCellEditorComponent(JTable table,Object value,boolean isSelected,int row,int column){
  JPanel panel=(JPanel)value;
  _setCaretForAllTextFields(panel,true);
  _currentValue=panel;
  return panel;
}
Program: 74597
Project: 74597
Buggy source:
Editor(){
  _textField.setEditable(false);
  _textField.setOpaque(true);
  _textField.addMouseListener(this);
  _textField.addFocusListener(this);
}

Fixed version (ground truth):
Editor(){
  _textField.setEditable(false);
  _textField.setOpaque(true);
  _textField.addMouseListener(this);
  _textField.addFocusListener(this);
  _textField.addActionListener(this);
}
Program: 74600
Project: 74600
Buggy source:
/** 
 * Clone to create a copy of the master copy. 
 */
private Object _cloneClone(Workspace workspace) throws CloneNotSupportedException {
  MultiInstanceComposite newObject=(MultiInstanceComposite)super.clone(workspace);
  newObject._isMasterCopy=false;
  try {
    new Attribute(newObject,"String_Node_Str");
  }
 catch (  KernelException e) {
  }
  return newObject;
}

Fixed version (ground truth):
/** 
 * Clone to create a copy of the master copy. 
 */
private Object _cloneClone(Workspace workspace) throws CloneNotSupportedException {
  MultiInstanceComposite newObject=(MultiInstanceComposite)super.clone(workspace);
  newObject._isMasterCopy=false;
  newObject.setPersistent(false);
  try {
    new Attribute(newObject,"String_Node_Str");
  }
 catch (  KernelException e) {
  }
  return newObject;
}
Program: 74601
Project: 74601
Buggy source:
private boolean _loadActorIcon(String actorClassName){
  try {
    Class<?> actorClass=Class.forName(actorClassName);
    CompositeActor container=new CompositeActor();
    String moml="String_Node_Str" + "String_Node_Str" + actorClassName + "String_Node_Str"+ "String_Node_Str";
    container.requestChange(new MoMLChangeRequest(this,container,moml));
    ComponentEntity actor=(ComponentEntity)container.entityList(actorClass).get(0);
    ConfigurableAttribute actorAttribute=(ConfigurableAttribute)actor.getAttribute("String_Node_Str");
    String iconDescription=actorAttribute.getConfigureText();
    _setIconDescription(iconDescription);
    _removeEditorIcons();
    List<?> editorIconList=actor.attributeList(EditorIcon.class);
    for (    Object editorIconObject : editorIconList) {
      if (!editorIconObject.getClass().getName().equals("String_Node_Str")) {
        continue;
      }
      EditorIcon editorIcon=(EditorIcon)editorIconObject;
      requestChange(new MoMLChangeRequest(this,this,editorIcon.exportMoML()));
    }
    return true;
  }
 catch (  Exception e) {
    return false;
  }
}

Fixed version (ground truth):
private boolean _loadActorIcon(String actorClassName){
  try {
    Class<?> actorClass=Class.forName(actorClassName);
    CompositeActor container=new CompositeActor();
    String moml="String_Node_Str" + "String_Node_Str" + actorClassName + "String_Node_Str"+ "String_Node_Str";
    container.requestChange(new MoMLChangeRequest(this,container,moml));
    ComponentEntity actor=(ComponentEntity)container.entityList(actorClass).get(0);
    ConfigurableAttribute actorAttribute=(ConfigurableAttribute)actor.getAttribute("String_Node_Str");
    String iconDescription=actorAttribute.getConfigureText();
    _setIconDescription(iconDescription);
    _removeEditorIcons();
    List<?> editorIconList=actor.attributeList(EditorIcon.class);
    for (    Object editorIconObject : editorIconList) {
      if (!editorIconObject.getClass().getName().equals("String_Node_Str")) {
        continue;
      }
      EditorIcon editorIcon=(EditorIcon)editorIconObject;
      requestChange(new MoMLChangeRequest(this,this,editorIcon.exportMoML()));
    }
    return true;
  }
 catch (  ClassNotFoundException e) {
    return false;
  }
}
Program: 74602
Project: 74602
Buggy source:
public Iterator<E> iterator(){
  return null;
}

Fixed version (ground truth):
public Iterator<E> iterator(){
  throw new KernelRuntimeException("String_Node_Str");
}
Program: 74604
Project: 74604
Buggy source:
/** 
 * Return a list of names corresponding to the identifiers defined by this scope.  If an identifier is returned in this list, then get() and getType() will return a value for the identifier.  Note that generally speaking, this list is extremely expensive to compute, and users should avoid calling it.  It is primarily used for debugging purposes.
 * @exception IllegalActionException If constructing the listcauses it.
 */
public Set identifierSet() throws IllegalActionException {
  try {
    Set<String> out=_getParameters();
    out.addAll(_variables.keySet());
    return out;
  }
 catch (  PtalonScopeException ex) {
    ex.printStackTrace();
    throw new IllegalActionException("String_Node_Str" + ex.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Return a list of names corresponding to the identifiers defined by this scope.  If an identifier is returned in this list, then get() and getType() will return a value for the identifier.  Note that generally speaking, this list is extremely expensive to compute, and users should avoid calling it.  It is primarily used for debugging purposes.
 * @return A set of identifier names.
 * @exception IllegalActionException If constructing the listcauses it.
 */
public Set identifierSet() throws IllegalActionException {
  try {
    Set<String> out=_getParameters();
    out.addAll(_variables.keySet());
    return out;
  }
 catch (  PtalonScopeException ex) {
    ex.printStackTrace();
    throw new IllegalActionException("String_Node_Str" + ex.getMessage());
  }
}
Program: 74605
Project: 74605
Buggy source:
/** 
 * Return true if we are in the main scope or the true part of a true branch.
 * @return true if in main scope or true part of a true branch.
 */
public boolean getCurrentBranch(){
  return _currentBranch;
}

Fixed version (ground truth):
/** 
 * Return true if we are in the main scope or the true part of a true branch.
 * @return true if in main scope or true part of a true branch.
 * @see #setCurrentBranch
 */
public boolean getCurrentBranch(){
  return _currentBranch;
}
Program: 74606
Project: 74606
Buggy source:
/** 
 * Look up and return the type of the value with the specified name in the scope. Return null if the name is not defined in this scope.
 * @return The token associated with the given name in thescope.
 * @exception IllegalActionException If a value in the scopeexists with the given name, but cannot be evaluated.
 */
public Type getType(String name) throws IllegalActionException {
  try {
    if (_variables.containsKey(name)) {
      return _variables.get(name).getType();
    }
    if (!_getTypeForScope(name).equals("String_Node_Str")) {
      throw new IllegalActionException(name + "String_Node_Str");
    }
    return _getTypeOf(name);
  }
 catch (  PtalonScopeException ex) {
    return null;
  }
catch (  PtalonRuntimeException ex) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Look up and return the type of the variable or parameter with the specified name in the scope. Return null if the name is not defined in this scope.
 * @param name The name of the variable or parameter.
 * @return The token associated with the given name in thescope.
 * @exception IllegalActionException If a value in the scopeexists with the given name, but cannot be evaluated.
 */
public Type getType(String name) throws IllegalActionException {
  try {
    if (_variables.containsKey(name)) {
      return _variables.get(name).getType();
    }
    if (!_getTypeForScope(name).equals("String_Node_Str")) {
      throw new IllegalActionException(name + "String_Node_Str");
    }
    return _getTypeOf(name);
  }
 catch (  PtalonScopeException ex) {
    return null;
  }
catch (  PtalonRuntimeException ex) {
    return null;
  }
}
Program: 74607
Project: 74607
Buggy source:
/** 
 * Look up and return the type term for the specified name in the scope. Return null if the name is not defined in this scope, or is a constant type.
 * @return The InequalityTerm associated with the given namein the scope.
 * @exception IllegalActionException If a value in the scopeexists with the given name, but cannot be evaluated.
 */
public InequalityTerm getTypeTerm(String name) throws IllegalActionException {
  try {
    if (_variables.containsKey(name)) {
      return null;
    }
    if (!_getTypeForScope(name).equals("String_Node_Str")) {
      throw new IllegalActionException(name + "String_Node_Str");
    }
    return _getTypeTermOf(name);
  }
 catch (  PtalonScopeException ex) {
    return null;
  }
catch (  PtalonRuntimeException ex) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Look up and return the type term for the variable or parameter with the specified name in the scope. Return null if the name is not defined in this scope, or is a constant type.
 * @param name The name of the variable or parameter.
 * @return The InequalityTerm associated with the given namein the scope.
 * @exception IllegalActionException If a value in the scopeexists with the given name, but cannot be evaluated.
 */
public InequalityTerm getTypeTerm(String name) throws IllegalActionException {
  try {
    if (_variables.containsKey(name)) {
      return null;
    }
    if (!_getTypeForScope(name).equals("String_Node_Str")) {
      throw new IllegalActionException(name + "String_Node_Str");
    }
    return _getTypeTermOf(name);
  }
 catch (  PtalonScopeException ex) {
    return null;
  }
catch (  PtalonRuntimeException ex) {
    return null;
  }
}
Program: 74608
Project: 74608
Buggy source:
/** 
 * Set the active branch to true or false.
 * @param branch The branch to set it to.
 */
public void setActiveBranch(boolean branch){
  _activeBranch=branch;
}

Fixed version (ground truth):
/** 
 * Set the active branch to true or false.
 * @param branch The branch to set it to.
 * @see #getActiveBranch
 */
public void setActiveBranch(boolean branch){
  _activeBranch=branch;
}
Program: 74609
Project: 74609
Buggy source:
/** 
 * Get the iteration (number of times this if/for block has been entered) in which this symbol is created.
 * @param symbol The symbol created.
 */
public int getEnteredIteration(String symbol){
  Integer entered=_createdIteration.get(symbol);
  if (entered == null) {
    return 0;
  }
  return entered;
}

Fixed version (ground truth):
/** 
 * Get the iteration (number of times this if/for block has been entered) in which this symbol is created.
 * @param symbol The symbol created.
 * @return The interation number.
 * @see #setEnteredIteration
 */
public int getEnteredIteration(String symbol){
  Integer entered=_createdIteration.get(symbol);
  if (entered == null) {
    return 0;
  }
  return entered;
}
Program: 74611
Project: 74611
Buggy source:
/** 
 * Look up and return the value with the specified name in the scope. Return null if the name is not defined in this scope.
 * @return The token associated with the given name in thescope.
 * @exception IllegalActionException If a value in the scopeexists with the given name, but cannot be evaluated.
 */
public Token get(String name) throws IllegalActionException {
  try {
    if (_variables.containsKey(name)) {
      return _variables.get(name);
    }
    if (!_getTypeForScope(name).equals("String_Node_Str")) {
      throw new IllegalActionException(name + "String_Node_Str");
    }
    return _getValueOf(name);
  }
 catch (  PtalonScopeException ex) {
    return null;
  }
catch (  PtalonRuntimeException ex) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Look up and return the value of the variable or parameter with the specified name in the scope. Return null if the name is not defined in this scope.
 * @param name The name of the variable or parameter.
 * @return The token associated with the given name in thescope.
 * @exception IllegalActionException If a value in the scopeexists with the given name, but cannot be evaluated.
 */
public Token get(String name) throws IllegalActionException {
  try {
    if (_variables.containsKey(name)) {
      return _variables.get(name);
    }
    if (!_getTypeForScope(name).equals("String_Node_Str")) {
      throw new IllegalActionException(name + "String_Node_Str");
    }
    return _getValueOf(name);
  }
 catch (  PtalonScopeException ex) {
    return null;
  }
catch (  PtalonRuntimeException ex) {
    return null;
  }
}
Program: 74612
Project: 74612
Buggy source:
/** 
 * Push into the scope of a new if statement contained as a sublock of the current if statement.
 */
public void pushIfStatement(){
  String name=_getNextIfSymbol();
  _currentIfTree=_currentIfTree.addChild(name);
}

Fixed version (ground truth):
/** 
 * Push into the scope of a new if statement contained as a sub-block of the current if statement.
 */
public void pushIfStatement(){
  String name=_getNextIfSymbol();
  _currentIfTree=_currentIfTree.addChild(name);
}
Program: 74613
Project: 74613
Buggy source:
/** 
 * Push into the scope of a new for statement contained
 * @param variable The variable associated with the for statement.
 * @param initExpr The expression representing the initial valuefor the variable.
 * @param satExpr The expression evaluated before executing thefor statement body.
 */
public void pushForStatement(String variable,String initExpr,String satExpr){
  String name=_getNextIfSymbol();
  _currentIfTree=_currentIfTree.addChild(name);
  _currentIfTree.isForStatement=true;
  _currentIfTree.variable=variable;
  _currentIfTree.initExpr=initExpr;
  _currentIfTree.satExpr=satExpr;
}

Fixed version (ground truth):
/** 
 * Push into the scope of a new for statement contained as a  sub-block of the current (FIXME: if or for) statement.
 * @param variable The variable associated with the for statement.
 * @param initExpr The expression representing the initial valuefor the variable.
 * @param satExpr The expression evaluated before executing thefor statement body.
 */
public void pushForStatement(String variable,String initExpr,String satExpr){
  String name=_getNextIfSymbol();
  _currentIfTree=_currentIfTree.addChild(name);
  _currentIfTree.isForStatement=true;
  _currentIfTree.variable=variable;
  _currentIfTree.initExpr=initExpr;
  _currentIfTree.satExpr=satExpr;
}
Program: 74614
Project: 74614
Buggy source:
/** 
 * Return the active branch, which may be null if it has not yet been set.
 * @return the active branch
 */
public Boolean getActiveBranch(){
  return _activeBranch;
}

Fixed version (ground truth):
/** 
 * Return the active branch, which may be null if it has not yet been set.
 * @return the active branch
 * @see #setActiveBranch
 */
public Boolean getActiveBranch(){
  return _activeBranch;
}
Program: 74615
Project: 74615
Buggy source:
/** 
 * Set the current branch that's being walked.
 * @param branch True if the true branch is being walked.
 */
public void setCurrentBranch(boolean branch){
  _currentBranch=branch;
}

Fixed version (ground truth):
/** 
 * Set the current branch that's being walked.
 * @param branch True if the true branch is being walked.
 * @see #getCurrentBranch
 */
public void setCurrentBranch(boolean branch){
  _currentBranch=branch;
}
Program: 74616
Project: 74616
Buggy source:
/** 
 * Set the iteration (number of times this if/for block has been entered) in which this symbol is created.
 * @param symbol The symbol created.
 * @param iteration The iteration of the symbol.
 */
public void setEnteredIteration(String symbol,int iteration){
  _createdIteration.put(symbol,iteration);
}

Fixed version (ground truth):
/** 
 * Set the iteration (number of times this if/for block has been entered) in which this symbol is created.
 * @param symbol The symbol created.
 * @param iteration The iteration of the symbol.
 * @see #getEnteredIteration
 */
public void setEnteredIteration(String symbol,int iteration){
  _createdIteration.put(symbol,iteration);
}
Program: 74617
Project: 74617
Buggy source:
/** 
 * @return The children of this tree.
 */
public List<TreeType> getChildren(){
  return _children;
}

Fixed version (ground truth):
/** 
 * Returns the children of this tree.
 * @return The children of this tree.
 */
public List<TreeType> getChildren(){
  return _children;
}
Program: 74618
Project: 74618
Buggy source:
/** 
 * Create a new tree with the specified parent.  This is null if the tree to create is a root.  
 * @param parent The parent for this tree.
 */
public NamedTree(TreeType parent,String name){
  _name=name;
  _parent=parent;
  _children=new LinkedList<TreeType>();
}

Fixed version (ground truth):
/** 
 * Create a new tree with the specified parent.  This is null if the tree to create is a root.  
 * @param parent The parent for this tree.
 * @param name The name for this tree.
 */
public NamedTree(TreeType parent,String name){
  _name=name;
  _parent=parent;
  _children=new LinkedList<TreeType>();
}
Program: 74619
Project: 74619
Buggy source:
/** 
 * @return The parent of this tree.
 */
public TreeType getParent(){
  return _parent;
}

Fixed version (ground truth):
/** 
 * Returns the parent of this tree.
 * @return The parent of this tree.
 */
public TreeType getParent(){
  return _parent;
}
Program: 74620
Project: 74620
Buggy source:
/** 
 * @return The name associated with this tree.
 */
public String getName(){
  return _name;
}

Fixed version (ground truth):
/** 
 * Returns the name associated with this tree.
 * @return The name associated with this tree.
 */
public String getName(){
  return _name;
}
Program: 74621
Project: 74621
Buggy source:
/** 
 * @return The ancestors of this tree, not includingthis tree.
 */
public List<TreeType> getProperAncestors(){
  LinkedList<TreeType> list=new LinkedList<TreeType>();
  TreeType next=_parent;
  while (next != null) {
    list.addFirst(next);
    next=(TreeType)next.getParent();
  }
  return list;
}

Fixed version (ground truth):
/** 
 * Return the ancestors of this tree, not including this tree.
 * @return The ancestors of this tree, not includingthis tree.
 */
public List<TreeType> getProperAncestors(){
  LinkedList<TreeType> list=new LinkedList<TreeType>();
  TreeType next=_parent;
  while (next != null) {
    list.addFirst(next);
    next=(TreeType)next.getParent();
  }
  return list;
}
Program: 74622
Project: 74622
Buggy source:
/** 
 * @param name The name for the desired child.
 * @return A child with the specified name, if thereis any, or null otherwise. 
 */
public TreeType getChild(String name){
  for (  TreeType child : _children) {
    if (child.getName().equals(name)) {
      return child;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the child with the specified name.
 * @param name The name for the desired child.
 * @return A child with the specified name, if thereis any, or null otherwise. 
 */
public TreeType getChild(String name){
  for (  TreeType child : _children) {
    if (child.getName().equals(name)) {
      return child;
    }
  }
  return null;
}
Program: 74623
Project: 74623
Buggy source:
public NestedActorManager getActorManager(){
  return _codeManager;
}

Fixed version (ground truth):
/** 
 * FIXME: this doesn't seem to be used.  Rename to getCodeManager? Get the code manager.
 * @return The code manager.
 */
public NestedActorManager getActorManager(){
  return _codeManager;
}
Program: 74624
Project: 74624
Buggy source:
/** 
 * Set the depth of this actor declaration with respect to its creator.  If this is not created by another PtalonActor's code, then the depth will be zero.  If however, this actor is named Bar in some PtalonCode, and it is created with Foo(a := Bar()), then it's depth will be 2, and the corresponding Foo container will have depth 1.
 * @param depth The of this actor declaration with respect to itscreator.
 */
public void setNestedDepth(int depth){
  _nestedDepth=depth;
}

Fixed version (ground truth):
/** 
 * Set the depth of this actor declaration with respect to its creator.  If this is not created by another PtalonActor's code, then the depth will be zero.  If however, this actor is named Bar in some PtalonCode, and it is created with Foo(a := Bar()), then it's depth will be 2, and the corresponding Foo container will have depth 1.
 * @param depth The of this actor declaration with respect to itscreator.
 * @see #getNestedDepth
 */
public void setNestedDepth(int depth){
  _nestedDepth=depth;
}
Program: 74625
Project: 74625
Buggy source:
/** 
 * Return the depth of this actor declaration with respect to its creator.  If this is not created by another PtalonActor's code, then the depth will be zero.  If however, this actor is named Bar in some PtalonCode, and it is created with Foo(a := Bar()), then it's depth will be 2, and the corresponding Foo container will have depth 1.
 * @return The depth of this actor declaration with respect toits creator.
 */
public int getNestedDepth(){
  return _nestedDepth;
}

Fixed version (ground truth):
/** 
 * Return the depth of this actor declaration with respect to its creator.  If this is not created by another PtalonActor's code, then the depth will be zero.  If however, this actor is named Bar in some PtalonCode, and it is created with Foo(a := Bar()), then it's depth will be 2, and the corresponding Foo container will have depth 1.
 * @return The depth of this actor declaration with respect toits creator.
 * @see #setNestedDepth
 */
public int getNestedDepth(){
  return _nestedDepth;
}
Program: 74626
Project: 74626
Buggy source:
/** 
 * Create a PtalonRuntimeException
 * @param message An explanation of the offense.
 * @param cause The cause of the offense.
 */
public PtalonRuntimeException(String message,Throwable cause){
  super(message,cause);
}

Fixed version (ground truth):
/** 
 * Create a PtalonRuntimeException.
 * @param message An explanation of the offense.
 * @param cause The cause of the offense.
 */
public PtalonRuntimeException(String message,Throwable cause){
  super(message,cause);
}
Program: 74627
Project: 74627
Buggy source:
/** 
 * Generate a Ptalon ScopeException
 * @param message An explanation of the offense.
 * @param cause The cause of the offense.
 */
public PtalonScopeException(String message,Throwable cause){
  super(message,cause);
}

Fixed version (ground truth):
/** 
 * Generate a Ptalon ScopeException.
 * @param message An explanation of the offense.
 * @param cause The cause of the offense.
 */
public PtalonScopeException(String message,Throwable cause){
  super(message,cause);
}
Program: 74629
Project: 74629
Buggy source:
/** 
 * Get an expression representing this actor tree, like a := b(c := d())(n := <2/>)
 * @return A string containing the expression.
 * @throws PtalonRuntimeException
 */
public String getExpression() throws PtalonRuntimeException {
  if (_actorParameter == null) {
    throw new PtalonRuntimeException("String_Node_Str");
  }
  String type="String_Node_Str";
  try {
    type=_getType(_symbol);
  }
 catch (  PtalonScopeException ex) {
    throw new PtalonRuntimeException("String_Node_Str",ex);
  }
  String output="String_Node_Str";
  if (type.equals("String_Node_Str")) {
    output+="String_Node_Str" + _imports.get(_symbol);
  }
 else   if (type.equals("String_Node_Str")) {
    Parameter parameter=_actor.getPtalonParameter(_symbol);
    output+=parameter.getExpression();
  }
 else {
    throw new PtalonRuntimeException("String_Node_Str");
  }
  for (  ActorTree child : _children) {
    output+="String_Node_Str" + child.getExpression() + "String_Node_Str";
  }
  for (  String param : _parameters.keySet()) {
    output+="String_Node_Str" + param + "String_Node_Str"+ _parameters.get(param)+ "String_Node_Str";
  }
  return output;
}

Fixed version (ground truth):
/** 
 * Get an expression representing this actor tree, like a := b(c := d())(n := <2/>)
 * @return A string containing the expression.
 * @throws PtalonRuntimeException
 */
public String getExpression() throws PtalonRuntimeException {
  if (_actorParameter == null) {
    throw new PtalonRuntimeException("String_Node_Str");
  }
  String type="String_Node_Str";
  try {
    type=_getType(_symbol);
  }
 catch (  PtalonScopeException ex) {
    throw new PtalonRuntimeException("String_Node_Str",ex);
  }
  StringBuffer buffer=new StringBuffer();
  if (type.equals("String_Node_Str")) {
    buffer.append("String_Node_Str" + _imports.get(_symbol));
  }
 else   if (type.equals("String_Node_Str")) {
    Parameter parameter=_actor.getPtalonParameter(_symbol);
    buffer.append(parameter.getExpression());
  }
 else {
    throw new PtalonRuntimeException("String_Node_Str");
  }
  for (  ActorTree child : _children) {
    buffer.append("String_Node_Str" + child.getExpression() + "String_Node_Str");
  }
  for (  String param : _parameters.keySet()) {
    buffer.append("String_Node_Str" + param + "String_Node_Str"+ _parameters.get(param)+ "String_Node_Str");
  }
  String output=buffer.toString();
  return output;
}
Program: 74630
Project: 74630
Buggy source:
/** 
 * Enumerate the info from this scope.
 */
public String toString(){
  String output="String_Node_Str" + getName() + "String_Node_Str";
  for (  String s : getSymbols()) {
    try {
      output+=s + "String_Node_Str" + getType(s)+ "String_Node_Str";
    }
 catch (    PtalonScopeException ex) {
    }
  }
  output+="String_Node_Str";
  for (  IfTree child : getChildren()) {
    output+=child.toString();
  }
  return output;
}

Fixed version (ground truth):
/** 
 * Enumerate the info from this scope.
 */
public String toString(){
  StringBuffer buffer=new StringBuffer("String_Node_Str" + getName() + "String_Node_Str");
  for (  String s : getSymbols()) {
    try {
      buffer.append(s + "String_Node_Str" + getType(s)+ "String_Node_Str");
    }
 catch (    PtalonScopeException ex) {
    }
  }
  buffer.append("String_Node_Str");
  for (  IfTree child : getChildren()) {
    buffer.append(child.toString());
  }
  String output=buffer.toString();
  return output;
}
Program: 74633
Project: 74633
Buggy source:
public void validate() throws RuleValidationException {
  if (_portName.equals("String_Node_Str")) {
    throw new RuleValidationException("String_Node_Str");
  }
  if (_portType.equals("String_Node_Str")) {
    throw new RuleValidationException("String_Node_Str");
  }
  if (!(_input ^ _output)) {
    throw new RuleValidationException("String_Node_Str" + "String_Node_Str");
  }
}

Fixed version (ground truth):
public void validate() throws RuleValidationException {
  if (isPortNameEnabled() && _portName.equals("String_Node_Str")) {
    throw new RuleValidationException("String_Node_Str");
  }
  if (isPortTypeEnabled() && _portType.equals("String_Node_Str")) {
    throw new RuleValidationException("String_Node_Str");
  }
  if (!((isInputEnabled() && _input) ^ (isOutputEnabled() && _output))) {
    throw new RuleValidationException("String_Node_Str" + "String_Node_Str");
  }
}