nus-yam/ex-repair huggingface dataset:
Program: 18452
Project: 18452
Buggy source:
private void setData(int count,float range){
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < count; i++) {
    xVals.add((i) + "String_Node_Str");
  }
  ArrayList<Entry> yVals=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float mult=(range + 1);
    float val=(float)(Math.random() * mult) + 3;
    yVals.add(new Entry(val,i));
  }
  LineDataSet set1=new LineDataSet(yVals,"String_Node_Str");
  set1.enableDashedLine(10f,5f,0f);
  set1.setColor(Color.BLACK);
  set1.setCircleColor(Color.BLACK);
  set1.setLineWidth(1f);
  set1.setCircleSize(3f);
  set1.setDrawCircleHole(false);
  set1.setValueTextSize(9f);
  set1.setFillAlpha(65);
  set1.setFillColor(Color.BLACK);
  set1.setDrawFilled(true);
  ArrayList<LineDataSet> dataSets=new ArrayList<LineDataSet>();
  dataSets.add(set1);
  LineData data=new LineData(xVals,dataSets);
  mChart.setData(data);
}

Fixed version (ground truth):
private void setData(int count,float range){
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < count; i++) {
    xVals.add((i) + "String_Node_Str");
  }
  ArrayList<Entry> yVals=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float mult=(range + 1);
    float val=(float)(Math.random() * mult) + 3;
    yVals.add(new Entry(val,i));
  }
  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);
  mChart.setData(data);
}
Program: 18455
Project: 18455
Buggy source:
/** 
 * draws the hole in the center of the chart and the transparent circle / hole
 */
protected void drawHole(Canvas c){
  if (mChart.isDrawHoleEnabled()) {
    float transparentCircleRadius=mChart.getTransparentCircleRadius();
    float holeRadius=mChart.getHoleRadius();
    float radius=mChart.getRadius();
    PointF center=mChart.getCenterCircleBox();
    if (transparentCircleRadius > holeRadius) {
      int color=mTransparentCirclePaint.getColor();
      mTransparentCirclePaint.setColor(color & 0x60FFFFFF);
      mBitmapCanvas.drawCircle(center.x,center.y,radius / 100 * transparentCircleRadius,mTransparentCirclePaint);
      mTransparentCirclePaint.setColor(color);
    }
    mBitmapCanvas.drawCircle(center.x,center.y,radius / 100 * holeRadius,mHolePaint);
  }
}

Fixed version (ground truth):
/** 
 * draws the hole in the center of the chart and the transparent circle / hole
 */
protected void drawHole(Canvas c){
  if (mChart.isDrawHoleEnabled()) {
    float transparentCircleRadius=mChart.getTransparentCircleRadius();
    float holeRadius=mChart.getHoleRadius();
    float radius=mChart.getRadius();
    PointF center=mChart.getCenterCircleBox();
    if (transparentCircleRadius > holeRadius && mAnimator.getPhaseX() >= 1f && mAnimator.getPhaseY() >= 1f) {
      int color=mTransparentCirclePaint.getColor();
      mTransparentCirclePaint.setColor(color & 0x60FFFFFF);
      mBitmapCanvas.drawCircle(center.x,center.y,radius / 100 * transparentCircleRadius,mTransparentCirclePaint);
      mTransparentCirclePaint.setColor(color);
    }
    mBitmapCanvas.drawCircle(center.x,center.y,radius / 100 * holeRadius,mHolePaint);
  }
}
Program: 18457
Project: 18457
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});
  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.CANDLE,DrawOrder.LINE,DrawOrder.SCATTER});
  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: 18458
Project: 18458
Buggy source:
/** 
 * Returns the lowest x-index (value on the x-axis) that is still visible on the chart.
 * @return
 */
public int getLowestVisibleXIndex(){
  float[] pts=new float[]{mViewPortHandler.contentLeft(),mViewPortHandler.contentBottom()};
  getTransformer(AxisDependency.LEFT).pixelsToValue(pts);
  return (pts[0] <= 0) ? 0 : (int)(pts[0] + 1);
}

Fixed version (ground truth):
/** 
 * Returns the lowest x-index (value on the x-axis) that is still visible on the chart.
 * @return
 */
@Override public int getLowestVisibleXIndex(){
  float[] pts=new float[]{mViewPortHandler.contentLeft(),mViewPortHandler.contentBottom()};
  getTransformer(AxisDependency.LEFT).pixelsToValue(pts);
  return (pts[0] <= 0) ? 0 : (int)(pts[0] + 1);
}
Program: 18459
Project: 18459
Buggy source:
/** 
 * Returns the highest x-index (value on the x-axis) that is still visible on the chart.
 * @return
 */
public int getHighestVisibleXIndex(){
  float[] pts=new float[]{mViewPortHandler.contentRight(),mViewPortHandler.contentBottom()};
  getTransformer(AxisDependency.LEFT).pixelsToValue(pts);
  return (pts[0] >= mData.getXValCount()) ? mData.getXValCount() - 1 : (int)pts[0];
}

Fixed version (ground truth):
/** 
 * Returns the highest x-index (value on the x-axis) that is still visible on the chart.
 * @return
 */
@Override public int getHighestVisibleXIndex(){
  float[] pts=new float[]{mViewPortHandler.contentRight(),mViewPortHandler.contentBottom()};
  getTransformer(AxisDependency.LEFT).pixelsToValue(pts);
  return (pts[0] >= mData.getXValCount()) ? mData.getXValCount() - 1 : (int)pts[0];
}
Program: 18463
Project: 18463
Buggy source:
@Override public void drawHighlighted(Canvas c,Highlight[] indices){
  for (int i=0; i < indices.length; i++) {
    int xIndex=indices[i].getXIndex();
    CandleDataSet set=mChart.getCandleData().getDataSetByIndex(indices[i].getDataSetIndex());
    if (set == null)     continue;
    mHighlightPaint.setColor(set.getHighLightColor());
    CandleEntry e=set.getEntryForXIndex(xIndex);
    if (e == null)     continue;
    float low=e.getLow() * mAnimator.getPhaseY();
    float high=e.getHigh() * mAnimator.getPhaseY();
    float min=mChart.getYChartMin();
    float max=mChart.getYChartMax();
    float[] vertPts=new float[]{xIndex - 0.5f,max,xIndex - 0.5f,min,xIndex + 0.5f,max,xIndex + 0.5f,min};
    float[] horPts=new float[]{0,low,mChart.getXChartMax(),low,0,high,mChart.getXChartMax(),high};
    mChart.getTransformer(set.getAxisDependency()).pointValuesToPixel(vertPts);
    mChart.getTransformer(set.getAxisDependency()).pointValuesToPixel(horPts);
    c.drawLines(vertPts,mHighlightPaint);
    c.drawLines(horPts,mHighlightPaint);
  }
}

