Program: 26594
Project: 26594
Buggy source:
protected void drawDataSet(Canvas c,BarDataSet dataSet,int index){
  Transformer trans=mChart.getTransformer(dataSet.getAxisDependency());
  calcXBounds(trans);
  mShadowPaint.setColor(dataSet.getBarShadowColor());
  float phaseX=mAnimator.getPhaseX();
  float phaseY=mAnimator.getPhaseY();
  List<BarEntry> entries=dataSet.getYVals();
  BarBuffer buffer=mBarBuffers[index];
  buffer.setPhases(phaseX,phaseY);
  buffer.setBarSpace(dataSet.getBarSpace());
  buffer.setDataSet(index);
  buffer.feed(entries);
  trans.pointValuesToPixel(buffer.buffer);
  if (dataSet.getColors().size() > 1) {
    for (int j=0; j < buffer.size(); j+=4) {
      if (!mViewPortHandler.isInBoundsLeft(buffer.buffer[j + 2]))       continue;
      if (!mViewPortHandler.isInBoundsRight(buffer.buffer[j]))       break;
      if (mChart.isDrawBarShadowEnabled()) {
        c.drawRect(buffer.buffer[j],mViewPortHandler.contentTop(),buffer.buffer[j + 2],mViewPortHandler.contentBottom(),mShadowPaint);
      }
      mRenderPaint.setColor(dataSet.getColor(j / 4));
      c.drawRect(buffer.buffer[j],buffer.buffer[j + 1],buffer.buffer[j + 2],buffer.buffer[j + 3],mRenderPaint);
    }
  }
 else {
    mRenderPaint.setColor(dataSet.getColor());
    for (int j=0; j < buffer.size(); j+=4) {
      if (!mViewPortHandler.isInBoundsLeft(buffer.buffer[j + 2]))       continue;
      if (!mViewPortHandler.isInBoundsRight(buffer.buffer[j]))       break;
      if (mChart.isDrawBarShadowEnabled()) {
        c.drawRect(buffer.buffer[j],mViewPortHandler.contentTop(),buffer.buffer[j + 2],mViewPortHandler.contentBottom(),mShadowPaint);
      }
      c.drawRect(buffer.buffer[j],buffer.buffer[j + 1],buffer.buffer[j + 2],buffer.buffer[j + 3],mRenderPaint);
    }
  }
}

Fixed version (ground truth):
protected void drawDataSet(Canvas c,BarDataSet dataSet,int index){
  Transformer trans=mChart.getTransformer(dataSet.getAxisDependency());
  calcXBounds(trans);
  mShadowPaint.setColor(dataSet.getBarShadowColor());
  float phaseX=mAnimator.getPhaseX();
  float phaseY=mAnimator.getPhaseY();
  List<BarEntry> entries=dataSet.getYVals();
  BarBuffer buffer=mBarBuffers[index];
  buffer.setPhases(phaseX,phaseY);
  buffer.setBarSpace(dataSet.getBarSpace());
  buffer.setDataSet(index);
  buffer.setInverted(mChart.isInverted(dataSet.getAxisDependency()));
  buffer.feed(entries);
  trans.pointValuesToPixel(buffer.buffer);
  if (dataSet.getColors().size() > 1) {
    for (int j=0; j < buffer.size(); j+=4) {
      if (!mViewPortHandler.isInBoundsLeft(buffer.buffer[j + 2]))       continue;
      if (!mViewPortHandler.isInBoundsRight(buffer.buffer[j]))       break;
      if (mChart.isDrawBarShadowEnabled()) {
        c.drawRect(buffer.buffer[j],mViewPortHandler.contentTop(),buffer.buffer[j + 2],mViewPortHandler.contentBottom(),mShadowPaint);
      }
      mRenderPaint.setColor(dataSet.getColor(j / 4));
      c.drawRect(buffer.buffer[j],buffer.buffer[j + 1],buffer.buffer[j + 2],buffer.buffer[j + 3],mRenderPaint);
    }
  }
 else {
    mRenderPaint.setColor(dataSet.getColor());
    for (int j=0; j < buffer.size(); j+=4) {
      if (!mViewPortHandler.isInBoundsLeft(buffer.buffer[j + 2]))       continue;
      if (!mViewPortHandler.isInBoundsRight(buffer.buffer[j]))       break;
      if (mChart.isDrawBarShadowEnabled()) {
        c.drawRect(buffer.buffer[j],mViewPortHandler.contentTop(),buffer.buffer[j + 2],mViewPortHandler.contentBottom(),mShadowPaint);
      }
      c.drawRect(buffer.buffer[j],buffer.buffer[j + 1],buffer.buffer[j + 2],buffer.buffer[j + 3],mRenderPaint);
    }
  }
}