nus-yam/ex-repair huggingface dataset:
Program: 26249
Project: 26249
Buggy source:
private void setupChart(LineChart chart,LineData data,int color){
  ((LineDataSet)data.getDataSetByIndex(0)).setCircleColorHole(color);
  chart.getDescription().setEnabled(false);
  chart.setDrawGridBackground(false);
  chart.setTouchEnabled(true);
  chart.setDragEnabled(true);
  chart.setScaleEnabled(true);
  chart.setPinchZoom(false);
  chart.setBackgroundColor(color);
  chart.setViewPortOffsets(10,0,10,0);
  chart.setData(data);
  Legend l=chart.getLegend();
  l.setEnabled(false);
  chart.getAxisLeft().setEnabled(false);
  chart.getAxisLeft().setSpaceTop(40);
  chart.getAxisLeft().setSpaceBottom(40);
  chart.getAxisRight().setEnabled(false);
  chart.getXAxis().setEnabled(false);
  chart.animateX(2500);
}

Fixed version (ground truth):
private void setupChart(LineChart chart,LineData data,int color){
  ((LineDataSet)data.getDataSetByIndex(0)).setCircleHoleColor(color);
  chart.getDescription().setEnabled(false);
  chart.setDrawGridBackground(false);
  chart.setTouchEnabled(true);
  chart.setDragEnabled(true);
  chart.setScaleEnabled(true);
  chart.setPinchZoom(false);
  chart.setBackgroundColor(color);
  chart.setViewPortOffsets(10,0,10,0);
  chart.setData(data);
  Legend l=chart.getLegend();
  l.setEnabled(false);
  chart.getAxisLeft().setEnabled(false);
  chart.getAxisLeft().setSpaceTop(40);
  chart.getAxisLeft().setSpaceBottom(40);
  chart.getAxisRight().setEnabled(false);
  chart.getXAxis().setEnabled(false);
  chart.animateX(2500);
}
Program: 26250
Project: 26250
Buggy source:
@Override public DataSet<BarEntry> copy(){
  List<BarEntry> yVals=new ArrayList<BarEntry>();
  yVals.clear();
  for (int i=0; i < mValues.size(); i++) {
    yVals.add(mValues.get(i).copy());
  }
  BarDataSet copied=new BarDataSet(yVals,getLabel());
  copied.mColors=mColors;
  copied.mStackSize=mStackSize;
  copied.mBarShadowColor=mBarShadowColor;
  copied.mStackLabels=mStackLabels;
  copied.mHighLightColor=mHighLightColor;
  copied.mHighLightAlpha=mHighLightAlpha;
  return copied;
}

Fixed version (ground truth):
protected void copy(BarDataSet barDataSet){
  super.copy(barDataSet);
  barDataSet.mStackSize=mStackSize;
  barDataSet.mBarShadowColor=mBarShadowColor;
  barDataSet.mBarBorderWidth=mBarBorderWidth;
  barDataSet.mStackLabels=mStackLabels;
  barDataSet.mHighLightAlpha=mHighLightAlpha;
}
Program: 26251
Project: 26251
Buggy source:
@Override public List<GradientColor> getGradientColors(){
  return gradientColors;
}

Fixed version (ground truth):
@Override public List<GradientColor> getGradientColors(){
  return mGradientColors;
}
Program: 26252
Project: 26252
Buggy source:
/** 
 * Sets the start and end color for gradient color, ONLY color that should be used for this DataSet.
 * @param startColor
 * @param endColor
 */
public void setGradientColor(int startColor,int endColor){
  gradientColor=new GradientColor(startColor,endColor);
}

Fixed version (ground truth):
/** 
 * Sets the start and end color for gradient color, ONLY color that should be used for this DataSet.
 * @param startColor
 * @param endColor
 */
public void setGradientColor(int startColor,int endColor){
  mGradientColor=new GradientColor(startColor,endColor);
}
Program: 26253
Project: 26253
Buggy source:
/** 
 * Sets the start and end color for gradient colors, ONLY color that should be used for this DataSet.
 * @param gradientColors
 */
public void setGradientColors(List<GradientColor> gradientColors){
  this.gradientColors=gradientColors;
}

Fixed version (ground truth):
/** 
 * Sets the start and end color for gradient colors, ONLY color that should be used for this DataSet.
 * @param gradientColors
 */
public void setGradientColors(List<GradientColor> gradientColors){
  this.mGradientColors=gradientColors;
}
Program: 26254
Project: 26254
Buggy source:
@Override public GradientColor getGradientColor(int index){
  return gradientColors.get(index % gradientColors.size());
}

Fixed version (ground truth):
@Override public GradientColor getGradientColor(int index){
  return mGradientColors.get(index % mGradientColors.size());
}
Program: 26255
Project: 26255
Buggy source:
@Override public DataSet<BubbleEntry> copy(){
  List<BubbleEntry> yVals=new ArrayList<BubbleEntry>();
  for (int i=0; i < mValues.size(); i++) {
    yVals.add(mValues.get(i).copy());
  }
  BubbleDataSet copied=new BubbleDataSet(yVals,getLabel());
  copied.mColors=mColors;
  copied.mHighLightColor=mHighLightColor;
  return copied;
}

Fixed version (ground truth):
protected void copy(BubbleDataSet bubbleDataSet){
  bubbleDataSet.mHighlightCircleWidth=mHighlightCircleWidth;
  bubbleDataSet.mNormalizeSize=mNormalizeSize;
}
Program: 26256
Project: 26256
Buggy source:
@Override public DataSet<CandleEntry> copy(){
  List<CandleEntry> yVals=new ArrayList<CandleEntry>();
  yVals.clear();
  for (int i=0; i < mValues.size(); i++) {
    yVals.add(mValues.get(i).copy());
  }
  CandleDataSet copied=new CandleDataSet(yVals,getLabel());
  copied.mColors=mColors;
  copied.mShadowWidth=mShadowWidth;
  copied.mShowCandleBar=mShowCandleBar;
  copied.mBarSpace=mBarSpace;
  copied.mHighLightColor=mHighLightColor;
  copied.mIncreasingPaintStyle=mIncreasingPaintStyle;
  copied.mDecreasingPaintStyle=mDecreasingPaintStyle;
  copied.mShadowColor=mShadowColor;
  return copied;
}

Fixed version (ground truth):
protected void copy(CandleDataSet candleDataSet){
  super.copy(candleDataSet);
  candleDataSet.mShadowWidth=mShadowWidth;
  candleDataSet.mShowCandleBar=mShowCandleBar;
  candleDataSet.mBarSpace=mBarSpace;
  candleDataSet.mShadowColorSameAsCandle=mShadowColorSameAsCandle;
  candleDataSet.mHighLightColor=mHighLightColor;
  candleDataSet.mIncreasingPaintStyle=mIncreasingPaintStyle;
  candleDataSet.mDecreasingPaintStyle=mDecreasingPaintStyle;
  candleDataSet.mNeutralColor=mNeutralColor;
  candleDataSet.mIncreasingColor=mIncreasingColor;
  candleDataSet.mDecreasingColor=mDecreasingColor;
  candleDataSet.mShadowColor=mShadowColor;
}
Program: 26257
Project: 26257
Buggy source:
/** 
 * Provides an exact copy of the DataSet this method is used on.
 * @return
 */
