nus-yam/ex-repair huggingface dataset:
Program: 11534
Project: 11534
Buggy source:
public TooltipPainter setFixedWidth(int fixedWidth){
  this.fixedWidth=fixedWidth;
  this.isFixedWidth=true;
  this.lines=null;
  return this;
}

Fixed version (ground truth):
public synchronized TooltipPainter setFixedWidth(int fixedWidth){
  this.fixedWidth=fixedWidth;
  this.isFixedWidth=true;
  this.lines=null;
  return this;
}
Program: 11535
Project: 11535
Buggy source:
public TooltipPainter setLocation(GlimpseMouseEvent e){
  return setLocation(e.getScreenPixelsX(),e.getScreenPixelsY());
}

Fixed version (ground truth):
public synchronized TooltipPainter setLocation(GlimpseMouseEvent e){
  return setLocation(e.getScreenPixelsX(),e.getScreenPixelsY());
}
Program: 11536
Project: 11536
Buggy source:
public TooltipPainter setOffset(int x,int y){
  this.offsetX=x;
  this.offsetY=y;
  return this;
}

Fixed version (ground truth):
public synchronized TooltipPainter setOffset(int x,int y){
  this.offsetX=x;
  this.offsetY=y;
  return this;
}
Program: 11537
Project: 11537
Buggy source:
public TooltipPainter setBreakOnEol(boolean breakOnEol){
  this.breakOnEol=breakOnEol;
  this.textLayout=null;
  return this;
}

Fixed version (ground truth):
public synchronized TooltipPainter setBreakOnEol(boolean breakOnEol){
  this.breakOnEol=breakOnEol;
  this.textLayout=null;
  return this;
}
Program: 11538
Project: 11538
Buggy source:
/** 
 * Whether to force a break on the end of line characters (\r \f \n).
 */
public boolean getBreakOnEol(){
  return breakOnEol;
}

Fixed version (ground truth):
/** 
 * Whether to force a break on the end of line characters (\r \f \n).
 */
public synchronized boolean getBreakOnEol(){
  return breakOnEol;
}
Program: 11539
Project: 11539
Buggy source:
public TooltipPainter setBorderSize(int size){
  this.borderSize=size;
  this.lines=null;
  return this;
}

Fixed version (ground truth):
public synchronized TooltipPainter setBorderSize(int size){
  this.borderSize=size;
  this.lines=null;
  return this;
}
Program: 11540
Project: 11540
Buggy source:
public void setClampToScreenEdges(boolean clamp){
  this.clampToScreenEdges=clamp;
}

Fixed version (ground truth):
public synchronized void setClampToScreenEdges(boolean clamp){
  this.clampToScreenEdges=clamp;
}
Program: 11541
Project: 11541
Buggy source:
public TooltipPainter setUnlimitedWidth(){
  this.isFixedWidth=false;
  this.lines=null;
  return this;
}

Fixed version (ground truth):
public synchronized TooltipPainter setUnlimitedWidth(){
  this.isFixedWidth=false;
  this.lines=null;
  return this;
}
Program: 11542
Project: 11542
Buggy source:
public TooltipPainter setWrapTextAroundIcon(boolean wrap){
  this.wrapTextAroundIcon=wrap;
  this.lines=null;
  return this;
}

Fixed version (ground truth):
public synchronized TooltipPainter setWrapTextAroundIcon(boolean wrap){
  this.wrapTextAroundIcon=wrap;
  this.lines=null;
  return this;
}
Program: 11543
Project: 11543
Buggy source:
/** 
 * Sets the icon to be displayed on the first line of the tool tip.
 * @param id the id of the icon in TooltipPainter's TextureAtlas
 */
public TooltipPainter setIcon(Object iconId){
  this.iconIds=Collections.singletonList(iconId);
  this.iconColors=null;
  this.icons=null;
  this.lines=null;
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the icon to be displayed on the first line of the tool tip.
 * @param id the id of the icon in TooltipPainter's TextureAtlas
 */
public synchronized TooltipPainter setIcon(Object iconId){
  this.iconIds=Collections.singletonList(iconId);
  this.iconColors=null;
  this.icons=null;
  this.lines=null;
  return this;
}
Program: 11544
Project: 11544
Buggy source:
public TooltipPainter setBreakIterator(BreakIterator breakIterator){
  this.breakIterator=breakIterator;
  this.textLayout=null;
  return this;
}

Fixed version (ground truth):
public synchronized TooltipPainter setBreakIterator(BreakIterator breakIterator){
  this.breakIterator=breakIterator;
  this.textLayout=null;
  return this;
}
Program: 11545
Project: 11545
Buggy source:
public TooltipPainter setLineSpacing(float lineSpacing){
  this.lineSpacing=lineSpacing;
  this.textLayout=null;
  return this;
}

Fixed version (ground truth):
public synchronized TooltipPainter setLineSpacing(float lineSpacing){
  this.lineSpacing=lineSpacing;
  this.textLayout=null;
  return this;
}
Program: 11546
Project: 11546
Buggy source:
/** 
 * Sets icons and associated colors.
 * @see #setIcons(List)
 */
public TooltipPainter setIcons(List<Object> iconIds,List<float[]> colors){
  setIcons(iconIds);
  this.iconColors=Lists.newArrayList(colors);
  return this;
}

Fixed version (ground truth):
/** 
 * Sets icons and associated colors.
 * @see #setIcons(List)
 */
public synchronized TooltipPainter setIcons(List<Object> iconIds,List<float[]> colors){
  setIcons(iconIds);
  this.iconColors=Lists.newArrayList(colors);
  return this;
}
Program: 11547
Project: 11547
Buggy source:
public boolean isFixedWidth(){
  return this.isFixedWidth;
}

Fixed version (ground truth):
public synchronized boolean isFixedWidth(){
  return this.isFixedWidth;
}
Program: 11548
Project: 11548
Buggy source:
public int getFixedWidth(){
  return this.fixedWidth;
}

Fixed version (ground truth):
public synchronized int getFixedWidth(){
  return this.fixedWidth;
}
Program: 11549
Project: 11549
Buggy source:
@Override public TooltipPainter setText(String text){
  this.text=text;
  this.lines=null;
  return this;
}

Fixed version (ground truth):
@Override public synchronized TooltipPainter setText(String text){
  this.text=text;
  this.lines=null;
  return this;
}
Program: 11550
Project: 11550
Buggy source:
@Override public void paintTo(GL2 gl,GlimpseBounds bounds,Axis2D axis){
  if (dataSize == 0)   return;
  if (!bufferInitialized) {
    bufferHandle=new int[1];
    gl.glGenBuffers(1,bufferHandle,0);
    colorHandle=new int[1];
    gl.glGenBuffers(1,colorHandle,0);
    bufferInitialized=true;
  }
  if (newData) {
    this.dataBufferLock.lock();
    try {
      gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,bufferHandle[0]);
      gl.glBufferData(GL2.GL_ARRAY_BUFFER,dataSize * 2 * BYTES_PER_FLOAT,dataBuffer.rewind(),GL2.GL_DYNAMIC_DRAW);
      glHandleError(gl);
      useColorDevice=useColorHost;
      if (useColorDevice) {
        gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,colorHandle[0]);
        gl.glBufferData(GL2.GL_ARRAY_BUFFER,dataSize * 4 * BYTES_PER_FLOAT,colorBuffer.rewind(),GL2.GL_DYNAMIC_DRAW);
        glHandleError(gl);
      }
      newData=false;
    }
  finally {
      this.dataBufferLock.unlock();
    }
  }
  if (useColorDevice) {
    gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,colorHandle[0]);
    gl.glColorPointer(4,GL2.GL_FLOAT,0,0);
    gl.glEnableClientState(GL2.GL_COLOR_ARRAY);
  }
  gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,bufferHandle[0]);
  gl.glVertexPointer(2,GL2.GL_FLOAT,0,0);
  gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
  gl.glColor4fv(pointColor,0);
  gl.glPointSize(pointSize);
  gl.glDrawArrays(GL2.GL_POINTS,0,dataSize);
}

