Program: 70853
Project: 70853
Buggy source:
private GL3Object buildGLO(GL3 gl,RenderObject robj,int pidx,int nidx,int cidx,int tidx,int oidx,int type){
  int nattribs=0;
  if (pidx >= 0) {
    nattribs++;
  }
  if (nidx >= 0) {
    nattribs++;
  }
  if (cidx >= 0) {
    nattribs++;
  }
  if (tidx >= 0) {
    tidx++;
  }
  GL3VertexAttributeArray[] attribs=new GL3VertexAttributeArray[nattribs];
  int aidx=0;
  if (pidx >= 0) {
    AttributeInfo pinfo=positionInfo[pidx];
    BufferObject vbo=vbos[pinfo.vboIndex];
    BufferStorage bs=positionPutter.storage();
    attribs[aidx]=new GL3VertexAttributeArray(vbo,GL3VertexAttribute.VERTEX_POSITION,GL3Util.getGLType(bs.type()),bs.size(),bs.isNormalized(),pinfo.offset,pinfo.stride,pinfo.count);
    aidx++;
  }
  if (nidx >= 0) {
    AttributeInfo ninfo=normalInfo[nidx];
    BufferObject vbo=vbos[ninfo.vboIndex];
    BufferStorage bs=normalPutter.storage();
    attribs[aidx]=new GL3VertexAttributeArray(vbo,GL3VertexAttribute.VERTEX_NORMAL,GL3Util.getGLType(bs.type()),bs.size(),bs.isNormalized(),ninfo.offset,ninfo.stride,ninfo.count);
    aidx++;
  }
  if (cidx >= 0) {
    AttributeInfo cinfo=colorInfo[cidx];
    BufferObject vbo=vbos[cinfo.vboIndex];
    BufferStorage bs=colorPutter.storage();
    attribs[aidx]=new GL3VertexAttributeArray(vbo,GL3VertexAttribute.VERTEX_COLOR,GL3Util.getGLType(bs.type()),bs.size(),bs.isNormalized(),cinfo.offset,cinfo.stride,cinfo.count);
    aidx++;
  }
  if (tidx >= 0) {
    AttributeInfo tinfo=textureInfo[tidx];
    BufferObject vbo=vbos[tinfo.vboIndex];
    BufferStorage bs=texturePutter.storage();
    attribs[aidx]=new GL3VertexAttributeArray(vbo,GL3VertexAttribute.VERTEX_TEXTURE,GL3Util.getGLType(bs.type()),bs.size(),bs.isNormalized(),tinfo.offset,tinfo.stride,tinfo.count);
    aidx++;
  }
  int mode;
  GL3ElementAttributeArray elems=null;
switch (type) {
case POINTS:
{
      AttributeInfo oinfo=pointsInfo[oidx];
      BufferStorage bs=indexPutter.storage();
      BufferObject ibo=vbos[oinfo.vboIndex];
      mode=GL.GL_POINTS;
      elems=new GL3ElementAttributeArray(ibo,GL3Util.getGLType(bs.type()),oinfo.offset,oinfo.stride,oinfo.count);
      break;
    }
case LINES:
{
    AttributeInfo oinfo=linesInfo[oidx];
    BufferStorage bs=indexPutter.storage();
    BufferObject ibo=vbos[oinfo.vboIndex];
    mode=GL.GL_LINES;
    elems=new GL3ElementAttributeArray(ibo,GL3Util.getGLType(bs.type()),oinfo.offset,oinfo.stride,oinfo.count);
    break;
  }
case TRIANGLES:
{
  AttributeInfo oinfo=trianglesInfo[oidx];
  BufferStorage bs=indexPutter.storage();
  BufferObject ibo=vbos[oinfo.vboIndex];
  mode=GL.GL_TRIANGLES;
  elems=new GL3ElementAttributeArray(ibo,GL3Util.getGLType(bs.type()),oinfo.offset,oinfo.stride,oinfo.count);
  break;
}
case VERTICES:
default :
mode=GL.GL_POINTS;
}
GL3Object glo=new GL3Object(attribs,elems,mode);
return glo;
}

