Program: 109339
Project: 109339
Buggy source:
public void endUpdate(){
  if (updateElement == -1) {
    throw new RuntimeException("String_Node_Str");
  }
  if (lastUpdateIdx < firstUpdateIdx)   return;
  if (updateElement == VERTICES) {
    if (updateVertexArray == null) {
      throw new RuntimeException("String_Node_Str");
    }
    int offset=firstUpdateIdx * 3;
    int size=(lastUpdateIdx - firstUpdateIdx + 1) * 3;
    vertices.put(updateVertexArray,offset,size);
    vertices.position(0);
    gl.glBufferSubData(GL11.GL_ARRAY_BUFFER,offset * SIZEOF_FLOAT,size * SIZEOF_FLOAT,vertices);
    gl.glBindBuffer(GL11.GL_ARRAY_BUFFER,0);
  }
 else   if (updateElement == COLORS) {
    if (updateColorArray == null) {
      throw new RuntimeException("String_Node_Str");
    }
    int offset=firstUpdateIdx * 4;
    int size=(lastUpdateIdx - firstUpdateIdx + 1) * 4;
    colors.put(updateColorArray,size,offset);
    colors.position(0);
    gl.glBufferSubData(GL11.GL_ARRAY_BUFFER,size * SIZEOF_FLOAT,offset * SIZEOF_FLOAT,colors);
    gl.glBindBuffer(GL11.GL_ARRAY_BUFFER,0);
  }
 else   if (updateElement == NORMALS) {
    if (updateNormalArray == null) {
      throw new RuntimeException("String_Node_Str");
    }
    int offset=firstUpdateIdx * 3;
    int size=(lastUpdateIdx - firstUpdateIdx + 1) * 3;
    normals.put(updateNormalArray,offset,size);
    normals.position(0);
    gl.glBufferSubData(GL11.GL_ARRAY_BUFFER,offset * SIZEOF_FLOAT,size * SIZEOF_FLOAT,normals);
    gl.glBindBuffer(GL11.GL_ARRAY_BUFFER,0);
  }
 else   if (updateElement == TEXTURES) {
    if (updateTexCoordArray == null) {
      throw new RuntimeException("String_Node_Str");
    }
    int offset=firstUpdateIdx * 2;
    int size=(lastUpdateIdx - firstUpdateIdx + 1) * 2;
    texCoords.put(updateNormalArray,offset,size);
    texCoords.position(0);
    gl.glBufferSubData(GL11.GL_ARRAY_BUFFER,offset * SIZEOF_FLOAT,size * SIZEOF_FLOAT,texCoords);
    gl.glBindBuffer(GL11.GL_ARRAY_BUFFER,0);
  }
 else   if (updateElement == GROUPS) {
    createGroups();
  }
  updateElement=-1;
}

Fixed version (ground truth):
public void endUpdate(){
  if (updateElement == -1) {
    throw new RuntimeException("String_Node_Str");
  }
  if (lastUpdateIdx < firstUpdateIdx)   return;
  if (updateElement == VERTICES) {
    if (updateVertexArray == null) {
      throw new RuntimeException("String_Node_Str");
    }
    int offset=firstUpdateIdx * 3;
    int size=(lastUpdateIdx - firstUpdateIdx + 1) * 3;
    vertices.put(updateVertexArray,offset,size);
    vertices.position(0);
    gl.glBufferSubData(GL11.GL_ARRAY_BUFFER,offset * SIZEOF_FLOAT,size * SIZEOF_FLOAT,vertices);
    gl.glBindBuffer(GL11.GL_ARRAY_BUFFER,0);
  }
 else   if (updateElement == COLORS) {
    if (updateColorArray == null) {
      throw new RuntimeException("String_Node_Str");
    }
    int offset=firstUpdateIdx * 4;
    int size=(lastUpdateIdx - firstUpdateIdx + 1) * 4;
    colors.put(updateColorArray,size,offset);
    colors.position(0);
    gl.glBufferSubData(GL11.GL_ARRAY_BUFFER,size * SIZEOF_FLOAT,offset * SIZEOF_FLOAT,colors);
    gl.glBindBuffer(GL11.GL_ARRAY_BUFFER,0);
  }
 else   if (updateElement == NORMALS) {
    if (updateNormalArray == null) {
      throw new RuntimeException("String_Node_Str");
    }
    int offset=firstUpdateIdx * 3;
    int size=(lastUpdateIdx - firstUpdateIdx + 1) * 3;
    normals.put(updateNormalArray,offset,size);
    normals.position(0);
    gl.glBufferSubData(GL11.GL_ARRAY_BUFFER,offset * SIZEOF_FLOAT,size * SIZEOF_FLOAT,normals);
    gl.glBindBuffer(GL11.GL_ARRAY_BUFFER,0);
  }
 else   if (updateElement == TEXTURES) {
    if (updateTexCoordArray == null) {
      throw new RuntimeException("String_Node_Str");
    }
    int offset=firstUpdateIdx * 2;
    int size=(lastUpdateIdx - firstUpdateIdx + 1) * 2;
    texCoords.put(updateTexCoordArray,offset,size);
    texCoords.position(0);
    gl.glBufferSubData(GL11.GL_ARRAY_BUFFER,offset * SIZEOF_FLOAT,size * SIZEOF_FLOAT,texCoords);
    gl.glBindBuffer(GL11.GL_ARRAY_BUFFER,0);
  }
 else   if (updateElement == GROUPS) {
    createGroups();
  }
  updateElement=-1;
}