nus-yam/ex-repair huggingface dataset:
Program: 190119
Project: 190119
Buggy source:
@Override public Component getCustomEditor(){
  ColorModePanel p;
  p=(ColorModePanel)super.getCustomEditor();
  p=new EdgeBothBColorModePanelDecorator(this,p);
  p=new EdgeB2ColorModePanelDecorator(this,p);
  p=new EdgeB1ColorModePanelDecorator(this,p);
  p=new ParentColorModePanelDecorator(this,p);
  return p;
}

Fixed version (ground truth):
@Override public Component getCustomEditor(){
  ColorModePanel p;
  p=(ColorModePanel)super.getCustomEditor();
  p=new EdgeBothBColorModePanelDecorator(this,p);
  p=new EdgeOriginalColorModePanelDecorator(this,p);
  p=new EdgeB2ColorModePanelDecorator(this,p);
  p=new EdgeB1ColorModePanelDecorator(this,p);
  p=new ParentColorModePanelDecorator(this,p);
  return p;
}
Program: 190120
Project: 190120
Buggy source:
@Override public Component getCustomEditor(){
  ColorModePanel p;
  p=(ColorModePanel)super.getCustomEditor();
  p=new EdgeBothBColorModePanelDecorator(this,p);
  p=new EdgeB2ColorModePanelDecorator(this,p);
  p=new EdgeB1ColorModePanelDecorator(this,p);
  return p;
}

Fixed version (ground truth):
@Override public Component getCustomEditor(){
  ColorModePanel p;
  p=(ColorModePanel)super.getCustomEditor();
  p=new EdgeOriginalColorModePanelDecorator(this,p);
  p=new EdgeBothBColorModePanelDecorator(this,p);
  p=new EdgeB2ColorModePanelDecorator(this,p);
  p=new EdgeB1ColorModePanelDecorator(this,p);
  return p;
}
Program: 190121
Project: 190121
Buggy source:
public void renderGraphLabelBorders(Graph graph){
  for (  Node n : graph.getNodes()) {
    if (n.showLabel() && n.hasLabel() && n.showLabelBorders()) {
      renderNodeLabelBorder(n.getLabelBorder());
    }
  }
}

Fixed version (ground truth):
public void renderGraphLabelBorders(Graph graph){
  for (  Node n : graph.getNodes()) {
    if (n.showLabel() && n.hasLabel() && n.showLabelBorders()&& n.getLabel().getFont() != null) {
      renderNodeLabelBorder(n.getLabelBorder());
    }
  }
}
Program: 190122
Project: 190122
Buggy source:
public void renderGraphLabels(Graph graph){
  textFont(uniEdgeMiniLabelFont);
  for (  UnidirectionalEdge e : graph.getUnidirectionalEdges()) {
    if (!e.isCurved()) {
      if (e.showLabel() && e.hasLabel()) {
        renderEdgeLabel(e.getLabel());
      }
      if (e.showMiniLabels()) {
        renderEdgeMiniLabels(e);
      }
    }
  }
  textFont(biEdgeMiniLabelFont);
  for (  BidirectionalEdge e : graph.getBidirectionalEdges()) {
    if (!e.isCurved()) {
      if (e.showLabel() && e.hasLabel()) {
        renderEdgeLabel(e.getLabel());
      }
      if (e.showMiniLabels()) {
        renderEdgeMiniLabels(e);
      }
    }
  }
  for (  UndirectedEdge e : graph.getUndirectedEdges()) {
    if (e.showLabel() && !e.isCurved() && e.hasLabel()) {
      renderEdgeLabel(e.getLabel());
    }
  }
  for (  Node n : graph.getNodes()) {
    if (n.showLabel() && n.hasLabel()) {
      renderNodeLabel(n.getLabel());
    }
  }
}

Fixed version (ground truth):
public void renderGraphLabels(Graph graph){
  textFont(uniEdgeMiniLabelFont);
  for (  UnidirectionalEdge e : graph.getUnidirectionalEdges()) {
    if (!e.isCurved()) {
      if (e.showLabel() && e.hasLabel() && e.getLabel().getFont() != null) {
        renderEdgeLabel(e.getLabel());
      }
      if (e.showMiniLabels()) {
        renderEdgeMiniLabels(e);
      }
    }
  }
  textFont(biEdgeMiniLabelFont);
  for (  BidirectionalEdge e : graph.getBidirectionalEdges()) {
    if (!e.isCurved()) {
      if (e.showLabel() && e.hasLabel() && e.getLabel().getFont() != null) {
        renderEdgeLabel(e.getLabel());
      }
      if (e.showMiniLabels()) {
        renderEdgeMiniLabels(e);
      }
    }
  }
  for (  UndirectedEdge e : graph.getUndirectedEdges()) {
    if (e.showLabel() && !e.isCurved() && e.hasLabel()&& e.getLabel().getFont() != null) {
      renderEdgeLabel(e.getLabel());
    }
  }
  for (  Node n : graph.getNodes()) {
    if (n.showLabel() && n.hasLabel() && n.getLabel().getFont() != null) {
      renderNodeLabel(n.getLabel());
    }
  }
}
Program: 190123
Project: 190123
Buggy source:
public void renderGraphLabels(Graph graph){
  for (  UnidirectionalEdge e : graph.getUnidirectionalEdges()) {
    if (!e.isCurved()) {
      if (e.showLabel() && e.hasLabel()) {
        renderEdgeLabel(e.getLabel());
      }
      if (e.showMiniLabels()) {
        renderEdgeMiniLabels(e);
      }
    }
  }
  for (  BidirectionalEdge e : graph.getBidirectionalEdges()) {
    if (!e.isCurved()) {
      if (e.showLabel() && e.hasLabel()) {
        renderEdgeLabel(e.getLabel());
      }
      if (e.showMiniLabels()) {
        renderEdgeMiniLabels(e);
      }
    }
  }
  for (  UndirectedEdge e : graph.getUndirectedEdges()) {
    if (e.showLabel() && !e.isCurved() && e.hasLabel()) {
      renderEdgeLabel(e.getLabel());
    }
  }
  for (  Node n : graph.getNodes()) {
    if (n.showLabel() && n.hasLabel()) {
      renderNodeLabel(n.getLabel());
    }
  }
}

