Program: 69190
Project: 69190
Buggy source:
private void computeYLocationWithMaxOrigin() 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 (bTicksBelow && dTickSize < dHTotal) {
    dY2+=dTickSize;
    dHTotal-=dTickSize;
  }
 else {
    dTickSize=0;
  }
  if (iXLabelLocation == PlotWithAxes.ABOVE) {
    double dXLabelHeight=Math.max((bTicksAbove ? dTickSize : 0) + dXAxisLabelsThickness,dAppliedXAxisPlotSpacing);
    if (dXLabelHeight + dDecorationThickness[1] < dHTotal) {
      dY1-=dXLabelHeight;
      dY2+=dDecorationThickness[1];
      dHTotal-=(dXLabelHeight + dDecorationThickness[1]);
    }
 else {
      dXLabelHeight=0;
      fHorizontalAxis.setShowLabels(false);
    }
  }
 else   if (iXLabelLocation == PlotWithAxes.BELOW) {
    double dXLabelHeight=Math.max(dXAxisLabelsThickness,dDecorationThickness[1]);
    double dHt1=Math.max(bTicksAbove ? dTickSize : 0,dAppliedXAxisPlotSpacing);
    if (dXLabelHeight + dHt1 <= dHTotal) {
      dY2+=dXLabelHeight;
      dY1-=dHt1;
      dHTotal-=(dXLabelHeight + dHt1);
    }
 else {
      dXLabelHeight=0;
      fHorizontalAxis.setShowLabels(false);
    }
  }
  if (iXTitleLocation == PlotWithAxes.ABOVE) {
    dY1-=dXAxisTitleThickness;
  }
 else   if (iXTitleLocation == PlotWithAxes.BELOW) {
    dY2+=dXAxisTitleThickness;
  }
  double dBlockY=fPlotBounds.getTop();
  double dBlockHeight=fPlotBounds.getHeight();
  if (dY2 > dBlockY + dBlockHeight) {
    final double dDelta=(dY2 - (dBlockY + dBlockHeight));
    dY2=dBlockY + dBlockHeight;
    dY-=dDelta;
    dY1-=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 computeYLocationWithMaxOrigin() 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 (bTicksBelow && dTickSize < dHTotal) {
    dY2+=dTickSize;
    dHTotal-=dTickSize;
  }
 else {
    dTickSize=0;
  }
  if (iXLabelLocation == PlotWithAxes.ABOVE) {
    double dXLabelHeight=Math.max((bTicksAbove ? dTickSize : 0) + dXAxisLabelsThickness,dAppliedXAxisPlotSpacing);
    if (dXLabelHeight + dDecorationThickness[1] < dHTotal) {
      dY1-=dXLabelHeight;
      dY2+=dDecorationThickness[1];
      dHTotal-=(dXLabelHeight + dDecorationThickness[1]);
    }
 else {
      dXLabelHeight=0;
      fHorizontalAxis.setShowLabels(false);
    }
  }
 else   if (iXLabelLocation == PlotWithAxes.BELOW) {
    double dXLabelHeight=Math.max(dXAxisLabelsThickness,dDecorationThickness[1]);
    double dHt1=Math.max(bTicksAbove ? dTickSize : 0,dAppliedXAxisPlotSpacing);
    if (dXLabelHeight + dHt1 <= dHTotal) {
      dY2+=dXLabelHeight;
      dY1-=dHt1;
      dHTotal-=(dXLabelHeight + dHt1);
    }
 else {
      dXLabelHeight=0;
      fHorizontalAxis.setShowLabels(false);
    }
  }
  if (iXTitleLocation == PlotWithAxes.ABOVE) {
    dY1-=dXAxisTitleThickness;
  }
 else   if (iXTitleLocation == PlotWithAxes.BELOW) {
    dY2+=dXAxisTitleThickness;
  }
  double dBlockY=fPlotBounds.getTop();
  double dBlockHeight=fPlotBounds.getHeight();
  if (dY2 > dBlockY + dBlockHeight) {
    final double dDelta=(dY2 - (dBlockY + dBlockHeight));
    dY2=dBlockY + dBlockHeight;
    dY-=dDelta;
    dY1-=dDelta;
  }
  fAxisY=dY;
  fAxisTop=dY1;
  fAxisBottom=dY2;
}