nus-yam/ex-repair huggingface dataset:
Program: 190392
Project: 190392
Buggy source:
public boolean isAdjacent(Edge edge1,Edge edge2){
  if (edge1 == edge2) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  checkEdge(edge1);
  checkEdge(edge2);
  return edge1.getSource() == edge2.getSource() || edge1.getSource() == edge2.getTarget() || edge1.getTarget() == edge2.getSource() || edge1.getTarget() == edge2.getTarget();
}

Fixed version (ground truth):
public boolean isAdjacent(Edge edge1,Edge edge2){
  if (edge1 == edge2) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  AbstractEdge absEdge1=checkEdge(edge1);
  AbstractEdge absEdge2=checkEdge(edge2);
  return absEdge1.getSource(view.getViewId()) == absEdge2.getSource(view.getViewId()) || absEdge1.getSource(view.getViewId()) == absEdge2.getTarget(view.getViewId()) || absEdge1.getTarget(view.getViewId()) == absEdge2.getSource(view.getViewId()) || absEdge1.getTarget(view.getViewId()) == absEdge2.getTarget(view.getViewId());
}
Program: 190393
Project: 190393
Buggy source:
public boolean isSelfLoop(Edge edge){
  checkEdge(edge);
  return edge.getSource() == edge.getTarget();
}

Fixed version (ground truth):
public boolean isSelfLoop(Edge edge){
  AbstractEdge absEdge=checkEdge(edge);
  return absEdge.getSource(view.getViewId()) == absEdge.getTarget(view.getViewId());
}
Program: 190394
Project: 190394
Buggy source:
public Node getOpposite(Node node,Edge edge){
  checkNode(node);
  checkEdge(edge);
  if (edge.getSource() == node) {
    return edge.getTarget();
  }
 else   if (edge.getTarget() == node) {
    return edge.getSource();
  }
  throw new IllegalArgumentException("String_Node_Str");
}

Fixed version (ground truth):
public Node getOpposite(Node node,Edge edge){
  checkNode(node);
  AbstractEdge absEdge=checkEdge(edge);
  if (absEdge.getSource(view.getViewId()) == node) {
    return absEdge.getTarget();
  }
 else   if (absEdge.getTarget(view.getViewId()) == node) {
    return absEdge.getSource(view.getViewId());
  }
  throw new IllegalArgumentException("String_Node_Str");
}
Program: 190395
Project: 190395
Buggy source:
public void transform(Transformer transformer){
  AbstractTransformer abstractTransformer=(AbstractTransformer)transformer;
  Ranking ranking=abstractTransformer.getRanking();
  RankingResultImpl rankingResult=new RankingResultImpl();
  rankingResult.transformer=transformer;
  rankingResult.ranking=ranking;
  Graph graph=Lookup.getDefault().lookup(GraphController.class).getModel().getGraph();
  if (ranking instanceof NodeRanking) {
    for (    Node node : graph.getNodes().toArray()) {
      Object rank=ranking.getValue(node);
      Object result=null;
      if (rank != null) {
        float normalizedValue=ranking.normalize(rank);
        if (transformer.isInBounds(normalizedValue)) {
          result=transformer.transform(node,normalizedValue);
        }
      }
      rankingResult.addResult(node,rank,result);
    }
  }
 else {
    for (    Edge edge : graph.getEdges().toArray()) {
      Object rank=ranking.getValue(edge);
      Object result=null;
      if (rank != null) {
        float normalizedValue=ranking.normalize(rank);
        if (transformer.isInBounds(normalizedValue)) {
          result=transformer.transform(edge,normalizedValue);
        }
      }
      rankingResult.addResult(edge,rank,result);
    }
  }
  rankingEventBus.publishResults(rankingResult);
}

