Program: 57958
Project: 57958
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;
    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;
    }
  }
}

Fixed version (ground truth):
public void initTextures(ArrayList<Float> uncertaintyVA){
  if (storageVA == null || contentVA == null)   return;
  int textureWidth=storageVA.size();
  int textureHeight=numberOfElements=contentVA.size();
  if (uncertaintyVA != null) {
    textureHeight=numberOfElements=uncertaintyVA.size();
  }
  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;
  float[] middle1={(light[0] + dark[0]) / 2f,(light[1] + dark[1]) * 0.66f,(light[2] + dark[2]) * 0.66f,(light[3] + dark[3]) * 0.66f};
  float[] middle2={(light[0] + dark[0]) / 2f,(light[1] + dark[1]) * 0.33f,(light[2] + dark[2]) * 0.33f,(light[3] + dark[3]) * 0.33f};
  for (int index=0; index < numberOfElements; index++) {
    float uncertainty;
    contentCount++;
    if (uncertaintyVA != null) {
      uncertainty=uncertaintyVA.get(index);
    }
 else {
      try {
        uncertainty=set.getNormalizedUncertainty(contentVA.get(index));
      }
 catch (      IllegalStateException ex) {
        uncertainty=0;
      }
    }
    for (int i=0; i < textureWidth; i++) {
      float[] rgba=new float[4];
      if ((((float)i / textureWidth) * 0.25) > (uncertainty)) {
        rgba=light;
      }
 else       if ((((float)i / textureWidth) * 0.5) > (uncertainty)) {
        rgba=light;
      }
 else       if ((((float)i / textureWidth) * 0.75) > (uncertainty)) {
        rgba=light;
      }
 else       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;
    }
  }
}