Fixed version (ground truth):
@Override public void drawHighlighted(Canvas c,Highlight[] indices){
  for (int i=0; i < indices.length; i++) {
    int xIndex=indices[i].getXIndex();
    CandleDataSet set=mChart.getCandleData().getDataSetByIndex(indices[i].getDataSetIndex());
    if (set == null)     continue;
    mHighlightPaint.setColor(set.getHighLightColor());
    CandleEntry e=set.getEntryForXIndex(xIndex);
    if (e == null)     continue;
    float low=e.getLow() * mAnimator.getPhaseY();
    float high=e.getHigh() * mAnimator.getPhaseY();
    float min=mChart.getYChartMin();
    float max=mChart.getYChartMax();
    float[] vertPts=new float[]{xIndex - 0.5f,max,xIndex - 0.5f,min,xIndex + 0.5f,max,xIndex + 0.5f,min};
    float[] horPts=new float[]{mChart.getXChartMin(),low,mChart.getXChartMax(),low,mChart.getXChartMin(),high,mChart.getXChartMax(),high};
    mChart.getTransformer(set.getAxisDependency()).pointValuesToPixel(vertPts);
    mChart.getTransformer(set.getAxisDependency()).pointValuesToPixel(horPts);
    c.drawLines(vertPts,mHighlightPaint);
    c.drawLines(horPts,mHighlightPaint);
  }
}
Program: 18464
Project: 18464
Buggy source:
public abstract void initBuffers();

Fixed version (ground truth):
/** 
 * Initializes the buffers used for rendering with a new size. Since this method performs memory allocations, it should only be called if necessary.
 */
public abstract void initBuffers();
Program: 18465
Project: 18465
Buggy source:
protected void drawDataSet(Canvas c,BarDataSet dataSet,int index){
  Transformer trans=mChart.getTransformer(dataSet.getAxisDependency());
  calcXBounds(trans);
  mShadowPaint.setColor(dataSet.getBarShadowColor());
  float phaseX=mAnimator.getPhaseX();
  float phaseY=mAnimator.getPhaseY();
  List<BarEntry> entries=dataSet.getYVals();
  BarBuffer buffer=mBarBuffers[index];
  buffer.setPhases(phaseX,phaseY);
  buffer.setBarSpace(dataSet.getBarSpace());
  buffer.setDataSet(index);
  buffer.setInverted(mChart.isInverted(dataSet.getAxisDependency()));
  buffer.feed(entries);
  trans.pointValuesToPixel(buffer.buffer);
  for (int j=0; j < buffer.size(); j+=4) {
    if (!mViewPortHandler.isInBoundsTop(buffer.buffer[j + 3]))     break;
    if (!mViewPortHandler.isInBoundsBottom(buffer.buffer[j + 1]))     continue;
    if (mChart.isDrawBarShadowEnabled()) {
      c.drawRect(mViewPortHandler.contentLeft(),buffer.buffer[j + 1],mViewPortHandler.contentRight(),buffer.buffer[j + 3],mShadowPaint);
    }
    mRenderPaint.setColor(dataSet.getColor(j / 4));
    c.drawRect(buffer.buffer[j],buffer.buffer[j + 1],buffer.buffer[j + 2],buffer.buffer[j + 3],mRenderPaint);
  }
}

Fixed version (ground truth):
protected void drawDataSet(Canvas c,BarDataSet dataSet,int index){
  Transformer trans=mChart.getTransformer(dataSet.getAxisDependency());
  mShadowPaint.setColor(dataSet.getBarShadowColor());
  float phaseX=mAnimator.getPhaseX();
  float phaseY=mAnimator.getPhaseY();
  List<BarEntry> entries=dataSet.getYVals();
  BarBuffer buffer=mBarBuffers[index];
  buffer.setPhases(phaseX,phaseY);
  buffer.setBarSpace(dataSet.getBarSpace());
  buffer.setDataSet(index);
  buffer.setInverted(mChart.isInverted(dataSet.getAxisDependency()));
  buffer.feed(entries);
  trans.pointValuesToPixel(buffer.buffer);
  for (int j=0; j < buffer.size(); j+=4) {
    if (!mViewPortHandler.isInBoundsTop(buffer.buffer[j + 3]))     break;
    if (!mViewPortHandler.isInBoundsBottom(buffer.buffer[j + 1]))     continue;
    if (mChart.isDrawBarShadowEnabled()) {
      c.drawRect(mViewPortHandler.contentLeft(),buffer.buffer[j + 1],mViewPortHandler.contentRight(),buffer.buffer[j + 3],mShadowPaint);
    }
    mRenderPaint.setColor(dataSet.getColor(j / 4));
    c.drawRect(buffer.buffer[j],buffer.buffer[j + 1],buffer.buffer[j + 2],buffer.buffer[j + 3],mRenderPaint);
  }
}
Program: 18466
Project: 18466
Buggy source:
protected void drawDataSet(Canvas c,LineDataSet dataSet){
  List<Entry> entries=dataSet.getYVals();
  if (entries.size() < 1)   return;
  calcXBounds(mChart.getTransformer(dataSet.getAxisDependency()));
  mRenderPaint.setStrokeWidth(dataSet.getLineWidth());
  mRenderPaint.setPathEffect(dataSet.getDashPathEffect());
  if (dataSet.isDrawCubicEnabled()) {
    drawCubic(c,dataSet,entries);
  }
 else {
    drawLinear(c,dataSet,entries);
  }
  mRenderPaint.setPathEffect(null);
}

