nus-yam/ex-repair huggingface dataset:
Program: 189936
Project: 189936
Buggy source:
public Graph filter(Graph graph){
  HierarchicalGraph hgraph=(HierarchicalGraph)graph;
  String str=pattern.toLowerCase();
  List<Node> nodes=new ArrayList<Node>();
  for (  Node n : hgraph.getNodes()) {
    if (n.getNodeData().getId().toLowerCase().contains(str)) {
      nodes.add(n);
    }
 else     if ((n.getNodeData().getLabel() != null) && n.getNodeData().getLabel().toLowerCase().contains(str)) {
      nodes.add(n);
    }
  }
  Set<Node> result=new HashSet<Node>();
  Set<Node> neighbours=new HashSet<Node>();
  neighbours.addAll(nodes);
  for (int i=0; i < depth; i++) {
    Node[] nei=neighbours.toArray(new Node[0]);
    neighbours.clear();
    for (    Node n : nei) {
      for (      Node neighbor : hgraph.getNeighbors(n)) {
        if (!result.contains(neighbor)) {
          neighbours.add(neighbor);
          result.add(neighbor);
        }
      }
    }
    if (neighbours.isEmpty()) {
      break;
    }
  }
  if (self) {
    result.addAll(nodes);
  }
  for (  Node node : hgraph.getNodes().toArray()) {
    if (!result.contains(node)) {
      hgraph.removeNode(node);
    }
  }
  return hgraph;
}

Fixed version (ground truth):
public Graph filter(Graph graph){
  HierarchicalGraph hgraph=(HierarchicalGraph)graph;
  String str=pattern.toLowerCase();
  List<Node> nodes=new ArrayList<Node>();
  for (  Node n : hgraph.getNodes()) {
    if (n.getNodeData().getId().toLowerCase().equals(str)) {
      nodes.add(n);
    }
 else     if ((n.getNodeData().getLabel() != null) && n.getNodeData().getLabel().toLowerCase().equals(str)) {
      nodes.add(n);
    }
  }
  Set<Node> result=new HashSet<Node>();
  Set<Node> neighbours=new HashSet<Node>();
  neighbours.addAll(nodes);
  for (int i=0; i < depth; i++) {
    Node[] nei=neighbours.toArray(new Node[0]);
    neighbours.clear();
    for (    Node n : nei) {
      for (      Node neighbor : hgraph.getNeighbors(n)) {
        if (!result.contains(neighbor)) {
          neighbours.add(neighbor);
          result.add(neighbor);
        }
      }
    }
    if (neighbours.isEmpty()) {
      break;
    }
  }
  if (self) {
    result.addAll(nodes);
  }
  for (  Node node : hgraph.getNodes().toArray()) {
    if (!result.contains(node)) {
      hgraph.removeNode(node);
    }
  }
  return hgraph;
}
Program: 189937
Project: 189937
Buggy source:
public void mouseExited(MouseEvent e){
  if (currentState == TimelineState.IDLE) {
    highlightedComponent=HighlightedComponent.NONE;
  }
  mouseInside=false;
  repaint();
}

Fixed version (ground truth):
public void mouseExited(MouseEvent e){
  if (currentState == TimelineState.IDLE) {
    highlightedComponent=HighlightedComponent.NONE;
    latestMousePositionX=e.getX();
    currentMousePositionX=latestMousePositionX;
  }
  mouseInside=false;
  repaint();
}
Program: 189939
Project: 189939
Buggy source:
public void mousePressed(MouseEvent e){
  if (model == null) {
    return;
  }
  int x=e.getX();
  float w=getWidth();
  int r=16;
  if (currentState == TimelineState.IDLE) {
    if (inRange(x,(int)sf - 1,(int)sf + r + 1)) {
      highlightedComponent=HighlightedComponent.LEFT_HOOK;
      currentState=TimelineState.RESIZE_FROM;
    }
 else     if (inRange(x,(int)sf + r,(int)st - r)) {
      highlightedComponent=HighlightedComponent.CENTER_HOOK;
      currentState=TimelineState.MOVING;
    }
 else     if (inRange(x,(int)st - r - 1,(int)st + 1)) {
      highlightedComponent=HighlightedComponent.RIGHT_HOOK;
      currentState=TimelineState.RESIZE_TO;
    }
  }
}

Fixed version (ground truth):
public void mousePressed(MouseEvent e){
  if (model == null) {
    return;
  }
  int x=e.getX();
  latestMousePositionX=x;
  currentMousePositionX=latestMousePositionX;
  int r=16;
  if (currentState == TimelineState.IDLE) {
    if (inRange(x,(int)sf - 1,(int)sf + r + 1)) {
      highlightedComponent=HighlightedComponent.LEFT_HOOK;
      currentState=TimelineState.RESIZE_FROM;
    }
 else     if (inRange(x,(int)sf + r,(int)st - r)) {
      highlightedComponent=HighlightedComponent.CENTER_HOOK;
      currentState=TimelineState.MOVING;
    }
 else     if (inRange(x,(int)st - r - 1,(int)st + 1)) {
      highlightedComponent=HighlightedComponent.RIGHT_HOOK;
      currentState=TimelineState.RESIZE_TO;
    }
  }
}
Program: 189940
Project: 189940
Buggy source:
public void mouseReleased(MouseEvent evt){
  latestMousePositionX=null;
  currentState=TimelineState.IDLE;
  this.getParent().repaint();
}

Fixed version (ground truth):
public void mouseReleased(MouseEvent evt){
  latestMousePositionX=evt.getX();
  currentMousePositionX=latestMousePositionX;
  currentState=TimelineState.IDLE;
  this.getParent().repaint();
}
Program: 189941
Project: 189941
Buggy source:
public void mouseEntered(MouseEvent e){
  latestMousePositionX=e.getX();
  currentMousePositionX=latestMousePositionX;
  mouseInside=true;
}

Fixed version (ground truth):
public void mouseEntered(MouseEvent e){
  if (currentState == TimelineState.IDLE) {
    latestMousePositionX=e.getX();
    currentMousePositionX=latestMousePositionX;
  }
  mouseInside=true;
}
Program: 189942
Project: 189942
Buggy source:
public void mouseClicked(MouseEvent e){
}