Fixed version (ground truth):
public void transform(Transformer transformer){
  AbstractTransformer abstractTransformer=(AbstractTransformer)transformer;
  Ranking ranking=abstractTransformer.getRanking();
  RankingResultImpl rankingResult=new RankingResultImpl();
  rankingResult.transformer=transformer;
  rankingResult.ranking=ranking;
  Graph graph=Lookup.getDefault().lookup(GraphController.class).getModel().getGraphVisible();
  if (ranking instanceof NodeRanking) {
    ((AbstractRanking)ranking).setGraph(graph);
    for (    Node node : graph.getNodes().toArray()) {
      Object rank=ranking.getValue(node);
      Object result=null;
      if (rank != null) {
        float normalizedValue=ranking.normalize(rank);
        if (transformer.isInBounds(normalizedValue)) {
          result=transformer.transform(node,normalizedValue);
        }
      }
      rankingResult.addResult(node,rank,result);
    }
  }
 else {
    ((AbstractRanking)ranking).setGraph(graph);
    for (    Edge edge : graph.getEdges().toArray()) {
      Object rank=ranking.getValue(edge);
      Object result=null;
      if (rank != null) {
        float normalizedValue=ranking.normalize(rank);
        if (transformer.isInBounds(normalizedValue)) {
          result=transformer.transform(edge,normalizedValue);
        }
      }
      rankingResult.addResult(edge,rank,result);
    }
  }
  rankingEventBus.publishResults(rankingResult);
}
Program: 190396
Project: 190396
Buggy source:
public EdgeRanking[] getEdgeRanking(){
  AttributeController attributeController=Lookup.getDefault().lookup(AttributeController.class);
  Graph graph=Lookup.getDefault().lookup(GraphController.class).getModel().getGraph();
  List<Ranking> rankingList=new ArrayList<Ranking>();
  for (  AttributeColumn column : attributeController.getModel().getEdgeTable().getColumns()) {
    if (RankingFactory.isNumberColumn(column)) {
      EdgeRanking r=RankingFactory.getEdgeAttributeRanking(column,graph);
      if (r.getMinimumValue() != null && r.getMaximumValue() != null && !r.getMinimumValue().equals(r.getMaximumValue())) {
        rankingList.add(r);
      }
    }
  }
  return rankingList.toArray(new EdgeRanking[0]);
}

Fixed version (ground truth):
public EdgeRanking[] getEdgeRanking(){
  AttributeController attributeController=Lookup.getDefault().lookup(AttributeController.class);
  Graph graph=Lookup.getDefault().lookup(GraphController.class).getModel().getGraphVisible();
  List<Ranking> rankingList=new ArrayList<Ranking>();
  for (  AttributeColumn column : attributeController.getModel().getEdgeTable().getColumns()) {
    if (RankingFactory.isNumberColumn(column)) {
      EdgeRanking r=RankingFactory.getEdgeAttributeRanking(column,graph);
      if (r.getMinimumValue() != null && r.getMaximumValue() != null && !r.getMinimumValue().equals(r.getMaximumValue())) {
        rankingList.add(r);
      }
    }
  }
  return rankingList.toArray(new EdgeRanking[0]);
}
Program: 190401
Project: 190401
Buggy source:
public void init(){
  PropertyChangeEvent evt=new PropertyChangeEvent(this,"String_Node_Str",null,null);
  for (  PropertyChangeListener l : listeners) {
    l.propertyChange(evt);
  }
}

Fixed version (ground truth):
public void init(){
  final PropertyChangeEvent evt=new PropertyChangeEvent(this,"String_Node_Str",null,null);
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      for (      PropertyChangeListener l : listeners) {
        l.propertyChange(evt);
      }
    }
  }
);
}
Program: 190402
Project: 190402
Buggy source:
public double getAttributeValue(int from,int to);

Fixed version (ground truth):
/** 
 * @param from
 * @param to
 * @return
 */
public double getAttributeValue(int from,int to);
Program: 190403
Project: 190403
Buggy source:
public void setRangeFromRealValues(double from,double to);

Fixed version (ground truth):
/** 
 * Set the range using real values
 * @param from
 * @param to
 */
public void setRangeFromRealValues(double from,double to);
Program: 190404
Project: 190404
Buggy source:
public double getFromFloat();

Fixed version (ground truth):
/** 
 * @return
 */
public double getFromFloat();
Program: 190405
Project: 190405
Buggy source:
public double getFromValue();

Fixed version (ground truth):
/** 
 * @return
 */
public double getFromValue();
Program: 190406
Project: 190406
Buggy source:
public double getMaxValue();

Fixed version (ground truth):
/** 
 * @return
 */
public double getMaxValue();
Program: 190407
Project: 190407
Buggy source:
public void setToValue(double to);

Fixed version (ground truth):
/** 
 * @param to
 */
public void setToValue(double to);
Program: 190408
Project: 190408
Buggy source:
public void setToFloat(double to);

Fixed version (ground truth):
/** 
 * @param to
 */
public void setToFloat(double to);
Program: 190409
Project: 190409
Buggy source:
public void addListener(TimelineModelListener listener);

Fixed version (ground truth):
/** 
 * @param listener
 */
public void addListener(TimelineModelListener listener);
Program: 190410
Project: 190410
Buggy source:
public String getLastAttributeLabel();

Fixed version (ground truth):
/** 
 * @return
 */
public String getLastAttributeLabel();
Program: 190411
Project: 190411
Buggy source:
public double getRangeSizeFloat();

Fixed version (ground truth):
/** 
 * @return
 */
public double getRangeSizeFloat();
Program: 190412
Project: 190412
Buggy source:
public void removeListener(TimelineModelListener listener);

Fixed version (ground truth):
/** 
 * @param listener
 */
