nus-yam/ex-repair huggingface dataset:
Program: 11297
Project: 11297
Buggy source:
/** 
 * Creates a new SciJava application context with the specified services (and any required service dependencies). Service dependency candidates are selected from those discovered by the given   {@link PluginIndex}'s associated   {@link org.scijava.plugin.PluginFinder}. <p> NB: Context creation is an important step of a SciJava applictation's lifecycle. Particularly in environments where more than one implementation exists for various services, careful consideration should be exercised regaring what classes and plugins are provided to the Context, and what needs to occur during the initialization of these services (especially those of lower priority). See   {@link ServiceHelper#loadServices()} for moreinformation. </p>
 * @param serviceClasses A collection of types that implement the{@link Service} interface (e.g., {@code DisplayService.class}).
 * @param pluginIndex The plugin index to use when discovering and indexingplugins. If you wish to completely control how services are discovered (i.e., use your own {@link org.scijava.plugin.PluginFinder} implementation), then youcan pass a custom  {@link PluginIndex} here.
 */
public Context(final Collection<Class<? extends Service>> serviceClasses,final PluginIndex pluginIndex){
  serviceIndex=new ServiceIndex();
  this.pluginIndex=pluginIndex == null ? new PluginIndex() : pluginIndex;
  this.pluginIndex.discover();
  final ServiceHelper serviceHelper=new ServiceHelper(this,serviceClasses);
  serviceHelper.loadServices();
}

Fixed version (ground truth):
/** 
 * Creates a new SciJava application context with the specified services (and any required service dependencies). Service dependency candidates are selected from those discovered by the given   {@link PluginIndex}'s associated   {@link org.scijava.plugin.PluginFinder}. <p> NB: Context creation is an important step of a SciJava application's lifecycle. Particularly in environments where more than one implementation exists for various services, careful consideration should be exercised regarding what classes and plugins are provided to the Context, and what needs to occur during the initialization of these services (especially those of lower priority). See   {@link ServiceHelper#loadServices()} for moreinformation. </p>
 * @param serviceClasses A collection of types that implement the{@link Service} interface (e.g., {@code DisplayService.class}).
 * @param pluginIndex The plugin index to use when discovering and indexingplugins. If you wish to completely control how services are discovered (i.e., use your own {@link org.scijava.plugin.PluginFinder} implementation), then youcan pass a custom  {@link PluginIndex} here.
 */
public Context(final Collection<Class<? extends Service>> serviceClasses,final PluginIndex pluginIndex){
  serviceIndex=new ServiceIndex();
  this.pluginIndex=pluginIndex == null ? new PluginIndex() : pluginIndex;
  this.pluginIndex.discover();
  final ServiceHelper serviceHelper=new ServiceHelper(this,serviceClasses);
  serviceHelper.loadServices();
}
Program: 11298
Project: 11298
Buggy source:
/** 
 * Cancels the command execution, with the given reason for doing so. 
 */
@Override public void cancel(final String reason){
  cancelReason=reason;
}

Fixed version (ground truth):
/** 
 * Cancels the command execution, with the given reason for doing so. 
 */
@Override public void cancel(final String reason){
  cancelReason=reason == null ? "String_Node_Str" : reason;
}
Program: 11299
Project: 11299
Buggy source:
@Override public void cancel(final String reason){
  cancelReason=reason;
}

Fixed version (ground truth):
@Override public void cancel(final String reason){
  cancelReason=reason == null ? "String_Node_Str" : reason;
}
Program: 11300
Project: 11300
Buggy source:
@Override public void cancel(final String reason){
  cancelReason=reason;
}

Fixed version (ground truth):
@Override public void cancel(final String reason){
  cancelReason=reason == null ? "String_Node_Str" : reason;
}
Program: 11301
Project: 11301
Buggy source:
@Override public void cancel(final String reason){
  cancelReason=reason;
}

Fixed version (ground truth):
@Override public void cancel(final String reason){
  cancelReason=reason == null ? "String_Node_Str" : reason;
}
Program: 11302
Project: 11302
Buggy source:
@Override public void cancel(final String reason){
  cancelReason=reason;
}

Fixed version (ground truth):
@Override public void cancel(final String reason){
  cancelReason=reason == null ? "String_Node_Str" : reason;
}
Program: 11303
Project: 11303
Buggy source:
/** 
 * Gets the component type of the given array type, or null if not an array. Supports both regular array types (i.e.,   {@link Class#getComponentType()}if   {@code type} is a {@link Class}) and generic array types (i.e.,  {@link GenericArrayType#getGenericComponentType()} if {@code type} is a{@link GenericArrayType}).
 */