Fixed version (ground truth):
public void renderGraphLabels(Graph graph){
  for (  UnidirectionalEdge e : graph.getUnidirectionalEdges()) {
    if (!e.isCurved()) {
      if (e.showLabel() && e.hasLabel() && e.getLabel().getFont() != null) {
        renderEdgeLabel(e.getLabel());
      }
      if (e.showMiniLabels()) {
        renderEdgeMiniLabels(e);
      }
    }
  }
  for (  BidirectionalEdge e : graph.getBidirectionalEdges()) {
    if (!e.isCurved()) {
      if (e.showLabel() && e.hasLabel() && e.getLabel().getFont() != null) {
        renderEdgeLabel(e.getLabel());
      }
      if (e.showMiniLabels()) {
        renderEdgeMiniLabels(e);
      }
    }
  }
  for (  UndirectedEdge e : graph.getUndirectedEdges()) {
    if (e.showLabel() && !e.isCurved() && e.hasLabel()&& e.getLabel().getFont() != null) {
      renderEdgeLabel(e.getLabel());
    }
  }
  for (  Node n : graph.getNodes()) {
    if (n.showLabel() && n.hasLabel() && n.getLabel().getFont() != null) {
      renderNodeLabel(n.getLabel());
    }
  }
}
Program: 190124
Project: 190124
Buggy source:
public void renderGraphLabelBorders(Graph graph){
  labelBorderGroupElem=createGroupElem("String_Node_Str");
  svgRoot.insertBefore(labelBorderGroupElem,labelGroupElem);
  for (  Node n : graph.getNodes()) {
    if (n.showLabel() && n.hasLabel() && n.showLabelBorders()) {
      renderNodeLabelBorder(n.getLabelBorder());
    }
  }
}

Fixed version (ground truth):
public void renderGraphLabelBorders(Graph graph){
  labelBorderGroupElem=createGroupElem("String_Node_Str");
  svgRoot.insertBefore(labelBorderGroupElem,labelGroupElem);
  for (  Node n : graph.getNodes()) {
    if (n.showLabel() && n.hasLabel() && n.showLabelBorders()&& n.getLabel().getFont() != null) {
      renderNodeLabelBorder(n.getLabelBorder());
    }
  }
}
Program: 190125
Project: 190125
Buggy source:
public void renderGraphLabels(Graph graph){
  labelGroupElem=createGroupElem("String_Node_Str");
  svgRoot.appendChild(labelGroupElem);
  for (  UnidirectionalEdge e : graph.getUnidirectionalEdges()) {
    if (!e.isCurved()) {
      if (e.showLabel() && e.hasLabel()) {
        renderEdgeLabel(e.getLabel());
      }
      if (e.showMiniLabels()) {
        renderEdgeMiniLabels(e);
      }
    }
  }
  for (  BidirectionalEdge e : graph.getBidirectionalEdges()) {
    if (!e.isCurved()) {
      if (e.showLabel() && e.hasLabel()) {
        renderEdgeLabel(e.getLabel());
      }
      if (e.showMiniLabels()) {
        renderEdgeMiniLabels(e);
      }
    }
  }
  for (  UndirectedEdge e : graph.getUndirectedEdges()) {
    if (e.showLabel() && !e.isCurved() && e.hasLabel()) {
      renderEdgeLabel(e.getLabel());
    }
  }
  for (  Node n : graph.getNodes()) {
    if (n.showLabel() && n.hasLabel()) {
      renderNodeLabel(n.getLabel());
    }
  }
}

Fixed version (ground truth):
public void renderGraphLabels(Graph graph){
  labelGroupElem=createGroupElem("String_Node_Str");
  svgRoot.appendChild(labelGroupElem);
  for (  UnidirectionalEdge e : graph.getUnidirectionalEdges()) {
    if (!e.isCurved()) {
      if (e.showLabel() && e.hasLabel() && e.getLabel().getFont() != null) {
        renderEdgeLabel(e.getLabel());
      }
      if (e.showMiniLabels()) {
        renderEdgeMiniLabels(e);
      }
    }
  }
  for (  BidirectionalEdge e : graph.getBidirectionalEdges()) {
    if (!e.isCurved()) {
      if (e.showLabel() && e.hasLabel() && e.getLabel().getFont() != null) {
        renderEdgeLabel(e.getLabel());
      }
      if (e.showMiniLabels()) {
        renderEdgeMiniLabels(e);
      }
    }
  }
  for (  UndirectedEdge e : graph.getUndirectedEdges()) {
    if (e.showLabel() && !e.isCurved() && e.hasLabel()&& e.getLabel().getFont() != null) {
      renderEdgeLabel(e.getLabel());
    }
  }
  for (  Node n : graph.getNodes()) {
    if (n.showLabel() && n.hasLabel() && n.getLabel().getFont() != null) {
      renderNodeLabel(n.getLabel());
    }
  }
}
Program: 190126
Project: 190126
Buggy source:
public Boolean showLabel(){
  if (!hasLabel()) {
    return false;
  }
  EdgeSupervisor supervisor=getEdgeSupervisor();
  int labelCharCount=supervisor.getShortenLabelsFlag() ? supervisor.getLabelMaxChar() : 10;
  float minlength=node1.getRadius() + node2.getRadius() + 0.65f * labelCharCount * label.getFont().getSize();
  return supervisor.getShowLabelsFlag() && length >= minlength;
}

Fixed version (ground truth):
public Boolean showLabel(){
  if (!hasLabel() || getLabel().getFont() == null) {
    return false;
  }
  EdgeSupervisor supervisor=getEdgeSupervisor();
  int labelCharCount=supervisor.getShortenLabelsFlag() ? supervisor.getLabelMaxChar() : 10;
  float minlength=node1.getRadius() + node2.getRadius() + 0.65f * labelCharCount * label.getFont().getSize();
  return supervisor.getShowLabelsFlag() && length >= minlength;
}
Program: 190127
Project: 190127
Buggy source:
/** 
 * Adjusts the font of the given label client.
 * @param client   the label to adjust the font
 */
public static void adjustFont(LabelFontAdjusterClient client){
  Font baseFont=client.getBaseFont();
  int newSize=(int)(baseFont.getSize() * client.getSizeFactor());
  Font font=new Font(baseFont.getName(),baseFont.getStyle(),newSize);
  client.setFont(font);
}

Fixed version (ground truth):
/** 
 * Adjusts the font of the given label client.
 * @param client   the label to adjust the font
 */
public static void adjustFont(LabelFontAdjusterClient client){
  Font baseFont=client.getBaseFont();
  int newSize=Math.round(baseFont.getSize() * client.getSizeFactor());
  if (newSize > 0) {
    Font font=new Font(baseFont.getName(),baseFont.getStyle(),newSize);
    client.setFont(font);
  }
}
Program: 190128
Project: 190128
Buggy source:
@Override public void restored(){
  initGephi();
  UIManager.put("String_Node_Str","String_Node_Str");
  Logger.getLogger("String_Node_Str").addHandler(new ReporterHandler());
}

