Program: 58743
Project: 58743
Buggy source:
@Override public void draw(float fXCenter,float fYCenter,GL gl,GLU glu){
  PartialDisc pdCurrentRootElement=radialHierarchy.getCurrentRootElement();
  PartialDisc pdCurrentMouseOverElement=radialHierarchy.getCurrentMouseOverElement();
  PartialDisc pdCurrentSelectedElement=radialHierarchy.getCurrentSelectedElement();
  PartialDisc pdHighlightedChildIndicator=null;
  calculateDrawingParameters(pdCurrentRootElement,pdCurrentSelectedElement,fXCenter,fYCenter);
  if (iDisplayedDetailViewDepth < MIN_DISPLAYED_DETAIL_DEPTH) {
    radialHierarchy.setCurrentSelectedElement(pdCurrentRootElement);
    radialHierarchy.setCurrentRootElement(pdCurrentRootElement);
    radialHierarchy.setCurrentMouseOverElement(pdCurrentRootElement);
    drawingController.setDrawingState(DrawingController.DRAWING_STATE_FULL_HIERARCHY);
    radialHierarchy.setDisplayListDirty();
    navigationHistory.replaceCurrentHistoryEntry(drawingController.getCurrentDrawingState(),pdCurrentRootElement,pdCurrentRootElement,radialHierarchy.getMaxDisplayedHierarchyDepth());
    drawingController.draw(fXCenter,fYCenter,gl,glu);
    bInitialDraw=true;
    radialHierarchy.setNewSelection(ESelectionType.SELECTION,pdCurrentRootElement.getElementID());
    return;
  }
  gl.glLoadIdentity();
  gl.glTranslatef(fXCenter,fYCenter,0);
  PDDrawingStrategy dsDefault=DrawingStrategyManager.get().getDefaultDrawingStrategy();
  PDDrawingStrategy dsSelected=DrawingStrategyManager.get().getDrawingStrategy(DrawingStrategyManager.PD_DRAWING_STRATEGY_SELECTED);
  PDDrawingStrategy dsTransparent=DrawingStrategyManager.get().getDrawingStrategy(DrawingStrategyManager.PD_DRAWING_STRATEGY_TRANSPARENT);
  pdCurrentRootElement.setPDDrawingStrategyChildren(dsDefault,iDisplayedOverviewDepth);
  boolean bMouseOverElementInDetailOutside=false;
  boolean bIsMouseOverElementDisplayed=true;
  boolean bIsMouseOverElementParentOfCurrentRoot=false;
  boolean bIsNewSelection=radialHierarchy.isNewSelection();
  if (pdCurrentMouseOverElement != null) {
    bMouseOverElementInDetailOutside=pdCurrentMouseOverElement.hasParent(pdCurrentSelectedElement,iDisplayedDetailViewDepth - 1);
    if (!bMouseOverElementInDetailOutside)     bMouseOverElementInDetailOutside=pdCurrentMouseOverElement == pdCurrentSelectedElement;
    if (bIsNewSelection) {
      int iParentPathLength=pdCurrentMouseOverElement.getParentPathLength(pdCurrentRootElement);
      if ((iParentPathLength >= iDisplayedOverviewDepth) || (iParentPathLength == -1)) {
        PartialDisc pdParent=pdCurrentMouseOverElement.getParent();
        if (pdParent == null) {
          pdCurrentRootElement=pdCurrentMouseOverElement;
        }
 else {
          pdCurrentRootElement=pdParent;
        }
        radialHierarchy.setCurrentRootElement(pdCurrentRootElement);
        radialHierarchy.setCurrentSelectedElement(pdCurrentRootElement);
        drawingController.setDrawingState(DrawingController.DRAWING_STATE_FULL_HIERARCHY);
        navigationHistory.addNewHistoryEntry(drawingController.getCurrentDrawingState(),pdCurrentRootElement,pdCurrentRootElement,radialHierarchy.getMaxDisplayedHierarchyDepth());
        drawingController.draw(fXCenter,fYCenter,gl,glu);
        bInitialDraw=true;
        radialHierarchy.setNewSelection(ESelectionType.SELECTION,pdCurrentRootElement.getElementID());
        return;
      }
    }
 else {
      if (pdCurrentMouseOverElement != pdCurrentRootElement) {
        ArrayList<PartialDisc> alParentPath=pdCurrentMouseOverElement.getParentPath(pdCurrentRootElement);
        if (alParentPath != null) {
          if (alParentPath.size() >= iDisplayedOverviewDepth) {
            DrawingStrategyManager drawingStategyManager=DrawingStrategyManager.get();
            PDDrawingStrategyChildIndicator dsDefaultHighlightedChildIndicator=(PDDrawingStrategyChildIndicator)drawingStategyManager.createDrawingStrategy(drawingStategyManager.getDefaultStrategyType());
            dsDefaultHighlightedChildIndicator.setChildIndicatorColor(RadialHierarchyRenderStyle.MOUSE_OVER_COLOR);
            pdHighlightedChildIndicator=alParentPath.get(alParentPath.size() - iDisplayedOverviewDepth);
            pdHighlightedChildIndicator.setPDDrawingStrategy(dsDefaultHighlightedChildIndicator);
            bIsMouseOverElementDisplayed=false;
          }
        }
 else {
          bIsMouseOverElementParentOfCurrentRoot=true;
          bIsMouseOverElementDisplayed=false;
        }
      }
    }
  }
  if (bIsMouseOverElementDisplayed) {
    PDDrawingStrategyDecorator dsLabelDecorator=new PDDrawingStrategyLabelDecorator();
    dsLabelDecorator.setDrawingStrategy(dsDefault);
    if (bMouseOverElementInDetailOutside) {
      pdCurrentMouseOverElement.setPDDrawingStrategyChildren(dsLabelDecorator,Math.min(iDisplayedDetailViewDepth,RadialHierarchyRenderStyle.MAX_LABELING_DEPTH));
    }
 else     if (pdCurrentMouseOverElement != null) {
      pdCurrentMouseOverElement.setPDDrawingStrategy(dsLabelDecorator);
    }
  }
  pdCurrentSelectedElement.drawHierarchyAngular(gl,glu,fDetailViewDiscWidth,iDisplayedDetailViewDepth,fDetailViewStartAngle,360,fDetailViewInnerRadius);
  if (bMouseOverElementInDetailOutside) {
    if (bIsNewSelection) {
      PDDrawingStrategySelected dsExternalSelected=(PDDrawingStrategySelected)DrawingStrategyManager.get().createDrawingStrategy(DrawingStrategyManager.PD_DRAWING_STRATEGY_SELECTED);
      dsExternalSelected.setBorderColor(RadialHierarchyRenderStyle.SELECTED_COLOR);
      dsSelected=dsExternalSelected;
    }
    dsSelected.drawPartialDisc(gl,glu,pdCurrentMouseOverElement);
  }
  pdCurrentSelectedElement.setPDDrawingStrategyChildren(dsTransparent,iDisplayedDetailViewDepth);
  if ((pdHighlightedChildIndicator != null) && (pdHighlightedChildIndicator.hasParent(pdCurrentSelectedElement,iDisplayedDetailViewDepth))) {
    PDDrawingStrategyTransparent dsTransparentHighlightedChildIndicator=(PDDrawingStrategyTransparent)DrawingStrategyManager.get().createDrawingStrategy(DrawingStrategyManager.PD_DRAWING_STRATEGY_TRANSPARENT);
    dsTransparentHighlightedChildIndicator.setChildIndicatorColor(RadialHierarchyRenderStyle.MOUSE_OVER_COLOR);
    pdHighlightedChildIndicator.setPDDrawingStrategy(dsTransparentHighlightedChildIndicator);
  }
  pdCurrentRootElement.drawHierarchyFull(gl,glu,fOverviewDiscWidth,iDisplayedOverviewDepth);
  gl.glPushAttrib(GL.GL_COLOR_BUFFER_BIT);
  gl.glColor3f(0,1,1);
  GLPrimitives.renderPartialDiscBorder(gl,glu,pdCurrentSelectedElement.getCurrentInnerRadius(),pdCurrentSelectedElement.getCurrentInnerRadius() + fOverviewDiscWidth * iDisplayedDetailViewDepth,pdCurrentSelectedElement.getCurrentStartAngle(),pdCurrentSelectedElement.getCurrentAngle(),100,2);
  gl.glPopAttrib();
  if ((pdCurrentMouseOverElement != null) && (bIsMouseOverElementDisplayed)) {
    if (bIsNewSelection) {
      PDDrawingStrategySelected dsExternalSelected=(PDDrawingStrategySelected)DrawingStrategyManager.get().createDrawingStrategy(DrawingStrategyManager.PD_DRAWING_STRATEGY_SELECTED);
      dsExternalSelected.setBorderColor(RadialHierarchyRenderStyle.SELECTED_COLOR);
      dsSelected=dsExternalSelected;
    }
    dsSelected.drawPartialDisc(gl,glu,pdCurrentMouseOverElement);
  }
  if (bIsMouseOverElementParentOfCurrentRoot) {
    gl.glPushClientAttrib(GL.GL_COLOR_BUFFER_BIT);
    gl.glColor3fv(RadialHierarchyRenderStyle.MOUSE_OVER_COLOR,0);
    GLPrimitives.renderCircle(gl,glu,fOverviewDiscWidth / 2.0f,100);
    GLPrimitives.renderCircleBorder(gl,glu,fOverviewDiscWidth / 2.0f,100,2);
    gl.glPopAttrib();
  }
  float fHierarchyOuterRadius=Math.min(fXCenter * 0.9f,fYCenter * 0.9f);
  LabelManager.get().drawAllLabels(gl,glu,fXCenter * 2.0f,fYCenter * 2.0f,fHierarchyOuterRadius);
  LabelManager.get().clearLabels();
  bInitialDraw=false;
}