public void removeListener(TimelineModelListener listener);
Program: 190413
Project: 190413
Buggy source:
public double getTotalSize();

Fixed version (ground truth):
/** 
 * @return
 */
public double getTotalSize();
Program: 190414
Project: 190414
Buggy source:
public void setFromValue(double from);

Fixed version (ground truth):
/** 
 * @param from
 */
public void setFromValue(double from);
Program: 190415
Project: 190415
Buggy source:
public void setRangeFromFloat(double from,double to);

Fixed version (ground truth):
/** 
 * @param from
 * @param to
 */
public void setRangeFromFloat(double from,double to);
Program: 190416
Project: 190416
Buggy source:
public void setMaxValue(double max);

Fixed version (ground truth):
/** 
 * @param max
 */
public void setMaxValue(double max);
Program: 190417
Project: 190417
Buggy source:
public double getMinValue();

Fixed version (ground truth):
/** 
 * @return
 */
public double getMinValue();
Program: 190418
Project: 190418
Buggy source:
public double getRangeSizeValue();

Fixed version (ground truth):
/** 
 * @return
 */
public double getRangeSizeValue();
Program: 190419
Project: 190419
Buggy source:
public void setMinMax(double min,double max);

Fixed version (ground truth):
/** 
 * @param min
 * @param max
 */
public void setMinMax(double min,double max);
Program: 190420
Project: 190420
Buggy source:
public double getToValue();

Fixed version (ground truth):
/** 
 * @return
 */
public double getToValue();
Program: 190421
Project: 190421
Buggy source:
public String getAttributeLabel(int from,int to);

Fixed version (ground truth):
/** 
 * @param from
 * @param to
 * @return
 */
public String getAttributeLabel(int from,int to);
Program: 190422
Project: 190422
Buggy source:
public TimeInterval getTimeInterval();

Fixed version (ground truth):
/** 
 * @return
 */
public TimeInterval getTimeInterval();
Program: 190423
Project: 190423
Buggy source:
public void setFromFloat(double from);

Fixed version (ground truth):
/** 
 * @param from
 */
public void setFromFloat(double from);
Program: 190424
Project: 190424
Buggy source:
public double getToFloat();

Fixed version (ground truth):
/** 
 * @return
 */
public double getToFloat();
Program: 190425
Project: 190425
Buggy source:
public void setMinValue(double min);

Fixed version (ground truth):
/** 
 * @param min
 */
public void setMinValue(double min);
Program: 190426
Project: 190426
Buggy source:
public void mouseDragged(MouseEvent evt){
  int x=evt.getX();
  double w=getWidth();
  int r=settings.selection.visibleHookWidth;
  double sf=(model.getFromFloat() * w);
  double st=(model.getToFloat() * w);
  if (currentState == TimelineState.IDLE) {
    if (inRange(x,(int)sf - 1,(int)sf + r + 1)) {
      highlightedComponent=HighlightedComponent.LEFT_HOOK;
      currentState=TimelineState.RESIZE_FROM;
    }
 else     if (inRange(x,(int)sf + r,(int)st - r)) {
      highlightedComponent=HighlightedComponent.CENTER_HOOK;
      currentState=TimelineState.MOVING;
    }
 else     if (inRange(x,(int)st - r - 1,(int)st + 1)) {
      highlightedComponent=HighlightedComponent.RIGHT_HOOK;
      currentState=TimelineState.RESIZE_TO;
    }
  }
  double delta=0;
  if (mousex != null) {
    delta=x - mousex;
  }
  mousex=x;
switch (currentState) {
case RESIZE_FROM:
    if ((sf + delta <= 0)) {
      sf=0;
    }
 else     if (Math.abs(st - sf + delta) > settings.selection.minimalWidth) {
      sf+=delta;
    }
 else {
    }
  break;
case RESIZE_TO:
if ((st + delta >= w)) {
  st=w;
}
 else if (Math.abs((st + delta) - sf) > settings.selection.minimalWidth) {
  st+=delta;
}
break;
case MOVING:
if ((sf + delta <= 0)) {
sf=0;
}
 else if (st + delta >= w) {
st=w;
}
 else {
sf+=delta;
st+=delta;
}
break;
}
if (model != null && w != 0) {
model.setRangeFromFloat(sf * (1.0 / w),st * (1.0 / w));
}
this.repaint();
}