public static Class<?> getComponentClass(final Type type){
  if (type instanceof Class)   return ((Class<?>)type).getComponentType();
  if (type instanceof GenericArrayType) {
    return (Class<?>)((GenericArrayType)type).getGenericComponentType();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gets the component type of the given array type, or null if not an array. Supports both regular array types (i.e.,   {@link Class#getComponentType()}if   {@code type} is a {@link Class}) and generic array types (i.e.,  {@link GenericArrayType#getGenericComponentType()} if {@code type} is a{@link GenericArrayType}).
 */
public static Class<?> getComponentClass(final Type type){
  if (type instanceof Class)   return ((Class<?>)type).getComponentType();
  if (type instanceof GenericArrayType) {
    return getClass(((GenericArrayType)type).getGenericComponentType());
  }
  return null;
}
Program: 11304
Project: 11304
Buggy source:
/** 
 * Tests   {@link CharArray#remove(Object)}. 
 */
@Test public void testRemove(){
  final char[] raw={3,5,8,13,21};
  final CharArray array=new CharArray(raw.clone());
  assertEquals(raw.length,array.size());
  array.remove(new Integer(raw[0]));
  assertEquals(raw.length - 1,array.size());
  array.remove(new Integer(raw[2]));
  assertEquals(raw.length - 2,array.size());
  array.remove(new Integer(raw[4]));
  assertEquals(raw.length - 3,array.size());
  assertEquals(raw[1],array.getValue(0));
  assertEquals(raw[3],array.getValue(1));
}

Fixed version (ground truth):
/** 
 * Tests   {@link CharArray#remove(Object)}. 
 */
@Test public void testRemove(){
  final char[] raw={3,5,8,13,21};
  final CharArray array=new CharArray(raw.clone());
  assertEquals(raw.length,array.size());
  array.remove(new Character(raw[0]));
  assertEquals(raw.length - 1,array.size());
  array.remove(new Character(raw[2]));
  assertEquals(raw.length - 2,array.size());
  array.remove(new Character(raw[4]));
  assertEquals(raw.length - 3,array.size());
  assertEquals(raw[1],array.getValue(0));
  assertEquals(raw[3],array.getValue(1));
}
Program: 11305
Project: 11305
Buggy source:
/** 
 * Tests   {@link CharArray#containsAll(Collection)}. 
 */
@Test public void testContainsAll(){
  final char[] raw={3,5,8,13,21};
  final CharArray array=new CharArray(raw.clone());
  final ArrayList<Integer> list=new ArrayList<Integer>();
  assertTrue(array.containsAll(list));
  list.add(13);
  assertTrue(array.containsAll(list));
  list.add(1);
  assertFalse(array.containsAll(list));
  final CharArray yes=new CharArray(new char[]{3,8,21});
  assertTrue(array.containsAll(yes));
  final CharArray no=new CharArray(new char[]{5,13,1});
  assertFalse(array.containsAll(no));
}

Fixed version (ground truth):
/** 
 * Tests   {@link CharArray#containsAll(Collection)}. 
 */
@Test public void testContainsAll(){
  final char[] raw={3,5,8,13,21};
  final CharArray array=new CharArray(raw.clone());
  final ArrayList<Character> list=new ArrayList<Character>();
  assertTrue(array.containsAll(list));
  list.add((char)13);
  assertTrue(array.containsAll(list));
  list.add((char)1);
  assertFalse(array.containsAll(list));
  final CharArray yes=new CharArray(new char[]{3,8,21});
  assertTrue(array.containsAll(yes));
  final CharArray no=new CharArray(new char[]{5,13,1});
  assertFalse(array.containsAll(no));
}
Program: 11306
Project: 11306
Buggy source:
@Override public void initialize(){
  log.info("String_Node_Str" + getPlugins() + "String_Node_Str"+ getPluginType().getSimpleName()+ "String_Node_Str");
}

Fixed version (ground truth):
@Override public void initialize(){
  log.info("String_Node_Str" + getPlugins().size() + "String_Node_Str"+ getPluginType().getSimpleName()+ "String_Node_Str");
}
Program: 11308
Project: 11308
Buggy source:
protected double printTickLabels(List<String> tickLabels,List<TimeStamp> tickTimes,Axis1D axis,int width,int height){
  Rectangle2D fixedBounds=textRenderer.getBounds("String_Node_Str");
  double textHeight=fixedBounds.getHeight();
  int jTimeText=Integer.MAX_VALUE;
  for (int index=0; index < tickLabels.size(); index++) {
    TimeStamp t=tickTimes.get(index);
    String string=tickLabels.get(index);
    Rectangle2D textBounds=textRenderer.getBounds(string);
    double textWidth=textBounds.getWidth();
    int i=(int)Math.round(axis.valueToScreenPixel(fromTimeStamp(t)) - 0.5 * textWidth);
    if (i < 0 || i + textWidth > width)     continue;
    int j=(int)Math.round(height - tickSize - textHeight) - tickBufferSize - textBufferSize;
    jTimeText=Math.min(jTimeText,j);
    textRenderer.draw(string,i,j);
  }
  return jTimeText;
}

Fixed version (ground truth):
protected double printTickLabels(List<String> tickLabels,List<TimeStamp> tickTimes,Axis1D axis,int width,int height){
  GlimpseColor.setColor(textRenderer,textColor);
  Rectangle2D fixedBounds=textRenderer.getBounds("String_Node_Str");
  double textHeight=fixedBounds.getHeight();
  int jTimeText=Integer.MAX_VALUE;
  for (int index=0; index < tickLabels.size(); index++) {
    TimeStamp t=tickTimes.get(index);
    String string=tickLabels.get(index);
    Rectangle2D textBounds=textRenderer.getBounds(string);
    double textWidth=textBounds.getWidth();
    int i=(int)Math.round(axis.valueToScreenPixel(fromTimeStamp(t)) - 0.5 * textWidth);
    if (i < 0 || i + textWidth > width)     continue;
    int j=(int)Math.round(height - tickSize - textHeight) - tickBufferSize - textBufferSize;
    jTimeText=Math.min(jTimeText,j);
    textRenderer.draw(string,i,j);
  }
  return jTimeText;
}
Program: 11309
Project: 11309
Buggy source:
protected void printHoverLabels(List<TimeStamp> tickTimes,Axis1D axis,double jTimeText,int width,int height){
  Rectangle2D fixedBounds=textRenderer.getBounds("String_Node_Str");
  double textHeight=fixedBounds.getHeight();
  List<TimeStruct> timeStructs=handler.getTimeStructs(axis,tickTimes);
  for (  TimeStruct time : timeStructs) {
    Rectangle2D textBounds=textRenderer.getBounds(time.text);
    double textWidth=textBounds.getWidth();
    int iMin=axis.valueToScreenPixel(fromTimeStamp(time.start));
    int iMax=(int)Math.floor(axis.valueToScreenPixel(fromTimeStamp(time.end)) - textWidth);
    int iApprox=(int)Math.round(axis.valueToScreenPixel(fromTimeStamp(time.textCenter)) - 0.5 * textWidth);
    int i=Math.max(iMin,Math.min(iMax,iApprox));
    if (i < 0 || i + textWidth > width)     continue;
    int j=(int)Math.floor(jTimeText - textHeight - hoverLabelOffset);
    textRenderer.draw(time.text,i,j);
  }
}

Fixed version (ground truth):
protected void printHoverLabels(List<TimeStamp> tickTimes,Axis1D axis,double jTimeText,int width,int height){
  GlimpseColor.setColor(textRenderer,textColor);
  Rectangle2D fixedBounds=textRenderer.getBounds("String_Node_Str");
  double textHeight=fixedBounds.getHeight();
  List<TimeStruct> timeStructs=handler.getTimeStructs(axis,tickTimes);
  for (  TimeStruct time : timeStructs) {
    Rectangle2D textBounds=textRenderer.getBounds(time.text);
    double textWidth=textBounds.getWidth();
    int iMin=axis.valueToScreenPixel(fromTimeStamp(time.start));
    int iMax=(int)Math.floor(axis.valueToScreenPixel(fromTimeStamp(time.end)) - textWidth);
    int iApprox=(int)Math.round(axis.valueToScreenPixel(fromTimeStamp(time.textCenter)) - 0.5 * textWidth);
    int i=Math.max(iMin,Math.min(iMax,iApprox));
    if (i < 0 || i + textWidth > width)     continue;
    int j=(int)Math.floor(jTimeText - textHeight - hoverLabelOffset);
    textRenderer.draw(time.text,i,j);
  }
}
Program: 11310
Project: 11310
Buggy source:
private float printTickLabels(List<String> tickLabels,List<TimeStamp> tickTimes,Axis1D axis,int width,int height){
  float iTimeText=Float.POSITIVE_INFINITY;
  textRenderer.beginRendering(width,height);
  try {
    for (int index=0; index < tickLabels.size(); index++) {
      TimeStamp t=tickTimes.get(index);
      String string=tickLabels.get(index);
      Rectangle2D textBounds=textRenderer.getBounds(string);
      double textHeight=textBounds.getHeight();
      float j=(float)(axis.valueToScreenPixel(fromTimeStamp(t)) - 0.5 * Math.max(1,textHeight - 2));
      if (j < 0 || j + textHeight > height)       continue;
      float i=(float)(width - tickSize - textBounds.getWidth()- 1- textBufferSize- tickBufferSize);
      iTimeText=Math.min(iTimeText,i);
      textRenderer.draw3D(string,i,j,0,1);
    }
  }
  finally {
    textRenderer.endRendering();
  }
  return iTimeText;
}

Fixed version (ground truth):
private float printTickLabels(List<String> tickLabels,List<TimeStamp> tickTimes,Axis1D axis,int width,int height){
  float iTimeText=Float.POSITIVE_INFINITY;
  textRenderer.beginRendering(width,height);
  try {
    GlimpseColor.setColor(textRenderer,textColor);
    for (int index=0; index < tickLabels.size(); index++) {
      TimeStamp t=tickTimes.get(index);
      String string=tickLabels.get(index);
      Rectangle2D textBounds=textRenderer.getBounds(string);
      double textHeight=textBounds.getHeight();
      float j=(float)(axis.valueToScreenPixel(fromTimeStamp(t)) - 0.5 * Math.max(1,textHeight - 2));
      if (j < 0 || j + textHeight > height)       continue;
      float i=(float)(width - tickSize - textBounds.getWidth()- 1- textBufferSize- tickBufferSize);
      iTimeText=Math.min(iTimeText,i);
      textRenderer.draw3D(string,i,j,0,1);
    }
  }
  finally {
    textRenderer.endRendering();
  }
  return iTimeText;
}
Program: 11311
Project: 11311
Buggy source:
public void useProgram(GL gl,boolean on){
  if (on) {
    gl.getGL3().glBindVertexArray(GLUtils.defaultVertexAttributeArray(gl));
  }
 else {
    gl.getGL3().glBindVertexArray(0);
  }
  if (!load(gl.getGL3(),this.codes))   return;
  this.state.useProgram(gl.getGL3(),on);
  if (on)   this.updateUniformData(gl);
  for (  GLArrayDataClient array : arrays) {
    if (array.sealed()) {
      array.enableBuffer(gl,on);
    }
  }
}

Fixed version (ground truth):
public void useProgram(GL gl,boolean on){
  if (on) {
    gl.getGL3().glBindVertexArray(GLUtils.defaultVertexAttributeArray(gl));
  }
  if (!load(gl.getGL3(),this.codes))   return;
  this.state.useProgram(gl.getGL3(),on);
  if (on)   this.updateUniformData(gl);
  for (  GLArrayDataClient array : arrays) {
    if (array.sealed()) {
      array.enableBuffer(gl,on);
    }
  }
  if (!on) {
    gl.getGL3().glBindVertexArray(0);
  }
}
Program: 11312
Project: 11312
Buggy source:
public void end(GL2ES2 gl){
  gl.getGL3().glBindVertexArray(0);
  gl.glDisableVertexAttribArray(this.handles.inXy);
  gl.glDisableVertexAttribArray(this.handles.inRgba);
  gl.glDisableVertexAttribArray(this.handles.inSize);
  gl.glUseProgram(0);
  gl.glDisable(GL3.GL_PROGRAM_POINT_SIZE);
  if (gl.isGL2())   gl.glDisable(GLES1.GL_POINT_SPRITE);
}

Fixed version (ground truth):
public void end(GL2ES2 gl){
  gl.glDisableVertexAttribArray(this.handles.inXy);
  gl.glDisableVertexAttribArray(this.handles.inRgba);
  gl.glDisableVertexAttribArray(this.handles.inSize);
  gl.glUseProgram(0);
  gl.glDisable(GL3.GL_PROGRAM_POINT_SIZE);
  if (gl.isGL2())   gl.glDisable(GLES1.GL_POINT_SPRITE);
  gl.getGL3().glBindVertexArray(0);
}
Program: 11313
Project: 11313
Buggy source:
public void end(GL2ES2 gl){
  gl.getGL3().glBindVertexArray(0);
  gl.glDisableVertexAttribArray(this.handles.inXy);
  gl.glUseProgram(0);
  gl.glDisable(GL3.GL_PROGRAM_POINT_SIZE);
  if (gl.isGL2())   gl.glDisable(GLES1.GL_POINT_SPRITE);
}

Fixed version (ground truth):
public void end(GL2ES2 gl){
  gl.glDisableVertexAttribArray(this.handles.inXy);
  gl.glUseProgram(0);
  gl.glDisable(GL3.GL_PROGRAM_POINT_SIZE);
  if (gl.isGL2())   gl.glDisable(GLES1.GL_POINT_SPRITE);
  gl.getGL3().glBindVertexArray(0);
}
Program: 11314
Project: 11314
Buggy source:
public void end(GL2ES2 gl){
  gl.getGL3().glBindVertexArray(0);
  gl.glDisableVertexAttribArray(this.handles.inXy);
  gl.glUseProgram(0);
}

Fixed version (ground truth):
public void end(GL2ES2 gl){
  gl.glDisableVertexAttribArray(this.handles.inXy);
  gl.glUseProgram(0);
  gl.getGL3().glBindVertexArray(0);
}
Program: 11315
Project: 11315
Buggy source:
@Override public ColorAxisPlot2D getLayout(){
  ColorAxisPlot2D plot=newPlot();
  plot.setTitle("String_Node_Str");
  plot.setAxisLabelX("String_Node_Str");
  plot.setAxisLabelY("String_Node_Str");
  plot.setBorderSize(30);
  plot.setAxisSizeX(40);
  plot.setAxisSizeY(60);
  plot.setMinX(0.0f);
  plot.setMaxX(1000.0f);
  plot.setMinY(0.0f);
  plot.setMaxY(1000.0f);
  plot.setMinZ(0.0f);
  plot.setMaxZ(1000.0f);
  plot.lockAspectRatioXY(1.0f);
  plot.setSelectionSize(100.0f);
  plot.setShowMinorTicks(true);
  plot.setMinorTickCount(9);
  heatmapPainter=newHeatMapPainter(plot.getAxisZ());
  plot.addPainter(heatmapPainter);
  plot.setColorScale(heatmapPainter.getColorScale());
  cursorPainter=new CursorTextZPainter();
  plot.addPainterForeground(cursorPainter);
  cursorPainter.setTexture(heatmapPainter.getData());
  return plot;
}

Fixed version (ground truth):
@Override public ColorAxisPlot2D getLayout(){
  ColorAxisPlot2D plot=newPlot();
  plot.setTitle("String_Node_Str");
  plot.setAxisLabelX("String_Node_Str");
  plot.setAxisLabelY("String_Node_Str");
  plot.setBorderSize(30);
  plot.setAxisSizeX(40);
  plot.setAxisSizeY(60);
  plot.lockAspectRatioXY(1.0f);
  plot.setMinX(0.0f);
  plot.setMaxX(1000.0f);
  plot.setMinY(0.0f);
  plot.setMaxY(1000.0f);
  plot.setMinZ(0.0f);
  plot.setMaxZ(1000.0f);
  plot.setSelectionSize(100.0f);
  plot.setShowMinorTicks(true);
  plot.setMinorTickCount(9);
  heatmapPainter=newHeatMapPainter(plot.getAxisZ());
  plot.addPainter(heatmapPainter);
  plot.setColorScale(heatmapPainter.getColorScale());
  cursorPainter=new CursorTextZPainter();
  plot.addPainterForeground(cursorPainter);
  cursorPainter.setTexture(heatmapPainter.getData());
  return plot;
}
Program: 11316
Project: 11316
Buggy source:
public TextureProjected2D getProjectedTexture(){
  Colorbuffer b=drawable.getColorbuffer(GL.GL_FRONT);
  return new ExternalTextureProjected2D(getTextureUnit(),b.getWidth(),b.getHeight(),false);
}

Fixed version (ground truth):
public TextureProjected2D getProjectedTexture(){
  Colorbuffer b=drawable.getColorbuffer(GL.GL_FRONT);
  return new ExternalTextureProjected2D(b.getName(),b.getWidth(),b.getHeight(),false);
}
Program: 11317
Project: 11317
Buggy source:
public static int defaultVertexAttributeArray(GL gl){
  if (default_vao == 0) {
    default_vao=genVertexAttributeArray(gl);
  }
  return default_vao;
}

Fixed version (ground truth):
public static int defaultVertexAttributeArray(GL gl){
  return gl.getContext().getDefaultVAO();
}
Program: 11318
Project: 11318
Buggy source:
protected int getTextureHandle(){
  return offscreenCanvas.getTextureUnit();
}

Fixed version (ground truth):
protected int getTextureHandle(){
  return offscreenCanvas.getTextureName();
}
Program: 11319
Project: 11319
Buggy source:
@Override protected int getTextureHandle(){
  return reprojectCanvas.getTextureUnit();
}

Fixed version (ground truth):
@Override protected int getTextureHandle(){
  return reprojectCanvas.getTextureName();
}
Program: 11321
Project: 11321
Buggy source:
/** 
 * Constructs a   {@link QuadPipelineGL30}.
 * @param gl Current OpenGL context
 * @param shaderProgram Shader program to render quads with
 * @throws NullPointerException if context is null
 * @throws IllegalArgumentException if shader program is less than one
 */
public QuadPipelineGL30(final GL3 gl,final int shaderProgram){
  super(VERTS_PER_PRIM,PRIMS_PER_QUAD);
  Check.notNull(gl,"String_Node_Str");
  Check.argument(shaderProgram > 0,"String_Node_Str");
  this.vbo=createVertexBufferObject(gl,BYTES_PER_BUFFER);
  this.vao=createVertexArrayObject(gl,shaderProgram,vbo);
}

Fixed version (ground truth):
/** 
 * Constructs a   {@link QuadPipelineGL30}.
 * @param gl Current OpenGL context
 * @param shaderProgram Shader program to render quads with
 * @throws NullPointerException if context is null
 * @throws IllegalArgumentException if shader program is less than one
 */
public QuadPipelineGL30(final GL3 gl,final int shaderProgram){
  super(VERTS_PER_PRIM,PRIMS_PER_QUAD);
  Check.notNull(gl,"String_Node_Str");
  Check.argument(shaderProgram > 0,"String_Node_Str");
  this.shaderProgram=shaderProgram;
  this.vbo=createVertexBufferObject(gl,BYTES_PER_BUFFER);
}
Program: 11322
Project: 11322
Buggy source:
@Override public void beginRendering(final GL gl){
  super.beginRendering(gl);
  final GL3 gl3=gl.getGL3();
  gl3.glBindBuffer(GL3.GL_ARRAY_BUFFER,vbo);
  gl3.glBindVertexArray(vao);
}

Fixed version (ground truth):
@Override public void beginRendering(final GL gl){
  super.beginRendering(gl);
  final GL3 gl3=gl.getGL3();
  gl3.glBindVertexArray(getVertexArrayObject(gl3,this.shaderProgram,this.vbo));
  gl3.glBindBuffer(GL3.GL_ARRAY_BUFFER,this.vbo);
}
Program: 11323
Project: 11323
Buggy source:
@Override public void dispose(final GL gl){
  super.dispose(gl);
  final GL3 gl3=gl.getGL3();
  final int[] handles=new int[1];
  handles[0]=vbo;
  gl3.glDeleteBuffers(1,handles,0);
  handles[0]=vao;
  gl3.glDeleteVertexArrays(1,handles,0);
}

Fixed version (ground truth):
@Override public void dispose(final GL gl){
  super.dispose(gl);
  final GL3 gl3=gl.getGL3();
  final int[] handles=new int[1];
  handles[0]=vbo;
  gl3.glDeleteBuffers(1,handles,0);
  if (!this.vaoMap.isEmpty()) {
    try {
      for (      GLContext context : this.vaoMap.keySet()) {
        context.makeCurrent();
        handles[0]=this.vaoMap.get(context);
        gl3.glDeleteVertexArrays(1,handles,0);
      }
    }
  finally {
      gl.getContext().makeCurrent();
    }
  }
}
Program: 11324
Project: 11324
Buggy source:
@Override public StackedTimePlot2D getLayout(){
  StackedTimePlot2D plot=super.getLayout();
  final RelativeTimeAxisLabelHandler handler=new RelativeTimeAxisLabelHandler(plot.getEpoch().getTimeStamp().add(-Time.fromHours(100)));
  handler.setFuturePositive(false);
  plot.setTimeAxisLabelHandler(handler);
  new Thread(){
    @Override public void run(){
      while (true) {
        handler.setReferenceTime(handler.getReferenceTime().add(Time.fromSeconds(10)));
        try {
          Thread.sleep(10);
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
    }
  }
.start();
  plot.setPlotSpacing(20);
  plot.getDefaultTimeline().setSize(65);
  for (  TimePlotInfo info : plot.getAllTimePlots()) {
    info.getLabelPainter().setHorizontalLabels(true);
  }
  return plot;
}

Fixed version (ground truth):
@Override public StackedTimePlot2D getLayout(){
  StackedTimePlot2D plot=super.getLayout();
  final RelativeTimeAxisLabelHandler handler=new RelativeTimeAxisLabelHandler(plot.getEpoch().getTimeStamp().add(-Time.fromHours(100)));
  handler.setFuturePositive(false);
  plot.setTimeAxisLabelHandler(handler);
  new Thread(){
    @Override public void run(){
      while (true) {
        handler.setReferenceTime(handler.getReferenceTime().add(Time.fromSeconds(10)));
        try {
          Thread.sleep(10);
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
    }
  }
.start();
  plot.setPlotSpacing(20);
  plot.getDefaultTimeline().setSize(75);
  for (  TimePlotInfo info : plot.getAllTimePlots()) {
    info.getLabelPainter().setHorizontalLabels(true);
  }
  return plot;
}
Program: 11325
Project: 11325
Buggy source:
public NumericAxisPainter(AxisLabelHandler ticks){
  resetFont();
  resetLabelColors();
  resetTickColor();
  initShaders();
}

Fixed version (ground truth):
public NumericAxisPainter(AxisLabelHandler ticks){
  this.ticks=ticks;
  resetFont();
  resetLabelColors();
  resetTickColor();
  initShaders();
}
Program: 11326
Project: 11326
Buggy source:
public void setAxisLabel(String label){
  this.ticks.setAxisLabel(label);
}

Fixed version (ground truth):
@Override public void setAxisLabel(String label){
  this.ticks.setAxisLabel(label);
}
Program: 11327
Project: 11327
Buggy source:
public AxisLabelHandler getTickCalculator(){
  return ticks;
}

Fixed version (ground truth):
@Override public AxisLabelHandler getTickCalculator(){
  return ticks;
}
Program: 11328
Project: 11328
Buggy source:
public void setTickCalculator(AxisLabelHandler ticks){
  this.ticks=ticks;
}

Fixed version (ground truth):
@Override public void setTickCalculator(AxisLabelHandler ticks){
  this.ticks=ticks;
}
Program: 11329
Project: 11329
Buggy source:
public NumericLabelHandlerAxisPainter(AxisLabelHandler ticks){
  this.ticks=ticks;
}

Fixed version (ground truth):
public NumericLabelHandlerAxisPainter(AxisLabelHandler ticks){
  super(ticks);
  this.ticks=ticks;
}
Program: 11330
Project: 11330
Buggy source:
public TimeAxisPainter(TimeAxisLabelHandler handler){
  this.handler=handler;
  this.newFont=FontUtils.getBitstreamVeraSansPlain(12.0f);
  this.tickColor=GlimpseColor.getBlack();
  this.textColor=GlimpseColor.getBlack();
  this.setCurrentTimeTextColor(GlimpseColor.getGreen(0.5f));
  this.setCurrentTimeTickColor(GlimpseColor.getGreen(1.0f));
  this.currentTimeLineThickness=3;
}

Fixed version (ground truth):
public TimeAxisPainter(TimeAxisLabelHandler handler){
  super(handler);
  this.handler=handler;
  this.newFont=FontUtils.getBitstreamVeraSansPlain(12.0f);
  this.tickColor=GlimpseColor.getBlack();
  this.textColor=GlimpseColor.getBlack();
  this.setCurrentTimeTextColor(GlimpseColor.getGreen(0.5f));
  this.setCurrentTimeTickColor(GlimpseColor.getGreen(1.0f));
  this.currentTimeLineThickness=3;
}
Program: 11331
Project: 11331
Buggy source:
protected double printTickLabels(List<String> tickLabels,List<TimeStamp> tickTimes,Axis1D axis,int width,int height){
  Rectangle2D fixedBounds=textRenderer.getBounds("String_Node_Str");
  double textHeight=fixedBounds.getHeight();
  int jTimeText=Integer.MAX_VALUE;
  for (int index=0; index < tickLabels.size(); index++) {
    TimeStamp t=tickTimes.get(index);
    String string=tickLabels.get(index);
    Rectangle2D textBounds=textRenderer.getBounds(string);
    double textWidth=textBounds.getWidth();
    int i=(int)Math.round(axis.valueToScreenPixel(fromTimeStamp(t)) - 0.5 * textWidth);
    if (i < 0 || i + textWidth > width)     continue;
    int j=(int)Math.round(height - tickSize - textHeight);
    jTimeText=Math.min(jTimeText,j);
    textRenderer.draw(string,i,j);
  }
  return jTimeText;
}

Fixed version (ground truth):
protected double printTickLabels(List<String> tickLabels,List<TimeStamp> tickTimes,Axis1D axis,int width,int height){
  Rectangle2D fixedBounds=textRenderer.getBounds("String_Node_Str");
  double textHeight=fixedBounds.getHeight();
  int jTimeText=Integer.MAX_VALUE;
  for (int index=0; index < tickLabels.size(); index++) {
    TimeStamp t=tickTimes.get(index);
    String string=tickLabels.get(index);
    Rectangle2D textBounds=textRenderer.getBounds(string);
    double textWidth=textBounds.getWidth();
    int i=(int)Math.round(axis.valueToScreenPixel(fromTimeStamp(t)) - 0.5 * textWidth);
    if (i < 0 || i + textWidth > width)     continue;
    int j=(int)Math.round(height - tickSize - textHeight) - tickBufferSize - textBufferSize;
    jTimeText=Math.min(jTimeText,j);
    textRenderer.draw(string,i,j);
  }
  return jTimeText;
}
Program: 11333
Project: 11333
Buggy source:
private double printTickLabels(List<String> tickLabels,List<TimeStamp> tickTimes,Axis1D axis,int width,int height){
  int iTimeText=Integer.MAX_VALUE;
  textRenderer.beginRendering(width,height);
  try {
    GlimpseColor.setColor(textRenderer,textColor);
    for (    TimeStamp t : tickTimes) {
      TimeStamp t=tickTimes.get(index);
      String string=tickLabels.get(index);
      Rectangle2D textBounds=textRenderer.getBounds(string);
      double textHeight=textBounds.getHeight();
      int j=(int)Math.round(axis.valueToScreenPixel(fromTimeStamp(t)) - 0.5 * Math.max(1,textHeight - 2));
      if (j < 0 || j + textHeight > height)       continue;
      int i=(int)Math.round(width - tickSize - textBounds.getWidth()) - 1;
      iTimeText=Math.min(iTimeText,i);
      textRenderer.draw(string,i,j);
    }
  }
  finally {
    textRenderer.endRendering();
  }
  return iTimeText;
}

Fixed version (ground truth):
private float printTickLabels(List<String> tickLabels,List<TimeStamp> tickTimes,Axis1D axis,int width,int height){
  float iTimeText=Float.POSITIVE_INFINITY;
  textRenderer.beginRendering(width,height);
  try {
    for (int index=0; index < tickLabels.size(); index++) {
      TimeStamp t=tickTimes.get(index);
      String string=tickLabels.get(index);
      Rectangle2D textBounds=textRenderer.getBounds(string);
      double textHeight=textBounds.getHeight();
      float j=(float)(axis.valueToScreenPixel(fromTimeStamp(t)) - 0.5 * Math.max(1,textHeight - 2));
      if (j < 0 || j + textHeight > height)       continue;
      float i=(float)(width - tickSize - textBounds.getWidth()- 1- textBufferSize- tickBufferSize);
      iTimeText=Math.min(iTimeText,i);
      textRenderer.draw3D(string,i,j,0,1);
    }
  }
  finally {
    textRenderer.endRendering();
  }
  return iTimeText;
}
Program: 11335
Project: 11335
Buggy source:
private void printHoverLabels(GL3 gl,List<TimeStamp> tickTimes,Axis1D axis,TimeStampFormat format,TimeStructFactory factory,double iTimeText,int width,int height){
  textRenderer.begin3DRendering();
  try {
    GlimpseColor.setColor(textRenderer,textColor);
    List<TimeStruct> days=handler.timeStructs(axis,tickTimes,factory);
    for (    TimeStruct day : days) {
      String text=day.textCenter.toString(format);
      Rectangle2D textBounds=textRenderer.getBounds(text);
      double halfTextHeight=0.5 * textBounds.getWidth();
      int jMin=(int)Math.ceil(axis.valueToScreenPixel(fromTimeStamp(day.start)) + halfTextHeight);
      int jMax=(int)Math.floor(axis.valueToScreenPixel(fromTimeStamp(day.end)) - halfTextHeight);
      int jApprox=axis.valueToScreenPixel(fromTimeStamp(day.textCenter));
      int j=Math.max(jMin,Math.min(jMax,jApprox));
      if (j - halfTextHeight < 0 || j + halfTextHeight > height)       continue;
      int i=(int)Math.floor(iTimeText - dateTextRightPadding - 1);
      transformMatrix.loadIdentity();
      transformMatrix.makeOrtho(0,width,0,height,-1,1);
      transformMatrix.translate(i,j,0);
      transformMatrix.rotate(PI_2,0,0,1.0f);
      textRenderer.setTransform(transformMatrix.getMatrix());
      textRenderer.draw3D(text,(int)Math.round(-halfTextHeight),0,0,1);
    }
  }
  finally {
    textRenderer.end3DRendering();
  }
}

Fixed version (ground truth):
private void printHoverLabels(GL3 gl,List<TimeStamp> tickTimes,Axis1D axis,double iTimeText,int width,int height){
  textRenderer.begin3DRendering();
  try {
    GlimpseColor.setColor(textRenderer,textColor);
    List<TimeStruct> timeStructs=handler.getTimeStructs(axis,tickTimes);
    for (    TimeStruct timeStruct : timeStructs) {
      String text=timeStruct.text;
      Rectangle2D textBounds=textRenderer.getBounds(text);
      double halfTextHeight=0.5 * textBounds.getWidth();
      float jMin=(float)(axis.valueToScreenPixel(fromTimeStamp(timeStruct.start)) + halfTextHeight);
      float jMax=(float)(axis.valueToScreenPixel(fromTimeStamp(timeStruct.end)) - halfTextHeight);
      float jApprox=axis.valueToScreenPixel(fromTimeStamp(timeStruct.textCenter));
      float j=Math.max(jMin,Math.min(jMax,jApprox));
      if (j - halfTextHeight < 0 || j + halfTextHeight > height)       continue;
      float i=(float)(iTimeText - dateTextRightPadding - 1);
      transformMatrix.loadIdentity();
      transformMatrix.makeOrtho(0,width,0,height,-1,1);
      transformMatrix.translate(i,j,0);
      transformMatrix.rotate(PI_2,0,0,1.0f);
      textRenderer.setTransform(transformMatrix.getMatrix());
      textRenderer.draw3D(text,(int)Math.round(-halfTextHeight),0,0,1);
    }
  }
  finally {
    textRenderer.end3DRendering();
  }
}
Program: 11336
Project: 11336
Buggy source:
@Override public void end(GlimpseContext context){
  GL2ES2 gl=context.getGL().getGL2ES2();
  gl.getGL3().glBindVertexArray(0);
  gl.glDisableVertexAttribArray(this.handles.inXy);
  gl.glDisableVertexAttribArray(this.handles.inS);
  gl.glUseProgram(0);
}

Fixed version (ground truth):
@Override public void end(GlimpseContext context){
  GL2ES2 gl=context.getGL().getGL2ES2();
  gl.glDisableVertexAttribArray(this.handles.inXy);
  gl.glDisableVertexAttribArray(this.handles.inS);
  gl.glUseProgram(0);
  gl.getGL3().glBindVertexArray(0);
}
Program: 11337
Project: 11337
Buggy source:
@Override public void end(GlimpseContext context){
  GL3 gl=context.getGL().getGL3();
  gl.getGL3().glBindVertexArray(0);
  if (this.handles != null) {
    gl.glDisableVertexAttribArray(this.handles.inXy);
    gl.glDisableVertexAttribArray(this.handles.inS);
  }
  gl.glUseProgram(0);
}

Fixed version (ground truth):
@Override public void end(GlimpseContext context){
  GL3 gl=context.getGL().getGL3();
  if (this.handles != null) {
    gl.glDisableVertexAttribArray(this.handles.inXy);
    gl.glDisableVertexAttribArray(this.handles.inS);
  }
  gl.glUseProgram(0);
  gl.getGL3().glBindVertexArray(0);
}
Program: 11338
Project: 11338
Buggy source:
public void end(GL2ES2 gl){
  gl.getGL3().glBindVertexArray(0);
  gl.glDisableVertexAttribArray(this.handles.inXy);
  gl.glUseProgram(0);
}

Fixed version (ground truth):
public void end(GL2ES2 gl){
  gl.glDisableVertexAttribArray(this.handles.inXy);
  gl.glUseProgram(0);
  gl.getGL3().glBindVertexArray(0);
}
Program: 11339
Project: 11339
Buggy source:
public void end(GL2ES2 gl){
  gl.getGL3().glBindVertexArray(0);
  gl.glDisableVertexAttribArray(this.handles.inXy);
  gl.glUseProgram(0);
}

Fixed version (ground truth):
public void end(GL2ES2 gl){
  gl.glDisableVertexAttribArray(this.handles.inXy);
  gl.glUseProgram(0);
  gl.getGL3().glBindVertexArray(0);
}
Program: 11340
Project: 11340
Buggy source:
public void coalesce(int tolerance){
  if (tolerance > 0) {
    for (int i=0; i < this.ranges.n - 2; i+=2) {
      int prevEnd=this.ranges.v(i + 1);
      int nextStart=this.ranges.v(i + 2);
      if (prevEnd + tolerance >= nextStart) {
        this.ranges.removeRange(i + 1,i + 3);
      }
    }
  }
}

Fixed version (ground truth):
public void coalesce(int tolerance){
  if (tolerance > 0 && this.ranges.n >= 4) {
    SortedIntsArray coalesced=this.scratch;
    int firstStart=this.ranges.v(0);
    int firstEnd=this.ranges.v(1);
    coalesced.append(firstStart);
    int pendingEnd=firstEnd;
    for (int i=2; i < this.ranges.n; i+=2) {
      int start=this.ranges.v(i + 0);
      int end=this.ranges.v(i + 1);
      if (pendingEnd + tolerance < start) {
        coalesced.append(pendingEnd);
        coalesced.append(start);
      }
      pendingEnd=end;
    }
    coalesced.append(pendingEnd);
    this.scratch=this.ranges;
    this.scratch.clear();
    this.ranges=coalesced;
  }
}
Program: 11341
Project: 11341
Buggy source:
public IntRangeSetModifiable(){
  this.ranges=new SortedIntsArray();
}

Fixed version (ground truth):
public IntRangeSetModifiable(){
  this.ranges=new SortedIntsArray();
  this.scratch=new SortedIntsArray();
}
Program: 11342
Project: 11342
Buggy source:
public static void updateMileageBuffer(FloatBuffer xyBuffer,ByteBuffer flagsBuffer,FloatBuffer mileageBuffer,boolean useInitialMileages,double ppvAspectRatio){
  int firstVertex=mileageBuffer.position();
  xyBuffer.position(2 * firstVertex);
  flagsBuffer.position(1 * firstVertex);
  float x;
  float y;
  float mileage;
  if (firstVertex > 0) {
    int i=firstVertex - 1;
    x=xyBuffer.get(2 * i + 0);
    y=xyBuffer.get(2 * i + 1);
    mileage=mileageBuffer.get(1 * i);
  }
 else {
    x=0;
    y=0;
    mileage=0;
  }
  while (flagsBuffer.hasRemaining()) {
    float xNew=xyBuffer.get();
    float yNew=xyBuffer.get();
    byte flagsNew=flagsBuffer.get();
    boolean connect=((flagsNew & FLAGS_CONNECT) != 0);
    if (!connect) {
      if (useInitialMileages) {
        mileage=mileageBuffer.get();
      }
 else {
        mileage=0;
      }
    }
 else {
      mileage+=distance(x,y,xNew,yNew,ppvAspectRatio);
      mileageBuffer.put(mileage);
    }
    x=xNew;
    y=yNew;
  }
}

Fixed version (ground truth):
public static void updateMileageBuffer(FloatBuffer xyBuffer,ByteBuffer flagsBuffer,FloatBuffer mileageBuffer,boolean useInitialMileages,double ppvAspectRatio){
  int firstVertex=mileageBuffer.position();
  xyBuffer.position(2 * firstVertex);
  flagsBuffer.position(1 * firstVertex);
  float x;
  float y;
  float mileage;
  if (firstVertex > 0) {
    int i=firstVertex - 1;
    x=xyBuffer.get(2 * i + 0);
    y=xyBuffer.get(2 * i + 1);
    mileage=mileageBuffer.get(1 * i);
  }
 else {
    x=0;
    y=0;
    mileage=0;
  }
  while (flagsBuffer.hasRemaining()) {
    float xNew=xyBuffer.get();
    float yNew=xyBuffer.get();
    byte flagsNew=flagsBuffer.get();
    boolean connect=((flagsNew & FLAGS_CONNECT) != 0);
    if (connect) {
      mileage+=distance(x,y,xNew,yNew,ppvAspectRatio);
      mileageBuffer.put(mileage);
    }
 else     if (useInitialMileages) {
      mileage=mileageBuffer.get();
    }
 else {
      mileage=0;
      mileageBuffer.put(mileage);
    }
    x=xNew;
    y=yNew;
  }
}
Program: 11343
Project: 11343
Buggy source:
public void begin(GlimpseContext context){
  GL3 gl=context.getGL().getGL3();
  this.useProgram(context.getGL(),true);
  if (this.handles == null) {
    this.handles=new ProgramHandles(gl,getShaderProgram().id());
  }
  gl.glEnableVertexAttribArray(this.handles.inXy);
  gl.glEnableVertexAttribArray(this.handles.inS);
}

Fixed version (ground truth):
public void begin(GlimpseContext context){
  GL3 gl=context.getGL().getGL3();
  this.useProgram(context.getGL(),true);
  if (this.handles == null) {
    this.handles=new ProgramHandles(gl,getShaderProgram().program());
  }
  gl.glEnableVertexAttribArray(this.handles.inXy);
  gl.glEnableVertexAttribArray(this.handles.inS);
}
Program: 11344
Project: 11344
Buggy source:
public void add(int first,int count){
  int start=first;
  int iBeforeStart=this.ranges.indexAtOrBefore(start);
  boolean startsInExistingRange=(iBeforeStart % 2 == 0);
  if (!startsInExistingRange && iBeforeStart >= 0 && start == this.ranges.v(iBeforeStart)) {
    start--;
    iBeforeStart--;
    startsInExistingRange=true;
  }
  int end=first + count;
  int iAfterEnd=this.ranges.indexAtOrAfter(end);
  boolean endsInExistingRange=(iAfterEnd % 2 == 1);
  if (!endsInExistingRange && iAfterEnd < this.ranges.n && end == this.ranges.v(iAfterEnd)) {
    end++;
    iAfterEnd++;
    endsInExistingRange=true;
  }
  if (startsInExistingRange && endsInExistingRange) {
    this.ranges.removeRange(iBeforeStart + 1,iAfterEnd);
  }
 else   if (startsInExistingRange) {
    this.ranges.a[iBeforeStart + 1]=end;
    this.ranges.removeRange(iBeforeStart + 2,iAfterEnd);
  }
 else   if (endsInExistingRange) {
    this.ranges.a[iAfterEnd - 1]=start;
    this.ranges.removeRange(iBeforeStart + 1,iAfterEnd - 1);
  }
 else {
    this.ranges.removeRange(iBeforeStart + 1,iAfterEnd);
    this.ranges.prepForInsert(iBeforeStart,2);
    this.ranges.a[iBeforeStart + 0]=start;
    this.ranges.a[iBeforeStart + 1]=end;
  }
}

Fixed version (ground truth):
public void add(int first,int count){
  if (count > 0) {
    int start=first;
    int iBeforeStart=this.ranges.indexAtOrBefore(start);
    boolean startsInExistingRange=(iBeforeStart % 2 == 0);
    if (!startsInExistingRange && iBeforeStart >= 0 && start == this.ranges.v(iBeforeStart)) {
      start--;
      iBeforeStart--;
      startsInExistingRange=true;
    }
    int end=first + count;
    int iAfterEnd=this.ranges.indexAtOrAfter(end);
    boolean endsInExistingRange=(iAfterEnd % 2 == 1);
    if (!endsInExistingRange && iAfterEnd < this.ranges.n && end == this.ranges.v(iAfterEnd)) {
      end++;
      iAfterEnd++;
      endsInExistingRange=true;
    }
    if (startsInExistingRange && endsInExistingRange) {
      this.ranges.removeRange(iBeforeStart + 1,iAfterEnd);
    }
 else     if (startsInExistingRange) {
      this.ranges.a[iBeforeStart + 1]=end;
      this.ranges.removeRange(iBeforeStart + 2,iAfterEnd);
    }
 else     if (endsInExistingRange) {
      this.ranges.a[iAfterEnd - 1]=start;
      this.ranges.removeRange(iBeforeStart + 1,iAfterEnd - 1);
    }
 else {
      this.ranges.removeRange(iBeforeStart + 1,iAfterEnd);
      this.ranges.prepForInsert(iBeforeStart + 1,2);
      this.ranges.a[iBeforeStart + 1]=start;
      this.ranges.a[iBeforeStart + 2]=end;
    }
  }
}
Program: 11345
Project: 11345
Buggy source:
public void coalesce(int tolerance){
  for (int i=0; i < this.ranges.n - 2; i+=2) {
    int prevEnd=this.ranges.v(i + 1);
    int nextStart=this.ranges.v(i + 2);
    if (prevEnd + tolerance >= nextStart) {
      this.ranges.removeRange(i + 1,i + 3);
    }
  }
}

Fixed version (ground truth):
public void coalesce(int tolerance){
  if (tolerance > 0) {
    for (int i=0; i < this.ranges.n - 2; i+=2) {
      int prevEnd=this.ranges.v(i + 1);
      int nextStart=this.ranges.v(i + 2);
      if (prevEnd + tolerance >= nextStart) {
        this.ranges.removeRange(i + 1,i + 3);
      }
    }
  }
}
Program: 11346
Project: 11346
Buggy source:
public void begin(GlimpseContext context){
  GL3 gl=context.getGL().getGL3();
  this.useProgram(context.getGL(),true);
  if (this.handles == null) {
    this.handles=new ProgramHandles(gl,getShaderProgram().id());
  }
  gl.glEnableVertexAttribArray(this.handles.inXy);
  gl.glEnableVertexAttribArray(this.handles.inS);
}

Fixed version (ground truth):
public void begin(GlimpseContext context){
  GL3 gl=context.getGL().getGL3();
  this.useProgram(context.getGL(),true);
  if (this.handles == null) {
    this.handles=new ProgramHandles(gl,getShaderProgram().program());
  }
  gl.glEnableVertexAttribArray(this.handles.inXy);
  gl.glEnableVertexAttribArray(this.handles.inS);
}
Program: 11347
Project: 11347
Buggy source:
public ProgramHandles(GL2ES2 gl,int program){
  this.inXy=gl.glGetAttribLocation(program,"String_Node_Str");
  this.inS=gl.glGetAttribLocation(program,"String_Node_Str");
}

Fixed version (ground truth):
public ProgramHandles(GL2ES2 gl,int program){
  this.inXy=gl.glGetAttribLocation(program,"String_Node_Str");
  this.inS=gl.glGetAttribLocation(program,"String_Node_Str");
  GLErrorUtils.logGLError(logger,gl,"String_Node_Str");
}
Program: 11350
Project: 11350
Buggy source:
@Override public void doPaintTo(GlimpseContext context){
  if (this.pickSupportEnabled) {
    if (this.pickFrameBuffer == null) {
      this.pickFrameBuffer=new GLSimpleFrameBufferObject(WIDTH_BUFFER * 2 + 1,HEIGHT_BUFFER * 2 + 1,context.getGLContext());
    }
    pickIcons(context);
  }
  paintIcons(context);
}

Fixed version (ground truth):
@Override public void doPaintTo(GlimpseContext context){
  GL3 gl=getGL3(context);
  if (this.pickSupportEnabled) {
    if (this.pickFrameBuffer == null) {
      this.pickFrameBuffer=new GLSimpleFrameBufferObject(WIDTH_BUFFER * 2 + 1,HEIGHT_BUFFER * 2 + 1,context.getGLContext());
    }
    pickIcons(context);
  }
  GLUtils.enableStandardBlending(gl);
  try {
    paintIcons(context);
  }
  finally {
    GLUtils.disableBlending(gl);
  }
}
Program: 11351
Project: 11351
Buggy source:
@Override public void end(GlimpseContext context){
  GL3 gl=context.getGL().getGL3();
  gl.glDisableVertexAttribArray(this.handles.inXy);
  gl.glDisableVertexAttribArray(this.handles.inS);
  gl.glUseProgram(0);
}

Fixed version (ground truth):
@Override public void end(GlimpseContext context){
  GL3 gl=context.getGL().getGL3();
  if (this.handles != null) {
    gl.glDisableVertexAttribArray(this.handles.inXy);
    gl.glDisableVertexAttribArray(this.handles.inS);
  }
  gl.glUseProgram(0);
}
Program: 11352
Project: 11352
Buggy source:
public static Supplier<BufferedImage> newImageLoader(final StreamOpener opener,final String location){
  return new Supplier<BufferedImage>(){
    public BufferedImage get(){
      try {
        InputStream stream=null;
        try {
          stream=opener.openForRead(location);
          return ImageIO.read(stream);
        }
  finally {
          if (stream != null)           stream.close();
        }
      }
 catch (      IOException e) {
        throw new RuntimeException(e);
      }
    }
  }
;
}

Fixed version (ground truth):
public static Supplier<BufferedImage> newImageLoader(final StreamOpener opener,final String location){
  return new Supplier<BufferedImage>(){
    @Override public BufferedImage get(){
      try {
        InputStream stream=null;
        try {
          stream=opener.openForRead(location);
          return ImageIO.read(stream);
        }
  finally {
          if (stream != null)           stream.close();
        }
      }
 catch (      IOException e) {
        throw new RuntimeException(e);
      }
    }
  }
;
}
Program: 11353
Project: 11353
Buggy source:
@Override protected void doDispose(GlimpseContext context){
  prog.dispose(context.getGL().getGL3());
  inXy.dispose(context.getGL());
  inS.dispose(context.getGL());
}

Fixed version (ground truth):
@Override protected void doDispose(GlimpseContext context){
  prog.dispose(context);
  inXy.dispose(context.getGL());
  inS.dispose(context.getGL());
}
Program: 11354
Project: 11354
Buggy source:
public BufferedImage get(){
  try {
    InputStream stream=null;
    try {
      stream=opener.openForRead(location);
      return ImageIO.read(stream);
    }
  finally {
      if (stream != null)       stream.close();
    }
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public BufferedImage get(){
  try {
    InputStream stream=null;
    try {
      stream=opener.openForRead(location);
      return ImageIO.read(stream);
    }
  finally {
      if (stream != null)       stream.close();
    }
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}