Program: 18355
Project: 18355
Buggy source:
@Override public void drawValues(Canvas c){
  BubbleData bubbleData=mChart.getBubbleData();
  if (bubbleData == null)   return;
  if (bubbleData.getYValCount() < (int)(Math.ceil((float)(mChart.getMaxVisibleCount()) * mViewPortHandler.getScaleX()))) {
    final List<BubbleDataSet> dataSets=bubbleData.getDataSets();
    float lineHeight=Utils.calcTextHeight(mValuePaint,"String_Node_Str");
    for (    BubbleDataSet dataSet : dataSets) {
      if (!dataSet.isDrawValuesEnabled())       continue;
      applyValueTextStyle(dataSet);
      final float phaseX=mAnimator.getPhaseX();
      final float phaseY=mAnimator.getPhaseY();
      final float alpha=phaseX == 1 ? phaseY : phaseX;
      int valueTextColor=dataSet.getValueTextColor();
      valueTextColor=Color.argb(Math.round(255.f * alpha),Color.red(valueTextColor),Color.green(valueTextColor),Color.blue(valueTextColor));
      mValuePaint.setColor(valueTextColor);
      final List<BubbleEntry> entries=dataSet.getYVals();
      Entry entryFrom=dataSet.getEntryForXIndex(mMinX);
      Entry entryTo=dataSet.getEntryForXIndex(mMaxX);
      int minx=dataSet.getEntryPosition(entryFrom);
      int maxx=Math.min(dataSet.getEntryPosition(entryTo) + 1,dataSet.getEntryCount());
      final float[] positions=mChart.getTransformer(dataSet.getAxisDependency()).generateTransformedValuesBubble(entries,phaseX,phaseY,minx,maxx);
      for (int j=0; j < positions.length; j+=2) {
        float x=positions[j];
        float y=positions[j + 1];
        if (!mViewPortHandler.isInBoundsRight(x))         break;
        if ((!mViewPortHandler.isInBoundsLeft(x) || !mViewPortHandler.isInBoundsY(y)))         continue;
        final BubbleEntry entry=entries.get(j / 2 + minx);
        final float val=entry.getSize();
        c.drawText(dataSet.getValueFormatter().getFormattedValue(val),x,y + (0.5f * lineHeight),mValuePaint);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void drawValues(Canvas c){
  BubbleData bubbleData=mChart.getBubbleData();
  if (bubbleData == null)   return;
  if (bubbleData.getYValCount() < (int)(Math.ceil((float)(mChart.getMaxVisibleCount()) * mViewPortHandler.getScaleX()))) {
    final List<BubbleDataSet> dataSets=bubbleData.getDataSets();
    float lineHeight=Utils.calcTextHeight(mValuePaint,"String_Node_Str");
    for (    BubbleDataSet dataSet : dataSets) {
      if (!dataSet.isDrawValuesEnabled() || dataSet.getEntryCount() == 0)       continue;
      applyValueTextStyle(dataSet);
      final float phaseX=mAnimator.getPhaseX();
      final float phaseY=mAnimator.getPhaseY();
      final float alpha=phaseX == 1 ? phaseY : phaseX;
      int valueTextColor=dataSet.getValueTextColor();
      valueTextColor=Color.argb(Math.round(255.f * alpha),Color.red(valueTextColor),Color.green(valueTextColor),Color.blue(valueTextColor));
      mValuePaint.setColor(valueTextColor);
      final List<BubbleEntry> entries=dataSet.getYVals();
      Entry entryFrom=dataSet.getEntryForXIndex(mMinX);
      Entry entryTo=dataSet.getEntryForXIndex(mMaxX);
      int minx=dataSet.getEntryPosition(entryFrom);
      int maxx=Math.min(dataSet.getEntryPosition(entryTo) + 1,dataSet.getEntryCount());
      final float[] positions=mChart.getTransformer(dataSet.getAxisDependency()).generateTransformedValuesBubble(entries,phaseX,phaseY,minx,maxx);
      for (int j=0; j < positions.length; j+=2) {
        float x=positions[j];
        float y=positions[j + 1];
        if (!mViewPortHandler.isInBoundsRight(x))         break;
        if ((!mViewPortHandler.isInBoundsLeft(x) || !mViewPortHandler.isInBoundsY(y)))         continue;
        final BubbleEntry entry=entries.get(j / 2 + minx);
        final float val=entry.getSize();
        c.drawText(dataSet.getValueFormatter().getFormattedValue(val),x,y + (0.5f * lineHeight),mValuePaint);
      }
    }
  }
}