nus-yam/ex-repair huggingface dataset:
Program: 18552
Project: 18552
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));
  }
  LineDataSet set1=new LineDataSet(yVals,"String_Node_Str");
  set1.enableDashedLine(10f,5f,0f);
  set1.setColor(Color.BLACK);
  set1.setCircleColor(Color.BLACK);
  set1.setLineWidth(1f);
  set1.setCircleSize(3f);
  set1.setDrawCircleHole(false);
  set1.setValueTextSize(9f);
  set1.setFillAlpha(65);
  set1.setFillColor(Color.BLACK);
  ArrayList<LineDataSet> dataSets=new ArrayList<LineDataSet>();
  dataSets.add(set1);
  LineData data=new LineData(xVals,dataSets);
  LimitLine ll1=new LimitLine(130f,"String_Node_Str");
  ll1.setLineWidth(4f);
  ll1.enableDashedLine(10f,10f,0f);
  ll1.setLabelPosition(LimitLabelPosition.POS_RIGHT);
  ll1.setTextSize(10f);
  LimitLine ll2=new LimitLine(-30f,"String_Node_Str");
  ll2.setLineWidth(4f);
  ll2.enableDashedLine(10f,10f,0f);
  ll2.setLabelPosition(LimitLabelPosition.POS_RIGHT);
  ll2.setTextSize(10f);
  YAxis leftAxis=mChart.getAxisLeft();
  leftAxis.addLimitLine(ll1);
  leftAxis.addLimitLine(ll2);
  leftAxis.setAxisMaxValue(220f);
  leftAxis.setAxisMinValue(-50f);
  leftAxis.setStartAtZero(false);
  mChart.getAxisRight().setEnabled(false);
  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=10; i < count - 10; i++) {
    float mult=(range + 1);
    float val=(float)(Math.random() * mult) + 3;
    yVals.add(new Entry(val,i));
  }
  LineDataSet set1=new LineDataSet(yVals,"String_Node_Str");
  set1.enableDashedLine(10f,5f,0f);
  set1.setColor(Color.BLACK);
  set1.setCircleColor(Color.BLACK);
  set1.setLineWidth(1f);
  set1.setCircleSize(3f);
  set1.setDrawCircleHole(false);
  set1.setValueTextSize(9f);
  set1.setFillAlpha(65);
  set1.setFillColor(Color.BLACK);
  ArrayList<LineDataSet> dataSets=new ArrayList<LineDataSet>();
  dataSets.add(set1);
  LineData data=new LineData(xVals,dataSets);
  LimitLine ll1=new LimitLine(130f,"String_Node_Str");
  ll1.setLineWidth(4f);
  ll1.enableDashedLine(10f,10f,0f);
  ll1.setLabelPosition(LimitLabelPosition.POS_RIGHT);
  ll1.setTextSize(10f);
  LimitLine ll2=new LimitLine(-30f,"String_Node_Str");
  ll2.setLineWidth(4f);
  ll2.enableDashedLine(10f,10f,0f);
  ll2.setLabelPosition(LimitLabelPosition.POS_RIGHT);
  ll2.setTextSize(10f);
  YAxis leftAxis=mChart.getAxisLeft();
  leftAxis.addLimitLine(ll1);
  leftAxis.addLimitLine(ll2);
  leftAxis.setAxisMaxValue(220f);
  leftAxis.setAxisMinValue(-50f);
  leftAxis.setStartAtZero(false);
  mChart.getAxisRight().setEnabled(false);
  mChart.setData(data);
}
Program: 18553
Project: 18553
Buggy source:
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  if (mDataNotSet)   return;
  if (mHighlightEnabled && valuesToHighlight())   mRenderer.drawHighlighted(canvas,mIndicesToHightlight);
  mRenderer.drawData(canvas);
  mRenderer.drawExtras(canvas);
  mRenderer.drawValues(canvas);
  mLegendRenderer.renderLegend(canvas,mLegend);
  drawDescription(canvas);
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  if (mDataNotSet)   return;
  mRenderer.drawData(canvas);
  if (mHighlightEnabled && valuesToHighlight())   mRenderer.drawHighlighted(canvas,mIndicesToHightlight);
  mRenderer.drawExtras(canvas);
  mRenderer.drawValues(canvas);
  mLegendRenderer.renderLegend(canvas,mLegend);
  drawDescription(canvas);
}
Program: 18554
Project: 18554
Buggy source:
protected void drawDataSet(Canvas c,BarDataSet dataSet,int index){
  Transformer trans=mChart.getTransformer(dataSet.getAxisDependency());
  calcXBounds(trans);
  mShadowPaint.setColor(dataSet.getBarShadowColor());
  float phaseX=mAnimator.getPhaseX();
  float phaseY=mAnimator.getPhaseY();
  ArrayList<BarEntry> entries=dataSet.getYVals();
  BarBuffer buffer=mBarBuffers[index];
  buffer.setPhases(phaseX,phaseY);
  buffer.setBarSpace(dataSet.getBarSpace());
  buffer.setDataSet(index);
  buffer.feed(entries);
  trans.pointValuesToPixel(buffer.buffer);
  for (int j=0; j < buffer.size(); j+=4) {
    if (!mViewPortHandler.isInBoundsLeft(buffer.buffer[j + 2]))     continue;
    if (!mViewPortHandler.isInBoundsRight(buffer.buffer[j]))     break;
    if (mChart.isDrawBarShadowEnabled()) {
      c.drawRect(buffer.buffer[j],mViewPortHandler.contentTop(),buffer.buffer[j + 2],mViewPortHandler.contentBottom(),mShadowPaint);
    }
    mRenderPaint.setColor(dataSet.getColor(j / 4));
    c.drawRect(buffer.buffer[j],buffer.buffer[j + 1],buffer.buffer[j + 2],buffer.buffer[j + 3],mRenderPaint);
  }
}

