nus-yam/ex-repair huggingface dataset:
Program: 142891
Project: 142891
Buggy source:
public synchronized void removeColumn(AttributeColumn column){
  columns.remove((AttributeColumnImpl)column);
  columnsMap.remove(column.getId());
  if (column.getTitle() != null && !column.getTitle().equals(column.getId())) {
    columnsMap.remove(column.getTitle());
  }
  columnsSet.remove(column);
  fireAttributeEvent(new AttributeEventImpl(AttributeEvent.EventType.REMOVE_COLUMN,this,column));
  version++;
}

Fixed version (ground truth):
public synchronized void removeColumn(AttributeColumn column){
  int index=columns.indexOf(column);
  if (index == -1) {
    return;
  }
  AttributeColumnImpl c;
  for (index=index + 1; index < columns.size(); index++) {
    c=columns.get(index);
    c.index--;
  }
  columns.remove((AttributeColumnImpl)column);
  columnsMap.remove(column.getId());
  if (column.getTitle() != null && !column.getTitle().equals(column.getId())) {
    columnsMap.remove(column.getTitle());
  }
  columnsSet.remove(column);
  fireAttributeEvent(new AttributeEventImpl(AttributeEvent.EventType.REMOVE_COLUMN,this,column));
  version++;
}
Program: 142892
Project: 142892
Buggy source:
public AbstractEdge newEdge(String id,Node source,Node target,float weight,boolean directed){
  if (source == null || target == null) {
    throw new NullPointerException();
  }
  AbstractNode nodeSource=(AbstractNode)source;
  AbstractNode nodeTarget=(AbstractNode)target;
  AbstractEdge edge;
  if (source == target) {
    edge=new SelfLoopImpl(idGen.newEdgeId(),nodeSource);
  }
 else {
    edge=new MixedEdgeImpl(idGen.newEdgeId(),nodeSource,nodeTarget,directed);
  }
  edge.setWeight(weight);
  edge.setAttributes(newEdgeAttributes());
  edge.getEdgeData().setTextData(newTextData());
  if (id != null) {
    edge.getEdgeData().setId(id);
  }
 else {
    edge.getEdgeData().setId("String_Node_Str" + edge.getId());
  }
  return edge;
}

Fixed version (ground truth):
public AbstractEdge newEdge(String id,Node source,Node target,float weight,boolean directed){
  if (source == null || target == null) {
    throw new NullPointerException();
  }
  AbstractNode nodeSource=(AbstractNode)source;
  AbstractNode nodeTarget=(AbstractNode)target;
  AbstractEdge edge;
  if (source == target) {
    edge=new SelfLoopImpl(idGen.newEdgeId(),nodeSource);
  }
 else {
    edge=new MixedEdgeImpl(idGen.newEdgeId(),nodeSource,nodeTarget,directed);
  }
  edge.setAttributes(newEdgeAttributes());
  edge.setWeight(weight);
  edge.getEdgeData().setTextData(newTextData());
  if (id != null) {
    edge.getEdgeData().setId(id);
  }
 else {
    edge.getEdgeData().setId("String_Node_Str" + edge.getId());
  }
  return edge;
}
Program: 142895
Project: 142895
Buggy source:
private AbstractNode[] deleteNode(AbstractNode node){
  AbstractNode[] descendants=new AbstractNode[node.size + 1];
  int i=0;
  for (DescendantAndSelfIterator itr=new DescendantAndSelfIterator(treeStructure,node,Tautology.instance); itr.hasNext(); ) {
    AbstractNode descendant=itr.next();
    descendants[i]=descendant;
    if (descendant.isEnabled()) {
      edgeProcessor.clearMetaEdges(descendant);
      view.decNodesEnabled(1);
    }
    AbstractEdge[] deletedEdges=edgeProcessor.clearEdges(descendant);
    if (deletedEdges != null) {
      for (int j=0; j < deletedEdges.length; j++) {
        dhns.getGraphStructure().removeFromDictionnary(deletedEdges[j]);
        dhns.getEventManager().fireEvent(new EdgeEvent(EventType.REMOVE_EDGES,deletedEdges[j],view));
      }
    }
    if (node.countInViews() == 1) {
      dhns.getGraphStructure().removeFromDictionnary(descendant);
    }
    i++;
  }
  treeStructure.deleteDescendantAndSelf(node);
  return descendants;
}

Fixed version (ground truth):
private AbstractNode[] deleteNode(AbstractNode node){
  AbstractNode[] descendants=new AbstractNode[node.size + 1];
  int i=0;
  for (DescendantAndSelfIterator itr=new DescendantAndSelfIterator(treeStructure,node,Tautology.instance); itr.hasNext(); ) {
    AbstractNode descendant=itr.next();
    descendants[i]=descendant;
    if (descendant.isEnabled()) {
      edgeProcessor.clearMetaEdges(descendant);
      view.decNodesEnabled(1);
    }
    AbstractEdge[] deletedEdges=edgeProcessor.clearEdges(descendant);
    if (deletedEdges != null) {
      for (int j=0; j < deletedEdges.length; j++) {
        if (deletedEdges[j] != null) {
          dhns.getGraphStructure().removeFromDictionnary(deletedEdges[j]);
          dhns.getEventManager().fireEvent(new EdgeEvent(EventType.REMOVE_EDGES,deletedEdges[j],view));
        }
      }
    }
    if (node.countInViews() == 1) {
      dhns.getGraphStructure().removeFromDictionnary(descendant);
    }
    i++;
  }
  treeStructure.deleteDescendantAndSelf(node);
  return descendants;
}
Program: 142897
Project: 142897
Buggy source:
/** 
 * Used for iterating through all nodes of the graph
 * @return Array with all graph nodes
 */
