Program: 71449
Project: 71449
Buggy source:
/** 
 * Zooms IN 'once' into a scale of type numerical or datetime Typically, this is called in a loop until label overlaps occur
 */
public final boolean zoomIn(){
  if (bStepFixed) {
    return false;
  }
  if (ChartUtil.mathEqual(0,((Number)oStep).doubleValue())) {
    return false;
  }
  if ((iType & NUMERICAL) == NUMERICAL) {
    if ((iType & LOGARITHMIC) == LOGARITHMIC) {
      final double dStep=asDouble(oStep).doubleValue();
      if ((Math.log(dStep) / LOG_10) > 1) {
        oStep=new Double(dStep / 10);
      }
 else {
        int n=iaLogarithmicDeltas.length;
        for (int i=n - 1; i >= 0; i--) {
          if ((int)dStep == iaLogarithmicDeltas[i]) {
            if (i > 0) {
              oStep=new Double(iaLogarithmicDeltas[i - 1]);
              return true;
            }
 else {
              return false;
            }
          }
        }
        return false;
      }
    }
 else     if ((iType & LINEAR) == LINEAR) {
      double dStep=asDouble(oStep).doubleValue();
      final double oldStep=dStep;
      if (bIntegralZoom) {
        double dPower=(Math.log(dStep) / LOG_10);
        dPower=Math.floor(dPower);
        dPower=Math.pow(10.0,dPower);
        dStep/=dPower;
        dStep=Math.round(dStep);
        int n=iaLinearDeltas.length;
        for (int i=0; i < n; i++) {
          if ((int)dStep == iaLinearDeltas[i]) {
            if (i > 0) {
              dStep=iaLinearDeltas[i - 1] * dPower;
            }
 else {
              dPower/=10;
              dStep=iaLinearDeltas[n - 2] * dPower;
            }
            break;
          }
        }
        if (dStep == oldStep) {
          dStep/=2;
        }
        oStep=new Double(dStep);
      }
 else {
        dStep/=2;
        oStep=new Double(dStep);
      }
      if (((Number)oStep).doubleValue() < dPrecision) {
        oStep=new Double(oldStep);
        return false;
      }
    }
  }
 else   if ((iType & DATE_TIME) == DATE_TIME) {
    int[] ia=null;
    int iStep=asInteger(oStep);
    int iUnit=asInteger(oUnit);
    for (int icu=0; icu < iaCalendarUnits.length; icu++) {
      if (iUnit == iaCalendarUnits[icu]) {
        ia=iaCalendarDeltas[icu];
        if (ia == null) {
          iStep--;
          if (iStep == 0) {
            oStep=new Integer(iaMonthDeltas[iaMonthDeltas.length - 1]);
            oUnit=new Integer(Calendar.MONTH);
          }
        }
 else {
          int i=0;
          for (; i < ia.length; i++) {
            if (ia[i] == iStep) {
              break;
            }
          }
          if (i == 0) {
            if (icu <= iMinUnit) {
              return false;
            }
            ia=iaCalendarDeltas[icu - 1];
            i=ia.length;
            oUnit=new Integer(iaCalendarUnits[icu - 1]);
          }
          oStep=new Integer(ia[i - 1]);
          break;
        }
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Zooms IN 'once' into a scale of type numerical or datetime Typically, this is called in a loop until label overlaps occur
 */
public final boolean zoomIn(){
  if (bStepFixed) {
    return false;
  }
  if (ChartUtil.mathEqual(0,((Number)oStep).doubleValue())) {
    return false;
  }
  if ((iType & NUMERICAL) == NUMERICAL) {
    if ((iType & LOGARITHMIC) == LOGARITHMIC) {
      final double dStep=asDouble(oStep).doubleValue();
      if ((Math.log(dStep) / LOG_10) > 1) {
        setStep(new Double(dStep / 10));
      }
 else {
        int n=iaLogarithmicDeltas.length;
        for (int i=n - 1; i >= 0; i--) {
          if ((int)dStep == iaLogarithmicDeltas[i]) {
            if (i > 0) {
              setStep(new Double(iaLogarithmicDeltas[i - 1]));
              return true;
            }
 else {
              return false;
            }
          }
        }
        return false;
      }
    }
 else     if ((iType & LINEAR) == LINEAR) {
      double dStep=asDouble(oStep).doubleValue();
      final double oldStep=dStep;
      if (bIntegralZoom) {
        double dPower=(Math.log(dStep) / LOG_10);
        dPower=Math.floor(dPower);
        dPower=Math.pow(10.0,dPower);
        dStep/=dPower;
        dStep=Math.round(dStep);
        int n=iaLinearDeltas.length;
        for (int i=0; i < n; i++) {
          if ((int)dStep == iaLinearDeltas[i]) {
            if (i > 0) {
              dStep=iaLinearDeltas[i - 1] * dPower;
            }
 else {
              dPower/=10;
              dStep=iaLinearDeltas[n - 2] * dPower;
            }
            break;
          }
        }
        if (dStep == oldStep) {
          dStep/=2;
        }
        setStep(new Double(dStep));
      }
 else {
        dStep/=2;
        setStep(new Double(dStep));
      }
      if (((Number)oStep).doubleValue() < dPrecision) {
        setStep(new Double(oldStep));
        return false;
      }
    }
  }
 else   if ((iType & DATE_TIME) == DATE_TIME) {
    int[] ia=null;
    int iStep=asInteger(oStep);
    int iUnit=asInteger(oUnit);
    for (int icu=0; icu < iaCalendarUnits.length; icu++) {
      if (iUnit == iaCalendarUnits[icu]) {
        ia=iaCalendarDeltas[icu];
        if (ia == null) {
          iStep--;
          if (iStep == 0) {
            setStep(new Integer(iaMonthDeltas[iaMonthDeltas.length - 1]));
            oUnit=new Integer(Calendar.MONTH);
          }
        }
 else {
          int i=0;
          for (; i < ia.length; i++) {
            if (ia[i] == iStep) {
              break;
            }
          }
          if (i == 0) {
            if (icu <= iMinUnit) {
              return false;
            }
            ia=iaCalendarDeltas[icu - 1];
            i=ia.length;
            oUnit=new Integer(iaCalendarUnits[icu - 1]);
          }
          setStep(new Integer(ia[i - 1]));
          break;
        }
      }
    }
  }
  return true;
}