public abstract DataSet<T> copy();

Fixed version (ground truth):
/** 
 * @param dataSet
 */
protected void copy(DataSet dataSet){
  super.copy(dataSet);
}
Program: 26258
Project: 26258
Buggy source:
@Override public DataSet<Entry> copy(){
  List<Entry> yVals=new ArrayList<Entry>();
  for (int i=0; i < mValues.size(); i++) {
    yVals.add(mValues.get(i).copy());
  }
  LineDataSet copied=new LineDataSet(yVals,getLabel());
  copied.mMode=mMode;
  copied.mColors=mColors;
  copied.mCircleRadius=mCircleRadius;
  copied.mCircleHoleRadius=mCircleHoleRadius;
  copied.mCircleColors=mCircleColors;
  copied.mDashPathEffect=mDashPathEffect;
  copied.mDrawCircles=mDrawCircles;
  copied.mDrawCircleHole=mDrawCircleHole;
  copied.mHighLightColor=mHighLightColor;
  return copied;
}

Fixed version (ground truth):
protected void copy(LineDataSet lineDataSet){
  super.copy(lineDataSet);
  lineDataSet.mCircleColors=mCircleColors;
  lineDataSet.mCircleHoleColor=mCircleHoleColor;
  lineDataSet.mCircleHoleRadius=mCircleHoleRadius;
  lineDataSet.mCircleRadius=mCircleRadius;
  lineDataSet.mCubicIntensity=mCubicIntensity;
  lineDataSet.mDashPathEffect=mDashPathEffect;
  lineDataSet.mDrawCircleHole=mDrawCircleHole;
  lineDataSet.mDrawCircles=mDrawCircleHole;
  lineDataSet.mFillFormatter=mFillFormatter;
  lineDataSet.mMode=mMode;
}
Program: 26259
Project: 26259
Buggy source:
@Override public int getCircleHoleColor(){
  return mCircleColorHole;
}

Fixed version (ground truth):
@Override public int getCircleHoleColor(){
  return mCircleHoleColor;
}
Program: 26262
Project: 26262
Buggy source:
/** 
 * Draws the zero line.
 */
protected void drawZeroLine(Canvas c){
  int clipRestoreCount=c.save();
  mZeroLineClippingRect.set(mViewPortHandler.getContentRect());
  mZeroLineClippingRect.inset(0.f,-mYAxis.getZeroLineWidth() / 2.f);
  c.clipRect(mLimitLineClippingRect);
  MPPointD pos=mTrans.getPixelForValues(0f,0f);
  mZeroLinePaint.setColor(mYAxis.getZeroLineColor());
  mZeroLinePaint.setStrokeWidth(mYAxis.getZeroLineWidth());
  Path zeroLinePath=mDrawZeroLinePath;
  zeroLinePath.reset();
  zeroLinePath.moveTo(mViewPortHandler.contentLeft(),(float)pos.y - 1);
  zeroLinePath.lineTo(mViewPortHandler.contentRight(),(float)pos.y - 1);
  c.drawPath(zeroLinePath,mZeroLinePaint);
  c.restoreToCount(clipRestoreCount);
}

Fixed version (ground truth):
/** 
 * Draws the zero line.
 */
protected void drawZeroLine(Canvas c){
  int clipRestoreCount=c.save();
  mZeroLineClippingRect.set(mViewPortHandler.getContentRect());
  mZeroLineClippingRect.inset(0.f,-mYAxis.getZeroLineWidth() / 2.f);
  c.clipRect(mZeroLineClippingRect);
  MPPointD pos=mTrans.getPixelForValues(0f,0f);
  mZeroLinePaint.setColor(mYAxis.getZeroLineColor());
  mZeroLinePaint.setStrokeWidth(mYAxis.getZeroLineWidth());
  Path zeroLinePath=mDrawZeroLinePath;
  zeroLinePath.reset();
  zeroLinePath.moveTo(mViewPortHandler.contentLeft(),(float)pos.y - 1);
  zeroLinePath.lineTo(mViewPortHandler.contentRight(),(float)pos.y - 1);
  c.drawPath(zeroLinePath,mZeroLinePaint);
  c.restoreToCount(clipRestoreCount);
}
Program: 26265
Project: 26265
Buggy source:
/** 
 * Returns the Description object of the chart.
 * @return
 */
public Description getDescription(){
  return mDescription;
}

Fixed version (ground truth):
/** 
 * Returns the Description object of the chart that is responsible for holding all information related to the description text that is displayed in the bottom right corner of the chart (by default).
 * @return
 */
public Description getDescription(){
  return mDescription;
}
Program: 26269
Project: 26269
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_scatterchart);
  tvX=(TextView)findViewById(R.id.tvXMax);
  tvY=(TextView)findViewById(R.id.tvYMax);
  mSeekBarX=(SeekBar)findViewById(R.id.seekBar1);
  mSeekBarX.setOnSeekBarChangeListener(this);
  mSeekBarY=(SeekBar)findViewById(R.id.seekBar2);
  mSeekBarY.setOnSeekBarChangeListener(this);
  mChart=(ScatterChart)findViewById(R.id.chart1);
  mChart.setDescription("String_Node_Str");
  mChart.setOnChartValueSelectedListener(this);
  mChart.setDrawGridBackground(false);
  mChart.setTouchEnabled(true);
  mChart.setMaxHighlightDistance(50f);
  mChart.setDragEnabled(true);
  mChart.setScaleEnabled(true);
  mChart.setMaxVisibleValueCount(200);
  mChart.setPinchZoom(true);
  mSeekBarX.setProgress(45);
  mSeekBarY.setProgress(100);
  Legend l=mChart.getLegend();
  l.setPosition(LegendPosition.RIGHT_OF_CHART);
  l.setTypeface(mTfLight);
  YAxis yl=mChart.getAxisLeft();
  yl.setTypeface(mTfLight);
  yl.setAxisMinValue(0f);
  mChart.getAxisRight().setEnabled(false);
  XAxis xl=mChart.getXAxis();
  xl.setTypeface(mTfLight);
  xl.setDrawGridLines(false);
}

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_scatterchart);
  tvX=(TextView)findViewById(R.id.tvXMax);
  tvY=(TextView)findViewById(R.id.tvYMax);
  mSeekBarX=(SeekBar)findViewById(R.id.seekBar1);
  mSeekBarX.setOnSeekBarChangeListener(this);
  mSeekBarY=(SeekBar)findViewById(R.id.seekBar2);
  mSeekBarY.setOnSeekBarChangeListener(this);
  mChart=(ScatterChart)findViewById(R.id.chart1);
  mChart.setDescription("String_Node_Str");
  mChart.setOnChartValueSelectedListener(this);
  mChart.setDrawGridBackground(false);
  mChart.setTouchEnabled(true);
  mChart.setMaxHighlightDistance(50f);
  mChart.setDragEnabled(true);
  mChart.setScaleEnabled(true);
  mChart.setMaxVisibleValueCount(200);
  mChart.setPinchZoom(true);
  mSeekBarX.setProgress(45);
  mSeekBarY.setProgress(100);
  Legend l=mChart.getLegend();
  l.setPosition(LegendPosition.RIGHT_OF_CHART);
  l.setTypeface(mTfLight);
  l.setXOffset(5f);
  YAxis yl=mChart.getAxisLeft();
  yl.setTypeface(mTfLight);
  yl.setAxisMinValue(0f);
  mChart.getAxisRight().setEnabled(false);
  XAxis xl=mChart.getXAxis();
  xl.setTypeface(mTfLight);
  xl.setDrawGridLines(false);
}
Program: 26271
Project: 26271
Buggy source:
/** 
 * Highlights the value selected by touch gesture. Unlike highlightValues(...), this generates a callback to the OnChartValueSelectedListener.
 * @param high         - the highlight object
 * @param callListener - call the listener
 */