private Node[] getNodesArray(){
  Graph graph=Lookup.getDefault().lookup(GraphController.class).getModel().getGraph();
  return graph.getNodes().toArray();
}

Fixed version (ground truth):
/** 
 * Used for iterating through all nodes of the graph
 * @return Array with all graph nodes
 */
private Node[] getNodesArray(){
  return Lookup.getDefault().lookup(GraphController.class).getModel().getHierarchicalGraph().getNodesTree().toArray();
}
Program: 142898
Project: 142898
Buggy source:
public void select(Workspace workspace){
  hideTable();
  enableTableControls();
  bannerPanel.setVisible(false);
  AttributeModel attributeModel=Lookup.getDefault().lookup(AttributeController.class).getModel();
  attributeModel.getNodeTable().addAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().addAttributeListener(DataTableTopComponent.this);
  graphModel=gc.getModel();
  graphModel.addGraphListener(DataTableTopComponent.this);
  dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
  refreshAll();
}

Fixed version (ground truth):
public void select(Workspace workspace){
  Lookup.getDefault().lookup(DataTablesController.class).setDataTablesEventListener(DataTableTopComponent.this);
  hideTable();
  enableTableControls();
  bannerPanel.setVisible(false);
  AttributeModel attributeModel=Lookup.getDefault().lookup(AttributeController.class).getModel();
  attributeModel.getNodeTable().addAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().addAttributeListener(DataTableTopComponent.this);
  graphModel=gc.getModel();
  graphModel.addGraphListener(DataTableTopComponent.this);
  dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
  refreshAll();
}
Program: 142900
Project: 142900
Buggy source:
public void contract(){
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        Set<Node> parents=new HashSet<Node>();
        for (        ModelImpl metaModelImpl : models) {
          NodeData nodeData=(NodeData)metaModelImpl.getObj();
          Node node=nodeData.getNode(graph.getView().getViewId());
          Node nodeParent=graph.getParent(node);
          if (nodeParent != null) {
            parents.add(nodeParent);
          }
        }
        for (        Node parent : parents) {
          GroupData gd=(GroupData)parent.getNodeData();
          if (gd.getHullModel() != null) {
            ConvexHull hull=((ConvexHullModel)gd.getHullModel()).getObj();
            contractPositioning(hull);
          }
          graph.retract(parent);
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
        graph.readUnlockAll();
      }
    }
  }
,"String_Node_Str").start();
}

Fixed version (ground truth):
public void contract(){
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        Set<Node> parents=new HashSet<Node>();
        for (        ModelImpl metaModelImpl : models) {
          NodeData nodeData=(NodeData)metaModelImpl.getObj();
          Node node=nodeData.getNode(graph.getView().getViewId());
          if (node != null) {
            Node nodeParent=graph.getParent(node);
            if (nodeParent != null) {
              parents.add(nodeParent);
            }
          }
        }
        for (        Node parent : parents) {
          GroupData gd=(GroupData)parent.getNodeData();
          if (gd.getHullModel() != null) {
            ConvexHull hull=((ConvexHullModel)gd.getHullModel()).getObj();
            contractPositioning(hull);
          }
          graph.retract(parent);
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
        graph.readUnlockAll();
      }
    }
  }
,"String_Node_Str").start();
}
Program: 142901
Project: 142901
Buggy source:
public void ungroup(){
  this.graph=graphController.getModel().getHierarchicalGraph();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        Set<Node> parents=new HashSet<Node>();
        for (        ModelImpl metaModelImpl : models) {
          NodeData nodeData=(NodeData)metaModelImpl.getObj();
          Node node=nodeData.getNode(graph.getView().getViewId());
          if (graph.getDescendantCount(node) > 0) {
            parents.add(node);
          }
 else           if (graph.getParent(node) != null) {
            parents.add(graph.getParent(node));
          }
        }
        for (        Node parent : parents) {
          graph.ungroupNodes(parent);
        }
      }
 catch (      Exception e) {
        graph.readUnlockAll();
        NotifyDescriptor.Message nd=new NotifyDescriptor.Message(e.getMessage());
        DialogDisplayer.getDefault().notifyLater(nd);
      }
    }
  }
,"String_Node_Str").start();
}

Fixed version (ground truth):
public void ungroup(){
  this.graph=graphController.getModel().getHierarchicalGraph();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        Set<Node> parents=new HashSet<Node>();
        for (        ModelImpl metaModelImpl : models) {
          NodeData nodeData=(NodeData)metaModelImpl.getObj();
          Node node=nodeData.getNode(graph.getView().getViewId());
          if (node != null && graph.getDescendantCount(node) > 0) {
            parents.add(node);
          }
 else           if (node != null && graph.getParent(node) != null) {
            parents.add(graph.getParent(node));
          }
        }
        for (        Node parent : parents) {
          graph.ungroupNodes(parent);
        }
      }
 catch (      Exception e) {
        graph.readUnlockAll();
        NotifyDescriptor.Message nd=new NotifyDescriptor.Message(e.getMessage());
        DialogDisplayer.getDefault().notifyLater(nd);
      }
    }
  }
,"String_Node_Str").start();
}
Program: 142902
Project: 142902
Buggy source:
public void run(){
  try {
    Set<Node> parents=new HashSet<Node>();
    for (    ModelImpl metaModelImpl : models) {
      NodeData nodeData=(NodeData)metaModelImpl.getObj();
      Node node=nodeData.getNode(graph.getView().getViewId());
      if (graph.getDescendantCount(node) > 0) {
        parents.add(node);
      }
 else       if (graph.getParent(node) != null) {
        parents.add(graph.getParent(node));
      }
    }
    for (    Node parent : parents) {
      graph.ungroupNodes(parent);
    }
  }
 catch (  Exception e) {
    graph.readUnlockAll();
    NotifyDescriptor.Message nd=new NotifyDescriptor.Message(e.getMessage());
    DialogDisplayer.getDefault().notifyLater(nd);
  }
}