Fixed version (ground truth):
public void mouseDragged(MouseEvent evt){
  if (model == null)   return;
  int x=evt.getX();
  double w=getWidth();
  int r=settings.selection.visibleHookWidth;
  double sf=(model.getFromFloat() * w);
  double st=(model.getToFloat() * w);
  if (currentState == TimelineState.IDLE) {
    if (inRange(x,(int)sf - 1,(int)sf + r + 1)) {
      highlightedComponent=HighlightedComponent.LEFT_HOOK;
      currentState=TimelineState.RESIZE_FROM;
    }
 else     if (inRange(x,(int)sf + r,(int)st - r)) {
      highlightedComponent=HighlightedComponent.CENTER_HOOK;
      currentState=TimelineState.MOVING;
    }
 else     if (inRange(x,(int)st - r - 1,(int)st + 1)) {
      highlightedComponent=HighlightedComponent.RIGHT_HOOK;
      currentState=TimelineState.RESIZE_TO;
    }
  }
  double delta=0;
  if (mousex != null) {
    delta=x - mousex;
  }
  mousex=x;
switch (currentState) {
case RESIZE_FROM:
    if ((sf + delta <= 0)) {
      sf=0;
    }
 else     if (Math.abs(st - sf + delta) > settings.selection.minimalWidth) {
      sf+=delta;
    }
 else {
    }
  break;
case RESIZE_TO:
if ((st + delta >= w)) {
  st=w;
}
 else if (Math.abs((st + delta) - sf) > settings.selection.minimalWidth) {
  st+=delta;
}
break;
case MOVING:
if ((sf + delta <= 0)) {
sf=0;
}
 else if (st + delta >= w) {
st=w;
}
 else {
sf+=delta;
st+=delta;
}
break;
}
if (model != null && w != 0) {
model.setRangeFromFloat(sf * (1.0 / w),st * (1.0 / w));
}
this.repaint();
}
Program: 190427
Project: 190427
Buggy source:
private void paintSmallGraduations(Graphics2D g2d,int x,int y,int numOfGrads){
  int width=y - x;
  int height=getHeight();
  int leftMargin=x;
  int topMargin=height - settings.informations.fontSize - 2;
  for (int i=1; i < numOfGrads; i++) {
    int xi=leftMargin + i * (width / numOfGrads);
    g2d.drawLine(xi,topMargin,xi,height - settings.informations.textBottomMargin);
  }
}

Fixed version (ground truth):
private void paintSmallGraduations(Graphics2D g2d,int x,int y,int numOfGrads){
  int width=y - x;
  int height=getHeight();
  int leftMargin=x;
  int topMargin=height - settings.informations.fontSize - 2;
  int unitSize=3;
  if (numOfGrads > (width / unitSize)) {
    return;
  }
  for (int i=1; i < numOfGrads; i++) {
    int xi=leftMargin + i * (width / numOfGrads);
    g2d.drawLine(xi,topMargin,xi,height - settings.informations.textBottomMargin);
  }
}
Program: 190429
Project: 190429
Buggy source:
public synchronized void setRangeFromRealValues(double from,double to){
  if (from >= to)   return;
  fromValue=from;
  toValue=to;
  filter.setValue(new Range(from,to));
}

Fixed version (ground truth):
public synchronized void setRangeFromRealValues(double from,double to){
  if (from >= to)   return;
  fromValue=from;
  toValue=to;
  if (filter != null)   filter.setValue(new Range(from,to));
}
Program: 190430
Project: 190430
Buggy source:
public synchronized void setToValue(double to){
  if (to <= fromValue)   return;
  toValue=to;
}

Fixed version (ground truth):
public synchronized void setToValue(double to){
  toValue=to;
}
Program: 190431
Project: 190431
Buggy source:
public synchronized void setToFloat(double to){
  if (to <= toFloat)   return;
  toFloat=to;
  setToValue(getMinValue() + getFromFloat() * getTotalSize());
}

Fixed version (ground truth):
public synchronized void setToFloat(double to){
  toFloat=to;
  setToValue(getMinValue() + getFromFloat() * getTotalSize());
  if (filter != null)   filter.setValue(new Range(getFromValue(),getToValue()));
}
Program: 190432
Project: 190432
Buggy source:
public synchronized void setFromValue(double from){
  if (from >= toValue)   return;
  fromValue=from;
}

Fixed version (ground truth):
public synchronized void setFromValue(double from){
  fromValue=from;
}
Program: 190433
Project: 190433
Buggy source:
public synchronized void setMaxValue(double max){
  if (max <= minValue)   return;
  this.maxValue=max;
  setFromValue(getMaxValue() + getToFloat() * getTotalSize());
}

Fixed version (ground truth):
public synchronized void setMaxValue(double max){
  this.maxValue=max;
  setFromValue(getMaxValue() + getToFloat() * getTotalSize());
}
Program: 190434
Project: 190434
Buggy source:
public synchronized void setFromFloat(double from){
  if (from >= toFloat)   return;
  fromFloat=from;
  setFromValue(getMinValue() + getFromFloat() * getTotalSize());
}