Fixed version (ground truth):
public void mouseClicked(MouseEvent e){
  latestMousePositionX=e.getX();
  currentMousePositionX=latestMousePositionX;
}
Program: 189943
Project: 189943
Buggy source:
public void dynamicModelChanged(DynamicModelEvent event){
  if (event.getSource() == dynamicModel) {
switch (event.getEventType()) {
case VISIBLE_INTERVAL:
      fireTimelineModelEvent(new TimelineModelEvent(TimelineModelEvent.EventType.VISIBLE_INTERVAL,this,event.getData()));
    break;
case MIN_CHANGED:
  setModelMin((Double)event.getData());
break;
case MAX_CHANGED:
setModelMax((Double)event.getData());
break;
}
}
}

Fixed version (ground truth):
public void dynamicModelChanged(DynamicModelEvent event){
  if (event.getSource() == dynamicModel) {
    unit=(dynamicModel.getTimeFormat().equals(DynamicModel.TimeFormat.DATE) || dynamicModel.getTimeFormat().equals(DynamicModel.TimeFormat.DATETIME)) ? DateTime.class : Double.class;
switch (event.getEventType()) {
case VISIBLE_INTERVAL:
      fireTimelineModelEvent(new TimelineModelEvent(TimelineModelEvent.EventType.VISIBLE_INTERVAL,this,event.getData()));
    break;
case MIN_CHANGED:
  setModelMin((Double)event.getData());
break;
case MAX_CHANGED:
setModelMax((Double)event.getData());
break;
}
}
}
Program: 189944
Project: 189944
Buggy source:
public void setup(DynamicModel dynamicModel){
  dynamicController=Lookup.getDefault().lookup(DynamicController.class);
  this.dynamicModel=dynamicModel;
  enabled=!Double.isInfinite(dynamicModel.getVisibleInterval().getLow()) && !Double.isInfinite(dynamicModel.getVisibleInterval().getHigh());
  dynamicController.addModelListener(this);
  unit=dynamicModel.getTimeFormat().equals(DynamicModel.TimeFormat.DATE) ? DateTime.class : null;
  customMin=Double.NEGATIVE_INFINITY;
  customMax=Double.POSITIVE_INFINITY;
  modelMin=Double.NEGATIVE_INFINITY;
  modelMax=Double.POSITIVE_INFINITY;
  setModelMin(dynamicModel.getMin());
  setModelMax(dynamicModel.getMax());
  refreshEnabled();
}

Fixed version (ground truth):
public void setup(DynamicModel dynamicModel){
  dynamicController=Lookup.getDefault().lookup(DynamicController.class);
  this.dynamicModel=dynamicModel;
  enabled=!Double.isInfinite(dynamicModel.getVisibleInterval().getLow()) && !Double.isInfinite(dynamicModel.getVisibleInterval().getHigh());
  dynamicController.addModelListener(this);
  unit=(dynamicModel.getTimeFormat().equals(DynamicModel.TimeFormat.DATE) || dynamicModel.getTimeFormat().equals(DynamicModel.TimeFormat.DATETIME)) ? DateTime.class : Double.class;
  customMin=Double.NEGATIVE_INFINITY;
  customMax=Double.POSITIVE_INFINITY;
  modelMin=Double.NEGATIVE_INFINITY;
  modelMax=Double.POSITIVE_INFINITY;
  setModelMin(dynamicModel.getMin());
  setModelMax(dynamicModel.getMax());
  refreshEnabled();
}
Program: 189945
Project: 189945
Buggy source:
public void readModel(XMLStreamReader reader,DynamicModelImpl model) throws XMLStreamException {
  boolean end=false;
  while (reader.hasNext() && !end) {
    int type=reader.next();
switch (type) {
case XMLStreamReader.START_ELEMENT:
      if ("String_Node_Str".equalsIgnoreCase(reader.getLocalName())) {
        String val=reader.getAttributeValue(null,"String_Node_Str");
        if (val.equals("String_Node_Str")) {
          model.setTimeFormat(DynamicModel.TimeFormat.DATE);
        }
 else {
          model.setTimeFormat(DynamicModel.TimeFormat.DOUBLE);
        }
      }
    break;
case XMLStreamReader.END_ELEMENT:
  if ("String_Node_Str".equalsIgnoreCase(reader.getLocalName())) {
    end=true;
  }
break;
}
}
}

Fixed version (ground truth):
public void readModel(XMLStreamReader reader,DynamicModelImpl model) throws XMLStreamException {
  boolean end=false;
  while (reader.hasNext() && !end) {
    int type=reader.next();
switch (type) {
case XMLStreamReader.START_ELEMENT:
      if ("String_Node_Str".equalsIgnoreCase(reader.getLocalName())) {
        String val=reader.getAttributeValue(null,"String_Node_Str");
        if (val.equalsIgnoreCase("String_Node_Str")) {
          model.setTimeFormat(DynamicModel.TimeFormat.DATE);
        }
        if (val.equalsIgnoreCase("String_Node_Str")) {
          model.setTimeFormat(DynamicModel.TimeFormat.DATETIME);
        }
 else {
          model.setTimeFormat(DynamicModel.TimeFormat.DOUBLE);
        }
      }
    break;
case XMLStreamReader.END_ELEMENT:
  if ("String_Node_Str".equalsIgnoreCase(reader.getLocalName())) {
    end=true;
  }
break;
}
}
}
Program: 189946
Project: 189946
Buggy source:
public void writeModel(XMLStreamWriter writer,DynamicModelImpl model) throws XMLStreamException {
  writer.writeStartElement("String_Node_Str");
  writer.writeStartElement("String_Node_Str");
  if (model.getTimeFormat().equals(DynamicModel.TimeFormat.DATE)) {
    writer.writeAttribute("String_Node_Str","String_Node_Str");
  }
 else {
    writer.writeAttribute("String_Node_Str","String_Node_Str");
  }
  writer.writeEndElement();
  writer.writeEndElement();
}

Fixed version (ground truth):
public void writeModel(XMLStreamWriter writer,DynamicModelImpl model) throws XMLStreamException {
  writer.writeStartElement("String_Node_Str");
  writer.writeStartElement("String_Node_Str");
  if (model.getTimeFormat().equals(DynamicModel.TimeFormat.DATETIME)) {
    writer.writeAttribute("String_Node_Str","String_Node_Str");
  }
 else   if (model.getTimeFormat().equals(DynamicModel.TimeFormat.DATE)) {
    writer.writeAttribute("String_Node_Str","String_Node_Str");
  }
 else {
    writer.writeAttribute("String_Node_Str","String_Node_Str");
  }
  writer.writeEndElement();
  writer.writeEndElement();
}
Program: 189947
Project: 189947
Buggy source:
public void setTimeIntervalMax(String timeIntervalMax){
  if (timeFormat.equals(TimeFormat.DATE)) {
    try {
      this.timeIntervalMax=DynamicUtilities.getDoubleFromXMLDateString(timeIntervalMax);
    }
 catch (    Exception ex) {
      report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class,"String_Node_Str",timeIntervalMax),Level.SEVERE));
    }
  }
 else {
    try {
      this.timeIntervalMax=Double.parseDouble(timeIntervalMax);
    }
 catch (    Exception ex) {
      report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class,"String_Node_Str",timeIntervalMax),Level.SEVERE));
    }
  }
}

