nus-yam/ex-repair huggingface dataset:
Program: 18285
Project: 18285
Buggy source:
public void setData(){
  float mult=150;
  int cnt=9;
  ArrayList<Entry> yVals1=new ArrayList<Entry>();
  ArrayList<Entry> yVals2=new ArrayList<Entry>();
  for (int i=0; i < cnt; i++) {
    yVals1.add(new Entry((float)(Math.random() * mult) + mult / 2,i));
  }
  for (int i=0; i < cnt; i++) {
    yVals2.add(new Entry((float)(Math.random() * mult) + mult / 2,i));
  }
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < cnt; i++)   xVals.add(mParties[i % mParties.length]);
  RadarDataSet set1=new RadarDataSet(yVals1,"String_Node_Str");
  set1.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);
  set1.setDrawFilled(true);
  set1.setLineWidth(2f);
  RadarDataSet set2=new RadarDataSet(yVals2,"String_Node_Str");
  set2.setColor(ColorTemplate.VORDIPLOM_COLORS[4]);
  set2.setDrawFilled(true);
  set2.setLineWidth(2f);
  ArrayList<RadarDataSet> sets=new ArrayList<RadarDataSet>();
  sets.add(set1);
  sets.add(set2);
  RadarData data=new RadarData(xVals,sets);
  data.setValueTypeface(tf);
  data.setValueTextSize(8f);
  data.setDrawValues(false);
  mChart.setData(data);
  mChart.invalidate();
}

Fixed version (ground truth):
public void setData(){
  float mult=150;
  int cnt=9;
  ArrayList<Entry> yVals1=new ArrayList<Entry>();
  ArrayList<Entry> yVals2=new ArrayList<Entry>();
  for (int i=0; i < cnt; i++) {
    yVals1.add(new Entry((float)(Math.random() * mult) + mult / 2,i));
  }
  for (int i=0; i < cnt; i++) {
    yVals2.add(new Entry((float)(Math.random() * mult) + mult / 2,i));
  }
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < cnt; i++)   xVals.add(mParties[i % mParties.length]);
  RadarDataSet set1=new RadarDataSet(yVals1,"String_Node_Str");
  set1.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);
  set1.setDrawFilled(true);
  set1.setLineWidth(2f);
  RadarDataSet set2=new RadarDataSet(yVals2,"String_Node_Str");
  set2.setColor(ColorTemplate.VORDIPLOM_COLORS[4]);
  set2.setDrawFilled(true);
  set2.setLineWidth(2f);
  ArrayList<IRadarDataSet> sets=new ArrayList<IRadarDataSet>();
  sets.add(set1);
  sets.add(set2);
  RadarData data=new RadarData(xVals,sets);
  data.setValueTypeface(tf);
  data.setValueTextSize(8f);
  data.setDrawValues(false);
  mChart.setData(data);
  mChart.invalidate();
}
Program: 18287
Project: 18287
Buggy source:
/** 
 * Set to true if the DataSet should be drawn filled (surface), and not just as a line, disabling this will give great performance boost! default: false
 * @param filled
 */
public void setDrawFilled(boolean filled){
  mDrawFilled=filled;
}

Fixed version (ground truth):
@Override public void setDrawFilled(boolean filled){
  mDrawFilled=filled;
}
Program: 18288
Project: 18288
Buggy source:
@Override public Entry getEntryForXIndex(int x){
  return null;
}

Fixed version (ground truth):
@Override public Entry getEntryForXIndex(int xIndex){
  return null;
}
Program: 18289
Project: 18289
Buggy source:
@Override public void drawData(Canvas c){
  int width=(int)mViewPortHandler.getChartWidth();
  int height=(int)mViewPortHandler.getChartHeight();
  if (mDrawBitmap == null || (mDrawBitmap.getWidth() != width) || (mDrawBitmap.getHeight() != height)) {
    if (width > 0 && height > 0) {
      mDrawBitmap=Bitmap.createBitmap(width,height,Bitmap.Config.ARGB_4444);
      mBitmapCanvas=new Canvas(mDrawBitmap);
    }
 else     return;
  }
  mDrawBitmap.eraseColor(Color.TRANSPARENT);
  PieData pieData=mChart.getData();
  for (  PieDataSet set : pieData.getDataSets()) {
    if (set.isVisible() && set.getEntryCount() > 0)     drawDataSet(c,set);
  }
}

Fixed version (ground truth):
@Override public void drawData(Canvas c){
  int width=(int)mViewPortHandler.getChartWidth();
  int height=(int)mViewPortHandler.getChartHeight();
  if (mDrawBitmap == null || (mDrawBitmap.getWidth() != width) || (mDrawBitmap.getHeight() != height)) {
    if (width > 0 && height > 0) {
      mDrawBitmap=Bitmap.createBitmap(width,height,Bitmap.Config.ARGB_4444);
      mBitmapCanvas=new Canvas(mDrawBitmap);
    }
 else     return;
  }
  mDrawBitmap.eraseColor(Color.TRANSPARENT);
  PieData pieData=mChart.getData();
  for (  IPieDataSet set : pieData.getDataSets()) {
    if (set.isVisible() && set.getEntryCount() > 0)     drawDataSet(c,set);
  }
}
Program: 18291
Project: 18291
Buggy source:
/** 
 * This gives all pie-slices a rounded edge.
 * @param c
 */
protected void drawRoundedSlices(Canvas c){
  if (!mChart.isDrawRoundedSlicesEnabled())   return;
  PieDataSet dataSet=mChart.getData().getDataSet();
  if (!dataSet.isVisible())   return;
  PointF center=mChart.getCenterCircleBox();
  float r=mChart.getRadius();
  float circleRadius=(r - (r * mChart.getHoleRadius() / 100f)) / 2f;
  List<Entry> entries=dataSet.getYVals();
  float[] drawAngles=mChart.getDrawAngles();
  float angle=mChart.getRotationAngle();
  for (int j=0; j < entries.size(); j++) {
    float newangle=drawAngles[j];
    Entry e=entries.get(j);
    if ((Math.abs(e.getVal()) > 0.000001)) {
      float x=(float)((r - circleRadius) * Math.cos(Math.toRadians((angle + newangle) * mAnimator.getPhaseY())) + center.x);
      float y=(float)((r - circleRadius) * Math.sin(Math.toRadians((angle + newangle) * mAnimator.getPhaseY())) + center.y);
      mRenderPaint.setColor(dataSet.getColor(j));
      mBitmapCanvas.drawCircle(x,y,circleRadius,mRenderPaint);
    }
    angle+=newangle * mAnimator.getPhaseX();
  }
}

Fixed version (ground truth):
/** 
 * This gives all pie-slices a rounded edge.
 * @param c
 */
