nus-yam/ex-repair huggingface dataset:
Program: 26635
Project: 26635
Buggy source:
/** 
 * draws the x-labels on the specified y-position
 * @param pos
 */
protected void drawLabels(Canvas c,float pos){
  float[] position=new float[]{0f,0f};
  int maxx=mMaxX + 1;
  int minx=mMinX - 1;
  if (maxx > mXAxis.getValues().size())   maxx=mXAxis.getValues().size();
  if (minx < 0)   minx=0;
  for (int i=minx; i < maxx; i+=mXAxis.mAxisLabelModulus) {
    position[0]=i;
    mTrans.pointValuesToPixel(position);
    if (mViewPortHandler.isInBoundsX(position[0])) {
      String label=mXAxis.getValues().get(i);
      if (mXAxis.isAvoidFirstLastClippingEnabled()) {
        if (i == mXAxis.getValues().size() - 1 && mXAxis.getValues().size() > 1) {
          float width=Utils.calcTextWidth(mAxisPaint,label);
          if (width > mViewPortHandler.offsetRight() * 2 && position[0] + width > mViewPortHandler.getChartWidth())           position[0]-=width / 2;
        }
 else         if (i == 0) {
          float width=Utils.calcTextWidth(mAxisPaint,label);
          position[0]+=width / 2;
        }
      }
      c.drawText(label,position[0],pos,mAxisPaint);
    }
  }
}

Fixed version (ground truth):
/** 
 * draws the x-labels on the specified y-position
 * @param pos
 */
protected void drawLabels(Canvas c,float pos){
  float[] position=new float[]{0f,0f};
  int maxx=mMaxX;
  int minx=mMinX;
  if (maxx > mXAxis.getValues().size())   maxx=mXAxis.getValues().size();
  if (minx < 0)   minx=0;
  for (int i=minx; i <= maxx; i+=mXAxis.mAxisLabelModulus) {
    position[0]=i;
    mTrans.pointValuesToPixel(position);
    if (mViewPortHandler.isInBoundsX(position[0])) {
      String label=mXAxis.getValues().get(i);
      if (mXAxis.isAvoidFirstLastClippingEnabled()) {
        if (i == mXAxis.getValues().size() - 1 && mXAxis.getValues().size() > 1) {
          float width=Utils.calcTextWidth(mAxisPaint,label);
          if (width > mViewPortHandler.offsetRight() * 2 && position[0] + width > mViewPortHandler.getChartWidth())           position[0]-=width / 2;
        }
 else         if (i == 0) {
          float width=Utils.calcTextWidth(mAxisPaint,label);
          position[0]+=width / 2;
        }
      }
      c.drawText(label,position[0],pos,mAxisPaint);
    }
  }
}
Program: 26636
Project: 26636
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());
  BarData bd=mChart.getData();
  int step=bd.getDataSetCount();
  for (int i=0; i < mXAxis.getValues().size(); i+=mXAxis.mAxisLabelModulus) {
    position[0]=i * step + i * bd.getGroupSpace() - 0.5f;
    mTrans.pointValuesToPixel(position);
    if (mViewPortHandler.isInBoundsX(position[0])) {
      c.drawLine(position[0],mViewPortHandler.offsetTop(),position[0],mViewPortHandler.contentBottom(),mGridPaint);
    }
  }
}

Fixed version (ground truth):
@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());
  BarData bd=mChart.getData();
  int step=bd.getDataSetCount();
  float div=(float)step + (step > 1 ? bd.getGroupSpace() : 0f);
  float min=(float)mMinX / div;
  float max=(float)mMaxX / div;
  for (int i=(int)min; i <= max; i+=mXAxis.mAxisLabelModulus) {
    position[0]=i * step + i * bd.getGroupSpace() - 0.5f;
    mTrans.pointValuesToPixel(position);
    if (mViewPortHandler.isInBoundsX(position[0])) {
      c.drawLine(position[0],mViewPortHandler.offsetTop(),position[0],mViewPortHandler.contentBottom(),mGridPaint);
    }
  }
}
Program: 26637
Project: 26637
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: 26638
Project: 26638
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: 26639
Project: 26639
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: 26640
Project: 26640
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: 26641
Project: 26641
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: 26642
Project: 26642
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: 26643
Project: 26643
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: 26646
Project: 26646
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: 26647
Project: 26647
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: 26648
Project: 26648
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: 26649
Project: 26649
Buggy source:
@Override public void drawExtras(Canvas c){
  drawCircles(c);
}

