Program: 57954
Project: 57954
Buggy source:
public void initTextures(ISet set,ContentVirtualArray contentVA,StorageVirtualArray storageVA){
  int textureWidth=storageVA.size();
  int textureHeight=numberOfElements=contentVA.size();
  this.storageVA=storageVA;
  this.contentVA=contentVA;
  this.set=set;
  numberOfTextures=(int)Math.ceil((double)numberOfElements / MAX_SAMPLES_PER_TEXTURE);
  if (numberOfTextures <= 1)   samplesPerTexture=numberOfElements;
 else   samplesPerTexture=MAX_SAMPLES_PER_TEXTURE;
  textures.clear();
  numberSamples.clear();
  Texture tempTexture;
  samplesPerTexture=(int)Math.ceil((double)textureHeight / numberOfTextures);
  FloatBuffer[] floatBuffer=new FloatBuffer[numberOfTextures];
  for (int iTexture=0; iTexture < numberOfTextures; iTexture++) {
    if (iTexture == numberOfTextures - 1) {
      numberSamples.add(textureHeight - samplesPerTexture * iTexture);
      floatBuffer[iTexture]=FloatBuffer.allocate((textureHeight - samplesPerTexture * iTexture) * textureWidth * 4);
    }
 else {
      numberSamples.add(samplesPerTexture);
      floatBuffer[iTexture]=FloatBuffer.allocate(samplesPerTexture * textureWidth * 4);
    }
  }
  int contentCount=0;
  int textureCounter=0;
  for (  Integer contentIndex : contentVA) {
    contentCount++;
    float uncertainty=set.getNormalizedUncertainty(contentIndex);
    for (int i=0; i < textureWidth; i++) {
      float[] rgba=new float[4];
      if ((float)i / textureWidth > uncertainty) {
        rgba=light;
      }
 else {
        rgba=dark;
      }
      floatBuffer[textureCounter].put(rgba);
    }
    if (contentCount >= numberSamples.get(textureCounter)) {
      floatBuffer[textureCounter].rewind();
      TextureData texData=new TextureData(GLProfile.getDefault(),GL2.GL_RGBA,textureWidth,numberSamples.get(textureCounter),0,GL2.GL_RGBA,GL2.GL_FLOAT,false,false,false,floatBuffer[textureCounter],null);
      tempTexture=TextureIO.newTexture(0);
      tempTexture.updateImage(texData);
      textures.add(tempTexture);
      textureCounter++;
      contentCount=0;
    }
  }
}

Fixed version (ground truth):
public void initTextures(ISet set,ContentVirtualArray contentVA,StorageVirtualArray storageVA){
  int textureWidth=storageVA.size();
  int textureHeight=numberOfElements=contentVA.size();
  this.storageVA=storageVA;
  this.contentVA=contentVA;
  this.set=set;
  numberOfTextures=(int)Math.ceil((double)numberOfElements / MAX_SAMPLES_PER_TEXTURE);
  if (numberOfTextures <= 1)   samplesPerTexture=numberOfElements;
 else   samplesPerTexture=MAX_SAMPLES_PER_TEXTURE;
  textures.clear();
  numberSamples.clear();
  Texture tempTexture;
  samplesPerTexture=(int)Math.ceil((double)textureHeight / numberOfTextures);
  FloatBuffer[] floatBuffer=new FloatBuffer[numberOfTextures];
  for (int iTexture=0; iTexture < numberOfTextures; iTexture++) {
    if (iTexture == numberOfTextures - 1) {
      numberSamples.add(textureHeight - samplesPerTexture * iTexture);
      floatBuffer[iTexture]=FloatBuffer.allocate((textureHeight - samplesPerTexture * iTexture) * textureWidth * 4);
    }
 else {
      numberSamples.add(samplesPerTexture);
      floatBuffer[iTexture]=FloatBuffer.allocate(samplesPerTexture * textureWidth * 4);
    }
  }
  int contentCount=0;
  int textureCounter=0;
  for (  Integer contentIndex : contentVA) {
    contentCount++;
    float uncertainty;
    try {
      uncertainty=set.getNormalizedUncertainty(contentIndex);
    }
 catch (    IllegalStateException ex) {
      uncertainty=0;
    }
    for (int i=0; i < textureWidth; i++) {
      float[] rgba=new float[4];
      if ((float)i / textureWidth > uncertainty) {
        rgba=light;
      }
 else {
        rgba=dark;
      }
      floatBuffer[textureCounter].put(rgba);
    }
    if (contentCount >= numberSamples.get(textureCounter)) {
      floatBuffer[textureCounter].rewind();
      TextureData texData=new TextureData(GLProfile.getDefault(),GL2.GL_RGBA,textureWidth,numberSamples.get(textureCounter),0,GL2.GL_RGBA,GL2.GL_FLOAT,false,false,false,floatBuffer[textureCounter],null);
      tempTexture=TextureIO.newTexture(0);
      tempTexture.updateImage(texData);
      textures.add(tempTexture);
      textureCounter++;
      contentCount=0;
    }
  }
}