Fixed version (ground truth):
public void run(){
  try {
    Set<Node> parents=new HashSet<Node>();
    for (    ModelImpl metaModelImpl : models) {
      NodeData nodeData=(NodeData)metaModelImpl.getObj();
      Node node=nodeData.getNode(graph.getView().getViewId());
      if (node != null && graph.getDescendantCount(node) > 0) {
        parents.add(node);
      }
 else       if (node != null && graph.getParent(node) != null) {
        parents.add(graph.getParent(node));
      }
    }
    for (    Node parent : parents) {
      graph.ungroupNodes(parent);
    }
  }
 catch (  Exception e) {
    graph.readUnlockAll();
    NotifyDescriptor.Message nd=new NotifyDescriptor.Message(e.getMessage());
    DialogDisplayer.getDefault().notifyLater(nd);
  }
}
Program: 142903
Project: 142903
Buggy source:
public boolean canGroup(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  return selectedNodeModels.length >= 1;
}

Fixed version (ground truth):
public boolean canGroup(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  int nodesReallyPresent=0;
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    Node node=nodeData.getNode(graph.getView().getViewId());
    if (node != null) {
      nodesReallyPresent++;
    }
  }
  return nodesReallyPresent >= 1;
}
Program: 142904
Project: 142904
Buggy source:
public void delete(){
  this.graph=graphController.getModel().getHierarchicalGraph();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    graph.removeNode(nodeData.getRootNode());
  }
}

Fixed version (ground truth):
public void delete(){
  this.graph=graphController.getModel().getHierarchicalGraph();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl model : selectedNodeModels) {
    NodeData nodeData=(NodeData)model.getObj();
    Node node=nodeData.getRootNode();
    if (node != null) {
      graph.removeNode(node);
    }
  }
}
Program: 142905
Project: 142905
Buggy source:
public boolean canExpand(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    Node node=nodeData.getNode(graph.getView().getViewId());
    if (graph.getDescendantCount(node) > 0) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean canExpand(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    Node node=nodeData.getNode(graph.getView().getViewId());
    if (node != null && graph.getDescendantCount(node) > 0) {
      return true;
    }
  }
  return false;
}
Program: 142906
Project: 142906
Buggy source:
public void expand(){
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        for (        ModelImpl metaModelImpl : models) {
          Node node=((NodeData)metaModelImpl.getObj()).getNode(graph.getView().getViewId());
          if (graph.getDescendantCount(node) > 0) {
            expandPositioning(node);
            graph.expand(node);
          }
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
        graph.readUnlockAll();
      }
    }
  }
,"String_Node_Str").start();
}

Fixed version (ground truth):
public void expand(){
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        for (        ModelImpl metaModelImpl : models) {
          Node node=((NodeData)metaModelImpl.getObj()).getNode(graph.getView().getViewId());
          if (node != null && graph.getDescendantCount(node) > 0) {
            expandPositioning(node);
            graph.expand(node);
          }
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
        graph.readUnlockAll();
      }
    }
  }
,"String_Node_Str").start();
}
Program: 142907
Project: 142907
Buggy source:
public boolean canDelete(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  return selectedNodeModels.length >= 1;
}

Fixed version (ground truth):
public boolean canDelete(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  int nodesReallyPresent=0;
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    Node node=nodeData.getNode(graph.getView().getViewId());
    if (node != null) {
      nodesReallyPresent++;
    }
  }
  return nodesReallyPresent >= 1;
}
Program: 142908
Project: 142908
Buggy source:
public boolean canContract(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    Node node=nodeData.getNode(graph.getView().getViewId());
    if (graph.getParent(node) != null) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean canContract(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    Node node=nodeData.getNode(graph.getView().getViewId());
    if (node != null && graph.getParent(node) != null) {
      return true;
    }
  }
  return false;
}
Program: 142910
Project: 142910
Buggy source:
public void unselectAll(){
  filterProperties[1].setValue(new ArrayList<Part>());
}

Fixed version (ground truth):
public void unselectAll(){
  getProperties()[1].setValue(new ArrayList<Part>());
}
Program: 142911
Project: 142911
Buggy source:
public void removePart(Part part){
  List<Part> newParts=new ArrayList<Part>(parts);
  if (newParts.remove(part)) {
    filterProperties[1].setValue(newParts);
  }
}

Fixed version (ground truth):
public void removePart(Part part){
  List<Part> newParts=new ArrayList<Part>(parts);
  if (newParts.remove(part)) {
    getProperties()[1].setValue(newParts);
  }
}
Program: 142912
Project: 142912
Buggy source:
public void selectAll(){
  filterProperties[1].setValue(Arrays.asList(partition.getParts()));
}

Fixed version (ground truth):
public void selectAll(){
  getProperties()[1].setValue(Arrays.asList(partition.getParts()));
}
Program: 142913
Project: 142913
Buggy source:
public void addPart(Part part){
  if (!parts.contains(part)) {
    List<Part> newParts=new ArrayList<Part>(parts.size() + 1);
    newParts.addAll(parts);
    newParts.add(part);
    filterProperties[1].setValue(newParts);
  }
}

