nus-yam/ex-repair huggingface dataset:
Program: 190471
Project: 190471
Buggy source:
public void setInited(){
  if (!inited) {
    inited=true;
    if (requestAnimation) {
      graphDrawable.display();
      startAnimating();
      requestAnimation=false;
    }
  }
 else {
    dataBridge.reset();
    textManager.initArchitecture();
  }
}

Fixed version (ground truth):
public void setInited(){
  if (!inited) {
    inited=true;
    if (requestAnimation) {
      startAnimating();
      requestAnimation=false;
    }
  }
 else {
    dataBridge.reset();
    textManager.initArchitecture();
  }
}
Program: 190472
Project: 190472
Buggy source:
@Override public void updateObjectsPosition(){
  int[] classIds=new int[modelClasses.length];
  int i=0;
  for (  ModelClass objClass : modelClasses) {
    if (objClass.isEnabled()) {
      classIds[i]=objClass.getClassId();
    }
 else {
      classIds[i]=-1;
    }
    i++;
  }
  octree.updateObjectsPosition(classIds);
}

Fixed version (ground truth):
@Override public void updateObjectsPosition(){
  for (  ModelClass objClass : modelClasses) {
    if (objClass.isEnabled()) {
      octree.updateObjectsPosition(objClass.getClassId());
    }
  }
}
Program: 190473
Project: 190473
Buggy source:
@Override public void display(GL gl,GLU glu){
  this.gl=gl;
  this.glu=glu;
  boolean execMouseClick=mouseClick.getAndSet(false);
  boolean execMouseMove=mouseMoved.getAndSet(false);
  boolean execDrag=drag.get() || startDrag.get() || stopDrag.get();
  int pool1Permit=0;
  int pool2Permit=0;
  if (execMouseMove) {
    pool2Permit++;
  }
 else   if (execDrag) {
    pool2Permit++;
  }
  if (execMouseClick) {
    pool2Permit++;
  }
  if (cameraMoved.getAndSet(false)) {
    graphDrawable.setCameraPosition(gl,glu);
    pool1Permit=modelSegments.size();
    engine.getOctree().updateVisibleOctant(gl);
    for (int i=0; i < modelSegments.size(); i++) {
      Runnable r=modelSegments.get(i);
      pool1.execute(r);
    }
  }
  if (execMouseMove) {
    engine.updateSelection(gl,glu);
    pool2.execute(selectionSegment);
  }
 else   if (execDrag) {
    pool2.execute(dragSegment);
  }
  if (execMouseClick) {
    pool2.execute(mouseClickSegment);
  }
  try {
    if (pool1Permit > 0) {
      pool1Semaphore.acquire(pool1Permit);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  engine.beforeDisplay(gl,glu);
  engine.display(gl,glu);
  engine.afterDisplay(gl,glu);
  try {
    if (pool2Permit > 0) {
      pool2Semaphore.acquire(pool2Permit);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void display(GL gl,GLU glu){
  if (simpleFPSAnimator.isDisplayCall()) {
    this.gl=gl;
    this.glu=glu;
    boolean execMouseClick=mouseClick.getAndSet(false);
    boolean execMouseMove=mouseMoved.getAndSet(false);
    boolean execDrag=drag.get() || startDrag.get() || stopDrag.get();
    int pool1Permit=0;
    int pool2Permit=0;
    if (execMouseMove) {
      pool2Permit++;
    }
 else     if (execDrag) {
      pool2Permit++;
    }
    if (execMouseClick) {
      pool2Permit++;
    }
    if (cameraMoved.getAndSet(false)) {
      graphDrawable.setCameraPosition(gl,glu);
      pool1Permit=modelSegments.size();
      engine.getOctree().updateVisibleOctant(gl);
      for (int i=0; i < modelSegments.size(); i++) {
        Runnable r=modelSegments.get(i);
        pool1.execute(r);
      }
    }
    if (execMouseMove) {
      engine.updateSelection(gl,glu);
      pool2.execute(selectionSegment);
    }
 else     if (execDrag) {
      pool2.execute(dragSegment);
    }
    if (execMouseClick) {
      pool2.execute(mouseClickSegment);
    }
    try {
      if (pool1Permit > 0) {
        pool1Semaphore.acquire(pool1Permit);
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    engine.beforeDisplay(gl,glu);
    engine.display(gl,glu);
    engine.afterDisplay(gl,glu);
    try {
      if (pool2Permit > 0) {
        pool2Semaphore.acquire(pool2Permit);
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}
Program: 190475
Project: 190475
Buggy source:
@Override public Octant[] getOctants(){
  Octant[] oc=((ModelImpl)obj.getModel()).getOctants();
  if (oc[0] == null) {
    oc=this.octants;
  }
  return oc;
}

Fixed version (ground truth):
@Override public Octant[] getOctants(){
  if (obj.getModel() == null) {
    return this.octants;
  }
  Octant[] oc=((ModelImpl)obj.getModel()).getOctants();
  if (oc[0] == null) {
    oc=this.octants;
  }
  return oc;
}
Program: 190476
Project: 190476
Buggy source:
public void updateObjectsPosition(int[] classIDs){
  Octant[] leavesCopy=leaves.toArray(new Octant[0]);
  for (int i=0; i < classIDs.length; i++) {
    int classID=classIDs[i];
    if (classID == -1) {
      continue;
    }
    for (    Octant o : leavesCopy) {
      if (o.isRequiringUpdatePosition()) {
        for (updatePositionIterator.setNode(o.getTree(classID)); updatePositionIterator.hasNext(); ) {
          ModelImpl obj=updatePositionIterator.next();
          if (!obj.isInOctreeLeaf(o)) {
            o.removeObject(classID,obj);
            obj.resetOctant();
            addObject(classID,obj);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void updateObjectsPosition(int classID){
  for (  Octant o : leaves) {
    if (o.isRequiringUpdatePosition()) {
      for (updatePositionIterator.setNode(o.getTree(classID)); updatePositionIterator.hasNext(); ) {
        ModelImpl obj=updatePositionIterator.next();
        if (!obj.isInOctreeLeaf(o)) {
          o.removeObject(classID,obj);
          obj.resetOctant();
          addObject(classID,obj);
        }
      }
    }
  }
}
Program: 190477
Project: 190477
Buggy source:
public void cleanDeletedObjects(int classID){
  for (  Octant o : leaves) {
    for (cleanObjectsIterator.setNode(o.getTree(classID)); cleanObjectsIterator.hasNext(); ) {
      ModelImpl obj=cleanObjectsIterator.next();
      if (!obj.isCacheMatching(cacheMarker)) {
        removeObject(classID,obj);
        obj.resetOctant();
        if (vizController.getVizConfig().isCleanDeletedModels()) {
          obj.getObj().setModel(null);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void cleanDeletedObjects(int classID){
  for (  Octant o : leaves) {
    for (cleanObjectsIterator.setNode(o.getTree(classID)); cleanObjectsIterator.hasNext(); ) {
      ModelImpl obj=cleanObjectsIterator.next();
      if (!obj.isCacheMatching(cacheMarker)) {
        removeObject(classID,obj);
        obj.resetOctant();
        if (vizController.getVizConfig().isCleanDeletedModels()) {
          obj.cleanModel();
        }
      }
    }
  }
}
Program: 190478
Project: 190478
Buggy source:
public void resetObjectClass(int classID){
  for (  Octant o : leaves) {
    ParamAVLTree<ModelImpl> tree=o.getTree(classID);
    for (cleanObjectsIterator.setNode(tree); cleanObjectsIterator.hasNext(); ) {
      ModelImpl obj=cleanObjectsIterator.next();
      obj.resetOctant();
      obj.getObj().setModel(null);
      obj.destroy();
    }
    o.clear(classID);
  }
}

Fixed version (ground truth):
public void resetObjectClass(int classID){
  for (  Octant o : leaves) {
    ParamAVLTree<ModelImpl> tree=o.getTree(classID);
    for (cleanObjectsIterator.setNode(tree); cleanObjectsIterator.hasNext(); ) {
      ModelImpl obj=cleanObjectsIterator.next();
      obj.resetOctant();
      obj.cleanModel();
      obj.destroy();
    }
    o.clear(classID);
  }
}
Program: 190480
Project: 190480
Buggy source:
public synchronized void mergeTable(AttributeTable table){
  for (  AttributeColumn column : table.getColumns()) {
    AttributeColumn existingCol=getColumn(column.getId(),column.getType());
    if (existingCol == null) {
      addColumn(column.getId(),column.getTitle(),column.getType(),column.getOrigin(),column.getDefaultValue());
    }
  }
}

Fixed version (ground truth):
public synchronized void mergeTable(AttributeTable table){
  for (  AttributeColumn column : table.getColumns()) {
    AttributeColumn existingCol=getColumn(column);
    if (existingCol == null) {
      addColumn(column.getId(),column.getTitle(),column.getType(),column.getOrigin(),column.getDefaultValue());
    }
  }
}
Program: 190481
Project: 190481
Buggy source:
private Element createNodeColors(Document document,Node n) throws Exception {
  Element colorE=document.createElement("String_Node_Str");
  colorE.setAttribute("String_Node_Str","String_Node_Str" + (n.getNodeData().r() * 255f));
  colorE.setAttribute("String_Node_Str","String_Node_Str" + (n.getNodeData().g() * 255f));
  colorE.setAttribute("String_Node_Str","String_Node_Str" + (n.getNodeData().b() * 255f));
  return colorE;
}

Fixed version (ground truth):
private Element createNodeColors(Document document,Node n) throws Exception {
  Element colorE=document.createElement("String_Node_Str");
  colorE.setAttribute("String_Node_Str","String_Node_Str" + (Math.round(n.getNodeData().r() * 255f)));
  colorE.setAttribute("String_Node_Str","String_Node_Str" + (Math.round(n.getNodeData().g() * 255f)));
  colorE.setAttribute("String_Node_Str","String_Node_Str" + (Math.round(n.getNodeData().b() * 255f)));
  return colorE;
}
Program: 190482
Project: 190482
Buggy source:
public GraphCanvas(){
  super();
  glCanvas=new GLCanvas(getCaps());
  super.initDrawable(glCanvas);
  graphComponent=(Component)glCanvas;
  graphComponent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
  JPopupMenu.setDefaultLightWeightPopupEnabled(false);
  ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
}

Fixed version (ground truth):
public GraphCanvas(){
  super();
  glCanvas=new GLCanvas(getCaps());
  super.initDrawable(glCanvas);
  glCanvas.setMinimumSize(new Dimension(0,0));
  graphComponent=(Component)glCanvas;
  graphComponent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
  JPopupMenu.setDefaultLightWeightPopupEnabled(false);
  ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
}
Program: 190483
Project: 190483
Buggy source:
@Override protected void reshape3DScene(GL gl){
  setCameraPosition(gl,glu);
}

Fixed version (ground truth):
@Override protected void reshape3DScene(GL gl){
  setCameraPosition(gl,glu);
  graphComponent.invalidate();
}
Program: 190484
Project: 190484
Buggy source:
private void setEdgeData(Element dataE,EdgeDraft edgeDraft,String edgeId){
  String dataKey=dataE.getAttribute("String_Node_Str");
  if (dataKey.isEmpty()) {
    report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class,"String_Node_Str",edgeDraft),Issue.Level.SEVERE));
    return;
  }
  String dataValue=dataE.getAttribute("String_Node_Str");
  if (!dataValue.isEmpty()) {
    AttributeColumn column=container.getAttributeManager().getNodeClass().getAttributeColumn(dataKey);
    if (column != null) {
      try {
        Object value=column.getAttributeType().parse(dataValue);
        edgeDraft.addAttributeValue(column,value);
      }
 catch (      Exception e) {
        report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class,"String_Node_Str",dataKey,edgeId,column.getTitle()),Issue.Level.SEVERE));
      }
    }
  }
}

Fixed version (ground truth):
private void setEdgeData(Element dataE,EdgeDraft edgeDraft,String edgeId){
  String dataKey=dataE.getAttribute("String_Node_Str");
  if (dataKey.isEmpty()) {
    report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class,"String_Node_Str",edgeDraft),Issue.Level.SEVERE));
    return;
  }
  String dataValue=dataE.getAttribute("String_Node_Str");
  if (!dataValue.isEmpty()) {
    AttributeColumn column=container.getAttributeManager().getEdgeClass().getAttributeColumn(dataKey);
    if (column != null) {
      try {
        Object value=column.getAttributeType().parse(dataValue);
        edgeDraft.addAttributeValue(column,value);
      }
 catch (      Exception e) {
        report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class,"String_Node_Str",dataKey,edgeId,column.getTitle()),Issue.Level.SEVERE));
      }
    }
  }
}
Program: 190486
Project: 190486
Buggy source:
private void updateNodes(){
  Modeler nodeInit=engine.getModelClasses()[AbstractEngine.CLASS_NODE].getCurrentModeler();
  NodeIterable nodeIterable;
  if (vizConfig.isVisualizeTree()) {
    nodeIterable=graph.getHierarchyTree().getNodes();
  }
 else {
    nodeIterable=graph.getClusteredGraph().getNodes();
  }
  for (  Node node : nodeIterable) {
    if (vizConfig.isVisualizeTree()) {
      node.getNodeData().setX(node.getPre() * 5);
      node.getNodeData().setY(node.getPost() * 5);
      if (graph.getClusteredGraph().isInView(node)) {
        node.getNodeData().setR(1f);
        node.getNodeData().setG(0f);
        node.getNodeData().setB(0f);
      }
 else {
        node.getNodeData().setR(0.2f);
        node.getNodeData().setG(0.2f);
        node.getNodeData().setB(0.2f);
      }
    }
    Model obj=node.getNodeData().getModel();
    if (obj == null) {
      obj=nodeInit.initModel(node.getNodeData());
      engine.addObject(AbstractEngine.CLASS_NODE,(ModelImpl)obj);
      System.out.println("String_Node_Str" + obj);
    }
 else     if (!obj.isValid()) {
      engine.addObject(AbstractEngine.CLASS_NODE,(ModelImpl)obj);
    }
    obj.setCacheMarker(cacheMarker);
    if (modeManager.getMode().equals(ModeManager.AVAILABLE_MODES.HIGHLIGHT)) {
      ModelImpl impl=(ModelImpl)obj;
      if (!node.isVisible()) {
        ColorLayer.layerColor(impl,0.8f,0.8f,0.8f);
      }
    }
  }
}

Fixed version (ground truth):
private void updateNodes(){
  Modeler nodeInit=engine.getModelClasses()[AbstractEngine.CLASS_NODE].getCurrentModeler();
  NodeIterable nodeIterable;
  if (vizConfig.isVisualizeTree()) {
    nodeIterable=graph.getHierarchyTree().getNodes();
  }
 else {
    nodeIterable=graph.getClusteredGraph().getNodes();
  }
  for (  Node node : nodeIterable) {
    if (vizConfig.isVisualizeTree()) {
      node.getNodeData().setX(node.getPre() * 5);
      node.getNodeData().setY(node.getPost() * 5);
      if (graph.getClusteredGraph().isInView(node)) {
        node.getNodeData().setR(1f);
        node.getNodeData().setG(0f);
        node.getNodeData().setB(0f);
      }
 else {
        node.getNodeData().setR(0.2f);
        node.getNodeData().setG(0.2f);
        node.getNodeData().setB(0.2f);
      }
    }
    Model obj=node.getNodeData().getModel();
    if (obj == null) {
      obj=nodeInit.initModel(node.getNodeData());
      engine.addObject(AbstractEngine.CLASS_NODE,(ModelImpl)obj);
    }
 else     if (!obj.isValid()) {
      engine.addObject(AbstractEngine.CLASS_NODE,(ModelImpl)obj);
    }
    obj.setCacheMarker(cacheMarker);
    if (modeManager.getMode().equals(ModeManager.AVAILABLE_MODES.HIGHLIGHT)) {
      ModelImpl impl=(ModelImpl)obj;
      if (!node.isVisible()) {
        ColorLayer.layerColor(impl,0.8f,0.8f,0.8f);
      }
    }
  }
}
Program: 190487
Project: 190487
Buggy source:
public void setup(){
  final VizConfig vizConfig=VizController.getInstance().getVizConfig();
  adjustTextCheckbox.setSelected(vizConfig.isAdjustByText());
  final DefaultComboBoxModel comboModel=new DefaultComboBoxModel();
  final ModelClass nodeClass=VizController.getInstance().getModelClassLibrary().getNodeClass();
  for (  Modeler modeler : nodeClass.getModelers()) {
    comboModel.addElement(modeler);
  }
  comboModel.setSelectedItem(nodeClass.getCurrentModeler());
  shapeCombo.setModel(comboModel);
  shapeCombo.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      nodeClass.setCurrentModeler((Modeler)comboModel.getSelectedItem());
    }
  }
);
}

Fixed version (ground truth):
public void setup(){
  final VizConfig vizConfig=VizController.getInstance().getVizConfig();
  adjustTextCheckbox.setSelected(vizConfig.isAdjustByText());
  adjustTextCheckbox.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent e){
      vizConfig.setAdjustByText(adjustTextCheckbox.isSelected());
    }
  }
);
  final DefaultComboBoxModel comboModel=new DefaultComboBoxModel();
  final ModelClass nodeClass=VizController.getInstance().getModelClassLibrary().getNodeClass();
  for (  Modeler modeler : nodeClass.getModelers()) {
    comboModel.addElement(modeler);
  }
  comboModel.setSelectedItem(nodeClass.getCurrentModeler());
  shapeCombo.setModel(comboModel);
  shapeCombo.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      nodeClass.setCurrentModeler((Modeler)comboModel.getSelectedItem());
    }
  }
);
}
Program: 190488
Project: 190488
Buggy source:
public void setSizeFactor(TextDataImpl text,ModelImpl model){
  float factor=textModel.sizeFactor / FACTOR * model.getCameraDistance();
  text.setSizeFactor(factor);
}

