nus-yam/ex-repair huggingface dataset:
Program: 74518
Project: 74518
Buggy source:
private void _addObjects(NamedObj replacement,NamedObj host) throws TransformationException {
  Collection<?> children=_getChildren(replacement,false,false,true,true);
  for (  Object childObject : children) {
    NamedObj child=(NamedObj)childObject;
    NamedObj hostChild=_replacementToHost.get(child);
    String moml=null;
    if (hostChild == null) {
      moml=_getMoML(child);
    }
 else {
      if (hostChild.getContainer() != host) {
        moml=_moml.get(child);
      }
    }
    if (moml != null && !moml.equals("String_Node_Str")) {
      moml="String_Node_Str" + moml + "String_Node_Str";
      MoMLChangeRequest request=new MoMLChangeRequest(this,host,moml);
      request.execute();
      hostChild=_getNewlyAddedObject(host,child.getClass());
      _addReplacementToHostEntries(hostChild);
    }
    if (hostChild != null) {
      _addObjects(child,hostChild);
    }
  }
}

Fixed version (ground truth):
private void _addObjects(NamedObj replacement,NamedObj host) throws TransformationException {
  if (replacement instanceof CompositeEntity) {
    for (    Object attributeObject : replacement.attributeList()) {
      Attribute attribute=(Attribute)attributeObject;
      if (!_isAttributeCopied(attribute)) {
        continue;
      }
      String moml="String_Node_Str" + attribute.exportMoML() + "String_Node_Str";
      MoMLChangeRequest request=new MoMLChangeRequest(this,host,moml);
      request.execute();
    }
  }
  Collection<?> children=_getChildren(replacement,false,false,true,true);
  for (  Object childObject : children) {
    NamedObj child=(NamedObj)childObject;
    NamedObj hostChild=_replacementToHost.get(child);
    String moml=null;
    if (hostChild == null) {
      moml=_getMoML(child);
    }
 else {
      if (hostChild.getContainer() != host) {
        moml=_moml.get(child);
      }
    }
    if (moml != null && !moml.equals("String_Node_Str")) {
      moml="String_Node_Str" + moml + "String_Node_Str";
      MoMLChangeRequest request=new MoMLChangeRequest(this,host,moml);
      request.execute();
      hostChild=_getNewlyAddedObject(host,child.getClass());
      _addReplacementToHostEntries(hostChild);
    }
    if (hostChild != null) {
      _addObjects(child,hostChild);
    }
  }
}
Program: 74519
Project: 74519
Buggy source:
/** 
 * Read the input, if there is any, and issue a change request to apply the MoML in the input to the displayed model.
 * @exception IllegalActionException If there is an error readingthe input.
 */
