nus-yam/ex-repair huggingface dataset:
Program: 18671
Project: 18671
Buggy source:
@Override protected void calculateOffsets(){
  super.calculateOffsets();
  float offset=mData.getGreatestShapeSize() / 2f;
  mViewPortHandler.restrainViewPort(mViewPortHandler.offsetLeft() - offset,mViewPortHandler.offsetTop(),mViewPortHandler.offsetRight() - offset,mViewPortHandler.offsetBottom());
  prepareMatrix();
}

Fixed version (ground truth):
@Override protected void calculateOffsets(){
  super.calculateOffsets();
  float offset=mData.getGreatestShapeSize() / 2f;
  mViewPortHandler.restrainViewPort(mViewPortHandler.offsetLeft() - offset,mViewPortHandler.offsetTop(),mViewPortHandler.offsetRight() - offset,mViewPortHandler.offsetBottom());
  prepareOffsetMatrix();
}
Program: 18672
Project: 18672
Buggy source:
public void setAxisMinValue(float min){
  mCustomAxisMin=min;
}

Fixed version (ground truth):
/** 
 * Set a custom minimum value for this axis. If set, this value will not be calculated automatically depending on the provided data. Use resetAxisMinValue() to undo this.
 * @param min
 */
public void setAxisMinValue(float min){
  mCustomAxisMin=min;
}
Program: 18673
Project: 18673
Buggy source:
public void resetAxisMaxValue(){
  mCustomAxisMax=Float.NaN;
}

Fixed version (ground truth):
/** 
 * By calling this method, any custom maximum value that has been previously set is reseted, and the calculation is done automatically.
 */
public void resetAxisMaxValue(){
  mCustomAxisMax=Float.NaN;
}
Program: 18674
Project: 18674
Buggy source:
public void setAxisMaxValue(float max){
  mCustomAxisMax=max;
}

Fixed version (ground truth):
/** 
 * Set a custom maximum value for this axis. If set, this value will not be calculated automatically depending on the provided data. Use resetAxisMaxValue() to undo this.
 * @param max
 */
public void setAxisMaxValue(float max){
  mCustomAxisMax=max;
}
Program: 18675
Project: 18675
Buggy source:
public void resetAxisMinValue(){
  mCustomAxisMin=Float.NaN;
}

Fixed version (ground truth):
/** 
 * By calling this method, any custom minimum value that has been previously set is reseted, and the calculation is done automatically.
 */