Fixed version (ground truth):
public synchronized void setFromFloat(double from){
  fromFloat=from;
  setFromValue(getMinValue() + getFromFloat() * getTotalSize());
  if (filter != null)   filter.setValue(new Range(getFromValue(),getToValue()));
}
Program: 190435
Project: 190435
Buggy source:
public synchronized void setMinValue(double min){
  if (min >= maxValue)   return;
  this.minValue=min;
  setFromValue(getMinValue() + getFromFloat() * getTotalSize());
}

Fixed version (ground truth):
public synchronized void setMinValue(double min){
  this.minValue=min;
  setFromValue(getMinValue() + getFromFloat() * getTotalSize());
}
Program: 190436
Project: 190436
Buggy source:
private void afterTaking(){
  WindowManager.getDefault().getMainWindow().setCursor(Cursor.getDefaultCursor());
  if (finishedMessage && file != null) {
    String msg=NbBundle.getMessage(ScreenshotMaker.class,"String_Node_Str",file.getName());
    JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),msg,NbBundle.getMessage(ScreenshotMaker.class,"String_Node_Str"),JOptionPane.INFORMATION_MESSAGE);
  }
}

Fixed version (ground truth):
private void afterTaking(){
  WindowManager.getDefault().getMainWindow().setCursor(Cursor.getDefaultCursor());
  if (finishedMessage && file != null) {
    final String msg=NbBundle.getMessage(ScreenshotMaker.class,"String_Node_Str",file.getName());
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),msg,NbBundle.getMessage(ScreenshotMaker.class,"String_Node_Str"),JOptionPane.INFORMATION_MESSAGE);
      }
    }
);
  }
}
Program: 190437
Project: 190437
Buggy source:
public void fatalError(Throwable t){
  Logger.getLogger("String_Node_Str").log(Level.SEVERE,"String_Node_Str",t.getCause());
}

Fixed version (ground truth):
public void fatalError(Throwable t){
  Logger.getLogger("String_Node_Str").log(Level.SEVERE,"String_Node_Str",t.getCause() != null ? t.getCause() : t);
}
Program: 190438
Project: 190438
Buggy source:
public LayoutModelImpl(){
  listeners=new ArrayList<PropertyChangeListener>();
  savedProperties=new HashMap<LayoutPropertyKey,Object>();
  executor=new LongTaskExecutor(true,"String_Node_Str",5);
  executor.setLongTaskListener(new LongTaskListener(){
    public void taskFinished(    LongTask task){
      setRunning(false);
    }
  }
);
  executor.setDefaultErrorHandler(new LongTaskErrorHandler(){
    public void fatalError(    Throwable t){
      Logger.getLogger("String_Node_Str").log(Level.SEVERE,"String_Node_Str",t.getCause());
    }
  }
);
}

Fixed version (ground truth):
public LayoutModelImpl(){
  listeners=new ArrayList<PropertyChangeListener>();
  savedProperties=new HashMap<LayoutPropertyKey,Object>();
  executor=new LongTaskExecutor(true,"String_Node_Str",5);
  executor.setLongTaskListener(new LongTaskListener(){
    public void taskFinished(    LongTask task){
      setRunning(false);
    }
  }
);
  executor.setDefaultErrorHandler(new LongTaskErrorHandler(){
    public void fatalError(    Throwable t){
      Logger.getLogger("String_Node_Str").log(Level.SEVERE,"String_Node_Str",t.getCause() != null ? t.getCause() : t);
    }
  }
);
}
Program: 190439
Project: 190439
Buggy source:
public void writeLock(){
  dhns.getWriteLock().lock();
}

Fixed version (ground truth):
public void writeLock(){
  if (SwingUtilities.isEventDispatchThread()) {
    System.err.println("String_Node_Str");
  }
  dhns.getWriteLock().lock();
}
Program: 190440
Project: 190440
Buggy source:
public void readLock(){
  dhns.getReadLock().lock();
}

Fixed version (ground truth):
public void readLock(){
  if (SwingUtilities.isEventDispatchThread()) {
    System.err.println("String_Node_Str");
  }
  dhns.getReadLock().lock();
}
Program: 190441
Project: 190441
Buggy source:
public NodeDataTable(){
  outlineTable=new Outline();
  quickFilter=new QuickFilter(){
    public boolean accept(    Object value){
      if (value == null) {
        return false;
      }
      if (value instanceof ImmutableTreeNode) {
        return pattern.matcher(((ImmutableTreeNode)value).getNode().getNodeData().getLabel()).find();
      }
      return pattern.matcher(value.toString()).find();
    }
  }
;
  outlineTable.addMouseListener(new PopupAdapter());
}

