nus-yam/ex-repair huggingface dataset:
Program: 74355
Project: 74355
Buggy source:
/** 
 * Construct a director in the given container with the given name. The container argument must not be null, or a NullPointerException will be thrown. If the name argument is null, then the name is set to the empty string. Increment the version number of the workspace. Create the timeResolution parameter.
 * @param container The container.
 * @param name The name of this director.
 * @exception IllegalActionException If the name has a period in it, orthe director is not compatible with the specified container, or if the time resolution parameter is malformed.
 * @exception NameDuplicationException If the container already containsan entity with the specified name.
 */
public ERGDirector(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  controllerName=new StringAttribute(this,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Construct a director in the given container with the given name. The container argument must not be null, or a NullPointerException will be thrown. If the name argument is null, then the name is set to the empty string. Increment the version number of the workspace. Create the timeResolution parameter.
 * @param container The container.
 * @param name The name of this director.
 * @exception IllegalActionException If the name has a period in it, orthe director is not compatible with the specified container, or if the time resolution parameter is malformed.
 * @exception NameDuplicationException If the container already containsan entity with the specified name.
 */
public ERGDirector(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  controllerName=new StringAttribute(this,"String_Node_Str");
  LIFO=new Parameter(this,"String_Node_Str");
  LIFO.setTypeEquals(BaseType.BOOLEAN);
  LIFO.setToken(BooleanToken.TRUE);
}
Program: 74356
Project: 74356
Buggy source:
/** 
 * Clone the director into the specified workspace. This calls the base class and then sets the attribute public members to refer to the attributes of the new director.
 * @param workspace The workspace for the new director.
 * @return A new director.
 * @exception CloneNotSupportedException If a derived class containsan attribute that cannot be cloned.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  ERGDirector newObject=(ERGDirector)super.clone(workspace);
  newObject._eventQueue=new PriorityQueue<TimedEvent>(10,_EVENT_COMPARATOR);
  newObject._inputQueue=new PriorityQueue<TimedEvent>(5,_EVENT_COMPARATOR);
  newObject._controller=null;
  newObject._controllerVersion=-1;
  return newObject;
}

Fixed version (ground truth):
/** 
 * Clone the director into the specified workspace. This calls the base class and then sets the attribute public members to refer to the attributes of the new director.
 * @param workspace The workspace for the new director.
 * @return A new director.
 * @exception CloneNotSupportedException If a derived class containsan attribute that cannot be cloned.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  ERGDirector newObject=(ERGDirector)super.clone(workspace);
  newObject._eventComparator=new EventComparator();
  newObject._eventQueue=new PriorityQueue<TimedEvent>(10,newObject._eventComparator);
  newObject._inputQueue=new PriorityQueue<TimedEvent>(5,newObject._eventComparator);
  newObject._controller=null;
  newObject._controllerVersion=-1;
  return newObject;
}
Program: 74357
Project: 74357
Buggy source:
/** 
 * Construct an ERG modal model with a name and a container. The container argument must not be null, or a NullPointerException will be thrown.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the container is incompatiblewith this actor.
 * @exception NameDuplicationException If the name coincides withan actor already in the container.
 */
public ERGModalModel(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  setClassName("String_Node_Str");
  directorClass.removeAllChoices();
  directorClass.setExpression("String_Node_Str");
  ComponentEntity controller=getEntity("String_Node_Str");
  if (controller != null) {
    controller.setContainer(null);
  }
  _controller=new ERGController(this,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Construct an ERG modal model in the specified workspace with no container and an empty string as a name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace.
 * @param workspace The workspace that will list the actor.
 * @exception IllegalActionException If the name has a period in it, orthe director is not compatible with the specified container.
 * @exception NameDuplicationException If the container already containsan entity with the specified name.
 */
public ERGModalModel(Workspace workspace) throws IllegalActionException, NameDuplicationException {
  super(workspace);
  _init();
}
Program: 74358
Project: 74358
Buggy source:
private void _addObjectsWithCreationAttributes(NamedObj pattern) throws TransformationException {
  Collection<?> children=GTTools.getChildren(pattern,false,true,true,true);
  for (  Object childObject : children) {
    NamedObj child=(NamedObj)childObject;
    if (GTTools.isIgnored(child)) {
      continue;
    }
    if (GTTools.isCreated(child)) {
      String moml=child.exportMoMLPlain();
      NamedObj host=_findChangeContext(pattern);
      moml="String_Node_Str" + moml + "String_Node_Str";
      MoMLChangeRequest request=new MoMLChangeRequest(this,host,moml);
      request.execute();
      NamedObj hostChild=_getNewlyAddedObject(host,child.getClass());
      _recordMirroredObjects(child,hostChild);
    }
 else {
      _addObjectsWithCreationAttributes(child);
    }
  }
}

Fixed version (ground truth):
private void _addObjectsWithCreationAttributes(NamedObj pattern) throws TransformationException {
  Collection<?> children=GTTools.getChildren(pattern,false,true,true,true);
  for (  Object childObject : children) {
    NamedObj child=(NamedObj)childObject;
    if (GTTools.isIgnored(child)) {
      continue;
    }
    if (GTTools.isCreated(child)) {
      String moml=child.exportMoMLPlain();
      NamedObj host=_findChangeContext(pattern);
      moml="String_Node_Str" + moml + "String_Node_Str";
      MoMLChangeRequest request=new MoMLChangeRequest(this,host,moml);
      request.execute();
      NamedObj hostChild=_getNewlyAddedObject(host,child.getClass());
      try {
        GTTools.deepRemoveAttributes(hostChild,MatchingAttribute.class);
      }
 catch (      KernelException e) {
        throw new TransformationException("String_Node_Str" + "String_Node_Str",e);
      }
      _recordMirroredObjects(child,hostChild);
    }
 else {
      _addObjectsWithCreationAttributes(child);
    }
  }
}
Program: 74360
Project: 74360
Buggy source:
/** 
 * Returns true if the current actor declaration is ready to be created.
 * @return true If the current actor declaration is ready to becreated.
 * @exception PtalonRuntimeException If thrown trying to access aparameter, or if there is no actor declaration to create.
 */
public boolean isActorReady() throws PtalonRuntimeException {
  if (_currentActorTree == null) {
    throw new PtalonRuntimeException("String_Node_Str");
  }
  if ((_currentActorTree.created)) {
    if (_inNewWhileIteration()) {
      if (_currentIfTree.isForStatement) {
        int iteration=_currentActorTree.createdIteration;
        if ((iteration == 0) || (iteration == _currentIfTree.entered)) {
        }
 else {
          return false;
        }
      }
 else {
        IfTree tree=_currentIfTree;
        while (!tree.isForStatement) {
          tree=tree.getParent();
          if (tree == null) {
            throw new PtalonRuntimeException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          }
        }
        int iteration=_currentActorTree.createdIteration;
        if ((iteration == 0) || (iteration == tree.entered)) {
        }
 else {
          return false;
        }
      }
    }
 else {
      return false;
    }
  }
  if (isReady()) {
    return _currentActorTree.isReady();
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns true if the current actor declaration is ready to be created.
 * @return true If the current actor declaration is ready to becreated.
 * @exception PtalonRuntimeException If thrown trying to access aparameter, or if there is no actor declaration to create.
 */
public boolean isActorReady() throws PtalonRuntimeException {
  if (_currentActorTree == null) {
    throw new PtalonRuntimeException("String_Node_Str");
  }
  if ((_currentActorTree.created)) {
    if (_inNewWhileIteration()) {
      if (_currentIfTree.isForStatement) {
        int iteration=_currentActorTree.createdIteration;
        if ((iteration == 0) || (iteration == _currentIfTree.entered)) {
        }
 else {
          return false;
        }
      }
 else {
        IfTree tree=_currentIfTree;
        while (!tree.isForStatement) {
          tree=tree.getParent();
          if (tree == null) {
            throw new PtalonRuntimeException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          }
        }
        int iteration=_currentActorTree.createdIteration;
        if ((iteration == 0) || (iteration == tree.entered)) {
        }
 else {
          return false;
        }
      }
    }
 else     if (_currentIfTree == null) {
    }
 else {
      return false;
    }
  }
  if (isReady()) {
    return _currentActorTree.isReady();
  }
  return false;
}
Program: 74361
Project: 74361
Buggy source:
/** 
 * Return the initial state of this actor. The initial state is the unique state with its <i>isInitialState</i> parameter set to true. An exception is thrown if this actor does not contain an initial state. This method is read-synchronized on the workspace.
 * @return The initial state of this actor.
 * @exception IllegalActionException If this actor does not containa state with the specified name.
 */
public State getInitialState() throws IllegalActionException {
  String name=initialStateName.getExpression();
  if (!name.equals("String_Node_Str")) {
    try {
      workspace().getReadAccess();
      State state=(State)getEntity(name);
      if (state == null) {
        throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str" + name + "String_Node_Str");
      }
      state.isInitialState.setToken("String_Node_Str");
      return _initialState;
    }
  finally {
      workspace().doneReading();
    }
  }
  if (_initialState == null) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
  return _initialState;
}

Fixed version (ground truth):
/** 
 * Return the initial state of this actor. The initial state is the unique state with its <i>isInitialState</i> parameter set to true. An exception is thrown if this actor does not contain an initial state. This method is read-synchronized on the workspace.
 * @return The initial state of this actor.
 * @exception IllegalActionException If this actor does not containa state with the specified name.
 */
public State getInitialState() throws IllegalActionException {
  String name=initialStateName.getExpression();
  if (!name.equals("String_Node_Str")) {
    try {
      workspace().getReadAccess();
      State state=(State)getEntity(name);
      if (state == null) {
        throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str" + name + "String_Node_Str");
      }
      state.isInitialState.setToken("String_Node_Str");
      _initialState=state;
      return _initialState;
    }
  finally {
      workspace().doneReading();
    }
  }
  if (_initialState == null) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
  return _initialState;
}
Program: 74363
Project: 74363
Buggy source:
/** 
 * Check to see whether the specified file has changed, and if so, re-read it, and invoke the wrapup() methods of objects that have been added using addInitializable().
 * @exception IllegalActionException If one of the added objectsthrows it, or if re-reading the file fails.
 */
public void wrapup() throws IllegalActionException {
  if (_initializables != null) {
    for (    Initializable initializable : _initializables) {
      initializable.preinitialize();
    }
  }
  _reReadIfNeeded();
}

Fixed version (ground truth):
/** 
 * Check to see whether the specified file has changed, and if so, re-read it, and invoke the wrapup() methods of objects that have been added using addInitializable().
 * @exception IllegalActionException If one of the added objectsthrows it, or if re-reading the file fails.
 */
public void wrapup() throws IllegalActionException {
  if (_initializables != null) {
    for (    Initializable initializable : _initializables) {
      initializable.wrapup();
    }
  }
  _reReadIfNeeded();
}
Program: 74364
Project: 74364
Buggy source:
/** 
 * Clone the actor into the specified workspace.
 * @param workspace The workspace for the new object.
 * @return A new actor.
 * @exception CloneNotSupportedException If a derived class containsan attribute that cannot be cloned.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  ViterbiDecoder newObject=(ViterbiDecoder)super.clone(workspace);
  newObject._inputRate=(Parameter)newObject.getAttribute("String_Node_Str");
  newObject._mask=new int[newObject._maskNumber];
  newObject._outputRate=(Parameter)newObject.getAttribute("String_Node_Str");
  try {
    newObject._type=new ptolemy.actor.TypeAttribute(newObject.input,"String_Node_Str");
  }
 catch (  Exception ex) {
    throw new CloneNotSupportedException("String_Node_Str" + ex);
  }
  return newObject;
}

Fixed version (ground truth):
/** 
 * Clone the actor into the specified workspace.
 * @param workspace The workspace for the new object.
 * @return A new actor.
 * @exception CloneNotSupportedException If a derived class containsan attribute that cannot be cloned.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  ViterbiDecoder newObject=(ViterbiDecoder)super.clone(workspace);
  newObject._inputRate=(Parameter)newObject.getAttribute("String_Node_Str");
  newObject._mask=new int[newObject._maskNumber];
  newObject._outputRate=(Parameter)newObject.getAttribute("String_Node_Str");
  newObject._type=(TypeAttribute)newObject.input.getAttribute("String_Node_Str");
  return newObject;
}
Program: 74365
Project: 74365
Buggy source:
/** 
 * Open the container, if any, of the entity. If this entity has no container, then do nothing. 
 */
public void openContainer(){
  GraphModel model=_getGraphModel();
  NamedObj toplevel=(NamedObj)model.getRoot();
  if (toplevel != toplevel.toplevel()) {
    try {
      Configuration configuration=getConfiguration();
      configuration.openInstance(toplevel.getContainer());
    }
 catch (    Throwable throwable) {
      MessageHandler.error("String_Node_Str",throwable);
    }
  }
}

Fixed version (ground truth):
/** 
 * Open the container, if any, of the entity. If this entity has no container, then do nothing.
 */
public void openContainer(){
  GraphModel model=_getGraphModel();
  NamedObj toplevel=(NamedObj)model.getRoot();
  if (toplevel != toplevel.toplevel()) {
    try {
      Configuration configuration=getConfiguration();
      configuration.openInstance(toplevel.getContainer());
    }
 catch (    Throwable throwable) {
      MessageHandler.error("String_Node_Str",throwable);
    }
  }
}
Program: 74367
Project: 74367
Buggy source:
/** 
 * Called when the mouse is moved.  This base class does nothing when the mouse is moved.  
 * @param event Contains details of the movement event.However, events _are_ handled by the components within this component.  
 */
public void mouseMoved(MouseEvent event){
}

Fixed version (ground truth):
/** 
 * Called when the mouse is moved. This base class does nothing when the mouse is moved.
 * @param event Contains details of the movement event.However, events _are_ handled by the components within this component.
 */
public void mouseMoved(MouseEvent event){
}
Program: 74368
Project: 74368
Buggy source:
/** 
 * Called when the mouse is clicked. This base class does nothing when the mouse is clicked. However, events _are_ handled by the components within this component.  
 * @param event The mouse event.
 */
public void mouseClicked(MouseEvent event){
}

Fixed version (ground truth):
/** 
 * Called when the mouse is clicked. This base class does nothing when the mouse is clicked. However, events _are_ handled by the components within this component.
 * @param event The mouse event.
 */
public void mouseClicked(MouseEvent event){
}
Program: 74369
Project: 74369
Buggy source:
/** 
 * Called when the mouse leaves this component. This base class does nothing when the exits this component. However, events _are_ handled by the components within this component.  
 * @param event The mouse event.
 */
public void mouseExited(MouseEvent event){
}

Fixed version (ground truth):
/** 
 * Called when the mouse leaves this component. This base class does nothing when the exits this component. However, events _are_ handled by the components within this component.
 * @param event The mouse event.
 */
public void mouseExited(MouseEvent event){
}
Program: 74370
Project: 74370
Buggy source:
/** 
 * Called when the mouse is released. This base class does nothing when the mouse is moved.   However, events _are_ handled by the components within this component.  
 * @param event The mouse event.
 */
public void mouseReleased(MouseEvent event){
}

Fixed version (ground truth):
/** 
 * Called when the mouse is released. This base class does nothing when the mouse is moved. However, events _are_ handled by the components within this component.
 * @param event The mouse event.
 */
public void mouseReleased(MouseEvent event){
}
Program: 74371
Project: 74371
Buggy source:
/** 
 * Called when the mouse enters this component. This base class does nothing when the enters this component. However, events _are_ handled by the components within this component.  
 * @param event The mouse event.
 */
public void mouseEntered(MouseEvent event){
}

Fixed version (ground truth):
/** 
 * Called when the mouse enters this component. This base class does nothing when the enters this component. However, events _are_ handled by the components within this component.
 * @param event The mouse event.
 */
public void mouseEntered(MouseEvent event){
}
Program: 74372
Project: 74372
Buggy source:
private boolean _shallowMatchRelation(Relation patternRelation,Relation hostRelation){
  if (!_checkCriterion(patternRelation,hostRelation)) {
    return false;
  }
  List<?> attributeList=patternRelation.attributeList(GTIngredientsAttribute.class);
  if (!attributeList.isEmpty()) {
    try {
      GTIngredientList ruleList=((GTIngredientsAttribute)attributeList.get(0)).getIngredientList();
      if (ruleList != null) {
        for (        GTIngredient rule : ruleList) {
          if (rule instanceof Criterion) {
            Criterion criterion=(Criterion)rule;
            if (criterion.canCheck(patternRelation)) {
              if (criterion.match(hostRelation)) {
                return false;
              }
            }
          }
        }
      }
    }
 catch (    MalformedStringException e) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean _shallowMatchRelation(Relation patternRelation,Relation hostRelation){
  if (!_checkCriterion(patternRelation,hostRelation)) {
    return false;
  }
  List<?> attributeList=patternRelation.attributeList(GTIngredientsAttribute.class);
  if (!attributeList.isEmpty()) {
    try {
      GTIngredientList ruleList=((GTIngredientsAttribute)attributeList.get(0)).getIngredientList();
      if (ruleList != null) {
        for (        GTIngredient rule : ruleList) {
          if (rule instanceof Criterion) {
            Criterion criterion=(Criterion)rule;
            if (criterion.canCheck(patternRelation)) {
              if (!criterion.match(hostRelation)) {
                return false;
              }
            }
          }
        }
      }
    }
 catch (    MalformedStringException e) {
      return false;
    }
  }
  return true;
}
Program: 74375
Project: 74375
Buggy source:
private boolean _matchChildrenCompositeEntity(CompositeEntity patternEntity,CompositeEntity hostEntity){
  ObjectList patternList=new ObjectList();
  patternList.add(patternEntity);
  ObjectList hostList=new ObjectList();
  hostList.add(hostEntity);
  IndexedLists markedList=new IndexedLists();
  boolean added=true;
  int i=0;
  ObjectList.Entry entry=hostList.getHead();
  while (added) {
    added=false;
    int size=hostList.size();
    for (; i < size; i++) {
      markedList.clear();
      hostEntity=(CompositeEntity)entry.getValue();
      NamedObj nextChild=findFirstChild(hostEntity,markedList,_match.keySet());
      while (nextChild != null) {
        if (nextChild instanceof CompositeEntity) {
          hostList.add(nextChild);
          added=true;
        }
        nextChild=findNextChild(hostEntity,markedList,_match.keySet());
      }
      entry=entry.getNext();
    }
  }
  return _matchObject(patternList,hostList);
}

Fixed version (ground truth):
private boolean _matchChildrenCompositeEntity(CompositeEntity patternEntity,CompositeEntity hostEntity){
  ObjectList patternList=new ObjectList();
  if (!_ignoreObject(patternEntity)) {
    patternList.add(patternEntity);
  }
  ObjectList hostList=new ObjectList();
  if (!_ignoreObject(hostEntity)) {
    hostList.add(hostEntity);
  }
  IndexedLists markedList=new IndexedLists();
  boolean added=true;
  int i=0;
  ObjectList.Entry entry=hostList.getHead();
  while (added) {
    added=false;
    int size=hostList.size();
    for (; i < size; i++) {
      markedList.clear();
      hostEntity=(CompositeEntity)entry.getValue();
      NamedObj nextChild=findFirstChild(hostEntity,markedList,_match.keySet());
      while (nextChild != null) {
        if (nextChild instanceof CompositeEntity) {
          hostList.add(nextChild);
          added=true;
        }
        nextChild=findNextChild(hostEntity,markedList,_match.keySet());
      }
      entry=entry.getNext();
    }
  }
  return _matchObject(patternList,hostList);
}
Program: 74378
Project: 74378
Buggy source:
private boolean _matchRelation(Relation patternRelation,Relation hostRelation){
  if (patternRelation instanceof GTEntity && !((GTEntity)patternRelation).match(hostRelation)) {
    return false;
  }
  int matchSize=_match.size();
  boolean success=true;
  _match.put(patternRelation,hostRelation);
  if (!_shallowMatchRelation(patternRelation,hostRelation)) {
    success=false;
  }
  if (success) {
    ObjectList patternList=new ObjectList();
    patternList.addAll((Collection<?>)patternRelation.linkedObjectsList());
    ObjectList hostList=new ObjectList();
    hostList.addAll((Collection<?>)hostRelation.linkedObjectsList());
    success=_matchObject(patternList,hostList);
  }
  if (!success) {
    _match.retain(matchSize);
  }
  return success;
}

Fixed version (ground truth):
private boolean _matchRelation(Relation patternRelation,Relation hostRelation){
  if (patternRelation instanceof GTEntity && !((GTEntity)patternRelation).match(hostRelation)) {
    return false;
  }
  int matchSize=_match.size();
  boolean success=true;
  _match.put(patternRelation,hostRelation);
  if (!_shallowMatchRelation(patternRelation,hostRelation)) {
    success=false;
  }
  if (success) {
    ObjectList patternList=new ObjectList();
    for (    Object relationObject : patternRelation.linkedObjectsList()) {
      if (!_ignoreObject(relationObject)) {
        patternList.add(relationObject);
      }
    }
    ObjectList hostList=new ObjectList();
    for (    Object relationObject : hostRelation.linkedObjectsList()) {
      if (!_ignoreObject(relationObject)) {
        hostList.add(relationObject);
      }
    }
    success=_matchObject(patternList,hostList);
  }
  if (!success) {
    _match.retain(matchSize);
  }
  return success;
}
Program: 74380
Project: 74380
Buggy source:
private void _addObjectsWithCreationAttributes(NamedObj pattern) throws TransformationException {
  Collection<?> children=GTTools.getChildren(pattern,false,true,true,true);
  for (  Object childObject : children) {
    NamedObj child=(NamedObj)childObject;
    if (_isToBeCreated(child)) {
      String moml=child.exportMoMLPlain();
      NamedObj host=_findChangeContext(pattern);
      moml="String_Node_Str" + moml + "String_Node_Str";
      MoMLChangeRequest request=new MoMLChangeRequest(this,host,moml);
      request.execute();
      NamedObj hostChild=_getNewlyAddedObject(host,child.getClass());
      _matchResult.put(child,hostChild);
    }
 else {
      _addObjectsWithCreationAttributes(child);
    }
  }
}

Fixed version (ground truth):
private void _addObjectsWithCreationAttributes(NamedObj pattern) throws TransformationException {
  Collection<?> children=GTTools.getChildren(pattern,false,true,true,true);
  for (  Object childObject : children) {
    NamedObj child=(NamedObj)childObject;
    if (_isToBeCreated(child)) {
      String moml=child.exportMoMLPlain();
      NamedObj host=_findChangeContext(pattern);
      moml="String_Node_Str" + moml + "String_Node_Str";
      MoMLChangeRequest request=new MoMLChangeRequest(this,host,moml);
      request.execute();
      NamedObj hostChild=_getNewlyAddedObject(host,child.getClass());
      _recordObjectsWithCreationAttributes(child,hostChild);
    }
 else {
      _addObjectsWithCreationAttributes(child);
    }
  }
}
Program: 74385
Project: 74385
Buggy source:
/** 
 * Constrain the type of this variable to be the same as the type of the specified object.  This constraint is not enforced here, but is returned by the typeConstraintList() method for use by a type system.
 * @param equal A Typeable object.
 */
public void setTypeSameAs(Typeable equal){
  if (_debugging) {
    String name="String_Node_Str";
    if (equal instanceof Nameable) {
      name=((Nameable)equal).getFullName();
    }
    _debug("String_Node_Str" + name);
  }
  Inequality ineq=new Inequality(this.getTypeTerm(),equal.getTypeTerm());
  _constraints.add(ineq);
  ineq=new Inequality(equal.getTypeTerm(),this.getTypeTerm());
  _constraints.add(ineq);
}

Fixed version (ground truth):
/** 
 * Constrain the type of this variable to be the same as the type of the specified object.  This constraint is not enforced here, but is returned by the typeConstraintList() method for use by a type system.
 * @param equal A Typeable object.
 */
public void setTypeSameAs(Typeable equal){
  if (_debugging) {
    String name="String_Node_Str";
    if (equal instanceof Nameable) {
      name=((Nameable)equal).getFullName();
    }
    _debug("String_Node_Str" + name);
  }
  Inequality ineq=new Inequality(this.getTypeTerm(),equal.getTypeTerm());
  addConstraint(ineq);
  ineq=new Inequality(equal.getTypeTerm(),this.getTypeTerm());
  addConstraint(ineq);
}
Program: 74386
Project: 74386
Buggy source:
/** 
 * Constrain the type of this variable to be equal to or greater than the type of the specified object. This constraint is not enforced here, but is returned by the typeConstraintList() method for use by a type system.
 * @param lesser A Typeable object.
 */
public void setTypeAtLeast(Typeable lesser){
  if (_debugging) {
    String name="String_Node_Str";
    if (lesser instanceof Nameable) {
      name=((Nameable)lesser).getFullName();
    }
    _debug("String_Node_Str" + name);
  }
  Inequality ineq=new Inequality(lesser.getTypeTerm(),this.getTypeTerm());
  _constraints.add(ineq);
}

Fixed version (ground truth):
/** 
 * Constrain the type of this variable to be equal to or greater than the type of the specified object. This constraint is not enforced here, but is returned by the typeConstraintList() method for use by a type system.
 * @param lesser A Typeable object.
 */
public void setTypeAtLeast(Typeable lesser){
  if (_debugging) {
    String name="String_Node_Str";
    if (lesser instanceof Nameable) {
      name=((Nameable)lesser).getFullName();
    }
    _debug("String_Node_Str" + name);
  }
  Inequality ineq=new Inequality(lesser.getTypeTerm(),this.getTypeTerm());
  addConstraint(ineq);
}
Program: 74387
Project: 74387
Buggy source:
/** 
 * Clone this actor into the specified workspace. Override the base class to ensure that private variables are reset to null.
 * @param workspace The workspace for the cloned object.
 * @return A new instance of VisualModelReference.
 * @exception CloneNotSupportedException If a derived class containsan attribute that cannot be cloned.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  VisualModelReference newActor=(VisualModelReference)super.clone(workspace);
  newActor._tableau=null;
  return newActor;
}

Fixed version (ground truth):
/** 
 * Clone this actor into the specified workspace. Override the base class to ensure that private variables are reset to null.
 * @param workspace The workspace for the cloned object.
 * @return A new instance of VisualModelReference.
 * @exception CloneNotSupportedException If a derived class containsan attribute that cannot be cloned.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  VisualModelReference newActor=(VisualModelReference)super.clone(workspace);
  newActor._tableau=null;
  newActor._effigy=null;
  return newActor;
}
Program: 74389
Project: 74389
Buggy source:
/** 
 * Get the stored unique name for a symbol in the PtalonActor.   The unique name comes from a call to uniqueName().
 * @param ptalonName The symbol.
 * @return The unique name.
 * @exception PtalonRuntimeException If no such symbol exists.
 */
public String getMappedName(String ptalonName) throws PtalonRuntimeException {
  return _codeManager.getMappedName(ptalonName);
}

Fixed version (ground truth):
/** 
 * Get the stored unique name for a symbol in the PtalonActor. The unique name comes from a call to uniqueName().
 * @param ptalonName The symbol.
 * @return The unique name.
 * @exception PtalonRuntimeException If no such symbol exists.
 */
public String getMappedName(String ptalonName) throws PtalonRuntimeException {
  return _codeManager.getMappedName(ptalonName);
}
Program: 74391
Project: 74391
Buggy source:
/** 
 * Process the start of a PtalonML element.
 * @param elname The element type name.
 * @exception java.lang.Exception If there is any trouble creatingthe AST or code manager,
 */
public void startElement(String elname) throws Exception {
  if (elname.equals("String_Node_Str")) {
    if (_attributes.containsKey("String_Node_Str")) {
      String name=_attributes.get("String_Node_Str");
      name=name.replace("String_Node_Str","String_Node_Str");
      name=name + "String_Node_Str";
      _actor.ptalonCodeLocation.setToken(new StringToken("String_Node_Str" + name));
    }
  }
 else   if (elname.equals("String_Node_Str")) {
    if (_attributes.containsKey("String_Node_Str") && _attributes.containsKey("String_Node_Str")) {
      PtalonParameter param=(PtalonParameter)_actor.getAttribute(_attributes.get("String_Node_Str"));
      param.setToken(new StringToken(_attributes.get("String_Node_Str")));
    }
  }
 else   if (elname.equals("String_Node_Str")) {
    if (_attributes.containsKey("String_Node_Str") && _attributes.containsKey("String_Node_Str")) {
      PtalonExpressionParameter param=(PtalonExpressionParameter)_actor.getAttribute(_attributes.get("String_Node_Str"));
      if (param == null) {
        throw new IllegalActionException(_actor,"String_Node_Str" + "String_Node_Str" + _attributes.get("String_Node_Str"));
      }
      param.setExpression(_attributes.get("String_Node_Str"));
      _actor.attributeChanged(param);
    }
  }
  _attributes.clear();
}

Fixed version (ground truth):
/** 
 * Process the start of a PtalonML element.
 * @param elname The element type name.
 * @exception java.lang.Exception If there is any trouble creatingthe AST or code manager,
 */
public void startElement(String elname) throws Exception {
  if (elname.equals("String_Node_Str")) {
    if (_attributes.containsKey("String_Node_Str")) {
      String name=_attributes.get("String_Node_Str");
      name=name.replace("String_Node_Str","String_Node_Str");
      name=name + "String_Node_Str";
      if (name.startsWith("String_Node_Str")) {
        name=name.substring(1);
      }
 else {
        name="String_Node_Str" + name;
      }
      _actor.ptalonCodeLocation.setToken(new StringToken(name));
    }
  }
 else   if (elname.equals("String_Node_Str")) {
    if (_attributes.containsKey("String_Node_Str") && _attributes.containsKey("String_Node_Str")) {
      PtalonParameter param=(PtalonParameter)_actor.getAttribute(_attributes.get("String_Node_Str"));
      param.setToken(new StringToken(_attributes.get("String_Node_Str")));
    }
  }
 else   if (elname.equals("String_Node_Str")) {
    if (_attributes.containsKey("String_Node_Str") && _attributes.containsKey("String_Node_Str")) {
      PtalonExpressionParameter param=(PtalonExpressionParameter)_actor.getAttribute(_attributes.get("String_Node_Str"));
      if (param == null) {
        throw new IllegalActionException(_actor,"String_Node_Str" + "String_Node_Str" + _attributes.get("String_Node_Str"));
      }
      param.setExpression(_attributes.get("String_Node_Str"));
      _actor.attributeChanged(param);
    }
  }
  _attributes.clear();
}
Program: 74392
Project: 74392
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 ComponentEntity.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  MovingMaximum newObject=(MovingMaximum)super.clone();
  newObject.input.setTypeAtMost(BaseType.SCALAR);
  newObject.output.setTypeSameAs(newObject.input);
  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 ComponentEntity.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  MovingMaximum newObject=(MovingMaximum)super.clone(workspace);
  newObject.input.setTypeAtMost(BaseType.SCALAR);
  newObject.output.setTypeSameAs(newObject.input);
  return newObject;
}
Program: 74395
Project: 74395
Buggy source:
/** 
 * Read the occupants from the database and produce them on the output port.
 * @throws IllegalActionException If the database query fails.
 */
public void fire() throws IllegalActionException {
  super.fire();
  columns.update();
  pattern.update();
  ArrayToken result=getOccupants();
  output.send(0,result);
}

Fixed version (ground truth):
/** 
 * Read the occupants from the database and produce them on the output port.
 * @throws IllegalActionException If the database query fails.
 */
public void fire() throws IllegalActionException {
  super.fire();
  columns.update();
  pattern.update();
  ArrayToken result=getOccupants();
  if (result != null) {
    output.send(0,result);
  }
}
Program: 74397
Project: 74397
Buggy source:
public void keyPressed(KeyEvent e){
  if (e.getKeyCode() == KeyEvent.VK_ESCAPE || e.getKeyCode() == (KeyEvent.VK_ALT | KeyEvent.VK_S)) {
    e.consume();
    _frame.cancelFullScreen();
  }
}

Fixed version (ground truth):
public void keyPressed(KeyEvent e){
  if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
    e.consume();
    _frame.cancelFullScreen();
  }
}
Program: 74398
Project: 74398
Buggy source:
/** 
 * Generate the preinitialize code for the associated PN director.
 * @return The generated preinitialize code.
 * @exception IllegalActionException If the helper associated withan actor throws it while generating preinitialize code for the actor.
 */
public String generatePreinitializeCode() throws IllegalActionException {
  StringBuffer bufferCode=new StringBuffer();
  _buffers.clear();
  List actorList=((CompositeEntity)_director.getContainer()).deepEntityList();
  Iterator actors=actorList.iterator();
  while (actors.hasNext()) {
    Entity actor=(Entity)actors.next();
    Iterator ports=actor.portList().iterator();
    while (ports.hasNext()) {
      IOPort port=(IOPort)ports.next();
      bufferCode.append(_createDynamicOffsetVariables(port));
    }
  }
  StringBuffer code=new StringBuffer(super.generatePreinitializeCode());
  List args=new LinkedList();
  args.add(generateDirectorHeader());
  args.add(((CompositeActor)_director.getContainer()).deepEntityList().size());
  args.add(_buffers.size());
  code.append(_codeStream.getCodeBlock("String_Node_Str",args));
  if (_codeGenerator.inline.getToken() == BooleanToken.TRUE) {
    _generateThreadFunctionCode(code);
  }
  return code.toString() + bufferCode.toString();
}

Fixed version (ground truth):
/** 
 * Generate the preinitialize code for the associated PN director.
 * @return The generated preinitialize code.
 * @exception IllegalActionException If the helper associated withan actor throws it while generating preinitialize code for the actor.
 */
public String generatePreinitializeCode() throws IllegalActionException {
  StringBuffer bufferCode=new StringBuffer();
  _buffers.clear();
  List actorList=((CompositeEntity)_director.getContainer()).deepEntityList();
  Iterator actors=actorList.iterator();
  while (actors.hasNext()) {
    Entity actor=(Entity)actors.next();
    Iterator ports=actor.portList().iterator();
    while (ports.hasNext()) {
      IOPort port=(IOPort)ports.next();
      bufferCode.append(_createDynamicOffsetVariables(port));
    }
  }
  StringBuffer code=new StringBuffer(super.generatePreinitializeCode());
  List args=new LinkedList();
  args.add(generateDirectorHeader());
  args.add(((CompositeActor)_director.getContainer()).deepEntityList().size());
  args.add(_buffers.size());
  code.append(_codeStream.getCodeBlock("String_Node_Str",args));
  code.append(bufferCode);
  if (_codeGenerator.inline.getToken() == BooleanToken.TRUE) {
    _generateThreadFunctionCode(code);
  }
  return code.toString();
}
Program: 74400
Project: 74400
Buggy source:
protected void _readChacoOutputFile() throws IllegalActionException {
  File file=new File(_sanitizedModelName + "String_Node_Str");
  FileInputStream fis=null;
  BufferedInputStream bis=null;
  DataInputStream dis=null;
  try {
    fis=new FileInputStream(file);
    bis=new BufferedInputStream(fis);
    dis=new DataInputStream(bis);
    int actorNum=1;
    while (dis.available() != 0) {
      String rankString=dis.readLine();
      Actor actor=(Actor)_HashNumberKey.get(actorNum);
      Parameter parameter=_getPartitionParameter(actor);
      parameter.setExpression(rankString);
      actorNum++;
      _rankNumbers.add(rankString);
    }
    fis.close();
    bis.close();
    dis.close();
  }
 catch (  IOException e) {
    System.err.println("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
protected void _readChacoOutputFile() throws IllegalActionException {
  String codeFileNameWritten=this.getCodeFileName();
  codeFileNameWritten=codeFileNameWritten.replaceAll("String_Node_Str","String_Node_Str");
  File file=new File(codeFileNameWritten);
  FileInputStream fis=null;
  BufferedInputStream bis=null;
  DataInputStream dis=null;
  try {
    fis=new FileInputStream(file);
    bis=new BufferedInputStream(fis);
    dis=new DataInputStream(bis);
    int actorNum=1;
    while (dis.available() != 0) {
      String rankString=dis.readLine();
      Actor actor=(Actor)_HashNumberKey.get(actorNum);
      Parameter parameter=_getPartitionParameter(actor);
      parameter.setExpression(rankString);
      actorNum++;
      _rankNumbers.add(rankString);
    }
    fis.close();
    bis.close();
    dis.close();
  }
 catch (  IOException e) {
    System.err.println("String_Node_Str" + e.getMessage());
  }
}
Program: 74401
Project: 74401
Buggy source:
/** 
 * Clone the object into the specified workspace. The new object is <i>not</i> added to the directory of that workspace (you must do this yourself if you want it there).
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException Not thrown in this base class
 * @return The new Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  AtomicWirelessChannel newObject=(AtomicWirelessChannel)super.clone(workspace);
  newObject._receiversInRangeCacheValid=false;
  newObject._listeningInputPorts=null;
  newObject._listeningInputPortsVersion=-1L;
  newObject._listeningOutputPorts=null;
  newObject._listeningOutputPortsVersion=-1L;
  newObject._propertyTransformers=null;
  newObject._propertyTransformersByPort=null;
  newObject._channelListeners=null;
  newObject._receiversInRangeCache=null;
  newObject._receiversInRangeCacheVersion=null;
  newObject._sendingInputPorts=null;
  newObject._sendingInputPortsVersion=-1L;
  newObject._sendingOutputPorts=null;
  newObject._sendingOutputPortsVersion=-1L;
  newObject._channelPort=(ChannelPort)getPort("String_Node_Str");
  return newObject;
}

Fixed version (ground truth):
/** 
 * Clone the object into the specified workspace. The new object is <i>not</i> added to the directory of that workspace (you must do this yourself if you want it there).
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException Not thrown in this base class
 * @return The new Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  AtomicWirelessChannel newObject=(AtomicWirelessChannel)super.clone(workspace);
  newObject._receiversInRangeCacheValid=false;
  newObject._listeningInputPorts=null;
  newObject._listeningInputPortsVersion=-1L;
  newObject._listeningOutputPorts=null;
  newObject._listeningOutputPortsVersion=-1L;
  newObject._propertyTransformers=null;
  newObject._propertyTransformersByPort=null;
  newObject._channelListeners=null;
  newObject._receiversInRangeCache=null;
  newObject._receiversInRangeCacheVersion=null;
  newObject._sendingInputPorts=null;
  newObject._sendingInputPortsVersion=-1L;
  newObject._sendingOutputPorts=null;
  newObject._sendingOutputPortsVersion=-1L;
  newObject._channelPort=(ChannelPort)newObject.getPort("String_Node_Str");
  return newObject;
}
Program: 74402
Project: 74402
Buggy source:
/** 
 * Evaluate a numeric constant or an identifier. In the case of an identifier, its value is obtained from the scope or from the list of registered constants.
 * @param node The specified node.
 * @exception IllegalActionException If an evaluation error occurs.
 */
public void visitLeafNode(ASTPtLeafNode node) throws IllegalActionException {
  if (node.isConstant() && node.isEvaluated()) {
    _evaluatedChildToken=node.getToken();
    return;
  }
  String name=node.getName();
  ptolemy.data.Token value=null;
  if (_scope != null) {
    value=_scope.get(name);
  }
  if (value == null) {
    value=Constants.get(name);
  }
  if (value != null) {
    _evaluatedChildToken=value;
    return;
  }
  throw new UndefinedConstantOrIdentifierException(node.getName());
}

Fixed version (ground truth):
/** 
 * Evaluate a numeric constant or an identifier. In the case of an identifier, its value is obtained from the scope or from the list of registered constants.
 * @param node The specified node.
 * @exception IllegalActionException If an evaluation error occurs.
 */
public void visitLeafNode(ASTPtLeafNode node) throws IllegalActionException {
  if (node.isConstant() && node.isEvaluated()) {
    _evaluatedChildToken=node.getToken();
    return;
  }
  String name=node.getName();
  ptolemy.data.Token value=null;
  if (_scope != null) {
    value=_scope.get(name);
  }
  if (value == null || value instanceof ObjectToken) {
    ptolemy.data.Token constant=Constants.get(name);
    if (constant != null) {
      value=constant;
    }
  }
  if (value != null) {
    _evaluatedChildToken=value;
    return;
  }
  throw new UndefinedConstantOrIdentifierException(node.getName());
}
Program: 74403
Project: 74403
Buggy source:
/** 
 * Return the type of the identifier with the given name.
 * @exception IllegalActionException If the identifier is undefined.
 */
protected Type _getTypeForName(String name) throws IllegalActionException {
  if (_scope != null) {
    Type type=_scope.getType(name);
    if (type != null) {
      return type;
    }
  }
  if (Constants.get(name) != null) {
    return Constants.get(name).getType();
  }
  throw new IllegalActionException("String_Node_Str" + name + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Return the type of the identifier with the given name.
 * @exception IllegalActionException If the identifier is undefined.
 */
protected Type _getTypeForName(String name) throws IllegalActionException {
  Type type=null;
  if (_scope != null) {
    type=_scope.getType(name);
    if (type != null && !(type instanceof ObjectType)) {
      return type;
    }
  }
  if (Constants.get(name) != null) {
    return Constants.get(name).getType();
  }
  if (type != null) {
    return type;
  }
  throw new IllegalActionException("String_Node_Str" + name + "String_Node_Str");
}
Program: 74404
Project: 74404
Buggy source:
/** 
 * Set the type of the given node to be the type of constant the variable refers to, if the node represents a constant, or the type of the identifier the node refers to in the current scope.
 * @param node The specified node.
 * @exception IllegalActionException If an inference erroroccurs, or an identifier is not bound in the current scope.
 */
public void visitLeafNode(ASTPtLeafNode node) throws IllegalActionException {
  if (node.isConstant() && node.isEvaluated()) {
    _setType(node,node.getToken().getType());
    return;
  }
  String name=node.getName();
  if (_scope != null) {
    Type type=_scope.getType(name);
    if (type != null) {
      _setType(node,type);
      return;
    }
  }
  if (Constants.get(name) != null) {
    _setType(node,Constants.get(name).getType());
    return;
  }
  throw new IllegalActionException("String_Node_Str" + name + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Set the type of the given node to be the type of constant the variable refers to, if the node represents a constant, or the type of the identifier the node refers to in the current scope.
 * @param node The specified node.
 * @exception IllegalActionException If an inference erroroccurs, or an identifier is not bound in the current scope.
 */
public void visitLeafNode(ASTPtLeafNode node) throws IllegalActionException {
  if (node.isConstant() && node.isEvaluated()) {
    _setType(node,node.getToken().getType());
    return;
  }
  String name=node.getName();
  Type type=null;
  if (_scope != null) {
    type=_scope.getType(name);
    if (type != null && !(type instanceof ObjectType)) {
      _setType(node,type);
      return;
    }
  }
  if (Constants.get(name) != null) {
    _setType(node,Constants.get(name).getType());
    return;
  }
  if (type != null) {
    _setType(node,type);
  }
  throw new IllegalActionException("String_Node_Str" + name + "String_Node_Str");
}