Program: 39567
Project: 39567
Buggy source:
protected void drawObject(Object3d $o){
  if ($o.isVisible() == false)   return;
  if ($o.hasNormals() && $o.normalsEnabled()) {
    $o.vertices().normals().buffer().position(0);
    _gl.glNormalPointer(GL10.GL_FLOAT,0,$o.vertices().normals().buffer());
    _gl.glEnableClientState(GL10.GL_NORMAL_ARRAY);
  }
 else {
    _gl.glDisableClientState(GL10.GL_NORMAL_ARRAY);
  }
  boolean useLighting=(_scene.lightingEnabled() && $o.hasNormals() && $o.normalsEnabled());
  if (useLighting) {
    _gl.glEnable(GL10.GL_LIGHTING);
  }
 else {
    _gl.glDisable(GL10.GL_LIGHTING);
  }
  _gl.glGetIntegerv(GL11.GL_SHADE_MODEL,_scratchIntBuffer);
  if ($o.shadeModel().glConstant() != _scratchIntBuffer.get(0)) {
    _gl.glShadeModel($o.shadeModel().glConstant());
  }
  if ($o.hasVertexColors() && $o.vertexColorsEnabled()) {
    $o.vertices().colors().buffer().position(0);
    _gl.glColorPointer(4,GL10.GL_UNSIGNED_BYTE,0,$o.vertices().colors().buffer());
    _gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
  }
 else {
    _gl.glColor4f((float)$o.defaultColor().r / 255f,(float)$o.defaultColor().g / 255f,(float)$o.defaultColor().b / 255f,(float)$o.defaultColor().a / 255f);
    _gl.glDisableClientState(GL10.GL_COLOR_ARRAY);
  }
  _gl.glGetIntegerv(GL10.GL_COLOR_MATERIAL,_scratchIntBuffer);
  _scratchB=(_scratchIntBuffer.get(0) != 0);
  if ($o.colorMaterialEnabled() != _scratchB) {
    if ($o.colorMaterialEnabled())     _gl.glEnable(GL10.GL_COLOR_MATERIAL);
 else     _gl.glDisable(GL10.GL_COLOR_MATERIAL);
  }
  if ($o.renderType() == RenderType.POINTS) {
    if ($o.pointSmoothing())     _gl.glEnable(GL10.GL_POINT_SMOOTH);
 else     _gl.glDisable(GL10.GL_POINT_SMOOTH);
    _gl.glPointSize($o.pointSize());
  }
  if ($o.renderType() == RenderType.LINES) {
    if ($o.lineSmoothing() == true) {
      _gl.glEnable(GL10.GL_LINE_SMOOTH);
    }
 else {
      _gl.glDisable(GL10.GL_LINE_SMOOTH);
    }
    _gl.glLineWidth($o.lineWidth());
  }
  if ($o.doubleSidedEnabled()) {
    _gl.glDisable(GL10.GL_CULL_FACE);
  }
 else {
    _gl.glEnable(GL10.GL_CULL_FACE);
  }
  drawObject_textures($o);
  _gl.glPushMatrix();
  _gl.glTranslatef($o.position().x,$o.position().y,$o.position().z);
  _gl.glRotatef($o.rotation().x,1,0,0);
  _gl.glRotatef($o.rotation().y,0,1,0);
  _gl.glRotatef($o.rotation().z,0,0,1);
  _gl.glScalef($o.scale().x,$o.scale().y,$o.scale().z);
  $o.vertices().points().buffer().position(0);
  _gl.glVertexPointer(3,GL10.GL_FLOAT,0,$o.vertices().points().buffer());
  if (!$o.ignoreFaces()) {
    int pos, len;
    if (!$o.faces().renderSubsetEnabled()) {
      pos=0;
      len=$o.faces().size();
    }
 else {
      pos=$o.faces().renderSubsetStartIndex() * FacesBufferedList.PROPERTIES_PER_ELEMENT;
      len=$o.faces().renderSubsetLength();
    }
    $o.faces().buffer().position(pos);
    _gl.glDrawElements($o.renderTypeInt(),len * FacesBufferedList.PROPERTIES_PER_ELEMENT,GL10.GL_UNSIGNED_SHORT,$o.faces().buffer());
  }
 else {
    _gl.glDrawArrays($o.renderTypeInt(),0,$o.vertices().size());
  }
  if ($o instanceof Object3dContainer) {
    Object3dContainer container=(Object3dContainer)$o;
    for (int i=0; i < container.children().size(); i++) {
      Object3d o=container.children().get(i);
      drawObject(o);
    }
  }
  _gl.glPopMatrix();
}

