Program: 18784
Project: 18784
Buggy source:
@Override protected void drawValues(){
  if (mDrawYValues && mCurrentData.getYValCount() < mMaxVisibleCount * mScaleX) {
    ArrayList<BarDataSet> dataSets=((BarData)mCurrentData).getDataSets();
    float offset=0f;
    if (mDrawValueAboveBar)     offset=-Utils.convertDpToPixel(5);
 else     offset=Utils.calcTextHeight(mValuePaint,"String_Node_Str") * 1.5f;
    for (int i=0; i < mCurrentData.getDataSetCount(); i++) {
      BarDataSet dataSet=dataSets.get(i);
      ArrayList<BarEntry> entries=dataSet.getYVals();
      float[] valuePoints=generateTransformedValuesBarChart(entries,i);
      if (!mDrawValuesForWholeStack) {
        for (int j=0; j < valuePoints.length * mPhaseX; j+=2) {
          if (isOffContentRight(valuePoints[j]))           break;
          if (isOffContentLeft(valuePoints[j]) || isOffContentTop(valuePoints[j + 1]) || isOffContentBottom(valuePoints[j + 1]))           continue;
          float val=entries.get(j / 2).getVal();
          drawValue(mValueFormatter.getFormattedValue(val),valuePoints[j],valuePoints[j + 1] + offset);
        }
      }
 else {
        for (int j=0; j < (valuePoints.length - 1) * mPhaseX; j+=2) {
          if (isOffContentRight(valuePoints[j]))           break;
          if (isOffContentLeft(valuePoints[j]) || isOffContentTop(valuePoints[j + 1]) || isOffContentBottom(valuePoints[j + 1]))           continue;
          BarEntry e=entries.get(j / 2);
          float[] vals=e.getVals();
          if (vals == null) {
            drawValue(mValueFormatter.getFormattedValue(e.getVal()),valuePoints[j],valuePoints[j + 1] + offset);
          }
 else {
            float[] transformed=new float[vals.length * 2];
            int cnt=0;
            float add=e.getVal();
            for (int k=0; k < transformed.length; k+=2) {
              add-=vals[cnt];
              transformed[k + 1]=(vals[cnt] + add) * mPhaseY;
              cnt++;
            }
            transformPointArray(transformed);
            for (int k=0; k < transformed.length; k+=2) {
              drawValue(mValueFormatter.getFormattedValue(vals[k / 2]),valuePoints[j],transformed[k + 1] + offset);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void drawValues(){
  if (mDrawYValues && mCurrentData.getYValCount() < mMaxVisibleCount * mScaleX) {
    ArrayList<BarDataSet> dataSets=((BarData)mCurrentData).getDataSets();
    float posOffset=0f;
    float negOffset=0f;
    if (mDrawValueAboveBar) {
      posOffset=-Utils.convertDpToPixel(5);
      negOffset=Utils.calcTextHeight(mValuePaint,"String_Node_Str") * 1.5f;
    }
 else {
      posOffset=Utils.calcTextHeight(mValuePaint,"String_Node_Str") * 1.5f;
      negOffset=-Utils.convertDpToPixel(5);
    }
    for (int i=0; i < mCurrentData.getDataSetCount(); i++) {
      BarDataSet dataSet=dataSets.get(i);
      ArrayList<BarEntry> entries=dataSet.getYVals();
      float[] valuePoints=generateTransformedValuesBarChart(entries,i);
      if (!mDrawValuesForWholeStack) {
        for (int j=0; j < valuePoints.length * mPhaseX; j+=2) {
          if (isOffContentRight(valuePoints[j]))           break;
          if (isOffContentLeft(valuePoints[j]) || isOffContentTop(valuePoints[j + 1]) || isOffContentBottom(valuePoints[j + 1]))           continue;
          float val=entries.get(j / 2).getVal();
          drawValue(val,valuePoints[j],valuePoints[j + 1] + (val >= 0 ? posOffset : negOffset));
        }
      }
 else {
        for (int j=0; j < (valuePoints.length - 1) * mPhaseX; j+=2) {
          if (isOffContentRight(valuePoints[j]))           break;
          if (isOffContentLeft(valuePoints[j]) || isOffContentTop(valuePoints[j + 1]) || isOffContentBottom(valuePoints[j + 1]))           continue;
          BarEntry e=entries.get(j / 2);
          float[] vals=e.getVals();
          if (vals == null) {
            drawValue(e.getVal(),valuePoints[j],valuePoints[j + 1] + (e.getVal() >= 0 ? posOffset : negOffset));
          }
 else {
            float[] transformed=new float[vals.length * 2];
            int cnt=0;
            float add=e.getVal();
            for (int k=0; k < transformed.length; k+=2) {
              add-=vals[cnt];
              transformed[k + 1]=(vals[cnt] + add) * mPhaseY;
              cnt++;
            }
            transformPointArray(transformed);
            for (int k=0; k < transformed.length; k+=2) {
              drawValue(vals[k / 2],valuePoints[j],transformed[k + 1] + (vals[k / 2] >= 0 ? posOffset : negOffset));
            }
          }
        }
      }
    }
  }
}