nus-yam/ex-repair huggingface dataset:
Program: 26362
Project: 26362
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: 26363
Project: 26363
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: 26364
Project: 26364
Buggy source:
@Override public String[] getStackLabels(){
  return new String[0];
}

Fixed version (ground truth):
@Override public String[] getStackLabels(){
  return null;
}
Program: 26365
Project: 26365
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: 26366
Project: 26366
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: 26367
Project: 26367
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: 26368
Project: 26368
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.actionToggleValues:
{
      for (      DataSet<?> set : mChart.getData().getDataSets())       set.setDrawValues(!set.isDrawValuesEnabled());
      mChart.invalidate();
      break;
    }
case R.id.actionToggleHole:
{
    if (mChart.isDrawHoleEnabled())     mChart.setDrawHoleEnabled(false);
 else     mChart.setDrawHoleEnabled(true);
    mChart.invalidate();
    break;
  }
case R.id.actionDrawCenter:
{
  if (mChart.isDrawCenterTextEnabled())   mChart.setDrawCenterText(false);
 else   mChart.setDrawCenterText(true);
  mChart.invalidate();
  break;
}
case R.id.actionToggleXVals:
{
mChart.setDrawSliceText(!mChart.isDrawSliceTextEnabled());
mChart.invalidate();
break;
}
case R.id.actionSave:
{
mChart.saveToPath("String_Node_Str" + System.currentTimeMillis(),"String_Node_Str");
break;
}
case R.id.actionTogglePercent:
mChart.setUsePercentValues(!mChart.isUsePercentValuesEnabled());
mChart.invalidate();
break;
case R.id.animateX:
{
mChart.animateX(1400);
break;
}
case R.id.animateY:
{
mChart.animateY(1400);
break;
}
case R.id.animateXY:
{
mChart.animateXY(1400,1400);
break;
}
}
return true;
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.actionToggleValues:
{
      for (      IDataSet<?> set : mChart.getData().getDataSets())       set.setDrawValues(!set.isDrawValuesEnabled());
      mChart.invalidate();
      break;
    }
case R.id.actionToggleHole:
{
    if (mChart.isDrawHoleEnabled())     mChart.setDrawHoleEnabled(false);
 else     mChart.setDrawHoleEnabled(true);
    mChart.invalidate();
    break;
  }
case R.id.actionDrawCenter:
{
  if (mChart.isDrawCenterTextEnabled())   mChart.setDrawCenterText(false);
 else   mChart.setDrawCenterText(true);
  mChart.invalidate();
  break;
}
case R.id.actionToggleXVals:
{
mChart.setDrawSliceText(!mChart.isDrawSliceTextEnabled());
mChart.invalidate();
break;
}
case R.id.actionSave:
{
mChart.saveToPath("String_Node_Str" + System.currentTimeMillis(),"String_Node_Str");
break;
}
case R.id.actionTogglePercent:
mChart.setUsePercentValues(!mChart.isUsePercentValuesEnabled());
mChart.invalidate();
break;
case R.id.animateX:
{
mChart.animateX(1400);
break;
}
case R.id.animateY:
{
mChart.animateY(1400);
break;
}
case R.id.animateXY:
{
mChart.animateXY(1400,1400);
break;
}
}
return true;
}
Program: 26369
Project: 26369
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: 26371
Project: 26371
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: 26372
Project: 26372
Buggy source:
/** 
 * Returns the index of the DataSet this x-index belongs to.
 * @param xIndex
 * @return
 */