Fixed version (ground truth):
protected void drawDataSet(Canvas c,LineDataSet dataSet){
  List<Entry> entries=dataSet.getYVals();
  if (entries.size() < 1)   return;
  mRenderPaint.setStrokeWidth(dataSet.getLineWidth());
  mRenderPaint.setPathEffect(dataSet.getDashPathEffect());
  if (dataSet.isDrawCubicEnabled()) {
    drawCubic(c,dataSet,entries);
  }
 else {
    drawLinear(c,dataSet,entries);
  }
  mRenderPaint.setPathEffect(null);
}
Program: 18467
Project: 18467
Buggy source:
@Override public void drawHighlighted(Canvas c,Highlight[] indices){
  for (int i=0; i < indices.length; i++) {
    LineDataSet set=mChart.getLineData().getDataSetByIndex(indices[i].getDataSetIndex());
    if (set == null)     continue;
    mHighlightPaint.setColor(set.getHighLightColor());
    int xIndex=indices[i].getXIndex();
    if (xIndex > mChart.getXChartMax() * mAnimator.getPhaseX())     continue;
    float y=set.getYValForXIndex(xIndex) * mAnimator.getPhaseY();
    float[] pts=new float[]{xIndex,mChart.getYChartMax(),xIndex,mChart.getYChartMin(),0,y,mChart.getXChartMax(),y};
    mChart.getTransformer(set.getAxisDependency()).pointValuesToPixel(pts);
    c.drawLines(pts,mHighlightPaint);
  }
}

Fixed version (ground truth):
@Override public void drawHighlighted(Canvas c,Highlight[] indices){
  for (int i=0; i < indices.length; i++) {
    LineDataSet set=mChart.getLineData().getDataSetByIndex(indices[i].getDataSetIndex());
    if (set == null)     continue;
    mHighlightPaint.setColor(set.getHighLightColor());
    int xIndex=indices[i].getXIndex();
    if (xIndex > mChart.getXChartMax() * mAnimator.getPhaseX())     continue;
    float y=set.getYValForXIndex(xIndex) * mAnimator.getPhaseY();
    float[] pts=new float[]{xIndex,mChart.getYChartMax(),xIndex,mChart.getYChartMin(),mChart.getXChartMin(),y,mChart.getXChartMax(),y};
    mChart.getTransformer(set.getAxisDependency()).pointValuesToPixel(pts);
    c.drawLines(pts,mHighlightPaint);
  }
}
Program: 18468
Project: 18468
Buggy source:
/** 
 * Calculates the minimum and maximum x-value the chart can currently display (with the given zoom level).
 * @param trans
 */
protected void calcXBounds(Transformer trans){
  double minx=trans.getValuesByTouchPoint(mViewPortHandler.contentLeft(),0).x;
  double maxx=trans.getValuesByTouchPoint(mViewPortHandler.contentRight(),0).x;
  if (!Double.isInfinite(minx))   mMinX=(int)minx;
  if (!Double.isInfinite(maxx))   mMaxX=(int)Math.ceil(maxx);
}

Fixed version (ground truth):
/** 
 * Calculates the minimum and maximum x-value the chart can currently display (with the given zoom level).
 * @param chart
 * @param modulus
 */
public void calcXBounds(BarLineScatterCandleDataProvider chart,int xAxisModulus){
  int low=chart.getLowestVisibleXIndex();
  int high=chart.getHighestVisibleXIndex();
  int subLow=(low % xAxisModulus == 0) ? xAxisModulus : 0;
  mMinX=Math.max((low / xAxisModulus) * (xAxisModulus) - subLow,0);
  mMaxX=Math.min((high / xAxisModulus) * (xAxisModulus) + xAxisModulus,(int)chart.getXChartMax());
}
Program: 18470
Project: 18470
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() - 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(mAxisLabelPaint,label);
          if (width > mViewPortHandler.offsetRight() * 2 && position[0] + width > mViewPortHandler.getChartWidth())           position[0]-=width / 2;
        }
 else         if (i == 0) {
          float width=Utils.calcTextWidth(mAxisLabelPaint,label);
          position[0]+=width / 2;
        }
      }
      c.drawText(label,position[0],pos,mAxisLabelPaint);
    }
  }
}

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};
  for (int i=mMinX; i <= mMaxX; 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(mAxisLabelPaint,label);
          if (width > mViewPortHandler.offsetRight() * 2 && position[0] + width > mViewPortHandler.getChartWidth())           position[0]-=width / 2;
        }
 else         if (i == 0) {
          float width=Utils.calcTextWidth(mAxisLabelPaint,label);
          position[0]+=width / 2;
        }
      }
      c.drawText(label,position[0],pos,mAxisLabelPaint);
    }
  }
}
Program: 18471
Project: 18471
Buggy source:
@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);
  }
}

Fixed version (ground truth):
@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);
  }
}
Program: 18472
Project: 18472
Buggy source:
@Override public void feed(List<Entry> entries){
  moveTo(entries.get(mFrom).getXIndex(),entries.get(mFrom).getVal());
  int size=(int)Math.ceil((mTo - mFrom) * phaseX + mFrom);
  for (int i=mFrom + 1; i < size; i++) {
    Entry e=entries.get(i);
    lineTo(e.getXIndex(),e.getVal() * phaseY);
  }
  reset();
}

Fixed version (ground truth):
@Override public void feed(List<Entry> entries){
  moveTo(entries.get(mFrom).getXIndex(),entries.get(mFrom).getVal() * phaseY);
  int size=(int)Math.ceil((mTo - mFrom) * phaseX + mFrom);
  for (int i=mFrom + 1; i < size; i++) {
    Entry e=entries.get(i);
    lineTo(e.getXIndex(),e.getVal() * phaseY);
  }
  reset();
}
Program: 18474
Project: 18474
Buggy source:
/** 
 * Sets the one and ONLY color that should be used for this DataSet when open <= close. Internally, this recreates the colors array and adds the specified color.
 * @param color
 */
public void setIncreasingColor(int color){
  mIncreasingColor=color;
}

Fixed version (ground truth):
/** 
 * Sets the one and ONLY color that should be used for this DataSet when open <= close. 
 * @param color
 */
public void setIncreasingColor(int color){
  mIncreasingColor=color;
}
Program: 18475
Project: 18475
Buggy source:
/** 
 * Sets the one and ONLY color that should be used for this DataSet when open > close. Internally, this recreates the colors array and adds the specified color.
 * @param color
 */
public void setDecreasingColor(int color){
  mDecreasingColor=color;
}

Fixed version (ground truth):
/** 
 * Sets the one and ONLY color that should be used for this DataSet when open > close. 
 * @param color
 */