Fixed version (ground truth):
@Override public void drawExtras(Canvas c){
}
Program: 26650
Project: 26650
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: 26651
Project: 26651
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: 26652
Project: 26652
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: 26653
Project: 26653
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: 26654
Project: 26654
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: 26655
Project: 26655
Buggy source:
private void setData(int count,float range){
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < count; i++) {
    xVals.add((1990 + i) + "String_Node_Str");
  }
  ArrayList<Entry> vals1=new ArrayList<Entry>();
  for (int i=5; i < count - 5; i++) {
    float mult=(range + 1);
    float val=(float)(Math.random() * mult) + 20;
    vals1.add(new Entry(val,i));
  }
  LineDataSet set1=new LineDataSet(vals1,"String_Node_Str");
  set1.setDrawCubic(true);
  set1.setCubicIntensity(0.2f);
  set1.setDrawCircles(false);
  set1.setLineWidth(2f);
  set1.setCircleSize(5f);
  set1.setHighLightColor(Color.rgb(244,117,117));
  set1.setColor(Color.rgb(104,241,175));
  set1.setFillColor(ColorTemplate.getHoloBlue());
  LineData data=new LineData(xVals,set1);
  data.setValueTypeface(tf);
  data.setValueTextSize(9f);
  data.setDrawValues(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((1990 + i) + "String_Node_Str");
  }
  ArrayList<Entry> vals1=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float mult=(range + 1);
    float val=(float)(Math.random() * mult) + 20;
    vals1.add(new Entry(val,i));
  }
  LineDataSet set1=new LineDataSet(vals1,"String_Node_Str");
  set1.setDrawCubic(true);
  set1.setCubicIntensity(0.2f);
  set1.setDrawCircles(false);
  set1.setLineWidth(2f);
  set1.setCircleSize(5f);
  set1.setHighLightColor(Color.rgb(244,117,117));
  set1.setColor(Color.rgb(104,241,175));
  set1.setFillColor(ColorTemplate.getHoloBlue());
  LineData data=new LineData(xVals,set1);
  data.setValueTypeface(tf);
  data.setValueTextSize(9f);
  data.setDrawValues(false);
  mChart.setData(data);
}
Program: 26656
Project: 26656
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> yVals1=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float mult=range / 2f;
    float val=(float)(Math.random() * mult) + 50;
    yVals1.add(new Entry(val,i));
  }
  LineDataSet set1=new LineDataSet(yVals1,"String_Node_Str");
  set1.setAxisDependency(AxisDependency.LEFT);
  set1.setColor(ColorTemplate.getHoloBlue());
  set1.setCircleColor(ColorTemplate.getHoloBlue());
  set1.setLineWidth(2f);
  set1.setCircleSize(4f);
  set1.setFillAlpha(65);
  set1.setFillColor(ColorTemplate.getHoloBlue());
  set1.setHighLightColor(Color.rgb(244,117,117));
  ArrayList<Entry> yVals2=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float mult=range;
    float val=(float)(Math.random() * mult) + 450;
    yVals2.add(new Entry(val,i));
  }
  LineDataSet set2=new LineDataSet(yVals2,"String_Node_Str");
  set2.setAxisDependency(AxisDependency.RIGHT);
  set2.setColor(Color.RED);
  set2.setCircleColor(Color.RED);
  set2.setLineWidth(2f);
  set2.setCircleSize(4f);
  set2.setFillAlpha(65);
  set2.setFillColor(Color.RED);
  set2.setHighLightColor(Color.rgb(244,117,117));
  ArrayList<LineDataSet> dataSets=new ArrayList<LineDataSet>();
  dataSets.add(set1);
  dataSets.add(set2);
  LineData data=new LineData(xVals,dataSets);
  data.setValueTextColor(Color.WHITE);
  data.setValueTextSize(9f);
  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> yVals1=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float mult=range / 2f;
    float val=(float)(Math.random() * mult) + 50;
    yVals1.add(new Entry(val,i));
  }
  LineDataSet set1=new LineDataSet(yVals1,"String_Node_Str");
  set1.setAxisDependency(AxisDependency.LEFT);
  set1.setColor(ColorTemplate.getHoloBlue());
  set1.setCircleColor(Color.WHITE);
  set1.setLineWidth(2f);
  set1.setCircleSize(3f);
  set1.setFillAlpha(65);
  set1.setFillColor(ColorTemplate.getHoloBlue());
  set1.setHighLightColor(Color.rgb(244,117,117));
  set1.setDrawCircleHole(false);
  ArrayList<Entry> yVals2=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float mult=range;
    float val=(float)(Math.random() * mult) + 450;
    yVals2.add(new Entry(val,i));
  }
  LineDataSet set2=new LineDataSet(yVals2,"String_Node_Str");
  set2.setAxisDependency(AxisDependency.RIGHT);
  set2.setColor(Color.RED);
  set2.setCircleColor(Color.WHITE);
  set2.setLineWidth(2f);
  set2.setCircleSize(3f);
  set2.setFillAlpha(65);
  set2.setFillColor(Color.RED);
  set2.setDrawCircleHole(false);
  set2.setHighLightColor(Color.rgb(244,117,117));
  ArrayList<LineDataSet> dataSets=new ArrayList<LineDataSet>();
  dataSets.add(set1);
  dataSets.add(set2);
  LineData data=new LineData(xVals,dataSets);
  data.setValueTextColor(Color.WHITE);
  data.setValueTextSize(9f);
  mChart.setData(data);
}
Program: 26657
Project: 26657
Buggy source:
public LineBuffer(int size){
  super(size);
}