Fixed version (ground truth):
public NodeDataTable(){
  outlineTable=new Outline();
  quickFilter=new QuickFilter(){
    public boolean accept(    Object value){
      if (value == null) {
        return false;
      }
      if (value instanceof ImmutableTreeNode) {
        String label=((ImmutableTreeNode)value).getNode().getNodeData().getLabel();
        if (label != null) {
          return pattern.matcher(label).find();
        }
        return false;
      }
      return pattern.matcher(value.toString()).find();
    }
  }
;
  outlineTable.addMouseListener(new PopupAdapter());
}
Program: 190442
Project: 190442
Buggy source:
public boolean accept(Object value){
  if (value == null) {
    return false;
  }
  if (value instanceof ImmutableTreeNode) {
    return pattern.matcher(((ImmutableTreeNode)value).getNode().getNodeData().getLabel()).find();
  }
  return pattern.matcher(value.toString()).find();
}

Fixed version (ground truth):
public boolean accept(Object value){
  if (value == null) {
    return false;
  }
  if (value instanceof ImmutableTreeNode) {
    String label=((ImmutableTreeNode)value).getNode().getNodeData().getLabel();
    if (label != null) {
      return pattern.matcher(label).find();
    }
    return false;
  }
  return pattern.matcher(value.toString()).find();
}
Program: 190443
Project: 190443
Buggy source:
private void refreshPie(){
  if (model.getSelectedPartition() != null) {
    pieLink.setEnabled(true);
    if (model.isPie()) {
      pieLink.setText(HIDE_PIE);
      partitionPie=new PartitionPie();
      partitionPie.setup(model.getSelectedPartition());
      remove(centerScrollPane);
      add(partitionPie,BorderLayout.CENTER);
      revalidate();
      repaint();
      return;
    }
 else {
      pieLink.setText(SHOW_PIE);
    }
  }
 else {
    pieLink.setText(SHOW_PIE);
    pieLink.setEnabled(false);
  }
  if (!isAncestorOf(centerScrollPane)) {
    remove(partitionPie);
    add(centerScrollPane,BorderLayout.CENTER);
    revalidate();
    repaint();
  }
}

Fixed version (ground truth):
private void refreshPie(){
  if (model.getSelectedPartition() != null) {
    pieLink.setEnabled(true);
    if (model.isPie()) {
      pieLink.setText(HIDE_PIE);
      partitionPie=new PartitionPie();
      SwingUtilities.invokeLater(new Runnable(){
        public void run(){
          partitionPie.setup(model.getSelectedPartition());
          remove(centerScrollPane);
          add(partitionPie,BorderLayout.CENTER);
          revalidate();
          repaint();
        }
      }
);
      return;
    }
 else {
      pieLink.setText(SHOW_PIE);
    }
  }
 else {
    pieLink.setText(SHOW_PIE);
    pieLink.setEnabled(false);
  }
  if (!isAncestorOf(centerScrollPane)) {
    remove(partitionPie);
    add(centerScrollPane,BorderLayout.CENTER);
    revalidate();
    repaint();
  }
}
Program: 190444
Project: 190444
Buggy source:
private void setSelectedLayout(LayoutBuilder builder){
  controller.setLayout(model.getLayout(builder));
}

Fixed version (ground truth):
private void setSelectedLayout(LayoutBuilder builder){
  controller.setLayout(builder != null ? model.getLayout(builder) : null);
}
Program: 190445
Project: 190445
Buggy source:
/** 
 * Constructor.
 * @param parent     the parent graph of the edge
 * @param thickness  the edge's thickness
 * @param node1      the edge's node 1
 * @param node2      the edge's node 2
 * @param label      the edge's label
 * @param labelSize  the edge's label size
 */
