Program: 11636
Project: 11636
Buggy source:
@Override public void paintTo(GlimpseContext context,GlimpseBounds bounds,Axis2D axis){
  GL gl=context.getGL();
  if (this.newData) {
    this.updateLock.lock();
    try {
      for (      Group group : updatedGroups) {
        int id=group.groupId;
        if (group.groupDeleted || group.groupCleared) {
          LoadedGroup loaded=getOrCreateLoadedGroup(id,group);
          loaded.dispose(gl);
          loadedGroups.remove(id);
          if (group.groupDeleted && !group.polygonsInserted) {
            groups.remove(id);
            continue;
          }
        }
        LoadedGroup loaded=getOrCreateLoadedGroup(id,group);
        loaded.loadSettings(group);
        if (group.polygonsInserted) {
          updateVertices(gl,loaded,group,true);
          updateVertices(gl,loaded,group,false);
        }
        if (loaded.glLineBufferInitialized && loaded.glFillBufferInitialized) {
          if (group.polygonsSelected) {
            loaded.loadLineSelectionIntoBuffer(group.selectedPolygons,group.selectedLinePrimitiveCount,0);
            loaded.loadFillSelectionIntoBuffer(group.selectedPolygons,group.selectedFillPrimitiveCount,0);
          }
 else           if (!group.newSelectedPolygons.isEmpty()) {
            loaded.loadLineSelectionIntoBuffer(group.newSelectedPolygons,group.selectedLinePrimitiveCount);
            loaded.loadFillSelectionIntoBuffer(group.newSelectedPolygons,group.selectedFillPrimitiveCount);
          }
        }
        group.reset();
      }
      this.updatedGroups.clear();
      this.newData=false;
    }
  finally {
      this.updateLock.unlock();
    }
    glHandleError(gl,"String_Node_Str");
  }
  if (loadedGroups.isEmpty())   return;
  gl.glMatrixMode(GL.GL_PROJECTION);
  gl.glLoadIdentity();
  gl.glOrtho(axis.getMinX(),axis.getMaxX(),axis.getMinY(),axis.getMaxY(),-1 << 23,1);
  gl.glBlendFunc(GL.GL_SRC_ALPHA,GL.GL_ONE_MINUS_SRC_ALPHA);
  gl.glEnable(GL.GL_BLEND);
  gl.glEnable(GL.GL_LINE_SMOOTH);
  gl.glEnableClientState(GL.GL_VERTEX_ARRAY);
  for (  LoadedGroup loaded : loadedGroups.values()) {
    drawGroup(gl,loaded);
  }
  glHandleError(gl,"String_Node_Str");
  gl.glDisable(GL.GL_DEPTH_TEST);
  gl.glDisable(GL.GL_BLEND);
  gl.glDisable(GL.GL_LINE_SMOOTH);
}

Fixed version (ground truth):
@Override public void paintTo(GlimpseContext context,GlimpseBounds bounds,Axis2D axis){
  GL gl=context.getGL();
  if (this.newData) {
    this.updateLock.lock();
    try {
      for (      Group group : updatedGroups) {
        int id=group.groupId;
        if (group.groupDeleted || group.groupCleared) {
          LoadedGroup loaded=getOrCreateLoadedGroup(id,group);
          loaded.dispose(gl);
          loadedGroups.remove(id);
          if (group.groupDeleted && !group.polygonsInserted) {
            groups.remove(id);
            continue;
          }
        }
        LoadedGroup loaded=getOrCreateLoadedGroup(id,group);
        loaded.loadSettings(group);
        if (group.polygonsInserted) {
          updateVertices(gl,loaded,group,true);
          updateVertices(gl,loaded,group,false);
        }
        if (group.polygonsSelected) {
          loaded.loadLineSelectionIntoBuffer(group.selectedPolygons,group.selectedLinePrimitiveCount,0);
          loaded.loadFillSelectionIntoBuffer(group.selectedPolygons,group.selectedFillPrimitiveCount,0);
        }
        group.reset();
      }
      this.updatedGroups.clear();
      this.newData=false;
    }
  finally {
      this.updateLock.unlock();
    }
    glHandleError(gl,"String_Node_Str");
  }
  if (loadedGroups.isEmpty())   return;
  gl.glMatrixMode(GL.GL_PROJECTION);
  gl.glLoadIdentity();
  gl.glOrtho(axis.getMinX(),axis.getMaxX(),axis.getMinY(),axis.getMaxY(),-1 << 23,1);
  gl.glBlendFunc(GL.GL_SRC_ALPHA,GL.GL_ONE_MINUS_SRC_ALPHA);
  gl.glEnable(GL.GL_BLEND);
  gl.glEnable(GL.GL_LINE_SMOOTH);
  gl.glEnableClientState(GL.GL_VERTEX_ARRAY);
  for (  LoadedGroup loaded : loadedGroups.values()) {
    drawGroup(gl,loaded);
  }
  glHandleError(gl,"String_Node_Str");
  gl.glDisable(GL.GL_DEPTH_TEST);
  gl.glDisable(GL.GL_BLEND);
  gl.glDisable(GL.GL_LINE_SMOOTH);
}