Program: 85809
Project: 85809
Buggy source:
/** 
 * Draws the visual representation of a single data item when the plot has a horizontal orientation.
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the plot is being drawn.
 * @param plot  the plot (can be used to obtain standard colorinformation etc).
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset (must be an instance of{@link BoxAndWhiskerCategoryDataset}).
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 */
public void drawHorizontalItem(Graphics2D g2,CategoryItemRendererState state,Rectangle2D dataArea,CategoryPlot plot,CategoryAxis domainAxis,ValueAxis rangeAxis,CategoryDataset dataset,int row,int column){
  BoxAndWhiskerCategoryDataset bawDataset=(BoxAndWhiskerCategoryDataset)dataset;
  double categoryEnd=domainAxis.getCategoryEnd(column,getColumnCount(),dataArea,plot.getDomainAxisEdge());
  double categoryStart=domainAxis.getCategoryStart(column,getColumnCount(),dataArea,plot.getDomainAxisEdge());
  double categoryWidth=Math.abs(categoryEnd - categoryStart);
  double yy=categoryStart;
  int seriesCount=getRowCount();
  int categoryCount=getColumnCount();
  if (seriesCount > 1) {
    double seriesGap=dataArea.getHeight() * getItemMargin() / (categoryCount * (seriesCount - 1));
    double usedWidth=(state.getBarWidth() * seriesCount) + (seriesGap * (seriesCount - 1));
    double offset=(categoryWidth - usedWidth) / 2;
    yy=yy + offset + (row * (state.getBarWidth() + seriesGap));
  }
 else {
    double offset=(categoryWidth - state.getBarWidth()) / 2;
    yy=yy + offset;
  }
  g2.setPaint(getItemPaint(row,column));
  Stroke s=getItemStroke(row,column);
  g2.setStroke(s);
  RectangleEdge location=plot.getRangeAxisEdge();
  Number xQ1=bawDataset.getQ1Value(row,column);
  Number xQ3=bawDataset.getQ3Value(row,column);
  Number xMax=bawDataset.getMaxRegularValue(row,column);
  Number xMin=bawDataset.getMinRegularValue(row,column);
  Shape box=null;
  if (xQ1 != null && xQ3 != null && xMax != null && xMin != null) {
    double xxQ1=rangeAxis.valueToJava2D(xQ1.doubleValue(),dataArea,location);
    double xxQ3=rangeAxis.valueToJava2D(xQ3.doubleValue(),dataArea,location);
    double xxMax=rangeAxis.valueToJava2D(xMax.doubleValue(),dataArea,location);
    double xxMin=rangeAxis.valueToJava2D(xMin.doubleValue(),dataArea,location);
    double yymid=yy + state.getBarWidth() / 2.0;
    double halfW=(state.getBarWidth() / 2.0) * this.whiskerWidth;
    box=new Rectangle2D.Double(Math.min(xxQ1,xxQ3),yy,Math.abs(xxQ1 - xxQ3),state.getBarWidth());
    if (this.fillBox) {
      g2.fill(box);
    }
    Paint outlinePaint=getItemOutlinePaint(row,column);
    if (this.useOutlinePaintForWhiskers) {
      g2.setPaint(outlinePaint);
    }
    g2.draw(new Line2D.Double(xxMax,yymid,xxQ3,yymid));
    g2.draw(new Line2D.Double(xxMax,yymid - halfW,xxMax,yymid + halfW));
    g2.draw(new Line2D.Double(xxMin,yymid,xxQ1,yymid));
    g2.draw(new Line2D.Double(xxMin,yymid - halfW,xxMin,yy + halfW));
    g2.setStroke(getItemOutlineStroke(row,column));
    g2.setPaint(outlinePaint);
    g2.draw(box);
  }
  g2.setPaint(this.artifactPaint);
  double aRadius;
  if (this.meanVisible) {
    Number xMean=bawDataset.getMeanValue(row,column);
    if (xMean != null) {
      double xxMean=rangeAxis.valueToJava2D(xMean.doubleValue(),dataArea,location);
      aRadius=state.getBarWidth() / 4;
      if ((xxMean > (dataArea.getMinX() - aRadius)) && (xxMean < (dataArea.getMaxX() + aRadius))) {
        Ellipse2D.Double avgEllipse=new Ellipse2D.Double(xxMean - aRadius,yy + aRadius,aRadius * 2,aRadius * 2);
        g2.fill(avgEllipse);
        g2.draw(avgEllipse);
      }
    }
  }
  if (this.medianVisible) {
    Number xMedian=bawDataset.getMedianValue(row,column);
    if (xMedian != null) {
      double xxMedian=rangeAxis.valueToJava2D(xMedian.doubleValue(),dataArea,location);
      g2.draw(new Line2D.Double(xxMedian,yy,xxMedian,yy + state.getBarWidth()));
    }
  }
  if (state.getInfo() != null && box != null) {
    EntityCollection entities=state.getEntityCollection();
    if (entities != null) {
      addItemEntity(entities,dataset,row,column,box);
    }
  }
}

