nus-yam/ex-repair huggingface dataset:
Program: 189825
Project: 189825
Buggy source:
public boolean execute(){
  attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  graphModel=workspace.getLookup().lookup(GraphModel.class);
  DirectedGraph graph;
  if (exportVisible) {
    graph=graphModel.getDirectedGraph();
  }
 else {
    graph=graphModel.getDirectedGraph();
  }
  progressTicket.start(graph.getNodeCount() + graph.getEdgeCount());
  graph.readLock();
  if (normalize) {
    computeNormalizeValues(graph);
  }
  try {
    exportData(graph);
  }
 catch (  IOException ex) {
    Exceptions.printStackTrace(ex);
  }
  progressTicket.finish();
  graph.readUnlock();
  return !cancel;
}

Fixed version (ground truth):
public boolean execute(){
  attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  graphModel=workspace.getLookup().lookup(GraphModel.class);
  Graph graph;
  if (exportVisible) {
    graph=graphModel.getGraphVisible();
  }
 else {
    graph=graphModel.getGraph();
  }
  progressTicket.start(graph.getNodeCount() + graph.getEdgeCount());
  DynamicModel dynamicModel=workspace.getLookup().lookup(DynamicModel.class);
  visibleInterval=dynamicModel != null && exportVisible ? dynamicModel.getVisibleInterval() : new TimeInterval();
  graph.readLock();
  if (normalize) {
    computeNormalizeValues(graph);
  }
  try {
    exportData(graph);
  }
 catch (  IOException ex) {
    Exceptions.printStackTrace(ex);
  }
  progressTicket.finish();
  graph.readUnlock();
  return !cancel;
}
Program: 189827
Project: 189827
Buggy source:
public DrawerSettings(){
  background.top=UIManager.getColor("String_Node_Str");
  background.bottom=new Color(97,95,93,0);
  background.paint=new GradientPaint(0,0,background.top,0,20,background.bottom,true);
  selection.top=new Color(108,151,194,50);
  selection.bottom=new Color(57,97,131,50);
  selection.paint=new GradientPaint(0,0,selection.top,0,20,selection.bottom,true);
  selection.visibleHookWidth=6;
  selection.invisibleHookMargin=1;
  selection.minimalWidth=16;
  selection.mouseOverTopColor=new Color(102,195,145,50);
  selection.activatedTopColor=new Color(188,118,114,50);
  selection.mouseOverBottomColor=new Color(60,143,96,50);
  selection.activatedBottomColor=new Color(151,79,79,50);
  selection.mouseOverPaint=new GradientPaint(0,0,selection.mouseOverTopColor,0,20,selection.mouseOverBottomColor,true);
  selection.activatedPaint=new GradientPaint(0,0,selection.activatedTopColor,0,20,selection.activatedBottomColor,true);
  shadowColor=new Color(35,35,35,105);
  defaultStroke=new BasicStroke(1.0f);
  defaultStrokeColor=Color.black;
  hookLength=8;
  tmMarginTop=0;
  tmMarginBottom=0;
  topChartMargin=16;
  Map<Key,Object> map=new HashMap<Key,Object>();
  map.put(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BILINEAR);
  map.put(RenderingHints.KEY_RENDERING,RenderingHints.VALUE_RENDER_QUALITY);
  map.put(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  map.put(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
  renderingHints=new RenderingHints(map);
}

Fixed version (ground truth):
public DrawerSettings(){
  background.top=UIManager.getColor("String_Node_Str");
  background.bottom=new Color(97,95,93,0);
  selection.top=new Color(108,151,194,50);
  selection.bottom=new Color(57,97,131,50);
  selection.paint=new GradientPaint(0,0,selection.top,0,20,selection.bottom,true);
  selection.visibleHookWidth=6;
  selection.invisibleHookMargin=1;
  selection.minimalWidth=16;
  selection.mouseOverTopColor=new Color(102,195,145,50);
  selection.activatedTopColor=new Color(188,118,114,50);
  selection.mouseOverBottomColor=new Color(60,143,96,50);
  selection.activatedBottomColor=new Color(151,79,79,50);
  selection.mouseOverPaint=new GradientPaint(0,0,selection.mouseOverTopColor,0,20,selection.mouseOverBottomColor,true);
  selection.activatedPaint=new GradientPaint(0,0,selection.activatedTopColor,0,20,selection.activatedBottomColor,true);
  shadowColor=new Color(35,35,35,105);
  defaultStroke=new BasicStroke(1.0f);
  defaultStrokeColor=Color.black;
  hookLength=8;
  tmMarginTop=0;
  tmMarginBottom=0;
  topChartMargin=16;
  Map<Key,Object> map=new HashMap<Key,Object>();
  map.put(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BILINEAR);
  map.put(RenderingHints.KEY_RENDERING,RenderingHints.VALUE_RENDER_QUALITY);
  map.put(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  map.put(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
  renderingHints=new RenderingHints(map);
}
Program: 189828
Project: 189828
Buggy source:
void update(int width,int height){
  if (lastWidth == width && lastHeight == height) {
    return;
  }
  lastWidth=width;
  lastHeight=height;
  background.paint=new GradientPaint(0,0,background.top,0,height,background.bottom,true);
  selection.paint=new GradientPaint(0,0,selection.top,0,height,selection.bottom,true);
  selection.mouseOverPaint=new GradientPaint(0,0,selection.mouseOverTopColor,0,height,selection.mouseOverBottomColor,true);
  selection.activatedPaint=new GradientPaint(0,0,selection.activatedTopColor,0,height,selection.activatedBottomColor,true);
}

Fixed version (ground truth):
void update(int width,int height){
  if (lastWidth == width && lastHeight == height) {
    return;
  }
  lastWidth=width;
  lastHeight=height;
  selection.paint=new GradientPaint(0,0,selection.top,0,height,selection.bottom,true);
  selection.mouseOverPaint=new GradientPaint(0,0,selection.mouseOverTopColor,0,height,selection.mouseOverBottomColor,true);
  selection.activatedPaint=new GradientPaint(0,0,selection.activatedTopColor,0,height,selection.activatedBottomColor,true);
}
Program: 189830
Project: 189830
Buggy source:
public boolean isRendererForitem(Item item,PreviewProperties properties){
  return item instanceof EdgeItem && properties.getBooleanValue(PreviewProperty.DIRECTED) && (Boolean)item.getData(EdgeItem.DIRECTED)&& !(Boolean)item.getData(EdgeItem.SELF_LOOP)&& !properties.getBooleanValue(PreviewProperty.MOVING);
}

Fixed version (ground truth):
public boolean isRendererForitem(Item item,PreviewProperties properties){
  return item instanceof EdgeItem && properties.getBooleanValue(PreviewProperty.SHOW_EDGES) && properties.getBooleanValue(PreviewProperty.DIRECTED)&& (Boolean)item.getData(EdgeItem.DIRECTED)&& !(Boolean)item.getData(EdgeItem.SELF_LOOP)&& !properties.getBooleanValue(PreviewProperty.MOVING);
}
Program: 189831
Project: 189831
Buggy source:
public AttributeModel getModel(Workspace workspace){
  AttributeModel model=workspace.getLookup().lookup(AttributeModel.class);
  if (model != null) {
    return model;
  }
  model=new IndexedAttributeModel();
  workspace.add(model);
  return model;
}

Fixed version (ground truth):
public synchronized AttributeModel getModel(Workspace workspace){
  AttributeModel model=workspace.getLookup().lookup(AttributeModel.class);
  if (model != null) {
    return model;
  }
  model=new IndexedAttributeModel();
  workspace.add(model);
  return model;
}
Program: 189832
Project: 189832
Buggy source:
public void clearMetaEdgesOutOfRange(AbstractNode enabledNode,AbstractNode rangeNode){
  int rangeStart=rangeNode.getPre();
  int rangeLimit=rangeStart + rangeNode.size;
  if (enabledNode.getMetaEdgesOutTree().getCount() > 0) {
    edgeIterator.setNode(enabledNode.getMetaEdgesOutTree());
    while (edgeIterator.hasNext()) {
      MetaEdgeImpl metaEdge=(MetaEdgeImpl)edgeIterator.next();
      AbstractNode target=metaEdge.getTarget(viewId);
      int targetPre=target.getPre();
      if (targetPre >= rangeStart && targetPre <= rangeLimit) {
        if (!metaEdge.isSelfLoop() && target.getEdgesInTree().hasNeighbour(enabledNode)) {
          enabledNode.decMutualMetaEdgeDegree();
          target.decMutualMetaEdgeDegree();
          view.decMutualMetaEdgesTotal(1);
        }
        edgeIterator.remove();
        target.getMetaEdgesInTree().remove(metaEdge);
        view.decMetaEdgesCount(1);
      }
    }
  }
  if (enabledNode.getMetaEdgesInTree().getCount() > 0) {
    edgeIterator.setNode(enabledNode.getMetaEdgesInTree());
    while (edgeIterator.hasNext()) {
      MetaEdgeImpl metaEdge=(MetaEdgeImpl)edgeIterator.next();
      int sourcePre=metaEdge.getSource(viewId).getPre();
      if (sourcePre >= rangeStart && sourcePre <= rangeLimit) {
        edgeIterator.remove();
        metaEdge.getSource(viewId).getMetaEdgesOutTree().remove(metaEdge);
        view.decMetaEdgesCount(1);
      }
    }
  }
}

Fixed version (ground truth):
public void clearMetaEdgesOutOfRange(AbstractNode enabledNode,AbstractNode rangeNode){
  int rangeStart=rangeNode.getPre();
  int rangeLimit=rangeStart + rangeNode.size;
  if (enabledNode.getMetaEdgesOutTree().getCount() > 0) {
    edgeIterator.setNode(enabledNode.getMetaEdgesOutTree());
    while (edgeIterator.hasNext()) {
      MetaEdgeImpl metaEdge=(MetaEdgeImpl)edgeIterator.next();
      AbstractNode target=metaEdge.getTarget(viewId);
      int targetPre=target.getPre();
      if (targetPre >= rangeStart && targetPre <= rangeLimit) {
        if (!metaEdge.isSelfLoop() && target.getMetaEdgesOutTree().hasNeighbour(enabledNode)) {
          enabledNode.decMutualMetaEdgeDegree();
          target.decMutualMetaEdgeDegree();
          view.decMutualMetaEdgesTotal(1);
        }
        edgeIterator.remove();
        target.getMetaEdgesInTree().remove(metaEdge);
        view.decMetaEdgesCount(1);
      }
    }
  }
  if (enabledNode.getMetaEdgesInTree().getCount() > 0) {
    edgeIterator.setNode(enabledNode.getMetaEdgesInTree());
    while (edgeIterator.hasNext()) {
      MetaEdgeImpl metaEdge=(MetaEdgeImpl)edgeIterator.next();
      int sourcePre=metaEdge.getSource(viewId).getPre();
      if (sourcePre >= rangeStart && sourcePre <= rangeLimit) {
        edgeIterator.remove();
        metaEdge.getSource(viewId).getMetaEdgesOutTree().remove(metaEdge);
        view.decMetaEdgesCount(1);
      }
    }
  }
}
Program: 189834
Project: 189834
Buggy source:
public void decrementEdgesCouting(AbstractNode disabledNode,AbstractNode parent){
  for (edgeIterator.setNode(disabledNode.getEdgesOutTree()); edgeIterator.hasNext(); ) {
    AbstractEdge edge=edgeIterator.next();
    AbstractNode target=edge.getTarget(view.getViewId());
    if (target.isEnabled() || (parent != null && target.parent == parent)) {
      target.decEnabledInDegree();
      disabledNode.decEnabledOutDegree();
      view.decEdgesCountEnabled(1);
      if (target.getEdgesOutTree().hasNeighbour(disabledNode) && (parent == null || (parent != null && target.parent == parent && target.getId() < disabledNode.getId()))) {
        target.decEnabledMutualDegree();
        disabledNode.decEnabledMutualDegree();
        view.decMutualEdgesEnabled(1);
      }
    }
  }
  for (edgeIterator.setNode(disabledNode.getEdgesInTree()); edgeIterator.hasNext(); ) {
    AbstractEdge edge=edgeIterator.next();
    AbstractNode source=edge.getSource(view.getViewId());
    if (source.isEnabled()) {
      view.decEdgesCountEnabled(1);
      disabledNode.decEnabledInDegree();
      source.decEnabledOutDegree();
    }
  }
}

Fixed version (ground truth):
public void decrementEdgesCouting(AbstractNode disabledNode,AbstractNode parent){
  for (edgeIterator.setNode(disabledNode.getEdgesOutTree()); edgeIterator.hasNext(); ) {
    AbstractEdge edge=edgeIterator.next();
    AbstractNode target=edge.getTarget(view.getViewId());
    if (target.isEnabled() || (parent != null && target.parent == parent) || edge.isSelfLoop()) {
      target.decEnabledInDegree();
      disabledNode.decEnabledOutDegree();
      view.decEdgesCountEnabled(1);
      if (target.getEdgesOutTree().hasNeighbour(disabledNode) && (parent == null || (parent != null && target.parent == parent && target.getId() < disabledNode.getId())) && !edge.isSelfLoop()) {
        target.decEnabledMutualDegree();
        disabledNode.decEnabledMutualDegree();
        view.decMutualEdgesEnabled(1);
      }
    }
  }
  for (edgeIterator.setNode(disabledNode.getEdgesInTree()); edgeIterator.hasNext(); ) {
    AbstractEdge edge=edgeIterator.next();
    AbstractNode source=edge.getSource(view.getViewId());
    if (source.isEnabled()) {
      view.decEdgesCountEnabled(1);
      disabledNode.decEnabledInDegree();
      source.decEnabledOutDegree();
    }
  }
}
Program: 189835
Project: 189835
Buggy source:
public void clearMetaEdges(AbstractNode node){
  if (node.getMetaEdgesInTree().getCount() > 0) {
    edgeIterator.setNode(node.getMetaEdgesInTree());
    while (edgeIterator.hasNext()) {
      AbstractEdge edge=edgeIterator.next();
      AbstractNode source=edge.getSource(viewId);
      if (!edge.isSelfLoop() && node.getEdgesOutTree().hasNeighbour(source)) {
        node.decMutualMetaEdgeDegree();
        source.decMutualMetaEdgeDegree();
        view.decMutualMetaEdgesTotal(1);
      }
      source.getMetaEdgesOutTree().remove((MetaEdgeImpl)edge);
      view.decMetaEdgesCount(1);
    }
    node.getMetaEdgesInTree().clear();
  }
  if (node.getMetaEdgesOutTree().getCount() > 0) {
    edgeIterator.setNode(node.getMetaEdgesOutTree());
    while (edgeIterator.hasNext()) {
      AbstractEdge edge=edgeIterator.next();
      edge.getTarget(viewId).getMetaEdgesInTree().remove((MetaEdgeImpl)edge);
      view.decMetaEdgesCount(1);
    }
    node.getMetaEdgesOutTree().clear();
  }
}

Fixed version (ground truth):
public void clearMetaEdges(AbstractNode node){
  if (node.getMetaEdgesInTree().getCount() > 0) {
    edgeIterator.setNode(node.getMetaEdgesInTree());
    while (edgeIterator.hasNext()) {
      AbstractEdge edge=edgeIterator.next();
      AbstractNode source=edge.getSource(viewId);
      if (!edge.isSelfLoop() && node.getMetaEdgesOutTree().hasNeighbour(source)) {
        node.decMutualMetaEdgeDegree();
        source.decMutualMetaEdgeDegree();
        view.decMutualMetaEdgesTotal(1);
      }
      source.getMetaEdgesOutTree().remove((MetaEdgeImpl)edge);
      view.decMetaEdgesCount(1);
    }
    node.getMetaEdgesInTree().clear();
  }
  if (node.getMetaEdgesOutTree().getCount() > 0) {
    edgeIterator.setNode(node.getMetaEdgesOutTree());
    while (edgeIterator.hasNext()) {
      AbstractEdge edge=edgeIterator.next();
      edge.getTarget(viewId).getMetaEdgesInTree().remove((MetaEdgeImpl)edge);
      view.decMetaEdgesCount(1);
    }
    node.getMetaEdgesOutTree().clear();
  }
}
Program: 189836
Project: 189836
Buggy source:
public EdgeIterable getEdgesTree(){
  readLock();
  return dhns.newEdgeIterable(new EdgeIterator(structure,new TreeIterator(structure,true,Tautology.instance),false,Tautology.instance,Tautology.instance));
}

Fixed version (ground truth):
public EdgeIterable getEdgesTree(){
  readLock();
  return dhns.newEdgeIterable(new EdgeIterator(structure,new TreeIterator(structure,false,Tautology.instance),false,Tautology.instance,Tautology.instance));
}
Program: 189837
Project: 189837
Buggy source:
public EdgeIterable getEdgesTree(){
  readLock();
  return dhns.newEdgeIterable(new EdgeIterator(structure,new TreeIterator(structure,true,Tautology.instance),false,Tautology.instance,Tautology.instance));
}

Fixed version (ground truth):
public EdgeIterable getEdgesTree(){
  readLock();
  return dhns.newEdgeIterable(new EdgeIterator(structure,new TreeIterator(structure,false,Tautology.instance),false,Tautology.instance,Tautology.instance));
}
Program: 189838
Project: 189838
Buggy source:
public EdgeIterable getEdgesTree(){
  readLock();
  return dhns.newEdgeIterable(new EdgeIterator(structure,new TreeIterator(structure,true,Tautology.instance),true,Tautology.instance,Tautology.instance));
}

Fixed version (ground truth):
public EdgeIterable getEdgesTree(){
  readLock();
  return dhns.newEdgeIterable(new EdgeIterator(structure,new TreeIterator(structure,false,Tautology.instance),true,Tautology.instance,Tautology.instance));
}
Program: 189839
Project: 189839
Buggy source:
public void refreshModel(HierarchicalGraph graph,AttributeColumn[] cols,final DataTablesModel dataTablesModel){
  showingColumns=cols;
  DynamicModel dm=Lookup.getDefault().lookup(DynamicController.class).getModel();
  if (dm != null) {
    timeIntervalsRenderer.setMinMax(dm.getMin(),dm.getMax());
    currentTimeFormat=dm.getTimeFormat();
    timeIntervalsRenderer.setTimeFormat(currentTimeFormat);
    timeIntervalCellEditor.setTimeFormat(currentTimeFormat);
    sparkLinesRenderer.setTimeFormat(currentTimeFormat);
  }
  timeIntervalsRenderer.setDrawGraphics(timeIntervalGraphics);
  refreshingTable=true;
  if (selectedNodes == null) {
    selectedNodes=getNodesFromSelectedRows();
  }
  NodeTreeModel nodeTreeModel=new NodeTreeModel(graph.wrapToTreeNode());
  final OutlineModel mdl=DefaultOutlineModel.createOutlineModel(nodeTreeModel,new NodeRowModel(cols),true);
  outlineTable.setRootVisible(false);
  outlineTable.setRenderDataProvider(new NodeRenderer());
  outlineTable.setModel(mdl);
  NodeDataTable.this.dataTablesModel=dataTablesModel;
  setNodesSelection(selectedNodes);
  selectedNodes=null;
  refreshingTable=false;
}

Fixed version (ground truth):
public void refreshModel(HierarchicalGraph graph,AttributeColumn[] cols,final DataTablesModel dataTablesModel){
  showingColumns=cols;
  DynamicModel dm=Lookup.getDefault().lookup(DynamicController.class).getModel();
  if (dm != null) {
    timeIntervalsRenderer.setMinMax(dm.getMin(),dm.getMax());
    currentTimeFormat=dm.getTimeFormat();
    timeIntervalsRenderer.setTimeFormat(currentTimeFormat);
    timeIntervalCellEditor.setTimeFormat(currentTimeFormat);
    sparkLinesRenderer.setTimeFormat(currentTimeFormat);
  }
  timeIntervalsRenderer.setDrawGraphics(timeIntervalGraphics);
  refreshingTable=true;
  if (selectedNodes == null) {
    selectedNodes=getNodesFromSelectedRows();
  }
  NodeTreeModel nodeTreeModel=new NodeTreeModel(graph.wrapToTreeNode());
  final OutlineModel mdl=DefaultOutlineModel.createOutlineModel(nodeTreeModel,new NodeRowModel(cols),true);
  ((ETableColumnModel)outlineTable.getColumnModel()).clearSortedColumns();
  outlineTable.setRootVisible(false);
  outlineTable.setRenderDataProvider(new NodeRenderer());
  outlineTable.setModel(mdl);
  NodeDataTable.this.dataTablesModel=dataTablesModel;
  setNodesSelection(selectedNodes);
  selectedNodes=null;
  refreshingTable=false;
}
Program: 189840
Project: 189840
Buggy source:
public void readRow(XMLStreamReader reader,AbstractAttributeModel model,AttributeTableImpl table,AttributeRowImpl row) throws XMLStreamException {
  row.setRowVersion(Integer.parseInt(reader.getAttributeValue(null,"String_Node_Str")));
  AttributeColumnImpl col=null;
  String value="String_Node_Str";
  boolean end=false;
  while (reader.hasNext() && !end) {
    int t=reader.next();
switch (t) {
case XMLStreamReader.START_ELEMENT:
      String name=reader.getLocalName();
    if (ELEMENT_VALUE.equalsIgnoreCase(name)) {
      col=(AttributeColumnImpl)table.getColumn(Integer.parseInt(reader.getAttributeValue(null,"String_Node_Str")));
    }
  break;
case XMLStreamReader.CHARACTERS:
if (!reader.isWhiteSpace() && col != null) {
  value+=reader.getText();
}
break;
case XMLStreamReader.END_ELEMENT:
if (ELEMENT_NODE_ROW.equalsIgnoreCase(reader.getLocalName()) || ELEMENT_EDGE_ROW.equalsIgnoreCase(reader.getLocalName())) {
end=true;
}
if (!value.isEmpty() && col != null) {
AttributeType type=col.getType();
Object v=type.parse(value);
v=model.getManagedValue(v,type);
row.setValue(col,value);
}
value="String_Node_Str";
col=null;
break;
}
}
}

Fixed version (ground truth):
public void readRow(XMLStreamReader reader,AbstractAttributeModel model,AttributeTableImpl table,AttributeRowImpl row) throws XMLStreamException {
  row.setRowVersion(Integer.parseInt(reader.getAttributeValue(null,"String_Node_Str")));
  AttributeColumnImpl col=null;
  String value="String_Node_Str";
  boolean end=false;
  while (reader.hasNext() && !end) {
    int t=reader.next();
switch (t) {
case XMLStreamReader.START_ELEMENT:
      String name=reader.getLocalName();
    if (ELEMENT_VALUE.equalsIgnoreCase(name)) {
      col=(AttributeColumnImpl)table.getColumn(Integer.parseInt(reader.getAttributeValue(null,"String_Node_Str")));
    }
  break;
case XMLStreamReader.CHARACTERS:
if (!reader.isWhiteSpace() && col != null) {
  value+=reader.getText();
}
break;
case XMLStreamReader.END_ELEMENT:
if (ELEMENT_NODE_ROW.equalsIgnoreCase(reader.getLocalName()) || ELEMENT_EDGE_ROW.equalsIgnoreCase(reader.getLocalName())) {
end=true;
}
if (!value.isEmpty() && col != null) {
AttributeType type=col.getType();
Object v=type.parse(value);
v=model.getManagedValue(v,type);
row.setValue(col,v);
}
value="String_Node_Str";
col=null;
break;
}
}
}
Program: 189841
Project: 189841
Buggy source:
public void execute(HierarchicalGraph hgraph,AttributeModel attributeModel){
  isCanceled=false;
  triangles(hgraph,attributeModel);
  AttributeTable nodeTable=attributeModel.getNodeTable();
  AttributeColumn clusteringCol=nodeTable.getColumn(CLUSTERING_COEFF);
  if (clusteringCol == null) {
    clusteringCol=nodeTable.addColumn(CLUSTERING_COEFF,"String_Node_Str",AttributeType.DOUBLE,AttributeOrigin.COMPUTED,new Double(0));
  }
  AttributeColumn triCount=nodeTable.getColumn("String_Node_Str");
  if (triCount == null) {
    triCount=nodeTable.addColumn("String_Node_Str","String_Node_Str",AttributeType.INT,AttributeOrigin.COMPUTED,new Integer(0));
  }
  for (int v=0; v < N; v++) {
    if (network[v].length() > 1) {
      AttributeRow row=(AttributeRow)network[v].node.getNodeData().getAttributes();
      row.setValue(clusteringCol,nodeClustering[v]);
      row.setValue(triCount,triangles[v]);
    }
  }
}

Fixed version (ground truth):
public void execute(HierarchicalGraph hgraph,AttributeModel attributeModel){
  isCanceled=false;
  triangles(hgraph);
  AttributeTable nodeTable=attributeModel.getNodeTable();
  AttributeColumn clusteringCol=nodeTable.getColumn(CLUSTERING_COEFF);
  if (clusteringCol == null) {
    clusteringCol=nodeTable.addColumn(CLUSTERING_COEFF,"String_Node_Str",AttributeType.DOUBLE,AttributeOrigin.COMPUTED,new Double(0));
  }
  AttributeColumn triCount=nodeTable.getColumn("String_Node_Str");
  if (triCount == null) {
    triCount=nodeTable.addColumn("String_Node_Str","String_Node_Str",AttributeType.INT,AttributeOrigin.COMPUTED,new Integer(0));
  }
  for (int v=0; v < N; v++) {
    if (network[v].length() > 1) {
      AttributeRow row=(AttributeRow)network[v].node.getNodeData().getAttributes();
      row.setValue(clusteringCol,nodeClustering[v]);
      row.setValue(triCount,triangles[v]);
    }
  }
}
Program: 189843
Project: 189843
Buggy source:
public Color getColor(Color parentColor){
  if (customColor == null) {
    return parentColor;
  }
  return customColor;
}

Fixed version (ground truth):
public Color getColor(Color parentColor){
  if (mode.equals(Mode.CUSTOM) && customColor != null) {
    return customColor;
  }
  return parentColor;
}
Program: 189846
Project: 189846
Buggy source:
private void refreshChooser(){
  DefaultComboBoxModel comboBoxModel=new DefaultComboBoxModel();
  comboBoxModel.addElement(NO_SELECTION);
  comboBoxModel.setSelectedItem(NO_SELECTION);
  if (model != null) {
    for (    LayoutBuilder builder : Lookup.getDefault().lookupAll(LayoutBuilder.class)) {
      LayoutBuilderWrapper item=new LayoutBuilderWrapper(builder);
      comboBoxModel.addElement(item);
      if (model.getSelectedLayout() != null && builder == model.getSelectedBuilder()) {
        comboBoxModel.setSelectedItem(item);
      }
    }
  }
  layoutCombobox.setModel(comboBoxModel);
  if (model != null) {
    layoutCombobox.setEnabled(!model.isRunning());
  }
}

Fixed version (ground truth):
private void refreshChooser(){
  DefaultComboBoxModel comboBoxModel=new DefaultComboBoxModel();
  comboBoxModel.addElement(NO_SELECTION);
  comboBoxModel.setSelectedItem(NO_SELECTION);
  if (model != null) {
    List<LayoutBuilder> builders=new ArrayList<LayoutBuilder>(Lookup.getDefault().lookupAll(LayoutBuilder.class));
    Collections.sort(builders,new Comparator(){
      public int compare(      Object o1,      Object o2){
        return ((LayoutBuilder)o1).getName().compareTo(((LayoutBuilder)o2).getName());
      }
    }
);
    for (    LayoutBuilder builder : builders) {
      LayoutBuilderWrapper item=new LayoutBuilderWrapper(builder);
      comboBoxModel.addElement(item);
      if (model.getSelectedLayout() != null && builder == model.getSelectedBuilder()) {
        comboBoxModel.setSelectedItem(item);
      }
    }
  }
  layoutCombobox.setModel(comboBoxModel);
  if (model != null) {
    layoutCombobox.setEnabled(!model.isRunning());
  }
}
Program: 189850
Project: 189850
Buggy source:
private void printEdge(Edge edge) throws IOException {
  printOpen("String_Node_Str");
  printTag("String_Node_Str" + edge.getId());
  printTag("String_Node_Str" + edge.getSource().getId());
  printTag("String_Node_Str" + edge.getTarget().getId());
  if (exportLabel && edge.getEdgeData().getLabel() != null) {
    printTag("String_Node_Str" + edge.getEdgeData().getLabel() + "String_Node_Str");
  }
  if (exportEdgeSize) {
    printTag("String_Node_Str" + edge.getWeight());
  }
  if (exportNotRecognizedElements) {
    for (int i=0; i < edge.getAttributes().countValues(); i++) {
      String s=attributeModel.getEdgeTable().getColumn(i).getTitle();
      if (edge.getAttributes().getValue(i) != null && !s.equals("String_Node_Str") && !s.equals("String_Node_Str")) {
        printTag(attributeModel.getEdgeTable().getColumn(i).getTitle().replace("String_Node_Str","String_Node_Str") + "String_Node_Str" + edge.getAttributes().getValue(i)+ "String_Node_Str");
      }
    }
  }
  printClose();
  progressTicket.progress();
}

Fixed version (ground truth):
private void printEdge(Edge edge) throws IOException {
  printOpen("String_Node_Str");
  printTag("String_Node_Str" + edge.getId());
  printTag("String_Node_Str" + edge.getSource().getId());
  printTag("String_Node_Str" + edge.getTarget().getId());
  if (exportLabel && edge.getEdgeData().getLabel() != null) {
    printTag("String_Node_Str" + edge.getEdgeData().getLabel() + "String_Node_Str");
  }
  if (exportEdgeSize) {
    printTag("String_Node_Str" + edge.getWeight());
  }
  if (exportNotRecognizedElements) {
    for (int i=0; i < edge.getAttributes().countValues(); i++) {
      String s=attributeModel.getEdgeTable().getColumn(i).getTitle();
      if (edge.getAttributes().getValue(i) != null && !s.equals("String_Node_Str") && !s.equals("String_Node_Str")) {
        printTag(formatString(s) + "String_Node_Str" + edge.getAttributes().getValue(i)+ "String_Node_Str");
      }
    }
  }
  printClose();
  progressTicket.progress();
}
Program: 189851
Project: 189851
Buggy source:
public boolean execute(){
  attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  graphModel=workspace.getLookup().lookup(GraphModel.class);
  DirectedGraph graph;
  if (exportVisible) {
    graph=graphModel.getDirectedGraph();
  }
 else {
    graph=graphModel.getDirectedGraph();
  }
  progressTicket.start(graph.getNodeCount() + graph.getEdgeCount());
  graph.readLock();
  if (normalize) {
    computeNormalizeValues(graph);
  }
  try {
    exportData(graph);
  }
 catch (  IOException ex) {
    Exceptions.printStackTrace(ex);
  }
  progressTicket.finish();
  graph.readUnlock();
  return true;
}

Fixed version (ground truth):
public boolean execute(){
  attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  graphModel=workspace.getLookup().lookup(GraphModel.class);
  DirectedGraph graph;
  if (exportVisible) {
    graph=graphModel.getDirectedGraph();
  }
 else {
    graph=graphModel.getDirectedGraph();
  }
  progressTicket.start(graph.getNodeCount() + graph.getEdgeCount());
  graph.readLock();
  if (normalize) {
    computeNormalizeValues(graph);
  }
  try {
    exportData(graph);
  }
 catch (  IOException ex) {
    Exceptions.printStackTrace(ex);
  }
  progressTicket.finish();
  graph.readUnlock();
  return !cancel;
}
Program: 189853
Project: 189853
Buggy source:
private void importData(LineNumberReader reader) throws Exception {
  Progress.start(progressTicket);
  ArrayList list;
  StreamTokenizer tokenizer=new StreamTokenizer(reader);
  tokenizer.ordinaryChar('[');
  tokenizer.ordinaryChar(']');
  tokenizer.wordChars('_','_');
  list=parseList(tokenizer);
  boolean ret=false;
  for (int i=0; i < list.size(); i++) {
    if ("String_Node_Str".equals(list.get(i)) && list.size() >= i + 2 && list.get(i + 1) instanceof ArrayList) {
      ret=parseGraph((ArrayList)list.get(i + 1));
    }
  }
  if (!ret) {
    report.logIssue(new Issue(NbBundle.getMessage(ImporterGML.class,"String_Node_Str"),Issue.Level.SEVERE));
  }
  Progress.finish(progressTicket);
}

Fixed version (ground truth):
private void importData(LineNumberReader reader) throws Exception {
  Progress.start(progressTicket);
  ArrayList list;
  StreamTokenizer tokenizer=new StreamTokenizer(reader);
  tokenizer.ordinaryChar('[');
  tokenizer.ordinaryChar(']');
  tokenizer.wordChars('_','_');
  String allowed="String_Node_Str";
  for (int i=0; i < allowed.length(); i++)   tokenizer.wordChars(allowed.charAt(i),allowed.charAt(i));
  list=parseList(tokenizer);
  boolean ret=false;
  for (int i=0; i < list.size(); i++) {
    if ("String_Node_Str".equals(list.get(i)) && list.size() >= i + 2 && list.get(i + 1) instanceof ArrayList) {
      ret=parseGraph((ArrayList)list.get(i + 1));
    }
  }
  if (!ret) {
    report.logIssue(new Issue(NbBundle.getMessage(ImporterGML.class,"String_Node_Str"),Issue.Level.SEVERE));
  }
  Progress.finish(progressTicket);
}
Program: 189854
Project: 189854
Buggy source:
private void printEdge(Edge edge) throws IOException {
  printOpen("String_Node_Str");
  printTag("String_Node_Str" + edge.getSource().getId());
  printTag("String_Node_Str" + edge.getTarget().getId());
  if (exportLabel && edge.getEdgeData().getLabel() != null) {
    printTag("String_Node_Str" + edge.getEdgeData().getLabel() + "String_Node_Str");
  }
  if (exportEdgeSize) {
    printTag("String_Node_Str" + edge.getWeight());
  }
  if (exportNotRecognizedElements) {
    for (int i=0; i < edge.getAttributes().countValues(); i++) {
      String s=attributeModel.getEdgeTable().getColumn(i).getTitle();
      if (s.charAt(0) >= 'a' && s.charAt(0) <= 'z' && edge.getAttributes().getValue(i) != null) {
        printTag(attributeModel.getEdgeTable().getColumn(i).getTitle() + "String_Node_Str" + (String)edge.getAttributes().getValue(i));
      }
    }
  }
  printClose();
  progressTicket.progress();
}

Fixed version (ground truth):
private void printEdge(Edge edge) throws IOException {
  printOpen("String_Node_Str");
  printTag("String_Node_Str" + edge.getSource().getId());
  printTag("String_Node_Str" + edge.getTarget().getId());
  if (exportLabel && edge.getEdgeData().getLabel() != null) {
    printTag("String_Node_Str" + edge.getEdgeData().getLabel() + "String_Node_Str");
  }
  if (exportEdgeSize) {
    printTag("String_Node_Str" + edge.getWeight());
  }
  if (exportNotRecognizedElements) {
    for (int i=0; i < edge.getAttributes().countValues(); i++) {
      String s=attributeModel.getEdgeTable().getColumn(i).getTitle();
      if (!(s.charAt(0) >= 'A' && s.charAt(0) <= 'Z') && edge.getAttributes().getValue(i) != null) {
        printTag(attributeModel.getEdgeTable().getColumn(i).getTitle() + "String_Node_Str" + (String)edge.getAttributes().getValue(i)+ "String_Node_Str");
      }
    }
  }
  printClose();
  progressTicket.progress();
}
Program: 189855
Project: 189855
Buggy source:
public boolean execute(){
  attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  graphModel=workspace.getLookup().lookup(GraphModel.class);
  DirectedGraph graph;
  if (exportVisible) {
    graph=graphModel.getDirectedGraph();
  }
 else {
    graph=graphModel.getDirectedGraph();
  }
  progressTicket.start(graph.getNodeCount() + graph.getEdgeCount());
  if (normalize) {
    computeNormalizeValues(graph);
  }
  graph.readLock();
  try {
    exportData(graph);
  }
 catch (  IOException ex) {
    Exceptions.printStackTrace(ex);
  }
  progressTicket.finish();
  graph.readUnlock();
  return true;
}

Fixed version (ground truth):
public boolean execute(){
  attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  graphModel=workspace.getLookup().lookup(GraphModel.class);
  DirectedGraph graph;
  if (exportVisible) {
    graph=graphModel.getDirectedGraph();
  }
 else {
    graph=graphModel.getDirectedGraph();
  }
  progressTicket.start(graph.getNodeCount() + graph.getEdgeCount());
  graph.readLock();
  if (normalize) {
    computeNormalizeValues(graph);
  }
  try {
    exportData(graph);
  }
 catch (  IOException ex) {
    Exceptions.printStackTrace(ex);
  }
  progressTicket.finish();
  graph.readUnlock();
  return true;
}
Program: 189857
Project: 189857
Buggy source:
private void initTransformersUI(){
  for (  ButtonGroup bg : buttonGroups) {
    for (Enumeration<AbstractButton> btns=bg.getElements(); btns.hasMoreElements(); ) {
      AbstractButton btn=btns.nextElement();
      remove(btn);
    }
  }
  if (model != null) {
    for (    String elmtType : controller.getElementTypes()) {
      ButtonGroup buttonGroup=new ButtonGroup();
      for (      final Transformer t : model.getTransformers(elmtType)) {
        TransformerUI u=controller.getUI(t);
        if (u != null) {
          JToggleButton btn=new JToggleButton(u.getIcon());
          btn.setToolTipText(u.getDisplayName());
          btn.addActionListener(new ActionListener(){
            public void actionPerformed(            ActionEvent e){
              model.setCurrentTransformer(t);
            }
          }
);
          btn.setName(u.getDisplayName());
          btn.setFocusPainted(false);
          buttonGroup.add(btn);
          add(btn);
        }
      }
      buttonGroups.add(buttonGroup);
    }
  }
}

Fixed version (ground truth):
private void initTransformersUI(){
  for (  ButtonGroup bg : buttonGroups) {
    for (Enumeration<AbstractButton> btns=bg.getElements(); btns.hasMoreElements(); ) {
      AbstractButton btn=btns.nextElement();
      remove(btn);
    }
  }
  buttonGroups.clear();
  if (model != null) {
    for (    String elmtType : controller.getElementTypes()) {
      ButtonGroup buttonGroup=new ButtonGroup();
      for (      final Transformer t : model.getTransformers(elmtType)) {
        TransformerUI u=controller.getUI(t);
        if (u != null) {
          JToggleButton btn=new JToggleButton(u.getIcon());
          btn.setToolTipText(u.getDisplayName());
          btn.addActionListener(new ActionListener(){
            public void actionPerformed(            ActionEvent e){
              model.setCurrentTransformer(t);
            }
          }
);
          btn.setName(u.getDisplayName());
          btn.setFocusPainted(false);
          buttonGroup.add(btn);
          add(btn);
        }
      }
      buttonGroups.add(buttonGroup);
    }
  }
}
Program: 189858
Project: 189858
Buggy source:
public void exportCurrentTable(ExportMode exportMode){
  JTable table;
  if (classDisplayed == classDisplayed.NODE) {
    table=nodeTable.getOutlineTable();
  }
 else {
    table=edgeTable.getTable();
  }
switch (exportMode) {
case CSV:
    showCSVExportUI(table);
  break;
}
}

Fixed version (ground truth):
public void exportCurrentTable(ExportMode exportMode){
  JTable table;
  String fileName=prepareTableExportFileName();
  if (classDisplayed == classDisplayed.NODE) {
    table=nodeTable.getOutlineTable();
    fileName+="String_Node_Str";
  }
 else {
    table=edgeTable.getTable();
    fileName+="String_Node_Str";
  }
  fileName+="String_Node_Str";
switch (exportMode) {
case CSV:
    showCSVExportUI(table,fileName);
  break;
}
}
Program: 189860
Project: 189860
Buggy source:
private void showCSVExportUI(JTable table){
  CSVExportUI csvUI=new CSVExportUI(table);
  DialogDescriptor dd=new DialogDescriptor(csvUI,csvUI.getDisplayName());
  if (DialogDisplayer.getDefault().notify(dd).equals(DialogDescriptor.OK_OPTION)) {
    DataTableTopComponent.exportTableAsCSV(this,table,csvUI.getSelectedSeparator(),csvUI.getSelectedCharset(),csvUI.getSelectedColumnsIndexes());
  }
  csvUI.unSetup();
}

Fixed version (ground truth):
private void showCSVExportUI(JTable table,String fileName){
  CSVExportUI csvUI=new CSVExportUI(table);
  DialogDescriptor dd=new DialogDescriptor(csvUI,csvUI.getDisplayName());
  if (DialogDisplayer.getDefault().notify(dd).equals(DialogDescriptor.OK_OPTION)) {
    DataTableTopComponent.exportTableAsCSV(this,table,csvUI.getSelectedSeparator(),csvUI.getSelectedCharset(),csvUI.getSelectedColumnsIndexes(),fileName);
  }
  csvUI.unSetup();
}
Program: 189863
Project: 189863
Buggy source:
public void writeNodeData(XMLStreamWriter writer,NodeDataImpl nodeData) throws XMLStreamException {
  writer.writeStartElement(ELEMENT_NODEDATA);
  AbstractNode node=nodeData.getRootNode();
  writer.writeAttribute("String_Node_Str",String.valueOf(node.getPre()));
  if (nodeData.getId() != null && !nodeData.getId().equals("String_Node_Str" + node.getId())) {
    writer.writeAttribute("String_Node_Str",nodeData.getId());
  }
  writer.writeStartElement(ELEMENT_NODEDATA_POSITION);
  writer.writeAttribute("String_Node_Str",String.valueOf(nodeData.x()));
  writer.writeAttribute("String_Node_Str",String.valueOf(nodeData.y()));
  writer.writeAttribute("String_Node_Str",String.valueOf(nodeData.z()));
  writer.writeEndElement();
  writer.writeStartElement(ELEMENT_NODEDATA_COLOR);
  writer.writeAttribute("String_Node_Str",String.valueOf(nodeData.r()));
  writer.writeAttribute("String_Node_Str",String.valueOf(nodeData.g()));
  writer.writeAttribute("String_Node_Str",String.valueOf(nodeData.b()));
  writer.writeAttribute("String_Node_Str",String.valueOf(nodeData.alpha()));
  writer.writeEndElement();
  writer.writeStartElement(ELEMENT_NODEDATA_SIZE);
  writer.writeAttribute("String_Node_Str",String.valueOf(nodeData.getSize()));
  writer.writeEndElement();
  writer.writeEndElement();
}

Fixed version (ground truth):
public void writeNodeData(XMLStreamWriter writer,NodeDataImpl nodeData) throws XMLStreamException {
  writer.writeStartElement(ELEMENT_NODEDATA);
  AbstractNode node=nodeData.getRootNode();
  writer.writeAttribute("String_Node_Str",String.valueOf(node.getPre()));
  if (nodeData.getId() != null && !nodeData.getId().equals(String.valueOf(node.getId()))) {
    writer.writeAttribute("String_Node_Str",nodeData.getId());
  }
  writer.writeStartElement(ELEMENT_NODEDATA_POSITION);
  writer.writeAttribute("String_Node_Str",String.valueOf(nodeData.x()));
  writer.writeAttribute("String_Node_Str",String.valueOf(nodeData.y()));
  writer.writeAttribute("String_Node_Str",String.valueOf(nodeData.z()));
  writer.writeEndElement();
  writer.writeStartElement(ELEMENT_NODEDATA_COLOR);
  writer.writeAttribute("String_Node_Str",String.valueOf(nodeData.r()));
  writer.writeAttribute("String_Node_Str",String.valueOf(nodeData.g()));
  writer.writeAttribute("String_Node_Str",String.valueOf(nodeData.b()));
  writer.writeAttribute("String_Node_Str",String.valueOf(nodeData.alpha()));
  writer.writeEndElement();
  writer.writeStartElement(ELEMENT_NODEDATA_SIZE);
  writer.writeAttribute("String_Node_Str",String.valueOf(nodeData.getSize()));
  writer.writeEndElement();
  writer.writeEndElement();
}
Program: 189864
Project: 189864
Buggy source:
public void writeEdgeData(XMLStreamWriter writer,EdgeDataImpl edgeData) throws XMLStreamException {
  writer.writeStartElement(ELEMENT_EDGEDATA);
  AbstractEdge edge=edgeData.getEdge();
  writer.writeAttribute("String_Node_Str",String.valueOf(edge.getSource().getPre()));
  writer.writeAttribute("String_Node_Str",String.valueOf(edge.getTarget().getPre()));
  if (edgeData.getId() != null && !edgeData.getId().equals("String_Node_Str" + edge.getId())) {
    writer.writeAttribute("String_Node_Str",edgeData.getId());
  }
  writer.writeStartElement(ELEMENT_EDGEDATA_COLOR);
  writer.writeAttribute("String_Node_Str",String.valueOf(edgeData.r()));
  writer.writeAttribute("String_Node_Str",String.valueOf(edgeData.g()));
  writer.writeAttribute("String_Node_Str",String.valueOf(edgeData.b()));
  writer.writeAttribute("String_Node_Str",String.valueOf(edgeData.alpha()));
  writer.writeEndElement();
  writer.writeEndElement();
}

Fixed version (ground truth):
public void writeEdgeData(XMLStreamWriter writer,EdgeDataImpl edgeData) throws XMLStreamException {
  writer.writeStartElement(ELEMENT_EDGEDATA);
  AbstractEdge edge=edgeData.getEdge();
  writer.writeAttribute("String_Node_Str",String.valueOf(edge.getSource().getPre()));
  writer.writeAttribute("String_Node_Str",String.valueOf(edge.getTarget().getPre()));
  if (edgeData.getId() != null && !edgeData.getId().equals(String.valueOf(edge.getId()))) {
    writer.writeAttribute("String_Node_Str",edgeData.getId());
  }
  writer.writeStartElement(ELEMENT_EDGEDATA_COLOR);
  writer.writeAttribute("String_Node_Str",String.valueOf(edgeData.r()));
  writer.writeAttribute("String_Node_Str",String.valueOf(edgeData.g()));
  writer.writeAttribute("String_Node_Str",String.valueOf(edgeData.b()));
  writer.writeAttribute("String_Node_Str",String.valueOf(edgeData.alpha()));
  writer.writeEndElement();
  writer.writeEndElement();
}
Program: 189865
Project: 189865
Buggy source:
private synchronized AttributeColumnImpl addColumn(String id,String title,AttributeType type,AttributeOrigin origin,Object defaultValue,AttributeValueDelegateProvider attributeValueDelegateProvider){
  if (title == null || title.isEmpty() || hasColumn(title)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (defaultValue != null) {
    if (defaultValue.getClass() != type.getType()) {
      if (defaultValue.getClass() == String.class) {
        defaultValue=type.parse((String)defaultValue);
      }
 else {
        throw new IllegalArgumentException("String_Node_Str");
      }
    }
    defaultValue=model.getManagedValue(defaultValue,type);
  }
  AttributeColumnImpl column=new AttributeColumnImpl(this,columns.size(),id,title,type,origin,defaultValue,attributeValueDelegateProvider);
  columns.add(column);
  columnsMap.put(id,column);
  if (title != null && !title.equals(id)) {
    columnsMap.put(title.toLowerCase(),column);
  }
  columnsSet.put(column,column);
  version++;
  model.fireAttributeEvent(new ColumnEvent(AttributeEvent.EventType.ADD_COLUMN,column));
  return column;
}

Fixed version (ground truth):
private synchronized AttributeColumnImpl addColumn(String id,String title,AttributeType type,AttributeOrigin origin,Object defaultValue,AttributeValueDelegateProvider attributeValueDelegateProvider){
  if (title == null || title.isEmpty() || hasColumn(title)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (defaultValue != null) {
    if (defaultValue.getClass() != type.getType()) {
      if (defaultValue.getClass() == String.class) {
        defaultValue=type.parse((String)defaultValue);
      }
 else {
        throw new IllegalArgumentException("String_Node_Str");
      }
    }
    defaultValue=model.getManagedValue(defaultValue,type);
  }
  AttributeColumnImpl column=new AttributeColumnImpl(this,columns.size(),id,title,type,origin,defaultValue,attributeValueDelegateProvider);
  columns.add(column);
  columnsMap.put(id,column);
  if (title != null && !title.equals(id)) {
    columnsMap.put(title,column);
  }
  columnsSet.put(column,column);
  version++;
  model.fireAttributeEvent(new ColumnEvent(AttributeEvent.EventType.ADD_COLUMN,column));
  return column;
}
Program: 189868
Project: 189868
Buggy source:
public boolean add(int node){
  nodes.addLast(new Integer(node));
  weightSum+=structure.weights[node];
  if (!isRandomized) {
    min=Math.min(node,min);
  }
  return true;
}

Fixed version (ground truth):
public boolean add(int node){
  nodes.addLast(new Integer(node));
  weightSum+=structure.weights[node];
  return true;
}
Program: 189869
Project: 189869
Buggy source:
public void seed(int node){
  nodes.add(node);
  weightSum+=structure.weights[node];
  min=node;
}

Fixed version (ground truth):
public void seed(int node){
  nodes.add(node);
  weightSum+=structure.weights[node];
}
Program: 189870
Project: 189870
Buggy source:
private void zoomOut(){
  int M=communities.size();
  LinkedList<ModEdge>[] newTopology=new LinkedList[M];
  int index=0;
  nodeCommunities=new Community[M];
  nodeConnections=new HashMap[M];
  HashMap<Integer,Community> newInvMap=new HashMap<Integer,Community>();
  for (int i=0; i < communities.size(); i++) {
    Community com=communities.get(i);
    nodeConnections[index]=new HashMap<Community,Integer>();
    newTopology[index]=new LinkedList<ModEdge>();
    nodeCommunities[index]=new Community(com);
    Set<Community> iter=com.connections.keySet();
    double weightSum=0;
    Community hidden=new Community(structure);
    for (    Integer nodeInt : com.nodes) {
      Community oldHidden=invMap.get(nodeInt);
      hidden.nodes.addAll(oldHidden.nodes);
    }
    newInvMap.put(index,hidden);
    for (    Community adjCom : iter) {
      int target=communities.indexOf(adjCom);
      int weight=com.connections.get(adjCom);
      weightSum+=weight;
      ModEdge e=new ModEdge(index,target,weight);
      newTopology[index].add(e);
    }
    weights[index]=weightSum;
    nodeCommunities[index].seed(index);
    index++;
  }
  communities.clear();
  for (int i=0; i < M; i++) {
    Community com=nodeCommunities[i];
    communities.add(com);
    for (    ModEdge e : newTopology[i]) {
      nodeConnections[i].put(nodeCommunities[e.target],e.weight);
      com.connections.put(nodeCommunities[e.target],e.weight);
    }
  }
  N=M;
  topology=newTopology;
  invMap=newInvMap;
}

Fixed version (ground truth):
private void zoomOut(){
  int M=communities.size();
  LinkedList<ModEdge>[] newTopology=new LinkedList[M];
  int index=0;
  nodeCommunities=new Community[M];
  nodeConnections=new HashMap[M];
  HashMap<Integer,Community> newInvMap=new HashMap<Integer,Community>();
  for (int i=0; i < communities.size(); i++) {
    Community com=communities.get(i);
    nodeConnections[index]=new HashMap<Community,Integer>();
    newTopology[index]=new LinkedList<ModEdge>();
    nodeCommunities[index]=new Community(com);
    Set<Community> iter=com.connections.keySet();
    double weightSum=0;
    Community hidden=new Community(structure);
    for (    Integer nodeInt : com.nodes) {
      Community oldHidden=invMap.get(nodeInt);
      hidden.nodes.addAll(oldHidden.nodes);
    }
    newInvMap.put(index,hidden);
    for (    Community adjCom : iter) {
      int target=communities.indexOf(adjCom);
      int weight=com.connections.get(adjCom);
      if (target == index)       weightSum+=2 * weight;
 else       weightSum+=weight;
      ModEdge e=new ModEdge(index,target,weight);
      newTopology[index].add(e);
    }
    weights[index]=weightSum;
    nodeCommunities[index].seed(index);
    index++;
  }
  communities.clear();
  for (int i=0; i < M; i++) {
    Community com=nodeCommunities[i];
    communities.add(com);
    for (    ModEdge e : newTopology[i]) {
      nodeConnections[i].put(nodeCommunities[e.target],e.weight);
      com.connections.put(nodeCommunities[e.target],e.weight);
    }
  }
  N=M;
  topology=newTopology;
  invMap=newInvMap;
}
Program: 189872
Project: 189872
Buggy source:
public boolean remove(int node){
  boolean result=nodes.remove(new Integer(node));
  weightSum-=structure.weights[node];
  if (nodes.size() == 0) {
    structure.communities.remove(this);
  }
  if (!isRandomized) {
    if (node == min.intValue()) {
      min=Integer.MAX_VALUE;
      for (      Integer other : nodes) {
        min=Math.min(other,min);
      }
    }
  }
  return result;
}

Fixed version (ground truth):
public boolean remove(int node){
  boolean result=nodes.remove(new Integer(node));
  weightSum-=structure.weights[node];
  if (nodes.size() == 0) {
    structure.communities.remove(this);
  }
  return result;
}