Fixed version (ground truth):
public LineBuffer(int size){
  super((size < 4) ? 4 : size);
}
Program: 26658
Project: 26658
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);
  }
}

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: 26660
Project: 26660
Buggy source:
@Override public void initBuffers(){
  LineData lineData=mChart.getLineData();
  mLineBuffers=new LineBuffer[lineData.getDataSetCount()];
  for (int i=0; i < mLineBuffers.length; i++) {
    LineDataSet set=lineData.getDataSetByIndex(i);
    int size=lineData.getXValCount() * 4 - 4;
    if (size < 4)     size=4;
    mLineBuffers[i]=new LineBuffer(size);
  }
  mCircleBuffers=new CircleBuffer[lineData.getDataSetCount()];
  for (int i=0; i < mCircleBuffers.length; i++) {
    LineDataSet set=lineData.getDataSetByIndex(i);
    mCircleBuffers[i]=new CircleBuffer(set.getEntryCount() * 2);
  }
}

Fixed version (ground truth):
@Override public void initBuffers(){
  LineData lineData=mChart.getLineData();
  mLineBuffers=new LineBuffer[lineData.getDataSetCount()];
  mCircleBuffers=new CircleBuffer[lineData.getDataSetCount()];
  for (int i=0; i < mLineBuffers.length; i++) {
    LineDataSet set=lineData.getDataSetByIndex(i);
    mLineBuffers[i]=new LineBuffer(set.getEntryCount() * 4 - 4);
    mCircleBuffers[i]=new CircleBuffer(set.getEntryCount() * 2);
  }
}
Program: 26662
Project: 26662
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;
    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) {
      mRenderPaint.setColor(dataSet.getCircleColor(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;
      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;
      mRenderPaint.setColor(dataSet.getCircleColor(j / 2));
      c.drawCircle(x,y,dataSet.getCircleSize(),mRenderPaint);
      if (dataSet.isDrawCircleHoleEnabled())       c.drawCircle(x,y,halfsize,mCirclePaintInner);
    }
  }
}
Program: 26663
Project: 26663
Buggy source:
/** 
 * draws the x-labels on the specified y-position
 * @param pos
 */
protected void drawLabels(Canvas c,float pos){
  float[] position=new float[]{0f,0f};
  int maxx=mMaxX;
  int minx=mMinX;
  if (maxx > mXAxis.getValues().size())   maxx=mXAxis.getValues().size();
  if (minx < 0)   minx=0;
  for (int i=minx; i <= maxx; i+=mXAxis.mAxisLabelModulus) {
    position[0]=i;
    mTrans.pointValuesToPixel(position);
    if (mViewPortHandler.isInBoundsX(position[0])) {
      String label=mXAxis.getValues().get(i);
      if (mXAxis.isAvoidFirstLastClippingEnabled()) {
        if (i == mXAxis.getValues().size() - 1 && mXAxis.getValues().size() > 1) {
          float width=Utils.calcTextWidth(mAxisPaint,label);
          if (width > mViewPortHandler.offsetRight() * 2 && position[0] + width > mViewPortHandler.getChartWidth())           position[0]-=width / 2;
        }
 else         if (i == 0) {
          float width=Utils.calcTextWidth(mAxisPaint,label);
          position[0]+=width / 2;
        }
      }
      c.drawText(label,position[0],pos,mAxisPaint);
    }
  }
}