public void highlightValue(Highlight high,boolean callListener){
  Entry e=null;
  if (high == null)   mIndicesToHighlight=null;
 else {
    if (mLogEnabled)     Log.i(LOG_TAG,"String_Node_Str" + high.toString());
    e=mData.getEntryForHighlight(high);
    if (e == null) {
      mIndicesToHighlight=null;
      high=null;
    }
 else {
      mIndicesToHighlight=new Highlight[]{high};
    }
  }
  if (callListener && mSelectionListener != null) {
    if (!valuesToHighlight())     mSelectionListener.onNothingSelected();
 else {
      mSelectionListener.onValueSelected(e,high);
    }
  }
  invalidate();
}

Fixed version (ground truth):
/** 
 * Highlights the value selected by touch gesture. Unlike highlightValues(...), this generates a callback to the OnChartValueSelectedListener.
 * @param high         - the highlight object
 * @param callListener - call the listener
 */
public void highlightValue(Highlight high,boolean callListener){
  Entry e=null;
  if (high == null)   mIndicesToHighlight=null;
 else {
    if (mLogEnabled)     Log.i(LOG_TAG,"String_Node_Str" + high.toString());
    e=mData.getEntryForHighlight(high);
    if (e == null) {
      mIndicesToHighlight=null;
      high=null;
    }
 else {
      mIndicesToHighlight=new Highlight[]{high};
    }
  }
  setLastHighlighted(mIndicesToHighlight);
  if (callListener && mSelectionListener != null) {
    if (!valuesToHighlight())     mSelectionListener.onNothingSelected();
 else {
      mSelectionListener.onValueSelected(e,high);
    }
  }
  invalidate();
}
Program: 26272
Project: 26272
Buggy source:
/** 
 * Highlights the values at the given indices in the given DataSets. Provide null or an empty array to undo all highlighting. This should be used to programmatically highlight values. This DOES NOT generate a callback to the OnChartValueSelectedListener.
 * @param highs
 */
public void highlightValues(Highlight[] highs){
  mIndicesToHighlight=highs;
  if (highs == null || highs.length <= 0 || highs[0] == null) {
    mChartTouchListener.setLastHighlighted(null);
  }
 else {
    mChartTouchListener.setLastHighlighted(highs[0]);
  }
  invalidate();
}

Fixed version (ground truth):
/** 
 * Highlights the values at the given indices in the given DataSets. Provide null or an empty array to undo all highlighting. This should be used to programmatically highlight values. This DOES NOT generate a callback to the OnChartValueSelectedListener.
 * @param highs
 */
public void highlightValues(Highlight[] highs){
  mIndicesToHighlight=highs;
  setLastHighlighted(highs);
  invalidate();
}
Program: 26273
Project: 26273
Buggy source:
/** 
 * Performs all necessary operations needed for dragging.
 * @param event
 */
private void performDrag(MotionEvent event){
  mLastGesture=ChartGesture.DRAG;
  mMatrix.set(mSavedMatrix);
  OnChartGestureListener l=mChart.getOnChartGestureListener();
  float dX, dY;
  if (mChart.isAnyAxisInverted() && mClosestDataSetToTouch != null && mChart.getAxis(mClosestDataSetToTouch.getAxisDependency()).isInverted()) {
    if (mChart instanceof HorizontalBarChart) {
      dX=-(event.getX() - mTouchStartPoint.x);
      dY=event.getY() - mTouchStartPoint.y;
    }
 else {
      dX=event.getX() - mTouchStartPoint.x;
      dY=-(event.getY() - mTouchStartPoint.y);
    }
  }
 else {
    dX=event.getX() - mTouchStartPoint.x;
    dY=event.getY() - mTouchStartPoint.y;
  }
  mMatrix.postTranslate(dX,dY);
  if (l != null)   l.onChartTranslate(event,dX,dY);
}

Fixed version (ground truth):
/** 
 * Performs all necessary operations needed for dragging.
 * @param event
 */
private void performDrag(MotionEvent event){
  mLastGesture=ChartGesture.DRAG;
  mMatrix.set(mSavedMatrix);
  OnChartGestureListener l=mChart.getOnChartGestureListener();
  float dX, dY;
  if (inverted()) {
    if (mChart instanceof HorizontalBarChart) {
      dX=-(event.getX() - mTouchStartPoint.x);
      dY=event.getY() - mTouchStartPoint.y;
    }
 else {
      dX=event.getX() - mTouchStartPoint.x;
      dY=-(event.getY() - mTouchStartPoint.y);
    }
  }
 else {
    dX=event.getX() - mTouchStartPoint.x;
    dY=event.getY() - mTouchStartPoint.y;
  }
  mMatrix.postTranslate(dX,dY);
  if (l != null)   l.onChartTranslate(event,dX,dY);
}
Program: 26274
Project: 26274
Buggy source:
/** 
 * returns the correct translation depending on the provided x and y touch points
 * @param x
 * @param y
 * @return
 */
public PointF getTrans(float x,float y){
  ViewPortHandler vph=mChart.getViewPortHandler();
  float xTrans=x - vph.offsetLeft();
  float yTrans=0f;
  if (mChart.isAnyAxisInverted() && mClosestDataSetToTouch != null && mChart.isInverted(mClosestDataSetToTouch.getAxisDependency())) {
    yTrans=-(y - vph.offsetTop());
  }
 else {
    yTrans=-(mChart.getMeasuredHeight() - y - vph.offsetBottom());
  }
  return new PointF(xTrans,yTrans);
}