Fixed version (ground truth):
public void setSizeFactor(TextDataImpl text,ModelImpl model){
  float factor=FACTOR * textModel.sizeFactor / model.getCameraDistance();
  text.setSizeFactor(factor);
}
Program: 190489
Project: 190489
Buggy source:
public float getHeight(){
  return (float)line.bounds.getHeight();
}

Fixed version (ground truth):
public float getHeight(){
  return (float)line.bounds.getHeight() * sizeFactor;
}
Program: 190490
Project: 190490
Buggy source:
public float getWidth(){
  return (float)line.bounds.getWidth();
}

Fixed version (ground truth):
public float getWidth(){
  return (float)line.bounds.getWidth() * sizeFactor;
}
Program: 190491
Project: 190491
Buggy source:
public void beginRendering(){
  renderer.begin3DRendering();
}

Fixed version (ground truth):
public void beginRendering(){
  renderer.beginRendering(drawable.getViewportWidth(),drawable.getViewportHeight());
}
Program: 190492
Project: 190492
Buggy source:
public void drawText(ModelImpl objectModel){
  Renderable renderable=objectModel.getObj();
  TextDataImpl textData=(TextDataImpl)renderable.getTextData();
  if (textData != null) {
    model.colorMode.textColor(this,textData,objectModel);
    model.sizeMode.setSizeFactor(textData,objectModel);
    String txt=textData.line.text;
    Rectangle2D r=renderer.getBounds(txt);
    textData.line.setBounds(r);
    float posX=renderable.x() + (float)r.getWidth() / -2 * textData.sizeFactor;
    float posY=renderable.y() + (float)r.getHeight() / -2 * textData.sizeFactor;
    float posZ=renderable.getRadius();
    renderer.draw3D(txt,posX,posY,posZ,textData.sizeFactor);
  }
}