Fixed version (ground truth):
public void setTimeIntervalMax(String timeIntervalMax){
  if (timeFormat.equals(TimeFormat.DATE) || timeFormat.equals(TimeFormat.DATETIME)) {
    try {
      this.timeIntervalMax=DynamicUtilities.getDoubleFromXMLDateString(timeIntervalMax);
    }
 catch (    Exception ex) {
      report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class,"String_Node_Str",timeIntervalMax),Level.SEVERE));
    }
  }
 else {
    try {
      this.timeIntervalMax=Double.parseDouble(timeIntervalMax);
    }
 catch (    Exception ex) {
      report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class,"String_Node_Str",timeIntervalMax),Level.SEVERE));
    }
  }
}
Program: 189948
Project: 189948
Buggy source:
public void setTimeIntervalMin(String timeIntervalMin){
  if (timeFormat.equals(TimeFormat.DATE)) {
    try {
      this.timeIntervalMin=DynamicUtilities.getDoubleFromXMLDateString(timeIntervalMin);
    }
 catch (    Exception ex) {
      report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class,"String_Node_Str",timeIntervalMin),Level.SEVERE));
    }
  }
 else {
    try {
      this.timeIntervalMin=Double.parseDouble(timeIntervalMin);
    }
 catch (    Exception ex) {
      report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class,"String_Node_Str",timeIntervalMin),Level.SEVERE));
    }
  }
}

Fixed version (ground truth):
public void setTimeIntervalMin(String timeIntervalMin){
  if (timeFormat.equals(TimeFormat.DATE) || timeFormat.equals(TimeFormat.DATETIME)) {
    try {
      this.timeIntervalMin=DynamicUtilities.getDoubleFromXMLDateString(timeIntervalMin);
    }
 catch (    Exception ex) {
      report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class,"String_Node_Str",timeIntervalMin),Level.SEVERE));
    }
  }
 else {
    try {
      this.timeIntervalMin=Double.parseDouble(timeIntervalMin);
    }
 catch (    Exception ex) {
      report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class,"String_Node_Str",timeIntervalMin),Level.SEVERE));
    }
  }
}
Program: 189952
Project: 189952
Buggy source:
public void mouseExited(MouseEvent e){
  if (currentState == TimelineState.IDLE) {
    highlightedComponent=HighlightedComponent.NONE;
  }
  mouseInside=false;
  repaint();
}

Fixed version (ground truth):
public void mouseExited(MouseEvent e){
  if (currentState == TimelineState.IDLE) {
    highlightedComponent=HighlightedComponent.NONE;
    latestMousePositionX=e.getX();
    currentMousePositionX=latestMousePositionX;
  }
  mouseInside=false;
  repaint();
}
Program: 189954
Project: 189954
Buggy source:
public void mousePressed(MouseEvent e){
  if (model == null) {
    return;
  }
  int x=e.getX();
  float w=getWidth();
  int r=16;
  if (currentState == TimelineState.IDLE) {
    if (inRange(x,(int)sf - 1,(int)sf + r + 1)) {
      highlightedComponent=HighlightedComponent.LEFT_HOOK;
      currentState=TimelineState.RESIZE_FROM;
    }
 else     if (inRange(x,(int)sf + r,(int)st - r)) {
      highlightedComponent=HighlightedComponent.CENTER_HOOK;
      currentState=TimelineState.MOVING;
    }
 else     if (inRange(x,(int)st - r - 1,(int)st + 1)) {
      highlightedComponent=HighlightedComponent.RIGHT_HOOK;
      currentState=TimelineState.RESIZE_TO;
    }
  }
}

Fixed version (ground truth):
public void mousePressed(MouseEvent e){
  if (model == null) {
    return;
  }
  int x=e.getX();
  latestMousePositionX=x;
  currentMousePositionX=latestMousePositionX;
  int r=16;
  if (currentState == TimelineState.IDLE) {
    if (inRange(x,(int)sf - 1,(int)sf + r + 1)) {
      highlightedComponent=HighlightedComponent.LEFT_HOOK;
      currentState=TimelineState.RESIZE_FROM;
    }
 else     if (inRange(x,(int)sf + r,(int)st - r)) {
      highlightedComponent=HighlightedComponent.CENTER_HOOK;
      currentState=TimelineState.MOVING;
    }
 else     if (inRange(x,(int)st - r - 1,(int)st + 1)) {
      highlightedComponent=HighlightedComponent.RIGHT_HOOK;
      currentState=TimelineState.RESIZE_TO;
    }
  }
}
Program: 189955
Project: 189955
Buggy source:
public void mouseReleased(MouseEvent evt){
  latestMousePositionX=null;
  currentState=TimelineState.IDLE;
  this.getParent().repaint();
}

Fixed version (ground truth):
public void mouseReleased(MouseEvent evt){
  latestMousePositionX=evt.getX();
  currentMousePositionX=latestMousePositionX;
  currentState=TimelineState.IDLE;
  this.getParent().repaint();
}
Program: 189956
Project: 189956
Buggy source:
public void mouseEntered(MouseEvent e){
  latestMousePositionX=e.getX();
  currentMousePositionX=latestMousePositionX;
  mouseInside=true;
}

Fixed version (ground truth):
public void mouseEntered(MouseEvent e){
  if (currentState == TimelineState.IDLE) {
    latestMousePositionX=e.getX();
    currentMousePositionX=latestMousePositionX;
  }
  mouseInside=true;
}
Program: 189957
Project: 189957
Buggy source:
public void mouseClicked(MouseEvent e){
}

