nus-yam/ex-repair huggingface dataset:
Program: 142795
Project: 142795
Buggy source:
/** 
 * Creates a preview bidirectional edge from the given source edge.
 * @param previewGraph  the parent preview graph
 * @param sourceEdge    the source edge
 * @return              the generated preview bidirectional edge
 */
private BidirectionalEdgeImpl createPreviewBidirectionalEdge(GraphImpl previewGraph,org.gephi.graph.api.Edge sourceEdge){
  org.gephi.graph.api.EdgeData sourceEdgeData=sourceEdge.getEdgeData();
  org.gephi.graph.api.TextData sourceEdgeTextData=sourceEdgeData.getTextData();
  String label=sourceEdgeData.getLabel();
  if (sourceEdgeTextData != null && sourceEdgeTextData.getText() != null && sourceEdgeTextData.getText().isEmpty()) {
    label=sourceEdgeTextData.getText();
  }
  float labelSize=1f;
  if (sourceEdgeTextData != null) {
    labelSize=sourceEdgeTextData.getSize();
  }
  BidirectionalEdgeImpl previewEdge=new BidirectionalEdgeImpl(previewGraph,sourceEdge.getWeight(),nodeMap.get(sourceEdge.getSource().getId()),nodeMap.get(sourceEdge.getTarget().getId()),label,labelSize);
  previewGraph.addBidirectionalEdge(previewEdge);
  return previewEdge;
}

Fixed version (ground truth):
/** 
 * Creates a preview bidirectional edge from the given source edge.
 * @param previewGraph  the parent preview graph
 * @param sourceEdge    the source edge
 * @return              the generated preview bidirectional edge
 */
private BidirectionalEdgeImpl createPreviewBidirectionalEdge(GraphImpl previewGraph,org.gephi.graph.api.Edge sourceEdge){
  org.gephi.graph.api.EdgeData sourceEdgeData=sourceEdge.getEdgeData();
  org.gephi.graph.api.TextData sourceEdgeTextData=sourceEdgeData.getTextData();
  String label=sourceEdgeData.getLabel();
  if (sourceEdgeTextData != null && sourceEdgeTextData.getText() != null && sourceEdgeTextData.getText().isEmpty()) {
    label=sourceEdgeTextData.getText();
  }
  float labelSize=1f;
  if (sourceEdgeTextData != null) {
    labelSize=sourceEdgeTextData.getSize();
  }
  BidirectionalEdgeImpl previewEdge=new BidirectionalEdgeImpl(previewGraph,sourceEdge,nodeMap.get(sourceEdge.getSource().getId()),nodeMap.get(sourceEdge.getTarget().getId()),label,labelSize);
  previewGraph.addBidirectionalEdge(previewEdge);
  return previewEdge;
}
Program: 142796
Project: 142796
Buggy source:
/** 
 * Creates a preview self-loop from the given source edge.
 * @param previewGraph  the parent preview graph
 * @param sourceEdge    the source edge
 * @return              the generated preview self-loop
 */
private SelfLoopImpl createPreviewSelfLoop(GraphImpl previewGraph,org.gephi.graph.api.Edge sourceEdge){
  org.gephi.graph.api.EdgeData sourceEdgeData=sourceEdge.getEdgeData();
  SelfLoopImpl previewSelfLoop=new SelfLoopImpl(previewGraph,sourceEdge.getWeight(),nodeMap.get(sourceEdge.getSource().getId()));
  previewGraph.addSelfLoop(previewSelfLoop);
  return previewSelfLoop;
}

Fixed version (ground truth):
/** 
 * Creates a preview self-loop from the given source edge.
 * @param previewGraph  the parent preview graph
 * @param sourceEdge    the source edge
 * @return              the generated preview self-loop
 */
private SelfLoopImpl createPreviewSelfLoop(GraphImpl previewGraph,org.gephi.graph.api.Edge sourceEdge){
  org.gephi.graph.api.EdgeData sourceEdgeData=sourceEdge.getEdgeData();
  SelfLoopImpl previewSelfLoop=new SelfLoopImpl(previewGraph,sourceEdge,nodeMap.get(sourceEdge.getSource().getId()));
  previewGraph.addSelfLoop(previewSelfLoop);
  return previewSelfLoop;
}
Program: 142797
Project: 142797
Buggy source:
/** 
 * Creates a preview undirected edge from the given source edge.
 * @param previewGraph  the parent preview graph
 * @param sourceEdge    the source edge
 * @return              the generated preview undirected edge
 */