Fixed version (ground truth):
public void drawText(ModelImpl objectModel){
  Renderable renderable=objectModel.getObj();
  TextDataImpl textData=(TextDataImpl)renderable.getTextData();
  if (textData != null) {
    model.colorMode.textColor(this,textData,objectModel);
    model.sizeMode.setSizeFactor(textData,objectModel);
    if (textData.sizeFactor * renderer.getCharWidth('a') < PIXEL_LIMIT) {
      return;
    }
    String txt=textData.line.text;
    Rectangle2D r=renderer.getBounds(txt);
    textData.line.setBounds(r);
    float posX=renderable.getModel().getViewportX() + (float)r.getWidth() / -2 * textData.sizeFactor;
    float posY=renderable.getModel().getViewportY() + (float)r.getHeight() / -2 * textData.sizeFactor;
    renderer.draw3D(txt,posX,posY,0,textData.sizeFactor);
  }
}
Program: 190493
Project: 190493
Buggy source:
public void initArchitecture(){
  vizConfig=VizController.getInstance().getVizConfig();
  drawable=VizController.getInstance().getDrawable();
  model.colorMode=new UniqueColorMode(model);
  model.sizeMode=sizeModes[1];
  model.font=vizConfig.getLabelFont();
  model.nodeColor=vizConfig.getDefaultNodeLabelColor();
  model.edgeColor=vizConfig.getDefaultEdgeLabelColor();
  model.setSelectedOnly(vizConfig.isShowLabelOnSelectedOnly());
  renderer=new Renderer3D();
  renderer.initRenderer();
  model.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent e){
      if (!renderer.getFont().equals(model.getFont())) {
        renderer.setFont(model.getFont());
      }
    }
  }
);
}

