Program: 109271
Project: 109271
Buggy source:
protected void allocate(){
  if (!matricesAllocated) {
    glprojection=new float[16];
    glmodelview=new float[16];
    glmodelviewInv=new float[16];
    pcamera=new float[16];
    pcameraInv=new float[16];
    projection=new PMatrix3D();
    modelview=new PMatrix3D();
    modelviewInv=new PMatrix3D();
    camera=new PMatrix3D();
    cameraInv=new PMatrix3D();
    matricesAllocated=true;
  }
  if (!lightsAllocated) {
    lightType=new int[MAX_LIGHTS];
    lightPosition=new float[MAX_LIGHTS][4];
    lightNormal=new float[MAX_LIGHTS][4];
    lightDiffuse=new float[MAX_LIGHTS][4];
    lightSpecular=new float[MAX_LIGHTS][4];
    lightFalloffConstant=new float[MAX_LIGHTS];
    lightFalloffLinear=new float[MAX_LIGHTS];
    lightFalloffQuadratic=new float[MAX_LIGHTS];
    lightSpotAngle=new float[MAX_LIGHTS];
    lightSpotAngleCos=new float[MAX_LIGHTS];
    lightSpotConcentration=new float[MAX_LIGHTS];
    currentLightSpecular=new float[4];
    lightsAllocated=true;
  }
  if (!buffersAllocated) {
    ByteBuffer vbb=ByteBuffer.allocateDirect(DEFAULT_BUFFER_SIZE * 3 * SIZEOF_INT);
    vbb.order(ByteOrder.nativeOrder());
    vertexBuffer=vbb.asIntBuffer();
    ByteBuffer cbb=ByteBuffer.allocateDirect(DEFAULT_BUFFER_SIZE * 4 * SIZEOF_INT);
    cbb.order(ByteOrder.nativeOrder());
    colorBuffer=cbb.asIntBuffer();
    ByteBuffer tbb=ByteBuffer.allocateDirect(DEFAULT_BUFFER_SIZE * 2 * SIZEOF_INT);
    tbb.order(ByteOrder.nativeOrder());
    texCoordBuffer=tbb.asIntBuffer();
    ByteBuffer nbb=ByteBuffer.allocateDirect(DEFAULT_BUFFER_SIZE * 3 * SIZEOF_INT);
    nbb.order(ByteOrder.nativeOrder());
    normalBuffer=nbb.asIntBuffer();
    vertexArray=new int[DEFAULT_BUFFER_SIZE * 3];
    colorArray=new int[DEFAULT_BUFFER_SIZE * 4];
    texCoordArray=new int[DEFAULT_BUFFER_SIZE * 2];
    normalArray=new int[DEFAULT_BUFFER_SIZE * 3];
    vbb=ByteBuffer.allocateDirect(DEFAULT_BUFFER_SIZE * 3 * SIZEOF_INT);
    vbb.order(ByteOrder.nativeOrder());
    textVerticesBuffer=vbb.asIntBuffer();
    tbb=ByteBuffer.allocateDirect(DEFAULT_BUFFER_SIZE * 2 * SIZEOF_INT);
    tbb.order(ByteOrder.nativeOrder());
    textTexCoordsBuffer=tbb.asIntBuffer();
    textVerticesArray=new int[DEFAULT_BUFFER_SIZE * 3];
    textTexCoordsArray=new int[DEFAULT_BUFFER_SIZE * 2];
    buffersAllocated=true;
  }
}

Fixed version (ground truth):
protected void allocate(){
  if (!matricesAllocated) {
    glprojection=new float[16];
    glmodelview=new float[16];
    glmodelviewInv=new float[16];
    pcamera=new float[16];
    pcameraInv=new float[16];
    projection=new PMatrix3D();
    modelview=new PMatrix3D();
    modelviewInv=new PMatrix3D();
    camera=new PMatrix3D();
    cameraInv=new PMatrix3D();
    matricesAllocated=true;
  }
  if (!lightsAllocated) {
    lightType=new int[MAX_LIGHTS];
    lightPosition=new float[MAX_LIGHTS][4];
    lightNormal=new float[MAX_LIGHTS][4];
    lightDiffuse=new float[MAX_LIGHTS][4];
    lightSpecular=new float[MAX_LIGHTS][4];
    lightFalloffConstant=new float[MAX_LIGHTS];
    lightFalloffLinear=new float[MAX_LIGHTS];
    lightFalloffQuadratic=new float[MAX_LIGHTS];
    lightSpotAngle=new float[MAX_LIGHTS];
    lightSpotAngleCos=new float[MAX_LIGHTS];
    lightSpotConcentration=new float[MAX_LIGHTS];
    currentLightSpecular=new float[4];
    lightsAllocated=true;
  }
  if (!buffersAllocated) {
    ByteBuffer vbb=ByteBuffer.allocateDirect(DEFAULT_BUFFER_SIZE * 3 * SIZEOF_INT);
    vbb.order(ByteOrder.nativeOrder());
    vertexBuffer=vbb.asIntBuffer();
    ByteBuffer cbb=ByteBuffer.allocateDirect(DEFAULT_BUFFER_SIZE * 4 * SIZEOF_INT);
    cbb.order(ByteOrder.nativeOrder());
    colorBuffer=cbb.asIntBuffer();
    ByteBuffer tbb=ByteBuffer.allocateDirect(DEFAULT_BUFFER_SIZE * 2 * SIZEOF_INT);
    tbb.order(ByteOrder.nativeOrder());
    texCoordBuffer=tbb.asIntBuffer();
    ByteBuffer nbb=ByteBuffer.allocateDirect(DEFAULT_BUFFER_SIZE * 3 * SIZEOF_INT);
    nbb.order(ByteOrder.nativeOrder());
    normalBuffer=nbb.asIntBuffer();
    vertexArray=new int[DEFAULT_BUFFER_SIZE * 3];
    colorArray=new int[DEFAULT_BUFFER_SIZE * 4];
    texCoordArray=new int[DEFAULT_BUFFER_SIZE * 2];
    normalArray=new int[DEFAULT_BUFFER_SIZE * 3];
    buffersAllocated=true;
  }
}