protected void drawRoundedSlices(Canvas c){
  if (!mChart.isDrawRoundedSlicesEnabled())   return;
  IPieDataSet dataSet=mChart.getData().getDataSet();
  if (!dataSet.isVisible())   return;
  PointF center=mChart.getCenterCircleBox();
  float r=mChart.getRadius();
  float circleRadius=(r - (r * mChart.getHoleRadius() / 100f)) / 2f;
  List<Entry> entries=dataSet.getYVals();
  float[] drawAngles=mChart.getDrawAngles();
  float angle=mChart.getRotationAngle();
  for (int j=0; j < entries.size(); j++) {
    float newangle=drawAngles[j];
    Entry e=entries.get(j);
    if ((Math.abs(e.getVal()) > 0.000001)) {
      float x=(float)((r - circleRadius) * Math.cos(Math.toRadians((angle + newangle) * mAnimator.getPhaseY())) + center.x);
      float y=(float)((r - circleRadius) * Math.sin(Math.toRadians((angle + newangle) * mAnimator.getPhaseY())) + center.y);
      mRenderPaint.setColor(dataSet.getColor(j));
      mBitmapCanvas.drawCircle(x,y,circleRadius,mRenderPaint);
    }
    angle+=newangle * mAnimator.getPhaseX();
  }
}
Program: 18292
Project: 18292
Buggy source:
protected void drawDataSet(Canvas c,PieDataSet dataSet){
  float angle=mChart.getRotationAngle();
  List<Entry> entries=dataSet.getYVals();
  float[] drawAngles=mChart.getDrawAngles();
  for (int j=0; j < entries.size(); j++) {
    float newangle=drawAngles[j];
    float sliceSpace=dataSet.getSliceSpace();
    Entry e=entries.get(j);
    if ((Math.abs(e.getVal()) > 0.000001)) {
      if (!mChart.needsHighlight(e.getXIndex(),mChart.getData().getIndexOfDataSet(dataSet))) {
        mRenderPaint.setColor(dataSet.getColor(j));
        mBitmapCanvas.drawArc(mChart.getCircleBox(),(angle + sliceSpace / 2f) * mAnimator.getPhaseY(),(newangle - sliceSpace / 2f) * mAnimator.getPhaseY(),true,mRenderPaint);
      }
    }
    angle+=newangle * mAnimator.getPhaseX();
  }
}

Fixed version (ground truth):
protected void drawDataSet(Canvas c,IPieDataSet dataSet){
  float angle=mChart.getRotationAngle();
  List<Entry> entries=dataSet.getYVals();
  float[] drawAngles=mChart.getDrawAngles();
  for (int j=0; j < entries.size(); j++) {
    float newangle=drawAngles[j];
    float sliceSpace=dataSet.getSliceSpace();
    Entry e=entries.get(j);
    if ((Math.abs(e.getVal()) > 0.000001)) {
      if (!mChart.needsHighlight(e.getXIndex(),mChart.getData().getIndexOfDataSet(dataSet))) {
        mRenderPaint.setColor(dataSet.getColor(j));
        mBitmapCanvas.drawArc(mChart.getCircleBox(),(angle + sliceSpace / 2f) * mAnimator.getPhaseY(),(newangle - sliceSpace / 2f) * mAnimator.getPhaseY(),true,mRenderPaint);
      }
    }
    angle+=newangle * mAnimator.getPhaseX();
  }
}
Program: 18293
Project: 18293
Buggy source:
@Override public void drawHighlighted(Canvas c,Highlight[] indices){
  float rotationAngle=mChart.getRotationAngle();
  float angle=0f;
  float[] drawAngles=mChart.getDrawAngles();
  float[] absoluteAngles=mChart.getAbsoluteAngles();
  for (int i=0; i < indices.length; i++) {
    int xIndex=indices[i].getXIndex();
    if (xIndex >= drawAngles.length)     continue;
    PieDataSet set=mChart.getData().getDataSetByIndex(indices[i].getDataSetIndex());
    if (set == null || !set.isHighlightEnabled())     continue;
    if (xIndex == 0)     angle=rotationAngle;
 else     angle=rotationAngle + absoluteAngles[xIndex - 1];
    angle*=mAnimator.getPhaseY();
    float sliceDegrees=drawAngles[xIndex];
    float shift=set.getSelectionShift();
    RectF circleBox=mChart.getCircleBox();
    RectF highlighted=new RectF(circleBox.left - shift,circleBox.top - shift,circleBox.right + shift,circleBox.bottom + shift);
    mRenderPaint.setColor(set.getColor(xIndex));
    mBitmapCanvas.drawArc(highlighted,angle + set.getSliceSpace() / 2f,sliceDegrees * mAnimator.getPhaseY() - set.getSliceSpace() / 2f,true,mRenderPaint);
  }
}

Fixed version (ground truth):
@Override public void drawHighlighted(Canvas c,Highlight[] indices){
  float rotationAngle=mChart.getRotationAngle();
  float angle=0f;
  float[] drawAngles=mChart.getDrawAngles();
  float[] absoluteAngles=mChart.getAbsoluteAngles();
  for (int i=0; i < indices.length; i++) {
    int xIndex=indices[i].getXIndex();
    if (xIndex >= drawAngles.length)     continue;
    IPieDataSet set=mChart.getData().getDataSetByIndex(indices[i].getDataSetIndex());
    if (set == null || !set.isHighlightEnabled())     continue;
    if (xIndex == 0)     angle=rotationAngle;
 else     angle=rotationAngle + absoluteAngles[xIndex - 1];
    angle*=mAnimator.getPhaseY();
    float sliceDegrees=drawAngles[xIndex];
    float shift=set.getSelectionShift();
    RectF circleBox=mChart.getCircleBox();
    RectF highlighted=new RectF(circleBox.left - shift,circleBox.top - shift,circleBox.right + shift,circleBox.bottom + shift);
    mRenderPaint.setColor(set.getColor(xIndex));
    mBitmapCanvas.drawArc(highlighted,angle + set.getSliceSpace() / 2f,sliceDegrees * mAnimator.getPhaseY() - set.getSliceSpace() / 2f,true,mRenderPaint);
  }
}
Program: 18294
Project: 18294
Buggy source:
@Override public void drawData(Canvas c){
  RadarData radarData=mChart.getData();
  for (  RadarDataSet set : radarData.getDataSets()) {
    if (set.isVisible() && set.getEntryCount() > 0)     drawDataSet(c,set);
  }
}