private UndirectedEdgeImpl createPreviewUndirectedEdge(GraphImpl previewGraph,org.gephi.graph.api.Edge sourceEdge){
  org.gephi.graph.api.EdgeData sourceEdgeData=sourceEdge.getEdgeData();
  org.gephi.graph.api.TextData sourceEdgeTextData=sourceEdgeData.getTextData();
  String label=sourceEdgeData.getLabel();
  if (sourceEdgeTextData != null && sourceEdgeTextData.getText() != null && sourceEdgeTextData.getText().isEmpty()) {
    label=sourceEdgeTextData.getText();
  }
  float labelSize=1f;
  if (sourceEdgeTextData != null) {
    labelSize=sourceEdgeTextData.getSize();
  }
  UndirectedEdgeImpl previewEdge=new UndirectedEdgeImpl(previewGraph,sourceEdge.getWeight(),nodeMap.get(sourceEdge.getSource().getId()),nodeMap.get(sourceEdge.getTarget().getId()),label,labelSize);
  previewGraph.addUndirectedEdge(previewEdge);
  return previewEdge;
}

Fixed version (ground truth):
/** 
 * Creates a preview undirected edge from the given source edge.
 * @param previewGraph  the parent preview graph
 * @param sourceEdge    the source edge
 * @return              the generated preview undirected edge
 */
private UndirectedEdgeImpl createPreviewUndirectedEdge(GraphImpl previewGraph,org.gephi.graph.api.Edge sourceEdge){
  org.gephi.graph.api.EdgeData sourceEdgeData=sourceEdge.getEdgeData();
  org.gephi.graph.api.TextData sourceEdgeTextData=sourceEdgeData.getTextData();
  String label=sourceEdgeData.getLabel();
  if (sourceEdgeTextData != null && sourceEdgeTextData.getText() != null && sourceEdgeTextData.getText().isEmpty()) {
    label=sourceEdgeTextData.getText();
  }
  float labelSize=1f;
  if (sourceEdgeTextData != null) {
    labelSize=sourceEdgeTextData.getSize();
  }
  UndirectedEdgeImpl previewEdge=new UndirectedEdgeImpl(previewGraph,sourceEdge,nodeMap.get(sourceEdge.getSource().getId()),nodeMap.get(sourceEdge.getTarget().getId()),label,labelSize);
  previewGraph.addUndirectedEdge(previewEdge);
  return previewEdge;
}
Program: 142798
Project: 142798
Buggy source:
/** 
 * Constructor.
 * @param parent     the parent graph of the self-loop
 * @param thickness  the self-loop's thickness
 * @param node       the self-loop's related node
 */