public void setDecreasingColor(int color){
  mDecreasingColor=color;
}
Program: 18476
Project: 18476
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_piechart);
  tvX=(TextView)findViewById(R.id.tvXMax);
  tvY=(TextView)findViewById(R.id.tvYMax);
  mSeekBarX=(SeekBar)findViewById(R.id.seekBar1);
  mSeekBarY=(SeekBar)findViewById(R.id.seekBar2);
  mSeekBarY.setProgress(10);
  mSeekBarX.setOnSeekBarChangeListener(this);
  mSeekBarY.setOnSeekBarChangeListener(this);
  mChart=(PieChart)findViewById(R.id.chart1);
  mChart.setUsePercentValues(true);
  mChart.setHoleColorTransparent(true);
  tf=Typeface.createFromAsset(getAssets(),"String_Node_Str");
  mChart.setCenterTextTypeface(Typeface.createFromAsset(getAssets(),"String_Node_Str"));
  mChart.setHoleRadius(60f);
  mChart.setDescription("String_Node_Str");
  mChart.setDrawCenterText(true);
  mChart.setDrawHoleEnabled(true);
  mChart.setRotationAngle(0);
  mChart.setRotationEnabled(true);
  mChart.setOnChartValueSelectedListener(this);
  mChart.setCenterText("String_Node_Str");
  setData(3,100);
  mChart.animateXY(1500,1500,EasingFunction.EaseInOutQuad,EasingFunction.EaseInOutQuad);
  Legend l=mChart.getLegend();
  l.setPosition(LegendPosition.RIGHT_OF_CHART);
  l.setXEntrySpace(7f);
  l.setYEntrySpace(5f);
}

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_piechart);
  tvX=(TextView)findViewById(R.id.tvXMax);
  tvY=(TextView)findViewById(R.id.tvYMax);
  mSeekBarX=(SeekBar)findViewById(R.id.seekBar1);
  mSeekBarY=(SeekBar)findViewById(R.id.seekBar2);
  mSeekBarY.setProgress(10);
  mSeekBarX.setOnSeekBarChangeListener(this);
  mSeekBarY.setOnSeekBarChangeListener(this);
  mChart=(PieChart)findViewById(R.id.chart1);
  mChart.setUsePercentValues(true);
  mChart.setDescription("String_Node_Str");
  tf=Typeface.createFromAsset(getAssets(),"String_Node_Str");
  mChart.setCenterTextTypeface(Typeface.createFromAsset(getAssets(),"String_Node_Str"));
  mChart.setDrawHoleEnabled(true);
  mChart.setHoleColorTransparent(true);
  mChart.setTransparentCircleColor(Color.WHITE);
  mChart.setHoleRadius(58f);
  mChart.setTransparentCircleRadius(61f);
  mChart.setDrawCenterText(true);
  mChart.setRotationAngle(0);
  mChart.setRotationEnabled(true);
  mChart.setOnChartValueSelectedListener(this);
  mChart.setCenterText("String_Node_Str");
  setData(3,100);
  mChart.animateXY(1500,1500);
  Legend l=mChart.getLegend();
  l.setPosition(LegendPosition.RIGHT_OF_CHART);
  l.setXEntrySpace(7f);
  l.setYEntrySpace(5f);
}
Program: 18477
Project: 18477
Buggy source:
private void setData(int count,float range){
  float mult=range;
  ArrayList<Entry> yVals1=new ArrayList<Entry>();
  for (int i=0; i < count + 1; i++) {
    yVals1.add(new Entry((float)(Math.random() * mult) + mult / 5,i));
  }
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < count + 1; i++)   xVals.add(mParties[i % mParties.length]);
  PieDataSet dataSet=new PieDataSet(yVals1,"String_Node_Str");
  dataSet.setSliceSpace(3f);
  ArrayList<Integer> colors=new ArrayList<Integer>();
  for (  int c : ColorTemplate.VORDIPLOM_COLORS)   colors.add(c);
  for (  int c : ColorTemplate.JOYFUL_COLORS)   colors.add(c);
  for (  int c : ColorTemplate.COLORFUL_COLORS)   colors.add(c);
  for (  int c : ColorTemplate.LIBERTY_COLORS)   colors.add(c);
  for (  int c : ColorTemplate.PASTEL_COLORS)   colors.add(c);
  colors.add(ColorTemplate.getHoloBlue());
  dataSet.setColors(colors);
  PieData data=new PieData(xVals,dataSet);
  data.setValueFormatter(new PercentFormatter());
  data.setValueTextSize(11f);
  data.setValueTextColor(Color.WHITE);
  data.setValueTypeface(tf);
  mChart.setData(data);
  mChart.highlightValues(null);
  mChart.invalidate();
}

Fixed version (ground truth):
private void setData(int count,float range){
  float mult=range;
  ArrayList<Entry> yVals1=new ArrayList<Entry>();
  for (int i=0; i < count + 1; i++) {
    yVals1.add(new Entry((float)(Math.random() * mult) + mult / 5,i));
  }
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < count + 1; i++)   xVals.add(mParties[i % mParties.length]);
  PieDataSet dataSet=new PieDataSet(yVals1,"String_Node_Str");
  dataSet.setSliceSpace(3f);
  dataSet.setSelectionShift(5f);
  ArrayList<Integer> colors=new ArrayList<Integer>();
  for (  int c : ColorTemplate.VORDIPLOM_COLORS)   colors.add(c);
  for (  int c : ColorTemplate.JOYFUL_COLORS)   colors.add(c);
  for (  int c : ColorTemplate.COLORFUL_COLORS)   colors.add(c);
  for (  int c : ColorTemplate.LIBERTY_COLORS)   colors.add(c);
  for (  int c : ColorTemplate.PASTEL_COLORS)   colors.add(c);
  colors.add(ColorTemplate.getHoloBlue());
  dataSet.setColors(colors);
  PieData data=new PieData(xVals,dataSet);
  data.setValueFormatter(new PercentFormatter());
  data.setValueTextSize(11f);
  data.setValueTextColor(Color.WHITE);
  data.setValueTypeface(tf);
  mChart.setData(data);
  mChart.highlightValues(null);
  mChart.invalidate();
}
Program: 18478
Project: 18478
Buggy source:
/** 
 * Set the hole in the center of the PieChart transparent. Thank you, code provided by:
 * @link https://github.com/tbarthel-fr
 * @param enable
 */
