Program: 66245
Project: 66245
Buggy source:
private void renderRiserTube2D(IPrimitiveRenderer ipr,Object oSource,DataPointHints dpha,Location[] loaFront,Fill f,LineAttributes lia,ChartDimension cd,double dSeriesThickness,boolean bOffset,boolean bTransposed,boolean bDeferred,boolean bInverted,boolean bStacked,int zorder_hint) throws ChartException {
  ArrayList alModel=new ArrayList();
  Fill fBrighter;
  if (!isDimension3D()) {
    f=FillUtil.convertFillToGradient(f,bTransposed);
    fBrighter=FillUtil.getBrighterFill(f);
  }
 else {
    fBrighter=FillUtil.changeBrightness(f,0.89);
    f=FillUtil.convertFillToGradient3D(f,bTransposed);
  }
  LineAttributes liaBorder=goFactory.copyOf(lia);
  if (liaBorder.getColor() == null) {
    liaBorder.setColor(FillUtil.getDarkerColor(f));
  }
  PolygonRenderEvent pre=((EventObjectCache)ipr).getEventObject(oSource,PolygonRenderEvent.class);
  LineRenderEvent lre=((EventObjectCache)ipr).getEventObject(oSource,LineRenderEvent.class);
  OvalRenderEvent ore=((EventObjectCache)ipr).getEventObject(oSource,OvalRenderEvent.class);
  ArcRenderEvent are=((EventObjectCache)ipr).getEventObject(oSource,ArcRenderEvent.class);
  double dWidth=bTransposed ? loaFront[1].getY() - loaFront[0].getY() : loaFront[2].getX() - loaFront[1].getX();
  if (bOffset) {
    for (int i=0; i < loaFront.length; i++) {
      if (bTransposed) {
        loaFront[i].setX(loaFront[i].getX() + dSeriesThickness);
      }
 else {
        loaFront[i].setY(loaFront[i].getY() - dSeriesThickness);
      }
    }
  }
  Bounds bottomBounds=null;
  if (bTransposed) {
    bottomBounds=goFactory.createBounds(loaFront[0].getX() - dSeriesThickness,loaFront[0].getY() + dWidth,dSeriesThickness * 2,Math.abs(dWidth));
  }
 else {
    bottomBounds=goFactory.createBounds(loaFront[0].getX(),loaFront[1].getY() - dSeriesThickness,dWidth,dSeriesThickness * 2);
  }
  Bounds topBounds=null;
  if (bTransposed) {
    topBounds=goFactory.createBounds(loaFront[3].getX() - dSeriesThickness,loaFront[3].getY() + dWidth,dSeriesThickness * 2,Math.abs(dWidth));
  }
 else {
    topBounds=goFactory.createBounds(loaFront[0].getX(),loaFront[0].getY() - dSeriesThickness,dWidth,dSeriesThickness * 2);
  }
  if (bottomBounds != null) {
    ore.setBounds(bottomBounds);
    ore.setBackground(f);
    ore.setOutline(liaBorder);
    if (bDeferred) {
      alModel.add(ore.copy());
    }
 else {
      ipr.fillOval(ore);
    }
    are.setBackground(null);
    are.setOutline(liaBorder);
    are.setBounds(ore.getBounds());
    are.setAngleExtent(180);
    are.setStyle(ArcRenderEvent.OPEN);
    if (bTransposed) {
      are.setStartAngle(90);
    }
 else {
      are.setStartAngle(180);
    }
    if (bDeferred) {
      alModel.add(are.copy());
    }
 else {
      ipr.drawArc(are);
    }
  }
  pre.setPoints(loaFront);
  pre.setBackground(f);
  pre.setOutline(null);
  if (bDeferred) {
    alModel.add(pre.copy());
  }
 else {
    ipr.fillPolygon(pre);
  }
  if (bTransposed) {
    lre.setStart(loaFront[1]);
    lre.setEnd(loaFront[2]);
  }
 else {
    lre.setStart(loaFront[0]);
    lre.setEnd(loaFront[1]);
  }
  lre.setLineAttributes(liaBorder);
  if (bDeferred) {
    alModel.add(lre.copy());
  }
 else {
    ipr.drawLine(lre);
  }
  if (bTransposed) {
    lre.setStart(loaFront[0]);
    lre.setEnd(loaFront[3]);
  }
 else {
    lre.setStart(loaFront[2]);
    lre.setEnd(loaFront[3]);
  }
  lre.setLineAttributes(liaBorder);
  if (bDeferred) {
    alModel.add(lre.copy());
  }
 else {
    ipr.drawLine(lre);
  }
  if (topBounds != null) {
    ore.setBounds(topBounds);
    ore.setBackground(fBrighter);
    ore.setOutline(liaBorder);
    if (bDeferred) {
      alModel.add(ore.copy());
    }
 else {
      ipr.fillOval(ore);
      ipr.drawOval(ore);
    }
    are.setBackground(null);
    are.setOutline(liaBorder);
    are.setBounds(ore.getBounds());
    are.setAngleExtent(180);
    are.setStyle(ArcRenderEvent.OPEN);
    if (bTransposed) {
      are.setStartAngle(90);
    }
 else {
      are.setStartAngle(180);
    }
    if (bDeferred) {
      alModel.add(are.copy());
    }
 else {
      ipr.drawArc(are);
    }
  }
  renderInteractivity(ipr,dpha,ore);
  if (!alModel.isEmpty()) {
    dc.addModel(new WrappedInstruction(getDeferredCache(),alModel,PrimitiveRenderEvent.FILL,zorder_hint));
  }
}