Fixed version (ground truth):
protected void drawDataSet(Canvas c,BarDataSet dataSet,int index){
  Transformer trans=mChart.getTransformer(dataSet.getAxisDependency());
  calcXBounds(trans);
  mShadowPaint.setColor(dataSet.getBarShadowColor());
  float phaseX=mAnimator.getPhaseX();
  float phaseY=mAnimator.getPhaseY();
  ArrayList<BarEntry> entries=dataSet.getYVals();
  BarBuffer buffer=mBarBuffers[index];
  buffer.setPhases(phaseX,phaseY);
  buffer.setBarSpace(dataSet.getBarSpace());
  buffer.setDataSet(index);
  buffer.feed(entries);
  trans.pointValuesToPixel(buffer.buffer);
  if (dataSet.getColors().size() > 1) {
    for (int j=0; j < buffer.size(); j+=4) {
      if (!mViewPortHandler.isInBoundsLeft(buffer.buffer[j + 2]))       continue;
      if (!mViewPortHandler.isInBoundsRight(buffer.buffer[j]))       break;
      if (mChart.isDrawBarShadowEnabled()) {
        c.drawRect(buffer.buffer[j],mViewPortHandler.contentTop(),buffer.buffer[j + 2],mViewPortHandler.contentBottom(),mShadowPaint);
      }
      mRenderPaint.setColor(dataSet.getColor(j / 4));
      c.drawRect(buffer.buffer[j],buffer.buffer[j + 1],buffer.buffer[j + 2],buffer.buffer[j + 3],mRenderPaint);
    }
  }
 else {
    mRenderPaint.setColor(dataSet.getColor());
    for (int j=0; j < buffer.size(); j+=4) {
      if (!mViewPortHandler.isInBoundsLeft(buffer.buffer[j + 2]))       continue;
      if (!mViewPortHandler.isInBoundsRight(buffer.buffer[j]))       break;
      if (mChart.isDrawBarShadowEnabled()) {
        c.drawRect(buffer.buffer[j],mViewPortHandler.contentTop(),buffer.buffer[j + 2],mViewPortHandler.contentBottom(),mShadowPaint);
      }
      c.drawRect(buffer.buffer[j],buffer.buffer[j + 1],buffer.buffer[j + 2],buffer.buffer[j + 3],mRenderPaint);
    }
  }
}
Program: 18555
Project: 18555
Buggy source:
@Override public void drawData(Canvas c){
  if (mPathBitmap == null) {
    mPathBitmap=Bitmap.createBitmap((int)mViewPortHandler.getChartWidth(),(int)mViewPortHandler.getChartHeight(),Bitmap.Config.ARGB_4444);
    mPathCanvas=new Canvas(mPathBitmap);
  }
  mPathBitmap.eraseColor(Color.TRANSPARENT);
  LineData lineData=mChart.getLineData();
  for (  LineDataSet set : lineData.getDataSets()) {
    if (set.isVisible())     drawDataSet(c,set);
  }
}

Fixed version (ground truth):
@Override public void drawData(Canvas c){
  if (mPathBitmap == null) {
    mPathBitmap=Bitmap.createBitmap((int)mViewPortHandler.getChartWidth(),(int)mViewPortHandler.getChartHeight(),Bitmap.Config.ARGB_4444);
    mBitmapCanvas=new Canvas(mPathBitmap);
  }
  mPathBitmap.eraseColor(Color.TRANSPARENT);
  LineData lineData=mChart.getLineData();
  for (  LineDataSet set : lineData.getDataSets()) {
    if (set.isVisible())     drawDataSet(c,set);
  }
}
Program: 18556
Project: 18556
Buggy source:
protected void drawCubicFill(Canvas c,LineDataSet dataSet,Path spline,Transformer trans,int from,int to){
  float fillMin=mChart.getFillFormatter().getFillLinePosition(dataSet,mChart.getLineData(),mChart.getYChartMax(),mChart.getYChartMin());
  Entry entryFrom=dataSet.getEntryForXIndex(mMinX);
  Entry entryTo=dataSet.getEntryForXIndex(mMaxX);
  spline.lineTo(entryTo.getXIndex(),fillMin);
  spline.lineTo(entryFrom.getXIndex(),fillMin);
  spline.close();
  mRenderPaint.setStyle(Paint.Style.FILL);
  mRenderPaint.setColor(dataSet.getFillColor());
  mRenderPaint.setAlpha(dataSet.getFillAlpha());
  trans.pathValueToPixel(spline);
  mPathCanvas.drawPath(spline,mRenderPaint);
  mRenderPaint.setAlpha(255);
}

Fixed version (ground truth):
protected void drawCubicFill(Canvas c,LineDataSet dataSet,Path spline,Transformer trans,int from,int to){
  float fillMin=mChart.getFillFormatter().getFillLinePosition(dataSet,mChart.getLineData(),mChart.getYChartMax(),mChart.getYChartMin());
  Entry entryFrom=dataSet.getEntryForXIndex(mMinX);
  Entry entryTo=dataSet.getEntryForXIndex(mMaxX + 1);
  spline.lineTo(entryTo.getXIndex(),fillMin);
  spline.lineTo(entryFrom.getXIndex(),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: 18558
Project: 18558
Buggy source:
@Override public void drawData(Canvas c){
  PieData pieData=mChart.getData();
  for (  PieDataSet set : pieData.getDataSets()) {
    if (set.isVisible())     drawDataSet(c,set);
  }
}

Fixed version (ground truth):
@Override public void drawData(Canvas c){
  if (mDrawBitmap == null) {
    mDrawBitmap=Bitmap.createBitmap((int)mViewPortHandler.getChartWidth(),(int)mViewPortHandler.getChartHeight(),Bitmap.Config.ARGB_4444);
    mBitmapCanvas=new Canvas(mDrawBitmap);
  }
  mDrawBitmap.eraseColor(Color.TRANSPARENT);
  PieData pieData=mChart.getData();
  for (  PieDataSet set : pieData.getDataSets()) {
    if (set.isVisible())     drawDataSet(c,set);
  }
  c.drawBitmap(mDrawBitmap,0,0,mRenderPaint);
}
Program: 18559
Project: 18559
Buggy source:
protected void drawDataSet(Canvas c,PieDataSet dataSet){
  float angle=mChart.getRotationAngle();
  int cnt=0;
  ArrayList<Entry> entries=dataSet.getYVals();
  float[] drawAngles=mChart.getDrawAngles();
  for (int j=0; j < entries.size(); j++) {
    float newangle=drawAngles[cnt];
    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));
        c.drawArc(mChart.getCircleBox(),angle + sliceSpace / 2f,newangle * mAnimator.getPhaseY() - sliceSpace / 2f,true,mRenderPaint);
      }
    }
    angle+=newangle * mAnimator.getPhaseX();
    cnt++;
  }
}

Fixed version (ground truth):
protected void drawDataSet(Canvas c,PieDataSet dataSet){
  float angle=mChart.getRotationAngle();
  int cnt=0;
  ArrayList<Entry> entries=dataSet.getYVals();
  float[] drawAngles=mChart.getDrawAngles();
  for (int j=0; j < entries.size(); j++) {
    float newangle=drawAngles[cnt];
    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,newangle * mAnimator.getPhaseY() - sliceSpace / 2f,true,mRenderPaint);
      }
    }
    angle+=newangle * mAnimator.getPhaseX();
    cnt++;
  }
}
Program: 18560
Project: 18560
Buggy source:
/** 
 * draws the hole in the center of the chart and the transparent circle / hole
 */