Fixed version (ground truth):
public void mouseClicked(MouseEvent e){
  latestMousePositionX=e.getX();
  currentMousePositionX=latestMousePositionX;
}
Program: 189958
Project: 189958
Buggy source:
public void dynamicModelChanged(DynamicModelEvent event){
  if (event.getSource() == dynamicModel) {
switch (event.getEventType()) {
case VISIBLE_INTERVAL:
      fireTimelineModelEvent(new TimelineModelEvent(TimelineModelEvent.EventType.VISIBLE_INTERVAL,this,event.getData()));
    break;
case MIN_CHANGED:
  setModelMin((Double)event.getData());
break;
case MAX_CHANGED:
setModelMax((Double)event.getData());
break;
}
}
}

Fixed version (ground truth):
public void dynamicModelChanged(DynamicModelEvent event){
  if (event.getSource() == dynamicModel) {
    unit=(dynamicModel.getTimeFormat().equals(DynamicModel.TimeFormat.DATE) || dynamicModel.getTimeFormat().equals(DynamicModel.TimeFormat.DATETIME)) ? DateTime.class : Double.class;
switch (event.getEventType()) {
case VISIBLE_INTERVAL:
      fireTimelineModelEvent(new TimelineModelEvent(TimelineModelEvent.EventType.VISIBLE_INTERVAL,this,event.getData()));
    break;
case MIN_CHANGED:
  setModelMin((Double)event.getData());
break;
case MAX_CHANGED:
setModelMax((Double)event.getData());
break;
}
}
}
Program: 189959
Project: 189959
Buggy source:
public void setup(DynamicModel dynamicModel){
  dynamicController=Lookup.getDefault().lookup(DynamicController.class);
  this.dynamicModel=dynamicModel;
  enabled=!Double.isInfinite(dynamicModel.getVisibleInterval().getLow()) && !Double.isInfinite(dynamicModel.getVisibleInterval().getHigh());
  dynamicController.addModelListener(this);
  unit=dynamicModel.getTimeFormat().equals(DynamicModel.TimeFormat.DATE) ? DateTime.class : null;
  customMin=Double.NEGATIVE_INFINITY;
  customMax=Double.POSITIVE_INFINITY;
  modelMin=Double.NEGATIVE_INFINITY;
  modelMax=Double.POSITIVE_INFINITY;
  setModelMin(dynamicModel.getMin());
  setModelMax(dynamicModel.getMax());
  refreshEnabled();
}

Fixed version (ground truth):
public void setup(DynamicModel dynamicModel){
  dynamicController=Lookup.getDefault().lookup(DynamicController.class);
  this.dynamicModel=dynamicModel;
  enabled=!Double.isInfinite(dynamicModel.getVisibleInterval().getLow()) && !Double.isInfinite(dynamicModel.getVisibleInterval().getHigh());
  dynamicController.addModelListener(this);
  unit=(dynamicModel.getTimeFormat().equals(DynamicModel.TimeFormat.DATE) || dynamicModel.getTimeFormat().equals(DynamicModel.TimeFormat.DATETIME)) ? DateTime.class : Double.class;
  customMin=Double.NEGATIVE_INFINITY;
  customMax=Double.POSITIVE_INFINITY;
  modelMin=Double.NEGATIVE_INFINITY;
  modelMax=Double.POSITIVE_INFINITY;
  setModelMin(dynamicModel.getMin());
  setModelMax(dynamicModel.getMax());
  refreshEnabled();
}
Program: 189960
Project: 189960
Buggy source:
public void readModel(XMLStreamReader reader,DynamicModelImpl model) throws XMLStreamException {
  boolean end=false;
  while (reader.hasNext() && !end) {
    int type=reader.next();
switch (type) {
case XMLStreamReader.START_ELEMENT:
      if ("String_Node_Str".equalsIgnoreCase(reader.getLocalName())) {
        String val=reader.getAttributeValue(null,"String_Node_Str");
        if (val.equals("String_Node_Str")) {
          model.setTimeFormat(DynamicModel.TimeFormat.DATE);
        }
 else {
          model.setTimeFormat(DynamicModel.TimeFormat.DOUBLE);
        }
      }
    break;
case XMLStreamReader.END_ELEMENT:
  if ("String_Node_Str".equalsIgnoreCase(reader.getLocalName())) {
    end=true;
  }
break;
}
}
}

Fixed version (ground truth):
public void readModel(XMLStreamReader reader,DynamicModelImpl model) throws XMLStreamException {
  boolean end=false;
  while (reader.hasNext() && !end) {
    int type=reader.next();
switch (type) {
case XMLStreamReader.START_ELEMENT:
      if ("String_Node_Str".equalsIgnoreCase(reader.getLocalName())) {
        String val=reader.getAttributeValue(null,"String_Node_Str");
        if (val.equalsIgnoreCase("String_Node_Str")) {
          model.setTimeFormat(DynamicModel.TimeFormat.DATE);
        }
        if (val.equalsIgnoreCase("String_Node_Str")) {
          model.setTimeFormat(DynamicModel.TimeFormat.DATETIME);
        }
 else {
          model.setTimeFormat(DynamicModel.TimeFormat.DOUBLE);
        }
      }
    break;
case XMLStreamReader.END_ELEMENT:
  if ("String_Node_Str".equalsIgnoreCase(reader.getLocalName())) {
    end=true;
  }
break;
}
}
}
Program: 189961
Project: 189961
Buggy source:
public void writeModel(XMLStreamWriter writer,DynamicModelImpl model) throws XMLStreamException {
  writer.writeStartElement("String_Node_Str");
  writer.writeStartElement("String_Node_Str");
  if (model.getTimeFormat().equals(DynamicModel.TimeFormat.DATE)) {
    writer.writeAttribute("String_Node_Str","String_Node_Str");
  }
 else {
    writer.writeAttribute("String_Node_Str","String_Node_Str");
  }
  writer.writeEndElement();
  writer.writeEndElement();
}

Fixed version (ground truth):
public void writeModel(XMLStreamWriter writer,DynamicModelImpl model) throws XMLStreamException {
  writer.writeStartElement("String_Node_Str");
  writer.writeStartElement("String_Node_Str");
  if (model.getTimeFormat().equals(DynamicModel.TimeFormat.DATETIME)) {
    writer.writeAttribute("String_Node_Str","String_Node_Str");
  }
 else   if (model.getTimeFormat().equals(DynamicModel.TimeFormat.DATE)) {
    writer.writeAttribute("String_Node_Str","String_Node_Str");
  }
 else {
    writer.writeAttribute("String_Node_Str","String_Node_Str");
  }
  writer.writeEndElement();
  writer.writeEndElement();
}
Program: 189962
Project: 189962
Buggy source:
public void setTimeIntervalMax(String timeIntervalMax){
  if (timeFormat.equals(TimeFormat.DATE)) {
    try {
      this.timeIntervalMax=DynamicUtilities.getDoubleFromXMLDateString(timeIntervalMax);
    }
 catch (    Exception ex) {
      report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class,"String_Node_Str",timeIntervalMax),Level.SEVERE));
    }
  }
 else {
    try {
      this.timeIntervalMax=Double.parseDouble(timeIntervalMax);
    }
 catch (    Exception ex) {
      report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class,"String_Node_Str",timeIntervalMax),Level.SEVERE));
    }
  }
}