Fixed version (ground truth):
/** 
 * returns the correct translation depending on the provided x and y touch points
 * @param x
 * @param y
 * @return
 */
public PointF getTrans(float x,float y){
  ViewPortHandler vph=mChart.getViewPortHandler();
  float xTrans=x - vph.offsetLeft();
  float yTrans=0f;
  if (inverted()) {
    yTrans=-(y - vph.offsetTop());
  }
 else {
    yTrans=-(mChart.getMeasuredHeight() - y - vph.offsetBottom());
  }
  return new PointF(xTrans,yTrans);
}
Program: 26277
Project: 26277
Buggy source:
/** 
 * Set this to true to make the highlight operation full-bar oriented, false to make it highlight single values (relevant only for stacked). Default: false
 * @param enabled
 */
public void setHighlightFullBarEnabled(boolean enabled){
  mHighlightFullBarEnabled=enabled;
}

Fixed version (ground truth):
/** 
 * Set this to true to make the highlight operation full-bar oriented, false to make it highlight single values (relevant only for stacked). If enabled, highlighting operations will highlight the whole bar, even if only a single stack entry was tapped. Default: false
 * @param enabled
 */
public void setHighlightFullBarEnabled(boolean enabled){
  mHighlightFullBarEnabled=enabled;
}
Program: 26278
Project: 26278
Buggy source:
/** 
 * Highlights the value at the given x-position in the given DataSet. Provide -1 as the dataSetIndex to undo all highlighting.
 * @param x
 * @param dataSetIndex
 * @param stackIndex the index inside the stack - only relevant for stacked entries
 */
public void highlightValue(float x,int dataSetIndex,int stackIndex){
  highlightValue(new Highlight(x,dataSetIndex,stackIndex),false);
}

Fixed version (ground truth):
/** 
 * Highlights the value at the given x-position in the given DataSet. Provide -1 as the dataSetIndex to undo all highlighting.
 * @param x
 * @param dataSetIndex
 * @param stackIndex   the index inside the stack - only relevant for stacked entries
 */
public void highlightValue(float x,int dataSetIndex,int stackIndex){
  highlightValue(new Highlight(x,dataSetIndex,stackIndex),false);
}
Program: 26279
Project: 26279
Buggy source:
@Override public void renderGridLines(Canvas c){
  if (!mXAxis.isDrawGridLinesEnabled() || !mXAxis.isEnabled())   return;
  float[] positions=new float[mXAxis.mEntryCount * 2];
  for (int i=0; i < positions.length; i+=2) {
    positions[i]=mXAxis.mEntries[i / 2];
  }
  mTrans.pointValuesToPixel(positions);
  mGridPaint.setColor(mXAxis.getGridColor());
  mGridPaint.setStrokeWidth(mXAxis.getGridLineWidth());
  mGridPaint.setPathEffect(mXAxis.getGridDashPathEffect());
  Path gridLinePath=new Path();
  for (int i=0; i < positions.length; i+=2) {
    float x=positions[i];
    if (x >= mViewPortHandler.offsetLeft() && x <= mViewPortHandler.getChartWidth()) {
      gridLinePath.moveTo(x,mViewPortHandler.contentBottom());
      gridLinePath.lineTo(x,mViewPortHandler.contentTop());
      c.drawPath(gridLinePath,mGridPaint);
    }
    gridLinePath.reset();
  }
}

Fixed version (ground truth):
@Override public void renderGridLines(Canvas c){
  if (!mXAxis.isDrawGridLinesEnabled() || !mXAxis.isEnabled())   return;
  float[] positions=new float[mXAxis.mEntryCount * 2];
  for (int i=0; i < positions.length; i+=2) {
    positions[i]=mXAxis.mEntries[i / 2];
    positions[i + 1]=mXAxis.mEntries[i / 2];
  }
  mTrans.pointValuesToPixel(positions);
  setupGridPaint();
  Path gridLinePath=new Path();
  for (int i=0; i < positions.length; i+=2) {
    drawGridLine(c,positions[i],positions[i + 1],gridLinePath);
  }
}
Program: 26280
Project: 26280
Buggy source:
/** 
 * Enabled/disable granularity control on axis value intervals. If enabled, the axis interval is not allowed to go below a certain granularity. Default: false
 * @param enabled
 */
public void setGranularityEnabled(boolean enabled){
  mGranularityEnabled=true;
}

Fixed version (ground truth):
/** 
 * Enabled/disable granularity control on axis value intervals. If enabled, the axis interval is not allowed to go below a certain granularity. Default: false
 * @param enabled
 */
public void setGranularityEnabled(boolean enabled){
  mGranularityEnabled=enabled;
}
Program: 26281
Project: 26281
Buggy source:
/** 
 * Transforms an List of Entry into a float array containing the x and y values transformed with all matrices for the BUBBLECHART.
 * @param data
 * @return
 */
public float[] generateTransformedValuesBubble(IBubbleDataSet data,float phaseY,int from,int to){
  final int count=(int)Math.ceil(to - from) * 2;
  float[] valuePoints=new float[count];
  for (int j=0; j < count; j+=2) {
    Entry e=data.getEntryForIndex(j / 2 + from);
    if (e != null) {
      valuePoints[j]=e.getX();
      valuePoints[j + 1]=e.getY() * phaseY;
    }
  }
  getValueToPixelMatrix().mapPoints(valuePoints);
  return valuePoints;
}

Fixed version (ground truth):
/** 
 * Transforms an List of Entry into a float array containing the x and y values transformed with all matrices for the BUBBLECHART.
 * @param data
 * @return
 */
public float[] generateTransformedValuesBubble(IBubbleDataSet data,float phaseY,int from,int to){
  final int count=(to - from + 1) * 2;
  float[] valuePoints=new float[count];
  for (int j=0; j < count; j+=2) {
    Entry e=data.getEntryForIndex(j / 2 + from);
    if (e != null) {
      valuePoints[j]=e.getX();
      valuePoints[j + 1]=e.getY() * phaseY;
    }
  }
  getValueToPixelMatrix().mapPoints(valuePoints);
  return valuePoints;
}
Program: 26282
Project: 26282
Buggy source:
/** 
 * Transforms an List of Entry into a float array containing the x and y values transformed with all matrices for the CANDLESTICKCHART.
 * @param data
 * @return
 */
public float[] generateTransformedValuesCandle(ICandleDataSet data,float phaseX,float phaseY,int from,int to){
  final int count=(int)Math.ceil((to - from) * phaseX) * 2;
  float[] valuePoints=new float[count];
  for (int j=0; j < count; j+=2) {
    CandleEntry e=data.getEntryForIndex(j / 2 + from);
    if (e != null) {
      valuePoints[j]=e.getX();
      valuePoints[j + 1]=e.getHigh() * phaseY;
    }
  }
  getValueToPixelMatrix().mapPoints(valuePoints);
  return valuePoints;
}