protected void drawHole(Canvas c){
  if (mChart.isDrawHoleEnabled()) {
    float transparentCircleRadius=mChart.getTransparentCircleRadius();
    float holeRadius=mChart.getHoleRadius();
    float radius=mChart.getRadius();
    PointF center=mChart.getCenterCircleBox();
    int color=mHolePaint.getColor();
    c.drawCircle(center.x,center.y,radius / 100 * holeRadius,mHolePaint);
    if (transparentCircleRadius > holeRadius) {
      mHolePaint.setColor(color & 0x60FFFFFF);
      c.drawCircle(center.x,center.y,radius / 100 * transparentCircleRadius,mHolePaint);
      mHolePaint.setColor(color);
    }
  }
}

Fixed version (ground truth):
/** 
 * draws the hole in the center of the chart and the transparent circle / hole
 */
protected void drawHole(Canvas c){
  if (mChart.isDrawHoleEnabled()) {
    float transparentCircleRadius=mChart.getTransparentCircleRadius();
    float holeRadius=mChart.getHoleRadius();
    float radius=mChart.getRadius();
    PointF center=mChart.getCenterCircleBox();
    int color=mHolePaint.getColor();
    mBitmapCanvas.drawCircle(center.x,center.y,radius / 100 * holeRadius,mHolePaint);
    if (transparentCircleRadius > holeRadius) {
      mHolePaint.setColor(color & 0x60FFFFFF);
      mBitmapCanvas.drawCircle(center.x,center.y,radius / 100 * transparentCircleRadius,mHolePaint);
      mHolePaint.setColor(color);
    }
  }
}
Program: 18562
Project: 18562
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;
    if (xIndex == 0)     angle=rotationAngle;
 else     angle=rotationAngle + absoluteAngles[xIndex - 1];
    angle*=mAnimator.getPhaseY();
    float sliceDegrees=drawAngles[xIndex];
    PieDataSet set=mChart.getData().getDataSetByIndex(indices[i].getDataSetIndex());
    if (set == null)     continue;
    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));
    c.drawArc(highlighted,angle + set.getSliceSpace() / 2f,sliceDegrees - 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;
    if (xIndex == 0)     angle=rotationAngle;
 else     angle=rotationAngle + absoluteAngles[xIndex - 1];
    angle*=mAnimator.getPhaseY();
    float sliceDegrees=drawAngles[xIndex];
    PieDataSet set=mChart.getData().getDataSetByIndex(indices[i].getDataSetIndex());
    if (set == null)     continue;
    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 - set.getSliceSpace() / 2f,true,mRenderPaint);
  }
}
Program: 18563
Project: 18563
Buggy source:
public YAxisRendererHorizontalBarChart(ViewPortHandler viewPortHandler,YAxis yAxis,Transformer trans){
  super(viewPortHandler,yAxis,trans);
}

Fixed version (ground truth):
public YAxisRendererHorizontalBarChart(ViewPortHandler viewPortHandler,YAxis yAxis,Transformer trans){
  super(viewPortHandler,yAxis,trans);
  mLimitLinePaint.setTextAlign(Align.LEFT);
}
Program: 18565
Project: 18565
Buggy source:
public boolean isUsePercentValuesEnabled(){
  return mUsePercentValues;
}

Fixed version (ground truth):
/** 
 * Returns true if using percentage values is enabled for the chart.
 * @return
 */
public boolean isUsePercentValuesEnabled(){
  return mUsePercentValues;
}
Program: 18566
Project: 18566
Buggy source:
/** 
 * Removes the DataSet at the given index in the DataSet array from the data object. Also recalculates all minimum and maximum values. Returns true if a DataSet was removed, false if no DataSet could be removed.
 * @param index
 */
public boolean removeDataSet(int index){
  if (mDataSets == null || index >= mDataSets.size() || index < 0)   return false;
  T set=mDataSets.get(index);
  return removeDataSet(set);
}

Fixed version (ground truth):
/** 
 * Removes the DataSet at the given index in the DataSet array from the data object. Also recalculates all minimum and maximum values. Returns true if a DataSet was removed, false if no DataSet could be removed.
 * @param index
 */
public boolean removeDataSet(int index){
  if (index >= mDataSets.size() || index < 0)   return false;
  T set=mDataSets.get(index);
  return removeDataSet(set);
}
Program: 18567
Project: 18567
Buggy source:
/** 
 * Adds an Entry to the DataSet at the specified index. Entries are added to the end of the list.
 * @param entry
 * @param dataSetIndex
 */