public void resetAxisMinValue(){
  mCustomAxisMin=Float.NaN;
}
Program: 18676
Project: 18676
Buggy source:
@Override public void drawValues(Canvas c){
  if (mChart.getData().getYValCount() < mChart.getMaxVisibleCount() * mViewPortHandler.getScaleX()) {
    ArrayList<ScatterDataSet> dataSets=mChart.getData().getDataSets();
    for (int i=0; i < mChart.getData().getDataSetCount(); i++) {
      ScatterDataSet dataSet=dataSets.get(i);
      ArrayList<Entry> entries=dataSet.getYVals();
      float[] positions=mChart.getTransformer(dataSet.getAxisDependency()).generateTransformedValuesLineScatter(entries,mAnimator.getPhaseY());
      float shapeSize=dataSet.getScatterShapeSize();
      for (int j=0; j < positions.length * mAnimator.getPhaseX(); j+=2) {
        if (!mViewPortHandler.isInBoundsRight(positions[j]))         break;
        if (j != 0 && !mViewPortHandler.isInBoundsLeft(positions[j - 1]) && !mViewPortHandler.isInBoundsY(positions[j + 1]))         continue;
        float val=entries.get(j / 2).getVal();
        c.drawText(mChart.getValueFormatter().getFormattedValue(val),positions[j],positions[j + 1] - shapeSize,mValuePaint);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void drawValues(Canvas c){
  if (mChart.getData().getYValCount() < mChart.getMaxVisibleCount() * mViewPortHandler.getScaleX()) {
    ArrayList<ScatterDataSet> dataSets=mChart.getData().getDataSets();
    for (int i=0; i < mChart.getData().getDataSetCount(); i++) {
      ScatterDataSet dataSet=dataSets.get(i);
      if (!dataSet.isDrawValuesEnabled())       continue;
      ArrayList<Entry> entries=dataSet.getYVals();
      float[] positions=mChart.getTransformer(dataSet.getAxisDependency()).generateTransformedValuesLineScatter(entries,mAnimator.getPhaseY());
      float shapeSize=dataSet.getScatterShapeSize();
      for (int j=0; j < positions.length * mAnimator.getPhaseX(); j+=2) {
        if (!mViewPortHandler.isInBoundsRight(positions[j]))         break;
        if (j != 0 && !mViewPortHandler.isInBoundsLeft(positions[j - 1]) && !mViewPortHandler.isInBoundsY(positions[j + 1]))         continue;
        float val=entries.get(j / 2).getVal();
        c.drawText(mChart.getValueFormatter().getFormattedValue(val),positions[j],positions[j + 1] - shapeSize,mValuePaint);
      }
    }
  }
}
Program: 18677
Project: 18677
Buggy source:
/** 
 * Computes the axis values.
 * @param yMin - the minimum y-value in the data object for this axis
 * @param yMax - the maximum y-value in the data object for this axis
 */
public void computeAxis(float yMin,float yMax){
  if (mViewPortHandler.contentWidth() > 10 && !mViewPortHandler.isFullyZoomedOutY()) {
    PointD p1=mTrans.getValuesByTouchPoint(mViewPortHandler.contentLeft(),mViewPortHandler.contentTop());
    PointD p2=mTrans.getValuesByTouchPoint(mViewPortHandler.contentLeft(),mViewPortHandler.contentBottom());
    if (!mYAxis.isInverted()) {
      yMin=(float)p2.y;
      yMax=(float)p1.y;
    }
 else {
      if (!mYAxis.isStartAtZeroEnabled())       yMin=(float)Math.min(p1.y,p2.y);
 else       yMin=0;
      yMax=(float)Math.max(p1.y,p2.y);
    }
  }
 else {
    if (!Float.isNaN(mYAxis.getAxisMaxValue())) {
      yMax=mYAxis.getAxisMaxValue();
    }
    if (!Float.isNaN(mYAxis.getAxisMinValue())) {
      yMin=mYAxis.getAxisMinValue();
    }
 else {
      if (mYAxis.isStartAtZeroEnabled()) {
        yMin=0;
      }
    }
  }
  mYAxis.mAxisMaximum=yMax;
  mYAxis.mAxisMinimum=yMin;
  computeAxisValues(yMin,yMax);
}

Fixed version (ground truth):
/** 
 * Computes the axis values.
 * @param yMin - the minimum y-value in the data object for this axis
 * @param yMax - the maximum y-value in the data object for this axis
 */
public void computeAxis(float yMin,float yMax){
  if (mViewPortHandler.contentWidth() > 10 && !mViewPortHandler.isFullyZoomedOutY()) {
    PointD p1=mTrans.getValuesByTouchPoint(mViewPortHandler.contentLeft(),mViewPortHandler.contentTop());
    PointD p2=mTrans.getValuesByTouchPoint(mViewPortHandler.contentLeft(),mViewPortHandler.contentBottom());
    if (!mYAxis.isInverted()) {
      yMin=(float)p2.y;
      yMax=(float)p1.y;
    }
 else {
      if (!mYAxis.isStartAtZeroEnabled())       yMin=(float)Math.min(p1.y,p2.y);
 else       yMin=0;
      yMax=(float)Math.max(p1.y,p2.y);
    }
  }
 else {
    if (!Float.isNaN(mYAxis.getAxisMaxValue())) {
      yMax=mYAxis.getAxisMaxValue();
    }
    if (!Float.isNaN(mYAxis.getAxisMinValue())) {
      yMin=mYAxis.getAxisMinValue();
    }
 else {
      if (mYAxis.isStartAtZeroEnabled()) {
        yMin=0;
      }
    }
  }
  computeAxisValues(yMin,yMax);
}
Program: 18678
Project: 18678
Buggy source:
/** 
 * Draws the LimitLines associated with this axis to the screen.
 * @param c
 */
public void renderLimitLines(Canvas c,ValueFormatter valueFormatter){
  ArrayList<LimitLine> limitLines=mYAxis.getLimitLines();
  if (limitLines == null)   return;
  float[] pts=new float[4];
  for (int i=0; i < limitLines.size(); i++) {
    LimitLine l=limitLines.get(i);
    pts[1]=l.getLimit();
    pts[3]=l.getLimit();
    mTrans.pointValuesToPixel(pts);
    pts[0]=0;
    pts[2]=mViewPortHandler.getChartWidth();
    mLimitLinePaint.setColor(l.getLineColor());
    mLimitLinePaint.setPathEffect(l.getDashPathEffect());
    mLimitLinePaint.setStrokeWidth(l.getLineWidth());
    c.drawLines(pts,mLimitLinePaint);
    if (l.isDrawValueEnabled()) {
      float xOffset=Utils.convertDpToPixel(4f);
      float yOffset=l.getLineWidth() + xOffset;
      String label=valueFormatter.getFormattedValue(l.getLimit());
      mLimitLinePaint.setPathEffect(null);
      mLimitLinePaint.setColor(l.getTextColor());
      if (l.getLabelPosition() == LimitLabelPosition.POS_RIGHT) {
        mLimitLinePaint.setTextAlign(Align.RIGHT);
        c.drawText(label,mViewPortHandler.contentRight() - xOffset,pts[1] - yOffset,mLimitLinePaint);
      }
 else {
        mLimitLinePaint.setTextAlign(Align.LEFT);
        c.drawText(label,mViewPortHandler.offsetLeft() + xOffset,pts[1] - yOffset,mLimitLinePaint);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Draws the LimitLines associated with this axis to the screen.
 * @param c
 */
public void renderLimitLines(Canvas c,ValueFormatter valueFormatter){
  ArrayList<LimitLine> limitLines=mYAxis.getLimitLines();
  if (limitLines == null || limitLines.size() <= 0)   return;
  float[] pts=new float[4];
  for (int i=0; i < limitLines.size(); i++) {
    LimitLine l=limitLines.get(i);
    pts[1]=l.getLimit();
    pts[3]=l.getLimit();
    mTrans.pointValuesToPixel(pts);
    pts[0]=0;
    pts[2]=mViewPortHandler.getChartWidth();
    mLimitLinePaint.setColor(l.getLineColor());
    mLimitLinePaint.setPathEffect(l.getDashPathEffect());
    mLimitLinePaint.setStrokeWidth(l.getLineWidth());
    c.drawLines(pts,mLimitLinePaint);
    if (l.isDrawValueEnabled()) {
      float xOffset=Utils.convertDpToPixel(4f);
      float yOffset=l.getLineWidth() + xOffset;
      String label=valueFormatter.getFormattedValue(l.getLimit());
      mLimitLinePaint.setPathEffect(null);
      mLimitLinePaint.setColor(l.getTextColor());
      if (l.getLabelPosition() == LimitLabelPosition.POS_RIGHT) {
        mLimitLinePaint.setTextAlign(Align.RIGHT);
        c.drawText(label,mViewPortHandler.contentRight() - xOffset,pts[1] - yOffset,mLimitLinePaint);
      }
 else {
        mLimitLinePaint.setTextAlign(Align.LEFT);
        c.drawText(label,mViewPortHandler.offsetLeft() + xOffset,pts[1] - yOffset,mLimitLinePaint);
      }
    }
  }
}
Program: 18679
Project: 18679
Buggy source:
/** 
 * Prepares the matrix that transforms values to pixels. Calculates the scale factors from the charts size and offsets.
 * @param chart
 */
public void prepareMatrixValuePx(ViewPortHandler viewport,float deltaX,float deltaY,float yChartMin){
  float scaleX=(float)((viewport.getChartWidth() - viewport.offsetRight() - viewport.offsetLeft()) / deltaX);
  float scaleY=(float)((viewport.getChartHeight() - viewport.offsetTop() - viewport.offsetBottom()) / deltaY);
  mMatrixValueToPx.reset();
  mMatrixValueToPx.postTranslate(0,-yChartMin);
  mMatrixValueToPx.postScale(scaleX,-scaleY);
}

Fixed version (ground truth):
/** 
 * Prepares the matrix that transforms values to pixels. Calculates the scale factors from the charts size and offsets.
 * @param chart
 */
public void prepareMatrixValuePx(float deltaX,float deltaY,float yChartMin){
  float scaleX=(float)((mViewPortHandler.getChartWidth() - mViewPortHandler.offsetRight() - mViewPortHandler.offsetLeft()) / deltaX);
  float scaleY=(float)((mViewPortHandler.getChartHeight() - mViewPortHandler.offsetTop() - mViewPortHandler.offsetBottom()) / deltaY);
  mMatrixValueToPx.reset();
  mMatrixValueToPx.postTranslate(0,-yChartMin);
  mMatrixValueToPx.postScale(scaleX,-scaleY);
}
Program: 18680
Project: 18680
Buggy source:
/** 
 * Prepares the matrix that contains all offsets.
 * @param chart
 */
public void prepareMatrixOffset(ViewPortHandler viewport,boolean inverted){
  mMatrixOffset.reset();
  if (!inverted)   mMatrixOffset.postTranslate(viewport.offsetLeft(),viewport.getChartHeight() - viewport.offsetBottom());
 else {
    mMatrixOffset.setTranslate(viewport.offsetLeft(),-viewport.offsetTop());
    mMatrixOffset.postScale(1.0f,-1.0f);
  }
}

Fixed version (ground truth):
/** 
 * Prepares the matrix that contains all offsets.
 * @param chart
 */
public void prepareMatrixOffset(boolean inverted){
  mMatrixOffset.reset();
  if (!inverted)   mMatrixOffset.postTranslate(mViewPortHandler.offsetLeft(),mViewPortHandler.getChartHeight() - mViewPortHandler.offsetBottom());
 else {
    mMatrixOffset.setTranslate(mViewPortHandler.offsetLeft(),-mViewPortHandler.offsetTop());
    mMatrixOffset.postScale(1.0f,-1.0f);
  }
}
Program: 18681
Project: 18681
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(4f);
  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);
  ll1.setLineWidth(4f);
  ll1.enableDashedLine(10f,10f,0f);
  ll1.setDrawValue(true);
  ll1.setLabelPosition(LimitLabelPosition.POS_RIGHT);
  LimitLine ll2=new LimitLine(-30f);
  ll2.setLineWidth(4f);
  ll2.enableDashedLine(10f,10f,0f);
  ll2.setDrawValue(true);
  ll2.setLabelPosition(LimitLabelPosition.POS_RIGHT);
  mChart.getAxisLeft().addLimitLine(ll1);
  mChart.getAxisLeft().addLimitLine(ll2);
  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(4f);
  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);
  mChart.getAxisRight().setEnabled(false);
  mChart.setData(data);
}
Program: 18683
Project: 18683
Buggy source:
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  if (mDataNotSet)   return;
  mXAxisRenderer.renderAxis(mDrawCanvas);
  if (mDrawWeb)   mRenderer.drawExtras(mDrawCanvas);
  mYAxisRenderer.renderLimitLines(mDrawCanvas,mValueFormatter);
  mRenderer.drawData(mDrawCanvas);
  if (mHighlightEnabled && valuesToHighlight())   mRenderer.drawHighlighted(mDrawCanvas,mIndicesToHightlight);
  mYAxisRenderer.renderAxis(mDrawCanvas);
  mRenderer.drawValues(mDrawCanvas);
  drawLegend();
  drawDescription();
  drawMarkers();
  canvas.drawBitmap(mDrawBitmap,0,0,mDrawPaint);
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  if (mDataNotSet)   return;
  mXAxisRenderer.renderAxis(mDrawCanvas);
  if (mDrawWeb)   mRenderer.drawExtras(mDrawCanvas);
  mYAxisRenderer.renderLimitLines(mDrawCanvas);
  mRenderer.drawData(mDrawCanvas);
  if (mHighlightEnabled && valuesToHighlight())   mRenderer.drawHighlighted(mDrawCanvas,mIndicesToHightlight);
  mYAxisRenderer.renderAxis(mDrawCanvas);
  mRenderer.drawValues(mDrawCanvas);
  drawLegend();
  drawDescription();
  drawMarkers();
  canvas.drawBitmap(mDrawBitmap,0,0,mDrawPaint);
}
Program: 18684
Project: 18684
Buggy source:
/** 
 * Constructor with limit.
 * @param limit
 */
public LimitLine(float limit){
  mLimit=limit;
}

Fixed version (ground truth):
/** 
 * Constructor with limit and label.
 * @param limit - the position (the value) on the y-axis where this lineshould appear
 * @param label - provide "" if no label is required
 */
public LimitLine(float limit,String label){
  mLimit=limit;
  mLabel=label;
}
Program: 18685
Project: 18685
Buggy source:
/** 
 * Draws the LimitLines associated with this axis to the screen.
 * @param c
 */
public void renderLimitLines(Canvas c,ValueFormatter valueFormatter){
  ArrayList<LimitLine> limitLines=mYAxis.getLimitLines();
  if (limitLines == null || limitLines.size() <= 0)   return;
  float[] pts=new float[4];
  for (int i=0; i < limitLines.size(); i++) {
    LimitLine l=limitLines.get(i);
    pts[1]=l.getLimit();
    pts[3]=l.getLimit();
    mTrans.pointValuesToPixel(pts);
    pts[0]=0;
    pts[2]=mViewPortHandler.getChartWidth();
    mLimitLinePaint.setColor(l.getLineColor());
    mLimitLinePaint.setPathEffect(l.getDashPathEffect());
    mLimitLinePaint.setStrokeWidth(l.getLineWidth());
    c.drawLines(pts,mLimitLinePaint);
    if (l.isDrawValueEnabled()) {
      float xOffset=Utils.convertDpToPixel(4f);
      float yOffset=l.getLineWidth() + xOffset;
      String label=valueFormatter.getFormattedValue(l.getLimit());
      mLimitLinePaint.setPathEffect(null);
      mLimitLinePaint.setColor(l.getTextColor());
      if (l.getLabelPosition() == LimitLabelPosition.POS_RIGHT) {
        mLimitLinePaint.setTextAlign(Align.RIGHT);
        c.drawText(label,mViewPortHandler.contentRight() - xOffset,pts[1] - yOffset,mLimitLinePaint);
      }
 else {
        mLimitLinePaint.setTextAlign(Align.LEFT);
        c.drawText(label,mViewPortHandler.offsetLeft() + xOffset,pts[1] - yOffset,mLimitLinePaint);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Draws the LimitLines associated with this axis to the screen.
 * @param c
 */
public void renderLimitLines(Canvas c){
  ArrayList<LimitLine> limitLines=mYAxis.getLimitLines();
  if (limitLines == null || limitLines.size() <= 0)   return;
  float[] pts=new float[4];
  for (int i=0; i < limitLines.size(); i++) {
    LimitLine l=limitLines.get(i);
    pts[1]=l.getLimit();
    pts[3]=l.getLimit();
    mTrans.pointValuesToPixel(pts);
    pts[0]=0;
    pts[2]=mViewPortHandler.getChartWidth();
    mLimitLinePaint.setColor(l.getLineColor());
    mLimitLinePaint.setPathEffect(l.getDashPathEffect());
    mLimitLinePaint.setStrokeWidth(l.getLineWidth());
    c.drawLines(pts,mLimitLinePaint);
    String label=l.getLabel();
    if (label != null && !label.equals("String_Node_Str")) {
      float xOffset=Utils.convertDpToPixel(4f);
      float yOffset=l.getLineWidth() + xOffset;
      mLimitLinePaint.setPathEffect(null);
      mLimitLinePaint.setColor(l.getTextColor());
      mLimitLinePaint.setStrokeWidth(1f);
      mLimitLinePaint.setTextSize(l.getTextSize());
      if (l.getLabelPosition() == LimitLabelPosition.POS_RIGHT) {
        mLimitLinePaint.setTextAlign(Align.RIGHT);
        c.drawText(label,mViewPortHandler.contentRight() - xOffset,pts[1] - yOffset,mLimitLinePaint);
      }
 else {
        mLimitLinePaint.setTextAlign(Align.LEFT);
        c.drawText(label,mViewPortHandler.offsetLeft() + xOffset,pts[1] - yOffset,mLimitLinePaint);
      }
    }
  }
}
Program: 18686
Project: 18686
Buggy source:
public YAxisRenderer(ViewPortHandler viewPortHandler,YAxis yAxis,Transformer trans){
  super(viewPortHandler,trans);
  this.mYAxis=yAxis;
  mAxisPaint.setColor(Color.BLACK);
  mAxisPaint.setTextSize(Utils.convertDpToPixel(10f));
  mLimitLinePaint=new Paint(Paint.ANTI_ALIAS_FLAG);
  mLimitLinePaint.setStyle(Paint.Style.STROKE);
}

Fixed version (ground truth):
public YAxisRenderer(ViewPortHandler viewPortHandler,YAxis yAxis,Transformer trans){
  super(viewPortHandler,trans);
  this.mYAxis=yAxis;
  mAxisPaint.setColor(Color.BLACK);
  mAxisPaint.setTextSize(Utils.convertDpToPixel(10f));
  mLimitLinePaint=new Paint(Paint.ANTI_ALIAS_FLAG);
  mLimitLinePaint.setStyle(Paint.Style.FILL_AND_STROKE);
}
Program: 18687
Project: 18687
Buggy source:
@Override public void renderLimitLines(Canvas c,ValueFormatter valueFormatter){
  ArrayList<LimitLine> limitLines=mYAxis.getLimitLines();
  if (limitLines == null)   return;
  float sliceangle=mChart.getSliceAngle();
  float factor=mChart.getFactor();
  PointF center=mChart.getCenterOffsets();
  for (int i=0; i < limitLines.size(); i++) {
    LimitLine l=limitLines.get(i);
    mLimitLinePaint.setColor(l.getLineColor());
    mLimitLinePaint.setPathEffect(l.getDashPathEffect());
    mLimitLinePaint.setStrokeWidth(l.getLineWidth());
    float r=l.getLimit() * factor;
    Path limitPath=new Path();
    for (int j=0; j < mChart.getData().getXValCount(); j++) {
      PointF p=Utils.getPosition(center,r,sliceangle * j + mChart.getRotationAngle());
      if (j == 0)       limitPath.moveTo(p.x,p.y);
 else       limitPath.lineTo(p.x,p.y);
    }
    limitPath.close();
    c.drawPath(limitPath,mLimitLinePaint);
  }
}

Fixed version (ground truth):
@Override public void renderLimitLines(Canvas c){
  ArrayList<LimitLine> limitLines=mYAxis.getLimitLines();
  if (limitLines == null)   return;
  float sliceangle=mChart.getSliceAngle();
  float factor=mChart.getFactor();
  PointF center=mChart.getCenterOffsets();
  for (int i=0; i < limitLines.size(); i++) {
    LimitLine l=limitLines.get(i);
    mLimitLinePaint.setColor(l.getLineColor());
    mLimitLinePaint.setPathEffect(l.getDashPathEffect());
    mLimitLinePaint.setStrokeWidth(l.getLineWidth());
    float r=l.getLimit() * factor;
    Path limitPath=new Path();
    for (int j=0; j < mChart.getData().getXValCount(); j++) {
      PointF p=Utils.getPosition(center,r,sliceangle * j + mChart.getRotationAngle());
      if (j == 0)       limitPath.moveTo(p.x,p.y);
 else       limitPath.lineTo(p.x,p.y);
    }
    limitPath.close();
    c.drawPath(limitPath,mLimitLinePaint);
  }
}
Program: 18688
Project: 18688
Buggy source:
private LineDataSet createSet(){
  LineDataSet set=new LineDataSet(null,"String_Node_Str");
  set.setLineWidth(2.5f);
  set.setCircleSize(4.5f);
  set.setColor(Color.rgb(240,99,99));
  set.setCircleColor(Color.rgb(240,99,99));
  set.setHighLightColor(Color.rgb(190,190,190));
  return set;
}

Fixed version (ground truth):
private LineDataSet createSet(){
  LineDataSet set=new LineDataSet(null,"String_Node_Str");
  set.setLineWidth(2.5f);
  set.setCircleSize(4.5f);
  set.setColor(Color.rgb(240,99,99));
  set.setCircleColor(Color.rgb(240,99,99));
  set.setHighLightColor(Color.rgb(190,190,190));
  set.setAxisDependency(AxisDependency.LEFT);
  return set;
}
Program: 18689
Project: 18689
Buggy source:
private LineData getData(int count,float range){
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < count; i++) {
    xVals.add(mMonths[i % 12]);
  }
  ArrayList<Entry> yVals=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float val=(float)(Math.random() * range) + 3;
    yVals.add(new Entry(val,i));
  }
  LineDataSet set1=new LineDataSet(yVals,"String_Node_Str");
  set1.setLineWidth(1.75f);
  set1.setCircleSize(3f);
  set1.setColor(Color.WHITE);
  set1.setCircleColor(Color.WHITE);
  set1.setHighLightColor(Color.WHITE);
  ArrayList<LineDataSet> dataSets=new ArrayList<LineDataSet>();
  dataSets.add(set1);
  LineData data=new LineData(xVals,dataSets);
  return data;
}

Fixed version (ground truth):
private LineData getData(int count,float range){
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < count; i++) {
    xVals.add(mMonths[i % 12]);
  }
  ArrayList<Entry> yVals=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float val=(float)(Math.random() * range) + 3;
    yVals.add(new Entry(val,i));
  }
  LineDataSet set1=new LineDataSet(yVals,"String_Node_Str");
  set1.setLineWidth(1.75f);
  set1.setCircleSize(3f);
  set1.setColor(Color.WHITE);
  set1.setCircleColor(Color.WHITE);
  set1.setHighLightColor(Color.WHITE);
  set1.setDrawValues(false);
  ArrayList<LineDataSet> dataSets=new ArrayList<LineDataSet>();
  dataSets.add(set1);
  LineData data=new LineData(xVals,dataSets);
  return data;
}
Program: 18690
Project: 18690
Buggy source:
private void setupChart(LineChart chart,LineData data,int color){
  chart.setDrawBorder(false);
  chart.setDescription("String_Node_Str");
  chart.setNoDataTextDescription("String_Node_Str");
  chart.setDrawGridBackground(false);
  chart.setGridWidth(1.25f);
  chart.setTouchEnabled(true);
  chart.setDragEnabled(true);
  chart.setScaleEnabled(true);
  chart.setPinchZoom(false);
  chart.setBackgroundColor(color);
  chart.setValueTypeface(mTf);
  chart.setData(data);
  Legend l=chart.getLegend();
  l.setForm(LegendForm.CIRCLE);
  l.setFormSize(6f);
  l.setTextColor(Color.WHITE);
  l.setTypeface(mTf);
  YAxis y=chart.getAxisLeft();
  y.setTextColor(Color.WHITE);
  y.setTypeface(mTf);
  y.setLabelCount(4);
  XAxis x=chart.getXAxis();
  x.setTextColor(Color.WHITE);
  x.setTypeface(mTf);
  x.setDrawGridLines(false);
  chart.animateX(2500);
}

Fixed version (ground truth):
private void setupChart(LineChart chart,LineData data,int color){
  chart.setDrawBorder(false);
  chart.setDescription("String_Node_Str");
  chart.setNoDataTextDescription("String_Node_Str");
  chart.setDrawGridBackground(false);
  chart.setGridWidth(1.25f);
  chart.setTouchEnabled(true);
  chart.setDragEnabled(true);
  chart.setScaleEnabled(true);
  chart.setPinchZoom(false);
  chart.setBackgroundColor(color);
  chart.setValueTypeface(mTf);
  chart.setData(data);
  Legend l=chart.getLegend();
  l.setForm(LegendForm.CIRCLE);
  l.setFormSize(6f);
  l.setTextColor(Color.WHITE);
  l.setTypeface(mTf);
  YAxis leftAxis=chart.getAxisLeft();
  leftAxis.setTextColor(Color.WHITE);
  leftAxis.setTypeface(mTf);
  leftAxis.setLabelCount(4);
  leftAxis.setDrawGridLines(false);
  chart.getAxisRight().setEnabled(false);
  XAxis x=chart.getXAxis();
  x.setTextColor(Color.WHITE);
  x.setTypeface(mTf);
  x.setDrawGridLines(false);
  chart.animateX(2500);
}
Program: 18692
Project: 18692
Buggy source:
/** 
 * Adds an Entry to the DataSet at the specified index. Entries are added to the end of the list.
 * @param e
 * @param dataSetIndex
 */
public void addEntry(Entry e,int dataSetIndex){
  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>();
  if (mDataSets.size() > dataSetIndex) {
    T set=mDataSets.get(dataSetIndex);
    if (set != null) {
      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 e
 * @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();
      }
      set.addEntry(e);
    }
  }
 else {
    Log.e("String_Node_Str","String_Node_Str");
  }
}
Program: 18693
Project: 18693
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();
}

Fixed version (ground truth):
/** 
 * 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();
  }
}
Program: 18694
Project: 18694
Buggy source:
public void setAxisDependency(AxisDependency dependency){
  mAxisDependency=dependency;
}

Fixed version (ground truth):
/** 
 * Set the y-axis this DataSet should be plotted against (either LEFT or RIGHT). Default: LEFT
 * @param dependency
 */
public void setAxisDependency(AxisDependency dependency){
  mAxisDependency=dependency;
}
Program: 18695
Project: 18695
Buggy source:
public AxisDependency getAxisDependency(){
  return mAxisDependency;
}

Fixed version (ground truth):
/** 
 * Returns the axis this DataSet should be plotted against.
 * @return
 */
public AxisDependency getAxisDependency(){
  return mAxisDependency;
}
Program: 18696
Project: 18696
Buggy source:
@Override protected void calcMinMax(boolean fixedValues){
  super.calcMinMax(fixedValues);
  mDeltaX++;
  mDeltaX*=mData.getDataSetCount();
  int maxEntry=0;
  for (int i=0; i < mData.getDataSetCount(); i++) {
    DataSet<? extends Entry> set=mData.getDataSetByIndex(i);
    if (maxEntry < set.getEntryCount())     maxEntry=set.getEntryCount();
  }
  float groupSpace=mData.getGroupSpace();
  mDeltaX+=maxEntry * groupSpace;
}

Fixed version (ground truth):
@Override protected void calcMinMax(){
  super.calcMinMax();
  mDeltaX++;
  mDeltaX*=mData.getDataSetCount();
  int maxEntry=0;
  for (int i=0; i < mData.getDataSetCount(); i++) {
    DataSet<? extends Entry> set=mData.getDataSetByIndex(i);
    if (maxEntry < set.getEntryCount())     maxEntry=set.getEntryCount();
  }
  float groupSpace=mData.getGroupSpace();
  mDeltaX+=maxEntry * groupSpace;
}
Program: 18697
Project: 18697
Buggy source:
@Override public void notifyDataSetChanged(){
  if (mDataNotSet) {
    if (mLogEnabled)     Log.i(LOG_TAG,"String_Node_Str");
    return;
  }
 else {
    if (mLogEnabled)     Log.i(LOG_TAG,"String_Node_Str");
  }
  calcMinMax(false);
  float minLeft=mData.getYMin(AxisDependency.LEFT);
  float maxLeft=mData.getYMax(AxisDependency.LEFT);
  float minRight=mData.getYMin(AxisDependency.RIGHT);
  float maxRight=mData.getYMax(AxisDependency.RIGHT);
  mAxisRendererLeft.computeAxis(minLeft,maxLeft);
  mAxisRendererRight.computeAxis(minRight,maxRight);
  mXAxisRenderer.computeAxis(mData.getXValAverageLength(),mData.getXVals());
  prepareLegend();
  calculateOffsets();
}

Fixed version (ground truth):
@Override public void notifyDataSetChanged(){
  if (mDataNotSet) {
    if (mLogEnabled)     Log.i(LOG_TAG,"String_Node_Str");
    return;
  }
 else {
    if (mLogEnabled)     Log.i(LOG_TAG,"String_Node_Str");
  }
  calcMinMax();
  mAxisRendererLeft.computeAxis(mAxisLeft.mAxisMinimum,mAxisLeft.mAxisMaximum);
  mAxisRendererRight.computeAxis(mAxisRight.mAxisMinimum,mAxisRight.mAxisMaximum);
  mXAxisRenderer.computeAxis(mData.getXValAverageLength(),mData.getXVals());
  prepareLegend();
  calculateOffsets();
}
Program: 18699
Project: 18699
Buggy source:
@Override protected void calcMinMax(boolean fixedValues){
  float minLeft=mData.getYMin(AxisDependency.LEFT);
  float maxLeft=mData.getYMax(AxisDependency.LEFT);
  float minRight=mData.getYMin(AxisDependency.RIGHT);
  float maxRight=mData.getYMax(AxisDependency.RIGHT);
  mDeltaX=mData.getXVals().size() - 1;
  mDeltaYLeft=Math.abs(maxLeft - minLeft);
  mDeltaYRight=Math.abs(maxRight - minRight);
  mAxisLeft.mAxisMaximum=maxLeft;
  mAxisRight.mAxisMaximum=maxRight;
  mAxisLeft.mAxisMinimum=minLeft;
  mAxisRight.mAxisMinimum=minRight;
}

Fixed version (ground truth):
@Override protected void calcMinMax(){
  float minLeft=mData.getYMin(AxisDependency.LEFT);
  float maxLeft=mData.getYMax(AxisDependency.LEFT);
  float minRight=mData.getYMin(AxisDependency.RIGHT);
  float maxRight=mData.getYMax(AxisDependency.RIGHT);
  float leftRange=Math.abs(maxLeft - minLeft);
  float rightRange=Math.abs(maxRight - minRight);
  float topSpaceLeft=leftRange / 100f * mAxisLeft.getSpaceTop();
  float topSpaceRight=rightRange / 100f * mAxisRight.getSpaceTop();
  float bottomSpaceLeft=leftRange / 100f * mAxisLeft.getSpaceBottom();
  float bottomSpaceRight=rightRange / 100f * mAxisRight.getSpaceBottom();
  mDeltaX=mData.getXVals().size() - 1;
  mAxisLeft.mAxisMaximum=maxLeft + topSpaceLeft;
  mAxisRight.mAxisMaximum=maxRight + topSpaceRight;
  mAxisLeft.mAxisMinimum=minLeft - bottomSpaceLeft;
  mAxisRight.mAxisMinimum=minRight - bottomSpaceRight;
  mDeltaYLeft=Math.abs(mAxisLeft.mAxisMaximum - mAxisLeft.mAxisMinimum);
  mDeltaYRight=Math.abs(mAxisRight.mAxisMaximum - mAxisRight.mAxisMinimum);
}
Program: 18700
Project: 18700
Buggy source:
@Override protected void calcMinMax(boolean fixedValues){
  super.calcMinMax(fixedValues);
  mDeltaX++;
}

Fixed version (ground truth):
@Override protected void calcMinMax(){
  super.calcMinMax();
  mDeltaX++;
}
Program: 18701
Project: 18701
Buggy source:
/** 
 * calcualtes the y-min and y-max value and the y-delta and x-delta value
 */
protected abstract void calcMinMax(boolean fixedValues);

Fixed version (ground truth):
/** 
 * calcualtes the y-min and y-max value and the y-delta and x-delta value
 */
protected abstract void calcMinMax();
Program: 18702
Project: 18702
Buggy source:
@Override protected void calcMinMax(boolean fixedValues){
  super.calcMinMax(fixedValues);
  if (mDeltaX == 0 && mData.getYValCount() > 0)   mDeltaX=1;
}

Fixed version (ground truth):
@Override protected void calcMinMax(){
  super.calcMinMax();
  if (mDeltaX == 0 && mData.getYValCount() > 0)   mDeltaX=1;
}
Program: 18703
Project: 18703
Buggy source:
@Override protected void calcMinMax(boolean fixedValues){
  super.calcMinMax(fixedValues);
  calcAngles();
}

Fixed version (ground truth):
@Override protected void calcMinMax(){
  super.calcMinMax();
  calcAngles();
}
Program: 18704
Project: 18704
Buggy source:
@Override protected void calcMinMax(boolean fixedValues){
  mDeltaX=mData.getXVals().size() - 1;
}

Fixed version (ground truth):
@Override protected void calcMinMax(){
  mDeltaX=mData.getXVals().size() - 1;
}
Program: 18705
Project: 18705
Buggy source:
@Override public void notifyDataSetChanged(){
  if (mDataNotSet)   return;
  calcMinMax(false);
  prepareLegend();
  calculateOffsets();
}

Fixed version (ground truth):
@Override public void notifyDataSetChanged(){
  if (mDataNotSet)   return;
  calcMinMax();
  prepareLegend();
  calculateOffsets();
}
Program: 18706
Project: 18706
Buggy source:
@Override protected void calcMinMax(boolean fixedValues){
  super.calcMinMax(fixedValues);
  if (mYAxis.mAxisMaximum <= 0)   mYAxis.mAxisMaximum=1f;
  mYAxis.mAxisMinimum=0;
}

Fixed version (ground truth):
@Override protected void calcMinMax(){
  super.calcMinMax();
  if (mYAxis.mAxisMaximum <= 0)   mYAxis.mAxisMaximum=1f;
  mYAxis.mAxisMinimum=0;
}
Program: 18707
Project: 18707
Buggy source:
@Override protected void calcMinMax(boolean fixedValues){
  super.calcMinMax(fixedValues);
  if (mDeltaX == 0 && mData.getYValCount() > 0)   mDeltaX=1;
}

Fixed version (ground truth):
@Override protected void calcMinMax(){
  super.calcMinMax();
  if (mDeltaX == 0 && mData.getYValCount() > 0)   mDeltaX=1;
}
Program: 18708
Project: 18708
Buggy source:
/** 
 * Computes the axis values.
 * @param yMin - the minimum y-value in the data object for this axis
 * @param yMax - the maximum y-value in the data object for this axis
 */
public void computeAxis(float yMin,float yMax){
  if (mViewPortHandler.contentWidth() > 10 && !mViewPortHandler.isFullyZoomedOutY()) {
    PointD p1=mTrans.getValuesByTouchPoint(mViewPortHandler.contentLeft(),mViewPortHandler.contentTop());
    PointD p2=mTrans.getValuesByTouchPoint(mViewPortHandler.contentLeft(),mViewPortHandler.contentBottom());
    if (!mYAxis.isInverted()) {
      yMin=(float)p2.y;
      yMax=(float)p1.y;
    }
 else {
      if (!mYAxis.isStartAtZeroEnabled())       yMin=(float)Math.min(p1.y,p2.y);
 else       yMin=0;
      yMax=(float)Math.max(p1.y,p2.y);
    }
  }
 else {
    if (!Float.isNaN(mYAxis.getAxisMaxValue())) {
      yMax=mYAxis.getAxisMaxValue();
    }
    if (!Float.isNaN(mYAxis.getAxisMinValue())) {
      yMin=mYAxis.getAxisMinValue();
    }
 else {
      if (mYAxis.isStartAtZeroEnabled()) {
        yMin=0;
      }
    }
  }
  computeAxisValues(yMin,yMax);
}

Fixed version (ground truth):
/** 
 * Computes the axis values.
 * @param yMin - the minimum y-value in the data object for this axis
 * @param yMax - the maximum y-value in the data object for this axis
 */
public void computeAxis(float yMin,float yMax){
  if (mViewPortHandler.contentWidth() > 10 && !mViewPortHandler.isFullyZoomedOutY()) {
    PointD p1=mTrans.getValuesByTouchPoint(mViewPortHandler.contentLeft(),mViewPortHandler.contentTop());
    PointD p2=mTrans.getValuesByTouchPoint(mViewPortHandler.contentLeft(),mViewPortHandler.contentBottom());
    if (!mYAxis.isInverted()) {
      yMin=(float)p2.y;
      yMax=(float)p1.y;
    }
 else {
      if (!mYAxis.isStartAtZeroEnabled())       yMin=(float)Math.min(p1.y,p2.y);
 else       yMin=0;
      yMax=(float)Math.max(p1.y,p2.y);
    }
  }
 else {
    if (!Float.isNaN(mYAxis.getAxisMaxValue())) {
      yMax=mYAxis.getAxisMaxValue();
    }
    if (!Float.isNaN(mYAxis.getAxisMinValue())) {
      yMin=mYAxis.getAxisMinValue();
    }
  }
  computeAxisValues(yMin,yMax);
}
Program: 18710
Project: 18710
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(4f);
  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);
  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(4f);
  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: 18711
Project: 18711
Buggy source:
/** 
 * Draws the LimitLines associated with this axis to the screen.
 * @param c
 */
public void renderLimitLines(Canvas c){
  ArrayList<LimitLine> limitLines=mYAxis.getLimitLines();
  if (limitLines == null || limitLines.size() <= 0)   return;
  float[] pts=new float[4];
  for (int i=0; i < limitLines.size(); i++) {
    LimitLine l=limitLines.get(i);
    pts[1]=l.getLimit();
    pts[3]=l.getLimit();
    mTrans.pointValuesToPixel(pts);
    pts[0]=0;
    pts[2]=mViewPortHandler.getChartWidth();
    mLimitLinePaint.setColor(l.getLineColor());
    mLimitLinePaint.setPathEffect(l.getDashPathEffect());
    mLimitLinePaint.setStrokeWidth(l.getLineWidth());
    c.drawLines(pts,mLimitLinePaint);
    String label=l.getLabel();
    if (label != null && !label.equals("String_Node_Str")) {
      float xOffset=Utils.convertDpToPixel(4f);
      float yOffset=l.getLineWidth() + xOffset;
      mLimitLinePaint.setPathEffect(null);
      mLimitLinePaint.setColor(l.getTextColor());
      mLimitLinePaint.setStrokeWidth(1f);
      mLimitLinePaint.setTextSize(l.getTextSize());
      if (l.getLabelPosition() == LimitLabelPosition.POS_RIGHT) {
        mLimitLinePaint.setTextAlign(Align.RIGHT);
        c.drawText(label,mViewPortHandler.contentRight() - xOffset,pts[1] - yOffset,mLimitLinePaint);
      }
 else {
        mLimitLinePaint.setTextAlign(Align.LEFT);
        c.drawText(label,mViewPortHandler.offsetLeft() + xOffset,pts[1] - yOffset,mLimitLinePaint);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Draws the LimitLines associated with this axis to the screen.
 * @param c
 */
public void renderLimitLines(Canvas c){
  ArrayList<LimitLine> limitLines=mYAxis.getLimitLines();
  if (limitLines == null || limitLines.size() <= 0)   return;
  float[] pts=new float[4];
  for (int i=0; i < limitLines.size(); i++) {
    LimitLine l=limitLines.get(i);
    pts[1]=l.getLimit();
    pts[3]=l.getLimit();
    mTrans.pointValuesToPixel(pts);
    pts[0]=0;
    pts[2]=mViewPortHandler.getChartWidth();
    mLimitLinePaint.setColor(l.getLineColor());
    mLimitLinePaint.setPathEffect(l.getDashPathEffect());
    mLimitLinePaint.setStrokeWidth(l.getLineWidth());
    c.drawLines(pts,mLimitLinePaint);
    String label=l.getLabel();
    if (label != null && !label.equals("String_Node_Str")) {
      float xOffset=Utils.convertDpToPixel(4f);
      float yOffset=l.getLineWidth() + Utils.calcTextHeight(mLimitLinePaint,label) / 2f;
      mLimitLinePaint.setPathEffect(null);
      mLimitLinePaint.setColor(l.getTextColor());
      mLimitLinePaint.setStrokeWidth(0.5f);
      mLimitLinePaint.setTextSize(l.getTextSize());
      if (l.getLabelPosition() == LimitLabelPosition.POS_RIGHT) {
        mLimitLinePaint.setTextAlign(Align.RIGHT);
        c.drawText(label,mViewPortHandler.contentRight() - xOffset,pts[1] - yOffset,mLimitLinePaint);
      }
 else {
        mLimitLinePaint.setTextAlign(Align.LEFT);
        c.drawText(label,mViewPortHandler.offsetLeft() + xOffset,pts[1] - yOffset,mLimitLinePaint);
      }
    }
  }
}
Program: 18712
Project: 18712
Buggy source:
/** 
 * generates a random ChartData object with just one DataSet
 * @return
 */
private PieData generateDataPie(int cnt){
  ArrayList<Entry> entries=new ArrayList<Entry>();
  for (int i=0; i < 4; i++) {
    entries.add(new Entry((int)(Math.random() * 70) + 30,i));
  }
  PieDataSet d=new PieDataSet(entries,"String_Node_Str");
  d.setSliceSpace(5f);
  d.setColors(ColorTemplate.VORDIPLOM_COLORS);
  PieData cd=new PieData(getQuarters(),d);
  return cd;
}

Fixed version (ground truth):
/** 
 * generates a random ChartData object with just one DataSet
 * @return
 */
private PieData generateDataPie(int cnt){
  ArrayList<Entry> entries=new ArrayList<Entry>();
  for (int i=0; i < 4; i++) {
    entries.add(new Entry((int)(Math.random() * 70) + 30,i));
  }
  PieDataSet d=new PieDataSet(entries,"String_Node_Str");
  d.setSliceSpace(2f);
  d.setColors(ColorTemplate.VORDIPLOM_COLORS);
  PieData cd=new PieData(getQuarters(),d);
  return cd;
}
Program: 18713
Project: 18713
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.setDrawBorder(false);
  mChart.setDrawGridBackground(false);
  mChart.setDrawXLabels(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 labels=mChart.getAxisLeft();
  labels.setTypeface(tf);
  XAxis xAxis=mChart.getXAxis();
  xAxis.setDrawGridLines(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");
  MyMarkerView mv=new MyMarkerView(getActivity(),R.layout.custom_marker_view);
  mChart.setMarkerView(mv);
  mChart.setHighlightIndicatorEnabled(false);
  mChart.setDrawBorder(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: 18714
Project: 18714
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.frag_simple_line,container,false);
  mChart=(LineChart)v.findViewById(R.id.lineChart1);
  mChart.setDescription("String_Node_Str");
  mChart.setHighlightIndicatorEnabled(false);
  mChart.setDrawBorder(false);
  mChart.setDrawGridBackground(false);
  mChart.setDrawXLabels(false);
  mChart.setData(getComplexity());
  mChart.animateX(3000);
  Typeface tf=Typeface.createFromAsset(getActivity().getAssets(),"String_Node_Str");
  Legend l=mChart.getLegend();
  l.setTypeface(tf);
  YAxis labels=mChart.getAxisLeft();
  labels.setTypeface(tf);
  XAxis xAxis=mChart.getXAxis();
  xAxis.setDrawGridLines(false);
  return v;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.frag_simple_line,container,false);
  mChart=(LineChart)v.findViewById(R.id.lineChart1);
  mChart.setDescription("String_Node_Str");
  mChart.setHighlightIndicatorEnabled(false);
  mChart.setDrawBorder(false);
  mChart.setDrawGridBackground(false);
  mChart.setData(getComplexity());
  mChart.animateX(3000);
  Typeface tf=Typeface.createFromAsset(getActivity().getAssets(),"String_Node_Str");
  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);
  return v;
}