Fixed version (ground truth):
@Override public void drawData(Canvas c){
  RadarData radarData=mChart.getData();
  for (  IRadarDataSet set : radarData.getDataSets()) {
    if (set.isVisible() && set.getEntryCount() > 0)     drawDataSet(c,set);
  }
}
Program: 18295
Project: 18295
Buggy source:
protected void drawDataSet(Canvas c,RadarDataSet dataSet){
  float sliceangle=mChart.getSliceAngle();
  float factor=mChart.getFactor();
  PointF center=mChart.getCenterOffsets();
  List<Entry> entries=dataSet.getYVals();
  Path surface=new Path();
  boolean hasMovedToPoint=false;
  for (int j=0; j < entries.size(); j++) {
    mRenderPaint.setColor(dataSet.getColor(j));
    Entry e=entries.get(j);
    PointF p=Utils.getPosition(center,(e.getVal() - mChart.getYChartMin()) * factor,sliceangle * j + mChart.getRotationAngle());
    if (Float.isNaN(p.x))     continue;
    if (!hasMovedToPoint) {
      surface.moveTo(p.x,p.y);
      hasMovedToPoint=true;
    }
 else     surface.lineTo(p.x,p.y);
  }
  surface.close();
  if (dataSet.isDrawFilledEnabled()) {
    mRenderPaint.setStyle(Paint.Style.FILL);
    mRenderPaint.setAlpha(dataSet.getFillAlpha());
    c.drawPath(surface,mRenderPaint);
    mRenderPaint.setAlpha(255);
  }
  mRenderPaint.setStrokeWidth(dataSet.getLineWidth());
  mRenderPaint.setStyle(Paint.Style.STROKE);
  if (!dataSet.isDrawFilledEnabled() || dataSet.getFillAlpha() < 255)   c.drawPath(surface,mRenderPaint);
}

Fixed version (ground truth):
protected void drawDataSet(Canvas c,IRadarDataSet dataSet){
  float sliceangle=mChart.getSliceAngle();
  float factor=mChart.getFactor();
  PointF center=mChart.getCenterOffsets();
  List<Entry> entries=dataSet.getYVals();
  Path surface=new Path();
  boolean hasMovedToPoint=false;
  for (int j=0; j < entries.size(); j++) {
    mRenderPaint.setColor(dataSet.getColor(j));
    Entry e=entries.get(j);
    PointF p=Utils.getPosition(center,(e.getVal() - mChart.getYChartMin()) * factor,sliceangle * j + mChart.getRotationAngle());
    if (Float.isNaN(p.x))     continue;
    if (!hasMovedToPoint) {
      surface.moveTo(p.x,p.y);
      hasMovedToPoint=true;
    }
 else     surface.lineTo(p.x,p.y);
  }
  surface.close();
  if (dataSet.isDrawFilledEnabled()) {
    mRenderPaint.setStyle(Paint.Style.FILL);
    mRenderPaint.setAlpha(dataSet.getFillAlpha());
    c.drawPath(surface,mRenderPaint);
    mRenderPaint.setAlpha(255);
  }
  mRenderPaint.setStrokeWidth(dataSet.getLineWidth());
  mRenderPaint.setStyle(Paint.Style.STROKE);
  if (!dataSet.isDrawFilledEnabled() || dataSet.getFillAlpha() < 255)   c.drawPath(surface,mRenderPaint);
}
Program: 18296
Project: 18296
Buggy source:
@Override public void drawValues(Canvas c){
  float sliceangle=mChart.getSliceAngle();
  float factor=mChart.getFactor();
  PointF center=mChart.getCenterOffsets();
  float yoffset=Utils.convertDpToPixel(5f);
  for (int i=0; i < mChart.getData().getDataSetCount(); i++) {
    RadarDataSet dataSet=mChart.getData().getDataSetByIndex(i);
    if (!dataSet.isDrawValuesEnabled() || dataSet.getEntryCount() == 0)     continue;
    applyValueTextStyle(dataSet);
    List<Entry> entries=dataSet.getYVals();
    for (int j=0; j < entries.size(); j++) {
      Entry entry=entries.get(j);
      PointF p=Utils.getPosition(center,(entry.getVal() - mChart.getYChartMin()) * factor,sliceangle * j + mChart.getRotationAngle());
      drawValue(c,dataSet.getValueFormatter(),entry.getVal(),entry,i,p.x,p.y - yoffset);
    }
  }
}

Fixed version (ground truth):
@Override public void drawValues(Canvas c){
  float sliceangle=mChart.getSliceAngle();
  float factor=mChart.getFactor();
  PointF center=mChart.getCenterOffsets();
  float yoffset=Utils.convertDpToPixel(5f);
  for (int i=0; i < mChart.getData().getDataSetCount(); i++) {
    IRadarDataSet dataSet=mChart.getData().getDataSetByIndex(i);
    if (!dataSet.isDrawValuesEnabled() || dataSet.getEntryCount() == 0)     continue;
    applyValueTextStyle(dataSet);
    List<Entry> entries=dataSet.getYVals();
    for (int j=0; j < entries.size(); j++) {
      Entry entry=entries.get(j);
      PointF p=Utils.getPosition(center,(entry.getVal() - mChart.getYChartMin()) * factor,sliceangle * j + mChart.getRotationAngle());
      drawValue(c,dataSet.getValueFormatter(),entry.getVal(),entry,i,p.x,p.y - yoffset);
    }
  }
}
Program: 18297
Project: 18297
Buggy source:
@Override public void drawHighlighted(Canvas c,Highlight[] indices){
  float sliceangle=mChart.getSliceAngle();
  float factor=mChart.getFactor();
  PointF center=mChart.getCenterOffsets();
  for (int i=0; i < indices.length; i++) {
    RadarDataSet set=mChart.getData().getDataSetByIndex(indices[i].getDataSetIndex());
    if (set == null || !set.isHighlightEnabled())     continue;
    int xIndex=indices[i].getXIndex();
    Entry e=set.getEntryForXIndex(xIndex);
    if (e == null || e.getXIndex() != xIndex)     continue;
    int j=set.getEntryIndex(e);
    float y=(e.getVal() - mChart.getYChartMin());
    if (Float.isNaN(y))     continue;
    PointF p=Utils.getPosition(center,y * factor,sliceangle * j + mChart.getRotationAngle());
    float[] pts=new float[]{p.x,p.y};
    drawHighlightLines(c,pts,set);
  }
}