public void addEntry(Entry e,int dataSetIndex){
  if (mDataSets == null)   mDataSets=new ArrayList<T>();
  if (mDataSets.size() > dataSetIndex && dataSetIndex >= 0) {
    float val=e.getVal();
    mYValCount+=1;
    mYValueSum+=val;
    if (mYMax < val)     mYMax=val;
    if (mYMin > val)     mYMin=val;
    if (mDataSets == null)     mDataSets=new ArrayList<T>();
    T set=mDataSets.get(dataSetIndex);
    if (set != null) {
      if (set.getAxisDependency() == AxisDependency.LEFT) {
        if (mLeftAxisMax < e.getVal())         mLeftAxisMax=e.getVal();
        if (mLeftAxisMin > e.getVal())         mLeftAxisMin=e.getVal();
      }
 else {
        if (mRightAxisMax < e.getVal())         mRightAxisMax=e.getVal();
        if (mRightAxisMin > e.getVal())         mRightAxisMin=e.getVal();
      }
      handleEmptyAxis(getFirstLeft(),getFirstRight());
      set.addEntry(e);
    }
  }
 else {
    Log.e("String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Adds an Entry to the DataSet at the specified index. Entries are added to the end of the list.
 * @param entry
 * @param dataSetIndex
 */
public void addEntry(Entry e,int dataSetIndex){
  if (mDataSets.size() > dataSetIndex && dataSetIndex >= 0) {
    float val=e.getVal();
    mYValCount+=1;
    mYValueSum+=val;
    if (mYMax < val)     mYMax=val;
    if (mYMin > val)     mYMin=val;
    T set=mDataSets.get(dataSetIndex);
    if (set != null) {
      if (set.getAxisDependency() == AxisDependency.LEFT) {
        if (mLeftAxisMax < e.getVal())         mLeftAxisMax=e.getVal();
        if (mLeftAxisMin > e.getVal())         mLeftAxisMin=e.getVal();
      }
 else {
        if (mRightAxisMax < e.getVal())         mRightAxisMax=e.getVal();
        if (mRightAxisMin > e.getVal())         mRightAxisMin=e.getVal();
      }
      handleEmptyAxis(getFirstLeft(),getFirstRight());
      set.addEntry(e);
    }
  }
 else {
    Log.e("String_Node_Str","String_Node_Str");
  }
}
Program: 18568
Project: 18568
Buggy source:
/** 
 * Adds a DataSet dynamically.
 * @param d
 */
public void addDataSet(T d){
  if (mDataSets == null)   mDataSets=new ArrayList<T>();
  mDataSets.add(d);
  mYValCount+=d.getEntryCount();
  mYValueSum+=d.getYValueSum();
  if (mYMax < d.getYMax())   mYMax=d.getYMax();
  if (mYMin > d.getYMin())   mYMin=d.getYMin();
  if (d.getAxisDependency() == AxisDependency.LEFT) {
    if (mLeftAxisMax < d.getYMax())     mLeftAxisMax=d.getYMax();
    if (mLeftAxisMin > d.getYMin())     mLeftAxisMin=d.getYMin();
  }
 else {
    if (mRightAxisMax < d.getYMax())     mRightAxisMax=d.getYMax();
    if (mRightAxisMin > d.getYMin())     mRightAxisMin=d.getYMin();
  }
  handleEmptyAxis(getFirstLeft(),getFirstRight());
}

Fixed version (ground truth):
/** 
 * Adds a DataSet dynamically.
 * @param d
 */
public void addDataSet(T d){
  if (d == null)   return;
  mYValCount+=d.getEntryCount();
  mYValueSum+=d.getYValueSum();
  if (mDataSets.size() <= 0) {
    mYMax=d.getYMax();
    mYMin=d.getYMin();
    if (d.getAxisDependency() == AxisDependency.LEFT) {
      mLeftAxisMax=d.getYMax();
      mLeftAxisMin=d.getYMin();
    }
 else {
      mRightAxisMax=d.getYMax();
      mRightAxisMin=d.getYMin();
    }
  }
 else {
    if (mYMax < d.getYMax())     mYMax=d.getYMax();
    if (mYMin > d.getYMin())     mYMin=d.getYMin();
    if (d.getAxisDependency() == AxisDependency.LEFT) {
      if (mLeftAxisMax < d.getYMax())       mLeftAxisMax=d.getYMax();
      if (mLeftAxisMin > d.getYMin())       mLeftAxisMin=d.getYMin();
    }
 else {
      if (mRightAxisMax < d.getYMax())       mRightAxisMax=d.getYMax();
      if (mRightAxisMin > d.getYMin())       mRightAxisMin=d.getYMin();
    }
  }
  mDataSets.add(d);
  handleEmptyAxis(getFirstLeft(),getFirstRight());
}
Program: 18569
Project: 18569
Buggy source:
@Override public boolean onSingleTapUp(MotionEvent e){
  OnChartGestureListener l=mChart.getOnChartGestureListener();
  if (l != null) {
    l.onChartSingleTapped(e);
  }
  Highlight h=mChart.getHighlightByTouchPoint(e.getX(),e.getY());
  if (h == null || h.equalTo(mLastHighlighted)) {
    mChart.highlightTouch(null);
    mLastHighlighted=null;
  }
 else {
    mLastHighlighted=h;
    mChart.highlightTouch(h);
  }
  return super.onSingleTapUp(e);
}

Fixed version (ground truth):
@Override public boolean onSingleTapUp(MotionEvent e){
  OnChartGestureListener l=mChart.getOnChartGestureListener();
  if (l != null) {
    l.onChartSingleTapped(e);
  }
  performHighlight(e);
  return super.onSingleTapUp(e);
}
Program: 18570
Project: 18570
Buggy source:
@Override public boolean onDoubleTap(MotionEvent e){
  OnChartGestureListener l=mChart.getOnChartGestureListener();
  if (l != null) {
    l.onChartDoubleTapped(e);
    return super.onDoubleTap(e);
  }
  if (mChart.isDoubleTapToZoomEnabled()) {
    PointF trans=getTrans(e.getX(),e.getY());
    mChart.zoom(1.4f,1.4f,trans.x,trans.y);
    Log.i("String_Node_Str","String_Node_Str" + trans.x + "String_Node_Str"+ trans.y);
  }
  return super.onDoubleTap(e);
}

Fixed version (ground truth):
@Override public boolean onDoubleTap(MotionEvent e){
  OnChartGestureListener l=mChart.getOnChartGestureListener();
  if (l != null) {
    l.onChartDoubleTapped(e);
    return super.onDoubleTap(e);
  }
  if (mChart.isDoubleTapToZoomEnabled()) {
    PointF trans=getTrans(e.getX(),e.getY());
    mChart.zoom(1.4f,1.4f,trans.x,trans.y);
    if (mChart.isLogEnabled())     Log.i("String_Node_Str","String_Node_Str" + trans.x + "String_Node_Str"+ trans.y);
  }
  return super.onDoubleTap(e);
}
Program: 18571
Project: 18571
Buggy source:
@Override public void drawData(Canvas c){
  if (mPathBitmap == null) {
    mPathBitmap=Bitmap.createBitmap((int)mViewPortHandler.getChartWidth(),(int)mViewPortHandler.getChartHeight(),Bitmap.Config.ARGB_4444);
    mBitmapCanvas=new Canvas(mPathBitmap);
  }
  mPathBitmap.eraseColor(Color.TRANSPARENT);
  LineData lineData=mChart.getLineData();
  for (  LineDataSet set : lineData.getDataSets()) {
    if (set.isVisible())     drawDataSet(c,set);
  }
  c.drawBitmap(mPathBitmap,0,0,mRenderPaint);
  drawCircles(c);
}

Fixed version (ground truth):
@Override public void drawData(Canvas c){
  if (mPathBitmap == null) {
    mPathBitmap=Bitmap.createBitmap((int)mViewPortHandler.getChartWidth(),(int)mViewPortHandler.getChartHeight(),Bitmap.Config.ARGB_4444);
    mBitmapCanvas=new Canvas(mPathBitmap);
  }
  mPathBitmap.eraseColor(Color.TRANSPARENT);
  LineData lineData=mChart.getLineData();
  for (  LineDataSet set : lineData.getDataSets()) {
    if (set.isVisible())     drawDataSet(c,set);
  }
  c.drawBitmap(mPathBitmap,0,0,mRenderPaint);
}
Program: 18572
Project: 18572
Buggy source:
@Override public void drawExtras(Canvas c){
}

Fixed version (ground truth):
@Override public void drawExtras(Canvas c){
  drawCircles(c);
}
Program: 18573
Project: 18573
Buggy source:
@Override public void renderGridLines(Canvas c){
  calcXBounds(mTrans);
  if (!mXAxis.isDrawGridLinesEnabled() || !mXAxis.isEnabled())   return;
  float[] position=new float[]{0f,0f};
  mGridPaint.setColor(mXAxis.getGridColor());
  mGridPaint.setStrokeWidth(mXAxis.getGridLineWidth());
  for (int i=mMinX; i <= mMaxX; i+=mXAxis.mAxisLabelModulus) {
    position[0]=i;
    mTrans.pointValuesToPixel(position);
    if (position[0] >= mViewPortHandler.offsetLeft() && position[0] <= mViewPortHandler.getChartWidth()) {
      c.drawLine(position[0],mViewPortHandler.offsetTop(),position[0],mViewPortHandler.contentBottom(),mGridPaint);
    }
  }
}

Fixed version (ground truth):
@Override public void renderGridLines(Canvas c){
  if (!mXAxis.isDrawGridLinesEnabled() || !mXAxis.isEnabled())   return;
  float[] position=new float[]{0f,0f};
  mGridPaint.setColor(mXAxis.getGridColor());
  mGridPaint.setStrokeWidth(mXAxis.getGridLineWidth());
  for (int i=mMinX; i <= mMaxX; i+=mXAxis.mAxisLabelModulus) {
    position[0]=i;
    mTrans.pointValuesToPixel(position);
    if (position[0] >= mViewPortHandler.offsetLeft() && position[0] <= mViewPortHandler.getChartWidth()) {
      c.drawLine(position[0],mViewPortHandler.offsetTop(),position[0],mViewPortHandler.contentBottom(),mGridPaint);
    }
  }
}
Program: 18574
Project: 18574
Buggy source:
@Override public void renderAxisLine(Canvas c){
  if (!mXAxis.isDrawAxisLineEnabled() || !mXAxis.isEnabled())   return;
  mAxisLinePaint.setColor(mXAxis.getAxisLineColor());
  mAxisLinePaint.setStrokeWidth(mXAxis.getAxisLineWidth());
  if (mXAxis.getPosition() == XAxisPosition.TOP || mXAxis.getPosition() == XAxisPosition.TOP_INSIDE || mXAxis.getPosition() == XAxisPosition.BOTH_SIDED) {
    c.drawLine(mViewPortHandler.contentLeft(),mViewPortHandler.contentTop(),mViewPortHandler.contentRight(),mViewPortHandler.contentTop(),mAxisLinePaint);
  }
  if (mXAxis.getPosition() == XAxisPosition.BOTTOM || mXAxis.getPosition() == XAxisPosition.BOTTOM_INSIDE || mXAxis.getPosition() == XAxisPosition.BOTH_SIDED) {
    c.drawLine(mViewPortHandler.contentLeft(),mViewPortHandler.contentBottom(),mViewPortHandler.contentRight(),mViewPortHandler.contentBottom(),mAxisLinePaint);
  }
}

Fixed version (ground truth):
@Override public void renderAxisLine(Canvas c){
  calcXBounds(mTrans);
  if (!mXAxis.isDrawAxisLineEnabled() || !mXAxis.isEnabled())   return;
  mAxisLinePaint.setColor(mXAxis.getAxisLineColor());
  mAxisLinePaint.setStrokeWidth(mXAxis.getAxisLineWidth());
  if (mXAxis.getPosition() == XAxisPosition.TOP || mXAxis.getPosition() == XAxisPosition.TOP_INSIDE || mXAxis.getPosition() == XAxisPosition.BOTH_SIDED) {
    c.drawLine(mViewPortHandler.contentLeft(),mViewPortHandler.contentTop(),mViewPortHandler.contentRight(),mViewPortHandler.contentTop(),mAxisLinePaint);
  }
  if (mXAxis.getPosition() == XAxisPosition.BOTTOM || mXAxis.getPosition() == XAxisPosition.BOTTOM_INSIDE || mXAxis.getPosition() == XAxisPosition.BOTH_SIDED) {
    c.drawLine(mViewPortHandler.contentLeft(),mViewPortHandler.contentBottom(),mViewPortHandler.contentRight(),mViewPortHandler.contentBottom(),mAxisLinePaint);
  }
}
Program: 18575
Project: 18575
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.frag_simple_bar,container,false);
  mChart=new BarChart(getActivity());
  mChart.setDescription("String_Node_Str");
  MyMarkerView mv=new MyMarkerView(getActivity(),R.layout.custom_marker_view);
  mChart.setMarkerView(mv);
  mChart.setHighlightIndicatorEnabled(false);
  mChart.setDrawGridBackground(false);
  mChart.setDrawBarShadow(false);
  Typeface tf=Typeface.createFromAsset(getActivity().getAssets(),"String_Node_Str");
  mChart.setData(generateBarData(1,20000,12));
  Legend l=mChart.getLegend();
  l.setTypeface(tf);
  YAxis leftAxis=mChart.getAxisLeft();
  leftAxis.setTypeface(tf);
  mChart.getAxisRight().setEnabled(false);
  XAxis xAxis=mChart.getXAxis();
  xAxis.setEnabled(false);
  FrameLayout parent=(FrameLayout)v.findViewById(R.id.parentLayout);
  parent.addView(mChart);
  return v;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.frag_simple_bar,container,false);
  mChart=new BarChart(getActivity());
  mChart.setDescription("String_Node_Str");
  mChart.setOnChartGestureListener(this);
  MyMarkerView mv=new MyMarkerView(getActivity(),R.layout.custom_marker_view);
  mChart.setMarkerView(mv);
  mChart.setHighlightIndicatorEnabled(false);
  mChart.setDrawGridBackground(false);
  mChart.setDrawBarShadow(false);
  Typeface tf=Typeface.createFromAsset(getActivity().getAssets(),"String_Node_Str");
  mChart.setData(generateBarData(1,20000,12));
  Legend l=mChart.getLegend();
  l.setTypeface(tf);
  YAxis leftAxis=mChart.getAxisLeft();
  leftAxis.setTypeface(tf);
  mChart.getAxisRight().setEnabled(false);
  XAxis xAxis=mChart.getXAxis();
  xAxis.setEnabled(false);
  FrameLayout parent=(FrameLayout)v.findViewById(R.id.parentLayout);
  parent.addView(mChart);
  return v;
}
Program: 18576
Project: 18576
Buggy source:
@Override public boolean onSingleTapUp(MotionEvent e){
  OnChartGestureListener l=mChart.getOnChartGestureListener();
  if (l != null) {
    l.onChartSingleTapped(e);
  }
  performHighlight(e);
  return super.onSingleTapUp(e);
}