Fixed version (ground truth):
/** 
 * Transforms an List of Entry into a float array containing the x and y values transformed with all matrices for the CANDLESTICKCHART.
 * @param data
 * @return
 */
public float[] generateTransformedValuesCandle(ICandleDataSet data,float phaseX,float phaseY,int from,int to){
  final int count=(int)((to - from) * phaseX + 1) * 2;
  float[] valuePoints=new float[count];
  for (int j=0; j < count; j+=2) {
    CandleEntry e=data.getEntryForIndex(j / 2 + from);
    if (e != null) {
      valuePoints[j]=e.getX();
      valuePoints[j + 1]=e.getHigh() * phaseY;
    }
  }
  getValueToPixelMatrix().mapPoints(valuePoints);
  return valuePoints;
}
Program: 26284
Project: 26284
Buggy source:
protected void prepareBarHighlight(float x,float y1,float y2,float barWidthHalf,Transformer trans){
  float left=x - barWidthHalf;
  float right=x + barWidthHalf;
  float top=y1;
  float bottom=y2;
  mBarRect.set(left,top,right,bottom);
  trans.rectValueToPixel(mBarRect,mAnimator.getPhaseY());
}

Fixed version (ground truth):
protected void prepareBarHighlight(float x,float y1,float y2,float barWidthHalf,Transformer trans){
  float left=x - barWidthHalf;
  float right=x + barWidthHalf;
  float top=y1;
  float bottom=y2;
  mBarRect.set(left,top,right,bottom);
  trans.rectToPixelPhase(mBarRect,mAnimator.getPhaseY());
}
Program: 26285
Project: 26285
Buggy source:
@Override public void drawHighlighted(Canvas c,Highlight[] indices){
  BarData barData=mChart.getBarData();
  for (  Highlight high : indices) {
    final int minDataSetIndex=high.getDataSetIndex() == -1 ? 0 : high.getDataSetIndex();
    final int maxDataSetIndex=high.getDataSetIndex() == -1 ? barData.getDataSetCount() : (high.getDataSetIndex() + 1);
    if (maxDataSetIndex - minDataSetIndex < 1)     continue;
    for (int dataSetIndex=minDataSetIndex; dataSetIndex < maxDataSetIndex; dataSetIndex++) {
      IBarDataSet set=barData.getDataSetByIndex(dataSetIndex);
      if (set == null || !set.isHighlightEnabled())       continue;
      Transformer trans=mChart.getTransformer(set.getAxisDependency());
      mHighlightPaint.setColor(set.getHighLightColor());
      mHighlightPaint.setAlpha(set.getHighLightAlpha());
      float x=high.getX();
      BarEntry e=set.getEntryForXPos(x);
      if (e == null)       continue;
      boolean isStack=high.getStackIndex() < 0 ? false : true;
      final float y1;
      final float y2;
      if (isStack) {
        y1=high.getRange().from;
        y2=high.getRange().to;
      }
 else {
        y1=e.getY();
        y2=0.f;
      }
      prepareBarHighlight(e.getX(),y1,y2,barData.getBarWidth() / 2f,trans);
      c.drawRect(mBarRect,mHighlightPaint);
    }
  }
}

Fixed version (ground truth):
@Override public void drawHighlighted(Canvas c,Highlight[] indices){
  BarData barData=mChart.getBarData();
  for (  Highlight high : indices) {
    final int minDataSetIndex=high.getDataSetIndex() == -1 ? 0 : high.getDataSetIndex();
    final int maxDataSetIndex=high.getDataSetIndex() == -1 ? barData.getDataSetCount() : (high.getDataSetIndex() + 1);
    if (maxDataSetIndex - minDataSetIndex < 1)     continue;
    for (int dataSetIndex=minDataSetIndex; dataSetIndex < maxDataSetIndex; dataSetIndex++) {
      IBarDataSet set=barData.getDataSetByIndex(dataSetIndex);
      if (set == null || !set.isHighlightEnabled())       continue;
      Transformer trans=mChart.getTransformer(set.getAxisDependency());
      mHighlightPaint.setColor(set.getHighLightColor());
      mHighlightPaint.setAlpha(set.getHighLightAlpha());
      float x=high.getX();
      BarEntry e=set.getEntryForXPos(x);
      float entryIndex=set.getEntryIndex(e);
      if (e == null || entryIndex > set.getEntryCount() * mAnimator.getPhaseX())       continue;
      boolean isStack=high.getStackIndex() < 0 ? false : true;
      final float y1;
      final float y2;
      if (isStack) {
        y1=high.getRange().from;
        y2=high.getRange().to;
      }
 else {
        y1=e.getY();
        y2=0.f;
      }
      prepareBarHighlight(e.getX(),y1,y2,barData.getBarWidth() / 2f,trans);
      c.drawRect(mBarRect,mHighlightPaint);
    }
  }
}
Program: 26286
Project: 26286
Buggy source:
@Override protected void prepareBarHighlight(float x,float y1,float y2,float barWidthHalf,Transformer trans){
  float top=x - barWidthHalf;
  float bottom=x + barWidthHalf;
  float left=y1;
  float right=y2;
  mBarRect.set(left,top,right,bottom);
  trans.rectValueToPixel(mBarRect,mAnimator.getPhaseY());
}

Fixed version (ground truth):
@Override protected void prepareBarHighlight(float x,float y1,float y2,float barWidthHalf,Transformer trans){
  float top=x - barWidthHalf;
  float bottom=x + barWidthHalf;
  float left=y1;
  float right=y2;
  mBarRect.set(left,top,right,bottom);
  trans.rectToPixelPhaseHorizontal(mBarRect,mAnimator.getPhaseY());
}
Program: 26287
Project: 26287
Buggy source:
/** 
 * Transform a rectangle with all matrices with potential animation phases.
 * @param r
 * @param phaseY
 */
public void rectValueToPixel(RectF r,float phaseY){
  r.top*=phaseY;
  r.bottom*=phaseY;
  mMatrixValueToPx.mapRect(r);
  mViewPortHandler.getMatrixTouch().mapRect(r);
  mMatrixOffset.mapRect(r);
}

Fixed version (ground truth):
/** 
 * Transform a rectangle with all matrices.
 * @param r
 */
public void rectValueToPixel(RectF r){
  mMatrixValueToPx.mapRect(r);
  mViewPortHandler.getMatrixTouch().mapRect(r);
  mMatrixOffset.mapRect(r);
}
Program: 26288
Project: 26288
Buggy source:
/** 
 * Constructor for bubbles.
 * @param xValue
 * @param yValue
 * @param bubbleSize
 */
public RealmDemoData(float xValue,float yValue,float bubbleSize){
  this.xValue=xValue;
  this.yValue=yValue;
  this.bubbleSize=bubbleSize;
}

Fixed version (ground truth):
/** 
 * Constructor for pie chart.
 * @param yValue
 * @param label
 */
