Program: 66796
Project: 66796
Buggy source:
/** 
 * @param ipr
 * @param x1
 * @param y1
 * @param x2
 * @param y2
 * @throws ChartException
 */
private final void plotPlane(IPrimitiveRenderer ipr,double x1,double y1,double x2,double y2,double z1,double z2,boolean drawSide,boolean leftSide) throws ChartException {
  if (bRendering3D) {
    final Polygon3DRenderEvent pre=((EventObjectCache)ipr).getEventObject(oSource,Polygon3DRenderEvent.class);
    pre.setOutline(null);
    pre.setDoubleSided(true);
    pre.setBackground(tapeColor);
    if (!leftSide) {
      loa3d[0].set(x1 + kError,y1 + kError,z1);
      loa3d[1].set(x2 + kError,y2 + kError,z2);
      loa3d[2].set(x2 + kError,y2 + kError,z2 - dTapeWidth);
      loa3d[3].set(x1 + kError,y1 + kError,z1 - dTapeWidth);
      pre.setPoints3D(loa3d);
      dc.addPlane(pre,PrimitiveRenderEvent.FILL);
    }
    if (drawSide) {
      pre.setBackground(sideColor);
      if (leftSide) {
        if (y1 + kError > zeroLocation) {
          loa3d[0].set(x1 + kError,y1 + kError,z1);
          loa3d[1].set(x1 + kError,y1 + kError,z1 - dTapeWidth);
          loa3d[2].set(x1 + kError,zeroLocation,z1 - dTapeWidth);
          loa3d[3].set(x1 + kError,zeroLocation,z1);
        }
 else {
          loa3d[0].set(x1 + kError,y1 + kError,z1);
          loa3d[1].set(x1 + kError,zeroLocation,z1);
          loa3d[2].set(x1 + kError,zeroLocation,z1 - dTapeWidth);
          loa3d[3].set(x1 + kError,y1 + kError,z1 - dTapeWidth);
        }
      }
 else {
        if (y2 + kError > zeroLocation) {
          loa3d[0].set(x2 + kError,y2 + kError,z2);
          loa3d[1].set(x2 + kError,zeroLocation,z2);
          loa3d[2].set(x2 + kError,zeroLocation,z2 - dTapeWidth);
          loa3d[3].set(x2 + kError,y2 + kError,z2 - dTapeWidth);
        }
 else {
          loa3d[0].set(x2 + kError,y2 + kError,z2);
          loa3d[1].set(x2 + kError,y2 + kError,z2 - dTapeWidth);
          loa3d[2].set(x2 + kError,zeroLocation,z2 - dTapeWidth);
          loa3d[3].set(x2 + kError,zeroLocation,z2);
        }
      }
      pre.setPoints3D(loa3d);
      dc.addPlane(pre,PrimitiveRenderEvent.FILL);
    }
  }
 else {
    final PolygonRenderEvent pre=((EventObjectCache)ipr).getEventObject(oSource,PolygonRenderEvent.class);
    pre.setOutline(null);
    pre.setBackground(tapeColor);
    loa[0].set(x1 + kError,y1 + kError);
    loa[1].set(x2 + kError,y2 + kError);
    loa[2].set(x2 + kError + dTapeWidth,y2 + kError - dTapeWidth);
    loa[3].set(x1 + kError + dTapeWidth,y1 + kError - dTapeWidth);
    pre.setPoints(loa);
    if (bDeferred) {
      dc.addPlane(pre,PrimitiveRenderEvent.FILL);
    }
 else {
      ipr.fillPolygon(pre);
    }
    if (drawSide) {
      pre.setBackground(sideColor);
      if (leftSide) {
        loa[0].set(x1 + kError,y1 + kError);
        loa[1].set(x1 + kError + dTapeWidth,y1 + kError - dTapeWidth);
        if (cwa.isTransposed()) {
          loa[2].set(zeroLocation + dTapeWidth,y1 + kError - dTapeWidth);
          loa[3].set(zeroLocation,y1 + kError);
        }
 else {
          loa[2].set(x1 + kError + dTapeWidth,zeroLocation - dTapeWidth);
          loa[3].set(x1 + kError,zeroLocation);
        }
      }
 else {
        loa[0].set(x2 + kError,y2 + kError);
        loa[1].set(x2 + kError + dTapeWidth,y2 + kError - dTapeWidth);
        if (cwa.isTransposed()) {
          loa[2].set(zeroLocation + dTapeWidth,y2 + kError - dTapeWidth);
          loa[3].set(zeroLocation,y2 + kError);
        }
 else {
          loa[2].set(x2 + kError + dTapeWidth,zeroLocation - dTapeWidth);
          loa[3].set(x2 + kError,zeroLocation);
        }
      }
      pre.setPoints(loa);
      if (bDeferred) {
        dc.addPlane(pre,PrimitiveRenderEvent.FILL);
      }
 else {
        ipr.fillPolygon(pre);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * @param ipr
 * @param x1
 * @param y1
 * @param x2
 * @param y2
 * @throws ChartException
 */
private final void plotPlane(IPrimitiveRenderer ipr,double x1,double y1,double x2,double y2,double z1,double z2,boolean drawSide,boolean leftSide) throws ChartException {
  if (bRendering3D) {
    final Polygon3DRenderEvent pre=((EventObjectCache)ipr).getEventObject(oSource,Polygon3DRenderEvent.class);
    pre.setOutline(null);
    pre.setDoubleSided(true);
    pre.setBackground(tapeColor);
    if (!leftSide) {
      loa3d[0].set(x1 + kError,y1 + kError,z1);
      loa3d[1].set(x2 + kError,y2 + kError,z2);
      loa3d[2].set(x2 + kError,y2 + kError,z2 - dTapeWidth);
      loa3d[3].set(x1 + kError,y1 + kError,z1 - dTapeWidth);
      pre.setPoints3D(loa3d);
      dc.addPlane(pre,PrimitiveRenderEvent.FILL);
    }
    if (drawSide) {
      pre.setBackground(sideColor);
      if (leftSide) {
        if (y1 + kError > zeroLocation) {
          loa3d[0].set(x1 + kError,y1 + kError,z1);
          loa3d[1].set(x1 + kError,y1 + kError,z1 - dTapeWidth);
          loa3d[2].set(x1 + kError,zeroLocation,z1 - dTapeWidth);
          loa3d[3].set(x1 + kError,zeroLocation,z1);
        }
 else {
          loa3d[0].set(x1 + kError,y1 + kError,z1);
          loa3d[1].set(x1 + kError,zeroLocation,z1);
          loa3d[2].set(x1 + kError,zeroLocation,z1 - dTapeWidth);
          loa3d[3].set(x1 + kError,y1 + kError,z1 - dTapeWidth);
        }
      }
 else {
        if (y2 + kError > zeroLocation) {
          loa3d[0].set(x2 + kError,y2 + kError,z2);
          loa3d[1].set(x2 + kError,zeroLocation,z2);
          loa3d[2].set(x2 + kError,zeroLocation,z2 - dTapeWidth);
          loa3d[3].set(x2 + kError,y2 + kError,z2 - dTapeWidth);
        }
 else {
          loa3d[0].set(x2 + kError,y2 + kError,z2);
          loa3d[1].set(x2 + kError,y2 + kError,z2 - dTapeWidth);
          loa3d[2].set(x2 + kError,zeroLocation,z2 - dTapeWidth);
          loa3d[3].set(x2 + kError,zeroLocation,z2);
        }
      }
      pre.setPoints3D(loa3d);
      dc.addPlane(pre,PrimitiveRenderEvent.FILL);
    }
  }
 else {
    final PolygonRenderEvent pre=((EventObjectCache)ipr).getEventObject(oSource,PolygonRenderEvent.class);
    pre.setOutline(null);
    pre.setBackground(tapeColor);
    loa[0].set(x1 + kError,y1 + kError);
    loa[1].set(x2 + kError,y2 + kError);
    loa[2].set(x2 + kError + dTapeWidth,y2 + kError - dTapeWidth);
    loa[3].set(x1 + kError + dTapeWidth,y1 + kError - dTapeWidth);
    pre.setPoints(loa);
    if (bDeferred) {
      dc.addPlane(pre,PrimitiveRenderEvent.FILL);
    }
 else {
      ipr.fillPolygon(pre);
    }
    if (drawSide) {
      pre.setBackground(sideColor);
      if (leftSide) {
        loa[0].set(x1 + kError,y1 + kError);
        loa[1].set(x1 + kError + dTapeWidth,y1 + kError - dTapeWidth);
        if (cwa.isTransposed()) {
          loa[2].set(zeroLocation + dTapeWidth,y1 + kError - dTapeWidth);
          loa[3].set(zeroLocation,y1 + kError);
        }
 else {
          loa[2].set(x1 + kError + dTapeWidth,zeroLocation - dTapeWidth);
          loa[3].set(x1 + kError,zeroLocation);
        }
      }
 else {
        Object obj=iRender.getRunTimeContext().getState(BaseRenderer.STACKED_SERIES_LOCATION_KEY);
        double[] last=new double[]{zeroLocation,zeroLocation};
        if (obj instanceof List) {
          List lst=(List)obj;
          int index=lst.size() - 1;
          if (index > 0) {
            obj=lst.get(index);
          }
          if (obj instanceof double[]) {
            last=(double[])obj;
          }
        }
        loa[0].set(x2 + kError,y2 + kError);
        loa[1].set(x2 + kError + dTapeWidth,y2 + kError - dTapeWidth);
        if (cwa.isTransposed()) {
          loa[2].set(last[0] + dTapeWidth,y2 + kError - dTapeWidth);
          loa[3].set(last[0],y2 + kError);
        }
 else {
          loa[2].set(x2 + kError + dTapeWidth,last[1] - dTapeWidth);
          loa[3].set(x2 + kError,last[1]);
        }
      }
      pre.setPoints(loa);
      if (bDeferred) {
        dc.addPlane(pre,PrimitiveRenderEvent.FILL);
      }
 else {
        ipr.fillPolygon(pre);
      }
    }
  }
}