Fixed version (ground truth):
@Override public boolean onSingleTapUp(MotionEvent e){
  performHighlight(e);
  return super.onSingleTapUp(e);
}
Program: 18577
Project: 18577
Buggy source:
@Override public boolean onSingleTapConfirmed(MotionEvent e){
  return super.onSingleTapConfirmed(e);
}

Fixed version (ground truth):
@Override public boolean onSingleTapConfirmed(MotionEvent e){
  OnChartGestureListener l=mChart.getOnChartGestureListener();
  if (l != null) {
    l.onChartSingleTapped(e);
  }
  return super.onSingleTapConfirmed(e);
}
Program: 18578
Project: 18578
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_combined);
  mChart=(CombinedChart)findViewById(R.id.chart1);
  mChart.setDescription("String_Node_Str");
  mChart.setDrawGridBackground(false);
  mChart.setDrawBarShadow(false);
  mChart.setDrawOrder(new DrawOrder[]{DrawOrder.BAR,DrawOrder.LINE,DrawOrder.CANDLE});
  YAxis rightAxis=mChart.getAxisRight();
  rightAxis.setDrawGridLines(false);
  YAxis leftAxis=mChart.getAxisLeft();
  leftAxis.setDrawGridLines(false);
  XAxis xAxis=mChart.getXAxis();
  xAxis.setPosition(XAxisPosition.BOTH_SIDED);
  CombinedData data=new CombinedData(mMonths);
  data.setData(generateLineData());
  data.setData(generateBarData());
  mChart.setData(data);
  mChart.invalidate();
}

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_combined);
  mChart=(CombinedChart)findViewById(R.id.chart1);
  mChart.setDescription("String_Node_Str");
  mChart.setDrawGridBackground(false);
  mChart.setDrawBarShadow(false);
  mChart.setDrawOrder(new DrawOrder[]{DrawOrder.BAR,DrawOrder.LINE});
  YAxis rightAxis=mChart.getAxisRight();
  rightAxis.setDrawGridLines(false);
  YAxis leftAxis=mChart.getAxisLeft();
  leftAxis.setDrawGridLines(false);
  XAxis xAxis=mChart.getXAxis();
  xAxis.setPosition(XAxisPosition.BOTH_SIDED);
  CombinedData data=new CombinedData(mMonths);
  data.setData(generateLineData());
  data.setData(generateBarData());
  mChart.setData(data);
  mChart.invalidate();
}
Program: 18579
Project: 18579
Buggy source:
@Override public void drawData(Canvas c){
  if (mPathBitmap == null) {
    mPathBitmap=Bitmap.createBitmap((int)mViewPortHandler.getChartWidth(),(int)mViewPortHandler.getChartHeight(),Bitmap.Config.ARGB_4444);
    mBitmapCanvas=new Canvas(mPathBitmap);
  }
  mPathBitmap.eraseColor(Color.TRANSPARENT);
  LineData lineData=mChart.getLineData();
  for (  LineDataSet set : lineData.getDataSets()) {
    if (set.isVisible())     drawDataSet(c,set);
  }
  c.drawBitmap(mPathBitmap,0,0,mRenderPaint);
}