Fixed version (ground truth):
/** 
 * @param ipr
 * @param oSource
 * @param dpha
 * @param loaFront
 * @param f
 * @param lia
 * @param cd
 * @param dSeriesThickness
 * @param bOffset
 * @param bTransposed
 * @param bDeferred
 * @param bInverted
 * @param bStacked
 * @param zorder_hint
 * @param compareBounds this bounds is used to adjust the order of polygon, if this bound isn't null, chart will use this bounds instead of actual bounds of polygon for order.
 * @throws ChartException
 */
private void renderRiserTube2D(IPrimitiveRenderer ipr,Object oSource,DataPointHints dpha,Location[] loaFront,Fill f,LineAttributes lia,ChartDimension cd,double dSeriesThickness,boolean bOffset,boolean bTransposed,boolean bDeferred,boolean bInverted,boolean bStacked,int zorder_hint,Bounds compareBounds) throws ChartException {
  ArrayList alModel=new ArrayList();
  Fill fBrighter;
  if (!isDimension3D()) {
    f=FillUtil.convertFillToGradient(f,bTransposed);
    fBrighter=FillUtil.getBrighterFill(f);
  }
 else {
    fBrighter=FillUtil.changeBrightness(f,0.89);
    f=FillUtil.convertFillToGradient3D(f,bTransposed);
  }
  LineAttributes liaBorder=goFactory.copyOf(lia);
  if (liaBorder.getColor() == null) {
    liaBorder.setColor(FillUtil.getDarkerColor(f));
  }
  PolygonRenderEvent pre=((EventObjectCache)ipr).getEventObject(oSource,PolygonRenderEvent.class);
  LineRenderEvent lre=((EventObjectCache)ipr).getEventObject(oSource,LineRenderEvent.class);
  OvalRenderEvent ore=((EventObjectCache)ipr).getEventObject(oSource,OvalRenderEvent.class);
  ArcRenderEvent are=((EventObjectCache)ipr).getEventObject(oSource,ArcRenderEvent.class);
  double dWidth=bTransposed ? loaFront[1].getY() - loaFront[0].getY() : loaFront[2].getX() - loaFront[1].getX();
  if (bOffset) {
    for (int i=0; i < loaFront.length; i++) {
      if (bTransposed) {
        loaFront[i].setX(loaFront[i].getX() + dSeriesThickness);
      }
 else {
        loaFront[i].setY(loaFront[i].getY() - dSeriesThickness);
      }
    }
  }
  Bounds bottomBounds=null;
  if (bTransposed) {
    bottomBounds=goFactory.createBounds(loaFront[0].getX() - dSeriesThickness,loaFront[0].getY() + dWidth,dSeriesThickness * 2,Math.abs(dWidth));
  }
 else {
    bottomBounds=goFactory.createBounds(loaFront[0].getX(),loaFront[1].getY() - dSeriesThickness,dWidth,dSeriesThickness * 2);
  }
  Bounds topBounds=null;
  if (bTransposed) {
    topBounds=goFactory.createBounds(loaFront[3].getX() - dSeriesThickness,loaFront[3].getY() + dWidth,dSeriesThickness * 2,Math.abs(dWidth));
  }
 else {
    topBounds=goFactory.createBounds(loaFront[0].getX(),loaFront[0].getY() - dSeriesThickness,dWidth,dSeriesThickness * 2);
  }
  if (bottomBounds != null) {
    ore.setBounds(bottomBounds);
    ore.setBackground(f);
    ore.setOutline(liaBorder);
    if (bDeferred) {
      alModel.add(ore.copy());
    }
 else {
      ipr.fillOval(ore);
    }
    are.setBackground(null);
    are.setOutline(liaBorder);
    are.setBounds(ore.getBounds());
    are.setAngleExtent(180);
    are.setStyle(ArcRenderEvent.OPEN);
    if (bTransposed) {
      are.setStartAngle(90);
    }
 else {
      are.setStartAngle(180);
    }
    if (bDeferred) {
      alModel.add(are.copy());
    }
 else {
      ipr.drawArc(are);
    }
  }
  pre.setPoints(loaFront);
  pre.setBackground(f);
  pre.setOutline(null);
  if (bDeferred) {
    alModel.add(pre.copy());
  }
 else {
    ipr.fillPolygon(pre);
  }
  if (bTransposed) {
    lre.setStart(loaFront[1]);
    lre.setEnd(loaFront[2]);
  }
 else {
    lre.setStart(loaFront[0]);
    lre.setEnd(loaFront[1]);
  }
  lre.setLineAttributes(liaBorder);
  if (bDeferred) {
    alModel.add(lre.copy());
  }
 else {
    ipr.drawLine(lre);
  }
  if (bTransposed) {
    lre.setStart(loaFront[0]);
    lre.setEnd(loaFront[3]);
  }
 else {
    lre.setStart(loaFront[2]);
    lre.setEnd(loaFront[3]);
  }
  lre.setLineAttributes(liaBorder);
  if (bDeferred) {
    alModel.add(lre.copy());
  }
 else {
    ipr.drawLine(lre);
  }
  if (topBounds != null) {
    ore.setBounds(topBounds);
    ore.setBackground(fBrighter);
    ore.setOutline(liaBorder);
    if (bDeferred) {
      alModel.add(ore.copy());
    }
 else {
      ipr.fillOval(ore);
      ipr.drawOval(ore);
    }
    are.setBackground(null);
    are.setOutline(liaBorder);
    are.setBounds(ore.getBounds());
    are.setAngleExtent(180);
    are.setStyle(ArcRenderEvent.OPEN);
    if (bTransposed) {
      are.setStartAngle(90);
    }
 else {
      are.setStartAngle(180);
    }
    if (bDeferred) {
      alModel.add(are.copy());
    }
 else {
      ipr.drawArc(are);
    }
  }
  renderInteractivity(ipr,dpha,ore);
  if (!alModel.isEmpty()) {
    WrappedInstruction wi=new WrappedInstruction(getDeferredCache(),alModel,PrimitiveRenderEvent.FILL,zorder_hint);
    wi.setCompareBounds(compareBounds);
    dc.addModel(wi);
  }
}