Fixed version (ground truth):
public void setTimeIntervalMax(String timeIntervalMax){
  if (timeFormat.equals(TimeFormat.DATE) || timeFormat.equals(TimeFormat.DATETIME)) {
    try {
      this.timeIntervalMax=DynamicUtilities.getDoubleFromXMLDateString(timeIntervalMax);
    }
 catch (    Exception ex) {
      report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class,"String_Node_Str",timeIntervalMax),Level.SEVERE));
    }
  }
 else {
    try {
      this.timeIntervalMax=Double.parseDouble(timeIntervalMax);
    }
 catch (    Exception ex) {
      report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class,"String_Node_Str",timeIntervalMax),Level.SEVERE));
    }
  }
}
Program: 189963
Project: 189963
Buggy source:
public void setTimeIntervalMin(String timeIntervalMin){
  if (timeFormat.equals(TimeFormat.DATE)) {
    try {
      this.timeIntervalMin=DynamicUtilities.getDoubleFromXMLDateString(timeIntervalMin);
    }
 catch (    Exception ex) {
      report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class,"String_Node_Str",timeIntervalMin),Level.SEVERE));
    }
  }
 else {
    try {
      this.timeIntervalMin=Double.parseDouble(timeIntervalMin);
    }
 catch (    Exception ex) {
      report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class,"String_Node_Str",timeIntervalMin),Level.SEVERE));
    }
  }
}

Fixed version (ground truth):
public void setTimeIntervalMin(String timeIntervalMin){
  if (timeFormat.equals(TimeFormat.DATE) || timeFormat.equals(TimeFormat.DATETIME)) {
    try {
      this.timeIntervalMin=DynamicUtilities.getDoubleFromXMLDateString(timeIntervalMin);
    }
 catch (    Exception ex) {
      report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class,"String_Node_Str",timeIntervalMin),Level.SEVERE));
    }
  }
 else {
    try {
      this.timeIntervalMin=Double.parseDouble(timeIntervalMin);
    }
 catch (    Exception ex) {
      report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class,"String_Node_Str",timeIntervalMin),Level.SEVERE));
    }
  }
}
Program: 189965
Project: 189965
Buggy source:
protected GLCapabilities getCaps(){
  GLCapabilities caps=new GLCapabilities();
  caps.setAlphaBits(8);
  caps.setDoubleBuffered(true);
  caps.setHardwareAccelerated(true);
  int antialisaing=vizController.getVizConfig().getAntialiasing();
  if (antialisaing == 0) {
    caps.setSampleBuffers(false);
  }
 else   if (antialisaing == 2) {
    caps.setSampleBuffers(true);
    caps.setNumSamples(2);
  }
 else   if (antialisaing == 4) {
    caps.setSampleBuffers(true);
    caps.setNumSamples(4);
  }
 else   if (antialisaing == 8) {
    caps.setSampleBuffers(true);
    caps.setNumSamples(8);
  }
 else   if (antialisaing == 16) {
    caps.setSampleBuffers(true);
    caps.setNumSamples(16);
  }
  return caps;
}

Fixed version (ground truth):
protected GLCapabilities getCaps(){
  GLCapabilities caps=new GLCapabilities();
  try {
    caps.setAlphaBits(8);
    caps.setDoubleBuffered(true);
    caps.setHardwareAccelerated(true);
    int antialisaing=vizController.getVizConfig().getAntialiasing();
    if (antialisaing == 0) {
      caps.setSampleBuffers(false);
    }
 else     if (antialisaing == 2) {
      caps.setSampleBuffers(true);
      caps.setNumSamples(2);
    }
 else     if (antialisaing == 4) {
      caps.setSampleBuffers(true);
      caps.setNumSamples(4);
    }
 else     if (antialisaing == 8) {
      caps.setSampleBuffers(true);
      caps.setNumSamples(8);
    }
 else     if (antialisaing == 16) {
      caps.setSampleBuffers(true);
      caps.setNumSamples(16);
    }
  }
 catch (  javax.media.opengl.GLException ex) {
    Exceptions.printStackTrace(ex);
  }
  return caps;
}
Program: 189966
Project: 189966
Buggy source:
public Object getValueFor(ImmutableTreeNode node){
  Node graphNode=node.getNode();
  if (graphNode.getId() == -1) {
    return null;
  }
  Attributes row=graphNode.getNodeData().getAttributes();
  Object value=row.getValue(column.getIndex());
  if (useSparklines && (attributeUtils.isNumberListColumn(column) || attributeUtils.isDynamicNumberColumn(column))) {
    return value;
  }
 else   if (column.getType() == AttributeType.TIME_INTERVAL) {
    return value;
  }
 else   if (attributeUtils.isNumberColumn(column)) {
    return value;
  }
 else {
    if (value != null) {
      if (value instanceof DynamicType) {
        return ((DynamicType)value).toString(currentTimeFormat == TimeFormat.DOUBLE);
      }
 else {
        return value.toString();
      }
    }
 else {
      return null;
    }
  }
}

Fixed version (ground truth):
public Object getValueFor(ImmutableTreeNode node){
  Node graphNode=node.getNode();
  if (graphNode.getId() == -1) {
    return null;
  }
  Attributes row=graphNode.getNodeData().getAttributes();
  Object value=row.getValue(column.getIndex());
  if (useSparklines && (attributeUtils.isNumberListColumn(column) || attributeUtils.isDynamicNumberColumn(column))) {
    return value;
  }
 else   if (column.getType() == AttributeType.TIME_INTERVAL) {
    return value;
  }
 else   if (attributeUtils.isNumberColumn(column)) {
    return value;
  }
 else   if (column.getType() == AttributeType.BOOLEAN) {
    return value;
  }
 else {
    if (value != null) {
      if (value instanceof DynamicType) {
        return ((DynamicType)value).toString(currentTimeFormat == TimeFormat.DOUBLE);
      }
 else {
        return value.toString();
      }
    }
 else {
      return null;
    }
  }
}
Program: 189967
Project: 189967
Buggy source:
public Class getColumnClass(){
  if (useSparklines && attributeUtils.isNumberListColumn(column)) {
    return NumberList.class;
  }
 else   if (useSparklines && attributeUtils.isDynamicNumberColumn(column)) {
    return column.getType().getType();
  }
 else   if (column.getType() == AttributeType.TIME_INTERVAL) {
    return TimeInterval.class;
  }
 else   if (attributeUtils.isNumberColumn(column)) {
    return column.getType().getType();
  }
 else {
    return String.class;
  }
}