Fixed version (ground truth):
/** 
 * draws the x-labels on the specified y-position
 * @param pos
 */
protected void drawLabels(Canvas c,float pos){
  float[] position=new float[]{0f,0f};
  int maxx=mMaxX;
  int minx=mMinX;
  if (maxx >= mXAxis.getValues().size())   maxx=mXAxis.getValues().size() - 1;
  if (minx < 0)   minx=0;
  for (int i=minx; i <= maxx; i+=mXAxis.mAxisLabelModulus) {
    position[0]=i;
    mTrans.pointValuesToPixel(position);
    if (mViewPortHandler.isInBoundsX(position[0])) {
      String label=mXAxis.getValues().get(i);
      if (mXAxis.isAvoidFirstLastClippingEnabled()) {
        if (i == mXAxis.getValues().size() - 1 && mXAxis.getValues().size() > 1) {
          float width=Utils.calcTextWidth(mAxisPaint,label);
          if (width > mViewPortHandler.offsetRight() * 2 && position[0] + width > mViewPortHandler.getChartWidth())           position[0]-=width / 2;
        }
 else         if (i == 0) {
          float width=Utils.calcTextWidth(mAxisPaint,label);
          position[0]+=width / 2;
        }
      }
      c.drawText(label,position[0],pos,mAxisPaint);
    }
  }
}
Program: 26665
Project: 26665
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: 26666
Project: 26666
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: 26667
Project: 26667
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: 26668
Project: 26668
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: 26669
Project: 26669
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: 26670
Project: 26670
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: 26671
Project: 26671
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: 26672
Project: 26672
Buggy source:
@Override public void drawExtras(Canvas c){
}

Fixed version (ground truth):
@Override public void drawExtras(Canvas c){
  drawCircles(c);
}
Program: 26673
Project: 26673
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: 26674
Project: 26674
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: 26675
Project: 26675
Buggy source:
private void setData(int count,float range){
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < count; i++) {
    xVals.add((1990 + i) + "String_Node_Str");
  }
  ArrayList<Entry> vals1=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float mult=(range + 1);
    float val=(float)(Math.random() * mult) + 20;
    vals1.add(new Entry(val,i));
  }
  LineDataSet set1=new LineDataSet(vals1,"String_Node_Str");
  set1.setDrawCubic(true);
  set1.setCubicIntensity(0.2f);
  set1.setDrawCircles(false);
  set1.setLineWidth(2f);
  set1.setCircleSize(5f);
  set1.setHighLightColor(Color.rgb(244,117,117));
  set1.setColor(Color.rgb(104,241,175));
  set1.setFillColor(ColorTemplate.getHoloBlue());
  LineData data=new LineData(xVals,set1);
  data.setValueTypeface(tf);
  data.setValueTextSize(9f);
  data.setDrawValues(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((1990 + i) + "String_Node_Str");
  }
  ArrayList<Entry> vals1=new ArrayList<Entry>();
  for (int i=5; i < count - 5; i++) {
    float mult=(range + 1);
    float val=(float)(Math.random() * mult) + 20;
    vals1.add(new Entry(val,i));
  }
  LineDataSet set1=new LineDataSet(vals1,"String_Node_Str");
  set1.setDrawCubic(true);
  set1.setCubicIntensity(0.2f);
  set1.setDrawCircles(false);
  set1.setLineWidth(2f);
  set1.setCircleSize(5f);
  set1.setHighLightColor(Color.rgb(244,117,117));
  set1.setColor(Color.rgb(104,241,175));
  set1.setFillColor(ColorTemplate.getHoloBlue());
  LineData data=new LineData(xVals,set1);
  data.setValueTypeface(tf);
  data.setValueTextSize(9f);
  data.setDrawValues(false);
  mChart.setData(data);
}