nus-yam/ex-repair huggingface dataset:
Program: 11604
Project: 11604
Buggy source:
/** 
 * This implementation of removeNotify is to get around an inconvenience where this canvas is removed from one component hierarchy and added to another.  Technically, this will destroy the context.  But since Glimpse makes significant use of buffers and textures, this data needs to come along.  Therefore, we force shared contexts to preserve the information as we transition to another canvas.  This helps for docking frameworks and moving the canvas seamlessly. <p> We could override the removeNotify method of the enclosed GLCanvas, but then we'd have to take care of removing it from drawing into the screen. We could create a new GLCanvas directly shared with the old, instead of a pbuffer, but you have to draw into a new context at least once to share all the information, and you can't draw into a GLCanvas until it's physically displayed. </p>
 */
@Override public void removeNotify(){
  if (tempDrawable == null) {
    tempDrawable=GLDrawableFactory.getFactory().createGLPbuffer(glCanvas.getChosenGLCapabilities(),null,10,10,glCanvas.getContext());
  }
  attachAllGLListeners(tempDrawable);
  tempDrawable.display();
  boolean autoSwap=glCanvas.getAutoSwapBufferMode();
  remove(this.glCanvas);
  super.removeNotify();
  this.glCanvas=new GLCanvas(tempDrawable.getChosenGLCapabilities(),null,tempDrawable.getContext(),null);
  this.glCanvas.setAutoSwapBufferMode(autoSwap);
  attachAllGLListeners(glCanvas);
  add(this.glCanvas,BorderLayout.CENTER);
}

Fixed version (ground truth):
/** 
 * This implementation of removeNotify is to get around an inconvenience where this canvas is removed from one component hierarchy and added to another.  Technically, this will destroy the context.  But since Glimpse makes significant use of buffers and textures, this data needs to come along.  Therefore, we force shared contexts to preserve the information as we transition to another canvas.  This helps for docking frameworks and moving the canvas seamlessly. <p> We could override the removeNotify method of the enclosed GLCanvas, but then we'd have to take care of removing it from drawing into the screen. We could create a new GLCanvas directly shared with the old, instead of a pbuffer, but you have to draw into a new context at least once to share all the information, and you can't draw into a GLCanvas until it's physically displayed. </p>
 */
@Override public void removeNotify(){
  if (offscreenCanvas == null) {
    offscreenCanvas=new FrameBufferGlimpseCanvas(getWidth(),getHeight(),glCanvas.getContext());
  }
  offscreenCanvas.removeAllLayouts();
  for (  GlimpseLayout layout : layoutManager.getLayoutList()) {
    offscreenCanvas.addLayout(layout);
  }
  offscreenCanvas.paint();
  boolean autoSwap=glCanvas.getAutoSwapBufferMode();
  remove(this.glCanvas);
  super.removeNotify();
  this.glCanvas=new GLCanvas(null,null,offscreenCanvas.getGLContext(),null);
  this.glCanvas.setAutoSwapBufferMode(autoSwap);
  attachAllGLListeners(glCanvas);
  add(this.glCanvas,BorderLayout.CENTER);
}
Program: 11605
Project: 11605
Buggy source:
@Override public void updateLayout(int index){
  Orientation orient=getStackedPlot().getOrientation();
  int plotCount=getStackedPlot().getAllPlots().size();
  int plotSpacing=getPlotSpacing();
  int size=isVisible() ? getSize() : 0;
  boolean grow=isGrow();
  if (index == plotCount - 1 && orient == HORIZONTAL)   plotSpacing=0;
 else   if (index == 0 && orient == VERTICAL)   plotSpacing=0;
  String layoutData=null;
  if (orient == VERTICAL) {
    if (grow) {
      String format="String_Node_Str";
      layoutData=String.format(format,0,index,plotSpacing);
    }
 else {
      String format="String_Node_Str";
      layoutData=String.format(format,0,index,size,plotSpacing);
    }
  }
 else   if (orient == HORIZONTAL) {
    if (grow) {
      String format="String_Node_Str";
      layoutData=String.format(format,index,0,plotSpacing);
    }
 else {
      String format="String_Node_Str";
      layoutData=String.format(format,index,0,size,plotSpacing);
    }
  }
  getLayout().setLayoutData(layoutData);
}

Fixed version (ground truth):
@Override public void updateLayout(int index){
  Orientation orient=getStackedPlot().getOrientation();
  int plotCount=getStackedPlot().getAllPlots().size();
  int plotSpacing=getPlotSpacing();
  int plotSize=getSize();
  if (!isVisible()) {
    plotSpacing=0;
    plotSize=0;
  }
  if (index == plotCount - 1 && orient == HORIZONTAL)   plotSpacing=0;
 else   if (index == 0 && orient == VERTICAL)   plotSpacing=0;
  String layoutData=null;
  if (orient == VERTICAL) {
    if (isGrow()) {
      String format="String_Node_Str";
      layoutData=String.format(format,0,index,plotSpacing);
    }
 else {
      String format="String_Node_Str";
      layoutData=String.format(format,0,index,plotSize,plotSpacing);
    }
  }
 else   if (orient == HORIZONTAL) {
    if (isGrow()) {
      String format="String_Node_Str";
      layoutData=String.format(format,index,0,plotSpacing);
    }
 else {
      String format="String_Node_Str";
      layoutData=String.format(format,index,0,plotSize,plotSpacing);
    }
  }
  getLayout().setLayoutData(layoutData);
}
Program: 11606
Project: 11606
Buggy source:
public GroupInfo getGroupById(Object id){
  this.lock.lock();
  try {
    return getGroup(getPlot(id));
  }
  finally {
    this.lock.unlock();
  }
}

Fixed version (ground truth):
public GroupInfo getGroupById(Object groupId){
  this.lock.lock();
  try {
    return (GroupInfo)getPlot(groupId);
  }
  finally {
    this.lock.unlock();
  }
}
Program: 11607
Project: 11607
Buggy source:
@Override public int getSizePixels(List<PlotInfo> list,int index){
  GroupInfo group=plot.getGroup(info);
  if (group != null && !group.isExpanded()) {
    return 0;
  }
 else {
    return info.getSize();
  }
}

Fixed version (ground truth):
@Override public int getSizePixels(List<PlotInfo> list,int index){
  GroupInfo group=plot.getGroupForChild(info);
  if (group != null && !group.isExpanded()) {
    return 0;
  }
 else {
    return info.getSize();
  }
}
Program: 11609
Project: 11609
Buggy source:
public GroupInfoImpl(PlotInfo group,Collection<? extends PlotInfo> subplots){
  this.group=group;
  this.subplots=new HashSet<PlotInfo>();
  this.subplots.addAll(subplots);
  for (  PlotInfo plot : subplots) {
    childParentMap.put(plot,this);
  }
  this.label=new GroupLabelPainter(group.getId());
  this.group.getLayout().addPainter(this.label);
  this.group.setSize(22);
  this.expanded=true;
  GlimpseLayout layout=this.group.getLayout();
  layout.setEventConsumer(false);
  layout.setEventGenerator(true);
  layout.addGlimpseMouseListener(new GlimpseMouseAdapter(){
    @Override public void mousePressed(    GlimpseMouseEvent event){
      int x=event.getScreenPixelsX();
      if (x < labelLayoutSize) {
        setExpanded(!expanded);
        event.setHandled(true);
      }
    }
  }
);
}