Fixed version (ground truth):
public Class getColumnClass(){
  if (useSparklines && attributeUtils.isNumberListColumn(column)) {
    return NumberList.class;
  }
 else   if (useSparklines && attributeUtils.isDynamicNumberColumn(column)) {
    return column.getType().getType();
  }
 else   if (column.getType() == AttributeType.TIME_INTERVAL) {
    return TimeInterval.class;
  }
 else   if (attributeUtils.isNumberColumn(column)) {
    return column.getType().getType();
  }
 else   if (column.getType() == AttributeType.BOOLEAN) {
    return Boolean.class;
  }
 else {
    return String.class;
  }
}
Program: 189969
Project: 189969
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(pStatistics,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);
        model.setRunning(pStatistics,false);
        for (        StatisticsUI s : uis) {
          model.addResult(s);
          s.unsetup();
        }
        model.addReport(pStatistics);
      }
    }
,builder.getName(),null);
  }
 else {
    pStatistics.execute(graphModel,attributeModel);
    if (listener != null) {
      listener.taskFinished(null);
    }
    model.setRunning(pStatistics,false);
    for (    StatisticsUI s : uis) {
      model.addResult(s);
      s.unsetup();
    }
    model.addReport(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);
  for (  StatisticsUI s : uis) {
    s.setup(pStatistics);
  }
  model.setRunning(pStatistics,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);
        model.setRunning(pStatistics,false);
        for (        StatisticsUI s : uis) {
          model.addResult(s);
          s.unsetup();
        }
        model.addReport(pStatistics);
      }
    }
,builder.getName(),null);
  }
 else {
    pStatistics.execute(graphModel,attributeModel);
    model.setRunning(pStatistics,false);
    for (    StatisticsUI s : uis) {
      model.addResult(s);
      s.unsetup();
    }
    model.addReport(pStatistics);
    if (listener != null) {
      listener.taskFinished(null);
    }
  }
}
Program: 189970
Project: 189970
Buggy source:
public void execute(HierarchicalGraph graph,AttributeModel attributeModel){
  double edgesCount=graph.getEdgeCount();
  double nodesCount=graph.getNodeCount();
  double multiplier=1;
  if (!isDirected) {
    multiplier=2;
  }
  density=(multiplier * edgesCount) / (nodesCount * nodesCount - nodesCount);
}

Fixed version (ground truth):
public void execute(GraphModel graphModel,AttributeModel attributeModel){
  HierarchicalGraph hgraph;
  if (isDirected) {
    hgraph=graphModel.getHierarchicalDirectedGraphVisible();
  }
 else {
    hgraph=graphModel.getHierarchicalUndirectedGraphVisible();
  }
  double edgesCount=hgraph.getTotalEdgeCount();
  double nodesCount=hgraph.getNodeCount();
  double multiplier=1;
  if (!isDirected) {
    multiplier=2;
  }
  density=(multiplier * edgesCount) / (nodesCount * nodesCount - nodesCount);
}
Program: 189971
Project: 189971
Buggy source:
/** 
 * @param struct
 * @param degrees
 * @param graph
 * @return
 */
public double finalQ(int[] struct,double[] degrees,HierarchicalUndirectedGraph graph,AttributeModel attributeModel){
  AttributeTable nodeTable=attributeModel.getNodeTable();
  AttributeColumn modCol=nodeTable.getColumn(MODULARITY_CLASS);
  if (modCol == null) {
    modCol=nodeTable.addColumn(MODULARITY_CLASS,"String_Node_Str",AttributeType.INT,AttributeOrigin.COMPUTED,new Integer(0));
  }
  double res=0;
  double[] internal=new double[degrees.length];
  for (  Node n : graph.getNodes()) {
    int n_index=structure.map.get(n);
    AttributeRow row=(AttributeRow)n.getNodeData().getAttributes();
    row.setValue(modCol,struct[n_index]);
    for (    Node neighbor : graph.getNeighbors(n)) {
      if (n == neighbor) {
        continue;
      }
      int neigh_index=structure.map.get(neighbor);
      if (struct[neigh_index] == struct[n_index]) {
        internal[struct[neigh_index]]++;
      }
    }
  }
  for (int i=0; i < degrees.length; i++) {
    internal[i]/=2.0;
    res+=(internal[i] / graph.getEdgeCount()) - Math.pow(degrees[i] / (2 * graph.getEdgeCount()),2);
  }
  return res;
}

Fixed version (ground truth):
/** 
 * @param struct
 * @param degrees
 * @param hgraph
 * @return
 */
public double finalQ(int[] struct,double[] degrees,HierarchicalUndirectedGraph hgraph,AttributeModel attributeModel){
  AttributeTable nodeTable=attributeModel.getNodeTable();
  AttributeColumn modCol=nodeTable.getColumn(MODULARITY_CLASS);
  if (modCol == null) {
    modCol=nodeTable.addColumn(MODULARITY_CLASS,"String_Node_Str",AttributeType.INT,AttributeOrigin.COMPUTED,new Integer(0));
  }
  double res=0;
  double[] internal=new double[degrees.length];
  for (  Node n : hgraph.getNodes()) {
    int n_index=structure.map.get(n);
    AttributeRow row=(AttributeRow)n.getNodeData().getAttributes();
    row.setValue(modCol,struct[n_index]);
    for (    Node neighbor : hgraph.getNeighbors(n)) {
      if (n == neighbor) {
        continue;
      }
      int neigh_index=structure.map.get(neighbor);
      if (struct[neigh_index] == struct[n_index]) {
        internal[struct[neigh_index]]++;
      }
    }
  }
  for (int i=0; i < degrees.length; i++) {
    internal[i]/=2.0;
    res+=(internal[i] / hgraph.getTotalEdgeCount()) - Math.pow(degrees[i] / (2 * hgraph.getTotalEdgeCount()),2);
  }
  return res;
}
Program: 189973
Project: 189973
Buggy source:
public void select(Workspace workspace){
  Lookup.getDefault().lookup(DataTablesController.class).setDataTablesEventListener(DataTableTopComponent.this);
  AttributeModel attributeModel=Lookup.getDefault().lookup(AttributeController.class).getModel();
  dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
  if (dataTablesModel == null) {
    workspace.add(dataTablesModel=new DataTablesModel(attributeModel.getNodeTable(),attributeModel.getEdgeTable()));
  }
  nodeAvailableColumnsModel=dataTablesModel.getNodeAvailableColumnsModel();
  edgeAvailableColumnsModel=dataTablesModel.getEdgeAvailableColumnsModel();
  hideTable();
  enableTableControls();
  bannerPanel.setVisible(false);
  attributeModel.addAttributeListener(DataTableTopComponent.this);
  graphModel=gc.getModel();
  graphModel.addGraphListener(DataTableTopComponent.this);
  refreshAll();
}

