Program: 27029
Project: 27029
Buggy source:
@Override protected void drawData(){
  ArrayList<DataSet> dataSets=mCurrentData.getDataSets();
  for (int i=0; i < mCurrentData.getDataSetCount(); i++) {
    DataSet dataSet=dataSets.get(i);
    ArrayList<Entry> entries=dataSet.getYVals();
    float[] pos=generateTransformedValues(entries,0f);
    ArrayList<Integer> colors=mCt.getDataSetColors(i % mCt.getColors().size());
    ScatterShape shape=mScatterShapes[i % mScatterShapes.length];
    for (int j=0; j < pos.length; j+=2) {
      mRenderPaint.setColor(colors.get(j % colors.size()));
      if (isOffContentRight(pos[j]))       break;
      float shapeHalf=mShapeSize / 2f;
      if (j != 0 && isOffContentLeft(pos[j - 1]) && isOffContentTop(pos[j + 1]) && isOffContentBottom(pos[j + 1]))       continue;
      if (shape == ScatterShape.SQUARE) {
        mDrawCanvas.drawRect(pos[j] - shapeHalf,pos[j + 1] - shapeHalf,pos[j] + shapeHalf,pos[j + 1] + shapeHalf,mRenderPaint);
      }
 else       if (shape == ScatterShape.CIRCLE) {
        mDrawCanvas.drawCircle(pos[j],pos[j + 1],mShapeSize / 2f,mRenderPaint);
      }
 else       if (shape == ScatterShape.CROSS) {
        mDrawCanvas.drawLine(pos[j] - shapeHalf,pos[j + 1],pos[j] + shapeHalf,pos[j + 1],mRenderPaint);
        mDrawCanvas.drawLine(pos[j],pos[j + 1] - shapeHalf,pos[j],pos[j + 1] + shapeHalf,mRenderPaint);
      }
 else       if (shape == ScatterShape.TRIANGLE) {
        Path tri=new Path();
        tri.moveTo(pos[j],pos[j + 1] - shapeHalf);
        tri.lineTo(pos[j] + shapeHalf,pos[j + 1] + shapeHalf);
        tri.lineTo(pos[j] - shapeHalf,pos[j + 1] + shapeHalf);
        tri.close();
        mDrawCanvas.drawPath(tri,mRenderPaint);
      }
 else       if (shape == ScatterShape.CUSTOM) {
        if (mCustomScatterPath == null)         return;
        transformPath(mCustomScatterPath);
        mDrawCanvas.drawPath(mCustomScatterPath,mRenderPaint);
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void drawData(){
  ArrayList<DataSet> dataSets=mCurrentData.getDataSets();
  float shapeHalf=mShapeSize / 2f;
  for (int i=0; i < mCurrentData.getDataSetCount(); i++) {
    DataSet dataSet=dataSets.get(i);
    ArrayList<Entry> entries=dataSet.getYVals();
    float[] pos=generateTransformedValues(entries,0f);
    ArrayList<Integer> colors=mCt.getDataSetColors(i % mCt.getColors().size());
    ScatterShape shape=mScatterShapes[i % mScatterShapes.length];
    for (int j=0; j < pos.length; j+=2) {
      mRenderPaint.setColor(colors.get(j % colors.size()));
      if (isOffContentRight(pos[j]))       break;
      if (j != 0 && isOffContentLeft(pos[j - 1]) && isOffContentTop(pos[j + 1]) && isOffContentBottom(pos[j + 1]))       continue;
      if (shape == ScatterShape.SQUARE) {
        mDrawCanvas.drawRect(pos[j] - shapeHalf,pos[j + 1] - shapeHalf,pos[j] + shapeHalf,pos[j + 1] + shapeHalf,mRenderPaint);
      }
 else       if (shape == ScatterShape.CIRCLE) {
        mDrawCanvas.drawCircle(pos[j],pos[j + 1],mShapeSize / 2f,mRenderPaint);
      }
 else       if (shape == ScatterShape.CROSS) {
        mDrawCanvas.drawLine(pos[j] - shapeHalf,pos[j + 1],pos[j] + shapeHalf,pos[j + 1],mRenderPaint);
        mDrawCanvas.drawLine(pos[j],pos[j + 1] - shapeHalf,pos[j],pos[j + 1] + shapeHalf,mRenderPaint);
      }
 else       if (shape == ScatterShape.TRIANGLE) {
        Path tri=new Path();
        tri.moveTo(pos[j],pos[j + 1] - shapeHalf);
        tri.lineTo(pos[j] + shapeHalf,pos[j + 1] + shapeHalf);
        tri.lineTo(pos[j] - shapeHalf,pos[j + 1] + shapeHalf);
        tri.close();
        mDrawCanvas.drawPath(tri,mRenderPaint);
      }
 else       if (shape == ScatterShape.CUSTOM) {
        if (mCustomScatterPath == null)         return;
        transformPath(mCustomScatterPath);
        mDrawCanvas.drawPath(mCustomScatterPath,mRenderPaint);
      }
    }
  }
}