Fixed version (ground truth):
public GroupInfoImpl(PlotInfo group,Collection<? extends PlotInfo> subplots){
  this.group=group;
  this.subplots=new LinkedHashSet<PlotInfo>();
  this.subplots.addAll(subplots);
  for (  PlotInfo plot : subplots) {
    childParentMap.put(plot,this);
  }
  this.label=new GroupLabelPainter(group.getId());
  this.group.getLayout().addPainter(this.label);
  this.group.setSize(22);
  this.expanded=true;
  GlimpseLayout layout=this.group.getLayout();
  layout.setEventConsumer(false);
  layout.setEventGenerator(true);
  layout.addGlimpseMouseListener(new GlimpseMouseAdapter(){
    @Override public void mousePressed(    GlimpseMouseEvent event){
      int x=event.getScreenPixelsX();
      if (x < labelLayoutSize) {
        setExpanded(!expanded);
        event.setHandled(true);
      }
    }
  }
);
}
Program: 11610
Project: 11610
Buggy source:
public static void showWithSwing(GlimpseLayoutProvider layoutProviderA,GlimpseLayoutProvider layoutProviderB) throws Exception {
  Jogular.initJogl();
  SwingGlimpseCanvas leftPanel=new SwingGlimpseCanvas(true);
  leftPanel.addLayout(layoutProviderA.getLayout());
  SwingGlimpseCanvas rightPanel=new SwingGlimpseCanvas(true,leftPanel.getGLContext());
  rightPanel.addLayout(layoutProviderB.getLayout());
  RepaintManager repaintManager=new RepaintManager();
  repaintManager.addGlimpseCanvas(leftPanel);
  repaintManager.addGlimpseCanvas(rightPanel);
  repaintManager.start();
  JFrame rightFrame=new JFrame("String_Node_Str");
  rightFrame.add(rightPanel);
  rightFrame.pack();
  rightFrame.setSize(800,800);
  rightFrame.setLocation(800,0);
  rightFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  rightFrame.setVisible(true);
  JFrame leftFrame=new JFrame("String_Node_Str");
  leftFrame.add(leftPanel);
  leftFrame.pack();
  leftFrame.setSize(800,800);
  leftFrame.setLocation(0,0);
  leftFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  leftFrame.setVisible(true);
  return;
}

Fixed version (ground truth):
public static void showWithSwing(GlimpseLayoutProvider layoutProviderA,GlimpseLayoutProvider layoutProviderB) throws Exception {
  Jogular.initJogl();
  SwingGlimpseCanvas leftPanel=new SwingGlimpseCanvas(true);
  leftPanel.addLayout(layoutProviderA.getLayout());
  SwingGlimpseCanvas rightPanel=new SwingGlimpseCanvas(true,leftPanel.getGLContext());
  rightPanel.addLayout(layoutProviderB.getLayout());
  RepaintManager repaintManager=new SwingRepaintManager();
  repaintManager.addGlimpseCanvas(leftPanel);
  repaintManager.addGlimpseCanvas(rightPanel);
  repaintManager.start();
  JFrame rightFrame=new JFrame("String_Node_Str");
  rightFrame.add(rightPanel);
  rightFrame.pack();
  rightFrame.setSize(800,800);
  rightFrame.setLocation(800,0);
  rightFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  rightFrame.setVisible(true);
  JFrame leftFrame=new JFrame("String_Node_Str");
  leftFrame.add(leftPanel);
  leftFrame.pack();
  leftFrame.setSize(800,800);
  leftFrame.setLocation(0,0);
  leftFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  leftFrame.setVisible(true);
  return;
}
Program: 11611
Project: 11611
Buggy source:
public static void main(String[] args) throws Exception {
  Jogular.initJogl();
  final SwingGlimpseCanvas canvas=new SwingGlimpseCanvas(true);
  GlimpseLayout plot=buildPlot(canvas);
  canvas.addLayout(plot);
  canvas.setLookAndFeel(new SwingLookAndFeel());
  final RepaintManager manager=RepaintManager.newRepaintManager(canvas);
  JFrame frame=new JFrame("String_Node_Str");
  frame.add(canvas);
  frame.pack();
  frame.setSize(800,800);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setVisible(true);
  Runtime.getRuntime().addShutdownHook(new Thread(){
    @Override public void run(){
      canvas.dispose(manager);
    }
  }
);
  return;
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  Jogular.initJogl();
  final SwingGlimpseCanvas canvas=new SwingGlimpseCanvas(true);
  GlimpseLayout plot=buildPlot(canvas);
  canvas.addLayout(plot);
  canvas.setLookAndFeel(new SwingLookAndFeel());
  final RepaintManager manager=SwingRepaintManager.newRepaintManager(canvas);
  JFrame frame=new JFrame("String_Node_Str");
  frame.add(canvas);
  frame.pack();
  frame.setSize(800,800);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setVisible(true);
  Runtime.getRuntime().addShutdownHook(new Thread(){
    @Override public void run(){
      canvas.dispose(manager);
    }
  }
);
  return;
}
Program: 11612
Project: 11612
Buggy source:
public BlackAndWhiteLookAndFeel(){
  map.put(CROSSHAIR_COLOR,getWhite());
  map.put(BORDER_COLOR,getWhite());
  map.put(PLOT_BACKGROUND_COLOR,getBlack());
  map.put(FRAME_BACKGROUND_COLOR,getBlack());
  map.put(AXIS_TEXT_COLOR,getWhite());
  map.put(AXIS_TICK_COLOR,getWhite());
  map.put(AXIS_TAG_COLOR,getWhite(0.2f));
  map.put(AXIS_FONT,getDefaultPlain(11));
  map.put(TITLE_FONT,getDefaultBold(14));
  map.put(TEXT_BACKGROUND_COLOR,getBlack(0.7f));
}

Fixed version (ground truth):
public BlackAndWhiteLookAndFeel(){
  map.put(CROSSHAIR_COLOR,getWhite());
  map.put(BORDER_COLOR,getWhite());
  map.put(PLOT_BACKGROUND_COLOR,getBlack());
  map.put(FRAME_BACKGROUND_COLOR,getBlack());
  map.put(AXIS_TEXT_COLOR,getWhite());
  map.put(AXIS_TICK_COLOR,getWhite());
  map.put(AXIS_TAG_COLOR,getWhite(0.2f));
  map.put(AXIS_FONT,getDefaultPlain(11));
  map.put(TITLE_FONT,getDefaultBold(14));
  map.put(TOOLTIP_BACKGROUND_COLOR,getBlack(0.7f));
  map.put(TOOLTIP_TEXT_COLOR,getWhite());
}
Program: 11613
Project: 11613
Buggy source:
public OceanLookAndFeel(){
  map.put(CROSSHAIR_COLOR,getBlack());
  map.put(BORDER_COLOR,getWhite());
  map.put(PLOT_BACKGROUND_COLOR,addRgb(GlimpseColor.fromColorRgb(25,42,62),-0.08f));
  map.put(FRAME_BACKGROUND_COLOR,GlimpseColor.fromColorRgb(25,42,62));
  map.put(AXIS_TEXT_COLOR,getWhite());
  map.put(AXIS_TICK_COLOR,getWhite());
  map.put(AXIS_TAG_COLOR,getWhite(0.2f));
  map.put(AXIS_FONT,getDefaultPlain(11));
  map.put(TITLE_FONT,getDefaultPlain(14));
  map.put(TEXT_BACKGROUND_COLOR,getBlack(0.7f));
}

