nus-yam/ex-repair huggingface dataset:
Program: 143136
Project: 143136
Buggy source:
private PreviewSettingsTopComponent(){
  initComponents();
  setName(NbBundle.getMessage(PreviewSettingsTopComponent.class,"String_Node_Str"));
  setToolTipText(NbBundle.getMessage(PreviewSettingsTopComponent.class,"String_Node_Str"));
  PropertySheet ps=new PropertySheet();
  ps.setNodes(new Node[]{new PreviewNode()});
  propertiesPanel.add(ps,BorderLayout.CENTER);
  PreviewUIController.findInstance();
}

Fixed version (ground truth):
private PreviewSettingsTopComponent(){
  initComponents();
  setName(NbBundle.getMessage(PreviewSettingsTopComponent.class,"String_Node_Str"));
  setToolTipText(NbBundle.getMessage(PreviewSettingsTopComponent.class,"String_Node_Str"));
  PropertySheet ps=new PropertySheet();
  ps.setNodes(new Node[]{new PreviewNode()});
  propertiesPanel.add(ps,BorderLayout.CENTER);
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  if (pc.getCurrentWorkspace() != null) {
    refreshButton.setEnabled(true);
  }
  PreviewUIController.findInstance();
}
Program: 143137
Project: 143137
Buggy source:
@Override public void afterDisplay(GL gl,GLU glu){
  if (vizConfig.isSelectionEnable()) {
    gl.glMatrixMode(GL.GL_PROJECTION);
    gl.glPushMatrix();
    gl.glLoadIdentity();
    gl.glOrtho(0,graphDrawable.getViewportWidth(),0,graphDrawable.getViewportHeight(),-1,1);
    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glPushMatrix();
    gl.glLoadIdentity();
    currentSelectionArea.drawArea(gl,glu);
    gl.glMatrixMode(GL.GL_PROJECTION);
    gl.glPopMatrix();
    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glPopMatrix();
  }
  graphIO.trigger();
}