Fixed version (ground truth):
@Override public void drawHighlighted(Canvas c,Highlight[] indices){
  float sliceangle=mChart.getSliceAngle();
  float factor=mChart.getFactor();
  PointF center=mChart.getCenterOffsets();
  for (int i=0; i < indices.length; i++) {
    IRadarDataSet set=mChart.getData().getDataSetByIndex(indices[i].getDataSetIndex());
    if (set == null || !set.isHighlightEnabled())     continue;
    int xIndex=indices[i].getXIndex();
    Entry e=set.getEntryForXIndex(xIndex);
    if (e == null || e.getXIndex() != xIndex)     continue;
    int j=set.getEntryIndex(e);
    float y=(e.getVal() - mChart.getYChartMin());
    if (Float.isNaN(y))     continue;
    PointF p=Utils.getPosition(center,y * factor,sliceangle * j + mChart.getRotationAngle());
    float[] pts=new float[]{p.x,p.y};
    drawHighlightLines(c,pts,set);
  }
}
Program: 18298
Project: 18298
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
  setContentView(R.layout.activity_linechart_noseekbar);
  mChart=(LineChart)findViewById(R.id.chart1);
  mChart.setDrawGridBackground(false);
  mChart.setDescription("String_Node_Str");
  mChart.setNoDataTextDescription("String_Node_Str");
  mChart.setTouchEnabled(true);
  mChart.setDragEnabled(true);
  mChart.setScaleEnabled(true);
  mChart.setPinchZoom(false);
  Typeface tf=Typeface.createFromAsset(getAssets(),"String_Node_Str");
  YAxis leftAxis=mChart.getAxisLeft();
  leftAxis.removeAllLimitLines();
  leftAxis.setAxisMaxValue(220f);
  leftAxis.setAxisMinValue(-50f);
  leftAxis.setStartAtZero(false);
  leftAxis.setTypeface(tf);
  mChart.getXAxis().setTypeface(tf);
  mChart.getAxisRight().setEnabled(false);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
  setContentView(R.layout.activity_barchart);
  mChart=(BarChart)findViewById(R.id.chart1);
  mChart.setDrawGridBackground(false);
  mChart.setDescription("String_Node_Str");
  mChart.setNoDataTextDescription("String_Node_Str");
  mChart.setTouchEnabled(true);
  mChart.setDragEnabled(true);
  mChart.setScaleEnabled(true);
  mChart.setPinchZoom(false);
  Typeface tf=Typeface.createFromAsset(getAssets(),"String_Node_Str");
  YAxis leftAxis=mChart.getAxisLeft();
  leftAxis.removeAllLimitLines();
  leftAxis.setAxisMaxValue(220f);
  leftAxis.setAxisMinValue(-50f);
  leftAxis.setStartAtZero(false);
  leftAxis.setTypeface(tf);
  mChart.getXAxis().setTypeface(tf);
  mChart.getAxisRight().setEnabled(false);
}
Program: 18299
Project: 18299
Buggy source:
private void setData(){
  RealmResults<RealmDemoData> result=mRealm.allObjects(RealmDemoData.class);
  RealmLineDataSet<RealmDemoData> set=new RealmLineDataSet<RealmDemoData>(result,"String_Node_Str","String_Node_Str");
  set.setValueTextSize(9f);
  ArrayList<ILineDataSet> dataSets=new ArrayList<ILineDataSet>();
  dataSets.add(set);
  LineData data=new LineData(result,"String_Node_Str",dataSets);
  mChart.setData(data);
  mChart.animateY(1400,Easing.EasingOption.EaseInOutQuart);
}

Fixed version (ground truth):
private void setData(){
  RealmResults<RealmDemoData> result=mRealm.allObjects(RealmDemoData.class);
  RealmBarDataSet<RealmDemoData> set=new RealmBarDataSet<RealmDemoData>(result,"String_Node_Str","String_Node_Str");
  set.setValueTextSize(9f);
  ArrayList<IBarDataSet> dataSets=new ArrayList<IBarDataSet>();
  dataSets.add(set);
  BarData data=new BarData(result,"String_Node_Str",dataSets);
  mChart.setData(data);
  mChart.animateY(1400,Easing.EasingOption.EaseInOutQuart);
}
Program: 18300
Project: 18300
Buggy source:
protected static List<String> toXVals(RealmResults<? extends RealmObject> result,String xValuesField){
  List<String> xVals=new ArrayList<>();
  for (  RealmObject object : result) {
    DynamicRealmObject dynamicObject=new DynamicRealmObject(object);
    xVals.add(dynamicObject.getString(xValuesField));
  }
  return xVals;
}

Fixed version (ground truth):
/** 
 * Transforms the given Realm-ResultSet into a String array by using the provided xValuesField.
 * @param result
 * @param xValuesField
 * @return
 */
protected static List<String> toXVals(RealmResults<? extends RealmObject> result,String xValuesField){
  List<String> xVals=new ArrayList<>();
  for (  RealmObject object : result) {
    DynamicRealmObject dynamicObject=new DynamicRealmObject(object);
    xVals.add(dynamicObject.getString(xValuesField));
  }
  return xVals;
}
Program: 18301
Project: 18301
Buggy source:
@Override public String[] getStackLabels(){
  return new String[0];
}

Fixed version (ground truth):
@Override public String[] getStackLabels(){
  return null;
}
Program: 18302
Project: 18302
Buggy source:
/** 
 * Returns the maximum number of bars that can be stacked upon another in this DataSet.
 * @return
 */
int getStackSize();

Fixed version (ground truth):
/** 
 * Returns the maximum number of bars that can be stacked upon another in this DataSet. This should return 1 for non stacked bars, and > 1 for stacked bars.
 * @return
 */
int getStackSize();
Program: 18303
Project: 18303
Buggy source:
@Override public void initBuffers(){
  BarData barData=mChart.getBarData();
  mBarBuffers=new BarBuffer[barData.getDataSetCount()];
  for (int i=0; i < mBarBuffers.length; i++) {
    IBarDataSet set=barData.getDataSetByIndex(i);
    mBarBuffers[i]=new BarBuffer(set.getEntryCount() * 4 * set.getStackSize(),barData.getGroupSpace(),barData.getDataSetCount(),set.isStacked());
  }
}

Fixed version (ground truth):
@Override public void initBuffers(){
  BarData barData=mChart.getBarData();
  mBarBuffers=new BarBuffer[barData.getDataSetCount()];
  for (int i=0; i < mBarBuffers.length; i++) {
    IBarDataSet set=barData.getDataSetByIndex(i);
    mBarBuffers[i]=new BarBuffer(set.getEntryCount() * 4 * (set.isStacked() ? set.getStackSize() : 1),barData.getGroupSpace(),barData.getDataSetCount(),set.isStacked());
  }
}
Program: 18304
Project: 18304
Buggy source:
@Override public void initBuffers(){
  BarData barData=mChart.getBarData();
  mBarBuffers=new HorizontalBarBuffer[barData.getDataSetCount()];
  for (int i=0; i < mBarBuffers.length; i++) {
    IBarDataSet set=barData.getDataSetByIndex(i);
    mBarBuffers[i]=new HorizontalBarBuffer(set.getEntryCount() * 4 * set.getStackSize(),barData.getGroupSpace(),barData.getDataSetCount(),set.isStacked());
  }
}

Fixed version (ground truth):
@Override public void initBuffers(){
  BarData barData=mChart.getBarData();
  mBarBuffers=new HorizontalBarBuffer[barData.getDataSetCount()];
  for (int i=0; i < mBarBuffers.length; i++) {
    IBarDataSet set=barData.getDataSetByIndex(i);
    mBarBuffers[i]=new HorizontalBarBuffer(set.getEntryCount() * 4 * (set.isStacked() ? set.getStackSize() : 1),barData.getGroupSpace(),barData.getDataSetCount(),set.isStacked());
  }
}
Program: 18305
Project: 18305
Buggy source:
@Override public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser){
  tvX.setText("String_Node_Str" + (mSeekBarX.getProgress() + 1));
  tvY.setText("String_Node_Str" + (mSeekBarY.getProgress()));
  ArrayList<BarEntry> yVals1=new ArrayList<BarEntry>();
  for (int i=0; i < mSeekBarX.getProgress() + 1; i++) {
    float mult=(mSeekBarY.getProgress() + 1);
    float val1=(float)(Math.random() * mult) + mult / 3;
    yVals1.add(new BarEntry((int)val1,i));
  }
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < mSeekBarX.getProgress() + 1; i++) {
    xVals.add((int)yVals1.get(i).getVal() + "String_Node_Str");
  }
  BarDataSet set1=new BarDataSet(yVals1,"String_Node_Str");
  set1.setColors(ColorTemplate.VORDIPLOM_COLORS);
  set1.setDrawValues(false);
  ArrayList<BarDataSet> dataSets=new ArrayList<BarDataSet>();
  dataSets.add(set1);
  BarData data=new BarData(xVals,dataSets);
  mChart.setData(data);
  mChart.invalidate();
}