public SelfLoopImpl(GraphImpl parent,float thickness,NodeImpl node){
  super(parent,thickness);
  this.node=node;
  genCurve();
  getSelfLoopSupervisor().addSelfLoop(this);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param parent     the parent graph of the self-loop
 * @param thickness  the self-loop's thickness
 * @param node       the self-loop's related node
 */
public SelfLoopImpl(GraphImpl parent,Edge edge,NodeImpl node){
  super(parent,edge.getWeight());
  this.node=node;
  if (edge.getEdgeData().r() != -1) {
    originalColor=new Color(edge.getEdgeData().r(),edge.getEdgeData().g(),edge.getEdgeData().b(),edge.getEdgeData().alpha());
  }
 else {
    originalColor=null;
  }
  genCurve();
  getSelfLoopSupervisor().addSelfLoop(this);
}
Program: 142799
Project: 142799
Buggy source:
/** 
 * Constructor.
 * @param parent     the parent graph of the edge
 * @param thickness  the edge's thickness
 * @param node1      the edge's node 1
 * @param node2      the edge's node 2
 * @param label      the edge's label
 * @param labelSize  the edge's label size
 */
public UndirectedEdgeImpl(GraphImpl parent,float thickness,NodeImpl node1,NodeImpl node2,String label,float labelSize){
  super(parent,thickness,node1,node2,label,labelSize);
  getUndirectedEdgeSupervisor().addEdge(this);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param parent     the parent graph of the edge
 * @param thickness  the edge's thickness
 * @param node1      the edge's node 1
 * @param node2      the edge's node 2
 * @param label      the edge's label
 * @param labelSize  the edge's label size
 */
public UndirectedEdgeImpl(GraphImpl parent,Edge edge,NodeImpl node1,NodeImpl node2,String label,float labelSize){
  super(parent,edge,node1,node2,label,labelSize);
  getUndirectedEdgeSupervisor().addEdge(this);
}
Program: 142800
Project: 142800
Buggy source:
/** 
 * Constructor.
 * @param parent     the parent graph of the edge
 * @param thickness  the edge's thickness
 * @param node1      the edge's node 1
 * @param node2      the edge's node 2
 * @param label      the edge's label
 * @param labelSize  the edge's label size
 */
public UnidirectionalEdgeImpl(GraphImpl parent,float thickness,NodeImpl node1,NodeImpl node2,String label,float labelSize){
  super(parent,thickness,node1,node2,label,labelSize);
  getDirectedEdgeSupervisor().addEdge(this);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param parent     the parent graph of the edge
 * @param thickness  the edge's thickness
 * @param node1      the edge's node 1
 * @param node2      the edge's node 2
 * @param label      the edge's label
 * @param labelSize  the edge's label size
 */
public UnidirectionalEdgeImpl(GraphImpl parent,Edge edge,NodeImpl node1,NodeImpl node2,String label,float labelSize){
  super(parent,edge,node1,node2,label,labelSize);
  getDirectedEdgeSupervisor().addEdge(this);
}
Program: 142801
Project: 142801
Buggy source:
@Override public void setAsText(String s){
  if (supportsCustomColorMode() && colorizerFactory.matchCustomColorMode(s)) {
    Pattern p=Pattern.compile("String_Node_Str");
    Matcher m=p.matcher(s);
    if (m.lookingAt()) {
      int r=Integer.valueOf(m.group(1));
      int g=Integer.valueOf(m.group(2));
      int b=Integer.valueOf(m.group(3));
      setValue(colorizerFactory.createCustomColorMode(r,g,b));
    }
  }
 else   if (supportsNodeOriginalColorMode() && colorizerFactory.matchNodeOriginalColorMode(s)) {
    setValue(colorizerFactory.createNodeOriginalColorMode());
  }
 else   if (supportsParentColorMode() && colorizerFactory.matchParentColorMode(s)) {
    setValue(colorizerFactory.createParentColorMode());
  }
 else   if (supportsEdgeB1ColorMode() && colorizerFactory.matchEdgeB1ColorMode(s)) {
    setValue(colorizerFactory.createEdgeB1ColorMode());
  }
 else   if (supportsEdgeB2ColorMode() && colorizerFactory.matchEdgeB2ColorMode(s)) {
    setValue(colorizerFactory.createEdgeB2ColorMode());
  }
 else   if (supportsEdgeBothBColorMode() && colorizerFactory.matchEdgeBothBColorMode(s)) {
    setValue(colorizerFactory.createEdgeBothBColorMode());
  }
}

Fixed version (ground truth):
@Override public void setAsText(String s){
  if (supportsCustomColorMode() && colorizerFactory.matchCustomColorMode(s)) {
    Pattern p=Pattern.compile("String_Node_Str");
    Matcher m=p.matcher(s);
    if (m.lookingAt()) {
      int r=Integer.valueOf(m.group(1));
      int g=Integer.valueOf(m.group(2));
      int b=Integer.valueOf(m.group(3));
      setValue(colorizerFactory.createCustomColorMode(r,g,b));
    }
  }
 else   if (supportsNodeOriginalColorMode() && colorizerFactory.matchNodeOriginalColorMode(s)) {
    setValue(colorizerFactory.createNodeOriginalColorMode());
  }
 else   if (supportsParentColorMode() && colorizerFactory.matchParentColorMode(s)) {
    setValue(colorizerFactory.createParentColorMode());
  }
 else   if (supportsEdgeB1ColorMode() && colorizerFactory.matchEdgeB1ColorMode(s)) {
    setValue(colorizerFactory.createEdgeB1ColorMode());
  }
 else   if (supportsEdgeB2ColorMode() && colorizerFactory.matchEdgeB2ColorMode(s)) {
    setValue(colorizerFactory.createEdgeB2ColorMode());
  }
 else   if (supportsEdgeBothBColorMode() && colorizerFactory.matchEdgeBothBColorMode(s)) {
    setValue(colorizerFactory.createEdgeBothBColorMode());
  }
 else   if (supportEdgeOriginalColorMode() && colorizerFactory.matchEdgeOriginalColorMode(s)) {
    setValue(colorizerFactory.createEdgeOriginalColorMode());
  }
}
Program: 142802
Project: 142802
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: 142803
Project: 142803
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: 142804
Project: 142804
Buggy source:
/** 
 * Creates a preview node from the given source node.
 * @param previewGraph  the parent preview graph
 * @param sourceNode    the source node
 * @return              the generated preview node
 */
private NodeImpl createPreviewNode(GraphImpl previewGraph,org.gephi.graph.api.Node sourceNode){
  org.gephi.graph.api.NodeData sourceNodeData=sourceNode.getNodeData();
  org.gephi.graph.api.TextData sourceNodeTextData=sourceNodeData.getTextData();
  String label=sourceNodeData.getLabel();
  if (sourceNodeTextData != null && sourceNodeTextData.getText() != null && sourceNodeTextData.getText().isEmpty()) {
    label=sourceNodeTextData.getText();
  }
  float labelSize=1f;
  if (sourceNodeTextData != null) {
    labelSize=sourceNodeTextData.getSize();
  }
  if (previewGraph.getModel().getNodeSupervisor().getProportionalLabelSize()) {
    labelSize*=sourceNodeData.getRadius() / 10f;
  }
  NodeImpl previewNode=new NodeImpl(previewGraph,sourceNodeData.x(),-sourceNodeData.y(),sourceNodeData.getRadius(),label,labelSize,sourceNodeData.r(),sourceNodeData.g(),sourceNodeData.b());
  previewGraph.addNode(previewNode);
  nodeMap.put(sourceNode.getId(),previewNode);
  return previewNode;
}

Fixed version (ground truth):
/** 
 * Creates a preview node from the given source node.
 * @param previewGraph  the parent preview graph
 * @param sourceNode    the source node
 * @return              the generated preview node
 */
private NodeImpl createPreviewNode(GraphImpl previewGraph,org.gephi.graph.api.Node sourceNode){
  org.gephi.graph.api.NodeData sourceNodeData=sourceNode.getNodeData();
  org.gephi.graph.api.TextData sourceNodeTextData=sourceNodeData.getTextData();
  String label=sourceNodeData.getLabel();
  if (sourceNodeTextData != null && sourceNodeTextData.getText() != null && !sourceNodeTextData.getText().isEmpty()) {
    label=sourceNodeTextData.getText();
  }
  float labelSize=1f;
  if (sourceNodeTextData != null) {
    labelSize=sourceNodeTextData.getSize();
  }
  if (previewGraph.getModel().getNodeSupervisor().getProportionalLabelSize()) {
    labelSize*=sourceNodeData.getRadius() / 10f;
  }
  NodeImpl previewNode=new NodeImpl(previewGraph,sourceNodeData.x(),-sourceNodeData.y(),sourceNodeData.getRadius(),label,labelSize,sourceNodeData.r(),sourceNodeData.g(),sourceNodeData.b());
  previewGraph.addNode(previewNode);
  nodeMap.put(sourceNode.getId(),previewNode);
  return previewNode;
}
Program: 142805
Project: 142805
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: 142806
Project: 142806
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: 142807
Project: 142807
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: 142808
Project: 142808
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: 142809
Project: 142809
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: 142810
Project: 142810
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: 142811
Project: 142811
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: 142812
Project: 142812
Buggy source:
public void removeChangeListener(ChangeListener listener){
  listeners.remove(listener);
}

Fixed version (ground truth):
public void removeChangeListener(ChangeListener listener){
  if (listeners != null) {
    listeners.remove(listener);
  }
}
Program: 142813
Project: 142813
Buggy source:
public Component getStatusLineElement(){
  panel=new WorkspaceUISelectorPanel();
  return panel;
}

Fixed version (ground truth):
public Component getStatusLineElement(){
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  pc.addWorkspaceListener(this);
  panel=new WorkspaceUISelectorPanel();
  return panel;
}
Program: 142814
Project: 142814
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: 142815
Project: 142815
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: 142816
Project: 142816
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: 142817
Project: 142817
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: 142818
Project: 142818
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: 142819
Project: 142819
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: 142820
Project: 142820
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: 142822
Project: 142822
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: 142823
Project: 142823
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: 142824
Project: 142824
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: 142825
Project: 142825
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: 142826
Project: 142826
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: 142829
Project: 142829
Buggy source:
public void setCameraDistance(float distance){
  fireProperyChange("String_Node_Str",null,distance);
}

Fixed version (ground truth):
public void setCameraDistance(float distance){
}
Program: 142831
Project: 142831
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: 142832
Project: 142832
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: 142833
Project: 142833
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: 142834
Project: 142834
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: 142835
Project: 142835
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: 142837
Project: 142837
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: 142838
Project: 142838
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: 142839
Project: 142839
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);
  }
}