public void setHoleColorTransparent(boolean enable){
  if (enable) {
    ((PieChartRenderer)mRenderer).getPaintHole().setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OUT));
  }
 else {
    ((PieChartRenderer)mRenderer).getPaintHole().setXfermode(null);
  }
}

Fixed version (ground truth):
/** 
 * Set the hole in the center of the PieChart transparent. Thank you, code provided by:
 * @link https://github.com/tbarthel-fr
 * @param enable
 */
public void setHoleColorTransparent(boolean enable){
  if (enable) {
    ((PieChartRenderer)mRenderer).getPaintHole().setColor(0xFFFFFFFF);
    ((PieChartRenderer)mRenderer).getPaintHole().setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
  }
 else {
    ((PieChartRenderer)mRenderer).getPaintHole().setXfermode(null);
  }
}
Program: 18479
Project: 18479
Buggy source:
public PieChartRenderer(PieChart chart,ChartAnimator animator,ViewPortHandler viewPortHandler){
  super(animator,viewPortHandler);
  mChart=chart;
  mHolePaint=new Paint(Paint.ANTI_ALIAS_FLAG);
  mHolePaint.setColor(Color.WHITE);
  mCenterTextPaint=new Paint(Paint.ANTI_ALIAS_FLAG);
  mCenterTextPaint.setColor(Color.BLACK);
  mCenterTextPaint.setTextSize(Utils.convertDpToPixel(12f));
  mCenterTextPaint.setTextAlign(Align.CENTER);
  mValuePaint.setTextSize(Utils.convertDpToPixel(13f));
  mValuePaint.setColor(Color.WHITE);
  mValuePaint.setTextAlign(Align.CENTER);
}

Fixed version (ground truth):
public PieChartRenderer(PieChart chart,ChartAnimator animator,ViewPortHandler viewPortHandler){
  super(animator,viewPortHandler);
  mChart=chart;
  mHolePaint=new Paint(Paint.ANTI_ALIAS_FLAG);
  mHolePaint.setColor(Color.WHITE);
  mHolePaint.setStyle(Style.FILL);
  mTransparentCirclePaint=new Paint(Paint.ANTI_ALIAS_FLAG);
  mTransparentCirclePaint.setColor(Color.WHITE);
  mTransparentCirclePaint.setStyle(Style.FILL);
  mCenterTextPaint=new Paint(Paint.ANTI_ALIAS_FLAG);
  mCenterTextPaint.setColor(Color.BLACK);
  mCenterTextPaint.setTextSize(Utils.convertDpToPixel(12f));
  mCenterTextPaint.setTextAlign(Align.CENTER);
  mValuePaint.setTextSize(Utils.convertDpToPixel(13f));
  mValuePaint.setColor(Color.WHITE);
  mValuePaint.setTextAlign(Align.CENTER);
}
Program: 18480
Project: 18480
Buggy source:
@Override public void drawData(Canvas c){
  if (mDrawBitmap == null) {
    mDrawBitmap=Bitmap.createBitmap((int)mViewPortHandler.getChartWidth(),(int)mViewPortHandler.getChartHeight(),Bitmap.Config.ARGB_4444);
    mBitmapCanvas=new Canvas(mDrawBitmap);
  }
  mDrawBitmap.eraseColor(Color.TRANSPARENT);
  PieData pieData=mChart.getData();
  for (  PieDataSet set : pieData.getDataSets()) {
    if (set.isVisible())     drawDataSet(c,set);
  }
  c.drawBitmap(mDrawBitmap,0,0,mRenderPaint);
}

Fixed version (ground truth):
@Override public void drawData(Canvas c){
  if (mDrawBitmap == null || ((int)mViewPortHandler.getChartHeight() != mDrawBitmap.getHeight())) {
    mDrawBitmap=Bitmap.createBitmap((int)mViewPortHandler.getChartWidth(),(int)mViewPortHandler.getChartHeight(),Bitmap.Config.ARGB_8888);
    mBitmapCanvas=new Canvas(mDrawBitmap);
  }
  mDrawBitmap.eraseColor(Color.TRANSPARENT);
  PieData pieData=mChart.getData();
  for (  PieDataSet set : pieData.getDataSets()) {
    if (set.isVisible())     drawDataSet(c,set);
  }
}
Program: 18481
Project: 18481
Buggy source:
/** 
 * draws the hole in the center of the chart and the transparent circle / hole
 */
protected void drawHole(Canvas c){
  if (mChart.isDrawHoleEnabled()) {
    float transparentCircleRadius=mChart.getTransparentCircleRadius();
    float holeRadius=mChart.getHoleRadius();
    float radius=mChart.getRadius();
    PointF center=mChart.getCenterCircleBox();
    int color=mHolePaint.getColor();
    mBitmapCanvas.drawCircle(center.x,center.y,radius / 100 * holeRadius,mHolePaint);
    if (transparentCircleRadius > holeRadius) {
      mHolePaint.setColor(color & 0x60FFFFFF);
      mBitmapCanvas.drawCircle(center.x,center.y,radius / 100 * transparentCircleRadius,mHolePaint);
      mHolePaint.setColor(color);
    }
  }
}

Fixed version (ground truth):
/** 
 * draws the hole in the center of the chart and the transparent circle / hole
 */
protected void drawHole(Canvas c){
  if (mChart.isDrawHoleEnabled()) {
    float transparentCircleRadius=mChart.getTransparentCircleRadius();
    float holeRadius=mChart.getHoleRadius();
    float radius=mChart.getRadius();
    PointF center=mChart.getCenterCircleBox();
    if (transparentCircleRadius > holeRadius) {
      int color=mTransparentCirclePaint.getColor();
      mTransparentCirclePaint.setColor(color & 0x60FFFFFF);
      mBitmapCanvas.drawCircle(center.x,center.y,radius / 100 * transparentCircleRadius,mTransparentCirclePaint);
      mTransparentCirclePaint.setColor(color);
    }
    mBitmapCanvas.drawCircle(center.x,center.y,radius / 100 * holeRadius,mHolePaint);
  }
}
Program: 18482
Project: 18482
Buggy source:
@Override public void drawExtras(Canvas c){
  drawHole(c);
  drawCenterText(c);
}