Fixed version (ground truth):
@Override public void afterDisplay(GL gl,GLU glu){
  if (vizConfig.isSelectionEnable() && currentSelectionArea != null) {
    gl.glMatrixMode(GL.GL_PROJECTION);
    gl.glPushMatrix();
    gl.glLoadIdentity();
    gl.glOrtho(0,graphDrawable.getViewportWidth(),0,graphDrawable.getViewportHeight(),-1,1);
    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glPushMatrix();
    gl.glLoadIdentity();
    currentSelectionArea.drawArea(gl,glu);
    gl.glMatrixMode(GL.GL_PROJECTION);
    gl.glPopMatrix();
    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glPopMatrix();
  }
  graphIO.trigger();
}
Program: 143138
Project: 143138
Buggy source:
@Override public boolean isInOctreeLeaf(Octant leaf){
  NodeData nodeFrom=obj.getSource();
  NodeData nodeTo=obj.getTarget();
  if (octants[0] == leaf) {
    if (octants[0] != ((ModelImpl)nodeFrom.getModel()).getOctants()[0]) {
      return false;
    }
  }
 else {
    if (octants[1] != ((ModelImpl)nodeTo.getModel()).getOctants()[0]) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean isInOctreeLeaf(Octant leaf){
  NodeData nodeFrom=obj.getSource();
  NodeData nodeTo=obj.getTarget();
  boolean res=true;
  if (octants[0] == leaf) {
    if (octants[0] != ((ModelImpl)nodeFrom.getModel()).getOctants()[0]) {
      res=false;
    }
  }
  if (octants[1] == leaf) {
    if (octants[1] != ((ModelImpl)nodeTo.getModel()).getOctants()[0]) {
      res=false;
    }
  }
  if (octants[0] != leaf && octants[1] != leaf) {
    res=false;
  }
  return res;
}
Program: 143139
Project: 143139
Buggy source:
@Override public void setOctant(Octant octant){
  if (((ModelImpl)obj.getSource().getModel()).getOctants()[0] == octant) {
    octants[0]=octant;
  }
 else {
    octants[1]=octant;
  }
}

Fixed version (ground truth):
@Override public void setOctant(Octant octant){
  if (((ModelImpl)obj.getSource().getModel()).getOctants()[0] == octant) {
    octants[0]=octant;
  }
  if (((ModelImpl)obj.getTarget().getModel()).getOctants()[0] == octant) {
    octants[1]=octant;
  }
}
Program: 143140
Project: 143140
Buggy source:
public void displayOctantInfo(GL gl,GLU glu){
  GLUT glut=new GLUT();
  float quantum=size / 2;
  float height=15;
  gl.glPushMatrix();
  gl.glTranslatef(posX - quantum,posY + quantum - height,posZ + quantum);
  gl.glScalef(0.1f,0.1f,0.1f);
  gl.glColor4f(0.0f,0.0f,1.0f,1.0f);
  glut.glutStrokeString(GLUT.STROKE_MONO_ROMAN,"String_Node_Str" + objectsCount);
  gl.glPopMatrix();
  int i=0;
  for (  ParamAVLTree<ModelImpl> p : modelClasses) {
    height+=15;
    gl.glPushMatrix();
    gl.glTranslatef(posX - quantum,posY + quantum - height,posZ + quantum);
    gl.glScalef(0.1f,0.1f,0.1f);
    gl.glColor4f(0.0f,0.0f,1.0f,1.0f);
    glut.glutStrokeString(GLUT.STROKE_MONO_ROMAN,"String_Node_Str" + (i++) + "String_Node_Str"+ p.getCount());
    gl.glPopMatrix();
  }
}

Fixed version (ground truth):
public void displayOctantInfo(GL gl,GLU glu){
  GLUT glut=new GLUT();
  float quantum=size / 2;
  float height=15;
  gl.glPushMatrix();
  gl.glTranslatef(posX - quantum,posY + quantum - height,posZ + quantum);
  gl.glScalef(0.1f,0.1f,0.1f);
  gl.glColor4f(0.0f,0.0f,1.0f,1.0f);
  glut.glutStrokeString(GLUT.STROKE_MONO_ROMAN,"String_Node_Str" + octantID);
  gl.glPopMatrix();
  height+=15;
  gl.glPushMatrix();
  gl.glTranslatef(posX - quantum,posY + quantum - height,posZ + quantum);
  gl.glScalef(0.1f,0.1f,0.1f);
  gl.glColor4f(0.0f,0.0f,1.0f,1.0f);
  glut.glutStrokeString(GLUT.STROKE_MONO_ROMAN,"String_Node_Str" + objectsCount);
  gl.glPopMatrix();
  int i=0;
  for (  ParamAVLTree<ModelImpl> p : modelClasses) {
    height+=15;
    gl.glPushMatrix();
    gl.glTranslatef(posX - quantum,posY + quantum - height,posZ + quantum);
    gl.glScalef(0.1f,0.1f,0.1f);
    gl.glColor4f(0.0f,0.0f,1.0f,1.0f);
    glut.glutStrokeString(GLUT.STROKE_MONO_ROMAN,"String_Node_Str" + (i++) + "String_Node_Str"+ p.getCount());
    gl.glPopMatrix();
  }
}
Program: 143141
Project: 143141
Buggy source:
public void addObject(int classID,ModelImpl obj){
  Octant[] octants=obj.getOctants();
  boolean manualAdd=true;
  for (int i=0; i < octants.length; i++) {
    Octant o=obj.getOctants()[i];
    if (o != null) {
      o.addObject(classID,obj);
      manualAdd=false;
    }
  }
  if (manualAdd) {
    root.addObject(classID,obj);
  }
}

Fixed version (ground truth):
public void addObject(int classID,ModelImpl obj){
  Octant[] octants=obj.getOctants();
  boolean manualAdd=true;
  for (int i=0; i < octants.length; i++) {
    Octant o=octants[i];
    if (o != null) {
      o.addObject(classID,obj);
      manualAdd=false;
    }
  }
  if (manualAdd) {
    root.addObject(classID,obj);
  }
}
Program: 143142
Project: 143142
Buggy source:
public HierarchicalDirectedGraphImplFiltered(Dhns dhns,GraphStructure graphStructure,View view){
  super(dhns,graphStructure);
  this.view=(ViewImpl)view;
}

Fixed version (ground truth):
public HierarchicalDirectedGraphImplFiltered(Dhns dhns,GraphStructure graphStructure,View view){
  super(dhns,graphStructure,view);
  this.delegate=new HierarchicalDirectedGraphImpl(dhns,structure);
}
Program: 143143
Project: 143143
Buggy source:
@Override public Edge getEdge(Node source,Node target){
  readLock();
  view.checkUpdate();
  AbstractNode sourceNode=checkNode(source);
  AbstractNode targetNode=checkNode(target);
  Predicate<AbstractEdge> edgePredicate=view.getClusteredLayerEdgePredicate();
  AbstractEdge res=sourceNode.getEdgesOutTree().getItem(targetNode.getNumber());
  if (!edgePredicate.evaluate(res)) {
    res=null;
  }
  readUnlock();
  return res;
}

Fixed version (ground truth):
@Override public Edge getEdge(Node source,Node target){
  view.checkUpdate();
  AbstractNode sourceNode=checkNode(source);
  AbstractNode targetNode=checkNode(target);
  Predicate<AbstractEdge> edgePredicate=view.getClusteredLayerEdgePredicate();
  AbstractEdge res=sourceNode.getEdgesOutTree().getItem(targetNode.getNumber());
  if (!edgePredicate.evaluate(res)) {
    res=null;
  }
  return res;
}
Program: 143144
Project: 143144
Buggy source:
@Override public HierarchicalDirectedGraphImpl copy(Dhns dhns,GraphStructure structure,View view){
  return new HierarchicalDirectedGraphImpl(dhns,structure);
}

Fixed version (ground truth):
@Override public HierarchicalDirectedGraphImplFiltered copy(Dhns dhns,GraphStructure structure,View view){
  return new HierarchicalDirectedGraphImplFiltered(dhns,structure,view);
}
Program: 143145
Project: 143145
Buggy source:
public ImmutableTreeNode wrap(AbstractNodeIterator iterator){
  nodeTree=new SimpleAVLTree();
  TreeNodeImpl root=new TreeNodeImpl(treeStructure.getRoot());
  nodeTree.add(root);
  for (; iterator.hasNext(); ) {
    AbstractNode node=iterator.next();
    TreeNodeImpl n=new TreeNodeImpl(node);
    if (node.parent != null) {
      TreeNodeImpl parent=(TreeNodeImpl)nodeTree.get(node.parent.getNumber());
      n.parent=parent;
      parent.children.add(n);
    }
    nodeTree.add(n);
  }
  for (  AVLItem item : nodeTree) {
    TreeNodeImpl node=(TreeNodeImpl)item;
    node.toArray();
  }
  return root;
}

Fixed version (ground truth):
public ImmutableTreeNode wrap(AbstractNodeIterator iterator){
  nodeTree=new SimpleAVLTree();
  TreeNodeImpl root=new TreeNodeImpl(treeStructure.getRoot());
  nodeTree.add(root);
  for (; iterator.hasNext(); ) {
    AbstractNode node=iterator.next();
    TreeNodeImpl n=new TreeNodeImpl(node);
    if (node.parent != null) {
      TreeNodeImpl parent=(TreeNodeImpl)nodeTree.get(node.parent.getNumber());
      if (parent != null) {
        n.parent=parent;
        parent.children.add(n);
      }
 else {
        n.parent=root;
        root.children.add(n);
      }
    }
    nodeTree.add(n);
  }
  for (  AVLItem item : nodeTree) {
    TreeNodeImpl node=(TreeNodeImpl)item;
    node.toArray();
  }
  return root;
}
Program: 143146
Project: 143146
Buggy source:
private ViewNodeTree createViewNodeTree(NodePredicate predicate){
  ViewNodeTree viewNodeTree=new ViewNodeTree();
  TreeIterator treeIterator=new TreeIterator(graphStructure.getStructure(),false,(Predicate)predicate);
  for (; treeIterator.hasNext(); ) {
    AbstractNode node=treeIterator.next();
    viewNodeTree.add(node);
  }
  return viewNodeTree;
}

Fixed version (ground truth):
private ViewNodeTree createViewNodeTree(Predicate<AbstractNode> predicate){
  ViewNodeTree viewNodeTree=new ViewNodeTree();
  TreeIterator treeIterator=new TreeIterator(graphStructure.getStructure(),false,predicate);
  for (; treeIterator.hasNext(); ) {
    AbstractNode node=treeIterator.next();
    viewNodeTree.add(node);
  }
  return viewNodeTree;
}
Program: 143147
Project: 143147
Buggy source:
public void filter(Predicate predicate){
  if (hierarchyLayerNodeTree == null) {
    NodePredicate nodePredicate=(NodePredicate)Tautology.instance;
    if (predicate instanceof NodePredicate) {
      nodePredicate=(NodePredicate)predicate;
    }
    hierarchyLayerNodeTree=createViewNodeTree(nodePredicate);
    Predicate<AbstractEdge> edgePredicate=Tautology.instance;
    if (predicate instanceof EdgePredicate) {
      edgePredicate=predicate;
    }
    hierarchyLayerEdgeTree=createViewEdgeTree(edgePredicate,hierarchyLayerNodeTree);
    hierarchyLayerNodeTreePredicate=new HierarchyLayerNodePredicate();
    hierarchyLayerEdgeTreePredicate=new HierarchyLayerEdgePredicate();
  }
 else {
    if (predicate instanceof NodePredicate) {
      filterViewNodeTree(hierarchyLayerNodeTree,(NodePredicate)predicate);
    }
 else {
      filterViewEdgeTree(hierarchyLayerEdgeTree,(EdgePredicate)predicate);
    }
  }
}

Fixed version (ground truth):
public void filter(Predicate predicate){
  if (hierarchyLayerNodeTree == null) {
    Predicate<AbstractNode> nodePredicate=Tautology.instance;
    if (predicate instanceof NodePredicate) {
      nodePredicate=predicate;
    }
    hierarchyLayerNodeTree=createViewNodeTree(nodePredicate);
    Predicate<AbstractEdge> edgePredicate=Tautology.instance;
    if (predicate instanceof EdgePredicate) {
      edgePredicate=predicate;
    }
    hierarchyLayerEdgeTree=createViewEdgeTree(edgePredicate,hierarchyLayerNodeTree);
    hierarchyLayerNodeTreePredicate=new HierarchyLayerNodePredicate();
    hierarchyLayerEdgeTreePredicate=new HierarchyLayerEdgePredicate();
  }
 else {
    if (predicate instanceof NodePredicate) {
      filterViewNodeTree(hierarchyLayerNodeTree,(NodePredicate)predicate);
    }
 else {
      filterViewEdgeTree(hierarchyLayerEdgeTree,(EdgePredicate)predicate);
    }
  }
}
Program: 143150
Project: 143150
Buggy source:
@Test public void testFiltering(){
  graphGlobal.getView().addPredicate(new DegreePredicate(3,5));
  Node[] actual=graphGlobal.getNodes().toArray();
  for (int i=0; i < actual.length; i++) {
    System.out.println(actual[i].getId());
  }
}

Fixed version (ground truth):
@Test public void testFiltering(){
}
Program: 143151
Project: 143151
Buggy source:
private void updateEdges(){
  Modeler edgeInit=engine.getModelClasses()[AbstractEngine.CLASS_EDGE].getCurrentModeler();
  Modeler arrowInit=engine.getModelClasses()[AbstractEngine.CLASS_ARROW].getCurrentModeler();
  EdgeIterable edgeIterable;
  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);
  }
}

