Program: 26472
Project: 26472
Buggy source:
/** 
 * calc minimum and maximum y value over all datasets
 */
public void calcMinMax(int start,int end){
  if (mDataSets == null || mDataSets.size() < 1) {
    mYMax=0f;
    mYMin=0f;
  }
 else {
    mLastStart=start;
    mLastEnd=end;
    mYMin=Float.MAX_VALUE;
    mYMax=-Float.MIN_VALUE;
    for (int i=0; i < mDataSets.size(); i++) {
      mDataSets.get(i).calcMinMax(start,end);
      if (mDataSets.get(i).getYMin() < mYMin)       mYMin=mDataSets.get(i).getYMin();
      if (mDataSets.get(i).getYMax() > mYMax)       mYMax=mDataSets.get(i).getYMax();
    }
    if (mYMin == Float.MAX_VALUE) {
      mYMin=0.f;
      mYMax=0.f;
    }
    T firstLeft=getFirstLeft();
    if (firstLeft != null) {
      mLeftAxisMax=firstLeft.getYMax();
      mLeftAxisMin=firstLeft.getYMin();
      for (      DataSet<?> dataSet : mDataSets) {
        if (dataSet.getAxisDependency() == AxisDependency.LEFT) {
          if (dataSet.getYMin() < mLeftAxisMin)           mLeftAxisMin=dataSet.getYMin();
          if (dataSet.getYMax() > mLeftAxisMax)           mLeftAxisMax=dataSet.getYMax();
        }
      }
    }
    T firstRight=getFirstRight();
    if (firstRight != null) {
      mRightAxisMax=firstRight.getYMax();
      mRightAxisMin=firstRight.getYMin();
      for (      DataSet<?> dataSet : mDataSets) {
        if (dataSet.getAxisDependency() == AxisDependency.RIGHT) {
          if (dataSet.getYMin() < mRightAxisMin)           mRightAxisMin=dataSet.getYMin();
          if (dataSet.getYMax() > mRightAxisMax)           mRightAxisMax=dataSet.getYMax();
        }
      }
    }
    handleEmptyAxis(firstLeft,firstRight);
  }
}

Fixed version (ground truth):
/** 
 * calc minimum and maximum y value over all datasets
 */
public void calcMinMax(int start,int end){
  if (mDataSets == null || mDataSets.size() < 1) {
    mYMax=0f;
    mYMin=0f;
  }
 else {
    mLastStart=start;
    mLastEnd=end;
    mYMin=Float.MAX_VALUE;
    mYMax=-Float.MAX_VALUE;
    for (int i=0; i < mDataSets.size(); i++) {
      mDataSets.get(i).calcMinMax(start,end);
      if (mDataSets.get(i).getYMin() < mYMin)       mYMin=mDataSets.get(i).getYMin();
      if (mDataSets.get(i).getYMax() > mYMax)       mYMax=mDataSets.get(i).getYMax();
    }
    if (mYMin == Float.MAX_VALUE) {
      mYMin=0.f;
      mYMax=0.f;
    }
    T firstLeft=getFirstLeft();
    if (firstLeft != null) {
      mLeftAxisMax=firstLeft.getYMax();
      mLeftAxisMin=firstLeft.getYMin();
      for (      DataSet<?> dataSet : mDataSets) {
        if (dataSet.getAxisDependency() == AxisDependency.LEFT) {
          if (dataSet.getYMin() < mLeftAxisMin)           mLeftAxisMin=dataSet.getYMin();
          if (dataSet.getYMax() > mLeftAxisMax)           mLeftAxisMax=dataSet.getYMax();
        }
      }
    }
    T firstRight=getFirstRight();
    if (firstRight != null) {
      mRightAxisMax=firstRight.getYMax();
      mRightAxisMin=firstRight.getYMin();
      for (      DataSet<?> dataSet : mDataSets) {
        if (dataSet.getAxisDependency() == AxisDependency.RIGHT) {
          if (dataSet.getYMin() < mRightAxisMin)           mRightAxisMin=dataSet.getYMin();
          if (dataSet.getYMax() > mRightAxisMax)           mRightAxisMax=dataSet.getYMax();
        }
      }
    }
    handleEmptyAxis(firstLeft,firstRight);
  }
}