Fixed version (ground truth):
@Override public void drawData(Canvas c){
  if (mPathBitmap == null) {
    mPathBitmap=Bitmap.createBitmap((int)mViewPortHandler.getChartWidth(),(int)mViewPortHandler.getChartHeight(),Bitmap.Config.ARGB_4444);
    mBitmapCanvas=new Canvas(mPathBitmap);
  }
  mPathBitmap.eraseColor(Color.TRANSPARENT);
  LineData lineData=mChart.getLineData();
  for (  LineDataSet set : lineData.getDataSets()) {
    if (set.isVisible())     drawDataSet(c,set);
  }
  c.drawBitmap(mPathBitmap,0,0,mRenderPaint);
  drawCircles(c);
}
Program: 18580
Project: 18580
Buggy source:
@Override public void drawExtras(Canvas c){
  drawCircles(c);
}

Fixed version (ground truth):
@Override public void drawExtras(Canvas c){
}
Program: 18581
Project: 18581
Buggy source:
protected void drawCircles(Canvas c){
  mRenderPaint.setStyle(Paint.Style.FILL);
  float phaseX=mAnimator.getPhaseX();
  float phaseY=mAnimator.getPhaseY();
  ArrayList<LineDataSet> dataSets=mChart.getLineData().getDataSets();
  for (int i=0; i < dataSets.size(); i++) {
    LineDataSet dataSet=dataSets.get(i);
    if (!dataSet.isVisible() || !dataSet.isDrawCirclesEnabled())     continue;
    mCirclePaintInner.setColor(dataSet.getCircleHoleColor());
    Transformer trans=mChart.getTransformer(dataSet.getAxisDependency());
    ArrayList<Entry> entries=dataSet.getYVals();
    CircleBuffer buffer=mCircleBuffers[i];
    buffer.setPhases(phaseX,phaseY);
    buffer.feed(entries);
    trans.pointValuesToPixel(buffer.buffer);
    float halfsize=dataSet.getCircleSize() / 2f;
    for (int j=0; j < buffer.size(); j+=2) {
      float x=buffer.buffer[j];
      float y=buffer.buffer[j + 1];
      if (!mViewPortHandler.isInBoundsRight(x))       break;
      if (!mViewPortHandler.isInBoundsLeft(x) || !mViewPortHandler.isInBoundsY(y))       continue;
      mRenderPaint.setColor(dataSet.getCircleColor(j / 2));
      c.drawCircle(x,y,dataSet.getCircleSize(),mRenderPaint);
      if (dataSet.isDrawCircleHoleEnabled())       c.drawCircle(x,y,halfsize,mCirclePaintInner);
    }
  }
}