Fixed version (ground truth):
@Override public void draw(float fXCenter,float fYCenter,GL gl,GLU glu){
  PartialDisc pdCurrentRootElement=radialHierarchy.getCurrentRootElement();
  PartialDisc pdCurrentMouseOverElement=radialHierarchy.getCurrentMouseOverElement();
  PartialDisc pdCurrentSelectedElement=radialHierarchy.getCurrentSelectedElement();
  PartialDisc pdHighlightedChildIndicator=null;
  calculateDrawingParameters(pdCurrentRootElement,pdCurrentSelectedElement,fXCenter,fYCenter);
  if (iDisplayedDetailViewDepth < MIN_DISPLAYED_DETAIL_DEPTH) {
    radialHierarchy.setCurrentSelectedElement(pdCurrentRootElement);
    radialHierarchy.setCurrentRootElement(pdCurrentRootElement);
    radialHierarchy.setCurrentMouseOverElement(pdCurrentRootElement);
    drawingController.setDrawingState(DrawingController.DRAWING_STATE_FULL_HIERARCHY);
    radialHierarchy.setDisplayListDirty();
    navigationHistory.replaceCurrentHistoryEntry(drawingController.getCurrentDrawingState(),pdCurrentRootElement,pdCurrentRootElement,radialHierarchy.getMaxDisplayedHierarchyDepth());
    drawingController.draw(fXCenter,fYCenter,gl,glu);
    bInitialDraw=true;
    radialHierarchy.setNewSelection(ESelectionType.SELECTION,pdCurrentRootElement.getElementID());
    return;
  }
  gl.glLoadIdentity();
  gl.glTranslatef(fXCenter,fYCenter,0);
  APDDrawingStrategy dsDefault=DrawingStrategyManager.get().getDefaultDrawingStrategy();
  APDDrawingStrategy dsSelected=DrawingStrategyManager.get().getDrawingStrategy(DrawingStrategyManager.PD_DRAWING_STRATEGY_SELECTED);
  APDDrawingStrategy dsTransparent=DrawingStrategyManager.get().getDrawingStrategy(DrawingStrategyManager.PD_DRAWING_STRATEGY_TRANSPARENT);
  pdCurrentRootElement.setPDDrawingStrategyChildren(dsDefault,iDisplayedOverviewDepth);
  boolean bMouseOverElementInDetailOutside=false;
  boolean bIsMouseOverElementDisplayed=true;
  boolean bIsMouseOverElementParentOfCurrentRoot=false;
  boolean bIsNewSelection=radialHierarchy.isNewSelection();
  if (pdCurrentMouseOverElement != null) {
    bMouseOverElementInDetailOutside=pdCurrentMouseOverElement.hasParent(pdCurrentSelectedElement,iDisplayedDetailViewDepth - 1);
    if (!bMouseOverElementInDetailOutside)     bMouseOverElementInDetailOutside=pdCurrentMouseOverElement == pdCurrentSelectedElement;
    if (bIsNewSelection) {
      int iParentPathLength=pdCurrentMouseOverElement.getParentPathLength(pdCurrentRootElement);
      if ((iParentPathLength >= iDisplayedOverviewDepth) || (iParentPathLength == -1)) {
        PartialDisc pdParent=pdCurrentMouseOverElement.getParent();
        if (pdParent == null) {
          pdCurrentRootElement=pdCurrentMouseOverElement;
        }
 else {
          pdCurrentRootElement=pdParent;
        }
        radialHierarchy.setCurrentRootElement(pdCurrentRootElement);
        radialHierarchy.setCurrentSelectedElement(pdCurrentRootElement);
        drawingController.setDrawingState(DrawingController.DRAWING_STATE_FULL_HIERARCHY);
        navigationHistory.addNewHistoryEntry(drawingController.getCurrentDrawingState(),pdCurrentRootElement,pdCurrentRootElement,radialHierarchy.getMaxDisplayedHierarchyDepth());
        drawingController.draw(fXCenter,fYCenter,gl,glu);
        bInitialDraw=true;
        radialHierarchy.setNewSelection(ESelectionType.SELECTION,pdCurrentRootElement.getElementID());
        return;
      }
    }
 else {
      if (pdCurrentMouseOverElement != pdCurrentRootElement) {
        ArrayList<PartialDisc> alParentPath=pdCurrentMouseOverElement.getParentPath(pdCurrentRootElement);
        if (alParentPath != null) {
          if (alParentPath.size() >= iDisplayedOverviewDepth) {
            DrawingStrategyManager drawingStategyManager=DrawingStrategyManager.get();
            APDDrawingStrategyChildIndicator dsDefaultHighlightedChildIndicator=(APDDrawingStrategyChildIndicator)drawingStategyManager.createDrawingStrategy(drawingStategyManager.getDefaultStrategyType());
            dsDefaultHighlightedChildIndicator.setChildIndicatorColor(RadialHierarchyRenderStyle.MOUSE_OVER_COLOR);
            pdHighlightedChildIndicator=alParentPath.get(alParentPath.size() - iDisplayedOverviewDepth);
            pdHighlightedChildIndicator.setPDDrawingStrategy(dsDefaultHighlightedChildIndicator);
            bIsMouseOverElementDisplayed=false;
          }
        }
 else {
          bIsMouseOverElementParentOfCurrentRoot=true;
          bIsMouseOverElementDisplayed=false;
        }
      }
    }
  }
  if (bIsMouseOverElementDisplayed) {
    APDDrawingStrategyDecorator dsLabelDecorator=new PDDrawingStrategyLabelDecorator();
    dsLabelDecorator.setDrawingStrategy(dsDefault);
    if (bMouseOverElementInDetailOutside) {
      pdCurrentMouseOverElement.setPDDrawingStrategyChildren(dsLabelDecorator,Math.min(iDisplayedDetailViewDepth,RadialHierarchyRenderStyle.MAX_LABELING_DEPTH));
    }
 else     if (pdCurrentMouseOverElement != null) {
      pdCurrentMouseOverElement.setPDDrawingStrategy(dsLabelDecorator);
    }
  }
  pdCurrentSelectedElement.drawHierarchyAngular(gl,glu,fDetailViewDiscWidth,iDisplayedDetailViewDepth,fDetailViewStartAngle,360,fDetailViewInnerRadius);
  if (bMouseOverElementInDetailOutside) {
    if (bIsNewSelection) {
      PDDrawingStrategySelected dsExternalSelected=(PDDrawingStrategySelected)DrawingStrategyManager.get().createDrawingStrategy(DrawingStrategyManager.PD_DRAWING_STRATEGY_SELECTED);
      dsExternalSelected.setBorderColor(RadialHierarchyRenderStyle.SELECTED_COLOR);
      dsSelected=dsExternalSelected;
    }
    dsSelected.drawPartialDisc(gl,glu,pdCurrentMouseOverElement);
  }
  pdCurrentSelectedElement.setPDDrawingStrategyChildren(dsTransparent,iDisplayedDetailViewDepth);
  if ((pdHighlightedChildIndicator != null) && (pdHighlightedChildIndicator.hasParent(pdCurrentSelectedElement,iDisplayedDetailViewDepth))) {
    PDDrawingStrategyTransparent dsTransparentHighlightedChildIndicator=(PDDrawingStrategyTransparent)DrawingStrategyManager.get().createDrawingStrategy(DrawingStrategyManager.PD_DRAWING_STRATEGY_TRANSPARENT);
    dsTransparentHighlightedChildIndicator.setChildIndicatorColor(RadialHierarchyRenderStyle.MOUSE_OVER_COLOR);
    pdHighlightedChildIndicator.setPDDrawingStrategy(dsTransparentHighlightedChildIndicator);
  }
  pdCurrentRootElement.drawHierarchyFull(gl,glu,fOverviewDiscWidth,iDisplayedOverviewDepth);
  gl.glPushAttrib(GL.GL_COLOR_BUFFER_BIT);
  gl.glColor3f(0,1,1);
  GLPrimitives.renderPartialDiscBorder(gl,glu,pdCurrentSelectedElement.getCurrentInnerRadius(),pdCurrentSelectedElement.getCurrentInnerRadius() + fOverviewDiscWidth * iDisplayedDetailViewDepth,pdCurrentSelectedElement.getCurrentStartAngle(),pdCurrentSelectedElement.getCurrentAngle(),100,2);
  gl.glPopAttrib();
  if ((pdCurrentMouseOverElement != null) && (bIsMouseOverElementDisplayed)) {
    if (bIsNewSelection) {
      PDDrawingStrategySelected dsExternalSelected=(PDDrawingStrategySelected)DrawingStrategyManager.get().createDrawingStrategy(DrawingStrategyManager.PD_DRAWING_STRATEGY_SELECTED);
      dsExternalSelected.setBorderColor(RadialHierarchyRenderStyle.SELECTED_COLOR);
      dsSelected=dsExternalSelected;
    }
    dsSelected.drawPartialDisc(gl,glu,pdCurrentMouseOverElement);
  }
  if (bIsMouseOverElementParentOfCurrentRoot) {
    gl.glPushClientAttrib(GL.GL_COLOR_BUFFER_BIT);
    gl.glColor3fv(RadialHierarchyRenderStyle.MOUSE_OVER_COLOR,0);
    GLPrimitives.renderCircle(gl,glu,fOverviewDiscWidth / 2.0f,100);
    GLPrimitives.renderCircleBorder(gl,glu,fOverviewDiscWidth / 2.0f,100,2);
    gl.glPopAttrib();
  }
  float fHierarchyOuterRadius=Math.min(fXCenter * 0.9f,fYCenter * 0.9f);
  LabelManager.get().drawAllLabels(gl,glu,fXCenter * 2.0f,fYCenter * 2.0f,fHierarchyOuterRadius);
  LabelManager.get().clearLabels();
  bInitialDraw=false;
}