Program: 26661
Project: 26661
Buggy source:
protected void drawCubic(Canvas c,LineDataSet dataSet,ArrayList<Entry> entries){
  Transformer trans=mChart.getTransformer(dataSet.getAxisDependency());
  int minx=mMinX;
  int maxx=mMaxX + 2;
  if (maxx > entries.size())   maxx=entries.size();
  float phaseX=mAnimator.getPhaseX();
  float phaseY=mAnimator.getPhaseY();
  float intensity=dataSet.getCubicIntensity();
  long start=System.currentTimeMillis();
  cubicPath.reset();
  float size=entries.size() * phaseX;
  if (entries.size() > 2) {
    float prevDx=0f;
    float prevDy=0f;
    float curDx=0f;
    float curDy=0f;
    Entry cur=entries.get(0);
    Entry next=entries.get(1);
    Entry prev=entries.get(0);
    Entry prevPrev=entries.get(0);
    cubicPath.moveTo(cur.getXIndex(),cur.getVal() * phaseY);
    prevDx=(next.getXIndex() - cur.getXIndex()) * intensity;
    prevDy=(next.getVal() - cur.getVal()) * intensity;
    cur=entries.get(1);
    next=entries.get(2);
    curDx=(next.getXIndex() - prev.getXIndex()) * intensity;
    curDy=(next.getVal() - prev.getVal()) * intensity;
    cubicPath.cubicTo(prev.getXIndex() + prevDx,(prev.getVal() + prevDy) * phaseY,cur.getXIndex() - curDx,(cur.getVal() - curDy) * phaseY,cur.getXIndex(),cur.getVal() * phaseY);
    for (int j=2; j < size - 1; j++) {
      prevPrev=entries.get(j - 2);
      prev=entries.get(j - 1);
      cur=entries.get(j);
      next=entries.get(j + 1);
      prevDx=(cur.getXIndex() - prevPrev.getXIndex()) * intensity;
      prevDy=(cur.getVal() - prevPrev.getVal()) * intensity;
      curDx=(next.getXIndex() - prev.getXIndex()) * intensity;
      curDy=(next.getVal() - prev.getVal()) * intensity;
      cubicPath.cubicTo(prev.getXIndex() + prevDx,(prev.getVal() + prevDy) * phaseY,cur.getXIndex() - curDx,(cur.getVal() - curDy) * phaseY,cur.getXIndex(),cur.getVal() * phaseY);
    }
    if (size > entries.size() - 1) {
      cur=entries.get(entries.size() - 1);
      prev=entries.get(entries.size() - 2);
      prevPrev=entries.get(entries.size() - 3);
      next=cur;
      prevDx=(cur.getXIndex() - prevPrev.getXIndex()) * intensity;
      prevDy=(cur.getVal() - prevPrev.getVal()) * intensity;
      curDx=(next.getXIndex() - prev.getXIndex()) * intensity;
      curDy=(next.getVal() - prev.getVal()) * intensity;
      cubicPath.cubicTo(prev.getXIndex() + prevDx,(prev.getVal() + prevDy) * phaseY,cur.getXIndex() - curDx,(cur.getVal() - curDy) * phaseY,cur.getXIndex(),cur.getVal() * phaseY);
    }
  }
  if (dataSet.isDrawFilledEnabled()) {
    cubicFillPath.reset();
    cubicFillPath.addPath(cubicPath);
    drawCubicFill(mBitmapCanvas,dataSet,cubicFillPath,trans,minx,maxx);
  }
  Log.i("String_Node_Str","String_Node_Str" + (System.currentTimeMillis() - start));
  mRenderPaint.setColor(dataSet.getColor());
  mRenderPaint.setStyle(Paint.Style.STROKE);
  start=System.currentTimeMillis();
  trans.pathValueToPixel(cubicPath);
  Log.i("String_Node_Str","String_Node_Str" + (System.currentTimeMillis() - start));
  start=System.currentTimeMillis();
  mBitmapCanvas.drawPath(cubicPath,mRenderPaint);
  Log.i("String_Node_Str","String_Node_Str" + (System.currentTimeMillis() - start));
  c.drawBitmap(mPathBitmap,0,0,mRenderPaint);
  mRenderPaint.setPathEffect(null);
}