Fixed version (ground truth):
protected void drawCircles(Canvas c){
  mRenderPaint.setStyle(Paint.Style.FILL);
  float phaseX=mAnimator.getPhaseX();
  float phaseY=mAnimator.getPhaseY();
  ArrayList<LineDataSet> dataSets=mChart.getLineData().getDataSets();
  for (int i=0; i < dataSets.size(); i++) {
    LineDataSet dataSet=dataSets.get(i);
    if (!dataSet.isVisible() || !dataSet.isDrawCirclesEnabled())     continue;
    mCirclePaintInner.setColor(dataSet.getCircleHoleColor());
    Transformer trans=mChart.getTransformer(dataSet.getAxisDependency());
    ArrayList<Entry> entries=dataSet.getYVals();
    CircleBuffer buffer=mCircleBuffers[i];
    buffer.setPhases(phaseX,phaseY);
    buffer.feed(entries);
    trans.pointValuesToPixel(buffer.buffer);
    float halfsize=dataSet.getCircleSize() / 2f;
    for (int j=0; j < buffer.size(); j+=2) {
      float x=buffer.buffer[j];
      float y=buffer.buffer[j + 1];
      if (!mViewPortHandler.isInBoundsRight(x))       break;
      if (!mViewPortHandler.isInBoundsLeft(x) || !mViewPortHandler.isInBoundsY(y))       continue;
      int circleColor=dataSet.getCircleColor(j / 2);
      mRenderPaint.setColor(circleColor);
      c.drawCircle(x,y,dataSet.getCircleSize(),mRenderPaint);
      if (dataSet.isDrawCircleHoleEnabled() && circleColor != mCirclePaintInner.getColor())       c.drawCircle(x,y,halfsize,mCirclePaintInner);
    }
  }
}
Program: 18582
Project: 18582
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=10; i < count - 10; i++) {
    float mult=(range + 1);
    float val=(float)(Math.random() * mult) + 3;
    yVals.add(new Entry(val,i));
  }
  LineDataSet set1=new LineDataSet(yVals,"String_Node_Str");
  set1.enableDashedLine(10f,5f,0f);
  set1.setColor(Color.BLACK);
  set1.setCircleColor(Color.BLACK);
  set1.setLineWidth(1f);
  set1.setCircleSize(3f);
  set1.setDrawCircleHole(false);
  set1.setValueTextSize(9f);
  set1.setFillAlpha(65);
  set1.setFillColor(Color.BLACK);
  ArrayList<LineDataSet> dataSets=new ArrayList<LineDataSet>();
  dataSets.add(set1);
  LineData data=new LineData(xVals,dataSets);
  LimitLine ll1=new LimitLine(130f,"String_Node_Str");
  ll1.setLineWidth(4f);
  ll1.enableDashedLine(10f,10f,0f);
  ll1.setLabelPosition(LimitLabelPosition.POS_RIGHT);
  ll1.setTextSize(10f);
  LimitLine ll2=new LimitLine(-30f,"String_Node_Str");
  ll2.setLineWidth(4f);
  ll2.enableDashedLine(10f,10f,0f);
  ll2.setLabelPosition(LimitLabelPosition.POS_RIGHT);
  ll2.setTextSize(10f);
  YAxis leftAxis=mChart.getAxisLeft();
  leftAxis.addLimitLine(ll1);
  leftAxis.addLimitLine(ll2);
  leftAxis.setAxisMaxValue(220f);
  leftAxis.setAxisMinValue(-50f);
  leftAxis.setStartAtZero(false);
  mChart.getAxisRight().setEnabled(false);
  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));
  }
  LineDataSet set1=new LineDataSet(yVals,"String_Node_Str");
  set1.enableDashedLine(10f,5f,0f);
  set1.setColor(Color.BLACK);
  set1.setCircleColor(Color.BLACK);
  set1.setLineWidth(1f);
  set1.setCircleSize(3f);
  set1.setDrawCircleHole(false);
  set1.setValueTextSize(9f);
  set1.setFillAlpha(65);
  set1.setFillColor(Color.BLACK);
  ArrayList<LineDataSet> dataSets=new ArrayList<LineDataSet>();
  dataSets.add(set1);
  LineData data=new LineData(xVals,dataSets);
  LimitLine ll1=new LimitLine(130f,"String_Node_Str");
  ll1.setLineWidth(4f);
  ll1.enableDashedLine(10f,10f,0f);
  ll1.setLabelPosition(LimitLabelPosition.POS_RIGHT);
  ll1.setTextSize(10f);
  LimitLine ll2=new LimitLine(-30f,"String_Node_Str");
  ll2.setLineWidth(4f);
  ll2.enableDashedLine(10f,10f,0f);
  ll2.setLabelPosition(LimitLabelPosition.POS_RIGHT);
  ll2.setTextSize(10f);
  YAxis leftAxis=mChart.getAxisLeft();
  leftAxis.addLimitLine(ll1);
  leftAxis.addLimitLine(ll2);
  leftAxis.setAxisMaxValue(220f);
  leftAxis.setAxisMinValue(-50f);
  leftAxis.setStartAtZero(false);
  mChart.getAxisRight().setEnabled(false);
  mChart.setData(data);
}
Program: 18583
Project: 18583
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));
  }
  LineDataSet set1=new LineDataSet(yVals,"String_Node_Str");
  set1.setColor(Color.BLACK);
  set1.setLineWidth(0.5f);
  set1.setDrawValues(false);
  set1.setDrawCircles(false);
  set1.setDrawCubic(false);
  set1.setDrawFilled(false);
  LineData data=new LineData(xVals,set1);
  mChart.setData(data);
  Legend l=mChart.getLegend();
  l.setEnabled(false);
}

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));
  }
  LineDataSet set1=new LineDataSet(yVals,"String_Node_Str");
  set1.setColor(Color.BLACK);
  set1.setLineWidth(0.5f);
  set1.setDrawValues(false);
  set1.setDrawCircles(false);
  set1.setDrawCubic(false);
  set1.setDrawFilled(true);
  LineData data=new LineData(xVals,set1);
  mChart.setData(data);
  Legend l=mChart.getLegend();
  l.setEnabled(false);
}
Program: 18584
Project: 18584
Buggy source:
/** 
 * Set this to true to enable scaling (zooming in and out by gesture) for the chart (this does not effect dragging).
 * @param enabled
 */
public void setScaleEnabled(boolean enabled){
  this.mScaleEnabled=enabled;
}

Fixed version (ground truth):
/** 
 * Set this to true to enable scaling (zooming in and out by gesture) for the chart (this does not effect dragging) on both X- and Y-Axis.
 * @param enabled
 */
public void setScaleEnabled(boolean enabled){
  this.mScaleXEnabled=enabled;
  this.mScaleYEnabled=enabled;
}
Program: 18585
Project: 18585
Buggy source:
/** 
 * Setting this to true will set the layer-type HARDWARE for the view, false will set layer-type SOFTWARE.
 * @param enabled
 */
public void setHardwareAccelerationEnabled(boolean enabled){
  if (enabled)   setLayerType(View.LAYER_TYPE_HARDWARE,null);
 else   setLayerType(View.LAYER_TYPE_SOFTWARE,null);
}

Fixed version (ground truth):
/** 
 * Setting this to true will set the layer-type HARDWARE for the view, false will set layer-type SOFTWARE.
 * @param enabled
 */
public void setHardwareAccelerationEnabled(boolean enabled){
  if (android.os.Build.VERSION.SDK_INT >= 11) {
    if (enabled)     setLayerType(View.LAYER_TYPE_HARDWARE,null);
 else     setLayerType(View.LAYER_TYPE_SOFTWARE,null);
  }
 else {
    Log.e(LOG_TAG,"String_Node_Str");
  }
}
Program: 18586
Project: 18586
Buggy source:
/** 
 * If set to true, the linechart lines are drawn in cubic-style instead of linear. Default: false
 * @param enabled
 */
public void setDrawCubic(boolean enabled){
  mDrawCubic=enabled;
}

Fixed version (ground truth):
/** 
 * If set to true, the linechart lines are drawn in cubic-style instead of linear. This affects performance! Default: false
 * @param enabled
 */