Fixed version (ground truth):
@Override public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser){
  tvX.setText("String_Node_Str" + (mSeekBarX.getProgress() + 1));
  tvY.setText("String_Node_Str" + (mSeekBarY.getProgress()));
  ArrayList<BarEntry> yVals1=new ArrayList<BarEntry>();
  for (int i=0; i < mSeekBarX.getProgress() + 1; i++) {
    float mult=(mSeekBarY.getProgress() + 1);
    float val1=(float)(Math.random() * mult) + mult / 3;
    yVals1.add(new BarEntry((int)val1,i));
  }
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < mSeekBarX.getProgress() + 1; i++) {
    xVals.add((int)yVals1.get(i).getVal() + "String_Node_Str");
  }
  BarDataSet set1=new BarDataSet(yVals1,"String_Node_Str");
  set1.setColors(ColorTemplate.VORDIPLOM_COLORS);
  set1.setDrawValues(false);
  ArrayList<IBarDataSet> dataSets=new ArrayList<IBarDataSet>();
  dataSets.add(set1);
  BarData data=new BarData(xVals,dataSets);
  mChart.setData(data);
  mChart.invalidate();
}
Program: 18307
Project: 18307
Buggy source:
private void setData(int count,float range){
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < count; i++) {
    xVals.add((i) + "String_Node_Str");
  }
  ArrayList<Entry> yVals=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float mult=(range + 1);
    float val=(float)(Math.random() * mult) + 3;
    yVals.add(new Entry(val,i));
  }
  RealmLineDataSet set1=new RealmLineDataSet();
  ArrayList<RealmLineDataSet> dataSets=new ArrayList<RealmLineDataSet>();
  dataSets.add(set1);
  LineData data=new LineData(null,dataSets);
  mChart.setData(data);
}

Fixed version (ground truth):
private void setData(int count,float range){
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < count; i++) {
    xVals.add((i) + "String_Node_Str");
  }
  ArrayList<Entry> yVals=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float mult=(range + 1);
    float val=(float)(Math.random() * mult) + 3;
    yVals.add(new Entry(val,i));
  }
  RealmLineDataSet set1=new RealmLineDataSet();
  ArrayList<RealmLineDataSet> dataSets=new ArrayList<RealmLineDataSet>();
  dataSets.add(set1);
  LineData data=new LineData();
  mChart.setData(data);
}
Program: 18308
Project: 18308
Buggy source:
@Override protected void calcMinMax(){
  super.calcMinMax();
  if (mDeltaX == 0 && mData.getYValCount() > 0)   mDeltaX=1;
  mXChartMin=-0.5f;
  mXChartMax=(float)mData.getXValCount() - 0.5f;
  if (mRenderer != null) {
    for (    BubbleDataSet set : mData.getDataSets()) {
      final float xmin=set.getXMin();
      final float xmax=set.getXMax();
      if (xmin < mXChartMin)       mXChartMin=xmin;
      if (xmax > mXChartMax)       mXChartMax=xmax;
    }
  }
  mDeltaX=Math.abs(mXChartMax - mXChartMin);
}

Fixed version (ground truth):
@Override protected void calcMinMax(){
  super.calcMinMax();
  if (mDeltaX == 0 && mData.getYValCount() > 0)   mDeltaX=1;
  mXChartMin=-0.5f;
  mXChartMax=(float)mData.getXValCount() - 0.5f;
  if (mRenderer != null) {
    for (    IBubbleDataSet set : mData.getDataSets()) {
      final float xmin=set.getXMin();
      final float xmax=set.getXMax();
      if (xmin < mXChartMin)       mXChartMin=xmin;
      if (xmax > mXChartMax)       mXChartMax=xmax;
    }
  }
  mDeltaX=Math.abs(mXChartMax - mXChartMin);
}
Program: 18309
Project: 18309
Buggy source:
@Override protected void calcMinMax(){
  super.calcMinMax();
  if (getBarData() != null || getCandleData() != null || getBubbleData() != null) {
    mXChartMin=-0.5f;
    mXChartMax=mData.getXVals().size() - 0.5f;
    if (getBubbleData() != null) {
      for (      BubbleDataSet set : getBubbleData().getDataSets()) {
        final float xmin=set.getXMin();
        final float xmax=set.getXMax();
        if (xmin < mXChartMin)         mXChartMin=xmin;
        if (xmax > mXChartMax)         mXChartMax=xmax;
      }
    }
  }
  mDeltaX=Math.abs(mXChartMax - mXChartMin);
}

Fixed version (ground truth):
@Override protected void calcMinMax(){
  super.calcMinMax();
  if (getBarData() != null || getCandleData() != null || getBubbleData() != null) {
    mXChartMin=-0.5f;
    mXChartMax=mData.getXVals().size() - 0.5f;
    if (getBubbleData() != null) {
      for (      IBubbleDataSet set : getBubbleData().getDataSets()) {
        final float xmin=set.getXMin();
        final float xmax=set.getXMax();
        if (xmin < mXChartMin)         mXChartMin=xmin;
        if (xmax > mXChartMax)         mXChartMax=xmax;
      }
    }
  }
  mDeltaX=Math.abs(mXChartMax - mXChartMin);
}
Program: 18310
Project: 18310
Buggy source:
@Override public RectF getBarBounds(BarEntry e){
  BarDataSet set=mData.getDataSetForEntry(e);
  if (set == null)   return null;
  float barspace=set.getBarSpace();
  float y=e.getVal();
  float x=e.getXIndex();
  float spaceHalf=barspace / 2f;
  float top=x - 0.5f + spaceHalf;
  float bottom=x + 0.5f - spaceHalf;
  float left=y >= 0 ? y : 0;
  float right=y <= 0 ? y : 0;
  RectF bounds=new RectF(left,top,right,bottom);
  getTransformer(set.getAxisDependency()).rectValueToPixel(bounds);
  return bounds;
}

Fixed version (ground truth):
@Override public RectF getBarBounds(BarEntry e){
  IBarDataSet set=mData.getDataSetForEntry(e);
  if (set == null)   return null;
  float barspace=set.getBarSpace();
  float y=e.getVal();
  float x=e.getXIndex();
  float spaceHalf=barspace / 2f;
  float top=x - 0.5f + spaceHalf;
  float bottom=x + 0.5f - spaceHalf;
  float left=y >= 0 ? y : 0;
  float right=y <= 0 ? y : 0;
  RectF bounds=new RectF(left,top,right,bottom);
  getTransformer(set.getAxisDependency()).rectValueToPixel(bounds);
  return bounds;
}
Program: 18311
Project: 18311
Buggy source:
/** 
 * Returns true if this DataSet is stacked (stacksize > 1) or not.
 * @return
 */