Fixed version (ground truth):
public OceanLookAndFeel(){
  map.put(CROSSHAIR_COLOR,getBlack());
  map.put(BORDER_COLOR,getWhite());
  map.put(PLOT_BACKGROUND_COLOR,addRgb(GlimpseColor.fromColorRgb(25,42,62),-0.08f));
  map.put(FRAME_BACKGROUND_COLOR,GlimpseColor.fromColorRgb(25,42,62));
  map.put(AXIS_TEXT_COLOR,getWhite());
  map.put(AXIS_TICK_COLOR,getWhite());
  map.put(AXIS_TAG_COLOR,getWhite(0.2f));
  map.put(AXIS_FONT,getDefaultPlain(11));
  map.put(TITLE_FONT,getDefaultPlain(14));
  map.put(TOOLTIP_BACKGROUND_COLOR,getBlack(0.7f));
  map.put(TOOLTIP_TEXT_COLOR,getWhite());
}
Program: 11614
Project: 11614
Buggy source:
public SwingLookAndFeel(){
  map.put(CROSSHAIR_COLOR,getBlack());
  map.put(BORDER_COLOR,getBlack());
  map.put(PLOT_BACKGROUND_COLOR,addRgb(fromColorAwt(SystemColor.window),-0.1f));
  map.put(FRAME_BACKGROUND_COLOR,fromColorAwt(SystemColor.window));
  map.put(AXIS_TEXT_COLOR,getBlack());
  map.put(AXIS_TICK_COLOR,getBlack());
  map.put(AXIS_TAG_COLOR,getBlack(0.2f));
  map.put(AXIS_FONT,getDefaultPlain(11));
  map.put(TITLE_FONT,getDefaultPlain(14));
  map.put(TEXT_BACKGROUND_COLOR,getBlack(0.7f));
}

Fixed version (ground truth):
public SwingLookAndFeel(){
  map.put(CROSSHAIR_COLOR,getBlack());
  map.put(BORDER_COLOR,getBlack());
  map.put(PLOT_BACKGROUND_COLOR,addRgb(fromColorAwt(SystemColor.window),-0.1f));
  map.put(FRAME_BACKGROUND_COLOR,fromColorAwt(SystemColor.window));
  map.put(AXIS_TEXT_COLOR,getBlack());
  map.put(AXIS_TICK_COLOR,getBlack());
  map.put(AXIS_TAG_COLOR,getBlack(0.2f));
  map.put(AXIS_FONT,getDefaultPlain(11));
  map.put(TITLE_FONT,getDefaultPlain(14));
  map.put(TOOLTIP_BACKGROUND_COLOR,getBlack(0.7f));
  map.put(TOOLTIP_TEXT_COLOR,getWhite());
}
Program: 11615
Project: 11615
Buggy source:
public SwtLookAndFeel(){
  map.put(CROSSHAIR_COLOR,GlimpseColor.getBlack());
  map.put(BORDER_COLOR,getBlack());
  map.put(PLOT_BACKGROUND_COLOR,GlimpseColorSwt.fromColorSwtSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW));
  map.put(FRAME_BACKGROUND_COLOR,GlimpseColorSwt.fromColorSwtSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
  map.put(AXIS_TEXT_COLOR,getBlack());
  map.put(AXIS_TICK_COLOR,getBlack());
  map.put(AXIS_TAG_COLOR,getBlack(0.2f));
  map.put(AXIS_FONT,getDefaultPlain(11));
  map.put(TITLE_FONT,getDefaultPlain(14));
  map.put(TEXT_BACKGROUND_COLOR,getBlack(0.7f));
}

Fixed version (ground truth):
public SwtLookAndFeel(){
  map.put(CROSSHAIR_COLOR,GlimpseColor.getBlack());
  map.put(BORDER_COLOR,getBlack());
  map.put(PLOT_BACKGROUND_COLOR,GlimpseColorSwt.fromColorSwtSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW));
  map.put(FRAME_BACKGROUND_COLOR,GlimpseColorSwt.fromColorSwtSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
  map.put(AXIS_TEXT_COLOR,getBlack());
  map.put(AXIS_TICK_COLOR,getBlack());
  map.put(AXIS_TAG_COLOR,getBlack(0.2f));
  map.put(AXIS_FONT,getDefaultPlain(11));
  map.put(TITLE_FONT,getDefaultPlain(14));
  map.put(TOOLTIP_BACKGROUND_COLOR,getBlack(0.7f));
  map.put(TOOLTIP_TEXT_COLOR,getWhite());
}
Program: 11616
Project: 11616
Buggy source:
public MouseWrapper(GlimpseCanvas canvas){
  this.canvas=canvas;
  this.dragHoveredSet=new HashSet<GlimpseTargetStack>();
  this.hoveredSet=new HashSet<GlimpseTargetStack>();
}

Fixed version (ground truth):
public MouseWrapper(GlimpseCanvas canvas){
  this.canvas=canvas;
  this.dragHoveredSet=new LinkedList<GlimpseTargetStack>();
  this.hoveredSet=new LinkedList<GlimpseTargetStack>();
}
Program: 11617
Project: 11617
Buggy source:
public void notifyMouseExited(E event,Set<GlimpseTargetStack> stacks){
  for (  GlimpseTargetStack stack : stacks) {
    notifyMouseExited(event,stack);
  }
}

Fixed version (ground truth):
public void notifyMouseExited(E event,List<GlimpseTargetStack> stacks){
  for (  GlimpseTargetStack stack : stacks) {
    notifyMouseExited(event,stack);
  }
}
Program: 11618
Project: 11618
Buggy source:
protected void setHovered(Collection<GlimpseTargetStack> list){
  clearHovered();
  for (  GlimpseTargetStack stack : list)   addHovered(stack);
}

Fixed version (ground truth):
protected void setHovered(List<GlimpseTargetStack> list){
  clearHovered();
  for (  GlimpseTargetStack stack : list)   addHovered(stack);
}
Program: 11619
Project: 11619
Buggy source:
protected Set<GlimpseTargetStack> clearAllHovered(){
  Set<GlimpseTargetStack> oldHovered=copyHovered();
  dragHoveredSet.clear();
  hoveredSet.clear();
  return oldHovered;
}

Fixed version (ground truth):
protected List<GlimpseTargetStack> clearAllHovered(){
  List<GlimpseTargetStack> oldHovered=copyHovered();
  dragHoveredSet.clear();
  hoveredSet.clear();
  return oldHovered;
}
Program: 11620
Project: 11620
Buggy source:
protected Set<GlimpseTargetStack> getHovered(){
  return hoveredSet;
}