public RealmDemoData(float yValue,String label){
  this.yValue=yValue;
  this.label=label;
}
Program: 26289
Project: 26289
Buggy source:
protected void writeToDBPie(){
  mRealm.beginTransaction();
  mRealm.clear(RealmDemoData.class);
  float value1=15f + (float)(Math.random() * 8f);
  float value2=15f + (float)(Math.random() * 8f);
  float value3=15f + (float)(Math.random() * 8f);
  float value4=15f + (float)(Math.random() * 8f);
  float value5=100f - value1 - value2- value3- value4;
  float[] values=new float[]{value1,value2,value3,value4,value5};
  String[] xValues=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  for (int i=0; i < values.length; i++) {
    RealmDemoData d=new RealmDemoData(i,values[i]);
    mRealm.copyToRealm(d);
  }
  mRealm.commitTransaction();
}

Fixed version (ground truth):
protected void writeToDBPie(){
  mRealm.beginTransaction();
  mRealm.clear(RealmDemoData.class);
  float value1=15f + (float)(Math.random() * 8f);
  float value2=15f + (float)(Math.random() * 8f);
  float value3=15f + (float)(Math.random() * 8f);
  float value4=15f + (float)(Math.random() * 8f);
  float value5=100f - value1 - value2- value3- value4;
  float[] values=new float[]{value1,value2,value3,value4,value5};
  String[] labels=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  for (int i=0; i < values.length; i++) {
    RealmDemoData d=new RealmDemoData(values[i],labels[i]);
    mRealm.copyToRealm(d);
  }
  mRealm.commitTransaction();
}
Program: 26290
Project: 26290
Buggy source:
private void setData(){
  RealmResults<RealmDemoData> result=mRealm.allObjects(RealmDemoData.class);
  RealmPieDataSet<RealmDemoData> set=new RealmPieDataSet<RealmDemoData>(result,"String_Node_Str");
  set.setColors(ColorTemplate.VORDIPLOM_COLORS);
  set.setLabel("String_Node_Str");
  set.setSliceSpace(2);
  PieData data=new PieData(set);
  styleData(data);
  data.setValueTextColor(Color.WHITE);
  data.setValueTextSize(12f);
  mChart.setData(data);
  mChart.animateY(1400);
}

Fixed version (ground truth):
private void setData(){
  RealmResults<RealmDemoData> result=mRealm.allObjects(RealmDemoData.class);
  RealmPieDataSet<RealmDemoData> set=new RealmPieDataSet<RealmDemoData>(result,"String_Node_Str","String_Node_Str");
  set.setColors(ColorTemplate.VORDIPLOM_COLORS);
  set.setLabel("String_Node_Str");
  set.setSliceSpace(2);
  PieData data=new PieData(set);
  styleData(data);
  data.setValueTextColor(Color.WHITE);
  data.setValueTextSize(12f);
  mChart.setData(data);
  mChart.animateY(1400);
}
Program: 26291
Project: 26291
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_radarchart_noseekbar);
  mChart=(RadarChart)findViewById(R.id.chart1);
  setup(mChart);
  mChart.getYAxis().setEnabled(false);
  mChart.setWebAlpha(180);
  mChart.setWebColorInner(Color.DKGRAY);
  mChart.setWebColor(Color.GRAY);
}

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_radarchart_noseekbar);
  mChart=(RadarChart)findViewById(R.id.chart1);
  setup(mChart);
  mChart.getYAxis().setEnabled(false);
  mChart.getXAxis().setEnabled(false);
  mChart.setWebAlpha(180);
  mChart.setWebColorInner(Color.DKGRAY);
  mChart.setWebColor(Color.GRAY);
}
Program: 26292
Project: 26292
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_realm_wiki);
  lineChart=(LineChart)findViewById(R.id.lineChart);
  barChart=(BarChart)findViewById(R.id.barChart);
  setup(lineChart);
  setup(barChart);
  lineChart.setExtraBottomOffset(5f);
  barChart.setExtraBottomOffset(5f);
  lineChart.getAxisLeft().setDrawGridLines(false);
  lineChart.getXAxis().setDrawGridLines(false);
  barChart.getAxisLeft().setDrawGridLines(false);
  barChart.getXAxis().setDrawGridLines(false);
  barChart.getXAxis().setCenterAxisLabels(true);
}

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_realm_wiki);
  lineChart=(LineChart)findViewById(R.id.lineChart);
  barChart=(BarChart)findViewById(R.id.barChart);
  setup(lineChart);
  setup(barChart);
  lineChart.setExtraBottomOffset(5f);
  barChart.setExtraBottomOffset(5f);
  lineChart.getAxisLeft().setDrawGridLines(false);
  lineChart.getXAxis().setDrawGridLines(false);
  lineChart.getXAxis().setLabelCount(5);
  lineChart.getXAxis().setGranularity(1f);
  barChart.getAxisLeft().setDrawGridLines(false);
  barChart.getXAxis().setDrawGridLines(false);
  barChart.getXAxis().setLabelCount(5);
  barChart.getXAxis().setGranularity(1f);
}
Program: 26294
Project: 26294
Buggy source:
/** 
 * Constructor that takes the realm RealmResults, sorts & stores them.
 * @param results
 * @param yValuesField
 * @param xIndexField
 */
public RealmLineScatterCandleRadarDataSet(RealmResults<T> results,String yValuesField,String xIndexField){
  super(results,yValuesField,xIndexField);
}

Fixed version (ground truth):
/** 
 * Constructor that takes the realm RealmResults, sorts & stores them.
 * @param results
 * @param xValueField
 * @param yValuesField
 */
public RealmLineScatterCandleRadarDataSet(RealmResults<T> results,String xValueField,String yValuesField){
  super(results,xValueField,yValuesField);
}
Program: 26295
Project: 26295
Buggy source:
/** 
 * Constructor for creating a LineDataSet with realm data.
 * @param result      the queried results from the realm database
 * @param highField   the name of the field in your data object that represents the "high" yValue
 * @param lowField    the name of the field in your data object that represents the "low" yValue
 * @param openField   the name of the field in your data object that represents the "open" yValue
 * @param closeField  the name of the field in your data object that represents the "close" yValue
 * @param xIndexField the name of the field in your data object that represents the xPx-index
 */
public RealmCandleDataSet(RealmResults<T> result,String highField,String lowField,String openField,String closeField,String xIndexField){
  super(result,null,xIndexField);
  this.mHighField=highField;
  this.mLowField=lowField;
  this.mOpenField=openField;
  this.mCloseField=closeField;
  build(this.results);
  calcMinMax();
}

Fixed version (ground truth):
/** 
 * Constructor for creating a LineDataSet with realm data.
 * @param result      the queried results from the realm database
 * @param xValueField the name of the field in your data object that represents the "x" value
 * @param highField   the name of the field in your data object that represents the "high" value
 * @param lowField    the name of the field in your data object that represents the "low" value
 * @param openField   the name of the field in your data object that represents the "open" value
 * @param closeField  the name of the field in your data object that represents the "close" value
 */