public boolean isStacked(){
  return mStackSize > 1 ? true : false;
}

Fixed version (ground truth):
@Override public boolean isStacked(){
  return mStackSize > 1 ? true : false;
}
Program: 18312
Project: 18312
Buggy source:
/** 
 * Returns the alpha value (transparency) that is used for drawing the highlight indicator.
 * @return
 */
public int getHighLightAlpha(){
  return mHighLightAlpha;
}

Fixed version (ground truth):
@Override public int getHighLightAlpha(){
  return mHighLightAlpha;
}
Program: 18313
Project: 18313
Buggy source:
/** 
 * Returns the color used for drawing the bar-shadows. The bar shadows is a surface behind the bar that indicates the maximum value.
 * @return
 */
public int getBarShadowColor(){
  return mBarShadowColor;
}

Fixed version (ground truth):
@Override public int getBarShadowColor(){
  return mBarShadowColor;
}
Program: 18314
Project: 18314
Buggy source:
/** 
 * returns the space between bars as the actual value (0 - 1.0f)
 * @return
 */
public float getBarSpace(){
  return mBarSpace;
}

Fixed version (ground truth):
@Override public float getBarSpace(){
  return mBarSpace;
}
Program: 18315
Project: 18315
Buggy source:
/** 
 * Returns the maximum number of bars that can be stacked upon another in this DataSet.
 * @return
 */
public int getStackSize(){
  return mStackSize;
}

Fixed version (ground truth):
@Override public int getStackSize(){
  return mStackSize;
}
Program: 18316
Project: 18316
Buggy source:
public float getHighlightCircleWidth(){
  return mHighlightCircleWidth;
}

Fixed version (ground truth):
@Override public float getHighlightCircleWidth(){
  return mHighlightCircleWidth;
}
Program: 18317
Project: 18317
Buggy source:
public float getXMax(){
  return mXMax;
}

Fixed version (ground truth):
@Override public float getXMax(){
  return mXMax;
}
Program: 18318
Project: 18318
Buggy source:
public float getMaxSize(){
  return mMaxSize;
}

Fixed version (ground truth):
@Override public float getMaxSize(){
  return mMaxSize;
}
Program: 18319
Project: 18319
Buggy source:
public float getXMin(){
  return mXMin;
}

Fixed version (ground truth):
@Override public float getXMin(){
  return mXMin;
}
Program: 18320
Project: 18320
Buggy source:
/** 
 * Returns the decreasing color.
 * @return
 */
public int getDecreasingColor(){
  return mDecreasingColor;
}

Fixed version (ground truth):
@Override public int getDecreasingColor(){
  return mDecreasingColor;
}
Program: 18321
Project: 18321
Buggy source:
/** 
 * Is the shadow color same as the candle color?
 * @return
 */
public boolean getShadowColorSameAsCandle(){
  return mShadowColorSameAsCandle;
}

Fixed version (ground truth):
@Override public boolean getShadowColorSameAsCandle(){
  return mShadowColorSameAsCandle;
}
Program: 18322
Project: 18322
Buggy source:
/** 
 * Returns paint style when open > close
 * @return
 */
public Paint.Style getDecreasingPaintStyle(){
  return mDecreasingPaintStyle;
}

Fixed version (ground truth):
@Override public Paint.Style getDecreasingPaintStyle(){
  return mDecreasingPaintStyle;
}
Program: 18323
Project: 18323
Buggy source:
/** 
 * Returns paint style when open <= close
 * @return
 */
public Paint.Style getIncreasingPaintStyle(){
  return mIncreasingPaintStyle;
}

Fixed version (ground truth):
@Override public Paint.Style getIncreasingPaintStyle(){
  return mIncreasingPaintStyle;
}
Program: 18324
Project: 18324
Buggy source:
/** 
 * Returns shadow color for all entries
 * @return
 */
public int getShadowColor(){
  return mShadowColor;
}

Fixed version (ground truth):
@Override public int getShadowColor(){
  return mShadowColor;
}
Program: 18325
Project: 18325
Buggy source:
/** 
 * Returns the width of the candle-shadow-line in pixels.
 * @return
 */
public float getShadowWidth(){
  return mShadowWidth;
}

Fixed version (ground truth):
@Override public float getShadowWidth(){
  return mShadowWidth;
}
Program: 18326
Project: 18326
Buggy source:
/** 
 * Returns the increasing color.
 * @return
 */
public int getIncreasingColor(){
  return mIncreasingColor;
}

Fixed version (ground truth):
@Override public int getIncreasingColor(){
  return mIncreasingColor;
}
Program: 18327
Project: 18327
Buggy source:
/** 
 * Returns the space that is left out on the left and right side of each candle.
 * @return
 */
public float getBodySpace(){
  return mBodySpace;
}

Fixed version (ground truth):
@Override public float getBodySpace(){
  return mBodySpace;
}
Program: 18328
Project: 18328
Buggy source:
@Override public int getXOffset(){
  return -(getWidth() / 2);
}

Fixed version (ground truth):
@Override public int getXOffset(float xpos){
  return -(getWidth() / 2);
}
Program: 18329
Project: 18329
Buggy source:
@Override public int getYOffset(){
  return -getHeight();
}

Fixed version (ground truth):
@Override public int getYOffset(float ypos){
  return -getHeight();
}
Program: 18330
Project: 18330
Buggy source:
@Override public int getXOffset(){
  return -(getWidth() / 2);
}

Fixed version (ground truth):
@Override public int getXOffset(float xpos){
  return -(getWidth() / 2);
}
Program: 18331
Project: 18331
Buggy source:
@Override public int getYOffset(){
  return -getHeight();
}

Fixed version (ground truth):
@Override public int getYOffset(float ypos){
  return -getHeight();
}
Program: 18332
Project: 18332
Buggy source:
/** 
 * Use this to return the desired offset you wish the MarkerView to have on the x-axis. By returning -(getWidth() / 2) you will center the MarkerView horizontally.
 * @return
 */
public abstract int getXOffset();

Fixed version (ground truth):
/** 
 * Use this to return the desired offset you wish the MarkerView to have on the x-axis. By returning -(getWidth() / 2) you will center the MarkerView horizontally.
 * @param xpos the position on the x-axis in pixels where the marker is drawn
 * @return
 */
public abstract int getXOffset(float xpos);
Program: 18333
Project: 18333
Buggy source:
/** 
 * This method enables a specified custom MarkerView to update it's content everytime the MarkerView is redrawn.
 * @param e The Entry the MarkerView belongs to. This can also be any subclass of Entry, like BarEntry or CandleEntry, simply cast it at runtime.
 * @param highlight the highlight object contains information about the highlighted value such as it's dataset-index, the selected range or stack-index (only stacked bar entries).
 */
