Program: 18229
Project: 18229
Buggy source:
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  if (mData == null)   return;
  long starttime=System.currentTimeMillis();
  calcModulus();
  mXAxisRenderer.calcXBounds(this,mXAxis.mAxisLabelModulus);
  mRenderer.calcXBounds(this,mXAxis.mAxisLabelModulus);
  drawGridBackground(canvas);
  if (mAxisLeft.isEnabled())   mAxisRendererLeft.computeAxis(mAxisLeft.mAxisMinimum,mAxisLeft.mAxisMaximum);
  if (mAxisRight.isEnabled())   mAxisRendererRight.computeAxis(mAxisRight.mAxisMinimum,mAxisRight.mAxisMaximum);
  mXAxisRenderer.renderAxisLine(canvas);
  mAxisRendererLeft.renderAxisLine(canvas);
  mAxisRendererRight.renderAxisLine(canvas);
  if (mAutoScaleMinMaxEnabled) {
    final int lowestVisibleXIndex=getLowestVisibleXIndex();
    final int highestVisibleXIndex=getHighestVisibleXIndex();
    if (mAutoScaleLastLowestVisibleXIndex == null || mAutoScaleLastLowestVisibleXIndex != lowestVisibleXIndex || mAutoScaleLastHighestVisibleXIndex == null || mAutoScaleLastHighestVisibleXIndex != highestVisibleXIndex) {
      calcMinMax();
      calculateOffsets();
      mAutoScaleLastLowestVisibleXIndex=lowestVisibleXIndex;
      mAutoScaleLastHighestVisibleXIndex=highestVisibleXIndex;
    }
  }
  int clipRestoreCount=canvas.save();
  canvas.clipRect(mViewPortHandler.getContentRect());
  mXAxisRenderer.renderGridLines(canvas);
  mAxisRendererLeft.renderGridLines(canvas);
  mAxisRendererRight.renderGridLines(canvas);
  if (mXAxis.isDrawLimitLinesBehindDataEnabled())   mXAxisRenderer.renderLimitLines(canvas);
  if (mAxisLeft.isDrawLimitLinesBehindDataEnabled())   mAxisRendererLeft.renderLimitLines(canvas);
  if (mAxisRight.isDrawLimitLinesBehindDataEnabled())   mAxisRendererRight.renderLimitLines(canvas);
  mRenderer.drawData(canvas);
  if (!mXAxis.isDrawLimitLinesBehindDataEnabled())   mXAxisRenderer.renderLimitLines(canvas);
  if (!mAxisLeft.isDrawLimitLinesBehindDataEnabled())   mAxisRendererLeft.renderLimitLines(canvas);
  if (!mAxisRight.isDrawLimitLinesBehindDataEnabled())   mAxisRendererRight.renderLimitLines(canvas);
  if (valuesToHighlight())   mRenderer.drawHighlighted(canvas,mIndicesToHighlight);
  canvas.restoreToCount(clipRestoreCount);
  mRenderer.drawExtras(canvas);
  mXAxisRenderer.renderAxisLabels(canvas);
  mAxisRendererLeft.renderAxisLabels(canvas);
  mAxisRendererRight.renderAxisLabels(canvas);
  mRenderer.drawValues(canvas);
  mLegendRenderer.renderLegend(canvas);
  drawMarkers(canvas);
  drawDescription(canvas);
  if (mLogEnabled) {
    long drawtime=(System.currentTimeMillis() - starttime);
    totalTime+=drawtime;
    drawCycles+=1;
    long average=totalTime / drawCycles;
    Log.i(LOG_TAG,"String_Node_Str" + drawtime + "String_Node_Str"+ average+ "String_Node_Str"+ drawCycles);
  }
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  if (mData == null)   return;
  long starttime=System.currentTimeMillis();
  calcModulus();
  mXAxisRenderer.calcXBounds(this,mXAxis.mAxisLabelModulus);
  mRenderer.calcXBounds(this,mXAxis.mAxisLabelModulus);
  drawGridBackground(canvas);
  if (mAxisLeft.isEnabled())   mAxisRendererLeft.computeAxis(mAxisLeft.mAxisMinimum,mAxisLeft.mAxisMaximum);
  if (mAxisRight.isEnabled())   mAxisRendererRight.computeAxis(mAxisRight.mAxisMinimum,mAxisRight.mAxisMaximum);
  mXAxisRenderer.renderAxisLine(canvas);
  mAxisRendererLeft.renderAxisLine(canvas);
  mAxisRendererRight.renderAxisLine(canvas);
  if (mAutoScaleMinMaxEnabled) {
    final int lowestVisibleXIndex=getLowestVisibleXIndex();
    final int highestVisibleXIndex=getHighestVisibleXIndex();
    if (mAutoScaleLastLowestVisibleXIndex == null || mAutoScaleLastLowestVisibleXIndex != lowestVisibleXIndex || mAutoScaleLastHighestVisibleXIndex == null || mAutoScaleLastHighestVisibleXIndex != highestVisibleXIndex) {
      calcMinMax();
      calculateOffsets();
      mAutoScaleLastLowestVisibleXIndex=lowestVisibleXIndex;
      mAutoScaleLastHighestVisibleXIndex=highestVisibleXIndex;
    }
  }
  int clipRestoreCount=canvas.save();
  canvas.clipRect(mViewPortHandler.getContentRect());
  mXAxisRenderer.renderGridLines(canvas);
  mAxisRendererLeft.renderGridLines(canvas);
  mAxisRendererRight.renderGridLines(canvas);
  if (mXAxis.isDrawLimitLinesBehindDataEnabled())   mXAxisRenderer.renderLimitLines(canvas);
  if (mAxisLeft.isDrawLimitLinesBehindDataEnabled())   mAxisRendererLeft.renderLimitLines(canvas);
  if (mAxisRight.isDrawLimitLinesBehindDataEnabled())   mAxisRendererRight.renderLimitLines(canvas);
  mRenderer.drawData(canvas);
  if (valuesToHighlight())   mRenderer.drawHighlighted(canvas,mIndicesToHighlight);
  canvas.restoreToCount(clipRestoreCount);
  mRenderer.drawExtras(canvas);
  if (!mXAxis.isDrawLimitLinesBehindDataEnabled())   mXAxisRenderer.renderLimitLines(canvas);
  if (!mAxisLeft.isDrawLimitLinesBehindDataEnabled())   mAxisRendererLeft.renderLimitLines(canvas);
  if (!mAxisRight.isDrawLimitLinesBehindDataEnabled())   mAxisRendererRight.renderLimitLines(canvas);
  mXAxisRenderer.renderAxisLabels(canvas);
  mAxisRendererLeft.renderAxisLabels(canvas);
  mAxisRendererRight.renderAxisLabels(canvas);
  mRenderer.drawValues(canvas);
  mLegendRenderer.renderLegend(canvas);
  drawMarkers(canvas);
  drawDescription(canvas);
  if (mLogEnabled) {
    long drawtime=(System.currentTimeMillis() - starttime);
    totalTime+=drawtime;
    drawCycles+=1;
    long average=totalTime / drawCycles;
    Log.i(LOG_TAG,"String_Node_Str" + drawtime + "String_Node_Str"+ average+ "String_Node_Str"+ drawCycles);
  }
}