Program: 57473
Project: 57473
Buggy source:
private void buildDisplayList(final GL2 gl,int iGLDisplayListIndex){
  dataRowHeight=pixelGLConverter.getGLHeightForPixelHeight(DEFAULT_DATA_ROW_HEIGHT_PIXELS);
  gl.glNewList(iGLDisplayListIndex,GL2.GL_COMPILE);
  float branchColumnWidth=pixelGLConverter.getGLWidthForPixelWidth(BRANCH_COLUMN_WIDTH_PIXELS);
  float pathwayColumnWidth=pixelGLConverter.getGLWidthForPixelWidth(PATHWAY_COLUMN_WIDTH_PIXELS);
  GLU glu=new GLU();
  float pathwayHeight=0;
  if (isLayoutDirty) {
    List<AnchorNodeSpacing> anchorNodeSpacings=calcAnchorNodeSpacings();
    Vec3f currentPosition=new Vec3f(branchColumnWidth + pathwayColumnWidth / 2.0f,viewFrustum.getHeight(),0.2f);
    float minNodeSpacing=pixelGLConverter.getGLHeightForPixelHeight(MIN_NODE_SPACING_PIXELS);
    int minViewHeightRequiredByBranchNodes=0;
    for (    AnchorNodeSpacing spacing : anchorNodeSpacings) {
      float currentAnchorNodeSpacing=spacing.getCurrentAnchorNodeSpacing();
      float nodeSpacing=(Float.isNaN(currentAnchorNodeSpacing) ? minNodeSpacing : (currentAnchorNodeSpacing - spacing.getTotalNodeHeight()) / ((float)spacing.getNodesInbetween().size() + 1));
      ANode startAnchorNode=spacing.getStartNode();
      float currentInbetweenNodePositionY=currentPosition.y() - ((startAnchorNode != null) ? startAnchorNode.getHeight() / 2.0f : 0);
      int minViewHeight=calculatePositionsOfBranchNodes(startAnchorNode);
      if (minViewHeight > minViewHeightRequiredByBranchNodes) {
        minViewHeightRequiredByBranchNodes=minViewHeight;
      }
      for (int i=0; i < spacing.getNodesInbetween().size(); i++) {
        ANode node=spacing.getNodesInbetween().get(i);
        node.setPosition(new Vec3f(currentPosition.x(),currentInbetweenNodePositionY - nodeSpacing - node.getHeight() / 2.0f,currentPosition.z()));
        currentInbetweenNodePositionY-=(nodeSpacing + node.getHeight());
        minViewHeight=calculatePositionsOfBranchNodes(node);
        if (minViewHeight > minViewHeightRequiredByBranchNodes) {
          minViewHeightRequiredByBranchNodes=minViewHeight;
        }
      }
      currentPosition.setY(currentPosition.y() - spacing.getCurrentAnchorNodeSpacing());
      ANode endAnchorNode=spacing.getEndNode();
      if (endAnchorNode != null) {
        endAnchorNode.setPosition(new Vec3f(currentPosition));
        minViewHeight=calculatePositionsOfBranchNodes(endAnchorNode);
        if (minViewHeight > minViewHeightRequiredByBranchNodes) {
          minViewHeightRequiredByBranchNodes=minViewHeight;
        }
      }
      pathwayHeight+=spacing.getCurrentAnchorNodeSpacing();
    }
    if (expandedBranchSummaryNode != null) {
      int minViewHeight=calculateBranchNodePosition(expandedBranchSummaryNode);
      if (minViewHeight > minViewHeightRequiredByBranchNodes) {
        minViewHeightRequiredByBranchNodes=minViewHeight;
      }
    }
    int minViewHeightPixels=Math.max(minViewHeightRequiredByBranchNodes,pixelGLConverter.getPixelHeightForGLHeight(pathwayHeight));
    System.out.println("String_Node_Str" + minViewHeightPixels);
    if (isNewPath) {
      System.out.println("String_Node_Str" + minViewHeightPixels);
      setMinSize(minViewHeightPixels + 3);
      isNewPath=false;
    }
  }
  for (  ALinearizableNode node : linearizedNodes) {
    node.render(gl,glu);
    renderBranchNodes(gl,glu,node);
  }
  if (expandedBranchSummaryNode != null) {
    renderBranchSummaryNode(gl,glu,expandedBranchSummaryNode);
    float coverWidth=pixelGLConverter.getGLWidthForPixelWidth(PATHWAY_COLUMN_WIDTH_PIXELS + BRANCH_COLUMN_WIDTH_PIXELS);
    gl.glColor4f(1,1,1,0.9f);
    gl.glBegin(GL2.GL_QUADS);
    gl.glVertex3f(0,0,0.1f);
    gl.glVertex3f(coverWidth,0,0.1f);
    gl.glVertex3f(coverWidth,viewFrustum.getHeight(),0.1f);
    gl.glVertex3f(0,viewFrustum.getHeight(),0.1f);
    gl.glEnd();
  }
  float dataRowPositionX=branchColumnWidth + pathwayColumnWidth;
  float topSpacing=pixelGLConverter.getGLWidthForPixelWidth(TOP_SPACING_MAPPED_DATA);
  gl.glPushMatrix();
  if (isLayoutDirty) {
    mappedDataRenderer.setLinearizedNodes(linearizedNodes);
  }
  setMappedDataRendererGeometry();
  gl.glTranslatef(dataRowPositionX,topSpacing,0);
  mappedDataRenderer.render(gl,isLayoutDirty);
  gl.glPopMatrix();
  renderEdgesOfLinearizedNodes(gl);
  gl.glEndList();
}

