Program: 26583
Project: 26583
Buggy source:
@Override public void drawValues(Canvas c){
  PointF center=mChart.getCenterCircleBox();
  float r=mChart.getRadius();
  float rotationAngle=mChart.getRotationAngle();
  float[] drawAngles=mChart.getDrawAngles();
  float[] absoluteAngles=mChart.getAbsoluteAngles();
  float off=r / 3f;
  if (mChart.isDrawHoleEnabled()) {
    off=(r - (r / 100f * mChart.getHoleRadius())) / 2f;
  }
  r-=off;
  PieData data=mChart.getData();
  List<PieDataSet> dataSets=data.getDataSets();
  int cnt=0;
  for (int i=0; i < dataSets.size(); i++) {
    PieDataSet dataSet=dataSets.get(i);
    if (!dataSet.isDrawValuesEnabled())     continue;
    applyValueTextStyle(dataSet);
    List<Entry> entries=dataSet.getYVals();
    for (int j=0; j < entries.size() * mAnimator.getPhaseX(); j++) {
      float offset=drawAngles[cnt] / 2;
      float x=(float)(r * Math.cos(Math.toRadians((rotationAngle + absoluteAngles[cnt] - offset) * mAnimator.getPhaseY())) + center.x);
      float y=(float)(r * Math.sin(Math.toRadians((rotationAngle + absoluteAngles[cnt] - offset) * mAnimator.getPhaseY())) + center.y);
      float value=mChart.isUsePercentValuesEnabled() ? entries.get(j).getVal() / mChart.getYValueSum() * 100f : entries.get(j).getVal();
      String val=dataSet.getValueFormatter().getFormattedValue(value);
      boolean drawXVals=mChart.isDrawSliceTextEnabled();
      boolean drawYVals=dataSet.isDrawValuesEnabled();
      if (drawXVals && drawYVals) {
        float lineHeight=(mValuePaint.ascent() + mValuePaint.descent()) * 1.6f;
        y-=lineHeight / 2;
        c.drawText(val,x,y,mValuePaint);
        if (j < data.getXValCount())         c.drawText(data.getXVals().get(j),x,y + lineHeight,mValuePaint);
      }
 else       if (drawXVals && !drawYVals) {
        if (j < data.getXValCount())         c.drawText(data.getXVals().get(j),x,y,mValuePaint);
      }
 else       if (!drawXVals && drawYVals) {
        c.drawText(val,x,y,mValuePaint);
      }
      cnt++;
    }
  }
}

Fixed version (ground truth):
@Override public void drawValues(Canvas c){
  PointF center=mChart.getCenterCircleBox();
  float r=mChart.getRadius();
  float rotationAngle=mChart.getRotationAngle();
  float[] drawAngles=mChart.getDrawAngles();
  float[] absoluteAngles=mChart.getAbsoluteAngles();
  float off=r / 3f;
  if (mChart.isDrawHoleEnabled()) {
    off=(r - (r / 100f * mChart.getHoleRadius())) / 2f;
  }
  r-=off;
  PieData data=mChart.getData();
  List<PieDataSet> dataSets=data.getDataSets();
  boolean drawXVals=mChart.isDrawSliceTextEnabled();
  int cnt=0;
  for (int i=0; i < dataSets.size(); i++) {
    PieDataSet dataSet=dataSets.get(i);
    if (!dataSet.isDrawValuesEnabled() && !drawXVals)     continue;
    applyValueTextStyle(dataSet);
    List<Entry> entries=dataSet.getYVals();
    for (int j=0; j < entries.size() * mAnimator.getPhaseX(); j++) {
      float offset=drawAngles[cnt] / 2;
      float x=(float)(r * Math.cos(Math.toRadians((rotationAngle + absoluteAngles[cnt] - offset) * mAnimator.getPhaseY())) + center.x);
      float y=(float)(r * Math.sin(Math.toRadians((rotationAngle + absoluteAngles[cnt] - offset) * mAnimator.getPhaseY())) + center.y);
      float value=mChart.isUsePercentValuesEnabled() ? entries.get(j).getVal() / mChart.getYValueSum() * 100f : entries.get(j).getVal();
      String val=dataSet.getValueFormatter().getFormattedValue(value);
      boolean drawYVals=dataSet.isDrawValuesEnabled();
      if (drawXVals && drawYVals) {
        float lineHeight=(mValuePaint.ascent() + mValuePaint.descent()) * 1.6f;
        y-=lineHeight / 2;
        c.drawText(val,x,y,mValuePaint);
        if (j < data.getXValCount())         c.drawText(data.getXVals().get(j),x,y + lineHeight,mValuePaint);
      }
 else       if (drawXVals && !drawYVals) {
        if (j < data.getXValCount())         c.drawText(data.getXVals().get(j),x,y,mValuePaint);
      }
 else       if (!drawXVals && drawYVals) {
        c.drawText(val,x,y,mValuePaint);
      }
      cnt++;
    }
  }
}