Program: 163769
Project: 163769
Buggy source:
/** 
 * OpenGL cannot draw until a proper native peer is available, so this returns the value of PApplet.isDisplayable() (inherited from Component).
 */
public void beginDraw(){
  VERTEXCOUNT=0;
  TRIANGLECOUNT=0;
  FACECOUNT=0;
  if (!primarySurface) {
    PGraphicsAndroid3D a3d=(PGraphicsAndroid3D)parent.g;
    a3d.saveGLState();
    for (int i=0; i < a3d.lightCount; i++) {
      a3d.glLightDisable(i);
    }
    gl=a3d.gl;
    gl11=a3d.gl11;
    gl11x=a3d.gl11x;
    gl11xp=a3d.gl11xp;
    OPENGL_VENDOR=a3d.OPENGL_VENDOR;
    OPENGL_RENDERER=a3d.OPENGL_RENDERER;
    OPENGL_VERSION=a3d.OPENGL_VERSION;
    npotTexSupported=a3d.npotTexSupported;
    mipmapSupported=a3d.mipmapSupported;
    matrixGetSupported=a3d.matrixGetSupported;
    vboSupported=a3d.vboSupported;
    fboSupported=a3d.fboSupported;
    maxTextureSize=a3d.maxTextureSize;
    maxPointSize=a3d.maxPointSize;
  }
  if (!settingsInited)   defaultSettings();
  resetMatrix();
  report("String_Node_Str");
  vertexBuffer.rewind();
  colorBuffer.rewind();
  texCoordBuffer.rewind();
  normalBuffer.rewind();
  textureImage=null;
  textureImagePrev=null;
  blend(BLEND);
  if (hints[DISABLE_DEPTH_TEST]) {
    gl.glDisable(GL10.GL_DEPTH_TEST);
  }
 else {
    gl.glEnable(GL10.GL_DEPTH_TEST);
  }
  gl.glDepthFunc(GL10.GL_LEQUAL);
  gl.glFrontFace(GL10.GL_CW);
  gl.glViewport(0,0,width,height);
  camera();
  perspective();
  lightCount=0;
  lightFalloff(1,0,0);
  lightSpecular(0,0,0);
  gl.glEnable(GL10.GL_COLOR_MATERIAL);
  gl.glEnable(GL10.GL_NORMALIZE);
  gl.glEnable(GL10.GL_RESCALE_NORMAL);
  shapeFirst=0;
  if (fbStack == null) {
    fbStack=new Stack<PFramebuffer>();
    screenFramebuffer=new PFramebuffer(parent,width,height,true);
    setFramebuffer(screenFramebuffer);
  }
  if (clear && primarySurface) {
    gl.glClearColor(0,0,0,0);
    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
  }
 else {
    if (fboSupported) {
      if (drawFramebuffer == null) {
        createDrawFramebuffer();
      }
      pushFramebuffer();
      setFramebuffer(drawFramebuffer);
      drawFramebuffer.addColorBuffer(drawTextures[drawIndex]);
      gl.glClearColor(0,0,0,0);
      if (clear) {
        gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
      }
 else {
        gl.glClear(GL10.GL_DEPTH_BUFFER_BIT);
      }
      renderDrawTexture((drawIndex + 1) % 2);
    }
 else {
      if (screenTexID[0] == 0) {
        createScreenTexture();
      }
      gl.glClearColor(0,0,0,0);
      gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
      drawScreenTexture();
    }
  }
  report("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * OpenGL cannot draw until a proper native peer is available, so this returns the value of PApplet.isDisplayable() (inherited from Component).
 */
public void beginDraw(){
  VERTEXCOUNT=0;
  TRIANGLECOUNT=0;
  FACECOUNT=0;
  if (!primarySurface) {
    PGraphicsAndroid3D a3d=(PGraphicsAndroid3D)parent.g;
    a3d.saveGLState();
    for (int i=0; i < a3d.lightCount; i++) {
      a3d.glLightDisable(i);
    }
    gl=a3d.gl;
    gl11=a3d.gl11;
    gl11x=a3d.gl11x;
    gl11xp=a3d.gl11xp;
    OPENGL_VENDOR=a3d.OPENGL_VENDOR;
    OPENGL_RENDERER=a3d.OPENGL_RENDERER;
    OPENGL_VERSION=a3d.OPENGL_VERSION;
    npotTexSupported=a3d.npotTexSupported;
    mipmapSupported=a3d.mipmapSupported;
    matrixGetSupported=a3d.matrixGetSupported;
    vboSupported=a3d.vboSupported;
    fboSupported=a3d.fboSupported;
    maxTextureSize=a3d.maxTextureSize;
    maxPointSize=a3d.maxPointSize;
  }
  if (!settingsInited) {
    defaultSettings();
  }
  report("String_Node_Str");
  vertexBuffer.rewind();
  colorBuffer.rewind();
  texCoordBuffer.rewind();
  normalBuffer.rewind();
  textureImage=null;
  textureImagePrev=null;
  blend(BLEND);
  if (hints[DISABLE_DEPTH_TEST]) {
    gl.glDisable(GL10.GL_DEPTH_TEST);
  }
 else {
    gl.glEnable(GL10.GL_DEPTH_TEST);
  }
  gl.glDepthFunc(GL10.GL_LEQUAL);
  gl.glFrontFace(GL10.GL_CW);
  gl.glViewport(0,0,width,height);
  camera();
  perspective();
  lightCount=0;
  lightFalloff(1,0,0);
  lightSpecular(0,0,0);
  gl.glEnable(GL10.GL_COLOR_MATERIAL);
  gl.glEnable(GL10.GL_NORMALIZE);
  gl.glEnable(GL10.GL_RESCALE_NORMAL);
  shapeFirst=0;
  if (fbStack == null) {
    fbStack=new Stack<PFramebuffer>();
    screenFramebuffer=new PFramebuffer(parent,width,height,true);
    setFramebuffer(screenFramebuffer);
  }
  if (clear && primarySurface) {
    gl.glClearColor(0,0,0,0);
    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
  }
 else {
    if (fboSupported) {
      if (drawFramebuffer == null) {
        createDrawFramebuffer();
      }
      pushFramebuffer();
      setFramebuffer(drawFramebuffer);
      drawFramebuffer.addColorBuffer(drawTextures[drawIndex]);
      gl.glClearColor(0,0,0,0);
      if (clear) {
        gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
      }
 else {
        gl.glClear(GL10.GL_DEPTH_BUFFER_BIT);
      }
      renderDrawTexture((drawIndex + 1) % 2);
    }
 else {
      if (screenTexID[0] == 0) {
        createScreenTexture();
      }
      gl.glClearColor(0,0,0,0);
      gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
      drawScreenTexture();
    }
  }
  report("String_Node_Str");
}