Program: 57884
Project: 57884
Buggy source:
public void initTextures(ArrayList<Float> uncertaintyVA){
  if (dimensionVA == null || recordVA == null)   return;
  int textureWidth=dimensionVA.size();
  int textureHeight=numberOfElements=recordVA.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;
  for (int index=0; index < numberOfElements; index++) {
    float uncertainty;
    contentCount++;
    if (uncertaintyVA != null) {
      uncertainty=uncertaintyVA.get(index);
    }
 else {
      uncertainty=glUncHeatmap.getMaxUncertainty(recordVA.get(index));
    }
    for (int i=0; i < textureWidth; i++) {
      float[] rgba=new float[4];
      if (((float)i / textureWidth) > uncertainty) {
        if (uncertainty >= 1)         rgba=this.lightCertain;
 else         rgba=this.lightUncertain;
      }
 else {
        rgba=GLUncertaintyHeatMap.BACKGROUND;
      }
      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 (dimensionVA == null || recordVA == null)   return;
  int textureWidth=dimensionVA.size();
  int textureHeight=numberOfElements=recordVA.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;
  for (int index=0; index < numberOfElements; index++) {
    float uncertainty;
    contentCount++;
    if (uncertaintyVA != null) {
      uncertainty=uncertaintyVA.get(index);
    }
 else     if (glUncHeatmap.isMaxUncertaintyCalculated()) {
      uncertainty=glUncHeatmap.getMaxUncertainty(recordVA.get(index));
    }
 else     uncertainty=1;
    for (int i=0; i < textureWidth; i++) {
      float[] rgba=new float[4];
      if (((float)i / textureWidth) > uncertainty) {
        if (uncertainty >= 1)         rgba=this.lightCertain;
 else         rgba=this.lightUncertain;
      }
 else {
        rgba=GLUncertaintyHeatMap.BACKGROUND;
      }
      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,true,false,false,floatBuffer[textureCounter],null);
      tempTexture=TextureIO.newTexture(0);
      tempTexture.updateImage(texData);
      textures.add(tempTexture);
      textureCounter++;
      contentCount=0;
    }
  }
}