public void setDrawCubic(boolean enabled){
  mDrawCubic=enabled;
}
Program: 18587
Project: 18587
Buggy source:
/** 
 * Set to true if the DataSet should be drawn filled (surface), and not just as a line, disabling this will give up to 20% performance boost on large datasets, default: false
 * @param filled
 */
public void setDrawFilled(boolean filled){
  mDrawFilled=filled;
}

Fixed version (ground truth):
/** 
 * 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;
}
Program: 18588
Project: 18588
Buggy source:
/** 
 * Performs the all operations necessary for pinch and axis zoom.
 * @param event
 */
private void performZoom(MotionEvent event){
  if (event.getPointerCount() >= 2) {
    float totalDist=spacing(event);
    if (totalDist > 10f) {
      PointF t=getTrans(mTouchPointCenter.x,mTouchPointCenter.y);
      if (mTouchMode == PINCH_ZOOM) {
        float scale=totalDist / mSavedDist;
        mMatrix.set(mSavedMatrix);
        mMatrix.postScale(scale,scale,t.x,t.y);
      }
 else       if (mTouchMode == X_ZOOM) {
        float xDist=getXDist(event);
        float scaleX=xDist / mSavedXDist;
        mMatrix.set(mSavedMatrix);
        mMatrix.postScale(scaleX,1f,t.x,t.y);
      }
 else       if (mTouchMode == Y_ZOOM) {
        float yDist=getYDist(event);
        float scaleY=yDist / mSavedYDist;
        mMatrix.set(mSavedMatrix);
        mMatrix.postScale(1f,scaleY,t.x,t.y);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Performs the all operations necessary for pinch and axis zoom.
 * @param event
 */
private void performZoom(MotionEvent event){
  if (event.getPointerCount() >= 2) {
    float totalDist=spacing(event);
    if (totalDist > 10f) {
      PointF t=getTrans(mTouchPointCenter.x,mTouchPointCenter.y);
      if (mTouchMode == PINCH_ZOOM) {
        float scale=totalDist / mSavedDist;
        mMatrix.set(mSavedMatrix);
        mMatrix.postScale((mChart.isScaleXEnabled()) ? scale : 1f,(mChart.isScaleYEnabled()) ? scale : 1f,t.x,t.y);
      }
 else       if (mTouchMode == X_ZOOM && mChart.isScaleXEnabled()) {
        float xDist=getXDist(event);
        float scaleX=xDist / mSavedXDist;
        mMatrix.set(mSavedMatrix);
        mMatrix.postScale(scaleX,1f,t.x,t.y);
      }
 else       if (mTouchMode == Y_ZOOM && mChart.isScaleYEnabled()) {
        float yDist=getYDist(event);
        float scaleY=yDist / mSavedYDist;
        mMatrix.set(mSavedMatrix);
        mMatrix.postScale(1f,scaleY,t.x,t.y);
      }
    }
  }
}
Program: 18591
Project: 18591
Buggy source:
protected void drawLinearFill(Canvas c,LineDataSet dataSet,ArrayList<Entry> entries,Transformer trans){
  mRenderPaint.setStyle(Paint.Style.FILL);
  mRenderPaint.setColor(dataSet.getFillColor());
  mRenderPaint.setAlpha(dataSet.getFillAlpha());
  Path filled=generateFilledPath(entries,mChart.getFillFormatter().getFillLinePosition(dataSet,mChart.getLineData(),mChart.getYChartMax(),mChart.getYChartMin()),mMinX,mMaxX + 1);
  trans.pathValueToPixel(filled);
  c.drawPath(filled,mRenderPaint);
  mRenderPaint.setAlpha(255);
}

Fixed version (ground truth):
protected void drawLinearFill(Canvas c,LineDataSet dataSet,ArrayList<Entry> entries,Transformer trans){
  Entry entryFrom=dataSet.getEntryForXIndex(mMinX - 2);
  Entry entryTo=dataSet.getEntryForXIndex(mMaxX + 2);
  int minx=dataSet.getEntryPosition(entryFrom);
  int maxx=dataSet.getEntryPosition(entryTo);
  mRenderPaint.setStyle(Paint.Style.FILL);
  mRenderPaint.setColor(dataSet.getFillColor());
  mRenderPaint.setAlpha(dataSet.getFillAlpha());
  Path filled=generateFilledPath(entries,mChart.getFillFormatter().getFillLinePosition(dataSet,mChart.getLineData(),mChart.getYChartMax(),mChart.getYChartMin()),minx,maxx);
  trans.pathValueToPixel(filled);
  c.drawPath(filled,mRenderPaint);
  mRenderPaint.setAlpha(255);
}
Program: 18593
Project: 18593
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_performance_linechart);
  mTvCount=(TextView)findViewById(R.id.tvValueCount);
  mSeekBarValues=(SeekBar)findViewById(R.id.seekbarValues);
  mTvCount.setText("String_Node_Str");
  mSeekBarValues.setProgress(500);
  mSeekBarValues.setOnSeekBarChangeListener(this);
  mChart=(LineChart)findViewById(R.id.chart1);
  mChart.setDrawGridBackground(false);
  mChart.setDescription("String_Node_Str");
  mChart.setNoDataTextDescription("String_Node_Str");
  mChart.setHighlightEnabled(false);
  mChart.setTouchEnabled(true);
  mChart.setDragEnabled(true);
  mChart.setScaleEnabled(true);
  mChart.setPinchZoom(false);
  mChart.setHighlightIndicatorEnabled(false);
  mChart.getAxisLeft().setDrawGridLines(false);
  mChart.getAxisRight().setEnabled(false);
  mChart.getXAxis().setDrawGridLines(false);
  mChart.getXAxis().setDrawAxisLine(false);
  mChart.invalidate();
}

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_performance_linechart);
  mTvCount=(TextView)findViewById(R.id.tvValueCount);
  mSeekBarValues=(SeekBar)findViewById(R.id.seekbarValues);
  mTvCount.setText("String_Node_Str");
  mSeekBarValues.setProgress(500);
  mSeekBarValues.setOnSeekBarChangeListener(this);
  mChart=(LineChart)findViewById(R.id.chart1);
  mChart.setDrawGridBackground(false);
  mChart.setDescription("String_Node_Str");
  mChart.setNoDataTextDescription("String_Node_Str");
  mChart.setHighlightEnabled(false);
  mChart.setTouchEnabled(true);
  mChart.setDragEnabled(true);
  mChart.setScaleEnabled(true);
  mChart.setPinchZoom(false);
  mChart.setHighlightIndicatorEnabled(false);
  mChart.getAxisLeft().setDrawGridLines(false);
  mChart.getAxisRight().setEnabled(false);
  mChart.getXAxis().setDrawGridLines(true);
  mChart.getXAxis().setDrawAxisLine(false);
  mChart.invalidate();
}