public int getDataSetIndexForIndex(int xIndex){
  List<? extends DataSet<? extends Entry>> dataSets=mData.getDataSets();
  for (int i=0; i < dataSets.size(); i++) {
    if (dataSets.get(i).getEntryForXIndex(xIndex) != null)     return i;
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * Returns the index of the DataSet this x-index belongs to.
 * @param xIndex
 * @return
 */
public int getDataSetIndexForIndex(int xIndex){
  List<IPieDataSet> dataSets=mData.getDataSets();
  for (int i=0; i < dataSets.size(); i++) {
    if (dataSets.get(i).getEntryForXIndex(xIndex) != null)     return i;
  }
  return -1;
}
Program: 26373
Project: 26373
Buggy source:
/** 
 * calculates the needed angles for the chart slices
 */
private void calcAngles(){
  mDrawAngles=new float[mData.getYValCount()];
  mAbsoluteAngles=new float[mData.getYValCount()];
  List<PieDataSet> dataSets=mData.getDataSets();
  int cnt=0;
  for (int i=0; i < mData.getDataSetCount(); i++) {
    PieDataSet set=dataSets.get(i);
    List<Entry> entries=set.getYVals();
    for (int j=0; j < entries.size(); j++) {
      mDrawAngles[cnt]=calcAngle(Math.abs(entries.get(j).getVal()));
      if (cnt == 0) {
        mAbsoluteAngles[cnt]=mDrawAngles[cnt];
      }
 else {
        mAbsoluteAngles[cnt]=mAbsoluteAngles[cnt - 1] + mDrawAngles[cnt];
      }
      cnt++;
    }
  }
}

Fixed version (ground truth):
/** 
 * calculates the needed angles for the chart slices
 */
private void calcAngles(){
  mDrawAngles=new float[mData.getYValCount()];
  mAbsoluteAngles=new float[mData.getYValCount()];
  List<IPieDataSet> dataSets=mData.getDataSets();
  int cnt=0;
  for (int i=0; i < mData.getDataSetCount(); i++) {
    IPieDataSet set=dataSets.get(i);
    List<Entry> entries=set.getYVals();
    for (int j=0; j < entries.size(); j++) {
      mDrawAngles[cnt]=calcAngle(Math.abs(entries.get(j).getVal()));
      if (cnt == 0) {
        mAbsoluteAngles[cnt]=mDrawAngles[cnt];
      }
 else {
        mAbsoluteAngles[cnt]=mAbsoluteAngles[cnt - 1] + mDrawAngles[cnt];
      }
      cnt++;
    }
  }
}
Program: 26374
Project: 26374
Buggy source:
/** 
 * Returns an array of SelectionDetail objects for the given x-index. The SelectionDetail objects give information about the value at the selected index and the DataSet it belongs to. INFORMATION: This method does calculations at runtime. Do not over-use in performance critical situations.
 * @return
 */
public List<SelectionDetail> getSelectionDetailsAtIndex(int xIndex){
  List<SelectionDetail> vals=new ArrayList<SelectionDetail>();
  for (int i=0; i < mData.getDataSetCount(); i++) {
    DataSet<?> dataSet=mData.getDataSetByIndex(i);
    final float yVal=dataSet.getYValForXIndex(xIndex);
    if (yVal == Float.NaN)     continue;
    vals.add(new SelectionDetail(yVal,i,dataSet));
  }
  return vals;
}

Fixed version (ground truth):
/** 
 * Returns an array of SelectionDetail objects for the given x-index. The SelectionDetail objects give information about the value at the selected index and the DataSet it belongs to. INFORMATION: This method does calculations at runtime. Do not over-use in performance critical situations.
 * @return
 */
public List<SelectionDetail> getSelectionDetailsAtIndex(int xIndex){
  List<SelectionDetail> vals=new ArrayList<SelectionDetail>();
  for (int i=0; i < mData.getDataSetCount(); i++) {
    IDataSet<?> dataSet=mData.getDataSetByIndex(i);
    final float yVal=dataSet.getYValForXIndex(xIndex);
    if (yVal == Float.NaN)     continue;
    vals.add(new SelectionDetail(yVal,i,dataSet));
  }
  return vals;
}
Program: 26375
Project: 26375
Buggy source:
@Override public Entry getEntryForXIndex(int x){
  return null;
}

Fixed version (ground truth):
@Override public Entry getEntryForXIndex(int xIndex){
  return null;
}
Program: 26376
Project: 26376
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: 26378
Project: 26378
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: 26379
Project: 26379
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: 26380
Project: 26380
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: 26381
Project: 26381
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: 26382
Project: 26382
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: 26383
Project: 26383
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: 26384
Project: 26384
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: 26385
Project: 26385
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: 26387
Project: 26387
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: 26388
Project: 26388
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: 26389
Project: 26389
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: 26390
Project: 26390
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: 26391
Project: 26391
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: 26392
Project: 26392
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: 26393
Project: 26393
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: 26394
Project: 26394
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: 26395
Project: 26395
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: 26396
Project: 26396
Buggy source:
public float getHighlightCircleWidth(){
  return mHighlightCircleWidth;
}

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

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

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

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

Fixed version (ground truth):
@Override public int getDecreasingColor(){
  return mDecreasingColor;
}
Program: 26401
Project: 26401
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: 26402
Project: 26402
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: 26403
Project: 26403
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: 26404
Project: 26404
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: 26405
Project: 26405
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: 26406
Project: 26406
Buggy source:
/** 
 * Returns the increasing color.
 * @return
 */
public int getIncreasingColor(){
  return mIncreasingColor;
}

Fixed version (ground truth):
@Override public int getIncreasingColor(){
  return mIncreasingColor;
}
Program: 26407
Project: 26407
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: 26408
Project: 26408
Buggy source:
@Override public int getXOffset(){
  return -(getWidth() / 2);
}

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

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

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

Fixed version (ground truth):
@Override public int getYOffset(float ypos){
  return -getHeight();
}
Program: 26412
Project: 26412
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: 26413
Project: 26413
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: 26414
Project: 26414
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: 26415
Project: 26415
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: 26416
Project: 26416
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: 26418
Project: 26418
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: 26420
Project: 26420
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: 26421
Project: 26421
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: 26422
Project: 26422
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: 26423
Project: 26423
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);
}