public RealmCandleDataSet(RealmResults<T> result,String xValueField,String highField,String lowField,String openField,String closeField){
  super(result,xValueField,null);
  this.mHighField=highField;
  this.mLowField=lowField;
  this.mOpenField=openField;
  this.mCloseField=closeField;
  build(this.results);
  calcMinMax();
}
Program: 26296
Project: 26296
Buggy source:
public CandleEntry buildEntryFromResultObject(T realmObject,int xIndex){
  DynamicRealmObject dynamicObject=new DynamicRealmObject(realmObject);
  return new CandleEntry(mXValuesField == null ? xIndex : dynamicObject.getFloat(mXValuesField),dynamicObject.getFloat(mHighField),dynamicObject.getFloat(mLowField),dynamicObject.getFloat(mOpenField),dynamicObject.getFloat(mCloseField));
}

Fixed version (ground truth):
@Override public CandleEntry buildEntryFromResultObject(T realmObject,float x){
  DynamicRealmObject dynamicObject=new DynamicRealmObject(realmObject);
  return new CandleEntry(mXValuesField == null ? x : dynamicObject.getFloat(mXValuesField),dynamicObject.getFloat(mHighField),dynamicObject.getFloat(mLowField),dynamicObject.getFloat(mOpenField),dynamicObject.getFloat(mCloseField));
}
Program: 26297
Project: 26297
Buggy source:
/** 
 * Constructor for creating a PieDataSet with realm data.
 * @param result       the queried results from the realm database
 * @param yValuesField the name of the field in your data object that represents the yPx-yValue
 */
public RealmPieDataSet(RealmResults<T> result,String yValuesField){
  super(result,yValuesField);
  build(this.results);
  calcMinMax();
}

Fixed version (ground truth):
public RealmPieDataSet(RealmResults<T> result,String yValuesField,String labelField){
  super(result,yValuesField);
  this.mLabelField=labelField;
  build(this.results);
  calcMinMax();
}
Program: 26299
Project: 26299
Buggy source:
/** 
 * Returns the lowest xPx-index (yValue on the xPx-axis) that is still visible on the chart.
 * @return
 */
@Override public float getLowestVisibleX(){
  PointD pos=getTransformer(AxisDependency.LEFT).getValuesByTouchPoint(mViewPortHandler.contentLeft(),mViewPortHandler.contentBottom());
  return (float)Math.min(mXAxis.mAxisMinimum,pos.x);
}

Fixed version (ground truth):
/** 
 * Returns the lowest xPx-index (yValue on the xPx-axis) that is still visible on the chart.
 * @return
 */
@Override public float getLowestVisibleX(){
  PointD pos=getTransformer(AxisDependency.LEFT).getValuesByTouchPoint(mViewPortHandler.contentLeft(),mViewPortHandler.contentBottom());
  return (float)Math.max(mXAxis.mAxisMinimum,pos.x);
}
Program: 26300
Project: 26300
Buggy source:
@Override public float getLowestVisibleX(){
  PointD pos=getTransformer(AxisDependency.LEFT).getValuesByTouchPoint(mViewPortHandler.contentLeft(),mViewPortHandler.contentBottom());
  return (float)Math.min(mXAxis.mAxisMinimum,pos.y);
}

Fixed version (ground truth):
@Override public float getLowestVisibleX(){
  PointD pos=getTransformer(AxisDependency.LEFT).getValuesByTouchPoint(mViewPortHandler.contentLeft(),mViewPortHandler.contentBottom());
  return (float)Math.max(mXAxis.mAxisMinimum,pos.y);
}
Program: 26301
Project: 26301
Buggy source:
public static List<BarEntry> loadBarEntriesFromAssets(AssetManager am,String path){
  List<BarEntry> entries=new ArrayList<BarEntry>();
  BufferedReader reader=null;
  try {
    reader=new BufferedReader(new InputStreamReader(am.open(path),"String_Node_Str"));
    String line=reader.readLine();
    while (line != null) {
      String[] split=line.split("String_Node_Str");
      entries.add(new BarEntry(Float.parseFloat(split[1]),Integer.parseInt(split[0])));
      line=reader.readLine();
    }
  }
 catch (  IOException e) {
    Log.e(LOG,e.toString());
  }
 finally {
    if (reader != null) {
      try {
        reader.close();
      }
 catch (      IOException e) {
        Log.e(LOG,e.toString());
      }
    }
  }
  return entries;
}

Fixed version (ground truth):
public static List<BarEntry> loadBarEntriesFromAssets(AssetManager am,String path){
  List<BarEntry> entries=new ArrayList<BarEntry>();
  BufferedReader reader=null;
  try {
    reader=new BufferedReader(new InputStreamReader(am.open(path),"String_Node_Str"));
    String line=reader.readLine();
    while (line != null) {
      String[] split=line.split("String_Node_Str");
      entries.add(new BarEntry(Float.parseFloat(split[1]),Float.parseFloat(split[0])));
      line=reader.readLine();
    }
  }
 catch (  IOException e) {
    Log.e(LOG,e.toString());
  }
 finally {
    if (reader != null) {
      try {
        reader.close();
      }
 catch (      IOException e) {
        Log.e(LOG,e.toString());
      }
    }
  }
  return entries;
}
Program: 26304
Project: 26304
Buggy source:
@Override public void drawHighlighted(Canvas c,Highlight[] indices){
  BarData barData=mChart.getBarData();
  int setCount=barData.getDataSetCount();
  for (  Highlight high : indices) {
    final int minDataSetIndex=high.getDataSetIndex() == -1 ? 0 : high.getDataSetIndex();
    final int maxDataSetIndex=high.getDataSetIndex() == -1 ? barData.getDataSetCount() : (high.getDataSetIndex() + 1);
    if (maxDataSetIndex - minDataSetIndex < 1)     continue;
    for (int dataSetIndex=minDataSetIndex; dataSetIndex < maxDataSetIndex; dataSetIndex++) {
      IBarDataSet set=barData.getDataSetByIndex(dataSetIndex);
      if (set == null || !set.isHighlightEnabled())       continue;
      Transformer trans=mChart.getTransformer(set.getAxisDependency());
      mHighlightPaint.setColor(set.getHighLightColor());
      mHighlightPaint.setAlpha(set.getHighLightAlpha());
      float x=high.getX();
      BarEntry e=set.getEntryForXPos(x);
      int entryIndex=set.getEntryIndex(e);
      if (e == null)       continue;
      boolean isStack=high.getStackIndex() < 0 ? false : true;
      final float y1;
      final float y2;
      if (isStack) {
        y1=high.getRange().from;
        y2=high.getRange().to;
      }
 else {
        y1=e.getY();
        y2=0.f;
      }
      prepareBarHighlight(e.getX(),y1,y2,barData.getBarWidth() / 2f,trans);
      c.drawRect(mBarRect,mHighlightPaint);
    }
  }
}