public abstract void refreshContent(Entry e,Highlight highlight);

Fixed version (ground truth):
/** 
 * This method enables a specified custom MarkerView to update it's content everytime the MarkerView is redrawn.
 * @param e         The Entry the MarkerView belongs to. This can also be any subclass of Entry, like BarEntry orCandleEntry, simply cast it at runtime.
 * @param highlight the highlight object contains information about the highlighted value such as it's dataset-index, theselected range or stack-index (only stacked bar entries).
 */
public abstract void refreshContent(Entry e,Highlight highlight);
Program: 18334
Project: 18334
Buggy source:
/** 
 * Draws the MarkerView on the given position on the screen with the given Canvas object.
 * @param canvas
 * @param posx
 * @param posy
 */
public void draw(Canvas canvas,float posx,float posy){
  posx+=getXOffset();
  posy+=getYOffset();
  canvas.translate(posx,posy);
  draw(canvas);
  canvas.translate(-posx,-posy);
}

Fixed version (ground truth):
/** 
 * Draws the MarkerView on the given position on the screen with the given Canvas object.
 * @param canvas
 * @param posx
 * @param posy
 */
public void draw(Canvas canvas,float posx,float posy){
  posx+=getXOffset(posx);
  posy+=getYOffset(posy);
  canvas.translate(posx,posy);
  draw(canvas);
  canvas.translate(-posx,-posy);
}
Program: 18335
Project: 18335
Buggy source:
/** 
 * Use this to return the desired position offset you wish the MarkerView to have on the y-axis. By returning -getHeight() you will cause the MarkerView to be above the selected value.
 * @return
 */
public abstract int getYOffset();

Fixed version (ground truth):
/** 
 * Use this to return the desired position offset you wish the MarkerView to have on the y-axis. By returning -getHeight() you will cause the MarkerView to be above the selected value.
 * @param ypos the position on the y-axis in pixels where the marker is drawn
 * @return
 */
public abstract int getYOffset(float ypos);
Program: 18336
Project: 18336
Buggy source:
@Override public void calculateOffsets(){
  super.calculateOffsets();
  if (mDataNotSet)   return;
  float diameter=getDiameter();
  float radius=diameter / 2f;
  PointF c=getCenterOffsets();
  final List<PieDataSet> dataSets=mData.getDataSets();
  float maxShift=0.f;
  for (int i=0; i < dataSets.size(); i++) {
    final float shift=dataSets.get(i).getSelectionShift();
    if (shift > maxShift)     maxShift=shift;
  }
  final float halfMaxShift=maxShift / 2.f;
  mCircleBox.set(c.x - radius + halfMaxShift,c.y - radius + halfMaxShift,c.x + radius - halfMaxShift,c.y + radius - halfMaxShift);
}

Fixed version (ground truth):
@Override public void calculateOffsets(){
  super.calculateOffsets();
  if (mDataNotSet)   return;
  float diameter=getDiameter();
  float radius=diameter / 2f;
  PointF c=getCenter();
  float shift=mData.getDataSet().getSelectionShift();
  mCircleBox.set(c.x - radius + shift,c.y - radius + shift,c.x + radius - shift,c.y + radius - shift);
}
Program: 18338
Project: 18338
Buggy source:
private SpannableString generateCenterSpannableText(){
  SpannableString s=new SpannableString("String_Node_Str");
  s.setSpan(new RelativeSizeSpan(1.7f),0,14,0);
  return s;
}

Fixed version (ground truth):
private SpannableString generateCenterSpannableText(){
  SpannableString s=new SpannableString("String_Node_Str");
  s.setSpan(new RelativeSizeSpan(1.7f),0,14,0);
  s.setSpan(new StyleSpan(Typeface.NORMAL),14,s.length() - 15,0);
  s.setSpan(new ForegroundColorSpan(Color.GRAY),14,s.length() - 15,0);
  s.setSpan(new RelativeSizeSpan(.8f),14,s.length() - 15,0);
  s.setSpan(new StyleSpan(Typeface.ITALIC),s.length() - 14,s.length(),0);
  return s;
}
Program: 18340
Project: 18340
Buggy source:
public PieChartRenderer(PieChart chart,ChartAnimator animator,ViewPortHandler viewPortHandler){
  super(animator,viewPortHandler);
  mChart=chart;
  mHolePaint=new Paint(Paint.ANTI_ALIAS_FLAG);
  mHolePaint.setColor(Color.WHITE);
  mHolePaint.setStyle(Style.FILL);
  mTransparentCirclePaint=new Paint(Paint.ANTI_ALIAS_FLAG);
  mTransparentCirclePaint.setColor(Color.WHITE);
  mTransparentCirclePaint.setStyle(Style.FILL);
  mTransparentCirclePaint.setAlpha(100);
  mCenterTextPaint=new TextPaint(Paint.ANTI_ALIAS_FLAG);
  mCenterTextPaint.setColor(Color.BLACK);
  mCenterTextPaint.setTextSize(Utils.convertDpToPixel(12f));
  mCenterTextPaint.setTextAlign(Align.CENTER);
  mValuePaint.setTextSize(Utils.convertDpToPixel(13f));
  mValuePaint.setColor(Color.WHITE);
  mValuePaint.setTextAlign(Align.CENTER);
}

Fixed version (ground truth):
public PieChartRenderer(PieChart chart,ChartAnimator animator,ViewPortHandler viewPortHandler){
  super(animator,viewPortHandler);
  mChart=chart;
  mHolePaint=new Paint(Paint.ANTI_ALIAS_FLAG);
  mHolePaint.setColor(Color.WHITE);
  mHolePaint.setStyle(Style.FILL);
  mTransparentCirclePaint=new Paint(Paint.ANTI_ALIAS_FLAG);
  mTransparentCirclePaint.setColor(Color.WHITE);
  mTransparentCirclePaint.setStyle(Style.FILL);
  mTransparentCirclePaint.setAlpha(100);
  mCenterTextPaint=new TextPaint(Paint.ANTI_ALIAS_FLAG);
  mCenterTextPaint.setColor(Color.BLACK);
  mCenterTextPaint.setTextSize(Utils.convertDpToPixel(12f));
  mValuePaint.setTextSize(Utils.convertDpToPixel(13f));
  mValuePaint.setColor(Color.WHITE);
  mValuePaint.setTextAlign(Align.CENTER);
}
Program: 18341
Project: 18341
Buggy source:
/** 
 * Sets the number of web-lines that should be skipped on chart web before the next one is drawn. This targets the lines that come from the center of the RadarChart.
 * @param count if count = 1 -> 1 line is skipped in between
 */
public void setSkipWebLineCount(int count){
  if (count < 0)   count=0;
  mWebModulus=count + 1;
}

Fixed version (ground truth):
/** 
 * Sets the number of web-lines that should be skipped on chart web before the next one is drawn. This targets the lines that come from the center of the RadarChart.
 * @param count if count = 1 -> 1 line is skipped in between
 */