Fixed version (ground truth):
public void initArchitecture(){
  vizConfig=VizController.getInstance().getVizConfig();
  drawable=VizController.getInstance().getDrawable();
  model.colorMode=new UniqueColorMode(model);
  model.sizeMode=sizeModes[1];
  model.font=vizConfig.getLabelFont();
  model.nodeColor=vizConfig.getDefaultNodeLabelColor();
  model.edgeColor=vizConfig.getDefaultEdgeLabelColor();
  model.setSelectedOnly(vizConfig.isShowLabelOnSelectedOnly());
  renderer=new Renderer2D();
  renderer.initRenderer();
  model.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent e){
      if (!renderer.getFont().equals(model.getFont())) {
        renderer.setFont(model.getFont());
      }
    }
  }
);
}
Program: 190494
Project: 190494
Buggy source:
public void endRendering(){
  renderer.end3DRendering();
}

Fixed version (ground truth):
public void endRendering(){
  renderer.endRendering();
}
Program: 190495
Project: 190495
Buggy source:
public Dhns newDhns(Workspace workspace){
  Dhns dhns=new Dhns(this);
  workspace.getWorkspaceData().setData(workspaceDataProvider.getWorkspaceDataKey(),dhns);
  dhns.setCentralDynamicGraph(new DynamicGraphImpl(dhns,getClusteredDirectedGraph()));
  return dhns;
}

Fixed version (ground truth):
public Dhns newDhns(Workspace workspace){
  Dhns dhns=new Dhns(this);
  workspace.getWorkspaceData().setData(workspaceDataProvider.getWorkspaceDataKey(),dhns);
  dhns.setCentralDynamicGraph(new DynamicGraphImpl(dhns,getHierarchicalDirectedGraph()));
  return dhns;
}
Program: 190496
Project: 190496
Buggy source:
public DynamicGraphImpl(Dhns dhns,T graph){
  this.graph=graph;
  this.dhns=dhns;
  FilteredGraph filteredGraph=(FilteredGraph)graph;
  filteredGraph.addNodePredicate(new DynamicNodePredicate());
  filteredGraph.addEdgePredicate(new DynamicEdgePredicate());
}

Fixed version (ground truth):
public DynamicGraphImpl(Dhns dhns,T graph){
  this.graph=graph;
  this.dhns=dhns;
  FilteredGraph filteredGraph=(FilteredGraph)graph;
  filteredGraph.addNodePredicate(new DynamicNodePredicate());
  filteredGraph.addEdgePredicate(new DynamicEdgePredicate());
  filteredGraph=(FilteredGraph)((ClusteredGraphImpl)graph).getClusteredGraph();
  filteredGraph.addNodePredicate(new DynamicNodePredicate());
  filteredGraph.addEdgePredicate(new DynamicEdgePredicate());
}
Program: 190497
Project: 190497
Buggy source:
public void generate(final Generator generator){
  String title=generator.getName();
  GeneratorUI ui=generator.getUI();
  if (ui != null) {
    ui.setup(generator);
    DialogDescriptor dd=new DialogDescriptor(ui.getPanel(),title);
    Object result=DialogDisplayer.getDefault().notify(dd);
    if (result != NotifyDescriptor.OK_OPTION) {
      return;
    }
    ui.unsetup();
  }
  final Container container=Lookup.getDefault().lookup(Container.class);
  container.setSource("String_Node_Str" + generator.getName());
  container.setReport(new Report());
  String taskname="String_Node_Str" + generator.getName();
  LongTaskErrorHandler errorHandler=new LongTaskErrorHandler(){
    public void fatalError(    Throwable t){
      NotifyDescriptor.Exception ex=new NotifyDescriptor.Exception(t);
      DialogDisplayer.getDefault().notify(ex);
      t.printStackTrace();
    }
  }
;
  executor.execute(generator,new Runnable(){
    public void run(){
      generator.generate(container.getLoader());
      finishGenerate(container);
    }
  }
,taskname,errorHandler);
}

Fixed version (ground truth):
public void generate(final Generator generator){
  String title=generator.getName();
  GeneratorUI ui=generator.getUI();
  if (ui != null) {
    ui.setup(generator);
    DialogDescriptor dd=new DialogDescriptor(ui.getPanel(),title);
    Object result=DialogDisplayer.getDefault().notify(dd);
    if (result != NotifyDescriptor.OK_OPTION) {
      return;
    }
    ui.unsetup();
  }
  final Container container=Lookup.getDefault().lookup(ContainerFactory.class).newContainer();
  container.setSource("String_Node_Str" + generator.getName());
  container.setReport(new Report());
  String taskname="String_Node_Str" + generator.getName();
  LongTaskErrorHandler errorHandler=new LongTaskErrorHandler(){
    public void fatalError(    Throwable t){
      NotifyDescriptor.Exception ex=new NotifyDescriptor.Exception(t);
      DialogDisplayer.getDefault().notify(ex);
      t.printStackTrace();
    }
  }
;
  executor.execute(generator,new Runnable(){
    public void run(){
      generator.generate(container.getLoader());
      finishGenerate(container);
    }
  }
,taskname,errorHandler);
}
Program: 190499
Project: 190499
Buggy source:
public void generate(ContainerLoader container){
  ContainerLoader.ContainerFactory factory=container.factory();
  for (int i=0; i < numberOfNodes; i++) {
    NodeDraft nodeDraft=factory.newNodeDraft();
    nodeDraft.setLabel("String_Node_Str" + i);
    nodeDraft.setId("String_Node_Str" + i);
    float from=(float)Math.random();
    float to=(float)(from + (1.0 - from) * Math.random());
    nodeDraft.setDynamicFrom(from);
    nodeDraft.setDynamicTo(to);
    container.addNode(nodeDraft);
  }
  for (int i=0; i < numberOfEdges; i++) {
    EdgeDraft edgeDraft=factory.newEdgeDraft();
    int source=(int)(Math.random() * (numberOfNodes));
    int target=(int)(Math.random() * (numberOfNodes));
    edgeDraft.setSource(container.getNode("String_Node_Str" + source));
    edgeDraft.setTarget(container.getNode("String_Node_Str" + target));
    container.addEdge(edgeDraft);
  }
}

