Program: 56790
Project: 56790
Buggy source:
@Override protected void renderContent(GL2 gl){
  TablePerspective mappedPerspective=pathRenderer.getMappedPerspective();
  List<Integer> ids=node.getMappedDavidIDs();
  if (ids == null || ids.isEmpty())   return;
  float onePxlWidth=view.getPixelGLConverter().getGLWidthForPixelWidth(1);
  float onePxlHeight=view.getPixelGLConverter().getGLHeightForPixelHeight(1);
  float z=1f;
  if (mappedPerspective != null) {
    Average average=null;
    if (pathRenderer.getSampleMappingMode() == ESampleMappingMode.ALL) {
      average=mappedPerspective.getContainerStatistics().getAverage(idType,ids.get(0));
    }
 else {
      Set<Integer> selectedSamples=pathRenderer.getSampleSelectionManager().getElements(SelectionType.SELECTION);
      List<Integer> selectedSamplesArray=new ArrayList<Integer>();
      selectedSamplesArray.addAll(selectedSamples);
      if (!selectedSamplesArray.isEmpty()) {
        VirtualArray selectedSamplesVA=new VirtualArray(pathRenderer.getSampleSelectionManager().getIDType(),selectedSamplesArray);
        GroupList groupList=new GroupList();
        groupList.append(new Group(selectedSamplesVA.size()));
        selectedSamplesVA.setGroupList(groupList);
        average=TablePerspectiveStatistics.calculateAverage(selectedSamplesVA,mappedPerspective.getDataDomain(),idType,ids);
      }
    }
    if (average != null) {
      setColor(mappedPerspective.getDataDomain().getTable().getColorMapper().getColor((float)average.getArithmeticMean()));
      float yStart=-1 * onePxlHeight;
      float yEnd=-5 * onePxlHeight;
      gl.glColor3f(1,1,1);
      gl.glBegin(GL2.GL_POLYGON);
      gl.glVertex3f(0,yStart,z);
      gl.glVertex3f(0,yEnd,z);
      gl.glVertex3f(x,yEnd,z);
      gl.glVertex3f(x,yStart,z);
      gl.glEnd();
      gl.glColor3fv(mappedPerspective.getDataDomain().getColor().getRGB(),0);
      gl.glBegin(GL2.GL_POLYGON);
      gl.glVertex3f(0,yStart,z);
      gl.glVertex3f(0,yEnd,z);
      gl.glVertex3f(x * (float)average.getStandardDeviation() * 2,yEnd,z);
      gl.glVertex3f(x * (float)average.getStandardDeviation() * 2,yStart,z);
      gl.glEnd();
      gl.glColor3f(0,0,0);
      gl.glBegin(GL.GL_LINE_LOOP);
      gl.glVertex3f(0,yStart,z);
      gl.glVertex3f(0,yEnd,z);
      gl.glVertex3f(x,yEnd,z);
      gl.glVertex3f(x,yStart,z);
      gl.glEnd();
      gl.glColor3fv(mappedPerspective.getDataDomain().getColor().getRGB(),0);
    }
 else {
      setColor(new float[]{1,1,1,1});
    }
  }
 else {
    setColor(new float[]{1,1,1,1});
  }
  Pair<TablePerspective,Average> highestAverage=null;
  Average average;
  for (  TablePerspective tablePerspective : pathRenderer.getTablePerspectives()) {
    average=tablePerspective.getContainerStatistics().getAverage(idType,ids.get(0));
    if (average == null)     continue;
    if (average.getStandardDeviation() > 0.2f) {
      if (highestAverage == null || average.getStandardDeviation() > highestAverage.getSecond().getStandardDeviation()) {
        highestAverage=new Pair<>(tablePerspective,average);
      }
    }
  }
  if (highestAverage != null) {
    gl.glColor3fv(highestAverage.getFirst().getDataDomain().getColor().darker().getRGB(),0);
    gl.glBegin(GL2.GL_POLYGON);
    gl.glVertex3f(x + 4 * onePxlWidth,3 * onePxlHeight,z);
    gl.glVertex3f(x + 8 * onePxlWidth,3 * onePxlHeight,z);
    gl.glVertex3f(x + 10 * onePxlWidth,y + 2 * onePxlHeight,z);
    gl.glVertex3f(x + 2 * onePxlWidth,y + 2 * onePxlHeight,z);
    gl.glEnd();
    gl.glBegin(GL2.GL_POLYGON);
    gl.glVertex3f(x + 3 * onePxlWidth,1 * onePxlHeight,z);
    gl.glVertex3f(x + 9 * onePxlWidth,1 * onePxlHeight,z);
    gl.glVertex3f(x + 9 * onePxlWidth,-3 * onePxlHeight,z);
    gl.glVertex3f(x + 3 * onePxlWidth,-3 * onePxlHeight,z);
    gl.glEnd();
  }
  super.renderContent(gl);
}