Fixed version (ground truth):
public void select(Workspace workspace){
  Lookup.getDefault().lookup(DataTablesController.class).setDataTablesEventListener(DataTableTopComponent.this);
  AttributeModel attributeModel=Lookup.getDefault().lookup(AttributeController.class).getModel();
  dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
  if (dataTablesModel == null) {
    workspace.add(dataTablesModel=new DataTablesModel(attributeModel.getNodeTable(),attributeModel.getEdgeTable()));
  }
  nodeAvailableColumnsModel=dataTablesModel.getNodeAvailableColumnsModel();
  edgeAvailableColumnsModel=dataTablesModel.getEdgeAvailableColumnsModel();
  hideTable();
  enableTableControls();
  attributeModel.addAttributeListener(DataTableTopComponent.this);
  graphModel=gc.getModel();
  graphModel.addGraphListener(DataTableTopComponent.this);
  refreshAllOnce();
}
Program: 189974
Project: 189974
Buggy source:
private void clearAll(){
  clearTableControls();
  clearColumnManipulators();
  clearGeneralActionsButtons();
}

Fixed version (ground truth):
private void clearAll(){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      clearTableControls();
      clearColumnManipulators();
      clearGeneralActionsButtons();
    }
  }
);
}
Program: 189975
Project: 189975
Buggy source:
private void hideTable(){
  tableScrollPane.setViewportView(null);
}

Fixed version (ground truth):
private void hideTable(){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      tableScrollPane.setViewportView(null);
    }
  }
);
}
Program: 189976
Project: 189976
Buggy source:
private void refreshAll(){
  if (nodesButton.isEnabled()) {
    refreshTable();
    refreshColumnManipulators();
    refreshGeneralActionsButtons();
  }
}

Fixed version (ground truth):
private synchronized void refreshAll(){
  if (nodesButton.isEnabled()) {
    refreshTable();
    refreshColumnManipulators();
    refreshGeneralActionsButtons();
  }
}
Program: 189977
Project: 189977
Buggy source:
public void selectEdgesTable(){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      classDisplayed=ClassDisplayed.EDGE;
      refreshAll();
    }
  }
);
}

Fixed version (ground truth):
public void selectEdgesTable(){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      classDisplayed=ClassDisplayed.EDGE;
      refreshAllOnce();
    }
  }
);
}
Program: 189979
Project: 189979
Buggy source:
public void selectNodesTable(){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      classDisplayed=ClassDisplayed.NODE;
      refreshAll();
    }
  }
);
}