Fixed version (ground truth):
@Override public void restored(){
  initGephi();
  UIManager.put("String_Node_Str","String_Node_Str");
  UIManager.put("String_Node_Str",Boolean.FALSE);
  Logger.getLogger("String_Node_Str").addHandler(new ReporterHandler());
}
Program: 190132
Project: 190132
Buggy source:
@Override public boolean accept(File file){
  if (file.isDirectory() || extensions.size() == 0) {
    return true;
  }
  String nomFichier=file.getName().toLowerCase();
  for (  String extension : extensions) {
    if (nomFichier.endsWith(extension)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean accept(File file){
  if (file.isDirectory() || extensions.size() == 0) {
    return true;
  }
  String fileName=file.getName().toLowerCase();
  for (  String extension : extensions) {
    if (fileName.endsWith(extension)) {
      return true;
    }
  }
  return false;
}
Program: 190133
Project: 190133
Buggy source:
public Element writeXML(Document document){
  Element modelE=document.createElement("String_Node_Str");
  Element resultsE=document.createElement("String_Node_Str");
  for (  Map.Entry<StatisticsUI,String> entry : resultMap.entrySet()) {
    if (entry.getValue() != null && !entry.getValue().isEmpty()) {
      Element resultE=document.createElement("String_Node_Str");
      resultE.setAttribute("String_Node_Str",entry.getKey().getClass().getName());
      resultE.setAttribute("String_Node_Str",entry.getValue());
      resultsE.appendChild(resultE);
    }
  }
  modelE.appendChild(resultsE);
  Element reportsE=document.createElement("String_Node_Str");
  for (  Map.Entry<Class,String> entry : reportMap.entrySet()) {
    if (entry.getValue() != null && !entry.getValue().isEmpty()) {
      Element reportE=document.createElement("String_Node_Str");
      reportE.setAttribute("String_Node_Str",entry.getKey().getName());
      reportE.setAttribute("String_Node_Str",entry.getValue());
      resultsE.appendChild(reportE);
    }
  }
  modelE.appendChild(reportsE);
  return modelE;
}

Fixed version (ground truth):
public Element writeXML(Document document){
  Element modelE=document.createElement("String_Node_Str");
  Element resultsE=document.createElement("String_Node_Str");
  for (  Map.Entry<StatisticsUI,String> entry : resultMap.entrySet()) {
    if (entry.getValue() != null && !entry.getValue().isEmpty()) {
      Element resultE=document.createElement("String_Node_Str");
      resultE.setAttribute("String_Node_Str",entry.getKey().getClass().getName());
      resultE.setAttribute("String_Node_Str",entry.getValue());
      resultsE.appendChild(resultE);
    }
  }
  modelE.appendChild(resultsE);
  Element reportsE=document.createElement("String_Node_Str");
  for (  Map.Entry<Class,String> entry : reportMap.entrySet()) {
    if (entry.getValue() != null && !entry.getValue().isEmpty()) {
      Element reportE=document.createElement("String_Node_Str");
      reportE.setAttribute("String_Node_Str",entry.getKey().getName());
      reportE.setAttribute("String_Node_Str",entry.getValue());
      reportsE.appendChild(reportE);
    }
  }
  modelE.appendChild(reportsE);
  return modelE;
}
Program: 190134
Project: 190134
Buggy source:
public void setEnable(boolean enable){
  System.out.println("String_Node_Str" + enable);
  if (enable) {
    graphModel.addGraphListener(this);
  }
 else {
    graphModel.removeGraphListener(this);
    refresh.set(false);
  }
  if (!isAlive()) {
    start();
  }
}

Fixed version (ground truth):
public void setEnable(boolean enable){
  if (enable) {
    graphModel.addGraphListener(this);
  }
 else {
    graphModel.removeGraphListener(this);
    refresh.set(false);
  }
  if (!isAlive()) {
    start();
  }
}
Program: 190135
Project: 190135
Buggy source:
@Override public void run(){
  while (running) {
    try {
      if (refresh.compareAndSet(true,false)) {
        if (filterModel.getFilterThread() != null && filterModel.getCurrentQuery() != null) {
          filterModel.getFilterThread().setRootQuery((AbstractQueryImpl)filterModel.getCurrentQuery());
          System.out.println("String_Node_Str");
        }
      }
      Thread.sleep(TIMER);
    }
 catch (    InterruptedException ex) {
      Exceptions.printStackTrace(ex);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (running) {
    try {
      if (refresh.compareAndSet(true,false)) {
        manualRefresh();
      }
      Thread.sleep(TIMER);
    }
 catch (    InterruptedException ex) {
      Exceptions.printStackTrace(ex);
    }
  }
}
Program: 190136
Project: 190136
Buggy source:
public void removeSubQuery(Query query,Query parent){
  AbstractQueryImpl impl=(AbstractQueryImpl)parent;
  impl.removeSubQuery(query);
  ((AbstractQueryImpl)query).setParent(null);
  fireChangeEvent();
}

Fixed version (ground truth):
public void removeSubQuery(Query query,Query parent){
  AbstractQueryImpl impl=(AbstractQueryImpl)parent;
  impl.removeSubQuery(query);
  ((AbstractQueryImpl)query).setParent(null);
  fireChangeEvent();
  autoRefreshor.manualRefresh();
}
Program: 190137
Project: 190137
Buggy source:
public void setSubQuery(Query query,Query subQuery){
  if (queries.contains(subQuery)) {
    queries.remove(subQuery);
  }
  if (subQuery.getParent() != null) {
    ((AbstractQueryImpl)subQuery.getParent()).removeSubQuery(subQuery);
  }
  AbstractQueryImpl impl=(AbstractQueryImpl)query;
  impl.addSubQuery(subQuery);
  fireChangeEvent();
}

Fixed version (ground truth):
public void setSubQuery(Query query,Query subQuery){
  if (queries.contains(subQuery)) {
    queries.remove(subQuery);
  }
  if (subQuery.getParent() != null) {
    ((AbstractQueryImpl)subQuery.getParent()).removeSubQuery(subQuery);
  }
  AbstractQueryImpl impl=(AbstractQueryImpl)query;
  impl.addSubQuery(subQuery);
  fireChangeEvent();
  autoRefreshor.manualRefresh();
}
Program: 190138
Project: 190138
Buggy source:
/** 
 * @return
 */
public String getReport(){
  String report=new String("String_Node_Str" + "String_Node_Str" + mGraphRevision + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ (this.mDirected ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ mDensity);
  return report;
}

Fixed version (ground truth):
/** 
 * @return
 */
public String getReport(){
  String report=new String("String_Node_Str" + "String_Node_Str" + mGraphRevision + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ (this.mDirected ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ mDensity+ "String_Node_Str");
  return report;
}
Program: 190139
Project: 190139
Buggy source:
public void updateParameters(Query query){
  ((FilterQueryImpl)query).updateParameters();
  fireChangeEvent();
}

Fixed version (ground truth):
public void updateParameters(Query query){
  if (query instanceof FilterQueryImpl) {
    ((FilterQueryImpl)query).updateParameters();
    fireChangeEvent();
  }
}
Program: 190140
Project: 190140
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.getDefault().isNumberListColumn(column)) {
    return value;
  }
 else {
    return value != null ? value.toString() : 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.getDefault().isNumberListColumn(column) || AttributeUtils.getDefault().isDynamicNumberColumn(column))) {
    return value;
  }
 else {
    return value != null ? value.toString() : null;
  }
}
Program: 190143
Project: 190143
Buggy source:
/** 
 * Constructs an empty   {@code IntervalTree}.
 */
public IntervalTree(){
  nil=new Node();
  nil.left=nil.right=nil.p=nil;
  root=nil;
}

Fixed version (ground truth):
public IntervalTree(IntervalTree intervalTree){
  nil=new Node();
  nil.left=nil.right=nil.p=nil;
  root=nil;
  copy(intervalTree.root.left,intervalTree.nil);
}
Program: 190144
Project: 190144
Buggy source:
public void setCameraDistance(float distance){
  fireProperyChange("String_Node_Str",null,distance);
}

Fixed version (ground truth):
public void setCameraDistance(float distance){
}
Program: 190146
Project: 190146
Buggy source:
public void centerOnGraph(){
  float graphWidth=Math.abs(limits.getMaxXoctree() - limits.getMinXoctree());
  float graphHeight=Math.abs(limits.getMaxYoctree() - limits.getMinYoctree());
  float currentDistanceGraphRatioX=Math.abs(graphDrawable.viewport.get(2) / (float)graphDrawable.getDraggingMarkerX()) / graphDrawable.cameraLocation[2];
  float currentDistanceGraphRatioY=Math.abs(graphDrawable.viewport.get(3) / (float)graphDrawable.getDraggingMarkerY()) / graphDrawable.cameraLocation[2];
  float newCameraLocationX=graphWidth / currentDistanceGraphRatioX;
  float newCameraLocationY=graphHeight / currentDistanceGraphRatioY;
  float newCameraLocation=Math.max(newCameraLocationX,newCameraLocationY);
  graphDrawable.cameraLocation[0]=limits.getMinXoctree() + graphWidth / 2;
  graphDrawable.cameraLocation[1]=limits.getMinYoctree() + graphWidth / 2;
  graphDrawable.cameraLocation[2]=newCameraLocation;
  graphDrawable.cameraTarget[0]=graphDrawable.cameraLocation[0];
  graphDrawable.cameraTarget[1]=graphDrawable.cameraLocation[1];
  graphDrawable.cameraTarget[2]=0;
  engine.getScheduler().requireUpdateVisible();
  vizController.getVizModel().setCameraDistance(graphDrawable.getCameraVector().length());
}

Fixed version (ground truth):
public void centerOnGraph(){
  float graphWidth=Math.abs(limits.getMaxXoctree() - limits.getMinXoctree());
  float graphHeight=Math.abs(limits.getMaxYoctree() - limits.getMinYoctree());
  float currentDistanceGraphRatioX=Math.abs(graphDrawable.viewport.get(2) / (float)graphDrawable.getDraggingMarkerX()) / graphDrawable.cameraLocation[2];
  float currentDistanceGraphRatioY=Math.abs(graphDrawable.viewport.get(3) / (float)graphDrawable.getDraggingMarkerY()) / graphDrawable.cameraLocation[2];
  float newCameraLocationX=graphWidth / currentDistanceGraphRatioX;
  float newCameraLocationY=graphHeight / currentDistanceGraphRatioY;
  float newCameraLocation=Math.max(newCameraLocationX,newCameraLocationY);
  graphDrawable.cameraLocation[0]=limits.getMinXoctree() + graphWidth / 2;
  graphDrawable.cameraLocation[1]=limits.getMinYoctree() + graphWidth / 2;
  graphDrawable.cameraLocation[2]=newCameraLocation;
  graphDrawable.cameraTarget[0]=graphDrawable.cameraLocation[0];
  graphDrawable.cameraTarget[1]=graphDrawable.cameraLocation[1];
  graphDrawable.cameraTarget[2]=0;
  engine.getScheduler().requireUpdateVisible();
}
Program: 190147
Project: 190147
Buggy source:
public void centerOnCoordinate(float x,float y,float z){
  graphDrawable.cameraTarget[0]=x;
  graphDrawable.cameraTarget[1]=y;
  graphDrawable.cameraTarget[2]=z;
  graphDrawable.cameraLocation[0]=x;
  graphDrawable.cameraLocation[1]=y;
  graphDrawable.cameraLocation[2]=z + 100;
  vizController.getVizModel().setCameraDistance(graphDrawable.getCameraVector().length());
}

Fixed version (ground truth):
public void centerOnCoordinate(float x,float y,float z){
  graphDrawable.cameraTarget[0]=x;
  graphDrawable.cameraTarget[1]=y;
  graphDrawable.cameraTarget[2]=z;
  graphDrawable.cameraLocation[0]=x;
  graphDrawable.cameraLocation[1]=y;
  graphDrawable.cameraLocation[2]=z + 100;
}
Program: 190148
Project: 190148
Buggy source:
public void centerOnZero(){
  graphDrawable.cameraLocation[0]=0;
  graphDrawable.cameraLocation[1]=0;
  graphDrawable.cameraLocation[2]=100;
  graphDrawable.cameraTarget[0]=0;
  graphDrawable.cameraTarget[1]=0;
  graphDrawable.cameraTarget[2]=0;
  engine.getScheduler().requireUpdateVisible();
  vizController.getVizModel().setCameraDistance(graphDrawable.getCameraVector().length());
}

Fixed version (ground truth):
public void centerOnZero(){
  graphDrawable.cameraLocation[0]=0;
  graphDrawable.cameraLocation[1]=0;
  graphDrawable.cameraLocation[2]=100;
  graphDrawable.cameraTarget[0]=0;
  graphDrawable.cameraTarget[1]=0;
  graphDrawable.cameraTarget[2]=0;
  engine.getScheduler().requireUpdateVisible();
}
Program: 190151
Project: 190151
Buggy source:
public boolean init(Graph graph){
  visibleInterval=dynamicModel.getVisibleInterval();
  min=Double.NEGATIVE_INFINITY;
  max=Double.POSITIVE_INFINITY;
  return true;
}

Fixed version (ground truth):
public boolean init(Graph graph){
  visibleInterval=dynamicModel.getVisibleInterval();
  min=Double.POSITIVE_INFINITY;
  max=Double.NEGATIVE_INFINITY;
  return true;
}
Program: 190152
Project: 190152
Buggy source:
public void finish(){
  timelineController.setMin(min);
  timelineController.setMax(max);
}

Fixed version (ground truth):
public void finish(){
  if (!Double.isInfinite(min)) {
    timelineController.setMin(min);
  }
  if (!Double.isInfinite(max)) {
    timelineController.setMax(max);
  }
}
Program: 190153
Project: 190153
Buggy source:
public boolean evaluate(Graph graph,Edge edge){
  if (edgeColumn != null) {
    Object obj=edge.getEdgeData().getAttributes().getValue(edgeColumn.getIndex());
    if (obj != null) {
      TimeInterval timeInterval=(TimeInterval)obj;
      min=Math.min(min,timeInterval.getLow());
      max=Math.max(max,timeInterval.getHigh());
      return timeInterval.isInRange(visibleInterval.getLow(),visibleInterval.getHigh());
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean evaluate(Graph graph,Edge edge){
  if (edgeColumn != null) {
    Object obj=edge.getEdgeData().getAttributes().getValue(edgeColumn.getIndex());
    if (obj != null) {
      TimeInterval timeInterval=(TimeInterval)obj;
      min=Math.min(min,Double.isInfinite(timeInterval.getLow()) ? min : timeInterval.getLow());
      max=Math.max(max,Double.isInfinite(timeInterval.getHigh()) ? max : timeInterval.getHigh());
      return timeInterval.isInRange(visibleInterval.getLow(),visibleInterval.getHigh());
    }
  }
  return true;
}
Program: 190154
Project: 190154
Buggy source:
private void readEdgelistRow(String row,int pointer,double startTime,double endTime){
  StringTokenizer rowkonizer=new StringTokenizer(row,"String_Node_Str");
  String from=rowkonizer.nextToken();
  String to=rowkonizer.nextToken();
  double weight=-1;
  String weightParse=rowkonizer.nextToken();
  weight=1.0;
  try {
    weight=Double.parseDouble(weightParse);
  }
 catch (  Exception e) {
    report.logIssue(new Issue(NbBundle.getMessage(ImporterDL.class,"String_Node_Str",weightParse,getLineNumber(pointer)),Issue.Level.WARNING));
  }
  NodeDraft sourceNode=container.getNode(from);
  NodeDraft targetNode=container.getNode(to);
  EdgeDraft edgeDraft=null;
  if (container.edgeExists(sourceNode,targetNode)) {
    edgeDraft=container.getEdge(sourceNode,targetNode);
  }
 else {
    edgeDraft=container.factory().newEdgeDraft();
    edgeDraft.setSource(sourceNode);
    edgeDraft.setTarget(targetNode);
    edgeDraft.setWeight((float)weight);
    container.addEdge(edgeDraft);
  }
}

Fixed version (ground truth):
private void readEdgelistRow(String row,int pointer,double startTime,double endTime){
  StringTokenizer rowkonizer=new StringTokenizer(row,"String_Node_Str");
  String from=rowkonizer.nextToken();
  String to=rowkonizer.nextToken();
  double weight=1.0;
  if (rowkonizer.hasMoreTokens()) {
    String weightParse=rowkonizer.nextToken();
    try {
      weight=Double.parseDouble(weightParse);
    }
 catch (    Exception e) {
      report.logIssue(new Issue(NbBundle.getMessage(ImporterDL.class,"String_Node_Str",weightParse,getLineNumber(pointer)),Issue.Level.WARNING));
    }
  }
  NodeDraft sourceNode=container.getNode(from);
  NodeDraft targetNode=container.getNode(to);
  EdgeDraft edgeDraft=null;
  if (container.edgeExists(sourceNode,targetNode)) {
    edgeDraft=container.getEdge(sourceNode,targetNode);
  }
 else {
    edgeDraft=container.factory().newEdgeDraft();
    edgeDraft.setSource(sourceNode);
    edgeDraft.setTarget(targetNode);
    edgeDraft.setWeight((float)weight);
    container.addEdge(edgeDraft);
  }
}
Program: 190155
Project: 190155
Buggy source:
private void readHeaderLine(String line){
  StringTokenizer firstLineTokenizer=new StringTokenizer(line,"String_Node_Str");
  while (firstLineTokenizer.hasMoreTokens()) {
    String tag=firstLineTokenizer.nextToken().toLowerCase();
    if (tag.indexOf("String_Node_Str") != -1) {
      headerMap.put(tag.substring(0,tag.indexOf("String_Node_Str")).trim(),tag.substring(tag.indexOf("String_Node_Str") + 1).trim());
    }
 else {
    }
  }
}

Fixed version (ground truth):
private void readHeaderLine(String line){
  line=line.replaceAll("String_Node_Str","String_Node_Str");
  StringTokenizer firstLineTokenizer=new StringTokenizer(line,"String_Node_Str");
  while (firstLineTokenizer.hasMoreTokens()) {
    String tag=firstLineTokenizer.nextToken().toLowerCase();
    if (tag.indexOf("String_Node_Str") != -1) {
      headerMap.put(tag.substring(0,tag.indexOf("String_Node_Str")).trim(),tag.substring(tag.indexOf("String_Node_Str") + 1).trim());
    }
 else {
    }
  }
}
Program: 190156
Project: 190156
Buggy source:
protected void setSelectedLayout(Layout selectedLayout){
  Layout oldValue=this.selectedLayout;
  this.selectedLayout=selectedLayout;
  this.selectedBuilder=selectedLayout.getBuilder();
  if (oldValue != null) {
    saveProperties(oldValue);
  }
  if (selectedLayout != null) {
    loadProperties(selectedLayout);
  }
  firePropertyChangeEvent(SELECTED_LAYOUT,oldValue,selectedLayout);
}

Fixed version (ground truth):
protected void setSelectedLayout(Layout selectedLayout){
  Layout oldValue=this.selectedLayout;
  this.selectedLayout=selectedLayout;
  this.selectedBuilder=selectedLayout != null ? selectedLayout.getBuilder() : null;
  if (oldValue != null) {
    saveProperties(oldValue);
  }
  if (selectedLayout != null) {
    loadProperties(selectedLayout);
  }
  firePropertyChangeEvent(SELECTED_LAYOUT,oldValue,selectedLayout);
}
Program: 190158
Project: 190158
Buggy source:
private void writeMatrixNode(Node node){
  if (header) {
    String label=node.getNodeData().getLabel();
    if (label == null) {
      label=node.getNodeData().getId();
    }
    stringBuilder.append(label);
    stringBuilder.append(SEPARATOR);
  }
}

Fixed version (ground truth):
private void writeMatrixNode(Node node,boolean writeSeparator) throws IOException {
  if (header) {
    String label=node.getNodeData().getLabel();
    if (label == null) {
      label=node.getNodeData().getId();
    }
    writer.append(label);
    if (writeSeparator) {
      writer.append(SEPARATOR);
    }
  }
}
Program: 190159
Project: 190159
Buggy source:
private void writeEdge(Edge edge){
  if (edge != null) {
    if (edgeWeight) {
      stringBuilder.append(Float.toString(edge.getWeight()));
    }
 else {
      stringBuilder.append(Float.toString(1f));
    }
    stringBuilder.append(SEPARATOR);
  }
 else {
    if (writeZero) {
      stringBuilder.append("String_Node_Str");
    }
    stringBuilder.append(SEPARATOR);
  }
}

Fixed version (ground truth):
private void writeEdge(Edge edge,boolean writeSeparator) throws IOException {
  if (edge != null) {
    if (edgeWeight) {
      writer.append(Float.toString(edge.getWeight()));
    }
 else {
      writer.append(Float.toString(1f));
    }
    if (writeSeparator) {
      writer.append(SEPARATOR);
    }
  }
 else {
    if (writeZero) {
      writer.append("String_Node_Str");
    }
    if (writeSeparator) {
      writer.append(SEPARATOR);
    }
  }
}
Program: 190160
Project: 190160
Buggy source:
private void writeListNode(Node node){
  String label=node.getNodeData().getLabel();
  if (label == null) {
    label=node.getNodeData().getId();
  }
  stringBuilder.append(label);
  stringBuilder.append(SEPARATOR);
}

Fixed version (ground truth):
private void writeListNode(Node node,boolean writeSeparator) throws IOException {
  String label=node.getNodeData().getLabel();
  if (label == null) {
    label=node.getNodeData().getId();
  }
  writer.append(label);
  if (writeSeparator) {
    writer.append(SEPARATOR);
  }
}
Program: 190161
Project: 190161
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  for (  Perspective g : perspectives) {
    if (g != perspective) {
      TopComponentGroup tpg=WindowManager.getDefault().findTopComponentGroup(g.getName());
      tpg.close();
    }
  }
  TopComponentGroup tpg=WindowManager.getDefault().findTopComponentGroup(perspective.getName());
  tpg.open();
  Perspective closingPerspective=getPerspective(selectedPerspective);
  for (  PerspectiveMember member : members) {
    if (member.close(closingPerspective)) {
      if (member instanceof TopComponent) {
        ((TopComponent)member).close();
      }
    }
  }
  for (  PerspectiveMember member : members) {
    if (member.open(perspective)) {
      if (member instanceof TopComponent) {
        ((TopComponent)member).open();
      }
    }
  }
  selectedPerspective=perspective.getName();
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  for (  Perspective g : perspectives) {
    if (g != perspective) {
      TopComponentGroup tpg=WindowManager.getDefault().findTopComponentGroup(g.getName());
      tpg.close();
    }
  }
  TopComponentGroup tpg=WindowManager.getDefault().findTopComponentGroup(perspective.getName());
  tpg.open();
  PerspectiveMember[] members=Lookup.getDefault().lookupAll(PerspectiveMember.class).toArray(new PerspectiveMember[0]);
  Perspective closingPerspective=getPerspective(selectedPerspective);
  for (  PerspectiveMember member : members) {
    if (member.close(closingPerspective)) {
      if (member instanceof TopComponent) {
        boolean closed=((TopComponent)member).close();
        System.out.println("String_Node_Str" + member + "String_Node_Str"+ closed);
      }
    }
  }
  for (  PerspectiveMember member : members) {
    if (member.open(perspective)) {
      if (member instanceof TopComponent && !((TopComponent)member).isOpened()) {
        ((TopComponent)member).open();
        System.out.println("String_Node_Str" + member);
      }
    }
  }
  selectedPerspective=perspective.getName();
}
Program: 190163
Project: 190163
Buggy source:
public void exportToNewWorkspace(Query query){
  Graph result;
  if (model.getCurrentQuery() == query) {
    GraphModel graphModel=Lookup.getDefault().lookup(GraphController.class).getModel();
    result=graphModel.getGraphVisible();
  }
 else {
    FilterProcessor processor=new FilterProcessor();
    GraphModel graphModel=Lookup.getDefault().lookup(GraphController.class).getModel();
    result=processor.process((AbstractQueryImpl)query,graphModel);
  }
  final Graph graphView=result;
  new Thread(new Runnable(){
    public void run(){
      ProgressTicketProvider progressProvider=Lookup.getDefault().lookup(ProgressTicketProvider.class);
      ProgressTicket ticket=null;
      if (progressProvider != null) {
        ticket=progressProvider.createTicket("String_Node_Str",null);
      }
      Progress.start(ticket);
      ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
      Workspace newWorkspace=pc.duplicateWorkspace(pc.getCurrentWorkspace());
      GraphModel graphModel=Lookup.getDefault().lookup(GraphController.class).getModel(newWorkspace);
      graphModel.clear();
      graphModel.pushFrom(graphView);
      Progress.finish(ticket);
      String workspaceName=newWorkspace.getLookup().lookup(WorkspaceInformation.class).getName();
    }
  }
,"String_Node_Str").start();
}

Fixed version (ground truth):
public void exportToNewWorkspace(Query query){
  Graph result;
  if (model.getCurrentQuery() == query) {
    GraphModel graphModel=Lookup.getDefault().lookup(GraphController.class).getModel();
    GraphView view=model.getCurrentResult();
    if (view == null) {
      return;
    }
    result=graphModel.getGraph(view);
  }
 else {
    FilterProcessor processor=new FilterProcessor();
    GraphModel graphModel=Lookup.getDefault().lookup(GraphController.class).getModel();
    result=processor.process((AbstractQueryImpl)query,graphModel);
  }
  final Graph graphView=result;
  new Thread(new Runnable(){
    public void run(){
      ProgressTicketProvider progressProvider=Lookup.getDefault().lookup(ProgressTicketProvider.class);
      ProgressTicket ticket=null;
      if (progressProvider != null) {
        ticket=progressProvider.createTicket("String_Node_Str",null);
      }
      Progress.start(ticket);
      ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
      Workspace newWorkspace=pc.duplicateWorkspace(pc.getCurrentWorkspace());
      GraphModel graphModel=Lookup.getDefault().lookup(GraphController.class).getModel(newWorkspace);
      graphModel.clear();
      graphModel.pushFrom(graphView);
      Progress.finish(ticket);
      String workspaceName=newWorkspace.getLookup().lookup(WorkspaceInformation.class).getName();
    }
  }
,"String_Node_Str").start();
}
Program: 190164
Project: 190164
Buggy source:
public void exportToColumn(String title,Query query){
  Graph result;
  if (model.getCurrentQuery() == query) {
    GraphModel graphModel=Lookup.getDefault().lookup(GraphController.class).getModel();
    result=graphModel.getGraphVisible();
  }
 else {
    FilterProcessor processor=new FilterProcessor();
    GraphModel graphModel=Lookup.getDefault().lookup(GraphController.class).getModel();
    result=processor.process((AbstractQueryImpl)query,graphModel);
  }
  AttributeModel am=Lookup.getDefault().lookup(AttributeController.class).getModel();
  AttributeColumn nodeCol=am.getNodeTable().getColumn("String_Node_Str" + title);
  if (nodeCol == null) {
    nodeCol=am.getNodeTable().addColumn("String_Node_Str" + title,title,AttributeType.BOOLEAN,AttributeOrigin.COMPUTED,Boolean.FALSE);
  }
  AttributeColumn edgeCol=am.getEdgeTable().getColumn("String_Node_Str" + title);
  if (edgeCol == null) {
    edgeCol=am.getEdgeTable().addColumn("String_Node_Str" + title,title,AttributeType.BOOLEAN,AttributeOrigin.COMPUTED,Boolean.FALSE);
  }
  result.readLock();
  for (  Node n : result.getNodes()) {
    n.getNodeData().getAttributes().setValue(nodeCol.getIndex(),Boolean.TRUE);
  }
  for (  Edge e : result.getEdges()) {
    e.getEdgeData().getAttributes().setValue(edgeCol.getIndex(),Boolean.TRUE);
  }
  result.readUnlock();
}

Fixed version (ground truth):
public void exportToColumn(String title,Query query){
  Graph result;
  if (model.getCurrentQuery() == query) {
    GraphModel graphModel=Lookup.getDefault().lookup(GraphController.class).getModel();
    GraphView view=model.getCurrentResult();
    if (view != null) {
      return;
    }
    result=graphModel.getGraph(view);
  }
 else {
    FilterProcessor processor=new FilterProcessor();
    GraphModel graphModel=Lookup.getDefault().lookup(GraphController.class).getModel();
    result=processor.process((AbstractQueryImpl)query,graphModel);
  }
  AttributeModel am=Lookup.getDefault().lookup(AttributeController.class).getModel();
  AttributeColumn nodeCol=am.getNodeTable().getColumn("String_Node_Str" + title);
  if (nodeCol == null) {
    nodeCol=am.getNodeTable().addColumn("String_Node_Str" + title,title,AttributeType.BOOLEAN,AttributeOrigin.COMPUTED,Boolean.FALSE);
  }
  AttributeColumn edgeCol=am.getEdgeTable().getColumn("String_Node_Str" + title);
  if (edgeCol == null) {
    edgeCol=am.getEdgeTable().addColumn("String_Node_Str" + title,title,AttributeType.BOOLEAN,AttributeOrigin.COMPUTED,Boolean.FALSE);
  }
  result.readLock();
  for (  Node n : result.getNodes()) {
    n.getNodeData().getAttributes().setValue(nodeCol.getIndex(),Boolean.TRUE);
  }
  for (  Edge e : result.getEdges()) {
    e.getEdgeData().getAttributes().setValue(edgeCol.getIndex(),Boolean.TRUE);
  }
  result.readUnlock();
}
Program: 190165
Project: 190165
Buggy source:
private void select(AbstractQueryImpl query){
  FilterProcessor processor=new FilterProcessor();
  GraphModel graphModel=Lookup.getDefault().lookup(GraphController.class).getModel();
  Graph result=processor.process((AbstractQueryImpl)query,graphModel);
  if (running) {
    VisualizationController visController=Lookup.getDefault().lookup(VisualizationController.class);
    if (visController != null) {
      visController.selectNodes(result.getNodes().toArray());
      visController.selectEdges(result.getEdges().toArray());
    }
  }
 else {
  }
  graphModel.destroyView(result.getView());
}

Fixed version (ground truth):
private void select(AbstractQueryImpl query){
  FilterProcessor processor=new FilterProcessor();
  GraphModel graphModel=Lookup.getDefault().lookup(GraphController.class).getModel();
  Graph result=processor.process((AbstractQueryImpl)query,graphModel);
  if (running) {
    VisualizationController visController=Lookup.getDefault().lookup(VisualizationController.class);
    if (visController != null) {
      visController.selectNodes(result.getNodes().toArray());
      visController.selectEdges(result.getEdges().toArray());
    }
    GraphView view=result.getView();
    model.setCurrentResult(view);
  }
 else {
    graphModel.destroyView(result.getView());
  }
}
Program: 190166
Project: 190166
Buggy source:
public boolean cancel(){
  return true;
}

Fixed version (ground truth):
public boolean cancel(){
  cancel=true;
  return true;
}
Program: 190167
Project: 190167
Buggy source:
public void readWorkspaceChildren(Workspace workspace,Element workspaceE) throws Exception {
  NodeList children=workspaceE.getChildNodes();
  for (int i=0; i < children.getLength(); i++) {
    Node child=children.item(i);
    if (child.getNodeType() == Node.ELEMENT_NODE) {
      Element childE=(Element)child;
      WorkspacePersistenceProvider pp=providers.get(childE.getTagName());
      if (pp != null) {
        try {
          pp.readXML(childE,workspace);
        }
 catch (        UnsupportedOperationException e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
public void readWorkspaceChildren(Workspace workspace,Element workspaceE) throws Exception {
  NodeList children=workspaceE.getChildNodes();
  for (int i=0; i < children.getLength() && !cancel; i++) {
    Node child=children.item(i);
    if (child.getNodeType() == Node.ELEMENT_NODE) {
      Element childE=(Element)child;
      WorkspacePersistenceProvider pp=providers.get(childE.getTagName());
      if (pp != null) {
        try {
          pp.readXML(childE,workspace);
        }
 catch (        UnsupportedOperationException e) {
        }
      }
    }
  }
}
Program: 190168
Project: 190168
Buggy source:
public void readProject(XPath xpath,Element projectE) throws Exception {
  ProjectInformationImpl info=project.getLookup().lookup(ProjectInformationImpl.class);
  WorkspaceProviderImpl workspaces=project.getLookup().lookup(WorkspaceProviderImpl.class);
  info.setName(projectE.getAttribute("String_Node_Str"));
  XPathExpression exp=xpath.compile("String_Node_Str");
  NodeList workSpaceList=(NodeList)exp.evaluate(projectE,XPathConstants.NODESET);
  for (int i=0; i < workSpaceList.getLength(); i++) {
    Element workspaceE=(Element)workSpaceList.item(i);
    Workspace workspace=readWorkspace(xpath,workspaceE);
    if (workspace.getLookup().lookup(WorkspaceInformationImpl.class).isOpen()) {
      workspaces.setCurrentWorkspace(workspace);
    }
  }
}

Fixed version (ground truth):
public void readProject(XPath xpath,Element projectE) throws Exception {
  ProjectInformationImpl info=project.getLookup().lookup(ProjectInformationImpl.class);
  WorkspaceProviderImpl workspaces=project.getLookup().lookup(WorkspaceProviderImpl.class);
  info.setName(projectE.getAttribute("String_Node_Str"));
  XPathExpression exp=xpath.compile("String_Node_Str");
  NodeList workSpaceList=(NodeList)exp.evaluate(projectE,XPathConstants.NODESET);
  for (int i=0; i < workSpaceList.getLength() && !cancel; i++) {
    Element workspaceE=(Element)workSpaceList.item(i);
    Workspace workspace=readWorkspace(xpath,workspaceE);
    if (workspace.getLookup().lookup(WorkspaceInformationImpl.class).isOpen()) {
      workspaces.setCurrentWorkspace(workspace);
    }
  }
}
Program: 190169
Project: 190169
Buggy source:
public boolean cancel(){
  cancel=true;
  gephiReader.cancel();
  return true;
}

Fixed version (ground truth):
public boolean cancel(){
  cancel=true;
  if (gephiReader != null) {
    gephiReader.cancel();
  }
  return true;
}
Program: 190170
Project: 190170
Buggy source:
public void run(){
  try {
    Progress.start(progressTicket);
    Progress.setDisplayName(progressTicket,NbBundle.getMessage(SaveTask.class,"String_Node_Str"));
    FileObject fileObject=FileUtil.toFileObject(file);
    if (FileUtil.isArchiveFile(fileObject)) {
      fileObject=FileUtil.getArchiveRoot(fileObject).getChildren()[0];
    }
    DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
    DocumentBuilder builder=factory.newDocumentBuilder();
    Document doc=builder.parse(fileObject.getInputStream());
    Project project=new ProjectImpl();
    project.getLookup().lookup(ProjectInformationImpl.class).setFile(file);
    String version=doc.getDocumentElement().getAttribute("String_Node_Str");
    if (version == null || version.isEmpty() || Double.parseDouble(version) != 0.7) {
      throw new GephiFormatException("String_Node_Str");
    }
    gephiReader=new GephiReader();
    project=gephiReader.readAll(doc.getDocumentElement(),project);
    if (!cancel) {
      ProjectControllerImpl pc=Lookup.getDefault().lookup(ProjectControllerImpl.class);
      pc.openProject(project);
    }
    Progress.finish(progressTicket);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    if (ex instanceof GephiFormatException) {
      throw (GephiFormatException)ex;
    }
    throw new GephiFormatException(GephiReader.class,ex);
  }
}

Fixed version (ground truth):
public void run(){
  try {
    Progress.start(progressTicket);
    Progress.setDisplayName(progressTicket,NbBundle.getMessage(SaveTask.class,"String_Node_Str"));
    FileObject fileObject=FileUtil.toFileObject(file);
    if (FileUtil.isArchiveFile(fileObject)) {
      fileObject=FileUtil.getArchiveRoot(fileObject).getChildren()[0];
    }
    DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
    DocumentBuilder builder=factory.newDocumentBuilder();
    Document doc=builder.parse(fileObject.getInputStream());
    if (!cancel) {
      Project project=new ProjectImpl();
      project.getLookup().lookup(ProjectInformationImpl.class).setFile(file);
      String version=doc.getDocumentElement().getAttribute("String_Node_Str");
      if (version == null || version.isEmpty() || Double.parseDouble(version) != 0.7) {
        throw new GephiFormatException("String_Node_Str");
      }
      gephiReader=new GephiReader();
      project=gephiReader.readAll(doc.getDocumentElement(),project);
      if (!cancel) {
        ProjectControllerImpl pc=Lookup.getDefault().lookup(ProjectControllerImpl.class);
        pc.openProject(project);
      }
    }
    Progress.finish(progressTicket);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    if (ex instanceof GephiFormatException) {
      throw (GephiFormatException)ex;
    }
    throw new GephiFormatException(GephiReader.class,ex);
  }
}
Program: 190172
Project: 190172
Buggy source:
/** 
 * Does export the preview graph as an SVG image.
 * @param file         the output SVG file
 * @param supportSize  the support size of the exported image
 * @throws Exception
 */
private void exportData(GraphSheet graphSheet) throws Exception {
  SupportSize supportSize=new SupportSize(210,297,LengthUnit.MILLIMETER);
  Progress.start(progress);
  Graph graph=graphSheet.getGraph();
  int max=0;
  if (graph.showNodes()) {
    max+=graph.countNodes();
  }
  if (graph.showEdges()) {
    max+=graph.countUnidirectionalEdges() + graph.countBidirectionalEdges();
    if (graph.showSelfLoops()) {
      max+=graph.countSelfLoops();
    }
  }
  Progress.switchToDeterminate(progress,max);
  buildDOM(graphSheet,supportSize);
  SVGTranscoder t=new SVGTranscoder();
  t.addTranscodingHint(SVGTranscoder.KEY_XML_DECLARATION,new String("String_Node_Str"));
  TranscoderInput input=new TranscoderInput(doc);
  try {
    TranscoderOutput output=new TranscoderOutput(writer);
    t.transcode(input,output);
  }
  finally {
    writer.close();
  }
  Progress.finish(progress);
}

Fixed version (ground truth):
/** 
 * Does export the preview graph as an SVG image.
 * @param file         the output SVG file
 * @param supportSize  the support size of the exported image
 * @throws Exception
 */
private void exportData(GraphSheet graphSheet) throws Exception {
  SupportSize supportSize=new SupportSize(210,297,LengthUnit.MILLIMETER);
  Progress.start(progress);
  Graph graph=graphSheet.getGraph();
  int max=0;
  if (graph.showNodes()) {
    max+=graph.countNodes();
  }
  if (graph.showEdges()) {
    max+=graph.countUnidirectionalEdges() + graph.countBidirectionalEdges();
    if (graph.showSelfLoops()) {
      max+=graph.countSelfLoops();
    }
  }
  Progress.switchToDeterminate(progress,max);
  buildDOM(graphSheet,supportSize);
  SVGTranscoder t=new SVGTranscoder();
  t.addTranscodingHint(SVGTranscoder.KEY_XML_DECLARATION,new String("String_Node_Str"));
  TranscoderInput input=new TranscoderInput(doc);
  try {
    TranscoderOutput output=new TranscoderOutput(new OutputStreamWriter(new WriterOutputStream(writer),Charset.forName("String_Node_Str")));
    t.transcode(input,output);
  }
  finally {
    writer.close();
  }
  Progress.finish(progress);
}