Program: 57831
Project: 57831
Buggy source:
/** 
 * Init textures, build array of textures used for holding the whole samples
 */
public void init(DataTable table,DimensionVirtualArray dimensionVA,RecordVirtualArray recordVA,DataRepresentation dataRepresentation){
  this.table=table;
  this.dimensionVA=dimensionVA;
  this.recordVA=recordVA;
  ColorMapper colorMapper=heatMap.getDataDomain().getColorMapper();
  int textureHeight=numberOfRecords=recordVA.size();
  int textureWidth=numberOfDimensions=dimensionVA.size();
  numberOfTextures=(int)Math.ceil((double)numberOfRecords / MAX_SAMPLES_PER_TEXTURE);
  if (numberOfTextures <= 1)   samplesPerTexture=numberOfRecords;
 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 texture=0; texture < numberOfTextures; texture++) {
    if (texture == numberOfTextures - 1) {
      numberSamples.add(textureHeight - samplesPerTexture * texture);
      floatBuffer[texture]=FloatBuffer.allocate((textureHeight - samplesPerTexture * texture) * textureWidth * 4);
    }
 else {
      numberSamples.add(samplesPerTexture);
      floatBuffer[texture]=FloatBuffer.allocate(samplesPerTexture * textureWidth * 4);
    }
  }
  int recordCount=0;
  int textureCounter=0;
  float opacity=1;
  for (  Integer recordID : recordVA) {
    recordCount++;
    for (    Integer dimensionID : dimensionVA) {
      lookupValue=table.getFloat(dataRepresentation,dimensionID,recordID);
      float[] mappingColor=colorMapper.getColor(lookupValue);
      float[] rgba={mappingColor[0],mappingColor[1],mappingColor[2],opacity};
      floatBuffer[textureCounter].put(rgba);
    }
    if (recordCount >= 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++;
      recordCount=0;
    }
  }
}

Fixed version (ground truth):
/** 
 * Init textures, build array of textures used for holding the whole samples
 */
public void init(DataTable table,DimensionVirtualArray dimensionVA,RecordVirtualArray recordVA,DataRepresentation dataRepresentation){
  this.table=table;
  this.dimensionVA=dimensionVA;
  this.recordVA=recordVA;
  int textureHeight=numberOfRecords=recordVA.size();
  int textureWidth=numberOfDimensions=dimensionVA.size();
  numberOfTextures=(int)Math.ceil((double)numberOfRecords / MAX_SAMPLES_PER_TEXTURE);
  if (numberOfTextures <= 1)   samplesPerTexture=numberOfRecords;
 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 texture=0; texture < numberOfTextures; texture++) {
    if (texture == numberOfTextures - 1) {
      numberSamples.add(textureHeight - samplesPerTexture * texture);
      floatBuffer[texture]=FloatBuffer.allocate((textureHeight - samplesPerTexture * texture) * textureWidth * 4);
    }
 else {
      numberSamples.add(samplesPerTexture);
      floatBuffer[texture]=FloatBuffer.allocate(samplesPerTexture * textureWidth * 4);
    }
  }
  int recordCount=0;
  int textureCounter=0;
  float opacity=1;
  for (  Integer recordID : recordVA) {
    recordCount++;
    for (    Integer dimensionID : dimensionVA) {
      lookupValue=table.getFloat(dataRepresentation,dimensionID,recordID);
      float[] mappingColor=colorMapper.getColor(lookupValue);
      float[] rgba={mappingColor[0],mappingColor[1],mappingColor[2],opacity};
      floatBuffer[textureCounter].put(rgba);
    }
    if (recordCount >= 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++;
      recordCount=0;
    }
  }
}