Fixed version (ground truth):
@Override public void paintTo(GL2 gl,GlimpseBounds bounds,Axis2D axis){
  if (dataSize == 0)   return;
  if (!bufferInitialized) {
    bufferHandle=new int[1];
    gl.glGenBuffers(1,bufferHandle,0);
    colorHandle=new int[1];
    gl.glGenBuffers(1,colorHandle,0);
    bufferInitialized=true;
  }
  this.dataBufferLock.lock();
  try {
    if (newData) {
      gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,bufferHandle[0]);
      gl.glBufferData(GL2.GL_ARRAY_BUFFER,dataSize * 2 * BYTES_PER_FLOAT,dataBuffer.rewind(),GL2.GL_DYNAMIC_DRAW);
      glHandleError(gl);
      useColorDevice=useColorHost;
      if (useColorDevice) {
        gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,colorHandle[0]);
        gl.glBufferData(GL2.GL_ARRAY_BUFFER,dataSize * 4 * BYTES_PER_FLOAT,colorBuffer.rewind(),GL2.GL_DYNAMIC_DRAW);
        glHandleError(gl);
      }
    }
    newData=false;
    if (useColorDevice) {
      gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,colorHandle[0]);
      gl.glColorPointer(4,GL2.GL_FLOAT,0,0);
      gl.glEnableClientState(GL2.GL_COLOR_ARRAY);
    }
    gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,bufferHandle[0]);
    gl.glVertexPointer(2,GL2.GL_FLOAT,0,0);
    gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
    gl.glColor4fv(pointColor,0);
    gl.glPointSize(pointSize);
    gl.glDrawArrays(GL2.GL_POINTS,0,dataSize);
  }
  finally {
    this.dataBufferLock.unlock();
  }
}
Program: 11551
Project: 11551
Buggy source:
@Override public boolean isDisposed(){
  return this.disposed;
}

Fixed version (ground truth):
@Override public boolean isDisposed(){
  this.disposeLock.lock();
  try {
    return this.disposed;
  }
  finally {
    this.disposeLock.unlock();
  }
}
Program: 11552
Project: 11552
Buggy source:
@Override public void paintTo(GL2 gl,GlimpseBounds bounds,Axis2D axis){
  if (lineCount == 0)   return;
  if (!bufferInitialized) {
    bufferHandle=new int[1];
    gl.glGenBuffers(1,bufferHandle,0);
    bufferInitialized=true;
  }
  gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,bufferHandle[0]);
  if (newData) {
    this.dataBufferLock.lock();
    try {
      gl.glBufferData(GL2.GL_ARRAY_BUFFER,totalPointCount * 2 * BYTES_PER_FLOAT,dataBuffer.rewind(),GL2.GL_DYNAMIC_DRAW);
      glHandleError(gl);
      newData=false;
    }
  finally {
      this.dataBufferLock.unlock();
    }
  }
  gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,bufferHandle[0]);
  gl.glVertexPointer(2,GL2.GL_FLOAT,0,0);
  gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
  gl.glColor4fv(lineColor,0);
  gl.glLineWidth(lineWidth);
  offsetBuffer.rewind();
  sizeBuffer.rewind();
  gl.glMultiDrawArrays(GL2.GL_LINE_STRIP,offsetBuffer,sizeBuffer,lineCount);
}

Fixed version (ground truth):
@Override public void paintTo(GL2 gl,GlimpseBounds bounds,Axis2D axis){
  if (lineCount == 0)   return;
  if (!bufferInitialized) {
    bufferHandle=new int[1];
    gl.glGenBuffers(1,bufferHandle,0);
    bufferInitialized=true;
  }
  gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,bufferHandle[0]);
  dataBufferLock.lock();
  try {
    if (newData) {
      gl.glBufferData(GL2.GL_ARRAY_BUFFER,totalPointCount * 2 * BYTES_PER_FLOAT,dataBuffer.rewind(),GL2.GL_DYNAMIC_DRAW);
      glHandleError(gl);
      newData=false;
    }
    gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,bufferHandle[0]);
    gl.glVertexPointer(2,GL2.GL_FLOAT,0,0);
    gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
    gl.glColor4fv(lineColor,0);
    gl.glLineWidth(lineWidth);
    offsetBuffer.rewind();
    sizeBuffer.rewind();
    gl.glMultiDrawArrays(GL2.GL_LINE_STRIP,offsetBuffer,sizeBuffer,lineCount);
  }
  finally {
    dataBufferLock.unlock();
  }
}
Program: 11554
Project: 11554
Buggy source:
public void add(V event){
  startMultimap.put(event.getStartTime(),event);
  endMultimap.put(event.getEndTime(),event);
}

Fixed version (ground truth):
public void add(V event){
  V existingEvent=values.get(event);
  if (existingEvent != null) {
    remove0(existingEvent);
  }
  add0(event);
}
Program: 11555
Project: 11555
Buggy source:
public void clear(){
  startMultimap.clear();
  endMultimap.clear();
}

Fixed version (ground truth):
public void clear(){
  values.clear();
  startMultimap.clear();
  endMultimap.clear();
}
Program: 11556
Project: 11556
Buggy source:
public void remove(V event){
  startMultimap.remove(event.getStartTime(),event);
  endMultimap.remove(event.getEndTime(),event);
}