Fixed version (ground truth):
@Override public void drawHighlighted(Canvas c,Highlight[] indices){
  BarData barData=mChart.getBarData();
  for (  Highlight high : indices) {
    final int minDataSetIndex=high.getDataSetIndex() == -1 ? 0 : high.getDataSetIndex();
    final int maxDataSetIndex=high.getDataSetIndex() == -1 ? barData.getDataSetCount() : (high.getDataSetIndex() + 1);
    if (maxDataSetIndex - minDataSetIndex < 1)     continue;
    for (int dataSetIndex=minDataSetIndex; dataSetIndex < maxDataSetIndex; dataSetIndex++) {
      IBarDataSet set=barData.getDataSetByIndex(dataSetIndex);
      if (set == null || !set.isHighlightEnabled())       continue;
      Transformer trans=mChart.getTransformer(set.getAxisDependency());
      mHighlightPaint.setColor(set.getHighLightColor());
      mHighlightPaint.setAlpha(set.getHighLightAlpha());
      float x=high.getX();
      BarEntry e=set.getEntryForXPos(x);
      int entryIndex=set.getEntryIndex(e);
      if (e == null)       continue;
      boolean isStack=high.getStackIndex() < 0 ? false : true;
      final float y1;
      final float y2;
      if (isStack) {
        y1=high.getRange().from;
        y2=high.getRange().to;
      }
 else {
        y1=e.getY();
        y2=0.f;
      }
      prepareBarHighlight(e.getX(),y1,y2,barData.getBarWidth() / 2f,trans);
      c.drawRect(mBarRect,mHighlightPaint);
    }
  }
}
Program: 26306
Project: 26306
Buggy source:
@Override public void notifyDataSetChanged(){
  if (mData == null) {
    if (mLogEnabled)     Log.i(LOG_TAG,"String_Node_Str");
    return;
  }
 else {
    if (mLogEnabled)     Log.i(LOG_TAG,"String_Node_Str");
  }
  if (mRenderer != null)   mRenderer.initBuffers();
  calcMinMax();
  mAxisRendererLeft.computeAxis(mAxisLeft.mAxisMinimum,mAxisLeft.mAxisMaximum,mAxisLeft.isInverted());
  mAxisRendererRight.computeAxis(mAxisRight.mAxisMinimum,mAxisRight.mAxisMaximum,mAxisRight.isInverted());
  if (mLegend != null)   mLegendRenderer.computeLegend(mData);
  calculateOffsets();
}

Fixed version (ground truth):
@Override public void notifyDataSetChanged(){
  if (mData == null) {
    if (mLogEnabled)     Log.i(LOG_TAG,"String_Node_Str");
    return;
  }
 else {
    if (mLogEnabled)     Log.i(LOG_TAG,"String_Node_Str");
  }
  if (mRenderer != null)   mRenderer.initBuffers();
  calcMinMax();
  mAxisRendererLeft.computeAxis(mAxisLeft.mAxisMinimum,mAxisLeft.mAxisMaximum,mAxisLeft.isInverted());
  mAxisRendererRight.computeAxis(mAxisRight.mAxisMinimum,mAxisRight.mAxisMaximum,mAxisRight.isInverted());
  mXAxisRenderer.computeAxis(mXAxis.mAxisMinimum,mXAxis.mAxisMaximum,false);
  if (mLegend != null)   mLegendRenderer.computeLegend(mData);
  calculateOffsets();
}
Program: 26307
Project: 26307
Buggy source:
@Override public void renderAxisLabels(Canvas c){
  if (!mXAxis.isEnabled() || !mXAxis.isDrawLabelsEnabled())   return;
  float yoffset=mXAxis.getYOffset();
  mAxisLabelPaint.setTypeface(mXAxis.getTypeface());
  mAxisLabelPaint.setTextSize(mXAxis.getTextSize());
  mAxisLabelPaint.setColor(mXAxis.getTextColor());
  if (mXAxis.getPosition() == XAxisPosition.TOP) {
    drawLabels(c,mViewPortHandler.contentTop() - yoffset,new PointF(0.5f,1.0f));
  }
 else   if (mXAxis.getPosition() == XAxisPosition.TOP_INSIDE) {
    drawLabels(c,mViewPortHandler.contentTop() + yoffset + mXAxis.mLabelRotatedHeight,new PointF(0.5f,1.0f));
  }
 else   if (mXAxis.getPosition() == XAxisPosition.BOTTOM) {
    drawLabels(c,mViewPortHandler.contentBottom() + yoffset,new PointF(0.5f,0.0f));
  }
 else   if (mXAxis.getPosition() == XAxisPosition.BOTTOM_INSIDE) {
    drawLabels(c,mViewPortHandler.contentBottom() - yoffset - mXAxis.mLabelRotatedHeight,new PointF(0.5f,0.0f));
  }
 else {
    drawLabels(c,mViewPortHandler.contentTop() - yoffset,new PointF(0.5f,1.0f));
    drawLabels(c,mViewPortHandler.contentBottom() + yoffset,new PointF(0.5f,0.0f));
  }
}

Fixed version (ground truth):
@Override public void renderAxisLabels(Canvas c){
  if (!mXAxis.isEnabled() || !mXAxis.isDrawLabelsEnabled())   return;
  float yoffset=mXAxis.getYOffset();
  mAxisLabelPaint.setTypeface(mXAxis.getTypeface());
  mAxisLabelPaint.setTextSize(mXAxis.getTextSize());
  mAxisLabelPaint.setColor(mXAxis.getTextColor());
  if (mXAxis.getPosition() == XAxisPosition.TOP) {
    drawLabels(c,mViewPortHandler.contentTop() - yoffset,new PointF(0.5f,0.9f));
  }
 else   if (mXAxis.getPosition() == XAxisPosition.TOP_INSIDE) {
    drawLabels(c,mViewPortHandler.contentTop() + yoffset + mXAxis.mLabelRotatedHeight,new PointF(0.5f,1.0f));
  }
 else   if (mXAxis.getPosition() == XAxisPosition.BOTTOM) {
    drawLabels(c,mViewPortHandler.contentBottom() + yoffset,new PointF(0.5f,0.0f));
  }
 else   if (mXAxis.getPosition() == XAxisPosition.BOTTOM_INSIDE) {
    drawLabels(c,mViewPortHandler.contentBottom() - yoffset - mXAxis.mLabelRotatedHeight,new PointF(0.5f,0.0f));
  }
 else {
    drawLabels(c,mViewPortHandler.contentTop() - yoffset,new PointF(0.5f,1.0f));
    drawLabels(c,mViewPortHandler.contentBottom() + yoffset,new PointF(0.5f,0.0f));
  }
}