Program: 78194
Project: 78194
Buggy source:
/** 
 * OpenGL ES 程序的全局数据初始化
 */
private void programDataInit(){
  float x=0;
  float y=0;
  float z=0;
  float r=sphereRadius;
  if (sphereRadius >= MAX_SCALE_VALUE) {
    r=MAX_SCALE_VALUE;
  }
 else   if (sphereRadius <= MIN_SCALE_VALUE) {
    r=MIN_SCALE_VALUE;
  }
  int index=0;
  int index1=0;
  double d=CAP * Math.PI / 180;
  for (int i=0; i < 180; i+=CAP) {
    double d1=i * Math.PI / 180;
    for (int j=0; j < 360; j+=CAP) {
      double d2=j * Math.PI / 180;
      verticals[index++]=(float)(x + r * Math.sin(d1 + d) * Math.cos(d2 + d));
      verticals[index++]=(float)(y + r * Math.cos(d1 + d));
      verticals[index++]=(float)(z + r * Math.sin(d1 + d) * Math.sin(d2 + d));
      UV_TEX_VERTEX[index1++]=(j + CAP) * 1f / 360;
      UV_TEX_VERTEX[index1++]=(i + CAP) * 1f / 180;
      verticals[index++]=(float)(x + r * Math.sin(d1) * Math.cos(d2));
      verticals[index++]=(float)(y + r * Math.cos(d1));
      verticals[index++]=(float)(z + r * Math.sin(d1) * Math.sin(d2));
      UV_TEX_VERTEX[index1++]=j * 1f / 360;
      UV_TEX_VERTEX[index1++]=i * 1f / 180;
      verticals[index++]=(float)(x + r * Math.sin(d1) * Math.cos(d2 + d));
      verticals[index++]=(float)(y + r * Math.cos(d1));
      verticals[index++]=(float)(z + r * Math.sin(d1) * Math.sin(d2 + d));
      UV_TEX_VERTEX[index1++]=(j + CAP) * 1f / 360;
      UV_TEX_VERTEX[index1++]=i * 1f / 180;
      verticals[index++]=(float)(x + r * Math.sin(d1 + d) * Math.cos(d2 + d));
      verticals[index++]=(float)(y + r * Math.cos(d1 + d));
      verticals[index++]=(float)(z + r * Math.sin(d1 + d) * Math.sin(d2 + d));
      UV_TEX_VERTEX[index1++]=(j + CAP) * 1f / 360;
      UV_TEX_VERTEX[index1++]=(i + CAP) * 1f / 180;
      verticals[index++]=(float)(x + r * Math.sin(d1 + d) * Math.cos(d2));
      verticals[index++]=(float)(y + r * Math.cos(d1 + d));
      verticals[index++]=(float)(z + r * Math.sin(d1 + d) * Math.sin(d2));
      UV_TEX_VERTEX[index1++]=j * 1f / 360;
      UV_TEX_VERTEX[index1++]=(i + CAP) * 1f / 180;
      verticals[index++]=(float)(x + r * Math.sin(d1) * Math.cos(d2));
      verticals[index++]=(float)(y + r * Math.cos(d1));
      verticals[index++]=(float)(z + r * Math.sin(d1) * Math.sin(d2));
      UV_TEX_VERTEX[index1++]=j * 1f / 360;
      UV_TEX_VERTEX[index1++]=i * 1f / 180;
    }
  }
  verticalsBuffer=ByteBuffer.allocateDirect(verticals.length * 4).order(ByteOrder.nativeOrder()).asFloatBuffer().put(verticals);
  verticalsBuffer.position(0);
  mUvTexVertexBuffer=ByteBuffer.allocateDirect(UV_TEX_VERTEX.length * 4).order(ByteOrder.nativeOrder()).asFloatBuffer().put(UV_TEX_VERTEX);
  mUvTexVertexBuffer.position(0);
}

Fixed version (ground truth):
/** 
 * OpenGL ES 程序的全局数据初始化
 */
private void programDataInit(){
  float x=0;
  float y=0;
  float z=0;
  float r=sphereRadius;
  int index=0;
  int index1=0;
  double d=CAP * Math.PI / 180;
  for (int i=0; i < 180; i+=CAP) {
    double d1=i * Math.PI / 180;
    for (int j=0; j < 360; j+=CAP) {
      double d2=j * Math.PI / 180;
      verticals[index++]=(float)(x + r * Math.sin(d1 + d) * Math.cos(d2 + d));
      verticals[index++]=(float)(y + r * Math.cos(d1 + d));
      verticals[index++]=(float)(z + r * Math.sin(d1 + d) * Math.sin(d2 + d));
      UV_TEX_VERTEX[index1++]=(j + CAP) * 1f / 360;
      UV_TEX_VERTEX[index1++]=(i + CAP) * 1f / 180;
      verticals[index++]=(float)(x + r * Math.sin(d1) * Math.cos(d2));
      verticals[index++]=(float)(y + r * Math.cos(d1));
      verticals[index++]=(float)(z + r * Math.sin(d1) * Math.sin(d2));
      UV_TEX_VERTEX[index1++]=j * 1f / 360;
      UV_TEX_VERTEX[index1++]=i * 1f / 180;
      verticals[index++]=(float)(x + r * Math.sin(d1) * Math.cos(d2 + d));
      verticals[index++]=(float)(y + r * Math.cos(d1));
      verticals[index++]=(float)(z + r * Math.sin(d1) * Math.sin(d2 + d));
      UV_TEX_VERTEX[index1++]=(j + CAP) * 1f / 360;
      UV_TEX_VERTEX[index1++]=i * 1f / 180;
      verticals[index++]=(float)(x + r * Math.sin(d1 + d) * Math.cos(d2 + d));
      verticals[index++]=(float)(y + r * Math.cos(d1 + d));
      verticals[index++]=(float)(z + r * Math.sin(d1 + d) * Math.sin(d2 + d));
      UV_TEX_VERTEX[index1++]=(j + CAP) * 1f / 360;
      UV_TEX_VERTEX[index1++]=(i + CAP) * 1f / 180;
      verticals[index++]=(float)(x + r * Math.sin(d1 + d) * Math.cos(d2));
      verticals[index++]=(float)(y + r * Math.cos(d1 + d));
      verticals[index++]=(float)(z + r * Math.sin(d1 + d) * Math.sin(d2));
      UV_TEX_VERTEX[index1++]=j * 1f / 360;
      UV_TEX_VERTEX[index1++]=(i + CAP) * 1f / 180;
      verticals[index++]=(float)(x + r * Math.sin(d1) * Math.cos(d2));
      verticals[index++]=(float)(y + r * Math.cos(d1));
      verticals[index++]=(float)(z + r * Math.sin(d1) * Math.sin(d2));
      UV_TEX_VERTEX[index1++]=j * 1f / 360;
      UV_TEX_VERTEX[index1++]=i * 1f / 180;
    }
  }
  verticalsBuffer=ByteBuffer.allocateDirect(verticals.length * 4).order(ByteOrder.nativeOrder()).asFloatBuffer().put(verticals);
  verticalsBuffer.position(0);
  mUvTexVertexBuffer=ByteBuffer.allocateDirect(UV_TEX_VERTEX.length * 4).order(ByteOrder.nativeOrder()).asFloatBuffer().put(UV_TEX_VERTEX);
  mUvTexVertexBuffer.position(0);
}