Program: 69189
Project: 69189
Buggy source:
private void computeYLocationWithMinOrigin() throws ChartException, IllegalArgumentException {
  IntersectionValue iv=fHorizontalAxis.getIntersectionValue();
  double dY=PlotWithAxes.getLocation(fVerticalAxis.getScale(),iv);
  double dY1=dY;
  double dY2=dY;
  dY-=dAppliedXAxisPlotSpacing;
  dHTotal-=dAppliedXAxisPlotSpacing;
  dY1=dY;
  dY2=dY;
  double dTickSize=fPlotWithAxes.getTickSize();
  if (bTicksAbove && dTickSize <= dHTotal) {
    dY1-=dTickSize;
    dHTotal-=dTickSize;
  }
 else {
    dTickSize=0;
  }
  double dH1=0;
  double dH2=0;
  if (iXLabelLocation == PlotWithAxes.ABOVE) {
    dH1=Math.max(dXAxisLabelsThickness,dDecorationThickness[0]);
    dH2=Math.max(bTicksBelow ? fPlotWithAxes.getTickSize() : 0,dAppliedXAxisPlotSpacing);
  }
 else   if (iXLabelLocation == PlotWithAxes.BELOW) {
    dH1=dDecorationThickness[0];
    dH2+=Math.max((bTicksBelow ? fPlotWithAxes.getTickSize() : 0) + dXAxisLabelsThickness,dAppliedXAxisPlotSpacing);
  }
  if (dH1 + dH2 <= dHTotal) {
    dY1-=dH1;
    dY2+=dH2;
    dHTotal-=(dH1 + dH2);
  }
 else {
    fHorizontalAxis.setShowLabels(false);
  }
  if (iXTitleLocation == PlotWithAxes.ABOVE) {
    dY1-=dXAxisTitleThickness;
  }
 else   if (iXTitleLocation == PlotWithAxes.BELOW) {
    dY2+=dXAxisTitleThickness;
  }
  double dBlockY=fPlotBounds.getTop();
  if (dY1 < dBlockY) {
    final double dDelta=(dBlockY - dY1);
    dY1=dBlockY;
    dY+=dDelta;
    dY2+=dDelta;
  }
  if (iXLabelLocation == PlotWithAxes.ABOVE) {
    dXAxisThickness=dY2 - dY1;
  }
 else   if (iXLabelLocation == PlotWithAxes.BELOW) {
    dXAxisThickness=dY2 - dY1;
  }
  fAxisY=dY;
  fAxisTop=dY1;
  fAxisBottom=dY2;
}

Fixed version (ground truth):
private void computeYLocationWithMinOrigin() throws ChartException, IllegalArgumentException {
  IntersectionValue iv=fHorizontalAxis.getIntersectionValue();
  double dY=PlotWithAxes.getLocation(fVerticalAxis.getScale(),iv);
  double dY1=dY;
  double dY2=dY;
  dY-=dAppliedXAxisPlotSpacing;
  dHTotal-=dAppliedXAxisPlotSpacing;
  dY1=dY;
  dY2=dY;
  double dTickSize=fPlotWithAxes.getTickSize();
  if (bTicksAbove && dTickSize <= dHTotal) {
    dY1-=dTickSize;
    dHTotal-=dTickSize;
  }
 else {
    dTickSize=0;
  }
  double dH1=0;
  double dH2=0;
  if (iXLabelLocation == PlotWithAxes.ABOVE) {
    dH1=Math.max(dXAxisLabelsThickness,dDecorationThickness[0]);
    dH2=Math.max(bTicksBelow ? fPlotWithAxes.getTickSize() : 0,dAppliedXAxisPlotSpacing);
  }
 else   if (iXLabelLocation == PlotWithAxes.BELOW) {
    dH1=dDecorationThickness[0];
    dH2+=Math.max((bTicksBelow ? fPlotWithAxes.getTickSize() : 0) + dXAxisLabelsThickness,dAppliedXAxisPlotSpacing);
  }
  if (dH1 + dH2 <= dHTotal) {
    dY1-=dH1;
    dY2+=dH2;
    dHTotal-=(dH1 + dH2);
  }
 else {
    fHorizontalAxis.setShowLabels(false);
  }
  if (iXTitleLocation == PlotWithAxes.ABOVE) {
    dY1-=dXAxisTitleThickness;
  }
 else   if (iXTitleLocation == PlotWithAxes.BELOW) {
    dY2+=dXAxisTitleThickness;
  }
  double dBlockY=fPlotBounds.getTop();
  if (dY1 < dBlockY) {
    final double dDelta=(dBlockY - dY1);
    dY1=dBlockY;
    dY+=dDelta;
    dY2+=dDelta;
  }
  fAxisY=dY;
  fAxisTop=dY1;
  fAxisBottom=dY2;
}