public void fire() throws IllegalActionException {
  super.fire();
  if (input.getWidth() > 0 && input.hasToken(0)) {
    if (_tableau != null) {
      _tableau.close();
      _tableau=null;
    }
    Entity model=((ActorToken)input.get(0)).getEntity();
    Configuration configuration=(Configuration)Configuration.findEffigy(toplevel()).toplevel();
    try {
      _tableau=configuration.openModel(model);
    }
 catch (    NameDuplicationException e) {
      throw new IllegalActionException(this,e,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Read the input, if there is any, and issue a change request to apply the MoML in the input to the displayed model.
 * @exception IllegalActionException If there is an error readingthe input.
 */
public void fire() throws IllegalActionException {
  super.fire();
  if (input.getWidth() > 0 && input.hasToken(0)) {
    if (_tableau != null) {
      _tableau.close();
      _tableau=null;
    }
    Entity model=((ActorToken)input.get(0)).getEntity();
    Configuration configuration=(Configuration)Configuration.findEffigy(toplevel()).toplevel();
    try {
      _parser.reset();
      NamedObj newModel=_parser.parse(model.exportMoML());
      _tableau=configuration.openInstance(newModel);
    }
 catch (    NameDuplicationException e) {
      throw new IllegalActionException(this,e,"String_Node_Str");
    }
catch (    Exception e) {
      throw new IllegalActionException(this,e,"String_Node_Str");
    }
  }
}
Program: 74520
Project: 74520
Buggy source:
private void _finishTransform(){
  _transformed=true;
  _asynchronousDehighlight();
  if (_topFrame == null) {
    for (    MatchResultViewer viewer : _subviewers) {
      viewer._finishTransform();
    }
  }
  _enableOrDisableActions();
  ((GTActorGraphModel)_getGraphModel()).startUpdate();
  _getGraphController().rerender();
}

Fixed version (ground truth):
private void _finishTransform(){
  _setTableauFactory(this,(CompositeEntity)getModel());
  _transformed=true;
  _asynchronousDehighlight();
  if (_topFrame == null) {
    for (    MatchResultViewer viewer : _subviewers) {
      viewer._finishTransform();
    }
  }
  _enableOrDisableActions();
  ((GTActorGraphModel)_getGraphModel()).startUpdate();
  _getGraphController().rerender();
}
Program: 74521
Project: 74521
Buggy source:
protected static void _setTableauFactory(Object originator,final CompositeEntity entity){
  if (entity.getAttribute("String_Node_Str") == null) {
    String momlTxt="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
    MoMLChangeRequest request=new MoMLChangeRequest(originator,entity,momlTxt);
    entity.requestChange(request);
    entity.requestChange(new ChangeRequest(originator,"String_Node_Str"){
      protected void _execute() throws Exception {
        _unsetPersistent(entity);
      }
      private void _unsetPersistent(      CompositeEntity entity){
        List<?> factoryList=entity.attributeList(MatchResultTableau.Factory.class);
        for (        Object attributeObject : factoryList) {
          MatchResultTableau.Factory factory=(MatchResultTableau.Factory)attributeObject;
          factory.setPersistent(false);
        }
        for (        Object subentity : entity.entityList(CompositeEntity.class)) {
          _unsetPersistent((CompositeEntity)subentity);
        }
      }
    }
);
  }
  for (  Object subentity : entity.entityList(CompositeEntity.class)) {
    _setTableauFactory(originator,(CompositeEntity)subentity);
  }
}

Fixed version (ground truth):
protected static void _setTableauFactory(Object originator,final CompositeEntity entity){
  List<?> factoryList=entity.attributeList(MatchResultTableau.Factory.class);
  if (factoryList.isEmpty()) {
    String momlTxt="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
    MoMLChangeRequest request=new MoMLChangeRequest(originator,entity,momlTxt);
    entity.requestChange(request);
    entity.requestChange(new ChangeRequest(originator,"String_Node_Str"){
      protected void _execute() throws Exception {
        _unsetPersistent(entity);
      }
      private void _unsetPersistent(      CompositeEntity entity){
        List<?> factoryList=entity.attributeList(MatchResultTableau.Factory.class);
        for (        Object attributeObject : factoryList) {
          MatchResultTableau.Factory factory=(MatchResultTableau.Factory)attributeObject;
          factory.setPersistent(false);
        }
        for (        Object subentity : entity.entityList(CompositeEntity.class)) {
          _unsetPersistent((CompositeEntity)subentity);
        }
      }
    }
);
  }
  for (  Object subentity : entity.entityList(CompositeEntity.class)) {
    _setTableauFactory(originator,(CompositeEntity)subentity);
  }
}
Program: 74522
Project: 74522
Buggy source:
public GTIngredientsEditor(DialogTableau tableau,Frame owner,Entity target,Configuration configuration){
  super("String_Node_Str",tableau,owner,target,configuration);
  _owner=owner;
  _target=target;
  Attribute attribute=null;
  if (target instanceof GTEntity) {
    if (GTTools.isInPattern(target)) {
      attribute=target.getAttribute("String_Node_Str");
      _ingredientClasses=_criterionClasses;
      tableau.setTitle("String_Node_Str" + target.getName());
    }
 else     if (GTTools.isInReplacement(target)) {
      attribute=target.getAttribute("String_Node_Str");
      _ingredientClasses=_operationClasses;
      tableau.setTitle("String_Node_Str" + target.getName());
    }
  }
  if (attribute == null || !(attribute instanceof GTIngredientsAttribute)) {
    throw new KernelRuntimeException("String_Node_Str" + target.getName() + "String_Node_Str");
  }
  _attribute=(GTIngredientsAttribute)attribute;
  _temporaryIngredientList=new GTIngredientList(_attribute);
  _createComponents();
}

Fixed version (ground truth):
public GTIngredientsEditor(DialogTableau tableau,Frame owner,Entity target,Configuration configuration){
  super("String_Node_Str",tableau,owner,target,configuration);
  _owner=owner;
  _target=target;
  Attribute attribute=null;
  if (target instanceof GTEntity) {
    if (GTTools.isInPattern(target)) {
      attribute=target.getAttribute("String_Node_Str");
      _ingredientClasses=_criterionClasses;
      tableau.setTitle("String_Node_Str" + target.getName());
    }
 else     if (GTTools.isInReplacement(target)) {
      attribute=target.getAttribute("String_Node_Str");
      _ingredientClasses=_operationClasses;
      tableau.setTitle("String_Node_Str" + target.getName());
    }
  }
  _attribute=(GTIngredientsAttribute)attribute;
  _temporaryIngredientList=new GTIngredientList(_attribute);
  _createComponents();
}
Program: 74523
Project: 74523
Buggy source:
public void setVisible(boolean visible){
  if (visible) {
    try {
      _initialIngredientList=_attribute.getIngredientList();
      resetTable(_initialIngredientList);
    }
 catch (    MalformedStringException e) {
      throw new KernelRuntimeException(e,"String_Node_Str" + _attribute.getName() + "String_Node_Str"+ "String_Node_Str"+ _target.getName()+ "String_Node_Str");
    }
  }
  super.setVisible(visible);
}

Fixed version (ground truth):
public void setVisible(boolean visible){
  if (visible && _attribute != null) {
    try {
      _initialIngredientList=_attribute.getIngredientList();
      resetTable(_initialIngredientList);
    }
 catch (    MalformedStringException e) {
      throw new KernelRuntimeException(e,"String_Node_Str" + _attribute.getName() + "String_Node_Str"+ "String_Node_Str"+ _target.getName()+ "String_Node_Str");
    }
  }
  super.setVisible(visible);
}
Program: 74526
Project: 74526
Buggy source:
@SuppressWarnings("String_Node_Str") MultipleViewController(){
  _files=_getModelFiles();
  if (_files == null) {
    return;
  }
  _viewers=new MatchResultViewer[_files.length];
  _models=new CompositeEntity[_files.length];
  _allResults=(List<MatchResult>[])new List[_files.length];
  try {
    _index=_findNextMatch(-1);
    if (_index < 0) {
      MessageHandler.message("String_Node_Str");
      return;
    }
    _viewCurrentModel();
  }
 catch (  Throwable throwable) {
    _handleErrors(throwable);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") MultipleViewController(){
  _files=_getModelFiles();
  if (_files == null) {
    return;
  }
  _viewers=new MatchResultViewer[_files.length];
  _models=new CompositeEntity[_files.length];
  _allResults=(List<MatchResult>[])new List[_files.length];
  try {
    _index=_findNextMatch(-1);
    if (_index < 0) {
      MessageHandler.message("String_Node_Str");
      return;
    }
    addWindowListener(this);
    _viewCurrentModel();
  }
 catch (  Throwable throwable) {
    _handleErrors(throwable);
  }
}
Program: 74527
Project: 74527
Buggy source:
public void actionPerformed(ActionEvent e){
  super.actionPerformed(e);
  try {
    File file=_getModelFile();
    if (file == null) {
      return;
    }
    CompositeEntity model=_getModel(file);
    List<MatchResult> results=_getMatchResult(model);
    if (results.isEmpty()) {
      MessageHandler.message("String_Node_Str");
    }
 else {
      _showViewer(model,results);
    }
  }
 catch (  MalformedURLException ex) {
    MessageHandler.error("String_Node_Str" + "String_Node_Str",ex);
  }
catch (  Exception ex) {
    throw new InternalErrorException(ex);
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  super.actionPerformed(e);
  try {
    File file=_getModelFile();
    if (file == null) {
      return;
    }
    CompositeEntity model=_getModel(file);
    List<MatchResult> results=_getMatchResult(model);
    if (results.isEmpty()) {
      MessageHandler.message("String_Node_Str");
    }
 else {
      _viewer=_showViewer(model,results);
      _viewer.addWindowListener(this);
      addWindowListener(this);
    }
  }
 catch (  MalformedURLException ex) {
    MessageHandler.error("String_Node_Str" + "String_Node_Str",ex);
  }
catch (  Exception ex) {
    throw new InternalErrorException(ex);
  }
}
Program: 74528
Project: 74528
Buggy source:
public void windowClosing(WindowEvent e){
}

Fixed version (ground truth):
public void windowClosing(WindowEvent e){
  Window window=e.getWindow();
  if (window == GTRuleGraphFrame.this) {
    _viewer.removeWindowListener(this);
    removeWindowListener(this);
    _viewer.close();
    _viewer=null;
  }
 else {
    _viewer.removeWindowListener(this);
    removeWindowListener(this);
    _viewer=null;
  }
}
Program: 74529
Project: 74529
Buggy source:
public void windowDeactivated(WindowEvent e){
  MatchResultViewer viewer=_viewers[_index];
  if (viewer.isVisible()) {
    return;
  }
  MatchResultViewer.FileSelectionStatus status=viewer.getFileSelectionStatus();
  viewer.clearFileSelectionStatus();
switch (status) {
case PREVIOUS:
    _index=_previousIndex;
  _viewCurrentModel();
break;
case NEXT:
_index=_nextIndex;
_viewCurrentModel();
break;
default :
_closeAll();
}
}

Fixed version (ground truth):
public void windowDeactivated(WindowEvent e){
}
Program: 74530
Project: 74530
Buggy source:
private void _closeAll(){
  for (  MatchResultViewer viewer : _viewers) {
    if (viewer != null) {
      viewer.close();
    }
  }
}

Fixed version (ground truth):
private void _closeAll(){
  removeWindowListener(this);
  for (  MatchResultViewer viewer : _viewers) {
    if (viewer != null) {
      viewer.removeWindowListener(this);
      viewer.close();
    }
  }
}
Program: 74531
Project: 74531
Buggy source:
private boolean _matchObject(Object patternObject,Object hostObject){
  Object match=_match.get(patternObject);
  if (match != null && match.equals(hostObject)) {
    return _checkBackward();
  }
 else   if (match != null || _match.containsValue(hostObject)) {
    return false;
  }
  if (patternObject instanceof AtomicActor && hostObject instanceof AtomicActor) {
    return _matchAtomicActor((AtomicActor)patternObject,(AtomicActor)hostObject);
  }
 else   if (patternObject instanceof CompositeEntity && hostObject instanceof CompositeEntity) {
    return _matchCompositeEntity((CompositeEntity)patternObject,(CompositeEntity)hostObject);
  }
 else   if (patternObject instanceof ObjectList && hostObject instanceof ObjectList) {
    LookbackEntry matchedObjectLists=new LookbackEntry((ObjectList)patternObject,(ObjectList)hostObject);
    return _matchList(matchedObjectLists);
  }
 else   if (patternObject instanceof Path && hostObject instanceof Path) {
    return _matchPath((Path)patternObject,(Path)hostObject);
  }
 else   if (patternObject instanceof Port && hostObject instanceof Port) {
    return _matchPort((Port)patternObject,(Port)hostObject);
  }
 else   if (patternObject instanceof Relation && hostObject instanceof Relation) {
    return _matchRelation((Relation)patternObject,(Relation)hostObject);
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
private boolean _matchObject(Object patternObject,Object hostObject){
  Object match=_match.get(patternObject);
  if (match != null && match.equals(hostObject)) {
    return _checkBackward();
  }
 else   if (match != null || _match.containsValue(hostObject)) {
    return false;
  }
  if (patternObject instanceof CompositeEntity && hostObject instanceof CompositeEntity) {
    return _matchCompositeEntity((CompositeEntity)patternObject,(CompositeEntity)hostObject);
  }
 else   if (patternObject instanceof ComponentEntity && hostObject instanceof ComponentEntity) {
    return _matchAtomicEntity((ComponentEntity)patternObject,(ComponentEntity)hostObject);
  }
 else   if (patternObject instanceof ObjectList && hostObject instanceof ObjectList) {
    LookbackEntry matchedObjectLists=new LookbackEntry((ObjectList)patternObject,(ObjectList)hostObject);
    return _matchList(matchedObjectLists);
  }
 else   if (patternObject instanceof Path && hostObject instanceof Path) {
    return _matchPath((Path)patternObject,(Path)hostObject);
  }
 else   if (patternObject instanceof Port && hostObject instanceof Port) {
    return _matchPort((Port)patternObject,(Port)hostObject);
  }
 else   if (patternObject instanceof Relation && hostObject instanceof Relation) {
    return _matchRelation((Relation)patternObject,(Relation)hostObject);
  }
 else {
    return false;
  }
}
Program: 74534
Project: 74534
Buggy source:
public void windowDeactivated(WindowEvent e){
  MatchResultViewer viewer=(MatchResultViewer)e.getWindow();
  MatchResultViewer.FileSelectionStatus status=viewer.getFileSelectionStatus();
  viewer.clearFileSelectionStatus();
switch (status) {
case PREVIOUS:
    _index=_previousIndex;
  _viewCurrentModel();
break;
case NEXT:
_index=_nextIndex;
_viewCurrentModel();
break;
}
}

Fixed version (ground truth):
public void windowDeactivated(WindowEvent e){
  MatchResultViewer viewer=_viewers[_index];
  if (viewer.isVisible()) {
    return;
  }
  MatchResultViewer.FileSelectionStatus status=viewer.getFileSelectionStatus();
  viewer.clearFileSelectionStatus();
switch (status) {
case PREVIOUS:
    _index=_previousIndex;
  _viewCurrentModel();
break;
case NEXT:
_index=_nextIndex;
_viewCurrentModel();
break;
default :
_closeAll();
}
}
Program: 74535
Project: 74535
Buggy source:
private void _nextFile(){
  _fileSelectionStatus=FileSelectionStatus.NEXT;
  setVisible(false);
}

Fixed version (ground truth):
private void _nextFile(){
  _fileSelectionStatus=FileSelectionStatus.NEXT;
  for (  MatchResultViewer viewer : _subviewers) {
    viewer.setVisible(false);
  }
  setVisible(false);
}
Program: 74536
Project: 74536
Buggy source:
private void _previousFile(){
  _fileSelectionStatus=FileSelectionStatus.PREVIOUS;
  setVisible(false);
}

Fixed version (ground truth):
private void _previousFile(){
  _fileSelectionStatus=FileSelectionStatus.PREVIOUS;
  for (  MatchResultViewer viewer : _subviewers) {
    viewer.setVisible(false);
  }
  setVisible(false);
}
Program: 74539
Project: 74539
Buggy source:
/** 
 * Output XML configuration to the pre-defined file (specified with "-config" argument in   {@link #main(String[])}).
 * @exception Exception If any error occurs.
 */
protected static void _outputConfig() throws Exception {
  if (_configName != null) {
    SourceOutputStream stream=SourceOutputStream.getStream(_configName,_overwrite);
    Set<String> classSet=new HashSet<String>();
    classSet.addAll(_classes);
    ConfigParser parser=new ConfigParser();
    parser.addExcludedFile(new File(_configName).getCanonicalPath());
    parser.parseConfigFile(ConfigParser.DEFAULT_SYSTEM_ID,classSet);
    if ((_prefix != null) && (_prefix.length() > 0)) {
      parser.addPackagePrefix(_prefix,classSet);
    }
    OutputStreamWriter writer=null;
    try {
      writer=new OutputStreamWriter(stream);
      XmlOutput.outputXmlTree(parser.getTree(),writer);
    }
  finally {
      if (writer == null) {
        writer.close();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Output XML configuration to the pre-defined file (specified with "-config" argument in   {@link #main(String[])}).
 * @exception Exception If any error occurs.
 */
protected static void _outputConfig() throws Exception {
  if (_configName != null) {
    SourceOutputStream stream=SourceOutputStream.getStream(_configName,_overwrite);
    Set<String> classSet=new HashSet<String>();
    classSet.addAll(_classes);
    ConfigParser parser=new ConfigParser();
    parser.addExcludedFile(new File(_configName).getCanonicalPath());
    parser.parseConfigFile(ConfigParser.DEFAULT_SYSTEM_ID,classSet);
    if ((_prefix != null) && (_prefix.length() > 0)) {
      parser.addPackagePrefix(_prefix,classSet);
    }
    OutputStreamWriter writer=null;
    try {
      writer=new OutputStreamWriter(stream);
      XmlOutput.outputXmlTree(parser.getTree(),writer);
    }
  finally {
      if (writer != null) {
        writer.close();
      }
    }
  }
}
Program: 74540
Project: 74540
Buggy source:
private Token _getAttribute(NamedObj container,Class<? extends CompositeEntityPatternAttribute> attributeClass){
  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(attributeClass);
    if (!attributeList.isEmpty()) {
      CompositeEntityPatternAttribute attribute=(CompositeEntityPatternAttribute)attributeList.get(0);
      try {
        return attribute.parameter.getToken();
      }
 catch (      IllegalActionException e) {
        return null;
      }
    }
    container=container.getContainer();
  }
  return null;
}

Fixed version (ground truth):
private Token _getAttribute(NamedObj container,String name,Class<? extends PatternAttribute> attributeClass){
  while (container != null) {
    if (_match.containsValue(container)) {
      container=(NamedObj)_match.getKey(container);
    }
 else     if (_temporaryMatch.containsValue(container)) {
      container=(NamedObj)_temporaryMatch.getKey(container);
    }
    Attribute attribute=container.getAttribute(name);
    if (attribute != null && attributeClass.isInstance(attribute)) {
      Parameter parameter=(Parameter)attribute.attributeList().get(0);
      try {
        return parameter == null ? null : parameter.getToken();
      }
 catch (      IllegalActionException e) {
        return null;
      }
    }
    container=container.getContainer();
  }
  return null;
}
Program: 74541
Project: 74541
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, or it has a  {@link HierarchyFlatteningAttribute} attributeinside with value <tt>true.
 * @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.
 */
protected boolean _isOpaque(CompositeEntity entity){
  if (entity instanceof CompositeActor && ((CompositeActor)entity).isOpaque()) {
    return true;
  }
 else {
    NamedObj container=entity.getContainer();
    Token value=_getAttribute(container,HierarchyFlatteningAttribute.class);
    boolean isOpaque=value == null ? false : !((BooleanToken)value).booleanValue();
    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, or it has a  {@link HierarchyFlatteningAttribute} attributeinside with value <tt>true.
 * @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.
 */
protected boolean _isOpaque(CompositeEntity entity){
  if (entity instanceof CompositeActor && ((CompositeActor)entity).isOpaque()) {
    return true;
  }
 else {
    NamedObj container=entity.getContainer();
    Token value=_getAttribute(container,"String_Node_Str",HierarchyFlatteningAttribute.class);
    boolean isOpaque=value == null ? false : !((BooleanToken)value).booleanValue();
    return isOpaque;
  }
}
Program: 74544
Project: 74544
Buggy source:
/** 
 * @param container
 * @param name
 * @throws NameDuplicationException
 * @throws IllegalActionException
 */
public HierarchyFlatteningAttribute(NamedObj container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name,"String_Node_Str",BaseType.BOOLEAN,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param container
 * @param name
 * @throws NameDuplicationException
 * @throws IllegalActionException
 */
public HierarchyFlatteningAttribute(NamedObj container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  parameter=new Parameter(this,"String_Node_Str");
  parameter.setTypeEquals(BaseType.BOOLEAN);
  parameter.setExpression("String_Node_Str");
}
Program: 74545
Project: 74545
Buggy source:
public RelationCollapsingAttribute(NamedObj container,String name) throws NameDuplicationException, IllegalActionException {
  super(container,name,"String_Node_Str",BaseType.BOOLEAN,"String_Node_Str");
}

Fixed version (ground truth):
public RelationCollapsingAttribute(NamedObj container,String name) throws NameDuplicationException, IllegalActionException {
  super(container,name);
  parameter=new Parameter(this,"String_Node_Str");
  parameter.setTypeEquals(BaseType.BOOLEAN);
  parameter.setExpression("String_Node_Str");
}
Program: 74546
Project: 74546
Buggy source:
public void validate() throws ValidationException {
  if (_superclass.equals("String_Node_Str")) {
    throw new ValidationException("String_Node_Str" + "String_Node_Str");
  }
  Class<?> superclass;
  try {
    superclass=Class.forName(_superclass);
  }
 catch (  ClassNotFoundException e) {
    throw new ValidationException("String_Node_Str" + _superclass + "String_Node_Str");
  }
  try {
    superclass.asSubclass(Actor.class);
  }
 catch (  ClassCastException e) {
    throw new ValidationException("String_Node_Str" + "String_Node_Str" + Actor.class.getName() + "String_Node_Str");
  }
}

Fixed version (ground truth):
public void validate() throws ValidationException {
  if (_superclass.equals("String_Node_Str")) {
    throw new ValidationException("String_Node_Str" + "String_Node_Str");
  }
  Class<?> superclass;
  try {
    superclass=Class.forName(_superclass);
  }
 catch (  Throwable t) {
    throw new ValidationException("String_Node_Str" + _superclass + "String_Node_Str",t);
  }
  try {
    superclass.asSubclass(Actor.class);
  }
 catch (  Throwable t) {
    throw new ValidationException("String_Node_Str" + "String_Node_Str" + Actor.class.getName() + "String_Node_Str",t);
  }
}
Program: 74549
Project: 74549
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,this,moml);
    request.execute();
  }
}

Fixed version (ground truth):
private void _removeEditorIcons(){
  for (  Object editorIconObject : attributeList(EditorIcon.class)) {
    EditorIcon editorIcon=(EditorIcon)editorIconObject;
    GTTools.getDeletionChangeRequest(this,editorIcon).execute();
  }
}
Program: 74550
Project: 74550
Buggy source:
public CompositeEntityPatternAttribute(NamedObj container,String name,String parameterName,Type type,String defaultExpression) throws NameDuplicationException, IllegalActionException {
  super(container,name);
  if (!(container instanceof EntityLibrary)) {
    try {
      String simpleClassName=getClass().getSimpleName();
      if (!(container instanceof CompositeActorMatcher)) {
        throw new IllegalActionException(simpleClassName + "String_Node_Str");
      }
      CompositeActorMatcher matcher=(CompositeActorMatcher)container;
      List<?> attributeList=matcher.attributeList(getClass());
      for (      Object attributeObject : attributeList) {
        if (attributeObject != this) {
          throw new IllegalActionException("String_Node_Str" + simpleClassName + "String_Node_Str"+ "String_Node_Str");
        }
      }
    }
 catch (    IllegalActionException e) {
      String moml="String_Node_Str" + name + "String_Node_Str";
      requestChange(new MoMLChangeRequest(this,container,moml));
      throw e;
    }
  }
  parameter=new Parameter(this,parameterName);
  parameter.setTypeEquals(type);
  parameter.setExpression(defaultExpression);
  _attachText("String_Node_Str",_LIBRARY_ICON);
}

Fixed version (ground truth):
public CompositeEntityPatternAttribute(NamedObj container,String name,String parameterName,Type type,String defaultExpression) throws NameDuplicationException, IllegalActionException {
  super(container,name);
  parameter=new Parameter(this,parameterName);
  parameter.setTypeEquals(type);
  parameter.setExpression(defaultExpression);
  _attachText("String_Node_Str",_LIBRARY_ICON);
}
Program: 74551
Project: 74551
Buggy source:
public static PatternObjectAttribute getPatternObjectAttribute(NamedObj object,boolean createNew){
  Attribute attribute=object.getAttribute("String_Node_Str");
  if (attribute == null) {
    if (createNew) {
      try {
        return new PatternObjectAttribute(object,"String_Node_Str");
      }
 catch (      IllegalActionException e) {
        return null;
      }
catch (      NameDuplicationException e) {
        return null;
      }
    }
 else {
      return null;
    }
  }
  if (attribute instanceof PatternObjectAttribute) {
    return (PatternObjectAttribute)attribute;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public static PatternObjectAttribute getPatternObjectAttribute(NamedObj object){
  Attribute attribute=object.getAttribute("String_Node_Str");
  if (attribute != null && attribute instanceof PatternObjectAttribute) {
    return (PatternObjectAttribute)attribute;
  }
 else {
    return null;
  }
}
Program: 74552
Project: 74552
Buggy source:
public static NamedObj getCorrespondingPatternObject(NamedObj replacementEntity){
  CompositeActorMatcher container=getContainingPatternOrReplacement(replacementEntity);
  if (container == null) {
    return null;
  }
  PatternObjectAttribute attribute=getPatternObjectAttribute(replacementEntity,false);
  if (attribute == null) {
    return null;
  }
  String patternObjectName=attribute.getExpression();
  if (patternObjectName.equals("String_Node_Str")) {
    return null;
  }
  TransformationRule transformer=(TransformationRule)container.getContainer();
  Pattern pattern=transformer.getPattern();
  return pattern.getEntity(patternObjectName);
}

Fixed version (ground truth):
public static NamedObj getCorrespondingPatternObject(NamedObj replacementObject){
  PatternObjectAttribute attribute=getPatternObjectAttribute(replacementObject);
  if (attribute == null) {
    return null;
  }
  CompositeActorMatcher container=getContainingPatternOrReplacement(replacementObject);
  if (container == null) {
    return null;
  }
  String patternObjectName=attribute.getExpression();
  if (patternObjectName.equals("String_Node_Str")) {
    return null;
  }
  TransformationRule transformer=(TransformationRule)container.getContainer();
  Pattern pattern=transformer.getPattern();
  if (replacementObject instanceof Entity) {
    return pattern.getEntity(patternObjectName);
  }
 else   if (replacementObject instanceof Relation) {
    return pattern.getRelation(patternObjectName);
  }
 else {
    return null;
  }
}
Program: 74557
Project: 74557
Buggy source:
/** 
 * Set the callback to be invoked by future calls to   {@link #match(CompositeActorMatcher,CompositeEntity)}.
 * @param callback The callback. If it is <tt>null</tt>, the callback isset to  {@link #DEFAULT_CALLBACK}.
 * @see #match(CompositeActorMatcher,CompositeEntity)
 */
public void setMatchCallback(MatchCallback callback){
  if (callback == null) {
    _callback=DEFAULT_CALLBACK;
  }
 else {
    _callback=callback;
  }
}

Fixed version (ground truth):
/** 
 * Set the callback to be invoked by future calls to   {@link #match(Pattern,CompositeEntity)}.
 * @param callback The callback. If it is <tt>null</tt>, the callback isset to  {@link #DEFAULT_CALLBACK}.
 * @see #match(Pattern,CompositeEntity)
 */
public void setMatchCallback(MatchCallback callback){
  if (callback == null) {
    _callback=DEFAULT_CALLBACK;
  }
 else {
    _callback=callback;
  }
}
Program: 74558
Project: 74558
Buggy source:
public boolean transform(TransformationRule transformer,MatchResult matchResult,CompositeEntity hostGraph){
  return _performOperations(matchResult,transformer.getPattern(),transformer.getReplacement());
}

Fixed version (ground truth):
public boolean transform(TransformationRule transformer,MatchResult matchResult,CompositeEntity hostGraph){
  boolean success=true;
  success=success && _performOperations(matchResult,transformer.getPattern(),transformer.getReplacement());
  return success;
}
Program: 74559
Project: 74559
Buggy source:
/** 
 * Check whether there is an IO error. This method always returns false.
 * @param true if there is an error; false, otherwise.
 */
public boolean checkError(){
  return false;
}

Fixed version (ground truth):
/** 
 * Check whether there is an IO error. This method always returns false.
 * @return true if there is an error; false, otherwise.
 */
public boolean checkError(){
  return false;
}
Program: 74560
Project: 74560
Buggy source:
/** 
 * Further process the XML element when it is closed with an end tag. If the element corresponds to a Ptolemy actor that has been changed to its backtracking version, the MoML description of the original actor's icon is copied to the new model, because the backtracking version does not have an icon associated with it.
 * @param container The container of the element.
 * @param The XML element to be closed.
 * @exception IllegalActionException If the MoML of the originalactor's icon cannot be read and inserted into the new model.
 */
public void filterEndElement(NamedObj container,String elementName) throws IllegalActionException {
  if ((elementName.equals("String_Node_Str") || elementName.equals("String_Node_Str")) && container != null && container.getClassName() != null) {
    if (_classStack.peek() != null && container.getClassName().equals(_newClassName((String)_classStack.peek()))) {
      _copyIcon(container);
      _entitiesChanged.add(container);
    }
    _classStack.pop();
  }
}

Fixed version (ground truth):
/** 
 * Further process the XML element when it is closed with an end tag. If the element corresponds to a Ptolemy actor that has been changed to its backtracking version, the MoML description of the original actor's icon is copied to the new model, because the backtracking version does not have an icon associated with it.
 * @param container The container of the element.
 * @param elementName The XML element to be closed.
 * @exception IllegalActionException If the MoML of the originalactor's icon cannot be read and inserted into the new model.
 */
public void filterEndElement(NamedObj container,String elementName) throws IllegalActionException {
  if ((elementName.equals("String_Node_Str") || elementName.equals("String_Node_Str")) && container != null && container.getClassName() != null) {
    if (_classStack.peek() != null && container.getClassName().equals(_newClassName((String)_classStack.peek()))) {
      _copyIcon(container);
      _entitiesChanged.add(container);
    }
    _classStack.pop();
  }
}
Program: 74561
Project: 74561
Buggy source:
public void keyPressed(KeyEvent e){
  if (e.getSource() != _fullScreenComponent) {
    return;
  }
  if (e.getKeyCode() == KeyEvent.VK_ESCAPE || e.getKeyCode() == (KeyEvent.VK_ALT | KeyEvent.VK_S)) {
    e.consume();
    cancelFullScreen();
  }
}

Fixed version (ground truth):
public void keyPressed(KeyEvent e){
  if (e.getKeyCode() == KeyEvent.VK_ESCAPE || e.getKeyCode() == (KeyEvent.VK_ALT | KeyEvent.VK_S)) {
    e.consume();
    cancelFullScreen();
  }
}
Program: 74562
Project: 74562
Buggy source:
public void cancelFullScreen(){
  _screen.dispose();
  _splitPane.setRightComponent(_getRightComponent());
  _tabbedPane.add(_fullScreenComponent,_selectedIndexBeforeFullScreen);
  _tabbedPane.setSelectedIndex(_selectedIndexBeforeFullScreen);
  if (_fullScreenComponent instanceof JGraph) {
    _graphPanner.setCanvas((JGraph)_fullScreenComponent);
  }
 else {
    _graphPanner.setCanvas(null);
  }
  pack();
  show();
  GraphicalMessageHandler.setContext(_previousDefaultContext);
  toFront();
  _getRightComponent().requestFocus();
}

Fixed version (ground truth):
public void cancelFullScreen(){
  _screen.dispose();
  _splitPane.setRightComponent(_getRightComponent());
  _tabbedPane.add(_fullScreenComponent,_selectedIndexBeforeFullScreen);
  _tabbedPane.setSelectedIndex(_selectedIndexBeforeFullScreen);
  if (_fullScreenComponent instanceof JGraph) {
    _graphPanner.setCanvas((JGraph)_fullScreenComponent);
  }
 else {
    _graphPanner.setCanvas(null);
  }
  _fullScreenComponent.removeKeyListener(this);
  if (_selectedIndexBeforeFullScreen == 2) {
    _setOrUnsetKeyListenersForAllComponents((JPanel)_fullScreenComponent,false);
  }
  pack();
  show();
  GraphicalMessageHandler.setContext(_previousDefaultContext);
  toFront();
  _getRightComponent().requestFocus();
}
Program: 74563
Project: 74563
Buggy source:
public void fullScreen(){
  _screen=new JDialog();
  _screen.getContentPane().setLayout(new BorderLayout());
  Toolkit toolkit=_screen.getToolkit();
  int width=toolkit.getScreenSize().width;
  int height=toolkit.getScreenSize().height;
  _screen.setSize(width,height);
  _selectedIndexBeforeFullScreen=_tabbedPane.getSelectedIndex();
  _fullScreenComponent=_tabbedPane.getSelectedComponent();
  _screen.setUndecorated(true);
  _screen.getContentPane().add(_fullScreenComponent,BorderLayout.CENTER);
  _screen.setVisible(true);
  Component _previousDefaultContext=GraphicalMessageHandler.getContext();
  GraphicalMessageHandler.setContext(_screen);
  _screen.toFront();
  _fullScreenComponent.requestFocus();
  _screen.setResizable(false);
  _fullScreenComponent.addKeyListener(this);
  _graphPanner.setCanvas(null);
  setVisible(false);
  GraphicalMessageHandler.setContext(_previousDefaultContext);
}

Fixed version (ground truth):
public void fullScreen(){
  _screen=new JDialog();
  _screen.getContentPane().setLayout(new BorderLayout());
  Toolkit toolkit=_screen.getToolkit();
  int width=toolkit.getScreenSize().width;
  int height=toolkit.getScreenSize().height;
  _screen.setSize(width,height);
  _selectedIndexBeforeFullScreen=_tabbedPane.getSelectedIndex();
  _fullScreenComponent=_tabbedPane.getSelectedComponent();
  _screen.setUndecorated(true);
  _screen.getContentPane().add(_fullScreenComponent,BorderLayout.CENTER);
  _screen.setVisible(true);
  Component _previousDefaultContext=GraphicalMessageHandler.getContext();
  GraphicalMessageHandler.setContext(_screen);
  _screen.toFront();
  _fullScreenComponent.requestFocus();
  _screen.setResizable(false);
  _fullScreenComponent.addKeyListener(this);
  if (_selectedIndexBeforeFullScreen == 2) {
    _setOrUnsetKeyListenersForAllComponents((JPanel)_fullScreenComponent,true);
  }
  _graphPanner.setCanvas(null);
  setVisible(false);
  GraphicalMessageHandler.setContext(_previousDefaultContext);
}
Program: 74564
Project: 74564
Buggy source:
public AtomicActorMatcher(CompositeEntity container,String name) throws NameDuplicationException, IllegalActionException {
  super(container,name);
  setClassName("String_Node_Str");
  criteria=new GTIngredientsAttribute(this,"String_Node_Str");
  criteria.setExpression("String_Node_Str");
  criteria.addValueListener(this);
  patternEntity=new PatternEntityAttribute(this,"String_Node_Str");
  patternEntity.setExpression("String_Node_Str");
  patternEntity.addValueListener(this);
  _attachText("String_Node_Str",_ICON_DESCRIPTION);
}

Fixed version (ground truth):
public AtomicActorMatcher(CompositeEntity container,String name) throws NameDuplicationException, IllegalActionException {
  super(container,name);
  setClassName("String_Node_Str");
  criteria=new GTIngredientsAttribute(this,"String_Node_Str");
  criteria.setExpression("String_Node_Str");
  criteria.addValueListener(this);
  operations=new GTIngredientsAttribute(this,"String_Node_Str");
  operations.setExpression("String_Node_Str");
  operations.addValueListener(this);
  patternEntity=new PatternEntityAttribute(this,"String_Node_Str");
  patternEntity.setExpression("String_Node_Str");
  patternEntity.addValueListener(this);
  editorFactory=new GTIngredientsEditor.Factory(this,"String_Node_Str");
  _attachText("String_Node_Str",_ICON_DESCRIPTION);
}
Program: 74565
Project: 74565
Buggy source:
public CompositeActorMatcher(CompositeEntity container,String name) throws NameDuplicationException, IllegalActionException {
  super(container,name);
  setClassName("String_Node_Str");
  criteria=new GTIngredientsAttribute(this,"String_Node_Str");
  criteria.setExpression("String_Node_Str");
  patternEntity=new PatternEntityAttribute(this,"String_Node_Str");
  patternEntity.setExpression("String_Node_Str");
}

Fixed version (ground truth):
public CompositeActorMatcher(CompositeEntity container,String name) throws NameDuplicationException, IllegalActionException {
  super(container,name);
  setClassName("String_Node_Str");
  criteria=new GTIngredientsAttribute(this,"String_Node_Str");
  criteria.setExpression("String_Node_Str");
  operations=new GTIngredientsAttribute(this,"String_Node_Str");
  operations.setExpression("String_Node_Str");
  patternEntity=new PatternEntityAttribute(this,"String_Node_Str");
  patternEntity.setExpression("String_Node_Str");
  editorFactory=new GTIngredientsEditor.Factory(this,"String_Node_Str");
}
Program: 74566
Project: 74566
Buggy source:
protected GTIngredient(GTIngredientList owner,int attributeCount){
  this(owner);
  _enablements=new boolean[attributeCount];
  enableAll();
}

Fixed version (ground truth):
protected GTIngredient(GTIngredientList owner,int elementCount){
  this(owner);
  _enablements=new boolean[elementCount];
  enableAll();
}
Program: 74567
Project: 74567
Buggy source:
protected String _decodeStringField(int index,FieldIterator iterator){
  if (iterator.hasNext()) {
    _enablements[index]=Boolean.parseBoolean(iterator.next());
  }
 else {
    _enablements[index]=false;
  }
  return iterator.hasNext() ? _unescapeStringAttribute(iterator.next()) : "String_Node_Str";
}

Fixed version (ground truth):
protected String _decodeStringField(int index,FieldIterator iterator){
  if (iterator.hasNext()) {
    _enablements[index]=Boolean.parseBoolean(iterator.next());
  }
 else {
    _enablements[index]=false;
  }
  return iterator.hasNext() ? _unescapeElementString(iterator.next()) : "String_Node_Str";
}
Program: 74568
Project: 74568
Buggy source:
public abstract void validate() throws RuleValidationException ;

Fixed version (ground truth):
public abstract void validate() throws ValidationException ;
Program: 74569
Project: 74569
Buggy source:
protected void _encodeStringField(StringBuffer buffer,int index,String value){
  if (buffer.length() > 0) {
    buffer.append(FIELD_SEPARATOR);
  }
  buffer.append(_enablements[index]);
  buffer.append(FIELD_SEPARATOR);
  buffer.append(_escapeStringAttribute(value));
}

Fixed version (ground truth):
protected void _encodeStringField(StringBuffer buffer,int index,String value){
  if (buffer.length() > 0) {
    buffer.append(FIELD_SEPARATOR);
  }
  buffer.append(_enablements[index]);
  buffer.append(FIELD_SEPARATOR);
  buffer.append(_escapeElementString(value));
}
Program: 74570
Project: 74570
Buggy source:
public void validate() throws RuleValidationException {
  int i=0;
  for (  GTIngredient rule : this) {
    i++;
    try {
      rule.validate();
    }
 catch (    RuleValidationException e) {
      throw new RuleValidationException("String_Node_Str" + i + "String_Node_Str"+ e.getMessage());
    }
  }
}

Fixed version (ground truth):
public void validate() throws ValidationException {
  int i=0;
  for (  GTIngredient rule : this) {
    i++;
    try {
      rule.validate();
    }
 catch (    ValidationException e) {
      throw new ValidationException("String_Node_Str" + i + "String_Node_Str"+ e.getMessage());
    }
  }
}
Program: 74571
Project: 74571
Buggy source:
public void validate() throws RuleValidationException {
  if (isAttributeNameEnabled()) {
    if (_attributeName.equals("String_Node_Str")) {
      throw new RuleValidationException("String_Node_Str");
    }
    try {
      _attributeName.getPattern();
    }
 catch (    PatternSyntaxException e) {
      throw new RuleValidationException("String_Node_Str" + _attributeName + "String_Node_Str",e);
    }
  }
  if (isAttributeTypeEnabled()) {
    if (_attributeType.equals("String_Node_Str")) {
      throw new RuleValidationException("String_Node_Str");
    }
    try {
      _attributeType.getToken().getType();
    }
 catch (    IllegalActionException e) {
      throw new RuleValidationException("String_Node_Str" + _attributeType + "String_Node_Str",e);
    }
  }
  if (isAttributeValueEnabled()) {
    try {
      _attributeValue.getToken();
    }
 catch (    IllegalActionException e) {
      throw new RuleValidationException("String_Node_Str" + _attributeValue + "String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
public void validate() throws ValidationException {
  if (isAttributeNameEnabled()) {
    if (_attributeName.equals("String_Node_Str")) {
      throw new ValidationException("String_Node_Str");
    }
    try {
      _attributeName.getPattern();
    }
 catch (    PatternSyntaxException e) {
      throw new ValidationException("String_Node_Str" + _attributeName + "String_Node_Str",e);
    }
  }
  if (isAttributeTypeEnabled()) {
    if (_attributeType.equals("String_Node_Str")) {
      throw new ValidationException("String_Node_Str");
    }
    try {
      _attributeType.getToken().getType();
    }
 catch (    IllegalActionException e) {
      throw new ValidationException("String_Node_Str" + _attributeType + "String_Node_Str",e);
    }
  }
  if (isAttributeValueEnabled()) {
    try {
      _attributeValue.getToken();
    }
 catch (    IllegalActionException e) {
      throw new ValidationException("String_Node_Str" + _attributeValue + "String_Node_Str",e);
    }
  }
}
Program: 74572
Project: 74572
Buggy source:
/** 
 * @param owner
 * @param attributeCount
 */
public Criterion(GTIngredientList owner,int attributeCount){
  super(owner,attributeCount);
}

Fixed version (ground truth):
/** 
 * @param owner
 * @param elementCount
 */
public Criterion(GTIngredientList owner,int elementCount){
  super(owner,elementCount);
}
Program: 74573
Project: 74573
Buggy source:
public void validate() throws RuleValidationException {
  if (isPortNameEnabled()) {
    if (_portName.get().equals("String_Node_Str")) {
      throw new RuleValidationException("String_Node_Str");
    }
    try {
      _portName.getPattern();
    }
 catch (    PatternSyntaxException e) {
      throw new RuleValidationException("String_Node_Str" + _portName + "String_Node_Str",e);
    }
  }
  if (isPortTypeEnabled()) {
    if (_portType.get().equals("String_Node_Str")) {
      throw new RuleValidationException("String_Node_Str");
    }
    try {
      _portType.getToken().getType();
    }
 catch (    IllegalActionException e) {
      throw new RuleValidationException("String_Node_Str" + _portType + "String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
public void validate() throws ValidationException {
  if (isPortNameEnabled()) {
    if (_portName.get().equals("String_Node_Str")) {
      throw new ValidationException("String_Node_Str");
    }
    try {
      _portName.getPattern();
    }
 catch (    PatternSyntaxException e) {
      throw new ValidationException("String_Node_Str" + _portName + "String_Node_Str",e);
    }
  }
  if (isPortTypeEnabled()) {
    if (_portType.get().equals("String_Node_Str")) {
      throw new ValidationException("String_Node_Str");
    }
    try {
      _portType.getToken().getType();
    }
 catch (    IllegalActionException e) {
      throw new ValidationException("String_Node_Str" + _portType + "String_Node_Str",e);
    }
  }
}