Fixed version (ground truth):
/** 
 * Draws the visual representation of a single data item when the plot has a horizontal orientation.
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the plot is being drawn.
 * @param plot  the plot (can be used to obtain standard colorinformation etc).
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset (must be an instance of{@link BoxAndWhiskerCategoryDataset}).
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 */
public void drawHorizontalItem(Graphics2D g2,CategoryItemRendererState state,Rectangle2D dataArea,CategoryPlot plot,CategoryAxis domainAxis,ValueAxis rangeAxis,CategoryDataset dataset,int row,int column){
  BoxAndWhiskerCategoryDataset bawDataset=(BoxAndWhiskerCategoryDataset)dataset;
  double categoryEnd=domainAxis.getCategoryEnd(column,getColumnCount(),dataArea,plot.getDomainAxisEdge());
  double categoryStart=domainAxis.getCategoryStart(column,getColumnCount(),dataArea,plot.getDomainAxisEdge());
  double categoryWidth=Math.abs(categoryEnd - categoryStart);
  double yy=categoryStart;
  int seriesCount=getRowCount();
  int categoryCount=getColumnCount();
  if (seriesCount > 1) {
    double seriesGap=dataArea.getHeight() * getItemMargin() / (categoryCount * (seriesCount - 1));
    double usedWidth=(state.getBarWidth() * seriesCount) + (seriesGap * (seriesCount - 1));
    double offset=(categoryWidth - usedWidth) / 2;
    yy=yy + offset + (row * (state.getBarWidth() + seriesGap));
  }
 else {
    double offset=(categoryWidth - state.getBarWidth()) / 2;
    yy=yy + offset;
  }
  g2.setPaint(getItemPaint(row,column));
  Stroke s=getItemStroke(row,column);
  g2.setStroke(s);
  RectangleEdge location=plot.getRangeAxisEdge();
  Number xQ1=bawDataset.getQ1Value(row,column);
  Number xQ3=bawDataset.getQ3Value(row,column);
  Number xMax=bawDataset.getMaxRegularValue(row,column);
  Number xMin=bawDataset.getMinRegularValue(row,column);
  Shape box=null;
  if (xQ1 != null && xQ3 != null && xMax != null && xMin != null) {
    double xxQ1=rangeAxis.valueToJava2D(xQ1.doubleValue(),dataArea,location);
    double xxQ3=rangeAxis.valueToJava2D(xQ3.doubleValue(),dataArea,location);
    double xxMax=rangeAxis.valueToJava2D(xMax.doubleValue(),dataArea,location);
    double xxMin=rangeAxis.valueToJava2D(xMin.doubleValue(),dataArea,location);
    double yymid=yy + state.getBarWidth() / 2.0;
    double halfW=(state.getBarWidth() / 2.0) * this.whiskerWidth;
    box=new Rectangle2D.Double(Math.min(xxQ1,xxQ3),yy,Math.abs(xxQ1 - xxQ3),state.getBarWidth());
    if (this.fillBox) {
      g2.fill(box);
    }
    Paint outlinePaint=getItemOutlinePaint(row,column);
    if (this.useOutlinePaintForWhiskers) {
      g2.setPaint(outlinePaint);
    }
    g2.draw(new Line2D.Double(xxMax,yymid,xxQ3,yymid));
    g2.draw(new Line2D.Double(xxMax,yymid - halfW,xxMax,yymid + halfW));
    g2.draw(new Line2D.Double(xxMin,yymid,xxQ1,yymid));
    g2.draw(new Line2D.Double(xxMin,yymid - halfW,xxMin,yymid + halfW));
    g2.setStroke(getItemOutlineStroke(row,column));
    g2.setPaint(outlinePaint);
    g2.draw(box);
  }
  g2.setPaint(this.artifactPaint);
  double aRadius;
  if (this.meanVisible) {
    Number xMean=bawDataset.getMeanValue(row,column);
    if (xMean != null) {
      double xxMean=rangeAxis.valueToJava2D(xMean.doubleValue(),dataArea,location);
      aRadius=state.getBarWidth() / 4;
      if ((xxMean > (dataArea.getMinX() - aRadius)) && (xxMean < (dataArea.getMaxX() + aRadius))) {
        Ellipse2D.Double avgEllipse=new Ellipse2D.Double(xxMean - aRadius,yy + aRadius,aRadius * 2,aRadius * 2);
        g2.fill(avgEllipse);
        g2.draw(avgEllipse);
      }
    }
  }
  if (this.medianVisible) {
    Number xMedian=bawDataset.getMedianValue(row,column);
    if (xMedian != null) {
      double xxMedian=rangeAxis.valueToJava2D(xMedian.doubleValue(),dataArea,location);
      g2.draw(new Line2D.Double(xxMedian,yy,xxMedian,yy + state.getBarWidth()));
    }
  }
  if (state.getInfo() != null && box != null) {
    EntityCollection entities=state.getEntityCollection();
    if (entities != null) {
      addItemEntity(entities,dataset,row,column,box);
    }
  }
}