Fixed version (ground truth):
protected List<GlimpseTargetStack> getHovered(){
  return hoveredSet;
}
Program: 11621
Project: 11621
Buggy source:
public void notifyMouseEnteredExited(E event,Set<GlimpseTargetStack> oldStacks,Set<GlimpseTargetStack> newStacks){
  for (  GlimpseTargetStack oldStack : oldStacks) {
    if (!newStacks.contains(oldStack)) {
      notifyMouseExited(event,oldStack);
    }
  }
  for (  GlimpseTargetStack newStack : newStacks) {
    if (!oldStacks.contains(newStack)) {
      notifyMouseEntered(event,newStack);
    }
  }
}

Fixed version (ground truth):
public void notifyMouseEnteredExited(E event,List<GlimpseTargetStack> oldStacks,List<GlimpseTargetStack> newStacks){
  for (  GlimpseTargetStack oldStack : oldStacks) {
    if (!newStacks.contains(oldStack)) {
      notifyMouseExited(event,oldStack);
    }
  }
  for (  GlimpseTargetStack newStack : newStacks) {
    if (!oldStacks.contains(newStack)) {
      notifyMouseEntered(event,newStack);
    }
  }
}
Program: 11622
Project: 11622
Buggy source:
protected Set<GlimpseTargetStack> getDragHovered(){
  return dragHoveredSet;
}

Fixed version (ground truth):
protected List<GlimpseTargetStack> getDragHovered(){
  return dragHoveredSet;
}
Program: 11623
Project: 11623
Buggy source:
protected void setAllHovered(Collection<GlimpseTargetStack> list){
  setDragHovered(list);
  setHovered(list);
}

Fixed version (ground truth):
protected void setAllHovered(List<GlimpseTargetStack> list){
  setDragHovered(list);
  setHovered(list);
}
Program: 11624
Project: 11624
Buggy source:
protected void setDragHovered(Collection<GlimpseTargetStack> list){
  clearDragHovered();
  for (  GlimpseTargetStack stack : list)   addDragHovered(stack);
}

Fixed version (ground truth):
protected void setDragHovered(List<GlimpseTargetStack> list){
  clearDragHovered();
  for (  GlimpseTargetStack stack : list)   addDragHovered(stack);
}
Program: 11625
Project: 11625
Buggy source:
protected Set<GlimpseTargetStack> copyHovered(){
  return new HashSet<GlimpseTargetStack>(hoveredSet);
}

Fixed version (ground truth):
protected List<GlimpseTargetStack> copyHovered(){
  return new LinkedList<GlimpseTargetStack>(hoveredSet);
}
Program: 11626
Project: 11626
Buggy source:
protected Set<GlimpseTargetStack> copyDragHovered(){
  return new HashSet<GlimpseTargetStack>(dragHoveredSet);
}

Fixed version (ground truth):
protected List<GlimpseTargetStack> copyDragHovered(){
  return new LinkedList<GlimpseTargetStack>(dragHoveredSet);
}
Program: 11627
Project: 11627
Buggy source:
protected Set<GlimpseTargetStack> clearDragHovered(){
  Set<GlimpseTargetStack> oldHovered=copyDragHovered();
  dragHoveredSet.clear();
  return oldHovered;
}

Fixed version (ground truth):
protected List<GlimpseTargetStack> clearDragHovered(){
  List<GlimpseTargetStack> oldHovered=copyDragHovered();
  dragHoveredSet.clear();
  return oldHovered;
}
Program: 11628
Project: 11628
Buggy source:
public void notifyMouseEntered(E event,Set<GlimpseTargetStack> stacks){
  for (  GlimpseTargetStack stack : stacks) {
    notifyMouseEntered(event,stack);
  }
}

Fixed version (ground truth):
public void notifyMouseEntered(E event,List<GlimpseTargetStack> stacks){
  for (  GlimpseTargetStack stack : stacks) {
    notifyMouseEntered(event,stack);
  }
}
Program: 11629
Project: 11629
Buggy source:
protected Set<GlimpseTargetStack> clearHovered(){
  Set<GlimpseTargetStack> oldHovered=copyHovered();
  hoveredSet.clear();
  return oldHovered;
}

Fixed version (ground truth):
protected List<GlimpseTargetStack> clearHovered(){
  List<GlimpseTargetStack> oldHovered=copyHovered();
  hoveredSet.clear();
  return oldHovered;
}
Program: 11630
Project: 11630
Buggy source:
public boolean mouseReleased0(E event){
  if (event == null)   return false;
  boolean handled=false;
  if (isDragHovered()) {
    Set<GlimpseTargetStack> hoveredList=getDragHovered();
    for (    GlimpseTargetStack hoveredStack : hoveredList) {
      Mouseable mouseTarget=getMouseTarget(hoveredStack);
      GlimpseMouseEvent glimpseEvent=toLocalGlimpseEvent(event,hoveredStack);
      if (mouseTarget != null)       mouseTarget.mouseReleased(glimpseEvent);
      if (glimpseEvent.isHandled()) {
        handled=true;
        break;
      }
    }
  }
  getContainingTargets(event);
  return handled;
}