Fixed version (ground truth):
private void updateEdges(){
}
Program: 143152
Project: 143152
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: 143153
Project: 143153
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: 143154
Project: 143154
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: 143156
Project: 143156
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: 143157
Project: 143157
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: 143158
Project: 143158
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: 143159
Project: 143159
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: 143161
Project: 143161
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: 143162
Project: 143162
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: 143163
Project: 143163
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: 143164
Project: 143164
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: 143165
Project: 143165
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: 143167
Project: 143167
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: 143168
Project: 143168
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: 143169
Project: 143169
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: 143170
Project: 143170
Buggy source:
public float getHeight(){
  return (float)line.bounds.getHeight();
}

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

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

Fixed version (ground truth):
public void beginRendering(){
  renderer.beginRendering(drawable.getViewportWidth(),drawable.getViewportHeight());
}
Program: 143173
Project: 143173
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: 143174
Project: 143174
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: 143175
Project: 143175
Buggy source:
public void endRendering(){
  renderer.end3DRendering();
}

Fixed version (ground truth):
public void endRendering(){
  renderer.endRendering();
}
Program: 143176
Project: 143176
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: 143177
Project: 143177
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: 143178
Project: 143178
Buggy source:
public void executeLayout(){
  layoutRun=new LayoutRun(layout);
}

Fixed version (ground truth):
public void executeLayout(){
  layoutRun=new LayoutRun(layout);
  executor.execute(layoutRun);
}
Program: 143179
Project: 143179
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: 143180
Project: 143180
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: 143181
Project: 143181
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: 143182
Project: 143182
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: 143183
Project: 143183
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: 143184
Project: 143184
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: 143186
Project: 143186
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: 143187
Project: 143187
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: 143188
Project: 143188
Buggy source:
public ContainerFactory factory();

Fixed version (ground truth):
public DraftFactory factory();
Program: 143189
Project: 143189
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: 143190
Project: 143190
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: 143191
Project: 143191
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;
  }
}