Fixed version (ground truth):
public void generate(ContainerLoader container){
  ContainerLoader.DraftFactory factory=container.factory();
  for (int i=0; i < numberOfNodes; i++) {
    NodeDraft nodeDraft=factory.newNodeDraft();
    nodeDraft.setLabel("String_Node_Str" + i);
    nodeDraft.setId("String_Node_Str" + i);
    float from=(float)Math.random();
    float to=(float)(from + (1.0 - from) * Math.random());
    nodeDraft.setDynamicFrom(from);
    nodeDraft.setDynamicTo(to);
    container.addNode(nodeDraft);
  }
  for (int i=0; i < numberOfEdges; i++) {
    EdgeDraft edgeDraft=factory.newEdgeDraft();
    int source=(int)(Math.random() * (numberOfNodes));
    int target=(int)(Math.random() * (numberOfNodes));
    edgeDraft.setSource(container.getNode("String_Node_Str" + source));
    edgeDraft.setTarget(container.getNode("String_Node_Str" + target));
    container.addEdge(edgeDraft);
  }
}
Program: 190500
Project: 190500
Buggy source:
public void generate(ContainerLoader container){
  ContainerLoader.ContainerFactory factory=container.factory();
  NodeDraft nodeA=factory.newNodeDraft();
  nodeA.setLabel("String_Node_Str");
  NodeDraft nodeB=factory.newNodeDraft();
  nodeB.setLabel("String_Node_Str");
  NodeDraft nodeC=factory.newNodeDraft();
  nodeC.setLabel("String_Node_Str");
  NodeDraft nodeD=factory.newNodeDraft();
  nodeD.setLabel("String_Node_Str");
  NodeDraft nodeE=factory.newNodeDraft();
  nodeE.setLabel("String_Node_Str");
  NodeDraft nodeF=factory.newNodeDraft();
  nodeF.setLabel("String_Node_Str");
  NodeDraft nodeG=factory.newNodeDraft();
  nodeG.setLabel("String_Node_Str");
  NodeDraft nodeH=factory.newNodeDraft();
  nodeH.setLabel("String_Node_Str");
  nodeA.addChild(nodeC);
  nodeA.addChild(nodeD);
  nodeA.addChild(nodeH);
  nodeB.addChild(nodeD);
  nodeB.addChild(nodeE);
  nodeB.addChild(nodeF);
  nodeB.addChild(nodeG);
  container.addNode(nodeA);
  container.addNode(nodeB);
  container.addNode(nodeC);
  container.addNode(nodeD);
  container.addNode(nodeE);
  container.addNode(nodeF);
  container.addNode(nodeG);
  container.addNode(nodeH);
}

Fixed version (ground truth):
public void generate(ContainerLoader container){
  ContainerLoader.DraftFactory factory=container.factory();
  NodeDraft nodeA=factory.newNodeDraft();
  nodeA.setLabel("String_Node_Str");
  NodeDraft nodeB=factory.newNodeDraft();
  nodeB.setLabel("String_Node_Str");
  NodeDraft nodeC=factory.newNodeDraft();
  nodeC.setLabel("String_Node_Str");
  NodeDraft nodeD=factory.newNodeDraft();
  nodeD.setLabel("String_Node_Str");
  NodeDraft nodeE=factory.newNodeDraft();
  nodeE.setLabel("String_Node_Str");
  NodeDraft nodeF=factory.newNodeDraft();
  nodeF.setLabel("String_Node_Str");
  NodeDraft nodeG=factory.newNodeDraft();
  nodeG.setLabel("String_Node_Str");
  NodeDraft nodeH=factory.newNodeDraft();
  nodeH.setLabel("String_Node_Str");
  nodeA.addChild(nodeC);
  nodeA.addChild(nodeD);
  nodeA.addChild(nodeH);
  nodeB.addChild(nodeD);
  nodeB.addChild(nodeE);
  nodeB.addChild(nodeF);
  nodeB.addChild(nodeG);
  container.addNode(nodeA);
  container.addNode(nodeB);
  container.addNode(nodeC);
  container.addNode(nodeD);
  container.addNode(nodeE);
  container.addNode(nodeF);
  container.addNode(nodeG);
  container.addNode(nodeH);
}
Program: 190501
Project: 190501
Buggy source:
public ContainerFactory factory();

Fixed version (ground truth):
public DraftFactory factory();
Program: 190502
Project: 190502
Buggy source:
public void executeLayout(){
  layoutRun=new LayoutRun(layout);
}

Fixed version (ground truth):
public void executeLayout(){
  layoutRun=new LayoutRun(layout);
  executor.execute(layoutRun);
}
Program: 190503
Project: 190503
Buggy source:
@Override public void setGraphController(GraphController graphController){
  super.setGraphController(graphController);
  this.graph=graphController.getUndirectedGraph();
}

Fixed version (ground truth):
@Override public void setGraphController(GraphController graphController){
  super.setGraphController(graphController);
  graph=graphController.getUndirectedGraph();
}
Program: 190504
Project: 190504
Buggy source:
public RotateLayout(LayoutBuilder layoutBuilder,double angle){
  super(layoutBuilder);
  this.angle=angle;
}

