Program: 79317
Project: 79317
Buggy source:
/** 
 * @param la
 * @param iLabelLocation
 * @param iOrientation
 * @param dStart
 * @param dEnd
 * @param bConsiderStartEndLabels
 * @param aax
 */
final void computeTicks(IDisplayServer xs,Label la,int iLabelLocation,int iOrientation,double dStart,double dEnd,boolean bConsiderStartEndLabels,AllAxes aax) throws GenerationException {
  int nTicks=0;
  double dLength=0;
  int iDirection=(iOrientation == HORIZONTAL) ? FORWARD : BACKWARD;
  DataSetIterator dsi=getData();
  if (bConsiderStartEndLabels) {
    computeAxisStartEndShifts(xs,la,iOrientation,iLabelLocation,aax);
    dStart+=dStartShift * iDirection;
    dEnd+=dEndShift * -iDirection;
  }
  if ((iType & TEXT) == TEXT || bCategoryScale) {
    nTicks=dsi.size() + 1;
    dLength=Math.abs(dStart - dEnd);
  }
 else   if ((iType & NUMERICAL) == NUMERICAL) {
{
      nTicks=getTickCount();
      dLength=Math.abs(dStart - dEnd);
    }
  }
 else   if ((iType & DATE_TIME) == DATE_TIME) {
    final CDateTime cdt1=(CDateTime)oMinimum;
    final CDateTime cdt2=(CDateTime)oMaximum;
    String s1=cdt1.toString();
    String s2=cdt2.toString();
    final double dNumberOfSteps=Math.ceil(CDateTime.computeDifference(cdt2,cdt1,asInteger(oUnit)));
    nTicks=(int)(dNumberOfSteps / asInteger(oStep)) + 1;
    dLength=Math.abs(dStart - dEnd);
  }
 else {
    throw new GenerationException("String_Node_Str");
  }
  double dTicGap=dLength / (nTicks - 1) * iDirection;
  double d=dStart + dTicGap;
  double[] da=new double[nTicks];
  for (int i=1; i < nTicks - 1; i++, d+=dTicGap) {
    da[i]=d;
  }
  da[0]=dStart;
  da[nTicks - 1]=dEnd;
  setTickCordinates(null);
  setEndPoints(dStart,dEnd);
  setTickCordinates(da);
}

Fixed version (ground truth):
/** 
 * @param la
 * @param iLabelLocation
 * @param iOrientation
 * @param dStart
 * @param dEnd
 * @param bConsiderStartEndLabels
 * @param aax
 */
final void computeTicks(IDisplayServer xs,Label la,int iLabelLocation,int iOrientation,double dStart,double dEnd,boolean bConsiderStartEndLabels,AllAxes aax) throws GenerationException {
  int nTicks=0;
  double dLength=0;
  int iDirection=(iOrientation == HORIZONTAL) ? FORWARD : BACKWARD;
  DataSetIterator dsi=getData();
  if (bConsiderStartEndLabels) {
    computeAxisStartEndShifts(xs,la,iOrientation,iLabelLocation,aax);
    dStart+=dStartShift * iDirection;
    dEnd+=dEndShift * -iDirection;
  }
  if ((iType & TEXT) == TEXT || bCategoryScale) {
    nTicks=dsi.size() + 1;
    dLength=Math.abs(dStart - dEnd);
  }
 else   if ((iType & NUMERICAL) == NUMERICAL) {
    nTicks=getTickCount();
    dLength=Math.abs(dStart - dEnd);
  }
 else   if ((iType & DATE_TIME) == DATE_TIME) {
    final CDateTime cdt1=(CDateTime)oMinimum;
    final CDateTime cdt2=(CDateTime)oMaximum;
    final double dNumberOfSteps=Math.ceil(CDateTime.computeDifference(cdt2,cdt1,asInteger(oUnit)));
    nTicks=(int)(dNumberOfSteps / asInteger(oStep)) + 1;
    dLength=Math.abs(dStart - dEnd);
  }
 else {
    throw new GenerationException("String_Node_Str");
  }
  final double dTickGap=dLength / (nTicks - 1) * iDirection;
  double d=dStart + dTickGap;
  final double[] da=new double[nTicks];
  for (int i=1; i < nTicks - 1; i++, d+=dTickGap) {
    da[i]=d;
  }
  da[0]=dStart;
  da[nTicks - 1]=dEnd;
  setTickCordinates(null);
  setEndPoints(dStart,dEnd);
  setTickCordinates(da);
}