Fixed version (ground truth):
@Override protected void renderContent(GL2 gl){
  TablePerspective mappedPerspective=pathRenderer.getMappedPerspective();
  List<Integer> ids=node.getMappedDavidIDs();
  if (ids == null || ids.isEmpty())   return;
  float onePxlWidth=view.getPixelGLConverter().getGLWidthForPixelWidth(1);
  float onePxlHeight=view.getPixelGLConverter().getGLHeightForPixelHeight(1);
  float z=1f;
  if (mappedPerspective != null) {
    Average average=null;
    if (pathRenderer.getSampleMappingMode() == ESampleMappingMode.ALL) {
      average=mappedPerspective.getContainerStatistics().getAverage(idType,ids.get(0));
    }
 else {
      Set<Integer> selectedSamples=pathRenderer.getSampleSelectionManager().getElements(SelectionType.SELECTION);
      List<Integer> selectedSamplesArray=new ArrayList<Integer>();
      selectedSamplesArray.addAll(selectedSamples);
      if (!selectedSamplesArray.isEmpty()) {
        VirtualArray selectedSamplesVA=new VirtualArray(pathRenderer.getSampleSelectionManager().getIDType(),selectedSamplesArray);
        GroupList groupList=new GroupList();
        groupList.append(new Group(selectedSamplesVA.size()));
        selectedSamplesVA.setGroupList(groupList);
        average=TablePerspectiveStatistics.calculateAverage(selectedSamplesVA,mappedPerspective.getDataDomain(),idType,ids);
        if (Double.isNaN(average.getArithmeticMean()))         average=null;
      }
    }
    if (average != null) {
      setColor(mappedPerspective.getDataDomain().getTable().getColorMapper().getColor((float)average.getArithmeticMean()));
      float yStart=-1 * onePxlHeight;
      float yEnd=-5 * onePxlHeight;
      gl.glColor3f(1,1,1);
      gl.glBegin(GL2.GL_POLYGON);
      gl.glVertex3f(0,yStart,z);
      gl.glVertex3f(0,yEnd,z);
      gl.glVertex3f(x,yEnd,z);
      gl.glVertex3f(x,yStart,z);
      gl.glEnd();
      gl.glColor3fv(mappedPerspective.getDataDomain().getColor().getRGB(),0);
      gl.glBegin(GL2.GL_POLYGON);
      gl.glVertex3f(0,yStart,z);
      gl.glVertex3f(0,yEnd,z);
      gl.glVertex3f(x * (float)average.getStandardDeviation() * 2,yEnd,z);
      gl.glVertex3f(x * (float)average.getStandardDeviation() * 2,yStart,z);
      gl.glEnd();
      gl.glColor3f(0,0,0);
      gl.glBegin(GL.GL_LINE_LOOP);
      gl.glVertex3f(0,yStart,z);
      gl.glVertex3f(0,yEnd,z);
      gl.glVertex3f(x,yEnd,z);
      gl.glVertex3f(x,yStart,z);
      gl.glEnd();
      gl.glColor3fv(mappedPerspective.getDataDomain().getColor().getRGB(),0);
    }
 else {
      setColor(new float[]{1,1,1,1});
    }
  }
 else {
    setColor(new float[]{1,1,1,1});
  }
  Pair<TablePerspective,Average> highestAverage=null;
  Average average;
  for (  TablePerspective tablePerspective : pathRenderer.getTablePerspectives()) {
    average=tablePerspective.getContainerStatistics().getAverage(idType,ids.get(0));
    if (average == null)     continue;
    if (average.getStandardDeviation() > 0.2f) {
      if (highestAverage == null || average.getStandardDeviation() > highestAverage.getSecond().getStandardDeviation()) {
        highestAverage=new Pair<>(tablePerspective,average);
      }
    }
  }
  if (highestAverage != null) {
    gl.glColor3fv(highestAverage.getFirst().getDataDomain().getColor().darker().getRGB(),0);
    gl.glBegin(GL2.GL_POLYGON);
    gl.glVertex3f(x + 4 * onePxlWidth,3 * onePxlHeight,z);
    gl.glVertex3f(x + 8 * onePxlWidth,3 * onePxlHeight,z);
    gl.glVertex3f(x + 10 * onePxlWidth,y + 2 * onePxlHeight,z);
    gl.glVertex3f(x + 2 * onePxlWidth,y + 2 * onePxlHeight,z);
    gl.glEnd();
    gl.glBegin(GL2.GL_POLYGON);
    gl.glVertex3f(x + 3 * onePxlWidth,1 * onePxlHeight,z);
    gl.glVertex3f(x + 9 * onePxlWidth,1 * onePxlHeight,z);
    gl.glVertex3f(x + 9 * onePxlWidth,-3 * onePxlHeight,z);
    gl.glVertex3f(x + 3 * onePxlWidth,-3 * onePxlHeight,z);
    gl.glEnd();
  }
  super.renderContent(gl);
}