public void setSkipWebLineCount(int count){
  mSkipWebLineCount=Math.max(0,count);
}
Program: 18342
Project: 18342
Buggy source:
/** 
 * Returns the modulus that is used for skipping web-lines.
 * @return
 */
public int getSkipWebLineCount(){
  return mWebModulus;
}

Fixed version (ground truth):
/** 
 * Returns the modulus that is used for skipping web-lines.
 * @return
 */
public int getSkipWebLineCount(){
  return mSkipWebLineCount;
}
Program: 18343
Project: 18343
Buggy source:
protected void drawCubicFill(LineDataSet dataSet,Path spline,Transformer trans,int from,int to){
  float fillMin=dataSet.getFillFormatter().getFillLinePosition(dataSet,mChart);
  spline.lineTo(to - 1,fillMin);
  spline.lineTo(from,fillMin);
  spline.close();
  mRenderPaint.setStyle(Paint.Style.FILL);
  mRenderPaint.setColor(dataSet.getFillColor());
  mRenderPaint.setAlpha(dataSet.getFillAlpha());
  trans.pathValueToPixel(spline);
  mBitmapCanvas.drawPath(spline,mRenderPaint);
  mRenderPaint.setAlpha(255);
}

Fixed version (ground truth):
protected void drawCubicFill(LineDataSet dataSet,Path spline,Transformer trans,int from,int to){
  if (to - from <= 1)   return;
  float fillMin=dataSet.getFillFormatter().getFillLinePosition(dataSet,mChart);
  spline.lineTo(to - 1,fillMin);
  spline.lineTo(from,fillMin);
  spline.close();
  mRenderPaint.setStyle(Paint.Style.FILL);
  mRenderPaint.setColor(dataSet.getFillColor());
  mRenderPaint.setAlpha(dataSet.getFillAlpha());
  trans.pathValueToPixel(spline);
  mBitmapCanvas.drawPath(spline,mRenderPaint);
  mRenderPaint.setAlpha(255);
}
Program: 18344
Project: 18344
Buggy source:
protected void drawWeb(Canvas c){
  float sliceangle=mChart.getSliceAngle();
  float factor=mChart.getFactor();
  float rotationangle=mChart.getRotationAngle();
  PointF center=mChart.getCenterOffsets();
  mWebPaint.setStrokeWidth(mChart.getWebLineWidth());
  mWebPaint.setColor(mChart.getWebColor());
  mWebPaint.setAlpha(mChart.getWebAlpha());
  for (int i=0; i < mChart.getData().getXValCount(); i+=mChart.getSkipWebLineCount()) {
    PointF p=Utils.getPosition(center,mChart.getYRange() * factor,sliceangle * i + rotationangle);
    c.drawLine(center.x,center.y,p.x,p.y,mWebPaint);
  }
  mWebPaint.setStrokeWidth(mChart.getWebLineWidthInner());
  mWebPaint.setColor(mChart.getWebColorInner());
  mWebPaint.setAlpha(mChart.getWebAlpha());
  int labelCount=mChart.getYAxis().mEntryCount;
  for (int j=0; j < labelCount; j++) {
    for (int i=0; i < mChart.getData().getXValCount(); i++) {
      float r=(mChart.getYAxis().mEntries[j] - mChart.getYChartMin()) * factor;
      PointF p1=Utils.getPosition(center,r,sliceangle * i + rotationangle);
      PointF p2=Utils.getPosition(center,r,sliceangle * (i + 1) + rotationangle);
      c.drawLine(p1.x,p1.y,p2.x,p2.y,mWebPaint);
    }
  }
}

Fixed version (ground truth):
protected void drawWeb(Canvas c){
  float sliceangle=mChart.getSliceAngle();
  float factor=mChart.getFactor();
  float rotationangle=mChart.getRotationAngle();
  PointF center=mChart.getCenterOffsets();
  mWebPaint.setStrokeWidth(mChart.getWebLineWidth());
  mWebPaint.setColor(mChart.getWebColor());
  mWebPaint.setAlpha(mChart.getWebAlpha());
  final int xIncrements=1 + mChart.getSkipWebLineCount();
  for (int i=0; i < mChart.getData().getXValCount(); i+=xIncrements) {
    PointF p=Utils.getPosition(center,mChart.getYRange() * factor,sliceangle * i + rotationangle);
    c.drawLine(center.x,center.y,p.x,p.y,mWebPaint);
  }
  mWebPaint.setStrokeWidth(mChart.getWebLineWidthInner());
  mWebPaint.setColor(mChart.getWebColorInner());
  mWebPaint.setAlpha(mChart.getWebAlpha());
  int labelCount=mChart.getYAxis().mEntryCount;
  for (int j=0; j < labelCount; j++) {
    for (int i=0; i < mChart.getData().getXValCount(); i++) {
      float r=(mChart.getYAxis().mEntries[j] - mChart.getYChartMin()) * factor;
      PointF p1=Utils.getPosition(center,r,sliceangle * i + rotationangle);
      PointF p2=Utils.getPosition(center,r,sliceangle * (i + 1) + rotationangle);
      c.drawLine(p1.x,p1.y,p2.x,p2.y,mWebPaint);
    }
  }
}
Program: 18346
Project: 18346
Buggy source:
/** 
 * Transform a rectangle with all matrices with potential animation phases.
 * @param r
 * @param phaseY
 */
public void rectValueToPixelHorizontal(RectF r,float phaseY){
  if (r.left > 0)   r.left*=phaseY;
 else   r.right*=phaseY;
  mMatrixValueToPx.mapRect(r);
  mViewPortHandler.getMatrixTouch().mapRect(r);
  mMatrixOffset.mapRect(r);
}

Fixed version (ground truth):
/** 
 * Transform a rectangle with all matrices with potential animation phases.
 * @param r
 * @param phaseY
 */
public void rectValueToPixelHorizontal(RectF r,float phaseY){
  r.left*=phaseY;
  r.right*=phaseY;
  mMatrixValueToPx.mapRect(r);
  mViewPortHandler.getMatrixTouch().mapRect(r);
  mMatrixOffset.mapRect(r);
}
Program: 18347
Project: 18347
Buggy source:
/** 
 * Transform a rectangle with all matrices with potential animation phases.
 * @param r
 * @param phaseY
 */
public void rectValueToPixel(RectF r,float phaseY){
  if (r.top > 0)   r.top*=phaseY;
 else   r.bottom*=phaseY;
  mMatrixValueToPx.mapRect(r);
  mViewPortHandler.getMatrixTouch().mapRect(r);
  mMatrixOffset.mapRect(r);
}

Fixed version (ground truth):
/** 
 * Transform a rectangle with all matrices with potential animation phases.
 * @param r
 * @param phaseY
 */
public void rectValueToPixel(RectF r,float phaseY){
  r.top*=phaseY;
  r.bottom*=phaseY;
  mMatrixValueToPx.mapRect(r);
  mViewPortHandler.getMatrixTouch().mapRect(r);
  mMatrixOffset.mapRect(r);
}