Fixed version (ground truth):
protected void drawObject(Object3d $o){
  if ($o.isVisible() == false)   return;
  if ($o.hasNormals() && $o.normalsEnabled()) {
    $o.vertices().normals().buffer().position(0);
    _gl.glNormalPointer(GL10.GL_FLOAT,0,$o.vertices().normals().buffer());
    _gl.glEnableClientState(GL10.GL_NORMAL_ARRAY);
  }
 else {
    _gl.glDisableClientState(GL10.GL_NORMAL_ARRAY);
  }
  boolean useLighting=(_scene.lightingEnabled() && $o.hasNormals() && $o.normalsEnabled()&& $o.lightingEnabled());
  if (useLighting) {
    _gl.glEnable(GL10.GL_LIGHTING);
  }
 else {
    _gl.glDisable(GL10.GL_LIGHTING);
  }
  _gl.glGetIntegerv(GL11.GL_SHADE_MODEL,_scratchIntBuffer);
  if ($o.shadeModel().glConstant() != _scratchIntBuffer.get(0)) {
    _gl.glShadeModel($o.shadeModel().glConstant());
  }
  if ($o.hasVertexColors() && $o.vertexColorsEnabled()) {
    $o.vertices().colors().buffer().position(0);
    _gl.glColorPointer(4,GL10.GL_UNSIGNED_BYTE,0,$o.vertices().colors().buffer());
    _gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
  }
 else {
    _gl.glColor4f((float)$o.defaultColor().r / 255f,(float)$o.defaultColor().g / 255f,(float)$o.defaultColor().b / 255f,(float)$o.defaultColor().a / 255f);
    _gl.glDisableClientState(GL10.GL_COLOR_ARRAY);
  }
  _gl.glGetIntegerv(GL10.GL_COLOR_MATERIAL,_scratchIntBuffer);
  _scratchB=(_scratchIntBuffer.get(0) != 0);
  if ($o.colorMaterialEnabled() != _scratchB) {
    if ($o.colorMaterialEnabled())     _gl.glEnable(GL10.GL_COLOR_MATERIAL);
 else     _gl.glDisable(GL10.GL_COLOR_MATERIAL);
  }
  if ($o.renderType() == RenderType.POINTS) {
    if ($o.pointSmoothing())     _gl.glEnable(GL10.GL_POINT_SMOOTH);
 else     _gl.glDisable(GL10.GL_POINT_SMOOTH);
    _gl.glPointSize($o.pointSize());
  }
  if ($o.renderType() == RenderType.LINES) {
    if ($o.lineSmoothing() == true) {
      _gl.glEnable(GL10.GL_LINE_SMOOTH);
    }
 else {
      _gl.glDisable(GL10.GL_LINE_SMOOTH);
    }
    _gl.glLineWidth($o.lineWidth());
  }
  if ($o.doubleSidedEnabled()) {
    _gl.glDisable(GL10.GL_CULL_FACE);
  }
 else {
    _gl.glEnable(GL10.GL_CULL_FACE);
  }
  drawObject_textures($o);
  _gl.glPushMatrix();
  _gl.glTranslatef($o.position().x,$o.position().y,$o.position().z);
  _gl.glRotatef($o.rotation().x,1,0,0);
  _gl.glRotatef($o.rotation().y,0,1,0);
  _gl.glRotatef($o.rotation().z,0,0,1);
  _gl.glScalef($o.scale().x,$o.scale().y,$o.scale().z);
  $o.vertices().points().buffer().position(0);
  _gl.glVertexPointer(3,GL10.GL_FLOAT,0,$o.vertices().points().buffer());
  if (!$o.ignoreFaces()) {
    int pos, len;
    if (!$o.faces().renderSubsetEnabled()) {
      pos=0;
      len=$o.faces().size();
    }
 else {
      pos=$o.faces().renderSubsetStartIndex() * FacesBufferedList.PROPERTIES_PER_ELEMENT;
      len=$o.faces().renderSubsetLength();
    }
    $o.faces().buffer().position(pos);
    _gl.glDrawElements($o.renderTypeInt(),len * FacesBufferedList.PROPERTIES_PER_ELEMENT,GL10.GL_UNSIGNED_SHORT,$o.faces().buffer());
  }
 else {
    _gl.glDrawArrays($o.renderTypeInt(),0,$o.vertices().size());
  }
  if ($o instanceof Object3dContainer) {
    Object3dContainer container=(Object3dContainer)$o;
    for (int i=0; i < container.children().size(); i++) {
      Object3d o=container.children().get(i);
      drawObject(o);
    }
  }
  _gl.glPopMatrix();
}