Program: 18946
Project: 18946
Buggy source:
/** 
 * draws the given y values to the screen
 */
@Override protected void drawData(){
  ArrayList<DataSet> dataSets;
  dataSets=mCurrentData.getDataSets();
  for (int i=0; i < mCurrentData.getDataSetCount(); i++) {
    DataSet dataSet=dataSets.get(i);
    ArrayList<Entry> entries=dataSet.getYVals();
    float[] valuePoints=generateTransformedValues(entries,0f);
    ArrayList<Integer> colors=mCt.getDataSetColors(i % mCt.getColors().size());
    Paint paint=mRenderPaint;
    if (mDrawSpline) {
      Path spline=new Path();
      spline.moveTo(entries.get(0).getXIndex(),entries.get(0).getVal());
      paint.setColor(colors.get(i % colors.size()));
      for (int x=1; x < entries.size() - 3; x+=2) {
        spline.cubicTo(entries.get(x).getXIndex(),entries.get(x).getVal(),entries.get(x + 1).getXIndex(),entries.get(x + 1).getVal(),entries.get(x + 2).getXIndex(),entries.get(x + 2).getVal());
      }
      transformPath(spline);
      mDrawCanvas.drawPath(spline,paint);
    }
 else {
      for (int j=0; j < valuePoints.length - 2; j+=2) {
        paint.setColor(colors.get(j % colors.size()));
        if (isOffContentRight(valuePoints[j]))         break;
        if (j != 0 && isOffContentLeft(valuePoints[j - 1]) && isOffContentTop(valuePoints[j + 1]) && isOffContentBottom(valuePoints[j + 1]))         continue;
        mDrawCanvas.drawLine(valuePoints[j],valuePoints[j + 1],valuePoints[j + 2],valuePoints[j + 3],paint);
      }
    }
    if (mDrawFilled && entries.size() > 0) {
      paint.setAlpha(85);
      Path filled=new Path();
      filled.moveTo(entries.get(0).getXIndex(),entries.get(0).getVal());
      for (int x=1; x < entries.size(); x++) {
        filled.lineTo(entries.get(x).getXIndex(),entries.get(x).getVal());
      }
      filled.lineTo(entries.get(entries.size() - 1).getXIndex(),mYChartMin);
      filled.lineTo(entries.get(0).getXIndex(),mYChartMin);
      filled.close();
      transformPath(filled);
      mDrawCanvas.drawPath(filled,paint);
      paint.setAlpha(255);
    }
  }
}

Fixed version (ground truth):
/** 
 * draws the given y values to the screen
 */
@Override protected void drawData(){
  ArrayList<DataSet> dataSets;
  dataSets=mCurrentData.getDataSets();
  for (int i=0; i < mCurrentData.getDataSetCount(); i++) {
    DataSet dataSet=dataSets.get(i);
    ArrayList<Entry> entries=dataSet.getYVals();
    float[] valuePoints=generateTransformedValues(entries,0f);
    ArrayList<Integer> colors=mCt.getDataSetColors(i % mCt.getColors().size());
    Paint paint=mRenderPaint;
    if (mDrawCubic) {
      paint.setColor(colors.get(i % colors.size()));
      Path spline=new Path();
      spline.moveTo(entries.get(0).getXIndex(),entries.get(0).getVal());
      for (int x=1; x < entries.size() - 3; x+=2) {
        spline.cubicTo(entries.get(x).getXIndex(),entries.get(x).getVal(),entries.get(x + 1).getXIndex(),entries.get(x + 1).getVal(),entries.get(x + 2).getXIndex(),entries.get(x + 2).getVal());
      }
      transformPath(spline);
      mDrawCanvas.drawPath(spline,paint);
    }
 else {
      for (int j=0; j < valuePoints.length - 2; j+=2) {
        paint.setColor(colors.get(j % colors.size()));
        if (isOffContentRight(valuePoints[j]))         break;
        if (j != 0 && isOffContentLeft(valuePoints[j - 1]) && isOffContentTop(valuePoints[j + 1]) && isOffContentBottom(valuePoints[j + 1]))         continue;
        mDrawCanvas.drawLine(valuePoints[j],valuePoints[j + 1],valuePoints[j + 2],valuePoints[j + 3],paint);
      }
    }
    if (mDrawFilled && entries.size() > 0) {
      paint.setAlpha(85);
      Path filled=new Path();
      filled.moveTo(entries.get(0).getXIndex(),entries.get(0).getVal());
      for (int x=1; x < entries.size(); x++) {
        filled.lineTo(entries.get(x).getXIndex(),entries.get(x).getVal());
      }
      filled.lineTo(entries.get(entries.size() - 1).getXIndex(),mYChartMin);
      filled.lineTo(entries.get(0).getXIndex(),mYChartMin);
      filled.close();
      transformPath(filled);
      mDrawCanvas.drawPath(filled,paint);
      paint.setAlpha(255);
    }
  }
}