Fixed version (ground truth):
private void buildDisplayList(final GL2 gl,int iGLDisplayListIndex){
  dataRowHeight=pixelGLConverter.getGLHeightForPixelHeight(DEFAULT_DATA_ROW_HEIGHT_PIXELS);
  gl.glNewList(iGLDisplayListIndex,GL2.GL_COMPILE);
  float branchColumnWidth=pixelGLConverter.getGLWidthForPixelWidth(BRANCH_COLUMN_WIDTH_PIXELS);
  float pathwayColumnWidth=pixelGLConverter.getGLWidthForPixelWidth(PATHWAY_COLUMN_WIDTH_PIXELS);
  GLU glu=new GLU();
  float pathwayHeight=0;
  if (isLayoutDirty) {
    List<AnchorNodeSpacing> anchorNodeSpacings=calcAnchorNodeSpacings();
    Vec3f currentPosition=new Vec3f(branchColumnWidth + pathwayColumnWidth / 2.0f,viewFrustum.getHeight(),0.2f);
    float minNodeSpacing=pixelGLConverter.getGLHeightForPixelHeight(MIN_NODE_SPACING_PIXELS);
    int minViewHeightRequiredByBranchNodes=0;
    for (    AnchorNodeSpacing spacing : anchorNodeSpacings) {
      float currentAnchorNodeSpacing=spacing.getCurrentAnchorNodeSpacing();
      float nodeSpacing=(Float.isNaN(currentAnchorNodeSpacing) ? minNodeSpacing : (currentAnchorNodeSpacing - spacing.getTotalNodeHeight()) / ((float)spacing.getNodesInbetween().size() + 1));
      ANode startAnchorNode=spacing.getStartNode();
      float currentInbetweenNodePositionY=currentPosition.y() - ((startAnchorNode != null) ? startAnchorNode.getHeight() / 2.0f : 0);
      int minViewHeight=calculatePositionsOfBranchNodes(startAnchorNode);
      if (minViewHeight > minViewHeightRequiredByBranchNodes) {
        minViewHeightRequiredByBranchNodes=minViewHeight;
      }
      for (int i=0; i < spacing.getNodesInbetween().size(); i++) {
        ANode node=spacing.getNodesInbetween().get(i);
        node.setPosition(new Vec3f(currentPosition.x(),currentInbetweenNodePositionY - nodeSpacing - node.getHeight() / 2.0f,currentPosition.z()));
        currentInbetweenNodePositionY-=(nodeSpacing + node.getHeight());
        minViewHeight=calculatePositionsOfBranchNodes(node);
        if (minViewHeight > minViewHeightRequiredByBranchNodes) {
          minViewHeightRequiredByBranchNodes=minViewHeight;
        }
      }
      currentPosition.setY(currentPosition.y() - spacing.getCurrentAnchorNodeSpacing());
      ANode endAnchorNode=spacing.getEndNode();
      if (endAnchorNode != null) {
        endAnchorNode.setPosition(new Vec3f(currentPosition));
        minViewHeight=calculatePositionsOfBranchNodes(endAnchorNode);
        if (minViewHeight > minViewHeightRequiredByBranchNodes) {
          minViewHeightRequiredByBranchNodes=minViewHeight;
        }
      }
      pathwayHeight+=spacing.getCurrentAnchorNodeSpacing();
    }
    if (expandedBranchSummaryNode != null) {
      int minViewHeight=calculateBranchNodePosition(expandedBranchSummaryNode);
      if (minViewHeight > minViewHeightRequiredByBranchNodes) {
        minViewHeightRequiredByBranchNodes=minViewHeight;
      }
    }
    int minViewHeightRequiredByPath=pixelGLConverter.getPixelHeightForGLHeight(pathwayHeight);
    int minViewHeightPixels=0;
    boolean isViewHeightCurrentlyDeterminedByPath;
    if (minViewHeightRequiredByBranchNodes > minViewHeightRequiredByPath) {
      minViewHeightPixels=minViewHeightRequiredByBranchNodes;
      isViewHeightCurrentlyDeterminedByPath=false;
    }
 else {
      minViewHeightPixels=minViewHeightRequiredByPath;
      isViewHeightCurrentlyDeterminedByPath=true;
    }
    System.out.println("String_Node_Str" + minViewHeightPixels);
    if (isNewPath || (isViewHeightCurrentlyDeterminedByPath != isViewHeightDeterminedByPath)) {
      System.out.println("String_Node_Str" + minViewHeightPixels);
      setMinSize(minViewHeightPixels + 3);
      isNewPath=false;
    }
    isViewHeightDeterminedByPath=isViewHeightCurrentlyDeterminedByPath;
  }
  for (  ALinearizableNode node : linearizedNodes) {
    node.render(gl,glu);
    renderBranchNodes(gl,glu,node);
  }
  if (expandedBranchSummaryNode != null) {
    renderBranchSummaryNode(gl,glu,expandedBranchSummaryNode);
    float coverWidth=pixelGLConverter.getGLWidthForPixelWidth(PATHWAY_COLUMN_WIDTH_PIXELS + BRANCH_COLUMN_WIDTH_PIXELS);
    gl.glColor4f(1,1,1,0.9f);
    gl.glBegin(GL2.GL_QUADS);
    gl.glVertex3f(0,0,0.1f);
    gl.glVertex3f(coverWidth,0,0.1f);
    gl.glVertex3f(coverWidth,viewFrustum.getHeight(),0.1f);
    gl.glVertex3f(0,viewFrustum.getHeight(),0.1f);
    gl.glEnd();
  }
  float dataRowPositionX=branchColumnWidth + pathwayColumnWidth;
  float topSpacing=pixelGLConverter.getGLWidthForPixelWidth(TOP_SPACING_MAPPED_DATA);
  gl.glPushMatrix();
  if (isLayoutDirty) {
    mappedDataRenderer.setLinearizedNodes(linearizedNodes);
  }
  setMappedDataRendererGeometry();
  gl.glTranslatef(dataRowPositionX,topSpacing,0);
  mappedDataRenderer.render(gl,isLayoutDirty);
  gl.glPopMatrix();
  renderEdgesOfLinearizedNodes(gl);
  gl.glEndList();
}