Program: 47809
Project: 47809
Buggy source:
/** 
 * Plots the data for a given series.
 * @param g2  the drawing surface.
 * @param dataArea  the data area.
 * @param info  collects plot rendering info.
 * @param plot  the plot.
 * @param dataset  the dataset.
 * @param seriesIndex  the series index.
 */
@Override public void drawSeries(Graphics2D g2,Rectangle2D dataArea,PlotRenderingInfo info,PolarPlot plot,XYDataset dataset,int seriesIndex){
  GeneralPath poly=null;
  ValueAxis axis=plot.getAxisForDataset(plot.indexOf(dataset));
  final int numPoints=dataset.getItemCount(seriesIndex);
  for (int i=0; i < numPoints; i++) {
    double theta=dataset.getXValue(seriesIndex,i);
    double radius=dataset.getYValue(seriesIndex,i);
    Point p=plot.translateToJava2D(theta,radius,axis,dataArea);
    if (poly == null) {
      poly=new GeneralPath();
      poly.moveTo(p.x,p.y);
    }
 else {
      poly.lineTo(p.x,p.y);
    }
  }
  if (getConnectFirstAndLastPoint()) {
    poly.closePath();
  }
  g2.setPaint(lookupSeriesPaint(seriesIndex));
  g2.setStroke(lookupSeriesStroke(seriesIndex));
  if (isSeriesFilled(seriesIndex)) {
    Composite savedComposite=g2.getComposite();
    g2.setComposite(this.fillComposite);
    g2.fill(poly);
    g2.setComposite(savedComposite);
    if (this.drawOutlineWhenFilled) {
      g2.setPaint(lookupSeriesOutlinePaint(seriesIndex));
      g2.draw(poly);
    }
  }
 else {
    g2.draw(poly);
  }
  if (this.shapesVisible) {
    EntityCollection entities=null;
    if (info != null) {
      entities=info.getOwner().getEntityCollection();
    }
    PathIterator pi=poly.getPathIterator(null);
    int i=0;
    while (!pi.isDone()) {
      final float[] coords=new float[6];
      final int segType=pi.currentSegment(coords);
      pi.next();
      if (segType != PathIterator.SEG_LINETO && segType != PathIterator.SEG_MOVETO) {
        continue;
      }
      final int x=Math.round(coords[0]);
      final int y=Math.round(coords[1]);
      final Shape shape=ShapeUtilities.createTranslatedShape(getItemShape(seriesIndex,i++),x,y);
      Paint paint;
      if (useFillPaint) {
        paint=lookupSeriesFillPaint(seriesIndex);
      }
 else {
        paint=lookupSeriesPaint(seriesIndex);
      }
      g2.setPaint(paint);
      g2.fill(shape);
      if (isSeriesFilled(seriesIndex) && this.drawOutlineWhenFilled) {
        g2.setPaint(lookupSeriesOutlinePaint(seriesIndex));
        g2.setStroke(lookupSeriesOutlineStroke(seriesIndex));
        g2.draw(shape);
      }
      if (entities != null && AbstractXYItemRenderer.isPointInRect(dataArea,x,y)) {
        addEntity(entities,shape,dataset,seriesIndex,i - 1,x,y);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Plots the data for a given series.
 * @param g2  the drawing surface.
 * @param dataArea  the data area.
 * @param info  collects plot rendering info.
 * @param plot  the plot.
 * @param dataset  the dataset.
 * @param seriesIndex  the series index.
 */
@Override public void drawSeries(Graphics2D g2,Rectangle2D dataArea,PlotRenderingInfo info,PolarPlot plot,XYDataset dataset,int seriesIndex){
  final int numPoints=dataset.getItemCount(seriesIndex);
  if (numPoints == 0) {
    return;
  }
  GeneralPath poly=null;
  ValueAxis axis=plot.getAxisForDataset(plot.indexOf(dataset));
  for (int i=0; i < numPoints; i++) {
    double theta=dataset.getXValue(seriesIndex,i);
    double radius=dataset.getYValue(seriesIndex,i);
    Point p=plot.translateToJava2D(theta,radius,axis,dataArea);
    if (poly == null) {
      poly=new GeneralPath();
      poly.moveTo(p.x,p.y);
    }
 else {
      poly.lineTo(p.x,p.y);
    }
  }
  if (getConnectFirstAndLastPoint()) {
    poly.closePath();
  }
  g2.setPaint(lookupSeriesPaint(seriesIndex));
  g2.setStroke(lookupSeriesStroke(seriesIndex));
  if (isSeriesFilled(seriesIndex)) {
    Composite savedComposite=g2.getComposite();
    g2.setComposite(this.fillComposite);
    g2.fill(poly);
    g2.setComposite(savedComposite);
    if (this.drawOutlineWhenFilled) {
      g2.setPaint(lookupSeriesOutlinePaint(seriesIndex));
      g2.draw(poly);
    }
  }
 else {
    g2.draw(poly);
  }
  if (this.shapesVisible) {
    EntityCollection entities=null;
    if (info != null) {
      entities=info.getOwner().getEntityCollection();
    }
    PathIterator pi=poly.getPathIterator(null);
    int i=0;
    while (!pi.isDone()) {
      final float[] coords=new float[6];
      final int segType=pi.currentSegment(coords);
      pi.next();
      if (segType != PathIterator.SEG_LINETO && segType != PathIterator.SEG_MOVETO) {
        continue;
      }
      final int x=Math.round(coords[0]);
      final int y=Math.round(coords[1]);
      final Shape shape=ShapeUtilities.createTranslatedShape(getItemShape(seriesIndex,i++),x,y);
      Paint paint;
      if (useFillPaint) {
        paint=lookupSeriesFillPaint(seriesIndex);
      }
 else {
        paint=lookupSeriesPaint(seriesIndex);
      }
      g2.setPaint(paint);
      g2.fill(shape);
      if (isSeriesFilled(seriesIndex) && this.drawOutlineWhenFilled) {
        g2.setPaint(lookupSeriesOutlinePaint(seriesIndex));
        g2.setStroke(lookupSeriesOutlineStroke(seriesIndex));
        g2.draw(shape);
      }
      if (entities != null && AbstractXYItemRenderer.isPointInRect(dataArea,x,y)) {
        addEntity(entities,shape,dataset,seriesIndex,i - 1,x,y);
      }
    }
  }
}