Program: 111197
Project: 111197
Buggy source:
@Override protected void onDataChanged(){
  super.onDataChanged();
  if (!mSeries.isEmpty()) {
    int seriesCount=mSeries.size();
    float maxValue=0;
    for (    ValueLineSeries series : mSeries) {
      for (      ValueLinePoint point : series.getSeries()) {
        if (point.getValue() > maxValue)         maxValue=point.getValue();
      }
    }
    float heightMultiplier=mUseableGraphHeight / maxValue;
    for (    ValueLineSeries series : mSeries) {
      int seriesPointCount=series.getSeries().size();
      if (seriesPointCount == 1) {
        Log.w(LOG_TAG,"String_Node_Str");
      }
 else {
        float widthOffset=mGraphWidth / seriesPointCount;
        widthOffset+=widthOffset / seriesPointCount;
        float currentOffset=0;
        series.setWidthOffset(widthOffset);
        if (mUseCubic) {
          widthOffset=mWidth / (seriesPointCount - 1);
        }
        float firstX=currentOffset;
        float firstY=(mUseableGraphHeight + mTopPadding) - (series.getSeries().get(0).getValue() * heightMultiplier);
        Path path=new Path();
        path.moveTo(firstX,firstY);
        series.getSeries().get(0).setCoordinates(new Point2D(firstX,firstY));
        if (mUseCubic) {
          Point2D P1=new Point2D();
          Point2D P2=new Point2D();
          Point2D P3=new Point2D();
          for (int i=0; i < seriesPointCount; i++) {
            if ((seriesPointCount - i) < 3) {
              P1.setX(currentOffset);
              P1.setY((mUseableGraphHeight + mTopPadding) - (series.getSeries().get(i).getValue() * heightMultiplier));
              P2.setX(mGraphWidth);
              P2.setY((mUseableGraphHeight + mTopPadding) - (series.getSeries().get(i + 1).getValue() * heightMultiplier));
              calculatePointDiff(P1,P2,P1,mSecondMultiplier);
              P3.setX(mGraphWidth);
              P3.setY((mUseableGraphHeight + mTopPadding) - (series.getSeries().get(i + 1).getValue() * heightMultiplier));
              calculatePointDiff(P2,P3,P3,mFirstMultiplier);
              path.cubicTo(P1.getX(),P1.getY(),P2.getX(),P2.getY(),P3.getX(),P3.getY());
              series.getSeries().get(i + 1).setCoordinates(new Point2D(P2.getX(),P2.getY()));
              break;
            }
 else {
              P1.setX(currentOffset);
              P1.setY((mUseableGraphHeight + mTopPadding) - (series.getSeries().get(i).getValue() * heightMultiplier));
              P2.setX(currentOffset + widthOffset);
              P2.setY((mUseableGraphHeight + mTopPadding) - (series.getSeries().get(i + 1).getValue() * heightMultiplier));
              calculatePointDiff(P1,P2,P1,mSecondMultiplier);
              P3.setX(currentOffset + (2 * widthOffset));
              P3.setY((mUseableGraphHeight + mTopPadding) - (series.getSeries().get(i + 2).getValue() * heightMultiplier));
              calculatePointDiff(P2,P3,P3,mFirstMultiplier);
              series.getSeries().get(i + 1).setCoordinates(new Point2D(P2.getX(),P2.getY()));
            }
            currentOffset+=widthOffset;
            path.cubicTo(P1.getX(),P1.getY(),P2.getX(),P2.getY(),P3.getX(),P3.getY());
          }
        }
 else {
          boolean first=true;
          int count=1;
          for (          ValueLinePoint point : series.getSeries()) {
            if (first) {
              first=false;
              continue;
            }
            currentOffset+=widthOffset;
            if (count == seriesPointCount - 1) {
              if (currentOffset < mGraphWidth) {
                currentOffset=mGraphWidth;
              }
            }
            point.setCoordinates(new Point2D(currentOffset,(mUseableGraphHeight + mTopPadding) - (point.getValue() * heightMultiplier)));
            path.lineTo(point.getCoordinates().getX(),point.getCoordinates().getY());
            count++;
          }
        }
        if (mUseOverlapFill || seriesCount == 1) {
          path.lineTo(mGraphWidth,mGraphHeight);
          path.lineTo(0,mGraphHeight);
          path.lineTo(firstX,firstY);
        }
        series.setPath(path);
      }
    }
    if (!mUseCustomLegend) {
      int index=0;
      int size=mSeries.get(0).getSeries().size();
      if (size > 1) {
        for (        ValueLinePoint valueLinePoint : mSeries.get(0).getSeries()) {
          if (!(index == 0 || index == size - 1)) {
            valueLinePoint.setLegendBounds(new RectF(valueLinePoint.getCoordinates().getX() - mSeries.get(0).getWidthOffset() / 2,0,valueLinePoint.getCoordinates().getX() + mSeries.get(0).getWidthOffset() / 2,mLegendHeight));
          }
 else {
            valueLinePoint.setIgnore(true);
          }
          index++;
        }
        Utils.calculateLegendInformation(mSeries.get(0).getSeries(),0,mLegendPaint);
      }
    }
    if (mShowIndicator && mSeries.size() == 1) {
      int size=mSeries.get(0).getSeries().size();
      int index;
      if (size > 1) {
        if (size == 3) {
          index=size / 2;
        }
 else {
          index=(size / 2) - 1;
        }
        mFocusedPoint=mSeries.get(0).getSeries().get(index);
        mTouchedArea.setX(mFocusedPoint.getCoordinates().getX());
        mTouchedArea.setY(mFocusedPoint.getCoordinates().getY());
        calculateValueTextHeight();
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void onDataChanged(){
  if (!mSeries.isEmpty()) {
    int seriesCount=mSeries.size();
    float maxValue=0;
    for (    ValueLineSeries series : mSeries) {
      for (      ValueLinePoint point : series.getSeries()) {
        if (point.getValue() > maxValue)         maxValue=point.getValue();
      }
    }
    float heightMultiplier=mUseableGraphHeight / maxValue;
    for (    ValueLineSeries series : mSeries) {
      int seriesPointCount=series.getSeries().size();
      if (seriesPointCount <= 1) {
        Log.w(LOG_TAG,"String_Node_Str");
      }
 else {
        float widthOffset=mGraphWidth / seriesPointCount;
        widthOffset+=widthOffset / seriesPointCount;
        float currentOffset=0;
        series.setWidthOffset(widthOffset);
        if (mUseCubic) {
          widthOffset=mWidth / (seriesPointCount - 1);
        }
        float firstX=currentOffset;
        float firstY=(mUseableGraphHeight + mTopPadding) - (series.getSeries().get(0).getValue() * heightMultiplier);
        Path path=new Path();
        path.moveTo(firstX,firstY);
        series.getSeries().get(0).setCoordinates(new Point2D(firstX,firstY));
        if (mUseCubic) {
          Point2D P1=new Point2D();
          Point2D P2=new Point2D();
          Point2D P3=new Point2D();
          for (int i=0; i < seriesPointCount; i++) {
            if ((seriesPointCount - i) < 3) {
              P1.setX(currentOffset);
              P1.setY((mUseableGraphHeight + mTopPadding) - (series.getSeries().get(i).getValue() * heightMultiplier));
              P2.setX(mGraphWidth);
              P2.setY((mUseableGraphHeight + mTopPadding) - (series.getSeries().get(i + 1).getValue() * heightMultiplier));
              calculatePointDiff(P1,P2,P1,mSecondMultiplier);
              P3.setX(mGraphWidth);
              P3.setY((mUseableGraphHeight + mTopPadding) - (series.getSeries().get(i + 1).getValue() * heightMultiplier));
              calculatePointDiff(P2,P3,P3,mFirstMultiplier);
              path.cubicTo(P1.getX(),P1.getY(),P2.getX(),P2.getY(),P3.getX(),P3.getY());
              series.getSeries().get(i + 1).setCoordinates(new Point2D(P2.getX(),P2.getY()));
              break;
            }
 else {
              P1.setX(currentOffset);
              P1.setY((mUseableGraphHeight + mTopPadding) - (series.getSeries().get(i).getValue() * heightMultiplier));
              P2.setX(currentOffset + widthOffset);
              P2.setY((mUseableGraphHeight + mTopPadding) - (series.getSeries().get(i + 1).getValue() * heightMultiplier));
              calculatePointDiff(P1,P2,P1,mSecondMultiplier);
              P3.setX(currentOffset + (2 * widthOffset));
              P3.setY((mUseableGraphHeight + mTopPadding) - (series.getSeries().get(i + 2).getValue() * heightMultiplier));
              calculatePointDiff(P2,P3,P3,mFirstMultiplier);
              series.getSeries().get(i + 1).setCoordinates(new Point2D(P2.getX(),P2.getY()));
            }
            currentOffset+=widthOffset;
            path.cubicTo(P1.getX(),P1.getY(),P2.getX(),P2.getY(),P3.getX(),P3.getY());
          }
        }
 else {
          boolean first=true;
          int count=1;
          for (          ValueLinePoint point : series.getSeries()) {
            if (first) {
              first=false;
              continue;
            }
            currentOffset+=widthOffset;
            if (count == seriesPointCount - 1) {
              if (currentOffset < mGraphWidth) {
                currentOffset=mGraphWidth;
              }
            }
            point.setCoordinates(new Point2D(currentOffset,(mUseableGraphHeight + mTopPadding) - (point.getValue() * heightMultiplier)));
            path.lineTo(point.getCoordinates().getX(),point.getCoordinates().getY());
            count++;
          }
        }
        if (mUseOverlapFill || seriesCount == 1) {
          path.lineTo(mGraphWidth,mGraphHeight);
          path.lineTo(0,mGraphHeight);
          path.lineTo(firstX,firstY);
        }
        series.setPath(path);
      }
    }
    if (!mUseCustomLegend) {
      int index=0;
      int size=mSeries.get(0).getSeries().size();
      if (size > 1) {
        for (        ValueLinePoint valueLinePoint : mSeries.get(0).getSeries()) {
          if (!(index == 0 || index == size - 1)) {
            valueLinePoint.setLegendBounds(new RectF(valueLinePoint.getCoordinates().getX() - mSeries.get(0).getWidthOffset() / 2,0,valueLinePoint.getCoordinates().getX() + mSeries.get(0).getWidthOffset() / 2,mLegendHeight));
          }
 else {
            valueLinePoint.setIgnore(true);
          }
          index++;
        }
        Utils.calculateLegendInformation(mSeries.get(0).getSeries(),0,mLegendPaint);
      }
    }
    if (mShowIndicator && mSeries.size() == 1) {
      int size=mSeries.get(0).getSeries().size();
      int index;
      if (size > 1) {
        if (size == 3) {
          index=size / 2;
        }
 else {
          index=(size / 2) - 1;
        }
        mFocusedPoint=mSeries.get(0).getSeries().get(index);
        mTouchedArea.setX(mFocusedPoint.getCoordinates().getX());
        mTouchedArea.setY(mFocusedPoint.getCoordinates().getY());
        calculateValueTextHeight();
      }
    }
  }
  super.onDataChanged();
  mLegend.invalidate();
}