Fixed version (ground truth):
public RotateLayout(LayoutBuilder layoutBuilder,double angle){
  super(layoutBuilder);
  this.angle=angle;
  initialized=false;
}
Program: 190505
Project: 190505
Buggy source:
public void stopEvent(){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
public void stopEvent(){
  stopButton.setEnabled(false);
  playButton.setEnabled(true);
}
Program: 190506
Project: 190506
Buggy source:
private void initLayoutController(){
  layoutController=Lookup.getDefault().lookup(LayoutController.class);
}

Fixed version (ground truth):
private void initLayoutController(){
  layoutController=Lookup.getDefault().lookup(LayoutController.class);
  layoutController.addObserver(this);
}
Program: 190507
Project: 190507
Buggy source:
public void executeEvent(){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
public void executeEvent(){
  stopButton.setEnabled(true);
  playButton.setEnabled(false);
}
Program: 190508
Project: 190508
Buggy source:
public void setInited(){
  if (!inited) {
    inited=true;
    if (requestAnimation) {
      graphDrawable.display();
      startAnimating();
      requestAnimation=false;
    }
  }
}

Fixed version (ground truth):
public void setInited(){
  if (!inited) {
    inited=true;
    if (requestAnimation) {
      graphDrawable.display();
      startAnimating();
      requestAnimation=false;
    }
  }
 else {
    dataBridge.reset();
    textManager.initArchitecture();
  }
}
Program: 190509
Project: 190509
Buggy source:
@Override public void init(GLAutoDrawable drawable){
  GL gl=drawable.getGL();
  GraphicalConfiguration graphicalConfiguration=new GraphicalConfiguration();
  graphicalConfiguration.checkGeneralCompatibility(gl);
  resizing=false;
  initConfig(gl);
  init(gl);
}

Fixed version (ground truth):
@Override public void init(GLAutoDrawable drawable){
  GL gl=drawable.getGL();
  GraphicalConfiguration graphicalConfiguration=new GraphicalConfiguration();
  graphicalConfiguration.checkGeneralCompatibility(gl);
  viewport=BufferUtil.newIntBuffer(4);
  resizing=false;
  initConfig(gl);
  init(gl);
}
Program: 190510
Project: 190510
Buggy source:
public void reshape(GLAutoDrawable drawable,int x,int y,int width,int height){
  if (!resizing) {
    resizing=true;
    if (viewport.get(2) == width && viewport.get(3) == height) {
      return;
    }
    if (height == 0) {
      height=1;
    }
    if (width == 0) {
      width=1;
    }
    int viewportW=0, viewportH=0, viewportX=width, viewportY=height;
    aspectRatio=(double)width / (double)height;
    viewportH=height;
    viewportW=(int)(height * aspectRatio);
    if (viewportW > width) {
      viewportW=width;
      viewportH=(int)(width * (1 / aspectRatio));
    }
    viewportX=((width - viewportW) / 2);
    viewportY=((height - viewportH) / 2);
    GL gl=drawable.getGL();
    gl.glViewport(viewportX,viewportY,viewportW,viewportH);
    gl.glGetIntegerv(GL.GL_VIEWPORT,viewport);
    gl.glMatrixMode(GL.GL_PROJECTION);
    gl.glLoadIdentity();
    glu.gluPerspective(viewField,aspectRatio,nearDistance,farDistance);
    gl.glGetDoublev(GL.GL_PROJECTION_MATRIX,projMatrix);
    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glLoadIdentity();
    reshape3DScene(drawable.getGL());
    if (DEBUG) {
      System.err.println("String_Node_Str" + gl.glGetString(GL.GL_VENDOR));
      System.err.println("String_Node_Str" + gl.glGetString(GL.GL_RENDERER));
      System.err.println("String_Node_Str" + gl.glGetString(GL.GL_VERSION));
    }
    resizing=false;
  }
}

Fixed version (ground truth):
public void reshape(GLAutoDrawable drawable,int x,int y,int width,int height){
  if (!resizing) {
    if (viewport.get(2) == width && viewport.get(3) == height) {
      return;
    }
    resizing=true;
    if (height == 0) {
      height=1;
    }
    if (width == 0) {
      width=1;
    }
    int viewportW=0, viewportH=0, viewportX=width, viewportY=height;
    aspectRatio=(double)width / (double)height;
    viewportH=height;
    viewportW=(int)(height * aspectRatio);
    if (viewportW > width) {
      viewportW=width;
      viewportH=(int)(width * (1 / aspectRatio));
    }
    viewportX=((width - viewportW) / 2);
    viewportY=((height - viewportH) / 2);
    GL gl=drawable.getGL();
    gl.glViewport(viewportX,viewportY,viewportW,viewportH);
    gl.glGetIntegerv(GL.GL_VIEWPORT,viewport);
    gl.glMatrixMode(GL.GL_PROJECTION);
    gl.glLoadIdentity();
    glu.gluPerspective(viewField,aspectRatio,nearDistance,farDistance);
    gl.glGetDoublev(GL.GL_PROJECTION_MATRIX,projMatrix);
    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glLoadIdentity();
    reshape3DScene(drawable.getGL());
    if (DEBUG) {
      System.err.println("String_Node_Str" + gl.glGetString(GL.GL_VENDOR));
      System.err.println("String_Node_Str" + gl.glGetString(GL.GL_RENDERER));
      System.err.println("String_Node_Str" + gl.glGetString(GL.GL_VERSION));
    }
    resizing=false;
  }
}
Program: 190511
Project: 190511
Buggy source:
private void deleteNode(PreNode node){
  for (DescendantAndSelfIterator itr=new DescendantAndSelfIterator(treeStructure,node,null); itr.hasNext(); ) {
    AbstractNode descendant=itr.next();
    if (descendant.isEnabled()) {
      edgeProcessor.clearMetaEdges(descendant);
    }
    edgeProcessor.clearEdges(descendant);
    if (descendant == descendant.getOriginalNode()) {
      CloneNode cn=descendant.getOriginalNode().getClones();
      while (cn != null) {
        treeStructure.deleteDescendantAndSelf(cn);
        cn=cn.getNext();
      }
    }
 else {
      treeStructure.deleteDescendantAndSelf(descendant.getOriginalNode());
      CloneNode cn=descendant.getOriginalNode().getClones();
      while (cn != null) {
        if (cn != descendant) {
          treeStructure.deleteDescendantAndSelf(cn);
        }
        cn=cn.getNext();
      }
    }
  }
  treeStructure.deleteDescendantAndSelf(node);
}

Fixed version (ground truth):
private void deleteNode(PreNode node){
  for (DescendantAndSelfIterator itr=new DescendantAndSelfIterator(treeStructure,node,null); itr.hasNext(); ) {
    AbstractNode descendant=itr.next();
    if (descendant.isEnabled()) {
      edgeProcessor.clearMetaEdges(descendant);
    }
    edgeProcessor.clearEdges(descendant);
    if (descendant == descendant.getOriginalNode()) {
      CloneNode cn=descendant.getOriginalNode().getClones();
      while (cn != null) {
        unAttachClones(cn);
        treeStructure.deleteDescendantAndSelf(cn);
        cn=cn.getNext();
      }
    }
 else {
      treeStructure.deleteDescendantAndSelf(descendant.getOriginalNode());
      CloneNode cn=descendant.getOriginalNode().getClones();
      while (cn != null) {
        if (cn != descendant) {
          treeStructure.deleteDescendantAndSelf(cn);
        }
        cn=cn.getNext();
      }
    }
  }
  treeStructure.deleteDescendantAndSelf(node);
}
Program: 190512
Project: 190512
Buggy source:
public boolean contains(Node node){
  if (node == null) {
    throw new NullPointerException();
  }
  AbstractNode absNode=(AbstractNode)node;
  readLock();
  if (!absNode.isValid()) {
    return false;
  }
  boolean res=false;
  if (nodeProposition.evaluate(absNode) && dhns.getTreeStructure().getTree().contains(absNode)) {
    res=true;
  }
  readUnlock();
  return res;
}

Fixed version (ground truth):
public boolean contains(Node node){
  if (node == null) {
    throw new NullPointerException();
  }
  AbstractNode absNode=(AbstractNode)node;
  readLock();
  boolean res=false;
  if (absNode.isValid()) {
    if (nodeProposition.evaluate(absNode) && dhns.getTreeStructure().getTree().contains(absNode)) {
      res=true;
    }
  }
  readUnlock();
  return res;
}
Program: 190513
Project: 190513
Buggy source:
@Test public void testCloneRemove(){
  graph1.removeNode(nodeMap.get("String_Node_Str"));
  assertFalse(graph1.contains(nodeMap.get("String_Node_Str")));
  assertEquals(1,((PreNode)nodeMap.get("String_Node_Str")).size);
  assertEquals(2,((PreNode)dhns1.getTreeStructure().root).size);
  assertEquals(2,graph1.getNodeCount());
  setUp();
  graph1.removeNode(nodeMap.get("String_Node_Str"));
  assertFalse(graph1.contains(nodeMap.get("String_Node_Str")));
  assertEquals(1,((PreNode)nodeMap.get("String_Node_Str")).size);
  assertEquals(2,((PreNode)dhns1.getTreeStructure().root).size);
  assertEquals(2,graph1.getNodeCount());
  DhnsGraphController controller=new DhnsGraphController();
  Dhns dhns=controller.getMainDhns();
  ClusteredDirectedGraphImpl graph=new ClusteredDirectedGraphImpl(dhns,false);
  GraphFactoryImpl factory=controller.factory();
  AbstractNode nodeA=factory.newNode();
  AbstractNode nodeB=factory.newNode();
  AbstractNode nodeC=factory.newNode();
  AbstractNode nodeD=factory.newNode();
  graph.addNode(nodeA);
  graph.addNode(nodeB,nodeA);
  graph.addNode(nodeC,nodeA);
  graph.addNode(nodeD,nodeB);
  graph.addNode(nodeD,nodeC);
  graph.addNode(nodeD,nodeA);
  graph.removeNode(nodeD);
  assertFalse(graph1.contains(nodeD));
  assertEquals(2,((PreNode)nodeA).size);
}

Fixed version (ground truth):
@Test public void testCloneRemove(){
  graph1.removeNode(nodeMap.get("String_Node_Str"));
  assertFalse(graph1.contains(nodeMap.get("String_Node_Str")));
  assertEquals(1,((PreNode)nodeMap.get("String_Node_Str")).size);
  assertEquals(2,((PreNode)dhns1.getTreeStructure().root).size);
  assertEquals(2,graph1.getNodeCount());
  setUp();
  graph1.removeNode(nodeMap.get("String_Node_Str"));
  assertFalse(graph1.contains(nodeMap.get("String_Node_Str")));
  assertEquals(1,((PreNode)nodeMap.get("String_Node_Str")).size);
  assertEquals(2,((PreNode)dhns1.getTreeStructure().root).size);
  assertEquals(2,graph1.getNodeCount());
  DhnsGraphController controller=new DhnsGraphController();
  Dhns dhns=controller.getMainDhns();
  ClusteredDirectedGraphImpl graph=new ClusteredDirectedGraphImpl(dhns,false);
  GraphFactoryImpl factory=controller.factory();
  AbstractNode nodeA=factory.newNode();
  AbstractNode nodeB=factory.newNode();
  AbstractNode nodeC=factory.newNode();
  AbstractNode nodeD=factory.newNode();
  graph.addNode(nodeA);
  graph.addNode(nodeB,nodeA);
  graph.addNode(nodeC,nodeA);
  graph.addNode(nodeD,nodeB);
  graph.addNode(nodeD,nodeC);
  graph.addNode(nodeD,nodeA);
  graph.removeNode(nodeD);
  assertFalse(graph.contains(nodeD));
  assertEquals(2,((PreNode)nodeA).size);
  setUp();
  graph1.addNode(nodeMap.get("String_Node_Str"),nodeMap.get("String_Node_Str"));
  AbstractNode cloneAafterE=nodeMap.get("String_Node_Str").getOriginalNode().getClones();
  graph1.addNode(cloneAafterE,nodeMap.get("String_Node_Str"));
  graph1.removeNode(nodeMap.get("String_Node_Str"));
  assertEquals(2,graph1.getNodeCount());
  assertTrue(graph1.contains(nodeMap.get("String_Node_Str")));
  assertTrue(graph1.contains(nodeMap.get("String_Node_Str")));
}
Program: 190514
Project: 190514
Buggy source:
public void logIssue(Issue issue){
  entries.add(new ReportEntry(issue));
  if (criticalException && issue.getLevel().equals(Issue.Level.CRITICAL)) {
    if (issue.getThrowable() != null) {
      throw new RuntimeException(issue.getMessage(),issue.getThrowable());
    }
 else {
      throw new RuntimeException(issue.getMessage());
    }
  }
}

Fixed version (ground truth):
public void logIssue(Issue issue){
  entries.add(new ReportEntry(issue));
  if (issue.getLevel().toInteger() >= exceptionLevel.toInteger()) {
    if (issue.getThrowable() != null) {
      throw new RuntimeException(issue.getMessage(),issue.getThrowable());
    }
 else {
      throw new RuntimeException(issue.getMessage());
    }
  }
}
Program: 190515
Project: 190515
Buggy source:
private void flushToNode(NodeDraftGetter nodeDraft,Node node){
  if (nodeDraft.getColor() != null) {
    node.getNodeData().setR(nodeDraft.getColor().getRed() / 255f);
    node.getNodeData().setG(nodeDraft.getColor().getGreen() / 255f);
    node.getNodeData().setB(nodeDraft.getColor().getBlue() / 255f);
  }
  if (nodeDraft.getLabel() != null) {
    node.getNodeData().setLabel(nodeDraft.getLabel());
  }
  if (nodeDraft.getX() != 0) {
    node.getNodeData().setX(nodeDraft.getX());
  }
 else {
    node.getNodeData().setX((float)((0.01 + Math.random()) * 1000) - 500);
  }
  if (nodeDraft.getY() != 0) {
    node.getNodeData().setY(nodeDraft.getY());
  }
 else {
    node.getNodeData().setY((float)((0.01 + Math.random()) * 1000) - 500);
  }
  if (nodeDraft.getZ() != 0) {
    node.getNodeData().setZ(nodeDraft.getZ());
  }
  if (nodeDraft.getSize() != 0) {
    node.getNodeData().setSize(nodeDraft.getSize());
  }
  if (node.getNodeData().getAttributes() != null) {
    AttributeRow row=(AttributeRow)node.getNodeData().getAttributes();
    for (    AttributeValue val : nodeDraft.getAttributeValues()) {
      row.setValue(val.getColumn(),val.getValue());
    }
  }
}

Fixed version (ground truth):
private void flushToNode(NodeDraftGetter nodeDraft,Node node){
  if (nodeDraft.getColor() != null) {
    node.getNodeData().setR(nodeDraft.getColor().getRed() / 255f);
    node.getNodeData().setG(nodeDraft.getColor().getGreen() / 255f);
    node.getNodeData().setB(nodeDraft.getColor().getBlue() / 255f);
  }
  if (nodeDraft.getLabel() != null) {
    node.getNodeData().setLabel(nodeDraft.getLabel());
  }
  if (nodeDraft.getX() != 0) {
    node.getNodeData().setX(nodeDraft.getX());
  }
 else {
    node.getNodeData().setX((float)((0.01 + Math.random()) * 1000) - 500);
  }
  if (nodeDraft.getY() != 0) {
    node.getNodeData().setY(nodeDraft.getY());
  }
 else {
    node.getNodeData().setY((float)((0.01 + Math.random()) * 1000) - 500);
  }
  if (nodeDraft.getZ() != 0) {
    node.getNodeData().setZ(nodeDraft.getZ());
  }
  if (nodeDraft.getSize() != 0) {
    node.getNodeData().setSize(nodeDraft.getSize());
  }
  if (nodeDraft.getId() != null) {
    node.getNodeData().setId(nodeDraft.getId());
  }
  if (node.getNodeData().getAttributes() != null) {
    AttributeRow row=(AttributeRow)node.getNodeData().getAttributes();
    for (    AttributeValue val : nodeDraft.getAttributeValues()) {
      row.setValue(val.getColumn(),val.getValue());
    }
  }
}
Program: 190516
Project: 190516
Buggy source:
private void updateEdges(){
  Modeler edgeInit=engine.getModelClasses()[AbstractEngine.CLASS_EDGE].getCurrentModeler();
  Modeler arrowInit=engine.getModelClasses()[AbstractEngine.CLASS_ARROW].getCurrentModeler();
  EdgeIterable edgeIterable;
  if (vizConfig.isVisualizeTree()) {
    edgeIterable=graph.getHierarchyTree().getEdges();
  }
 else {
    edgeIterable=graph.getEdges();
  }
  for (  Edge edge : edgeIterable) {
    Model obj=edge.getEdgeData().getModel();
    if (obj == null) {
      obj=edgeInit.initModel(edge.getEdgeData());
      engine.addObject(AbstractEngine.CLASS_EDGE,(ModelImpl)obj);
      if (vizConfig.isShowArrows() && !edge.isSelfLoop()) {
        ModelImpl arrowObj=arrowInit.initModel(edge.getEdgeData());
        engine.addObject(AbstractEngine.CLASS_ARROW,arrowObj);
        arrowObj.setCacheMarker(cacheMarker);
        ((Edge2dModel)obj).setArrow(arrowObj);
      }
    }
 else     if (!obj.isValid()) {
      engine.addObject(AbstractEngine.CLASS_EDGE,(ModelImpl)obj);
      if (vizConfig.isShowArrows()) {
        ModelImpl arrowObj=((Edge2dModel)obj).getArrow();
        engine.addObject(AbstractEngine.CLASS_ARROW,arrowObj);
        arrowObj.setCacheMarker(cacheMarker);
      }
    }
    obj.setCacheMarker(cacheMarker);
  }
}

Fixed version (ground truth):
private void updateEdges(){
  Modeler edgeInit=engine.getModelClasses()[AbstractEngine.CLASS_EDGE].getCurrentModeler();
  Modeler arrowInit=engine.getModelClasses()[AbstractEngine.CLASS_ARROW].getCurrentModeler();
  EdgeIterable edgeIterable;
  if (vizConfig.isVisualizeTree()) {
    edgeIterable=graph.getHierarchyTree().getEdges();
  }
 else {
    edgeIterable=graph.getEdges();
  }
  for (  Edge edge : edgeIterable) {
    Model obj=edge.getEdgeData().getModel();
    if (obj == null) {
      obj=edgeInit.initModel(edge.getEdgeData());
      engine.addObject(AbstractEngine.CLASS_EDGE,(ModelImpl)obj);
      if (vizConfig.isShowArrows() && !edge.isSelfLoop()) {
        ModelImpl arrowObj=arrowInit.initModel(edge.getEdgeData());
        engine.addObject(AbstractEngine.CLASS_ARROW,arrowObj);
        arrowObj.setCacheMarker(cacheMarker);
        ((Edge2dModel)obj).setArrow(arrowObj);
      }
    }
 else     if (!obj.isValid()) {
      engine.addObject(AbstractEngine.CLASS_EDGE,(ModelImpl)obj);
      if (vizConfig.isShowArrows() && !edge.isSelfLoop()) {
        ModelImpl arrowObj=((Edge2dModel)obj).getArrow();
        engine.addObject(AbstractEngine.CLASS_ARROW,arrowObj);
        arrowObj.setCacheMarker(cacheMarker);
      }
    }
    obj.setCacheMarker(cacheMarker);
  }
}
Program: 190517
Project: 190517
Buggy source:
public void executeLayout(final Layout layout){
  executor.execute(new Runnable(){
    public void run(){
      GraphController graphController=Lookup.getDefault().lookup(GraphController.class);
      layout.initAlgo(graphController);
      layout.resetPropertiesValues();
      while (layout.canAlgo()) {
        layout.goAlgo();
      }
      layout.endAlgo();
    }
  }
);
}

Fixed version (ground truth):
public void executeLayout(final Layout layout){
  System.out.println("String_Node_Str");
  executor.execute(new Runnable(){
    public void run(){
      GraphController graphController=Lookup.getDefault().lookup(GraphController.class);
      System.out.println("String_Node_Str");
      layout.initAlgo(graphController);
      layout.resetPropertiesValues();
      while (layout.canAlgo()) {
        layout.goAlgo();
      }
      System.out.println("String_Node_Str");
      layout.endAlgo();
    }
  }
);
}
Program: 190518
Project: 190518
Buggy source:
public LayoutControllerImpl(){
  layouts=new ArrayList<Layout>(Lookup.getDefault().lookupAll(Layout.class));
  executor=Executors.newSingleThreadExecutor();
}

Fixed version (ground truth):
public LayoutControllerImpl(){
  layouts=new ArrayList<LayoutBuilder>(Lookup.getDefault().lookupAll(LayoutBuilder.class));
  executor=Executors.newSingleThreadExecutor();
}
Program: 190519
Project: 190519
Buggy source:
public void run(){
  GraphController graphController=Lookup.getDefault().lookup(GraphController.class);
  layout.initAlgo(graphController);
  layout.resetPropertiesValues();
  while (layout.canAlgo()) {
    layout.goAlgo();
  }
  layout.endAlgo();
}

Fixed version (ground truth):
public void run(){
  GraphController graphController=Lookup.getDefault().lookup(GraphController.class);
  System.out.println("String_Node_Str");
  layout.initAlgo(graphController);
  layout.resetPropertiesValues();
  while (layout.canAlgo()) {
    layout.goAlgo();
  }
  System.out.println("String_Node_Str");
  layout.endAlgo();
}
Program: 190520
Project: 190520
Buggy source:
public GraphFactoryImpl(IDGen idGen,AttributeRowFactory attributesFactory){
  this.idGen=idGen;
}

Fixed version (ground truth):
public GraphFactoryImpl(IDGen idGen,AttributeRowFactory attributesFactory){
  this.idGen=idGen;
  this.attributesFactory=attributesFactory;
}