Fixed version (ground truth):
@Override public void drawExtras(Canvas c){
  drawHole(c);
  c.drawBitmap(mDrawBitmap,0,0,mRenderPaint);
  drawCenterText(c);
}
Program: 18484
Project: 18484
Buggy source:
@Override public void feed(List<CandleEntry> entries){
  float size=entries.size() * phaseX;
  for (int i=0; i < size; i++) {
    CandleEntry e=entries.get(i);
    addBody(e.getXIndex() - 0.5f + mBodySpace,e.getClose() * phaseY,e.getXIndex() + 0.5f - mBodySpace,e.getOpen() * phaseY);
  }
  reset();
}

Fixed version (ground truth):
@Override public void feed(List<CandleEntry> entries){
  int size=(int)Math.ceil((mTo - mFrom) * phaseX + mFrom);
  for (int i=mFrom; i < size; i++) {
    CandleEntry e=entries.get(i);
    addBody(e.getXIndex() - 0.5f + mBodySpace,e.getClose() * phaseY,e.getXIndex() + 0.5f - mBodySpace,e.getOpen() * phaseY);
  }
  reset();
}
Program: 18485
Project: 18485
Buggy source:
@Override public void feed(List<CandleEntry> entries){
  float size=entries.size() * phaseX;
  for (int i=0; i < size; i++) {
    CandleEntry e=entries.get(i);
    addShadow(e.getXIndex(),e.getHigh() * phaseY,e.getXIndex(),e.getLow() * phaseY);
  }
  reset();
}

Fixed version (ground truth):
@Override public void feed(List<CandleEntry> entries){
  int size=(int)Math.ceil((mTo - mFrom) * phaseX + mFrom);
  for (int i=mFrom; i < size; i++) {
    CandleEntry e=entries.get(i);
    addShadow(e.getXIndex(),e.getHigh() * phaseY,e.getXIndex(),e.getLow() * phaseY);
  }
  reset();
}
Program: 18486
Project: 18486
Buggy source:
@Override public void feed(List<Entry> entries){
  float size=entries.size() * phaseX;
  for (int i=0; i < size; i++) {
    Entry e=entries.get(i);
    addCircle(e.getXIndex(),e.getVal() * phaseY);
  }
  reset();
}

Fixed version (ground truth):
@Override public void feed(List<Entry> entries){
  int size=(int)Math.ceil((mTo - mFrom) * phaseX + mFrom);
  for (int i=mFrom; i < size; i++) {
    Entry e=entries.get(i);
    addCircle(e.getXIndex(),e.getVal() * phaseY);
  }
  reset();
}
Program: 18487
Project: 18487
Buggy source:
@Override public void feed(List<Entry> entries){
  moveTo(entries.get(0).getXIndex(),entries.get(0).getVal());
  float size=entries.size() * phaseX;
  for (int i=1; i < size; i++) {
    Entry e=entries.get(i);
    lineTo(e.getXIndex(),e.getVal() * phaseY);
  }
  reset();
}