Fixed version (ground truth):
public boolean mouseReleased0(E event){
  if (event == null)   return false;
  boolean handled=false;
  if (isDragHovered()) {
    List<GlimpseTargetStack> hoveredList=getDragHovered();
    for (    GlimpseTargetStack hoveredStack : hoveredList) {
      Mouseable mouseTarget=getMouseTarget(hoveredStack);
      GlimpseMouseEvent glimpseEvent=toLocalGlimpseEvent(event,hoveredStack);
      if (mouseTarget != null)       mouseTarget.mouseReleased(glimpseEvent);
      if (glimpseEvent.isHandled()) {
        handled=true;
        break;
      }
    }
  }
  getContainingTargets(event);
  return handled;
}
Program: 11631
Project: 11631
Buggy source:
public boolean mouseMoved0(E event){
  if (event == null)   return false;
  Set<GlimpseTargetStack> oldHovered=clearAllHovered();
  getContainingTargets(event);
  Set<GlimpseTargetStack> newHovered=getHovered();
  notifyMouseEnteredExited(event,oldHovered,newHovered);
  if (isDragHovered()) {
    for (    GlimpseTargetStack hoveredStack : newHovered) {
      Mouseable mouseHoveredTarget=getMouseTarget(hoveredStack);
      GlimpseMouseEvent glimpseHoveredEvent=toLocalGlimpseEvent(event,hoveredStack);
      if (mouseHoveredTarget != null)       mouseHoveredTarget.mouseMoved(glimpseHoveredEvent);
      if (glimpseHoveredEvent.isHandled())       return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean mouseMoved0(E event){
  if (event == null)   return false;
  List<GlimpseTargetStack> oldHovered=clearAllHovered();
  getContainingTargets(event);
  List<GlimpseTargetStack> newHovered=getHovered();
  notifyMouseEnteredExited(event,oldHovered,newHovered);
  if (isDragHovered()) {
    for (    GlimpseTargetStack hoveredStack : newHovered) {
      Mouseable mouseHoveredTarget=getMouseTarget(hoveredStack);
      GlimpseMouseEvent glimpseHoveredEvent=toLocalGlimpseEvent(event,hoveredStack);
      if (mouseHoveredTarget != null)       mouseHoveredTarget.mouseMoved(glimpseHoveredEvent);
      if (glimpseHoveredEvent.isHandled())       return true;
    }
  }
  return false;
}
Program: 11632
Project: 11632
Buggy source:
public void mouseEntered0(E event){
  if (event == null)   return;
  Set<GlimpseTargetStack> oldHovered=clearHovered();
  getContainingTargets(event);
  Set<GlimpseTargetStack> newHovered=getHovered();
  notifyMouseEnteredExited(event,oldHovered,newHovered);
}

Fixed version (ground truth):
public void mouseEntered0(E event){
  if (event == null)   return;
  List<GlimpseTargetStack> oldHovered=clearHovered();
  getContainingTargets(event);
  List<GlimpseTargetStack> newHovered=getHovered();
  notifyMouseEnteredExited(event,oldHovered,newHovered);
}
Program: 11633
Project: 11633
Buggy source:
public boolean mouseDragged0(E event){
  if (event == null)   return false;
  Set<GlimpseTargetStack> oldHovered=clearHovered();
  getContainingTargets(event);
  Set<GlimpseTargetStack> newHovered=getHovered();
  notifyMouseEnteredExited(event,oldHovered,newHovered);
  if (isDragHovered()) {
    Set<GlimpseTargetStack> hoveredList=getDragHovered();
    for (    GlimpseTargetStack hoveredStack : hoveredList) {
      Mouseable mouseHoveredTarget=getMouseTarget(hoveredStack);
      GlimpseMouseEvent glimpseHoveredEvent=toLocalGlimpseEvent(event,hoveredStack);
      if (mouseHoveredTarget != null)       mouseHoveredTarget.mouseMoved(glimpseHoveredEvent);
      if (glimpseHoveredEvent.isHandled())       return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean mouseDragged0(E event){
  if (event == null)   return false;
  List<GlimpseTargetStack> oldHovered=clearHovered();
  getContainingTargets(event);
  List<GlimpseTargetStack> newHovered=getHovered();
  notifyMouseEnteredExited(event,oldHovered,newHovered);
  if (isDragHovered()) {
    List<GlimpseTargetStack> hoveredList=getDragHovered();
    for (    GlimpseTargetStack hoveredStack : hoveredList) {
      Mouseable mouseHoveredTarget=getMouseTarget(hoveredStack);
      GlimpseMouseEvent glimpseHoveredEvent=toLocalGlimpseEvent(event,hoveredStack);
      if (mouseHoveredTarget != null)       mouseHoveredTarget.mouseMoved(glimpseHoveredEvent);
      if (glimpseHoveredEvent.isHandled())       return true;
    }
  }
  return false;
}
Program: 11634
Project: 11634
Buggy source:
public void mouseExited0(E event){
  if (event == null)   return;
  Set<GlimpseTargetStack> oldHovered=clearHovered();
  getContainingTargets(event);
  Set<GlimpseTargetStack> newHovered=getHovered();
  notifyMouseEnteredExited(event,oldHovered,newHovered);
}

Fixed version (ground truth):
public void mouseExited0(E event){
  if (event == null)   return;
  List<GlimpseTargetStack> oldHovered=clearHovered();
  getContainingTargets(event);
  List<GlimpseTargetStack> newHovered=getHovered();
  notifyMouseEnteredExited(event,oldHovered,newHovered);
}
Program: 11635
Project: 11635
Buggy source:
protected Axis2D getMainMapAxis0(GlimpseTargetStack stack){
  return getAxis0(newTargetStack(stack).pop().pop());
}

Fixed version (ground truth):
protected Axis2D getMainMapAxis0(GlimpseTargetStack stack){
  return getAxis0(getMainMapTargetStack(stack));
}
Program: 11637
Project: 11637
Buggy source:
public void loadLineSelectionIntoBuffer(Collection<IdPolygon> polygons,int size,int offset){
  ensureLineOffsetBufferSize(size);
  ensureLineCountBufferSize(size);
  if (size <= 0 || offset < 0)   return;
  glLineOffsetBuffer.position(offset);
  glLineCountBuffer.position(offset);
  for (  IdPolygon polygon : polygons) {
    polygon.loadLineIntoBuffer(glLineOffsetBuffer,glLineCountBuffer);
  }
}

Fixed version (ground truth):
public void loadLineSelectionIntoBuffer(Collection<IdPolygon> polygons,int size,int offset){
  if (size <= 0 || offset < 0)   return;
  ensureLineOffsetBufferSize(size);
  ensureLineCountBufferSize(size);
  glLineOffsetBuffer.position(offset);
  glLineCountBuffer.position(offset);
  for (  IdPolygon polygon : polygons) {
    polygon.loadLineIntoBuffer(glLineOffsetBuffer,glLineCountBuffer);
  }
}
Program: 11639
Project: 11639
Buggy source:
public GlimpseLayoutDelegate(GlimpseLayout layout){
  this.layout=layout;
  this.layoutChildren=new ArrayList<GlimpseLayoutDelegate>();
  this.memberList=new ArrayList<Member>();
  this.memberMap=new LinkedHashMap<GlimpsePainter,Member>();
  this.backgroundPainter=new BackgroundPainter(true);
  this.backgroundPainterEnabled=true;
}

Fixed version (ground truth):
public GlimpseLayoutDelegate(GlimpseLayout layout){
  this.layout=layout;
  this.layoutChildren=new ArrayList<GlimpseLayoutDelegate>();
  this.memberList=new ArrayList<Member>();
  this.memberMap=new LinkedHashMap<GlimpsePainter,Member>();
}
Program: 11640
Project: 11640
Buggy source:
public void setLookAndFeel(LookAndFeel laf){
  backgroundPainter.setLookAndFeel(laf);
  for (  Member m : memberList) {
    m.painter.setLookAndFeel(laf);
  }
}

Fixed version (ground truth):
public void setLookAndFeel(LookAndFeel laf){
  for (  Member m : memberList) {
    m.painter.setLookAndFeel(laf);
  }
}
Program: 11641
Project: 11641
Buggy source:
public void paintTo(GlimpseContext context){
  GL gl=context.getGL();
  GlimpseBounds bounds=context.getTargetStack().getBounds();
  GlimpseBounds clippedBounds=getClippedBounds(context);
  if (!clippedBounds.isValid())   return;
  if (backgroundPainterEnabled) {
    try {
      gl.glEnable(GL.GL_SCISSOR_TEST);
      gl.glViewport(bounds.getX(),bounds.getY(),bounds.getWidth(),bounds.getHeight());
      gl.glScissor(clippedBounds.getX(),clippedBounds.getY(),clippedBounds.getWidth(),clippedBounds.getHeight());
      this.backgroundPainter.paintTo(context);
    }
  finally {
      gl.glDisable(GL.GL_SCISSOR_TEST);
    }
  }
  for (  Member m : memberList) {
    try {
      gl.glEnable(GL.GL_SCISSOR_TEST);
      gl.glViewport(bounds.getX(),bounds.getY(),bounds.getWidth(),bounds.getHeight());
      gl.glScissor(clippedBounds.getX(),clippedBounds.getY(),clippedBounds.getWidth(),clippedBounds.getHeight());
      if (m.callback != null)       m.callback.prePaint(m.painter,context);
      m.painter.paintTo(context);
      if (m.callback != null)       m.callback.postPaint(m.painter,context);
    }
  finally {
      gl.glDisable(GL.GL_SCISSOR_TEST);
    }
  }
}

Fixed version (ground truth):
public void paintTo(GlimpseContext context){
  GL gl=context.getGL();
  GlimpseBounds bounds=context.getTargetStack().getBounds();
  GlimpseBounds clippedBounds=getClippedBounds(context);
  if (!clippedBounds.isValid())   return;
  for (  Member m : memberList) {
    try {
      gl.glEnable(GL.GL_SCISSOR_TEST);
      gl.glViewport(bounds.getX(),bounds.getY(),bounds.getWidth(),bounds.getHeight());
      gl.glScissor(clippedBounds.getX(),clippedBounds.getY(),clippedBounds.getWidth(),clippedBounds.getHeight());
      if (m.callback != null)       m.callback.prePaint(m.painter,context);
      m.painter.paintTo(context);
      if (m.callback != null)       m.callback.postPaint(m.painter,context);
    }
  finally {
      gl.glDisable(GL.GL_SCISSOR_TEST);
    }
  }
}
Program: 11642
Project: 11642
Buggy source:
protected void initializePainters(){
  this.titleLayout=new GlimpseLayout(this,"String_Node_Str");
  this.axisLayoutXY=new GlimpseAxisLayout2D(this,"String_Node_Str",new Axis2D(centerAxisX,centerAxisY));
  this.titlePainter=createTitlePainter();
  if (titlePainter != null)   titleLayout.addPainter(titlePainter);
  this.setTitleFont(getDefaultTitleFont(),false);
  this.plotBackgroundPainter=new BackgroundPainter(false);
  this.axisLayoutXY.addPainter(this.plotBackgroundPainter);
  this.mouseListenerXY=createAxisMouseListenerXY();
  this.attachAxisMouseListener(axisLayoutXY,mouseListenerXY);
}

Fixed version (ground truth):
protected void initializePainters(){
  this.backgroundPainter=new BackgroundPainter(true);
  super.addPainter(this.backgroundPainter);
  this.titleLayout=new GlimpseLayout(this,"String_Node_Str");
  this.axisLayoutXY=new GlimpseAxisLayout2D(this,"String_Node_Str",new Axis2D(centerAxisX,centerAxisY));
  this.titlePainter=createTitlePainter();
  if (titlePainter != null)   titleLayout.addPainter(titlePainter);
  this.setTitleFont(getDefaultTitleFont(),false);
  this.plotBackgroundPainter=new BackgroundPainter(false);
  this.axisLayoutXY.addPainter(this.plotBackgroundPainter);
  this.mouseListenerXY=createAxisMouseListenerXY();
  this.attachAxisMouseListener(axisLayoutXY,mouseListenerXY);
}
Program: 11643
Project: 11643
Buggy source:
protected void initialize(){
  initializeAxes();
  initializePainters();
  attachAxisMouseListeners();
  initializeLookAndFeel();
  updatePainterLayout();
}

Fixed version (ground truth):
protected void initialize(){
  initializeAxes();
  initializeParentLayout();
  initializePainters();
  attachAxisMouseListeners();
  initializeLookAndFeel();
  updatePainterLayout();
}
Program: 11644
Project: 11644
Buggy source:
public void invalidateLayout(){
  lock.lock();
  try {
    layoutCache.clear();
    layoutDelegate.invalidateLayout();
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
public void invalidateLayout(){
  lock.lock();
  try {
    layoutClean.clear();
    layoutDelegate.invalidateLayout();
  }
  finally {
    lock.unlock();
  }
}
Program: 11645
Project: 11645
Buggy source:
protected List<Tag> copyTags(List<Tag> list){
  List<Tag> newList=new ArrayList<Tag>(list.size());
  for (  Tag tag : newList) {
    newList.add(new Tag(tag));
  }
  return newList;
}

Fixed version (ground truth):
protected List<Tag> copyTags(List<Tag> list){
  List<Tag> newList=new ArrayList<Tag>(list.size());
  for (  Tag tag : list) {
    newList.add(new Tag(tag));
  }
  return newList;
}
Program: 11646
Project: 11646
Buggy source:
public GlimpseLayoutDelegate(GlimpseLayout layout){
  this.layout=layout;
  this.layoutChildren=new ArrayList<GlimpseLayoutDelegate>();
  this.memberList=new ArrayList<Member>();
  this.memberMap=new LinkedHashMap<GlimpsePainter,Member>();
}

Fixed version (ground truth):
public GlimpseLayoutDelegate(GlimpseLayout layout){
  this.layout=layout;
  this.layoutChildren=new ArrayList<GlimpseLayoutDelegate>();
  this.memberList=new ArrayList<Member>();
  this.memberMap=new LinkedHashMap<GlimpsePainter,Member>();
  this.backgroundPainter=new BackgroundPainter(true);
  this.backgroundPainterEnabled=true;
}
Program: 11647
Project: 11647
Buggy source:
public void setLookAndFeel(LookAndFeel laf){
  for (  Member m : memberList) {
    m.painter.setLookAndFeel(laf);
  }
}

Fixed version (ground truth):
public void setLookAndFeel(LookAndFeel laf){
  backgroundPainter.setLookAndFeel(laf);
  for (  Member m : memberList) {
    m.painter.setLookAndFeel(laf);
  }
}
Program: 11648
Project: 11648
Buggy source:
public void paintTo(GlimpseContext context){
  GL gl=context.getGL();
  GlimpseBounds bounds=context.getTargetStack().getBounds();
  GlimpseBounds clippedBounds=getClippedBounds(context);
  if (!clippedBounds.isValid())   return;
  for (  Member m : memberList) {
    try {
      gl.glEnable(GL.GL_SCISSOR_TEST);
      gl.glViewport(bounds.getX(),bounds.getY(),bounds.getWidth(),bounds.getHeight());
      gl.glScissor(clippedBounds.getX(),clippedBounds.getY(),clippedBounds.getWidth(),clippedBounds.getHeight());
      if (m.callback != null)       m.callback.prePaint(m.painter,context);
      m.painter.paintTo(context);
      if (m.callback != null)       m.callback.postPaint(m.painter,context);
    }
  finally {
      gl.glDisable(GL.GL_SCISSOR_TEST);
    }
  }
}

Fixed version (ground truth):
public void paintTo(GlimpseContext context){
  GL gl=context.getGL();
  GlimpseBounds bounds=context.getTargetStack().getBounds();
  GlimpseBounds clippedBounds=getClippedBounds(context);
  if (!clippedBounds.isValid())   return;
  if (backgroundPainterEnabled) {
    try {
      gl.glEnable(GL.GL_SCISSOR_TEST);
      gl.glViewport(bounds.getX(),bounds.getY(),bounds.getWidth(),bounds.getHeight());
      gl.glScissor(clippedBounds.getX(),clippedBounds.getY(),clippedBounds.getWidth(),clippedBounds.getHeight());
      this.backgroundPainter.paintTo(context);
    }
  finally {
      gl.glDisable(GL.GL_SCISSOR_TEST);
    }
  }
  for (  Member m : memberList) {
    try {
      gl.glEnable(GL.GL_SCISSOR_TEST);
      gl.glViewport(bounds.getX(),bounds.getY(),bounds.getWidth(),bounds.getHeight());
      gl.glScissor(clippedBounds.getX(),clippedBounds.getY(),clippedBounds.getWidth(),clippedBounds.getHeight());
      if (m.callback != null)       m.callback.prePaint(m.painter,context);
      m.painter.paintTo(context);
      if (m.callback != null)       m.callback.postPaint(m.painter,context);
    }
  finally {
      gl.glDisable(GL.GL_SCISSOR_TEST);
    }
  }
}
Program: 11649
Project: 11649
Buggy source:
protected void initializePainters(){
  this.backgroundPainter=new BackgroundPainter(true);
  super.addPainter(this.backgroundPainter);
  this.titleLayout=new GlimpseLayout(this,"String_Node_Str");
  this.axisLayoutXY=new GlimpseAxisLayout2D(this,"String_Node_Str",new Axis2D(centerAxisX,centerAxisY));
  this.titlePainter=createTitlePainter();
  if (titlePainter != null)   titleLayout.addPainter(titlePainter);
  this.setTitleFont(getDefaultTitleFont(),false);
  this.plotBackgroundPainter=new BackgroundPainter(false);
  this.axisLayoutXY.addPainter(this.plotBackgroundPainter);
  this.mouseListenerXY=createAxisMouseListenerXY();
  this.attachAxisMouseListener(axisLayoutXY,mouseListenerXY);
}

Fixed version (ground truth):
protected void initializePainters(){
  this.titleLayout=new GlimpseLayout(this,"String_Node_Str");
  this.axisLayoutXY=new GlimpseAxisLayout2D(this,"String_Node_Str",new Axis2D(centerAxisX,centerAxisY));
  this.titlePainter=createTitlePainter();
  if (titlePainter != null)   titleLayout.addPainter(titlePainter);
  this.setTitleFont(getDefaultTitleFont(),false);
  this.plotBackgroundPainter=new BackgroundPainter(false);
  this.axisLayoutXY.addPainter(this.plotBackgroundPainter);
  this.mouseListenerXY=createAxisMouseListenerXY();
  this.attachAxisMouseListener(axisLayoutXY,mouseListenerXY);
}
Program: 11650
Project: 11650
Buggy source:
protected void initialize(){
  initializeAxes();
  initializeParentLayout();
  initializePainters();
  attachAxisMouseListeners();
  initializeLookAndFeel();
  updatePainterLayout();
}

Fixed version (ground truth):
protected void initialize(){
  initializeAxes();
  initializePainters();
  attachAxisMouseListeners();
  initializeLookAndFeel();
  updatePainterLayout();
}
Program: 11651
Project: 11651
Buggy source:
public SwingLookAndFeel(){
  map.put(CROSSHAIR_COLOR,getBlack());
  map.put(PLOT_BACKGROUND_COLOR,fromColorAwt(SystemColor.control));
  map.put(FRAME_BACKGROUND_COLOR,fromColorAwt(SystemColor.controlHighlight));
  map.put(AXIS_FONT,getDefaultPlain(11));
  map.put(TITLE_FONT,getDefaultPlain(14));
}

Fixed version (ground truth):
public SwingLookAndFeel(){
  map.put(CROSSHAIR_COLOR,getBlack());
  map.put(PLOT_BACKGROUND_COLOR,fromColorAwt(SystemColor.windowBorder));
  map.put(FRAME_BACKGROUND_COLOR,fromColorAwt(SystemColor.window));
  map.put(AXIS_FONT,getDefaultPlain(11));
  map.put(TITLE_FONT,getDefaultPlain(14));
}
Program: 11652
Project: 11652
Buggy source:
public SwingLookAndFeel(){
  map.put(CROSSHAIR_COLOR,getBlack());
  map.put(PLOT_BACKGROUND_COLOR,fromColorAwt(SystemColor.windowBorder));
  map.put(FRAME_BACKGROUND_COLOR,fromColorAwt(SystemColor.window));
  map.put(AXIS_FONT,getDefaultPlain(11));
  map.put(TITLE_FONT,getDefaultPlain(14));
}

Fixed version (ground truth):
public SwingLookAndFeel(){
  map.put(CROSSHAIR_COLOR,getBlack());
  map.put(PLOT_BACKGROUND_COLOR,addRgb(fromColorAwt(SystemColor.window),-0.1f));
  map.put(FRAME_BACKGROUND_COLOR,fromColorAwt(SystemColor.window));
  map.put(AXIS_FONT,getDefaultPlain(11));
  map.put(TITLE_FONT,getDefaultPlain(14));
}
Program: 11654
Project: 11654
Buggy source:
@Override public void paintTo(GlimpseContext context,GlimpseBounds bounds,Axis2D axis){
  GL gl=context.getGL();
  int width=bounds.getWidth();
  int height=bounds.getHeight();
  gl.glMatrixMode(GL.GL_PROJECTION);
  gl.glLoadIdentity();
  gl.glOrtho(0,width,0,height,-1,1);
  gl.glMatrixMode(GL.GL_MODELVIEW);
  gl.glLoadIdentity();
  gl.glBlendFunc(GL.GL_SRC_ALPHA,GL.GL_ONE_MINUS_SRC_ALPHA);
  gl.glEnable(GL.GL_BLEND);
  gl.glEnable(GL.GL_LINE_SMOOTH);
  gl.glEnable(GL.GL_POINT_SMOOTH);
  if (isVisible() && !list.isEmpty()) {
    displayLegend(gl,width,height);
  }
}

Fixed version (ground truth):
@Override public void paintTo(GlimpseContext context,GlimpseBounds bounds,Axis2D axis){
  if (newFont != null) {
    if (textRenderer != null)     textRenderer.dispose();
    textRenderer=new TextRenderer(newFont,antialias,false);
    newFont=null;
  }
  GL gl=context.getGL();
  int width=bounds.getWidth();
  int height=bounds.getHeight();
  gl.glMatrixMode(GL.GL_PROJECTION);
  gl.glLoadIdentity();
  gl.glOrtho(0,width,0,height,-1,1);
  gl.glMatrixMode(GL.GL_MODELVIEW);
  gl.glLoadIdentity();
  gl.glBlendFunc(GL.GL_SRC_ALPHA,GL.GL_ONE_MINUS_SRC_ALPHA);
  gl.glEnable(GL.GL_BLEND);
  gl.glEnable(GL.GL_LINE_SMOOTH);
  gl.glEnable(GL.GL_POINT_SMOOTH);
  if (isVisible() && !list.isEmpty()) {
    displayLegend(gl,width,height);
  }
}
Program: 11655
Project: 11655
Buggy source:
@Override public void dispose(GLContext context){
  if (textRenderer != null)   textRenderer.dispose();
  textRenderer=null;
}

Fixed version (ground truth):
@Override public void dispose(GlimpseContext context){
  if (textRenderer != null)   textRenderer.dispose();
  textRenderer=null;
}
Program: 11656
Project: 11656
Buggy source:
public void setFont(float size,boolean bold){
  setFont(bold ? FontUtils.getDefaultBold(size) : FontUtils.getDefaultPlain(size));
}

Fixed version (ground truth):
public LegendPainter setFont(int size,boolean bold,boolean antialias){
  if (bold) {
    setFont(getDefaultBold(size),antialias);
  }
 else {
    setFont(getDefaultPlain(size),antialias);
  }
  return this;
}
Program: 11658
Project: 11658
Buggy source:
@Override public void paintTo(GlimpseContext context){
  if (!displayOn)   return;
  GlimpseBounds bounds=context.getTargetStack().getBounds();
  if (bounds == null)   return;
  int width=bounds.getWidth();
  int height=bounds.getHeight();
  if (width <= 0 || height <= 0)   return;
  GL gl=context.getGL();
  gl.glPushClientAttrib((int)GL.GL_CLIENT_ALL_ATTRIB_BITS);
  gl.glPushAttrib(GL.GL_ALL_ATTRIB_BITS);
  gl.glMatrixMode(GL.GL_MODELVIEW);
  gl.glPushMatrix();
  gl.glMatrixMode(GL.GL_PROJECTION);
  gl.glPushMatrix();
  try {
    paintTo(context,bounds);
    if (doErrorHandling)     glHandleError(gl,"String_Node_Str" + getClass().getName());
  }
  finally {
    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glPopMatrix();
    gl.glMatrixMode(GL.GL_PROJECTION);
    gl.glPopMatrix();
    gl.glPopAttrib();
    gl.glPopClientAttrib();
  }
}

Fixed version (ground truth):
@Override public void paintTo(GlimpseContext context){
  if (!displayOn)   return;
  GlimpseBounds bounds=context.getTargetStack().getBounds();
  if (bounds == null)   return;
  int width=bounds.getWidth();
  int height=bounds.getHeight();
  if (width <= 0 || height <= 0)   return;
  GL gl=context.getGL();
  gl.glPushClientAttrib((int)GL.GL_CLIENT_ALL_ATTRIB_BITS);
  gl.glPushAttrib(GL.GL_ALL_ATTRIB_BITS);
  gl.glMatrixMode(GL.GL_MODELVIEW);
  gl.glPushMatrix();
  gl.glMatrixMode(GL.GL_PROJECTION);
  gl.glPushMatrix();
  try {
    paintTo(context,bounds);
    if (doErrorHandling)     glHandleError(gl,errorPrefix);
  }
  finally {
    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glPopMatrix();
    gl.glMatrixMode(GL.GL_PROJECTION);
    gl.glPopMatrix();
    gl.glPopAttrib();
    gl.glPopClientAttrib();
  }
}
Program: 11660
Project: 11660
Buggy source:
/** 
 * Sets whether or not zooming of the Y axis is allowed for all timeline and plot axes. This setting will also affect newly created plots.
 * @param lock whether to allow zooming of the Y axis
 * @see AxisMouseListener#setAllowZoomY(boolean)
 */
public void setAllowZoomY(boolean lock){
  this.allowZoomY=lock;
  if (this.getOrientation() == Orientation.HORIZONTAL) {
    this.timelineMouseListener.setAllowZoom(lock);
  }
  for (  TimePlotInfo info : getAllTimePlots()) {
    info.getTimelineMouseListener().setAllowZoomY(lock);
  }
}

Fixed version (ground truth):
/** 
 * Sets whether or not zooming of the Y axis is allowed for all timeline and plot axes. This setting will also affect newly created plots.
 * @param lock whether to allow zooming of the Y axis
 * @see AxisMouseListener#setAllowZoomY(boolean)
 */
public void setAllowZoomY(boolean lock){
  this.lock.lock();
  try {
    this.allowZoomY=lock;
    if (this.getOrientation() == Orientation.HORIZONTAL) {
      this.timelineMouseListener.setAllowZoom(lock);
    }
    for (    TimePlotInfo info : getAllTimePlots()) {
      info.getTimelineMouseListener().setAllowZoomY(lock);
    }
  }
  finally {
    this.lock.unlock();
  }
}
Program: 11661
Project: 11661
Buggy source:
/** 
 * Sets whether or not zooming of the X axis is allowed for all timeline and plot axes. This setting will also affect newly created plots.
 * @param lock whether to allow zooming of the X axis
 * @see AxisMouseListener#setAllowZoomX(boolean)
 */
public void setAllowZoomX(boolean lock){
  this.allowZoomX=lock;
  if (this.getOrientation() == Orientation.VERTICAL) {
    this.timelineMouseListener.setAllowZoom(lock);
  }
  for (  TimePlotInfo info : getAllTimePlots()) {
    info.getTimelineMouseListener().setAllowZoomX(lock);
  }
}

Fixed version (ground truth):
/** 
 * Sets whether or not zooming of the X axis is allowed for all timeline and plot axes. This setting will also affect newly created plots.
 * @param lock whether to allow zooming of the X axis
 * @see AxisMouseListener#setAllowZoomX(boolean)
 */
public void setAllowZoomX(boolean lock){
  this.lock.lock();
  try {
    this.allowZoomX=lock;
    if (this.getOrientation() == Orientation.VERTICAL) {
      this.timelineMouseListener.setAllowZoom(lock);
    }
    for (    TimePlotInfo info : getAllTimePlots()) {
      info.getTimelineMouseListener().setAllowZoomX(lock);
    }
  }
  finally {
    this.lock.unlock();
  }
}
Program: 11662
Project: 11662
Buggy source:
/** 
 * <p>Returns only the TimePlotInfo handles for plotting areas created with   {@link #createTimePlot(String)}.</p> Note, this may not be all the plotting areas for this StackedPlot2D if some vanilla plots were created using   {@link #createPlot(String)}.
 */
public Collection<TimePlotInfo> getAllTimePlots(){
  List<TimePlotInfo> list=new LinkedList<TimePlotInfo>();
  for (  PlotInfo plot : getAllPlots()) {
    if (plot instanceof TimePlotInfo)     list.add((TimePlotInfo)plot);
  }
  return list;
}

Fixed version (ground truth):
/** 
 * <p>Returns only the TimePlotInfo handles for plotting areas created with   {@link #createTimePlot(String)}.</p> Note, this may not be all the plotting areas for this StackedPlot2D if some vanilla plots were created using   {@link #createPlot(String)}.
 */
public Collection<TimePlotInfo> getAllTimePlots(){
  this.lock.lock();
  try {
    List<TimePlotInfo> list=new LinkedList<TimePlotInfo>();
    for (    PlotInfo plot : getAllPlots()) {
      if (plot instanceof TimePlotInfo)       list.add((TimePlotInfo)plot);
    }
    return list;
  }
  finally {
    this.lock.unlock();
  }
}
Program: 11663
Project: 11663
Buggy source:
/** 
 * Returns the time plot handle for the plot identified via its unique string identifier.
 * @param name a plot unique identifier
 * @return the PlotInfo handle
 */
public TimePlotInfo getTimePlot(String name){
  PlotInfo plot=getPlot(name);
  if (plot instanceof TimePlotInfo) {
    return (TimePlotInfo)plot;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns the time plot handle for the plot identified via its unique string identifier.
 * @param name a plot unique identifier
 * @return the PlotInfo handle
 */
public TimePlotInfo getTimePlot(String name){
  this.lock.lock();
  try {
    PlotInfo plot=getPlot(name);
    if (plot instanceof TimePlotInfo) {
      return (TimePlotInfo)plot;
    }
 else {
      return null;
    }
  }
  finally {
    this.lock.unlock();
  }
}