protected DirectedEdgeImpl(GraphImpl parent,float thickness,NodeImpl node1,NodeImpl node2,String label,float labelSize){
  super(parent,thickness,node1,node2,label,labelSize);
  arrows.add(new EdgeArrowB1Out(this));
  arrows.add(new EdgeArrowB2In(this));
  miniLabels.add(new EdgeMiniLabelB1(this));
  miniLabels.add(new EdgeMiniLabelB2(this));
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param parent     the parent graph of the edge
 * @param thickness  the edge's thickness
 * @param node1      the edge's node 1
 * @param node2      the edge's node 2
 * @param label      the edge's label
 * @param labelSize  the edge's label size
 */
protected DirectedEdgeImpl(GraphImpl parent,float thickness,NodeImpl node1,NodeImpl node2,String label,float labelSize){
  super(parent,thickness,node1,node2,label,labelSize);
  arrows.add(new EdgeArrowB1Out(this));
  arrows.add(new EdgeArrowB2In(this));
  if (node1.hasLabel()) {
    miniLabels.add(new EdgeMiniLabelB1(this));
  }
  if (node2.hasLabel()) {
    miniLabels.add(new EdgeMiniLabelB2(this));
  }
}
Program: 190446
Project: 190446
Buggy source:
/** 
 * Constructor.
 * @param parent     the parent graph of the edge
 * @param thickness  the edge's thickness
 * @param node1      the edge's node 1
 * @param node2      the edge's node 2
 * @param label      the edge's label
 * @param labelSize  the edge's label size
 */
protected EdgeImpl(GraphImpl parent,float thickness,NodeImpl node1,NodeImpl node2,String label,float labelSize){
  super(parent,thickness);
  this.node1=node1;
  this.node2=node2;
  direction=new Vector(this.node2.getPosition());
  direction.sub(new Vector(this.node1.getPosition()));
  length=direction.mag();
  direction.normalize();
  genCurves();
  if (null != label) {
    this.label=new EdgeLabelImpl(this,label,labelSize);
  }
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param parent     the parent graph of the edge
 * @param thickness  the edge's thickness
 * @param node1      the edge's node 1
 * @param node2      the edge's node 2
 * @param label      the edge's label
 * @param labelSize  the edge's label size
 */
protected EdgeImpl(GraphImpl parent,float thickness,NodeImpl node1,NodeImpl node2,String label,float labelSize){
  super(parent,thickness);
  this.node1=node1;
  this.node2=node2;
  direction=new Vector(this.node2.getPosition());
  direction.sub(new Vector(this.node1.getPosition()));
  length=direction.mag();
  direction.normalize();
  genCurves();
  if (null != label) {
    this.label=new EdgeLabelImpl(this,label,labelSize);
  }
 else {
    this.label=null;
  }
}
Program: 190447
Project: 190447
Buggy source:
/** 
 * Constructor.
 * @param parent  the parent graph
 * @param label   the node label
 * @param x       the 'x' position component
 * @param y       the 'y' position component
 * @param radius  the node radius
 * @param r       the red color component
 * @param g       the green color component
 * @param b       the blue color component
 */
public NodeImpl(GraphImpl parent,float x,float y,float radius,String label,float labelSize,float r,float g,float b){
  this.parent=parent;
  this.position=new PointImpl(x,y);
  this.radius=radius;
  this.originalColor=new SimpleColor(r,g,b,0);
  this.label=new NodeLabelImpl(this,label,labelSize);
  this.labelBorder=new NodeLabelBorderImpl(this);
  Vector topLeftVector=new Vector(position);
  topLeftVector.sub(radius,radius,0);
  topLeftPosition=new PointImpl(topLeftVector);
  Vector bottomRightVector=new Vector(position);
  bottomRightVector.add(radius,radius,0);
  bottomRightPosition=new PointImpl(bottomRightVector);
  getNodeSupervisor().addNode(this);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param parent  the parent graph
 * @param label   the node label
 * @param x       the 'x' position component
 * @param y       the 'y' position component
 * @param radius  the node radius
 * @param r       the red color component
 * @param g       the green color component
 * @param b       the blue color component
 */
public NodeImpl(GraphImpl parent,float x,float y,float radius,String label,float labelSize,float r,float g,float b){
  this.parent=parent;
  this.position=new PointImpl(x,y);
  this.radius=radius;
  this.originalColor=new SimpleColor(r,g,b,0);
  if (label != null) {
    this.label=new NodeLabelImpl(this,label,labelSize);
    this.labelBorder=new NodeLabelBorderImpl(this);
  }
 else {
    this.label=null;
    this.labelBorder=null;
  }
  Vector topLeftVector=new Vector(position);
  topLeftVector.sub(radius,radius,0);
  topLeftPosition=new PointImpl(topLeftVector);
  Vector bottomRightVector=new Vector(position);
  bottomRightVector.add(radius,radius,0);
  bottomRightPosition=new PointImpl(bottomRightVector);
  getNodeSupervisor().addNode(this);
}
Program: 190448
Project: 190448
Buggy source:
/** 
 * Colors the given node label border with the node label border colorizer.
 * @param node  the node label border to color
 */
private void colorNodeLabelBorder(NodeLabelBorderImpl nodeLabelBorder){
  nodeLabelBorderColorizer.color(nodeLabelBorder);
}

Fixed version (ground truth):
/** 
 * Colors the given node label border with the node label border colorizer.
 * @param node  the node label border to color
 */
private void colorNodeLabelBorder(NodeLabelBorderImpl nodeLabelBorder){
  if (nodeLabelBorder != null) {
    nodeLabelBorderColorizer.color(nodeLabelBorder);
  }
}
Program: 190449
Project: 190449
Buggy source:
/** 
 * Updates the node label by shortening its value or by reverting its original one.
 */
private void updateLabelValue(NodeLabelImpl nodeLabel){
  if (shortenLabelsFlag) {
    shortenNodeLabel(nodeLabel);
  }
 else {
    revertLabel(nodeLabel);
  }
}

Fixed version (ground truth):
/** 
 * Updates the node label by shortening its value or by reverting its original one.
 */
private void updateLabelValue(NodeLabelImpl nodeLabel){
  if (nodeLabel != null) {
    if (shortenLabelsFlag) {
      shortenNodeLabel(nodeLabel);
    }
 else {
      revertLabel(nodeLabel);
    }
  }
}
Program: 190450
Project: 190450
Buggy source:
/** 
 * Colors the given node label with the node label colorizer.
 * @param node  the node label to color
 */
private void colorNodeLabel(NodeLabelImpl nodeLabel){
  nodeLabelColorizer.color(nodeLabel);
}

Fixed version (ground truth):
/** 
 * Colors the given node label with the node label colorizer.
 * @param node  the node label to color
 */
private void colorNodeLabel(NodeLabelImpl nodeLabel){
  if (nodeLabel != null) {
    nodeLabelColorizer.color(nodeLabel);
  }
}
Program: 190451
Project: 190451
Buggy source:
private void walkFile(BufferedReader reader) throws Exception {
  int cptLine=0;
  while (reader.ready() && !cancel) {
    String line=reader.readLine();
    if (!isComment(line)) {
      String[] tokens=line.split("String_Node_Str");
      if (tokens.length > 0) {
        if (tokens[0].equals("String_Node_Str")) {
          parseNodes(tokens);
        }
 else         if (tokens[0].equals("String_Node_Str")) {
          parseEdge(tokens,cptLine);
        }
      }
    }
    cptLine++;
  }
}

Fixed version (ground truth):
private void walkFile(BufferedReader reader) throws Exception {
  int cptLine=0;
  int state=0;
  while (reader.ready() && !cancel) {
    String line=reader.readLine();
    if (!isComment(line)) {
      String[] tokens=line.split("String_Node_Str");
      if (tokens.length > 0) {
        if (state == 0) {
          if (tokens[0].equals("String_Node_Str")) {
            parseNodes(tokens);
          }
 else           if (tokens[0].equals("String_Node_Str")) {
            parseEdge(tokens,cptLine);
          }
 else           if (tokens[0].equals("String_Node_Str")) {
            state=1;
          }
        }
        if (state == 1) {
          return;
        }
      }
    }
    cptLine++;
  }
}
Program: 190452
Project: 190452
Buggy source:
/** 
 * Colors the label of the supervised nodes with the node label colorizer.
 */
private void colorNodeLabels(){
  for (  NodeImpl n : supervisedNodes) {
    colorNodeLabel(n.getLabel());
  }
}

Fixed version (ground truth):
/** 
 * Colors the label of the supervised nodes with the node label colorizer.
 */
private void colorNodeLabels(){
  for (  NodeImpl n : supervisedNodes) {
    if (n.hasLabel()) {
      colorNodeLabel(n.getLabel());
    }
  }
}
Program: 190453
Project: 190453
Buggy source:
/** 
 * Shortens the labels of the supervised nodes.
 */
private void shortenNodeLabels(){
  for (  NodeImpl n : supervisedNodes) {
    shortenNodeLabel(n.getLabel());
  }
}

Fixed version (ground truth):
/** 
 * Shortens the labels of the supervised nodes.
 */
private void shortenNodeLabels(){
  for (  NodeImpl n : supervisedNodes) {
    if (n.hasLabel()) {
      shortenNodeLabel(n.getLabel());
    }
  }
}
Program: 190454
Project: 190454
Buggy source:
/** 
 * Constructor.
 */
public PreviewControllerImpl(){
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  pc.addWorkspaceListener(new WorkspaceListener(){
    public void initialize(    Workspace workspace){
    }
    public void select(    Workspace workspace){
      updateFlag=true;
    }
    public void unselect(    Workspace workspace){
    }
    public void close(    Workspace workspace){
    }
    public void disable(){
      graphSheet=null;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
public PreviewControllerImpl(){
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  if (pc.getCurrentWorkspace() != null) {
    updateFlag=true;
  }
  pc.addWorkspaceListener(new WorkspaceListener(){
    public void initialize(    Workspace workspace){
    }
    public void select(    Workspace workspace){
      updateFlag=true;
    }
    public void unselect(    Workspace workspace){
    }
    public void close(    Workspace workspace){
    }
    public void disable(){
      graphSheet=null;
    }
  }
);
}
Program: 190455
Project: 190455
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: 190456
Project: 190456
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: 190457
Project: 190457
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: 190458
Project: 190458
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: 190459
Project: 190459
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: 190460
Project: 190460
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: 190461
Project: 190461
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: 190462
Project: 190462
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: 190465
Project: 190465
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: 190466
Project: 190466
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: 190467
Project: 190467
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: 190468
Project: 190468
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: 190469
Project: 190469
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: 190470
Project: 190470
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(){
}