Fixed version (ground truth):
@Override public void feed(List<Entry> entries){
  moveTo(entries.get(mFrom).getXIndex(),entries.get(mFrom).getVal());
  int size=(int)Math.ceil((mTo - mFrom) * phaseX + mFrom);
  for (int i=mFrom + 1; i < size; i++) {
    Entry e=entries.get(i);
    lineTo(e.getXIndex(),e.getVal() * phaseY);
  }
  reset();
}
Program: 18489
Project: 18489
Buggy source:
@Override public void drawValues(Canvas c){
  if (mChart.getCandleData().getYValCount() < mChart.getMaxVisibleCount() * mViewPortHandler.getScaleX()) {
    List<CandleDataSet> dataSets=mChart.getCandleData().getDataSets();
    for (int i=0; i < dataSets.size(); i++) {
      CandleDataSet dataSet=dataSets.get(i);
      if (!dataSet.isDrawValuesEnabled())       continue;
      applyValueTextStyle(dataSet);
      Transformer trans=mChart.getTransformer(dataSet.getAxisDependency());
      List<CandleEntry> entries=dataSet.getYVals();
      float[] positions=trans.generateTransformedValuesCandle(entries,mAnimator.getPhaseY());
      float yOffset=Utils.convertDpToPixel(5f);
      for (int j=0; j < positions.length * mAnimator.getPhaseX(); j+=2) {
        float x=positions[j];
        float y=positions[j + 1];
        if (!mViewPortHandler.isInBoundsRight(x))         break;
        if (!mViewPortHandler.isInBoundsLeft(x) || !mViewPortHandler.isInBoundsY(y))         continue;
        float val=entries.get(j / 2).getHigh();
        c.drawText(dataSet.getValueFormatter().getFormattedValue(val),x,y - yOffset,mValuePaint);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void drawValues(Canvas c){
  if (mChart.getCandleData().getYValCount() < mChart.getMaxVisibleCount() * mViewPortHandler.getScaleX()) {
    List<CandleDataSet> dataSets=mChart.getCandleData().getDataSets();
    for (int i=0; i < dataSets.size(); i++) {
      CandleDataSet dataSet=dataSets.get(i);
      if (!dataSet.isDrawValuesEnabled())       continue;
      applyValueTextStyle(dataSet);
      Transformer trans=mChart.getTransformer(dataSet.getAxisDependency());
      List<CandleEntry> entries=dataSet.getYVals();
      Entry entryFrom=dataSet.getEntryForXIndex(mMinX);
      Entry entryTo=dataSet.getEntryForXIndex(mMaxX);
      int minx=dataSet.getEntryPosition(entryFrom);
      int maxx=Math.min(dataSet.getEntryPosition(entryTo) + 1,entries.size());
      float[] positions=trans.generateTransformedValuesCandle(entries,mAnimator.getPhaseX(),mAnimator.getPhaseY(),minx,maxx);
      float yOffset=Utils.convertDpToPixel(5f);
      for (int j=0; j < positions.length; j+=2) {
        float x=positions[j];
        float y=positions[j + 1];
        if (!mViewPortHandler.isInBoundsRight(x))         break;
        if (!mViewPortHandler.isInBoundsLeft(x) || !mViewPortHandler.isInBoundsY(y))         continue;
        float val=entries.get(j / 2 + minx).getHigh();
        c.drawText(dataSet.getValueFormatter().getFormattedValue(val),x,y - yOffset,mValuePaint);
      }
    }
  }
}
Program: 18491
Project: 18491
Buggy source:
/** 
 * limits the drawing on the x-axis 
 */
public void limitFrom(int from){
  mFrom=from;
}

Fixed version (ground truth):
/** 
 * limits the drawing on the x-axis 
 */
public void limitFrom(int from){
  if (from < 0)   from=0;
  mFrom=from;
}
Program: 18492
Project: 18492
Buggy source:
/** 
 * limits the drawing on the x-axis 
 */
public void limitTo(int to){
  mTo=to;
}

Fixed version (ground truth):
/** 
 * limits the drawing on the x-axis 
 */
public void limitTo(int to){
  if (to < 0)   to=0;
  mTo=to;
}
Program: 18493
Project: 18493
Buggy source:
@Override public void drawValues(Canvas c){
  if (mChart.getLineData().getYValCount() < mChart.getMaxVisibleCount() * mViewPortHandler.getScaleX()) {
    List<LineDataSet> dataSets=mChart.getLineData().getDataSets();
    for (int i=0; i < dataSets.size(); i++) {
      LineDataSet dataSet=dataSets.get(i);
      if (!dataSet.isDrawValuesEnabled())       continue;
      applyValueTextStyle(dataSet);
      Transformer trans=mChart.getTransformer(dataSet.getAxisDependency());
      int valOffset=(int)(dataSet.getCircleSize() * 1.75f);
      if (!dataSet.isDrawCirclesEnabled())       valOffset=valOffset / 2;
      List<Entry> entries=dataSet.getYVals();
      Entry entryFrom=dataSet.getEntryForXIndex(mMinX);
      Entry entryTo=dataSet.getEntryForXIndex(mMaxX);
      int minx=dataSet.getEntryPosition(entryFrom);
      int maxx=Math.min(dataSet.getEntryPosition(entryTo) + 1,entries.size());
      float[] positions=trans.generateTransformedValuesLine(entries,mAnimator.getPhaseX(),mAnimator.getPhaseY(),minx,maxx);
      for (int j=0; j < positions.length; j+=2) {
        float x=positions[j];
        float y=positions[j + 1];
        if (!mViewPortHandler.isInBoundsRight(x))         break;
        if (!mViewPortHandler.isInBoundsLeft(x) || !mViewPortHandler.isInBoundsY(y))         continue;
        float val=entries.get(j / 2 + minx).getVal();
        c.drawText(dataSet.getValueFormatter().getFormattedValue(val),x,y - valOffset,mValuePaint);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void drawValues(Canvas c){
  if (mChart.getLineData().getYValCount() < mChart.getMaxVisibleCount() * mViewPortHandler.getScaleX()) {
    List<LineDataSet> dataSets=mChart.getLineData().getDataSets();
    for (int i=0; i < dataSets.size(); i++) {
      LineDataSet dataSet=dataSets.get(i);
      if (!dataSet.isDrawValuesEnabled())       continue;
      applyValueTextStyle(dataSet);
      Transformer trans=mChart.getTransformer(dataSet.getAxisDependency());
      int valOffset=(int)(dataSet.getCircleSize() * 1.75f);
      if (!dataSet.isDrawCirclesEnabled())       valOffset=valOffset / 2;
      List<Entry> entries=dataSet.getYVals();
      Entry entryFrom=dataSet.getEntryForXIndex(mMinX);
      Entry entryTo=dataSet.getEntryForXIndex(mMaxX);
      int minx=dataSet.getEntryPosition(entryFrom);
      if (minx < 0)       minx=0;
      int maxx=Math.min(dataSet.getEntryPosition(entryTo) + 1,entries.size());
      float[] positions=trans.generateTransformedValuesLine(entries,mAnimator.getPhaseX(),mAnimator.getPhaseY(),minx,maxx);
      for (int j=0; j < positions.length; j+=2) {
        float x=positions[j];
        float y=positions[j + 1];
        if (!mViewPortHandler.isInBoundsRight(x))         break;
        if (!mViewPortHandler.isInBoundsLeft(x) || !mViewPortHandler.isInBoundsY(y))         continue;
        float val=entries.get(j / 2 + minx).getVal();
        c.drawText(dataSet.getValueFormatter().getFormattedValue(val),x,y - valOffset,mValuePaint);
      }
    }
  }
}
Program: 18495
Project: 18495
Buggy source:
@Override protected void onSizeChanged(int w,int h,int oldw,int oldh){
  if (mLogEnabled)   Log.i(LOG_TAG,"String_Node_Str");
  if (w > 0 && h > 0 && w < 10000 && h < 10000) {
    mDrawBitmap=Bitmap.createBitmap(w,h,Bitmap.Config.ARGB_4444);
    mViewPortHandler.setChartDimens(w,h);
    if (mLogEnabled)     Log.i(LOG_TAG,"String_Node_Str" + w + "String_Node_Str"+ h);
    for (    Runnable r : mJobs) {
      post(r);
    }
    mJobs.clear();
  }
  notifyDataSetChanged();
  super.onSizeChanged(w,h,oldw,oldh);
}

Fixed version (ground truth):
@Override protected void onSizeChanged(int w,int h,int oldw,int oldh){
  if (mLogEnabled)   Log.i(LOG_TAG,"String_Node_Str");
  if (w > 0 && h > 0 && w < 10000 && h < 10000) {
    if (mDrawBitmap != null)     mDrawBitmap.recycle();
    mDrawBitmap=Bitmap.createBitmap(w,h,Bitmap.Config.ARGB_4444);
    mViewPortHandler.setChartDimens(w,h);
    if (mLogEnabled)     Log.i(LOG_TAG,"String_Node_Str" + w + "String_Node_Str"+ h);
    for (    Runnable r : mJobs) {
      post(r);
    }
    mJobs.clear();
  }
  notifyDataSetChanged();
  super.onSizeChanged(w,h,oldw,oldh);
}
Program: 18498
Project: 18498
Buggy source:
/** 
 * Moves the left side of the current viewport to the specified x-index.
 * @param xIndex
 */
public void moveViewToX(int xIndex){
  float[] pts=new float[]{xIndex,0f};
  getTransformer(AxisDependency.LEFT).pointValuesToPixel(pts);
  mViewPortHandler.centerViewPort(pts,this);
}

Fixed version (ground truth):
/** 
 * Moves the left side of the current viewport to the specified x-index.
 * @param xIndex
 */
public void moveViewToX(float xIndex){
  Runnable job=new MoveViewJob(mViewPortHandler,xIndex,0f,getTransformer(AxisDependency.LEFT),this);
  if (mViewPortHandler.hasChartDimens()) {
    post(job);
  }
 else {
    mJobs.add(job);
  }
}
Program: 18499
Project: 18499
Buggy source:
/** 
 * Centers the viewport to the specified y-value on the y-axis.
 * @param yValue
 * @param axis - which axis should be used as a reference for the y-axis
 */
public void moveViewToY(float yValue,AxisDependency axis){
  float valsInView=getDeltaY(axis) / mViewPortHandler.getScaleY();
  float[] pts=new float[]{0f,yValue + valsInView / 2f};
  getTransformer(axis).pointValuesToPixel(pts);
  mViewPortHandler.centerViewPort(pts,this);
}

Fixed version (ground truth):
/** 
 * Centers the viewport to the specified y-value on the y-axis.
 * @param yValue
 * @param axis - which axis should be used as a reference for the y-axis
 */
public void moveViewToY(float yValue,AxisDependency axis){
  float valsInView=getDeltaY(axis) / mViewPortHandler.getScaleY();
  Runnable job=new MoveViewJob(mViewPortHandler,0f,yValue + valsInView / 2f,getTransformer(axis),this);
  if (mViewPortHandler.hasChartDimens()) {
    post(job);
  }
 else {
    mJobs.add(job);
  }
}
Program: 18500
Project: 18500
Buggy source:
/** 
 * This will move the left side of the current viewport to the specified x-index on the x-axis, and center the viewport to the specified y-value on the y-axis.
 * @param xIndex
 * @param yValue
 * @param axis - which axis should be used as a reference for the y-axis
 */
public void moveViewTo(int xIndex,float yValue,AxisDependency axis){
  float valsInView=getDeltaY(axis) / mViewPortHandler.getScaleY();
  float[] pts=new float[]{xIndex,yValue + valsInView / 2f};
  getTransformer(axis).pointValuesToPixel(pts);
  mViewPortHandler.centerViewPort(pts,this);
}

Fixed version (ground truth):
/** 
 * This will move the left side of the current viewport to the specified x-index on the x-axis, and center the viewport to the specified y-value on the y-axis.
 * @param xIndex
 * @param yValue
 * @param axis - which axis should be used as a reference for the y-axis
 */
public void moveViewTo(float xIndex,float yValue,AxisDependency axis){
  float valsInView=getDeltaY(axis) / mViewPortHandler.getScaleY();
  Runnable job=new MoveViewJob(mViewPortHandler,xIndex,yValue + valsInView / 2f,getTransformer(axis),this);
  if (mViewPortHandler.hasChartDimens()) {
    post(job);
  }
 else {
    mJobs.add(job);
  }
}
Program: 18501
Project: 18501
Buggy source:
@Override protected void onSizeChanged(int w,int h,int oldw,int oldh){
  if (mLogEnabled)   Log.i(LOG_TAG,"String_Node_Str");
  if (w > 0 && h > 0 && w < 10000 && h < 10000) {
    mDrawBitmap=Bitmap.createBitmap(w,h,Bitmap.Config.ARGB_4444);
    mViewPortHandler.setChartDimens(w,h);
    if (mLogEnabled)     Log.i(LOG_TAG,"String_Node_Str" + w + "String_Node_Str"+ h);
  }
  notifyDataSetChanged();
  super.onSizeChanged(w,h,oldw,oldh);
}

Fixed version (ground truth):
@Override protected void onSizeChanged(int w,int h,int oldw,int oldh){
  if (mLogEnabled)   Log.i(LOG_TAG,"String_Node_Str");
  if (w > 0 && h > 0 && w < 10000 && h < 10000) {
    mDrawBitmap=Bitmap.createBitmap(w,h,Bitmap.Config.ARGB_4444);
    mViewPortHandler.setChartDimens(w,h);
    if (mLogEnabled)     Log.i(LOG_TAG,"String_Node_Str" + w + "String_Node_Str"+ h);
    for (    Runnable r : mJobs) {
      post(r);
    }
    mJobs.clear();
  }
  notifyDataSetChanged();
  super.onSizeChanged(w,h,oldw,oldh);
}
Program: 18502
Project: 18502
Buggy source:
/** 
 * Centers the viewport around the specified position (x-index and y-value) in the chart. Centering the viewport outside the bounds of the chart is not possible. Makes most sense in combination with the setScaleMinima(...) method.
 * @param pts the position to center view viewport to
 * @param chart
 * @return save
 */
public synchronized void centerViewPort(final float[] transformedPts,final Chart<?> chart){
  Matrix save=new Matrix();
  save.set(mMatrixTouch);
  final float x=transformedPts[0] - offsetLeft();
  final float y=transformedPts[1] - offsetTop();
  save.postTranslate(-x,-y);
  refresh(save,chart,false);
}

Fixed version (ground truth):
/** 
 * Centers the viewport around the specified position (x-index and y-value) in the chart. Centering the viewport outside the bounds of the chart is not possible. Makes most sense in combination with the setScaleMinima(...) method.
 * @param pts the position to center view viewport to
 * @param chart
 * @return save
 */
public synchronized void centerViewPort(final float[] transformedPts,final View view){
  Matrix save=new Matrix();
  save.set(mMatrixTouch);
  final float x=transformedPts[0] - offsetLeft();
  final float y=transformedPts[1] - offsetTop();
  Log.i("String_Node_Str","String_Node_Str" + x + "String_Node_Str"+ y);
  save.postTranslate(-x,-y);
  refresh(save,view,false);
}
Program: 18503
Project: 18503
Buggy source:
/** 
 * call this method to refresh the graph with a given matrix
 * @param newMatrix
 * @return
 */
public Matrix refresh(Matrix newMatrix,Chart<?> chart,boolean invalidate){
  mMatrixTouch.set(newMatrix);
  limitTransAndScale(mMatrixTouch,mContentRect);
  chart.invalidate();
  newMatrix.set(mMatrixTouch);
  return newMatrix;
}

Fixed version (ground truth):
/** 
 * call this method to refresh the graph with a given matrix
 * @param newMatrix
 * @return
 */
public Matrix refresh(Matrix newMatrix,View chart,boolean invalidate){
  mMatrixTouch.set(newMatrix);
  limitTransAndScale(mMatrixTouch,mContentRect);
  chart.invalidate();
  newMatrix.set(mMatrixTouch);
  return newMatrix;
}