Fixed version (ground truth):
/** 
 * Draws a cubic line.
 * @param c
 * @param dataSet
 * @param entries
 */
protected void drawCubic(Canvas c,LineDataSet dataSet,ArrayList<Entry> entries){
  Transformer trans=mChart.getTransformer(dataSet.getAxisDependency());
  int minx=mMinX;
  int maxx=mMaxX + 2;
  if (maxx > entries.size())   maxx=entries.size();
  float phaseX=mAnimator.getPhaseX();
  float phaseY=mAnimator.getPhaseY();
  float intensity=dataSet.getCubicIntensity();
  cubicPath.reset();
  float size=entries.size() * phaseX;
  if (entries.size() > 2) {
    float prevDx=0f;
    float prevDy=0f;
    float curDx=0f;
    float curDy=0f;
    Entry cur=entries.get(0);
    Entry next=entries.get(1);
    Entry prev=entries.get(0);
    Entry prevPrev=entries.get(0);
    cubicPath.moveTo(cur.getXIndex(),cur.getVal() * phaseY);
    prevDx=(next.getXIndex() - cur.getXIndex()) * intensity;
    prevDy=(next.getVal() - cur.getVal()) * intensity;
    cur=entries.get(1);
    next=entries.get(2);
    curDx=(next.getXIndex() - prev.getXIndex()) * intensity;
    curDy=(next.getVal() - prev.getVal()) * intensity;
    cubicPath.cubicTo(prev.getXIndex() + prevDx,(prev.getVal() + prevDy) * phaseY,cur.getXIndex() - curDx,(cur.getVal() - curDy) * phaseY,cur.getXIndex(),cur.getVal() * phaseY);
    for (int j=2; j < size - 1; j++) {
      prevPrev=entries.get(j - 2);
      prev=entries.get(j - 1);
      cur=entries.get(j);
      next=entries.get(j + 1);
      prevDx=(cur.getXIndex() - prevPrev.getXIndex()) * intensity;
      prevDy=(cur.getVal() - prevPrev.getVal()) * intensity;
      curDx=(next.getXIndex() - prev.getXIndex()) * intensity;
      curDy=(next.getVal() - prev.getVal()) * intensity;
      cubicPath.cubicTo(prev.getXIndex() + prevDx,(prev.getVal() + prevDy) * phaseY,cur.getXIndex() - curDx,(cur.getVal() - curDy) * phaseY,cur.getXIndex(),cur.getVal() * phaseY);
    }
    if (size > entries.size() - 1) {
      cur=entries.get(entries.size() - 1);
      prev=entries.get(entries.size() - 2);
      prevPrev=entries.get(entries.size() - 3);
      next=cur;
      prevDx=(cur.getXIndex() - prevPrev.getXIndex()) * intensity;
      prevDy=(cur.getVal() - prevPrev.getVal()) * intensity;
      curDx=(next.getXIndex() - prev.getXIndex()) * intensity;
      curDy=(next.getVal() - prev.getVal()) * intensity;
      cubicPath.cubicTo(prev.getXIndex() + prevDx,(prev.getVal() + prevDy) * phaseY,cur.getXIndex() - curDx,(cur.getVal() - curDy) * phaseY,cur.getXIndex(),cur.getVal() * phaseY);
    }
  }
  if (dataSet.isDrawFilledEnabled()) {
    cubicFillPath.reset();
    cubicFillPath.addPath(cubicPath);
    drawCubicFill(mBitmapCanvas,dataSet,cubicFillPath,trans,minx,maxx);
  }
  mRenderPaint.setColor(dataSet.getColor());
  mRenderPaint.setStyle(Paint.Style.STROKE);
  trans.pathValueToPixel(cubicPath);
  mBitmapCanvas.drawPath(cubicPath,mRenderPaint);
  mRenderPaint.setPathEffect(null);
}