Fixed version (ground truth):
public void remove(V event){
  V existingEvent=values.get(event);
  if (existingEvent != null) {
    remove0(existingEvent);
  }
 else {
    remove0(event);
  }
}
Program: 11557
Project: 11557
Buggy source:
public IntervalSortedMultimap(){
  startMultimap=buildMap();
  endMultimap=buildMap();
  startMap=(SortedMap<K,Collection<V>>)startMultimap.asMap();
  endMap=(SortedMap<K,Collection<V>>)endMultimap.asMap();
}

Fixed version (ground truth):
public IntervalSortedMultimap(){
  values=Maps.newHashMap();
  startMultimap=buildMap();
  endMultimap=buildMap();
  startMap=(SortedMap<K,Collection<V>>)startMultimap.asMap();
  endMap=(SortedMap<K,Collection<V>>)endMultimap.asMap();
}
Program: 11560
Project: 11560
Buggy source:
public Example(SwingGlimpseCanvas canvas,RepaintManager manager,JFrame frame,GlimpseLayout layout){
  super();
  this.canvas=canvas;
  this.manager=manager;
  this.frame=frame;
  this.layout=layout;
}

Fixed version (ground truth):
public Example(NewtGlimpseCanvas canvas,RepaintManager manager,JFrame frame,GlimpseLayout layout){
  super();
  this.canvas=canvas;
  this.manager=manager;
  this.frame=frame;
  this.layout=layout;
}
Program: 11561
Project: 11561
Buggy source:
public static void showWithSwing(GlimpseLayoutProvider layoutProviderA,GlimpseLayoutProvider layoutProviderB) throws Exception {
  GLContext context=createPixelBuffer(1,1).getContext();
  SwingGlimpseCanvas leftPanel=new SwingGlimpseCanvas(context);
  leftPanel.addLayout(layoutProviderA.getLayout());
  SwingGlimpseCanvas rightPanel=new SwingGlimpseCanvas(context);
  rightPanel.addLayout(layoutProviderB.getLayout());
  RepaintManager repaintManager=new NEWTRepaintManager(leftPanel.getGLDrawable());
  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 {
  final GLOffscreenAutoDrawable pBuffer=createPixelBuffer(1,1);
  final GLContext context=pBuffer.getContext();
  NewtGlimpseCanvas leftPanel=new NewtGlimpseCanvas(context);
  leftPanel.addLayout(layoutProviderA.getLayout());
  NewtGlimpseCanvas rightPanel=new NewtGlimpseCanvas(context);
  rightPanel.addLayout(layoutProviderB.getLayout());
  RepaintManager repaintManager=new NEWTRepaintManager(leftPanel.getGLDrawable());
  repaintManager.addGlimpseCanvas(leftPanel);
  repaintManager.addGlimpseCanvas(rightPanel);
  repaintManager.start();
  JFrame rightFrame=new JFrame("String_Node_Str");
  rightPanel.addDisposeListener(rightFrame,pBuffer);
  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");
  leftPanel.addDisposeListener(leftFrame,pBuffer);
  leftFrame.add(leftPanel);
  leftFrame.pack();
  leftFrame.setSize(800,800);
  leftFrame.setLocation(0,0);
  leftFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  leftFrame.setVisible(true);
  return;
}
Program: 11562
Project: 11562
Buggy source:
public SwingGlimpseCanvas getCanvas(){
  return canvas;
}

Fixed version (ground truth):
public NewtGlimpseCanvas getCanvas(){
  return canvas;
}
Program: 11563
Project: 11563
Buggy source:
protected static GlimpseLayout buildPlot(final SwingGlimpseCanvas canvas) throws Exception {
  GlimpseLayout layout=new SimpleLayoutExample().getLayout();
  final JPopupMenu _popupMenu=createPopupMenu();
  canvas.getGLWindow().addMouseListener(new MouseAdapter(){
    @Override public void mouseClicked(    MouseEvent event){
      if (event.getButton() == MouseEvent.BUTTON3) {
        _popupMenu.show(canvas,event.getX(),event.getY());
      }
    }
  }
);
  return layout;
}

Fixed version (ground truth):
protected static GlimpseLayout buildPlot(final NewtGlimpseCanvas canvas) throws Exception {
  GlimpseLayout layout=new SimpleLayoutExample().getLayout();
  final JPopupMenu _popupMenu=createPopupMenu();
  canvas.getGLWindow().addMouseListener(new MouseAdapter(){
    @Override public void mouseClicked(    MouseEvent event){
      if (event.getButton() == MouseEvent.BUTTON3) {
        _popupMenu.show(canvas,event.getX(),event.getY());
      }
    }
  }
);
  return layout;
}
Program: 11564
Project: 11564
Buggy source:
public static void main(String[] args) throws Exception {
  final SwingGlimpseCanvas canvas=new SwingGlimpseCanvas();
  GlimpseLayout plot=buildPlot(canvas);
  canvas.addLayout(plot);
  canvas.setLookAndFeel(new SwingLookAndFeel());
  final JFrame frame=new JFrame("String_Node_Str");
  frame.addWindowListener(new WindowAdapter(){
    @Override public void windowClosing(    WindowEvent e){
      canvas.dispose();
      frame.remove(canvas);
    }
  }
);
  frame.add(canvas);
  frame.pack();
  frame.setSize(800,800);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setVisible(true);
  return;
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  final NewtGlimpseCanvas canvas=new NewtGlimpseCanvas();
  GlimpseLayout plot=buildPlot(canvas);
  canvas.addLayout(plot);
  canvas.setLookAndFeel(new SwingLookAndFeel());
  NEWTRepaintManager.newRepaintManager(canvas);
  final JFrame frame=new JFrame("String_Node_Str");
  frame.addWindowListener(new WindowAdapter(){
    @Override public void windowClosing(    WindowEvent e){
      canvas.dispose();
      frame.remove(canvas);
    }
  }
);
  frame.add(canvas);
  frame.pack();
  frame.setSize(800,800);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setVisible(true);
  return;
}
Program: 11565
Project: 11565
Buggy source:
public static void main(String[] args) throws Exception {
  final SwingGlimpseCanvas canvas=new SwingGlimpseCanvas();
  GlimpseLayout plot=new HeatMapExample().getLayout();
  canvas.addLayout(plot);
  canvas.setLookAndFeel(new SwingLookAndFeel());
  SwingRepaintManager.newRepaintManager(canvas);
  final JFrame frame=makeFrame(0,0,800,800);
  final JFrame frame2=makeFrame(800,0,800,800);
  frame.add(canvas);
  new Timer(1000,new ActionListener(){
    boolean toc=true;
    @Override public void actionPerformed(    ActionEvent e){
      if (toc) {
        frame.remove(canvas);
        frame2.add(canvas);
      }
 else {
        frame2.remove(canvas);
        frame.add(canvas);
      }
      frame2.validate();
      frame.validate();
      toc=!toc;
    }
  }
).start();
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  final NewtGlimpseCanvas canvas=new NewtGlimpseCanvas();
  GlimpseLayout plot=new HeatMapExample().getLayout();
  canvas.addLayout(plot);
  canvas.setLookAndFeel(new SwingLookAndFeel());
  NEWTRepaintManager.newRepaintManager(canvas);
  final JFrame frame=makeFrame(0,0,800,800);
  final JFrame frame2=makeFrame(800,0,800,800);
  frame.add(canvas);
  new Timer(1000,new ActionListener(){
    boolean toc=true;
    @Override public void actionPerformed(    ActionEvent e){
      if (toc) {
        frame.remove(canvas);
        frame2.add(canvas);
      }
 else {
        frame2.remove(canvas);
        frame.add(canvas);
      }
      frame2.validate();
      frame.validate();
      toc=!toc;
    }
  }
).start();
}
Program: 11566
Project: 11566
Buggy source:
public static JFrame createFrame(String name,final SwingGlimpseCanvas canvas){
  final JFrame frame=new JFrame(name);
  frame.addWindowListener(new WindowAdapter(){
    @Override public void windowClosing(    WindowEvent e){
      canvas.dispose();
      frame.remove(canvas);
    }
  }
);
  frame.add(canvas);
  frame.pack();
  frame.setSize(800,800);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setVisible(true);
  return frame;
}

Fixed version (ground truth):
public static JFrame createFrame(String name,final NewtGlimpseCanvas canvas){
  final JFrame frame=new JFrame(name);
  frame.addWindowListener(new WindowAdapter(){
    @Override public void windowClosing(    WindowEvent e){
      canvas.dispose();
      frame.remove(canvas);
    }
  }
);
  frame.add(canvas);
  frame.pack();
  frame.setSize(800,800);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setVisible(true);
  return frame;
}
Program: 11567
Project: 11567
Buggy source:
public static void main(String[] args) throws Exception {
  GLContext context=createPixelBuffer(1,1).getContext();
  final SwingGlimpseCanvas canvas=new SwingGlimpseCanvas(context);
  ColorAxisPlot2D layout=new HeatMapExample().getLayout();
  canvas.addLayout(layout);
  canvas.setLookAndFeel(new SwingLookAndFeel());
  final RepaintManager manager=SwingRepaintManager.newRepaintManager(canvas);
  final FrameBufferGlimpseCanvas offscreenCanvas=new FrameBufferGlimpseCanvas(800,800,context);
  offscreenCanvas.addLayout(layout);
  manager.addGlimpseCanvas(offscreenCanvas);
  final SwingGlimpseCanvas canvas2=new SwingGlimpseCanvas(context);
  canvas2.addLayout(new ReprojectionExample().getLayout(offscreenCanvas));
  canvas2.setLookAndFeel(new SwingLookAndFeel());
  manager.addGlimpseCanvas(canvas2);
  createFrame("String_Node_Str",canvas);
  createFrame("String_Node_Str",canvas2);
  Runtime.getRuntime().addShutdownHook(new Thread(){
    @Override public void run(){
      offscreenCanvas.dispose();
    }
  }
);
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  GLContext context=createPixelBuffer(1,1).getContext();
  final NewtGlimpseCanvas canvas=new NewtGlimpseCanvas(context);
  ColorAxisPlot2D layout=new HeatMapExample().getLayout();
  canvas.addLayout(layout);
  canvas.setLookAndFeel(new SwingLookAndFeel());
  final RepaintManager manager=NEWTRepaintManager.newRepaintManager(canvas);
  final FrameBufferGlimpseCanvas offscreenCanvas=new FrameBufferGlimpseCanvas(800,800,context);
  offscreenCanvas.addLayout(layout);
  manager.addGlimpseCanvas(offscreenCanvas);
  final NewtGlimpseCanvas canvas2=new NewtGlimpseCanvas(context);
  canvas2.addLayout(new ReprojectionExample().getLayout(offscreenCanvas));
  canvas2.setLookAndFeel(new SwingLookAndFeel());
  manager.addGlimpseCanvas(canvas2);
  createFrame("String_Node_Str",canvas);
  createFrame("String_Node_Str",canvas2);
  Runtime.getRuntime().addShutdownHook(new Thread(){
    @Override public void run(){
      offscreenCanvas.dispose();
    }
  }
);
}
Program: 11568
Project: 11568
Buggy source:
public static void main(String[] args) throws Exception {
  GLContext context=createPixelBuffer(1,1).getContext();
  final SwingGlimpseCanvas canvas=new SwingGlimpseCanvas(context);
  canvas.addLayout(new ScreenCaptureExample().getLayout(context));
  canvas.setLookAndFeel(new SwingLookAndFeel());
  final JFrame frame=new JFrame("String_Node_Str");
  frame.addWindowListener(new WindowAdapter(){
    @Override public void windowClosing(    WindowEvent e){
      canvas.dispose();
      frame.remove(canvas);
    }
  }
);
  frame.add(canvas);
  frame.pack();
  frame.setSize(800,800);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setVisible(true);
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  GLContext context=createPixelBuffer(1,1).getContext();
  final NewtGlimpseCanvas canvas=new NewtGlimpseCanvas(context);
  canvas.addLayout(new ScreenCaptureExample().getLayout(context));
  canvas.setLookAndFeel(new SwingLookAndFeel());
  final JFrame frame=new JFrame("String_Node_Str");
  frame.addWindowListener(new WindowAdapter(){
    @Override public void windowClosing(    WindowEvent e){
      canvas.dispose();
      frame.remove(canvas);
    }
  }
);
  frame.add(canvas);
  frame.pack();
  frame.setSize(800,800);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setVisible(true);
}
Program: 11569
Project: 11569
Buggy source:
@Override public StackedTimePlot2D getLayout(){
  StackedTimePlot2D plot=createPlot();
  Epoch epoch=plot.getEpoch();
  TimeStamp selectionMaxTime=epoch.getTimeStamp();
  TimeStamp selectionMinTime=selectionMaxTime.subtract(Time.fromHours(3));
  TimeStamp axisMaxTime=selectionMaxTime.add(Time.fromHours(1));
  TimeStamp axisMinTime=selectionMaxTime.subtract(Time.fromHours(20));
  plot.setTimeSelection(selectionMinTime,selectionMaxTime);
  plot.setTimeAxisBounds(axisMinTime,axisMaxTime);
  plot.setPlotSpacing(2);
  plot.setBorderSize(4);
  TimePlotInfo plot1=plot.createTimePlot("String_Node_Str");
  TimePlotInfo plot2=plot.createTimePlot("String_Node_Str");
  plot1.setLabelText("String_Node_Str");
  plot2.setLabelText("String_Node_Str");
  plot.setLabelSize(30);
  plot.showLabels(true);
  plot1.getLabelPainter().setHorizontalLabels(false);
  plot2.getLabelPainter().setHorizontalLabels(false);
  setChartData(plot1,epoch,axisMinTime,axisMaxTime);
  setChartData(plot2,epoch,axisMinTime,axisMaxTime);
  addMouseListener(epoch,plot1);
  addMouseListener(epoch,plot2);
  return plot;
}

Fixed version (ground truth):
@Override public StackedTimePlot2D getLayout(){
  StackedTimePlot2D plot=createPlot();
  Epoch epoch=plot.getEpoch();
  TimeStamp selectionMaxTime=epoch.getTimeStamp();
  TimeStamp selectionMinTime=selectionMaxTime.subtract(Time.fromHours(3));
  TimeStamp axisMaxTime=selectionMaxTime.add(Time.fromHours(1));
  TimeStamp axisMinTime=selectionMaxTime.subtract(Time.fromHours(20));
  plot.setTimeSelection(selectionMinTime,selectionMaxTime);
  plot.setTimeAxisBounds(axisMinTime,axisMaxTime);
  plot.setPlotSpacing(2);
  plot.setBorderSize(4);
  TimePlotInfo plot1=plot.createTimePlot("String_Node_Str");
  TimePlotInfo plot2=plot.createTimePlot("String_Node_Str");
  plot1.getLabelPainter().setHorizontalLabels(false);
  plot2.getLabelPainter().setHorizontalLabels(false);
  setChartData(plot1,epoch,axisMinTime,axisMaxTime);
  setChartData(plot2,epoch,axisMinTime,axisMaxTime);
  addMouseListener(epoch,plot1);
  addMouseListener(epoch,plot2);
  return plot;
}
Program: 11570
Project: 11570
Buggy source:
@Override protected void setRowColumnConstraints(){
  if (indentSubplots) {
    int maxLevel=setIndentLevel0();
    setRowColumnConstraints(maxLevel,labelLayoutSize);
  }
 else {
    resetIndentLevel0(0);
    setRowColumnConstraints(0,labelLayoutSize);
  }
}

Fixed version (ground truth):
@Override protected void setRowColumnConstraints(){
  if (indentSubplots) {
    int maxLevel=setIndentLevel0();
    setRowColumnConstraints(maxLevel,getLabelSize());
  }
 else {
    resetIndentLevel0(0);
    setRowColumnConstraints(0,getLabelSize());
  }
}
Program: 11572
Project: 11572
Buggy source:
@Override public void updateLayout(int index){
  setGrow(!doAnyOtherPlotsGrow());
  super.updateLayout(index);
  if (timeLayout == null)   return;
  if (isTimeAxisHorizontal()) {
    timeLayout.setLayoutData(String.format("String_Node_Str",labelLayoutSize));
  }
 else {
    timeLayout.setLayoutData(String.format("String_Node_Str",labelLayoutSize));
  }
}

Fixed version (ground truth):
@Override public void updateLayout(int index){
  setGrow(!doAnyOtherPlotsGrow());
  super.updateLayout(index);
  if (timeLayout == null)   return;
  if (isTimeAxisHorizontal()) {
    timeLayout.setLayoutData(String.format("String_Node_Str",getLabelSize()));
  }
 else {
    timeLayout.setLayoutData(String.format("String_Node_Str",getLabelSize()));
  }
}
Program: 11573
Project: 11573
Buggy source:
@Override protected int getOverlayLayoutOffsetX(){
  return orient == VERTICAL ? labelLayoutSize : 0;
}

Fixed version (ground truth):
@Override protected int getOverlayLayoutOffsetX(){
  return orient == VERTICAL ? getLabelSize() : 0;
}
Program: 11574
Project: 11574
Buggy source:
@Override protected int getOverlayLayoutOffsetY2(){
  return orient == VERTICAL ? 0 : labelLayoutSize;
}

Fixed version (ground truth):
@Override protected int getOverlayLayoutOffsetY2(){
  return orient == VERTICAL ? 0 : getLabelSize();
}
Program: 11575
Project: 11575
Buggy source:
public int getLabelSize(){
  return this.labelLayoutSize;
}

Fixed version (ground truth):
public int getLabelSize(){
  return showLabelLayout ? this.labelLayoutSize : 0;
}
Program: 11576
Project: 11576
Buggy source:
public static GlimpseMouseEvent fromMouseEvent(MouseEvent event,GlimpseTargetStack stack,int x,int y){
  int wheelIncrement=(int)-event.getRotation()[1];
  int clickCount=event.getClickCount();
  EnumSet<MouseButton> buttons=getMouseButtons(event);
  EnumSet<ModifierKey> modifiers=getModifierKeys(event);
  return new GlimpseMouseEvent(stack,modifiers,buttons,x,y,wheelIncrement,clickCount);
}

Fixed version (ground truth):
public static GlimpseMouseEvent fromMouseEvent(MouseEvent event,GlimpseTargetStack stack,int x,int y){
  System.out.println(Arrays.toString(event.getRotation()));
  int wheelIncrement=getWheelIncrement(event);
  int clickCount=event.getClickCount();
  EnumSet<MouseButton> buttons=getMouseButtons(event);
  EnumSet<ModifierKey> modifiers=getModifierKeys(event);
  return new GlimpseMouseEvent(stack,modifiers,buttons,x,y,wheelIncrement,clickCount);
}
Program: 11577
Project: 11577
Buggy source:
protected void updateSelectedTime(){
  if (timeAttributeBuffer != null) {
    startIndex=binarySearch0(timeAttributeBuffer,0,timeAttributeBuffer.limit(),startTime);
    if (startIndex < 0)     startIndex=-startIndex + 1;
    endIndex=binarySearch0(timeAttributeBuffer,0,timeAttributeBuffer.limit(),endTime);
    if (endIndex < 0)     endIndex=-endIndex + 1;
  }
 else   if (positionBuffer != null) {
    startIndex=0;
    endIndex=positionBuffer.getNumVertices();
  }
}

Fixed version (ground truth):
protected void updateSelectedTime(){
  if (timeAttributeBuffer != null) {
    startIndex=binarySearch0(timeAttributeBuffer,0,timeAttributeBuffer.limit(),startTime);
    if (startIndex < 0)     startIndex=-(startIndex + 1);
    endIndex=binarySearch0(timeAttributeBuffer,0,timeAttributeBuffer.limit(),endTime);
    if (endIndex < 0)     endIndex=-(endIndex + 1);
  }
 else   if (positionBuffer != null) {
    startIndex=0;
    endIndex=positionBuffer.getNumVertices();
  }
}
Program: 11579
Project: 11579
Buggy source:
public void select(Axis1D axis,boolean horizontal,float posX,float posY){
  if (!allowSelect)   return;
  if (axis.isSelectionLocked())   return;
  double posPixels=getDim(horizontal,posX,posY);
  double posData=posPixels / axis.getPixelsPerValue();
  axis.setSelectionCenter(posData);
}

Fixed version (ground truth):
public void select(Axis1D axis,boolean horizontal,float posX,float posY){
  if (!allowSelect)   return;
  double posPixels=getDim(horizontal,posX,posY);
  double posData=axis.screenPixelToValue(posPixels);
  axis.setMouseValue(posData);
  if (!axis.isSelectionLocked()) {
    axis.setSelectionCenter(posData);
  }
}
Program: 11580
Project: 11580
Buggy source:
@Override public void panDetected(GlimpsePanGestureEvent event){
  GlimpseAxisLayout1D layout=getAxisLayout(event.getTargetStack());
  if (layout == null)   return;
  Axis1D targetAxis=layout.getAxis(event.getTargetStack());
  pan(targetAxis,layout.isHorizontal(),event.getDx(),event.getDy());
  this.validateAxes(targetAxis);
}

Fixed version (ground truth):
@Override public void panDetected(GlimpsePanGestureEvent event){
  GlimpseAxisLayout1D layout=getAxisLayout(event.getTargetStack());
  if (layout == null)   return;
  Axis1D targetAxis=layout.getAxis(event.getTargetStack());
  pan(targetAxis,layout.isHorizontal(),event.getDx(),event.getDy());
  validateAxes(targetAxis);
}
Program: 11581
Project: 11581
Buggy source:
@Override public void pinchDetected(GlimpsePinchGestureEvent event){
  GlimpseAxisLayout1D layout=getAxisLayout(event.getTargetStack());
  if (layout == null)   return;
  Axis1D targetAxis=layout.getAxis(event.getTargetStack());
  zoom(targetAxis,layout.isHorizontal(),event.getX(),event.getY(),event.getScale());
  this.validateAxes(targetAxis);
}

Fixed version (ground truth):
@Override public void pinchDetected(GlimpsePinchGestureEvent event){
  GlimpseAxisLayout1D layout=getAxisLayout(event.getTargetStack());
  if (layout == null)   return;
  Axis1D targetAxis=layout.getAxis(event.getTargetStack());
  zoom(targetAxis,layout.isHorizontal(),event.getX(),event.getY(),event.getScale());
  validateAxes(targetAxis);
}
Program: 11582
Project: 11582
Buggy source:
@Override public void tapDetected(GlimpseTapGestureEvent event){
  GlimpseAxisLayout1D layout=getAxisLayout(event.getTargetStack());
  if (layout == null)   return;
  Axis1D targetAxis=layout.getAxis(event.getTargetStack());
  select(targetAxis,layout.isHorizontal(),event.getX(),event.getY());
  this.validateAxes(targetAxis);
}

Fixed version (ground truth):
@Override public void tapDetected(GlimpseTapGestureEvent event){
  GlimpseAxisLayout1D layout=getAxisLayout(event.getTargetStack());
  if (layout == null)   return;
  Axis1D targetAxis=layout.getAxis(event.getTargetStack());
  select(targetAxis,layout.isHorizontal(),event.getX(),event.getY());
  validateAxes(targetAxis);
}
Program: 11583
Project: 11583
Buggy source:
protected Touchable getTouchTarget(GlimpseTargetStack stack){
  if (stack == null) {
    return null;
  }
  GlimpseTarget target=stack.getTarget();
  if (target == null || !(target instanceof Touchable)) {
    return null;
  }
  Touchable touchTarget=(Touchable)target;
  return touchTarget;
}

Fixed version (ground truth):
protected Touchable getTouchTarget(GlimpseTargetStack stack){
  if (stack == null) {
    return null;
  }
  GlimpseTarget target=stack.getTarget();
  if (target instanceof Touchable) {
    return (Touchable)target;
  }
  return null;
}
Program: 11584
Project: 11584
Buggy source:
public int getDirection(){
  return direction;
}

Fixed version (ground truth):
/** 
 * The angle of the swipe, in MATH RADIANS.
 */
public int getDirection(){
  return direction;
}
Program: 11585
Project: 11585
Buggy source:
/** 
 * Links two WorldWindows so that the eye position of the master window is copied to the eye position of the slave. Does not set up the reverse link. However, the caller may call again with the arguments reversed to have both windows reflect each others position.
 * @param master
 * @param slave
 */
public static void linkWorldWindToWorldWind(final WorldWindow master,final WorldWindow slave){
  master.addPositionListener(new PositionListener(){
    @Override public void moved(    PositionEvent event){
      Position pos=master.getView().getCurrentEyePosition();
      slave.getView().setEyePosition(pos);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Links two WorldWindows so that the eye position of the master window is copied to the eye position of the slave. Does not set up the reverse link. However, the caller may call again with the arguments reversed to have both windows reflect each others position.
 * @param master
 * @param slave
 */
public static void linkWorldWindToWorldWind(final WorldWindow master,final WorldWindow slave){
  master.addPositionListener(new PositionListener(){
    @Override public void moved(    PositionEvent event){
      Position pos=master.getView().getCurrentEyePosition();
      slave.getView().setEyePosition(pos);
      slave.redraw();
    }
  }
);
}
Program: 11586
Project: 11586
Buggy source:
protected void pruneIndex(int updateIndex){
  lock.lock();
  try {
    if (!indexEnabled) {
      xyIndex=null;
      return;
    }
    if (xyIndex == null || updateIndex > getNumVertices()) {
      xyIndex=null;
    }
 else {
      for (int i=updateIndex; i < getNumVertices(); i++) {
        xyIndex.remove(i);
      }
    }
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
protected void pruneIndex(int updateIndex){
  lock.lock();
  try {
    if (!indexEnabled) {
      xyIndex=null;
      return;
    }
    if (xyIndex == null || updateIndex == 0) {
      xyIndex=null;
    }
 else {
      for (int i=updateIndex; i < getNumVertices(); i++) {
        xyIndex.remove(i);
      }
    }
  }
  finally {
    lock.unlock();
  }
}
Program: 11587
Project: 11587
Buggy source:
protected void updateIndex(int updateIndex){
  lock.lock();
  try {
    if (!indexEnabled) {
      xyIndex=null;
      return;
    }
    if (xyIndex == null) {
      xyIndex=new QuadTreeInts(MAX_BUCKET_SIZE){
        @Override protected final float x(        int i){
          return data.asFloatBuffer().get(i * 2);
        }
        @Override protected final float y(        int i){
          return data.asFloatBuffer().get(i * 2 + 1);
        }
      }
;
      for (int i=0; i < getNumVertices(); i++) {
        xyIndex.add(i);
      }
    }
 else {
      for (int i=updateIndex; i < getNumVertices(); i++) {
        xyIndex.add(i);
      }
    }
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
protected void updateIndex(int updateIndex){
  lock.lock();
  try {
    if (!indexEnabled) {
      xyIndex=null;
      return;
    }
    if (xyIndex == null) {
      xyIndex=new QuadTreeInts(MAX_BUCKET_SIZE){
        @Override public final float x(        int i){
          return data.asFloatBuffer().get(i * 2);
        }
        @Override public final float y(        int i){
          return data.asFloatBuffer().get(i * 2 + 1);
        }
      }
;
      for (int i=0; i < getNumVertices(); i++) {
        xyIndex.add(i);
      }
    }
 else {
      for (int i=updateIndex; i < getNumVertices(); i++) {
        xyIndex.add(i);
      }
    }
  }
  finally {
    lock.unlock();
  }
}
Program: 11588
Project: 11588
Buggy source:
@Override protected final float x(int i){
  return data.asFloatBuffer().get(i * 2);
}

Fixed version (ground truth):
@Override public final float x(int i){
  return data.asFloatBuffer().get(i * 2);
}
Program: 11589
Project: 11589
Buggy source:
@Override protected final float y(int i){
  return data.asFloatBuffer().get(i * 2 + 1);
}

Fixed version (ground truth):
@Override public final float y(int i){
  return data.asFloatBuffer().get(i * 2 + 1);
}
Program: 11590
Project: 11590
Buggy source:
protected void createIndex(){
  lock.lock();
  try {
    if (!indexEnabled) {
      xyIndex=null;
      return;
    }
    xyIndex=new QuadTreeInts(MAX_BUCKET_SIZE){
      @Override protected final float x(      int i){
        return data.asFloatBuffer().get(i * 2);
      }
      @Override protected final float y(      int i){
        return data.asFloatBuffer().get(i * 2 + 1);
      }
    }
;
    for (int i=0; i < getNumVertices(); i++) {
      xyIndex.add(i);
    }
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
protected void createIndex(){
  lock.lock();
  try {
    if (!indexEnabled) {
      xyIndex=null;
      return;
    }
    xyIndex=new QuadTreeInts(MAX_BUCKET_SIZE){
      @Override public final float x(      int i){
        return data.asFloatBuffer().get(i * 2);
      }
      @Override public final float y(      int i){
        return data.asFloatBuffer().get(i * 2 + 1);
      }
    }
;
    for (int i=0; i < getNumVertices(); i++) {
      xyIndex.add(i);
    }
  }
  finally {
    lock.unlock();
  }
}
Program: 11591
Project: 11591
Buggy source:
public static List<LatLon> getCorners(DrawContext dc){
  View view=dc.getView();
  Rectangle viewport=view.getViewport();
  List<LatLon> corners=new ArrayList<LatLon>(4);
  corners.add(view.computePositionFromScreenPoint(viewport.getMinX(),viewport.getMinY()));
  corners.add(view.computePositionFromScreenPoint(viewport.getMinX(),viewport.getMaxY()));
  corners.add(view.computePositionFromScreenPoint(viewport.getMaxX(),viewport.getMaxY()));
  corners.add(view.computePositionFromScreenPoint(viewport.getMaxX(),viewport.getMinY()));
  return corners;
}

Fixed version (ground truth):
public static List<LatLon> getCorners(LatLonBounds bounds){
  List<LatLon> corners=new ArrayList<LatLon>();
  corners.add(LatLon.fromDegrees(bounds.minLat,bounds.minLon));
  corners.add(LatLon.fromDegrees(bounds.minLat,bounds.maxLon));
  corners.add(LatLon.fromDegrees(bounds.maxLat,bounds.maxLon));
  corners.add(LatLon.fromDegrees(bounds.maxLat,bounds.minLon));
  return corners;
}
Program: 11592
Project: 11592
Buggy source:
protected void updateGeometry(DrawContext dc){
  corners=maxCorners;
  bounds=maxBounds;
  List<LatLon> screenCorners=getCorners0(dc);
  if (isValid(screenCorners)) {
    LatLonBounds screenBounds=bufferCorners(getCorners(screenCorners),0.5);
    bounds=getIntersectedCorners(maxBounds,screenBounds);
    corners=getCorners(bounds);
  }
  if (tile != null) {
    setAxes(axes,bounds,projection);
    tile.setCorners(corners);
  }
}

Fixed version (ground truth):
protected void updateGeometry(List<LatLon> screenCorners){
  LatLonBounds screenBounds=bufferCorners(getCorners(screenCorners),0.5);
  bounds=getIntersectedCorners(maxBounds,screenBounds);
  corners=getCorners(bounds);
  updateTile();
}
Program: 11593
Project: 11593
Buggy source:
public DatumSphereWgs84(){
  super(avgGeodesicRadius);
}

Fixed version (ground truth):
public DatumSphereWgs84(){
  super(Constants.avgGeodesicRadius);
}
Program: 11594
Project: 11594
Buggy source:
public DatumWgs84(){
  super(equatorialRadius,flattening);
}

Fixed version (ground truth):
public DatumWgs84(){
  super(Constants.equatorialRadius,Constants.flattening);
}
Program: 11597
Project: 11597
Buggy source:
@Override public double getTextureFractionY(double vertexX,double vertexY){
  double texFracUnnormY=(vertexY - minX) / diffY;
  return texFracUnnormY * diffTexY + minTexY;
}

Fixed version (ground truth):
@Override public double getTextureFractionY(double vertexX,double vertexY){
  double texFracUnnormY=(vertexY - minY) / diffY;
  return texFracUnnormY * diffTexY + minTexY;
}
Program: 11598
Project: 11598
Buggy source:
protected void allocate_genBuffers(GL gl){
  if (vertexCoordHandles != null)   gl.glDeleteBuffers(numTextures,vertexCoordHandles,0);
  if (texCoordHandles != null)   gl.glDeleteBuffers(numTextures,texCoordHandles,0);
  if (numTextures == 0 || projection == null)   return;
  vertexCoordHandles=new int[numTextures];
  gl.glGenBuffers(numTextures,vertexCoordHandles,0);
  texCoordHandles=new int[numTextures];
  gl.glGenBuffers(numTextures,texCoordHandles,0);
  texStartsX=new int[numTextures];
  texStartsY=new int[numTextures];
  texSizesX=new int[numTextures];
  texSizesY=new int[numTextures];
  texQuadCounts=new int[numTextures];
  int index=0;
  for (int x=0; x < textureCountX; x++) {
    for (int y=0; y < textureCountY; y++) {
      int startX=x * maxTextureSize;
      int startY=y * maxTextureSize;
      int endX=Math.min(startX + maxTextureSize,dataSizeX);
      int endY=Math.min(startY + maxTextureSize,dataSizeY);
      int sizeX=endX - startX;
      int sizeY=endY - startY;
      texStartsX[index]=startX;
      texStartsY[index]=startY;
      texSizesX[index]=sizeX;
      texSizesY[index]=sizeY;
      texQuadCounts[index]=getQuadCountForTexture(index,startX,startY,sizeX,sizeY);
      index++;
    }
  }
  glAllocated=true;
  makeDirty();
  makeProjectionDirty();
}

Fixed version (ground truth):
protected void allocate_genBuffers(GL gl){
  if (vertexCoordHandles != null && vertexCoordHandles.length != 0) {
    gl.glDeleteBuffers(vertexCoordHandles.length,vertexCoordHandles,0);
  }
  if (texCoordHandles != null && texCoordHandles.length != 0) {
    gl.glDeleteBuffers(texCoordHandles.length,texCoordHandles,0);
  }
  if (numTextures == 0 || projection == null)   return;
  vertexCoordHandles=new int[numTextures];
  gl.glGenBuffers(numTextures,vertexCoordHandles,0);
  texCoordHandles=new int[numTextures];
  gl.glGenBuffers(numTextures,texCoordHandles,0);
  texStartsX=new int[numTextures];
  texStartsY=new int[numTextures];
  texSizesX=new int[numTextures];
  texSizesY=new int[numTextures];
  texQuadCounts=new int[numTextures];
  int index=0;
  for (int x=0; x < textureCountX; x++) {
    for (int y=0; y < textureCountY; y++) {
      int startX=x * maxTextureSize;
      int startY=y * maxTextureSize;
      int endX=Math.min(startX + maxTextureSize,dataSizeX);
      int endY=Math.min(startY + maxTextureSize,dataSizeY);
      int sizeX=endX - startX;
      int sizeY=endY - startY;
      texStartsX[index]=startX;
      texStartsY[index]=startY;
      texSizesX[index]=sizeX;
      texSizesY[index]=sizeY;
      texQuadCounts[index]=getQuadCountForTexture(index,startX,startY,sizeX,sizeY);
      index++;
    }
  }
  glAllocated=true;
  makeDirty();
  makeProjectionDirty();
}
Program: 11599
Project: 11599
Buggy source:
protected void allocate_genTextureHandles(GL gl){
  if (textureHandles != null)   gl.glDeleteTextures(numTextures,textureHandles,0);
  if (numTextures == 0 || projection == null)   return;
  textureHandles=new int[numTextures];
  gl.glGenTextures(numTextures,textureHandles,0);
}

Fixed version (ground truth):
protected void allocate_genTextureHandles(GL gl){
  if (textureHandles != null && textureHandles.length != 0) {
    gl.glDeleteTextures(textureHandles.length,textureHandles,0);
  }
  if (numTextures == 0 || projection == null)   return;
  textureHandles=new int[numTextures];
  gl.glGenTextures(numTextures,textureHandles,0);
}
Program: 11600
Project: 11600
Buggy source:
@Override public void dispose(GLContext context){
  GL gl=context.getGL();
  if (textureHandles != null)   gl.glDeleteTextures(numTextures,textureHandles,0);
  if (vertexCoordHandles != null)   gl.glDeleteBuffers(numTextures,vertexCoordHandles,0);
  if (texCoordHandles != null)   gl.glDeleteBuffers(numTextures,texCoordHandles,0);
}

Fixed version (ground truth):
@Override public void dispose(GLContext context){
  GL gl=context.getGL();
  if (textureHandles != null && textureHandles.length != 0) {
    gl.glDeleteTextures(textureHandles.length,textureHandles,0);
  }
  if (vertexCoordHandles != null && vertexCoordHandles.length != 0) {
    gl.glDeleteBuffers(vertexCoordHandles.length,vertexCoordHandles,0);
  }
  if (texCoordHandles != null && texCoordHandles.length != 0) {
    gl.glDeleteBuffers(texCoordHandles.length,texCoordHandles,0);
  }
}
Program: 11601
Project: 11601
Buggy source:
public void deletePlot(Object id){
  this.lock.lock();
  try {
    PlotInfo info=stackedPlots.get(id);
    if (info == null)     return;
    this.removeLayout(info.getLayout());
    stackedPlots.remove(id);
    if (isAutoValidate())     validate();
  }
  finally {
    this.lock.unlock();
  }
}

Fixed version (ground truth):
public void deletePlot(Object id){
  this.lock.lock();
  try {
    PlotInfo info=stackedPlots.remove(id);
    if (info == null)     return;
    info.deletePlot();
    if (isAutoValidate())     validate();
  }
  finally {
    this.lock.unlock();
  }
}
Program: 11602
Project: 11602
Buggy source:
@Override public void addChildPlot(PlotInfo childPlot){
  childPlot.setVisible(this.expanded);
  this.children.add(childPlot);
  this.plot.validateLayout();
}

Fixed version (ground truth):
@Override public void addChildPlot(PlotInfo childPlot){
  childPlot.setVisible(this.expanded);
  this.children.add(childPlot);
  if (this.plot.isAutoValidate())   this.plot.validateLayout();
}
Program: 11603
Project: 11603
Buggy source:
@Override public void removeChildPlot(PlotInfo childPlot){
  this.children.remove(childPlot);
  this.plot.validateLayout();
}

Fixed version (ground truth):
@Override public void removeChildPlot(PlotInfo childPlot){
  this.children.remove(childPlot);
  if (this.plot.isAutoValidate())   this.plot.validateLayout();
}