Program: 57886
Project: 57886
Buggy source:
public void init(GLUncertaintyHeatMap uncertaintyHeatMap,DataTable table,RecordVirtualArray recordVA,DimensionVirtualArray dimensionVA,int groupIndex){
  this.recordVA=recordVA;
  this.dimensionVA=dimensionVA;
  this.table=table;
  this.uncertaintyHeatMap=uncertaintyHeatMap;
  ColorMapper colorMapper=uncertaintyHeatMap.getColorMapper();
  this.groupIndex=groupIndex;
  int textureHeight=numberOfElements=recordVA.size();
  int textureWidth=numberOfExpirments=dimensionVA.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);
  float fLookupValue=0;
  floatBuffer=new FloatBuffer[numberOfTextures];
  for (int itextures=0; itextures < numberOfTextures; itextures++) {
    if (itextures == numberOfTextures - 1) {
      numberSamples.add(textureHeight - samplesPerTexture * itextures);
      floatBuffer[itextures]=FloatBuffer.allocate((textureHeight - samplesPerTexture * itextures) * textureWidth * 4);
    }
 else {
      numberSamples.add(samplesPerTexture);
      floatBuffer[itextures]=FloatBuffer.allocate(samplesPerTexture * textureWidth * 4);
    }
  }
  int contentCount=0;
  int textureCounter=0;
  float opacity=1;
  for (  Integer recordIndex : recordVA) {
    contentCount++;
    for (    Integer dimensionIndex : dimensionVA) {
      fLookupValue=table.get(dimensionIndex).getFloat(uncertaintyHeatMap.getRenderingRepresentation(),recordIndex);
      float[] mappingColor=colorMapper.getColor(fLookupValue);
      float[] rgba={mappingColor[0],mappingColor[1],mappingColor[2],opacity};
      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 init(GLUncertaintyHeatMap uncertaintyHeatMap,DataTable table,RecordVirtualArray recordVA,DimensionVirtualArray dimensionVA,int groupIndex){
  this.recordVA=recordVA;
  this.dimensionVA=dimensionVA;
  this.table=table;
  this.uncertaintyHeatMap=uncertaintyHeatMap;
  ColorMapper colorMapper=uncertaintyHeatMap.getColorMapper();
  this.groupIndex=groupIndex;
  int textureHeight=numberOfElements=recordVA.size();
  int textureWidth=numberOfExpirments=dimensionVA.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);
  float lookupValue=0;
  floatBuffer=new FloatBuffer[numberOfTextures];
  for (int itextures=0; itextures < numberOfTextures; itextures++) {
    if (itextures == numberOfTextures - 1) {
      numberSamples.add(textureHeight - samplesPerTexture * itextures);
      floatBuffer[itextures]=FloatBuffer.allocate((textureHeight - samplesPerTexture * itextures) * textureWidth * 4);
    }
 else {
      numberSamples.add(samplesPerTexture);
      floatBuffer[itextures]=FloatBuffer.allocate(samplesPerTexture * textureWidth * 4);
    }
  }
  int contentCount=0;
  int textureCounter=0;
  float opacity=1;
  for (  Integer recordIndex : recordVA) {
    contentCount++;
    for (    Integer dimensionIndex : dimensionVA) {
      lookupValue=table.get(dimensionIndex).getFloat(uncertaintyHeatMap.getRenderingRepresentation(),recordIndex);
      float[] mappingColor=colorMapper.getColor(lookupValue);
      float[] rgba={mappingColor[0],mappingColor[1],mappingColor[2],opacity};
      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;
    }
  }
}