Fixed version (ground truth):
public void addPart(Part part){
  if (!parts.contains(part)) {
    List<Part> newParts=new ArrayList<Part>(parts.size() + 1);
    newParts.addAll(parts);
    newParts.add(part);
    getProperties()[1].setValue(newParts);
  }
}
Program: 142914
Project: 142914
Buggy source:
private SearchResult matchRegex(Object value,SearchOptions searchOptions,int rowIndex,int columnIndex){
  boolean found;
  String str=value != null ? value.toString() : "String_Node_Str";
  Matcher matcher=searchOptions.getRegexPattern().matcher(str);
  if (searchOptions.getRegionStart() >= str.length()) {
    return null;
  }
  if (searchOptions.isOnlyMatchWholeAttributeValue()) {
    found=matcher.matches();
  }
 else {
    matcher.region(searchOptions.getRegionStart(),str.length());
    found=matcher.find();
  }
  if (found) {
    searchOptions.setStartingRow(rowIndex);
    searchOptions.setStartingColumn(columnIndex);
    searchOptions.setRegionStart(matcher.end() + 1);
    return new SearchResult(searchOptions,null,null,rowIndex,columnIndex,matcher.start(),matcher.end());
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
private SearchResult matchRegex(Object value,SearchOptions searchOptions,int rowIndex,int columnIndex){
  boolean found;
  String str=value != null ? value.toString() : "String_Node_Str";
  Matcher matcher=searchOptions.getRegexPattern().matcher(str);
  if (searchOptions.getRegionStart() >= str.length()) {
    return null;
  }
  if (searchOptions.isOnlyMatchWholeAttributeValue()) {
    found=matcher.matches();
  }
 else {
    matcher.region(searchOptions.getRegionStart(),str.length());
    found=matcher.find();
  }
  if (found) {
    searchOptions.setStartingRow(rowIndex);
    searchOptions.setStartingColumn(columnIndex);
    searchOptions.setRegionStart(matcher.end());
    return new SearchResult(searchOptions,null,null,rowIndex,columnIndex,matcher.start(),matcher.end());
  }
 else {
    return null;
  }
}
Program: 142915
Project: 142915
Buggy source:
public void execute(){
  SearchReplaceUI ui=Lookup.getDefault().lookup(SearchReplaceUI.class);
  if (Lookup.getDefault().lookup(DataTablesController.class).isNodeTableMode()) {
    ui.setMode(SearchReplaceUI.Mode.NODES_TABLE);
  }
 else {
    ui.setMode(SearchReplaceUI.Mode.EDGES_TABLE);
  }
  DialogDescriptor dd=new DialogDescriptor(ui,getName());
  dd.setModal(false);
  dd.setOptions(new Object[]{NbBundle.getMessage(SearchReplace.class,"String_Node_Str")});
  DialogDisplayer.getDefault().notify(dd);
}

Fixed version (ground truth):
public void execute(){
  SearchReplaceUI ui=Lookup.getDefault().lookup(SearchReplaceUI.class);
  if (Lookup.getDefault().lookup(DataTablesController.class).isNodeTableMode()) {
    ui.setMode(SearchReplaceUI.Mode.NODES_TABLE);
  }
 else {
    ui.setMode(SearchReplaceUI.Mode.EDGES_TABLE);
  }
  DialogDescriptor dd=new DialogDescriptor(ui,getName());
  dd.setModal(true);
  dd.setOptions(new Object[]{NbBundle.getMessage(SearchReplace.class,"String_Node_Str")});
  DialogDisplayer.getDefault().notify(dd);
}
Program: 142916
Project: 142916
Buggy source:
/** 
 * @param graphModel
 */
public void execute(GraphModel graphModel,AttributeModel attributeModel){
  mIsCanceled=false;
  mAvgInDegree=mAvgOutDegree=0.0;
  AttributeTable nodeTable=attributeModel.getNodeTable();
  AttributeColumn inCol=nodeTable.getColumn(INDEGREE);
  AttributeColumn outCol=nodeTable.getColumn(OUTDEGREE);
  if (inCol == null) {
    inCol=nodeTable.addColumn(INDEGREE,"String_Node_Str",AttributeType.INT,AttributeOrigin.COMPUTED,0);
  }
  if (outCol == null) {
    outCol=nodeTable.addColumn(OUTDEGREE,"String_Node_Str",AttributeType.INT,AttributeOrigin.COMPUTED,0);
  }
  DirectedGraph graph=graphModel.getDirectedGraphVisible();
  int i=0;
  graph.readLock();
  this.mGraphRevision="String_Node_Str" + graph.getNodeVersion() + "String_Node_Str"+ graph.getEdgeVersion()+ "String_Node_Str";
  Progress.start(mProgress,graph.getNodeCount());
  for (  Node n : graph.getNodes()) {
    AttributeRow row=(AttributeRow)n.getNodeData().getAttributes();
    row.setValue(inCol,graph.getInDegree(n));
    row.setValue(outCol,graph.getOutDegree(n));
    mAvgInDegree+=graph.getInDegree(n);
    mAvgOutDegree+=graph.getOutDegree(n);
    if (mIsCanceled) {
      break;
    }
    i++;
    mProgress.progress(i);
  }
  mAvgDegree=mAvgInDegree + mAvgOutDegree;
  mAvgInDegree/=graph.getNodeCount();
  mAvgOutDegree/=graph.getNodeCount();
  mAvgDegree/=graph.getNodeCount();
  graph.readUnlockAll();
}

Fixed version (ground truth):
/** 
 * @param graphModel
 */
public void execute(GraphModel graphModel,AttributeModel attributeModel){
  mIsCanceled=false;
  mAvgInDegree=mAvgOutDegree=0.0;
  AttributeTable nodeTable=attributeModel.getNodeTable();
  AttributeColumn inCol=nodeTable.getColumn(INDEGREE);
  AttributeColumn outCol=nodeTable.getColumn(OUTDEGREE);
  if (inCol == null) {
    inCol=nodeTable.addColumn(INDEGREE,"String_Node_Str",AttributeType.INT,AttributeOrigin.COMPUTED,0);
  }
  if (outCol == null) {
    outCol=nodeTable.addColumn(OUTDEGREE,"String_Node_Str",AttributeType.INT,AttributeOrigin.COMPUTED,0);
  }
  DirectedGraph graph=graphModel.getDirectedGraphVisible();
  int i=0;
  graph.readLock();
  this.mGraphRevision="String_Node_Str" + graph.getNodeVersion() + "String_Node_Str"+ graph.getEdgeVersion()+ "String_Node_Str";
  Progress.start(mProgress,graph.getNodeCount());
  for (  Node n : graph.getNodes()) {
    AttributeRow row=(AttributeRow)n.getNodeData().getAttributes();
    row.setValue(inCol,graph.getInDegree(n));
    row.setValue(outCol,graph.getOutDegree(n));
    mAvgInDegree+=graph.getInDegree(n);
    mAvgOutDegree+=graph.getOutDegree(n);
    if (mIsCanceled) {
      break;
    }
    i++;
    Progress.progress(mProgress,i);
  }
  mAvgDegree=mAvgInDegree + mAvgOutDegree;
  mAvgInDegree/=graph.getNodeCount();
  mAvgOutDegree/=graph.getNodeCount();
  mAvgDegree/=graph.getNodeCount();
  graph.readUnlockAll();
}
Program: 142918
Project: 142918
Buggy source:
public Object getValue(){
  if (!column.getOrigin().isDelegate())   return value;
 else {
    Object delegateIdValue=row.getDelegateIdValue();
    PropertiesColumn propertiesColumn=column.getOrigin().getPropertiesColumn();
    AttributeValueDelegateProvider attributeValueDelegateProvider=PropertyColumnToAttributeValueDelegateProviderMapper.getInstance().get(propertiesColumn);
    if (row.attributeTable.isEdgeTable())     return attributeValueDelegateProvider.getEdgeValue(column,delegateIdValue);
 else     if (row.attributeTable.isNodeTable())     return attributeValueDelegateProvider.getNodeValue(column,delegateIdValue);
 else     throw new AssertionError();
  }
}

Fixed version (ground truth):
public Object getValue(){
  if (!column.getOrigin().isDelegate()) {
    System.out.println("String_Node_Str" + column.getOrigin());
    System.out.println("String_Node_Str" + column.getOrigin().isDelegate());
    System.out.println();
    return value;
  }
 else {
    System.out.println("String_Node_Str");
    Object delegateIdValue=1L;
    PropertiesColumn propertiesColumn=column.getOrigin().getPropertiesColumn();
    AttributeValueDelegateProvider attributeValueDelegateProvider=PropertyColumnToAttributeValueDelegateProviderMapper.getInstance().get(propertiesColumn);
    return attributeValueDelegateProvider.getEdgeValue(column,delegateIdValue);
  }
}
Program: 142919
Project: 142919
Buggy source:
void setAttributeRow(AttributeRowImpl row){
  this.row=row;
}

Fixed version (ground truth):
void setAttributeRow(AttributeRowImpl row){
  System.out.println("String_Node_Str" + row);
  this.row=row;
}
Program: 142921
Project: 142921
Buggy source:
@Override public void run(){
  neo4jImporter.importLocal(neo4jDirectory);
}

Fixed version (ground truth):
@Override public void run(){
  neo4jExporter.exportLocal(neo4jDirectory);
}
Program: 142922
Project: 142922
Buggy source:
public void select(Workspace workspace){
  elementGroup.clearSelection();
  tableScrollPane.setViewportView(null);
  nodesButton.setEnabled(true);
  edgesButton.setEnabled(true);
  filterTextField.setEnabled(true);
  labelFilter.setEnabled(true);
  visibleGraphCheckbox.setEnabled(true);
  bannerPanel.setVisible(false);
  graphModel=gc.getModel();
  graphModel.addGraphListener(DataTableTopComponent.this);
  dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().addAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().addAttributeListener(DataTableTopComponent.this);
  refresh();
}

Fixed version (ground truth):
public void select(Workspace workspace){
  hideTable();
  enableControls();
  bannerPanel.setVisible(false);
  graphModel=gc.getModel();
  graphModel.addGraphListener(DataTableTopComponent.this);
  dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().addAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().addAttributeListener(DataTableTopComponent.this);
  refresh();
}
Program: 142923
Project: 142923
Buggy source:
private DataTableTopComponent(){
  dynamicFiltering=NbPreferences.forModule(DataTableTopComponent.class).getBoolean(DATA_LABORATORY_DYNAMIC_FILTERING,true);
  taskExecutor=new ThreadPoolExecutor(0,1,10L,TimeUnit.SECONDS,new LinkedBlockingDeque<Runnable>(20),new ThreadFactory(){
    public Thread newThread(    Runnable r){
      return new Thread(r,"String_Node_Str");
    }
  }
);
  initComponents();
  setName(NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str"));
  setIcon(ImageUtilities.loadImage(ICON_PATH));
  Border b=(Border)UIManager.get("String_Node_Str");
  controlToolbar.setBorder(b);
  if (UIUtils.isAquaLookAndFeel()) {
    controlToolbar.setBackground(UIManager.getColor("String_Node_Str"));
  }
  initEvents();
  nodeTable=new NodeDataTable();
  edgeTable=new EdgeDataTable();
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  if (pc.getCurrentWorkspace() == null) {
    nodesButton.setEnabled(false);
    edgesButton.setEnabled(false);
    filterTextField.setEnabled(false);
    labelFilter.setEnabled(false);
    bannerPanel.setVisible(false);
    visibleGraphCheckbox.setEnabled(false);
  }
 else {
    refresh();
  }
  bannerPanel.setVisible(false);
}

Fixed version (ground truth):
private DataTableTopComponent(){
  dynamicFiltering=NbPreferences.forModule(DataTableTopComponent.class).getBoolean(DATA_LABORATORY_DYNAMIC_FILTERING,true);
  taskExecutor=new ThreadPoolExecutor(0,1,10L,TimeUnit.SECONDS,new LinkedBlockingDeque<Runnable>(20),new ThreadFactory(){
    public Thread newThread(    Runnable r){
      return new Thread(r,"String_Node_Str");
    }
  }
);
  initComponents();
  setName(NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str"));
  setIcon(ImageUtilities.loadImage(ICON_PATH));
  Border b=(Border)UIManager.get("String_Node_Str");
  controlToolbar.setBorder(b);
  if (UIUtils.isAquaLookAndFeel()) {
    controlToolbar.setBackground(UIManager.getColor("String_Node_Str"));
  }
  initEvents();
  nodeTable=new NodeDataTable();
  edgeTable=new EdgeDataTable();
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  if (pc.getCurrentWorkspace() == null) {
    clear();
  }
 else {
    refresh();
  }
  bannerPanel.setVisible(false);
}
Program: 142924
Project: 142924
Buggy source:
private void clear(){
  tableScrollPane.setViewport(null);
}

Fixed version (ground truth):
private void clear(){
  elementGroup.clearSelection();
  nodesButton.setEnabled(false);
  edgesButton.setEnabled(false);
  filterTextField.setEnabled(false);
  labelFilter.setEnabled(false);
  bannerPanel.setVisible(false);
  visibleGraphCheckbox.setEnabled(false);
  hideTable();
}
Program: 142925
Project: 142925
Buggy source:
private void refresh(){
  bannerPanel.setVisible(false);
  if (classDisplayed.equals(ClassDisplayed.NODE)) {
    initNodesView();
  }
 else   if (classDisplayed.equals(ClassDisplayed.EDGE)) {
    initEdgesView();
  }
}

Fixed version (ground truth):
private void refresh(){
  bannerPanel.setVisible(false);
  if (classDisplayed.equals(ClassDisplayed.NODE)) {
    nodesButton.setSelected(true);
    initNodesView();
  }
 else   if (classDisplayed.equals(ClassDisplayed.EDGE)) {
    edgesButton.setSelected(true);
    initEdgesView();
  }
}
Program: 142927
Project: 142927
Buggy source:
public void disable(){
  elementGroup.clearSelection();
  nodesButton.setEnabled(false);
  edgesButton.setEnabled(false);
  filterTextField.setEnabled(false);
  labelFilter.setEnabled(false);
  bannerPanel.setVisible(false);
  visibleGraphCheckbox.setEnabled(false);
  clear();
}

Fixed version (ground truth):
public void disable(){
  clear();
}
Program: 142928
Project: 142928
Buggy source:
public void initialize(Workspace workspace){
  workspace.add(new DataTablesModel());
  refresh();
}

Fixed version (ground truth):
public void initialize(Workspace workspace){
  workspace.add(new DataTablesModel());
}
Program: 142929
Project: 142929
Buggy source:
public void refreshModel(StatisticsModel model){
  currentModel=model;
  if (model == null) {
    runButton.setText(RUN);
    runButton.setEnabled(false);
    busyLabel.setBusy(false);
    busyLabel.setVisible(false);
    reportButton.setEnabled(false);
    resultLabel.setText("String_Node_Str");
    currentStatistics=null;
    return;
  }
  runButton.setEnabled(true);
  if (model.isRunning(statisticsUI)) {
    runButton.setText(CANCEL);
    busyLabel.setVisible(true);
    busyLabel.setBusy(true);
    reportButton.setEnabled(false);
    resultLabel.setText("String_Node_Str");
  }
 else {
    runButton.setText(RUN);
    busyLabel.setBusy(false);
    busyLabel.setVisible(false);
    currentStatistics=null;
    refreshResult(model);
  }
}

Fixed version (ground truth):
public void refreshModel(StatisticsModel model){
  currentModel=model;
  if (model == null) {
    runButton.setText(RUN);
    runButton.setEnabled(false);
    busyLabel.setBusy(false);
    busyLabel.setVisible(false);
    reportButton.setEnabled(false);
    resultLabel.setText("String_Node_Str");
    currentStatistics=null;
    return;
  }
  runButton.setEnabled(true);
  if (model.isRunning(statisticsUI)) {
    runButton.setText(CANCEL);
    busyLabel.setVisible(true);
    busyLabel.setBusy(true);
    reportButton.setEnabled(false);
    resultLabel.setText("String_Node_Str");
    if (currentStatistics == null) {
      currentStatistics=currentModel.getStatistics(statisticsUI);
    }
  }
 else {
    runButton.setText(RUN);
    busyLabel.setBusy(false);
    busyLabel.setVisible(false);
    currentStatistics=null;
    refreshResult(model);
  }
}
Program: 142930
Project: 142930
Buggy source:
public void run(){
  pStatistics.execute(graphModel,attributeModel);
  for (  StatisticsUI s : uis) {
    model.setRunning(s,false);
  }
  model.addStatistics(pStatistics);
}

Fixed version (ground truth):
public void run(){
  pStatistics.execute(graphModel,attributeModel);
  for (  StatisticsUI s : uis) {
    model.setRunning(s,false);
  }
}
Program: 142931
Project: 142931
Buggy source:
/** 
 * @param statistics
 */
public void execute(final Statistics pStatistics,LongTaskListener listener){
  final GraphController graphController=Lookup.getDefault().lookup(GraphController.class);
  final GraphModel graphModel=graphController.getModel();
  final AttributeModel attributeModel=Lookup.getDefault().lookup(AttributeController.class).getModel();
  StatisticsBuilder builder=getBuilder(pStatistics.getClass());
  final StatisticsUI[] uis=getUI(pStatistics);
  for (  StatisticsUI s : uis) {
    s.setup(pStatistics);
    model.setRunning(s,true);
  }
  if (pStatistics instanceof LongTask) {
    LongTaskExecutor executor=new LongTaskExecutor(true,builder.getName(),10);
    if (listener != null) {
      executor.setLongTaskListener(listener);
    }
    executor.execute((LongTask)pStatistics,new Runnable(){
      public void run(){
        pStatistics.execute(graphModel,attributeModel);
        for (        StatisticsUI s : uis) {
          model.setRunning(s,false);
        }
        model.addStatistics(pStatistics);
      }
    }
,builder.getName(),null);
  }
 else {
    pStatistics.execute(graphModel,attributeModel);
    if (listener != null) {
      listener.taskFinished(null);
    }
    for (    StatisticsUI s : uis) {
      model.setRunning(s,false);
    }
    model.addStatistics(pStatistics);
  }
}

Fixed version (ground truth):
/** 
 * @param statistics
 */
public void execute(final Statistics pStatistics,LongTaskListener listener){
  final GraphController graphController=Lookup.getDefault().lookup(GraphController.class);
  final GraphModel graphModel=graphController.getModel();
  final AttributeModel attributeModel=Lookup.getDefault().lookup(AttributeController.class).getModel();
  StatisticsBuilder builder=getBuilder(pStatistics.getClass());
  final StatisticsUI[] uis=getUI(pStatistics);
  model.addStatistics(pStatistics);
  for (  StatisticsUI s : uis) {
    s.setup(pStatistics);
    model.setRunning(s,true);
  }
  if (pStatistics instanceof LongTask) {
    LongTaskExecutor executor=new LongTaskExecutor(true,builder.getName(),10);
    if (listener != null) {
      executor.setLongTaskListener(listener);
    }
    executor.execute((LongTask)pStatistics,new Runnable(){
      public void run(){
        pStatistics.execute(graphModel,attributeModel);
        for (        StatisticsUI s : uis) {
          model.setRunning(s,false);
        }
      }
    }
,builder.getName(),null);
  }
 else {
    pStatistics.execute(graphModel,attributeModel);
    if (listener != null) {
      listener.taskFinished(null);
    }
    for (    StatisticsUI s : uis) {
      model.setRunning(s,false);
    }
  }
}
Program: 142932
Project: 142932
Buggy source:
public void select(Workspace workspace){
  elementGroup.clearSelection();
  tableScrollPane.setViewportView(null);
  nodesButton.setEnabled(true);
  edgesButton.setEnabled(true);
  filterTextField.setEnabled(true);
  labelFilter.setEnabled(true);
  visibleGraphCheckbox.setEnabled(true);
  bannerPanel.setVisible(false);
  graphModel=gc.getModel();
  graphModel.addGraphListener(DataTableTopComponent.this);
  dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().addAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().addAttributeListener(DataTableTopComponent.this);
}

Fixed version (ground truth):
public void select(Workspace workspace){
  elementGroup.clearSelection();
  tableScrollPane.setViewportView(null);
  nodesButton.setEnabled(true);
  edgesButton.setEnabled(true);
  filterTextField.setEnabled(true);
  labelFilter.setEnabled(true);
  visibleGraphCheckbox.setEnabled(true);
  bannerPanel.setVisible(false);
  graphModel=gc.getModel();
  graphModel.addGraphListener(DataTableTopComponent.this);
  dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().addAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().addAttributeListener(DataTableTopComponent.this);
  refresh();
}
Program: 142933
Project: 142933
Buggy source:
public void unselect(Workspace workspace){
  graphModel.removeGraphListener(DataTableTopComponent.this);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().removeAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().removeAttributeListener(DataTableTopComponent.this);
  graphModel=null;
  dataTablesModel=null;
}

Fixed version (ground truth):
public void unselect(Workspace workspace){
  graphModel.removeGraphListener(DataTableTopComponent.this);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().removeAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().removeAttributeListener(DataTableTopComponent.this);
  graphModel=null;
  dataTablesModel=null;
  clear();
}
Program: 142934
Project: 142934
Buggy source:
private void refreshButtonActionPerformed(java.awt.event.ActionEvent evt){
  bannerPanel.setVisible(false);
  if (classDisplayed.equals(ClassDisplayed.NODE)) {
    initNodesView();
  }
 else   if (classDisplayed.equals(ClassDisplayed.EDGE)) {
    initEdgesView();
  }
}

Fixed version (ground truth):
private void refreshButtonActionPerformed(java.awt.event.ActionEvent evt){
  refresh();
}
Program: 142935
Project: 142935
Buggy source:
public void close(Workspace workspace){
}

Fixed version (ground truth):
public void close(Workspace workspace){
  clear();
}
Program: 142936
Project: 142936
Buggy source:
private DataTableTopComponent(){
  dynamicFiltering=NbPreferences.forModule(DataTableTopComponent.class).getBoolean(DATA_LABORATORY_DYNAMIC_FILTERING,true);
  taskExecutor=new ThreadPoolExecutor(0,1,10L,TimeUnit.SECONDS,new LinkedBlockingDeque<Runnable>(20),new ThreadFactory(){
    public Thread newThread(    Runnable r){
      return new Thread(r,"String_Node_Str");
    }
  }
);
  initComponents();
  setName(NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str"));
  setIcon(ImageUtilities.loadImage(ICON_PATH));
  Border b=(Border)UIManager.get("String_Node_Str");
  controlToolbar.setBorder(b);
  if (UIUtils.isAquaLookAndFeel()) {
    controlToolbar.setBackground(UIManager.getColor("String_Node_Str"));
  }
  initEvents();
  nodeTable=new NodeDataTable();
  edgeTable=new EdgeDataTable();
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  if (pc.getCurrentWorkspace() == null) {
    nodesButton.setEnabled(false);
    edgesButton.setEnabled(false);
    filterTextField.setEnabled(false);
    labelFilter.setEnabled(false);
    bannerPanel.setVisible(false);
    visibleGraphCheckbox.setEnabled(false);
  }
  bannerPanel.setVisible(false);
}

Fixed version (ground truth):
private DataTableTopComponent(){
  dynamicFiltering=NbPreferences.forModule(DataTableTopComponent.class).getBoolean(DATA_LABORATORY_DYNAMIC_FILTERING,true);
  taskExecutor=new ThreadPoolExecutor(0,1,10L,TimeUnit.SECONDS,new LinkedBlockingDeque<Runnable>(20),new ThreadFactory(){
    public Thread newThread(    Runnable r){
      return new Thread(r,"String_Node_Str");
    }
  }
);
  initComponents();
  setName(NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str"));
  setIcon(ImageUtilities.loadImage(ICON_PATH));
  Border b=(Border)UIManager.get("String_Node_Str");
  controlToolbar.setBorder(b);
  if (UIUtils.isAquaLookAndFeel()) {
    controlToolbar.setBackground(UIManager.getColor("String_Node_Str"));
  }
  initEvents();
  nodeTable=new NodeDataTable();
  edgeTable=new EdgeDataTable();
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  if (pc.getCurrentWorkspace() == null) {
    nodesButton.setEnabled(false);
    edgesButton.setEnabled(false);
    filterTextField.setEnabled(false);
    labelFilter.setEnabled(false);
    bannerPanel.setVisible(false);
    visibleGraphCheckbox.setEnabled(false);
  }
 else {
    refresh();
  }
  bannerPanel.setVisible(false);
}
Program: 142938
Project: 142938
Buggy source:
public void disable(){
  elementGroup.clearSelection();
  nodesButton.setEnabled(false);
  edgesButton.setEnabled(false);
  filterTextField.setEnabled(false);
  labelFilter.setEnabled(false);
  bannerPanel.setVisible(false);
  visibleGraphCheckbox.setEnabled(false);
}

Fixed version (ground truth):
public void disable(){
  elementGroup.clearSelection();
  nodesButton.setEnabled(false);
  edgesButton.setEnabled(false);
  filterTextField.setEnabled(false);
  labelFilter.setEnabled(false);
  bannerPanel.setVisible(false);
  visibleGraphCheckbox.setEnabled(false);
  clear();
}
Program: 142939
Project: 142939
Buggy source:
public void initialize(Workspace workspace){
  workspace.add(new DataTablesModel());
}

Fixed version (ground truth):
public void initialize(Workspace workspace){
  workspace.add(new DataTablesModel());
  refresh();
}
Program: 142940
Project: 142940
Buggy source:
public void select(Workspace workspace){
  elementGroup.clearSelection();
  tableScrollPane.setViewportView(null);
  nodesButton.setEnabled(true);
  edgesButton.setEnabled(true);
  filterTextField.setEnabled(true);
  labelFilter.setEnabled(true);
  visibleGraphCheckbox.setEnabled(true);
  bannerPanel.setVisible(false);
  graphModel=gc.getModel();
  graphModel.addGraphListener(DataTableTopComponent.this);
  dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().addAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().addAttributeListener(DataTableTopComponent.this);
}

Fixed version (ground truth):
public void select(Workspace workspace){
  elementGroup.clearSelection();
  tableScrollPane.setViewportView(null);
  nodesButton.setEnabled(true);
  edgesButton.setEnabled(true);
  filterTextField.setEnabled(true);
  labelFilter.setEnabled(true);
  visibleGraphCheckbox.setEnabled(true);
  bannerPanel.setVisible(false);
  graphModel=gc.getModel();
  graphModel.addGraphListener(DataTableTopComponent.this);
  dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().addAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().addAttributeListener(DataTableTopComponent.this);
  refresh();
}
Program: 142941
Project: 142941
Buggy source:
public void unselect(Workspace workspace){
  graphModel.removeGraphListener(DataTableTopComponent.this);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().removeAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().removeAttributeListener(DataTableTopComponent.this);
  graphModel=null;
  dataTablesModel=null;
}

Fixed version (ground truth):
public void unselect(Workspace workspace){
  graphModel.removeGraphListener(DataTableTopComponent.this);
  AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  attributeModel.getNodeTable().removeAttributeListener(DataTableTopComponent.this);
  attributeModel.getEdgeTable().removeAttributeListener(DataTableTopComponent.this);
  graphModel=null;
  dataTablesModel=null;
  clear();
}
Program: 142942
Project: 142942
Buggy source:
public void close(Workspace workspace){
}

Fixed version (ground truth):
public void close(Workspace workspace){
  clear();
}