Fixed version (ground truth):
private GL3Object buildGLO(GL3 gl,RenderObject robj,int pidx,int nidx,int cidx,int tidx,int oidx,int type){
  int nattribs=0;
  if (pidx >= 0) {
    nattribs++;
  }
  if (nidx >= 0) {
    nattribs++;
  }
  if (cidx >= 0) {
    nattribs++;
  }
  if (tidx >= 0) {
    nattribs++;
  }
  GL3VertexAttributeArray[] attribs=new GL3VertexAttributeArray[nattribs];
  int aidx=0;
  if (pidx >= 0) {
    AttributeInfo pinfo=positionInfo[pidx];
    BufferObject vbo=vbos[pinfo.vboIndex];
    BufferStorage bs=positionPutter.storage();
    attribs[aidx]=new GL3VertexAttributeArray(vbo,GL3VertexAttribute.VERTEX_POSITION,GL3Util.getGLType(bs.type()),bs.size(),bs.isNormalized(),pinfo.offset,pinfo.stride,pinfo.count);
    aidx++;
  }
  if (nidx >= 0) {
    AttributeInfo ninfo=normalInfo[nidx];
    BufferObject vbo=vbos[ninfo.vboIndex];
    BufferStorage bs=normalPutter.storage();
    attribs[aidx]=new GL3VertexAttributeArray(vbo,GL3VertexAttribute.VERTEX_NORMAL,GL3Util.getGLType(bs.type()),bs.size(),bs.isNormalized(),ninfo.offset,ninfo.stride,ninfo.count);
    aidx++;
  }
  if (cidx >= 0) {
    AttributeInfo cinfo=colorInfo[cidx];
    BufferObject vbo=vbos[cinfo.vboIndex];
    BufferStorage bs=colorPutter.storage();
    attribs[aidx]=new GL3VertexAttributeArray(vbo,GL3VertexAttribute.VERTEX_COLOR,GL3Util.getGLType(bs.type()),bs.size(),bs.isNormalized(),cinfo.offset,cinfo.stride,cinfo.count);
    aidx++;
  }
  if (tidx >= 0) {
    AttributeInfo tinfo=textureInfo[tidx];
    BufferObject vbo=vbos[tinfo.vboIndex];
    BufferStorage bs=texturePutter.storage();
    attribs[aidx]=new GL3VertexAttributeArray(vbo,GL3VertexAttribute.VERTEX_TEXTURE,GL3Util.getGLType(bs.type()),bs.size(),bs.isNormalized(),tinfo.offset,tinfo.stride,tinfo.count);
    aidx++;
  }
  int mode;
  GL3ElementAttributeArray elems=null;
switch (type) {
case POINTS:
{
      AttributeInfo oinfo=pointsInfo[oidx];
      BufferStorage bs=indexPutter.storage();
      BufferObject ibo=vbos[oinfo.vboIndex];
      mode=GL.GL_POINTS;
      elems=new GL3ElementAttributeArray(ibo,GL3Util.getGLType(bs.type()),oinfo.offset,oinfo.stride,oinfo.count);
      break;
    }
case LINES:
{
    AttributeInfo oinfo=linesInfo[oidx];
    BufferStorage bs=indexPutter.storage();
    BufferObject ibo=vbos[oinfo.vboIndex];
    mode=GL.GL_LINES;
    elems=new GL3ElementAttributeArray(ibo,GL3Util.getGLType(bs.type()),oinfo.offset,oinfo.stride,oinfo.count);
    break;
  }
case TRIANGLES:
{
  AttributeInfo oinfo=trianglesInfo[oidx];
  BufferStorage bs=indexPutter.storage();
  BufferObject ibo=vbos[oinfo.vboIndex];
  mode=GL.GL_TRIANGLES;
  elems=new GL3ElementAttributeArray(ibo,GL3Util.getGLType(bs.type()),oinfo.offset,oinfo.stride,oinfo.count);
  break;
}
case VERTICES:
default :
mode=GL.GL_POINTS;
}
GL3Object glo=new GL3Object(attribs,elems,mode);
return glo;
}