Fixed version (ground truth):
public void selectNodesTable(){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      classDisplayed=ClassDisplayed.NODE;
      refreshAllOnce();
    }
  }
);
}
Program: 189980
Project: 189980
Buggy source:
private void initNodesView(){
  Runnable initNodesRunnable=new Runnable(){
    public void run(){
      try {
        String busyMsg=NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str");
        BusyUtils.BusyLabel busylabel=BusyUtils.createCenteredBusyLabel(tableScrollPane,busyMsg,nodeTable.getOutlineTable());
        busylabel.setBusy(true);
        final AttributeColumn[] cols=nodeAvailableColumnsModel.getAvailableColumns();
        HierarchicalGraph graph;
        if (visibleOnly) {
          graph=graphModel.getHierarchicalGraphVisible();
        }
 else {
          graph=graphModel.getHierarchicalGraph();
        }
        if (graph == null) {
          tableScrollPane.setViewportView(null);
          return;
        }
        nodeTable.refreshModel(graph,cols,dataTablesModel);
        refreshFilterColumns();
        busylabel.setBusy(false);
        nodeTable.scrollToFirstNodeSelected();
      }
 catch (      Exception e) {
        Exceptions.printStackTrace(e);
        JLabel errorLabel=new JLabel(NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str"),SwingConstants.CENTER);
        tableScrollPane.setViewportView(errorLabel);
      }
    }
  }
;
  Future future=taskExecutor.submit(initNodesRunnable);
}

Fixed version (ground truth):
private void initNodesView(){
  Runnable initNodesRunnable=new Runnable(){
    public void run(){
      try {
        String busyMsg=NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str");
        BusyUtils.BusyLabel busylabel=BusyUtils.createCenteredBusyLabel(tableScrollPane,busyMsg,nodeTable.getOutlineTable());
        busylabel.setBusy(true);
        final AttributeColumn[] cols=nodeAvailableColumnsModel.getAvailableColumns();
        HierarchicalGraph graph;
        if (visibleOnly) {
          graph=graphModel.getHierarchicalGraphVisible();
        }
 else {
          graph=graphModel.getHierarchicalGraph();
        }
        if (graph == null) {
          tableScrollPane.setViewportView(null);
          return;
        }
        nodeTable.refreshModel(graph,cols,dataTablesModel);
        refreshFilterColumns();
        busylabel.setBusy(false);
        nodeTable.scrollToFirstNodeSelected();
      }
 catch (      Exception e) {
        Exceptions.printStackTrace(e);
        JLabel errorLabel=new JLabel(NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str"),SwingConstants.CENTER);
        tableScrollPane.setViewportView(errorLabel);
      }
    }
  }
;
  SwingUtilities.invokeLater(initNodesRunnable);
}
Program: 189981
Project: 189981
Buggy source:
private void refreshOnce(boolean refreshTableOnly){
  if (refreshOnceHelperThread == null || !refreshOnceHelperThread.isAlive() || (refreshOnceHelperThread.refreshTableOnly && !refreshTableOnly)) {
    refreshOnceHelperThread=new RefreshOnceHelperThread(refreshTableOnly);
    refreshOnceHelperThread.start();
  }
 else {
    refreshOnceHelperThread.eventAttended();
  }
}

Fixed version (ground truth):
/** 
 * This method ensures that the refreshing of all Data laboratory or table only happens once in a short time period.
 * @param refreshTableOnly True to refresh only table values, false to refresh all UI including manipulators
 */
private void refreshOnce(boolean refreshTableOnly){
  if (refreshOnceHelperThread == null || !refreshOnceHelperThread.isAlive() || (refreshOnceHelperThread.refreshTableOnly && !refreshTableOnly)) {
    refreshOnceHelperThread=new RefreshOnceHelperThread(refreshTableOnly);
    refreshOnceHelperThread.start();
  }
 else {
    refreshOnceHelperThread.eventAttended();
  }
}
Program: 189982
Project: 189982
Buggy source:
@Override public void componentOpened(){
  refreshAll();
}

Fixed version (ground truth):
@Override public void componentOpened(){
  refreshAllOnce();
}
Program: 189983
Project: 189983
Buggy source:
private void availableColumnsButtonActionPerformed(java.awt.event.ActionEvent evt){
  AttributeTable table;
  AvailableColumnsModel availableColumnsModel;
  if (classDisplayed == classDisplayed.NODE) {
    table=Lookup.getDefault().lookup(AttributeController.class).getModel().getNodeTable();
  }
 else {
    table=Lookup.getDefault().lookup(AttributeController.class).getModel().getEdgeTable();
  }
  availableColumnsModel=getTableAvailableColumnsModel(table);
  DialogDescriptor dd=new DialogDescriptor(new AvailableColumnsPanel(table,availableColumnsModel).getValidationPanel(),NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str"));
  dd.setOptions(new Object[]{DialogDescriptor.OK_OPTION});
  DialogDisplayer.getDefault().notify(dd);
  refreshAll();
  availableColumnsButton.setIcon(ImageUtilities.loadImageIcon("String_Node_Str",true));
}

Fixed version (ground truth):
private void availableColumnsButtonActionPerformed(java.awt.event.ActionEvent evt){
  AttributeTable table;
  AvailableColumnsModel availableColumnsModel;
  if (classDisplayed == classDisplayed.NODE) {
    table=Lookup.getDefault().lookup(AttributeController.class).getModel().getNodeTable();
  }
 else {
    table=Lookup.getDefault().lookup(AttributeController.class).getModel().getEdgeTable();
  }
  availableColumnsModel=getTableAvailableColumnsModel(table);
  DialogDescriptor dd=new DialogDescriptor(new AvailableColumnsPanel(table,availableColumnsModel).getValidationPanel(),NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str"));
  dd.setOptions(new Object[]{DialogDescriptor.OK_OPTION});
  DialogDisplayer.getDefault().notify(dd);
  refreshAllOnce();
  availableColumnsButton.setIcon(ImageUtilities.loadImageIcon("String_Node_Str",true));
}
Program: 189984
Project: 189984
Buggy source:
/** 
 * Column manipulators related methods:
 */
private void refreshColumnManipulators(){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      clearColumnManipulators();
      prepareAddColumnButton();
      prepareMergeColumnsButton();
      prepareColumnManipulatorsButtons();
      columnManipulatorsPanel.updateUI();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Column manipulators related methods:
 */
private void refreshColumnManipulators(){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      clearColumnManipulators();
      prepareAddColumnButton();
      prepareMergeColumnsButton();
      prepareColumnManipulatorsButtons();
    }
  }
);
}
Program: 189985
Project: 189985
Buggy source:
public void refreshCurrentTable(){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      refreshTable();
    }
  }
);
}

Fixed version (ground truth):
public void refreshCurrentTable(){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      refreshOnce(true);
    }
  }
);
}
Program: 189987
Project: 189987
Buggy source:
private void initEdgesView(){
  Runnable initEdgesRunnable=new Runnable(){
    public void run(){
      try {
        String busyMsg=NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str");
        BusyUtils.BusyLabel busylabel=BusyUtils.createCenteredBusyLabel(tableScrollPane,busyMsg,edgeTable.getTable());
        busylabel.setBusy(true);
        final AttributeColumn[] cols=edgeAvailableColumnsModel.getAvailableColumns();
        HierarchicalGraph graph;
        if (visibleOnly) {
          graph=graphModel.getHierarchicalGraphVisible();
        }
 else {
          graph=graphModel.getHierarchicalGraph();
        }
        if (graph == null) {
          tableScrollPane.setViewportView(null);
          return;
        }
        edgeTable.refreshModel(graph,cols,dataTablesModel);
        refreshFilterColumns();
        busylabel.setBusy(false);
        edgeTable.scrollToFirstEdgeSelected();
      }
 catch (      Exception e) {
        Exceptions.printStackTrace(e);
        JLabel errorLabel=new JLabel(NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str"),SwingConstants.CENTER);
        tableScrollPane.setViewportView(errorLabel);
      }
    }
  }
;
  Future future=taskExecutor.submit(initEdgesRunnable);
}

Fixed version (ground truth):
private void initEdgesView(){
  Runnable initEdgesRunnable=new Runnable(){
    public void run(){
      try {
        String busyMsg=NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str");
        BusyUtils.BusyLabel busylabel=BusyUtils.createCenteredBusyLabel(tableScrollPane,busyMsg,edgeTable.getTable());
        busylabel.setBusy(true);
        final AttributeColumn[] cols=edgeAvailableColumnsModel.getAvailableColumns();
        HierarchicalGraph graph;
        if (visibleOnly) {
          graph=graphModel.getHierarchicalGraphVisible();
        }
 else {
          graph=graphModel.getHierarchicalGraph();
        }
        if (graph == null) {
          tableScrollPane.setViewportView(null);
          return;
        }
        edgeTable.refreshModel(graph,cols,dataTablesModel);
        refreshFilterColumns();
        busylabel.setBusy(false);
        edgeTable.scrollToFirstEdgeSelected();
      }
 catch (      Exception e) {
        Exceptions.printStackTrace(e);
        JLabel errorLabel=new JLabel(NbBundle.getMessage(DataTableTopComponent.class,"String_Node_Str"),SwingConstants.CENTER);
        tableScrollPane.setViewportView(errorLabel);
      }
    }
  }
;
  SwingUtilities.invokeLater(initEdgesRunnable);
}