nus-yam/ex-repair huggingface dataset:
Program: 18642
Project: 18642
Buggy source:
private void setData(int count,float range){
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < count; i++) {
    xVals.add((1990 + i) + "String_Node_Str");
  }
  ArrayList<Entry> vals1=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float mult=(range + 1);
    float val=(float)(Math.random() * mult) + 20;
    vals1.add(new Entry(val,i));
  }
  LineDataSet set1=new LineDataSet(vals1,"String_Node_Str");
  set1.setDrawCubic(true);
  set1.setCubicIntensity(0.2f);
  set1.setDrawFilled(true);
  set1.setDrawCircles(false);
  set1.setLineWidth(2f);
  set1.setCircleSize(5f);
  set1.setHighLightColor(Color.rgb(244,117,117));
  set1.setColor(Color.rgb(104,241,175));
  ArrayList<LineDataSet> dataSets=new ArrayList<LineDataSet>();
  dataSets.add(set1);
  LineData data=new LineData(xVals,dataSets);
  data.setValueTypeface(tf);
  mChart.setData(data);
}

Fixed version (ground truth):
private void setData(int count,float range){
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < count; i++) {
    xVals.add((1990 + i) + "String_Node_Str");
  }
  ArrayList<Entry> vals1=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float mult=(range + 1);
    float val=(float)(Math.random() * mult) + 20;
    vals1.add(new Entry(val,i));
  }
  LineDataSet set1=new LineDataSet(vals1,"String_Node_Str");
  set1.setDrawCubic(true);
  set1.setCubicIntensity(0.2f);
  set1.setDrawFilled(true);
  set1.setDrawCircles(false);
  set1.setLineWidth(2f);
  set1.setCircleSize(5f);
  set1.setHighLightColor(Color.rgb(244,117,117));
  set1.setColor(Color.rgb(104,241,175));
  ArrayList<LineDataSet> dataSets=new ArrayList<LineDataSet>();
  dataSets.add(set1);
  LineData data=new LineData(xVals,dataSets);
  data.setValueTypeface(tf);
  data.setValueTextSize(9f);
  data.setDrawValues(false);
  mChart.setData(data);
}
Program: 18644
Project: 18644
Buggy source:
@SuppressLint("String_Node_Str") @Override public void onValueSelected(Entry e,int dataSetIndex,Highlight h){
  if (e == null)   return;
  RectF bounds=mChart.getBarBounds((BarEntry)e);
  PointF position=mChart.getPosition(e,AxisDependency.LEFT);
  Log.i("String_Node_Str",bounds.toString());
  Log.i("String_Node_Str",position.toString());
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") @Override public void onValueSelected(Entry e,int dataSetIndex,Highlight h){
  if (e == null)   return;
  RectF bounds=mChart.getBarBounds((BarEntry)e);
  PointF position=mChart.getPosition(e,mChart.getData().getDataSetByIndex(dataSetIndex).getAxisDependency());
  Log.i("String_Node_Str",bounds.toString());
  Log.i("String_Node_Str",position.toString());
}
Program: 18645
Project: 18645
Buggy source:
private void setData(int count,float range){
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < count; i++) {
    xVals.add((i) + "String_Node_Str");
  }
  ArrayList<Entry> yVals=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float mult=(range + 1);
    float val=(float)(Math.random() * mult) + 3;
    yVals.add(new Entry(val,i));
  }
  LineDataSet set1=new LineDataSet(yVals,"String_Node_Str");
  set1.enableDashedLine(10f,5f,0f);
  set1.setColor(Color.BLACK);
  set1.setCircleColor(Color.BLACK);
  set1.setLineWidth(1f);
  set1.setCircleSize(4f);
  set1.setFillAlpha(65);
  set1.setFillColor(Color.BLACK);
  ArrayList<LineDataSet> dataSets=new ArrayList<LineDataSet>();
  dataSets.add(set1);
  LineData data=new LineData(xVals,dataSets);
  LimitLine ll1=new LimitLine(130f,"String_Node_Str");
  ll1.setLineWidth(4f);
  ll1.enableDashedLine(10f,10f,0f);
  ll1.setLabelPosition(LimitLabelPosition.POS_RIGHT);
  ll1.setTextSize(10f);
  LimitLine ll2=new LimitLine(-30f,"String_Node_Str");
  ll2.setLineWidth(4f);
  ll2.enableDashedLine(10f,10f,0f);
  ll2.setLabelPosition(LimitLabelPosition.POS_RIGHT);
  ll2.setTextSize(10f);
  YAxis leftAxis=mChart.getAxisLeft();
  leftAxis.addLimitLine(ll1);
  leftAxis.addLimitLine(ll2);
  leftAxis.setAxisMaxValue(220f);
  leftAxis.setAxisMinValue(-50f);
  leftAxis.setStartAtZero(false);
  mChart.getAxisRight().setEnabled(false);
  mChart.setData(data);
}

Fixed version (ground truth):
private void setData(int count,float range){
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < count; i++) {
    xVals.add((i) + "String_Node_Str");
  }
  ArrayList<Entry> yVals=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float mult=(range + 1);
    float val=(float)(Math.random() * mult) + 3;
    yVals.add(new Entry(val,i));
  }
  LineDataSet set1=new LineDataSet(yVals,"String_Node_Str");
  set1.enableDashedLine(10f,5f,0f);
  set1.setColor(Color.BLACK);
  set1.setCircleColor(Color.BLACK);
  set1.setLineWidth(1f);
  set1.setCircleSize(4f);
  set1.setFillAlpha(65);
  set1.setFillColor(Color.BLACK);
  ArrayList<LineDataSet> dataSets=new ArrayList<LineDataSet>();
  dataSets.add(set1);
  LineData data=new LineData(xVals,dataSets);
  data.setValueTextSize(10f);
  LimitLine ll1=new LimitLine(130f,"String_Node_Str");
  ll1.setLineWidth(4f);
  ll1.enableDashedLine(10f,10f,0f);
  ll1.setLabelPosition(LimitLabelPosition.POS_RIGHT);
  ll1.setTextSize(10f);
  LimitLine ll2=new LimitLine(-30f,"String_Node_Str");
  ll2.setLineWidth(4f);
  ll2.enableDashedLine(10f,10f,0f);
  ll2.setLabelPosition(LimitLabelPosition.POS_RIGHT);
  ll2.setTextSize(10f);
  YAxis leftAxis=mChart.getAxisLeft();
  leftAxis.addLimitLine(ll1);
  leftAxis.addLimitLine(ll2);
  leftAxis.setAxisMaxValue(220f);
  leftAxis.setAxisMinValue(-50f);
  leftAxis.setStartAtZero(false);
  mChart.getAxisRight().setEnabled(false);
  mChart.setData(data);
}
Program: 18646
Project: 18646
Buggy source:
private void setData(int count,float range){
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < count; i++) {
    xVals.add((i) + "String_Node_Str");
  }
  ArrayList<Entry> yVals1=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float mult=range / 2f;
    float val=(float)(Math.random() * mult) + 50;
    yVals1.add(new Entry(val,i));
  }
  LineDataSet set1=new LineDataSet(yVals1,"String_Node_Str");
  set1.setAxisDependency(AxisDependency.LEFT);
  set1.setColor(ColorTemplate.getHoloBlue());
  set1.setCircleColor(ColorTemplate.getHoloBlue());
  set1.setLineWidth(2f);
  set1.setCircleSize(4f);
  set1.setFillAlpha(65);
  set1.setFillColor(ColorTemplate.getHoloBlue());
  set1.setHighLightColor(Color.rgb(244,117,117));
  ArrayList<Entry> yVals2=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float mult=range;
    float val=(float)(Math.random() * mult) + 450;
    yVals2.add(new Entry(val,i));
  }
  LineDataSet set2=new LineDataSet(yVals2,"String_Node_Str");
  set2.setAxisDependency(AxisDependency.RIGHT);
  set2.setColor(Color.RED);
  set2.setCircleColor(Color.RED);
  set2.setLineWidth(2f);
  set2.setCircleSize(4f);
  set2.setFillAlpha(65);
  set2.setFillColor(Color.RED);
  set2.setHighLightColor(Color.rgb(244,117,117));
  ArrayList<LineDataSet> dataSets=new ArrayList<LineDataSet>();
  dataSets.add(set1);
  dataSets.add(set2);
  LineData data=new LineData(xVals,dataSets);
  data.setValueTextColor(Color.WHITE);
  mChart.setData(data);
}

Fixed version (ground truth):
private void setData(int count,float range){
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < count; i++) {
    xVals.add((i) + "String_Node_Str");
  }
  ArrayList<Entry> yVals1=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float mult=range / 2f;
    float val=(float)(Math.random() * mult) + 50;
    yVals1.add(new Entry(val,i));
  }
  LineDataSet set1=new LineDataSet(yVals1,"String_Node_Str");
  set1.setAxisDependency(AxisDependency.LEFT);
  set1.setColor(ColorTemplate.getHoloBlue());
  set1.setCircleColor(ColorTemplate.getHoloBlue());
  set1.setLineWidth(2f);
  set1.setCircleSize(4f);
  set1.setFillAlpha(65);
  set1.setFillColor(ColorTemplate.getHoloBlue());
  set1.setHighLightColor(Color.rgb(244,117,117));
  ArrayList<Entry> yVals2=new ArrayList<Entry>();
  for (int i=0; i < count; i++) {
    float mult=range;
    float val=(float)(Math.random() * mult) + 450;
    yVals2.add(new Entry(val,i));
  }
  LineDataSet set2=new LineDataSet(yVals2,"String_Node_Str");
  set2.setAxisDependency(AxisDependency.RIGHT);
  set2.setColor(Color.RED);
  set2.setCircleColor(Color.RED);
  set2.setLineWidth(2f);
  set2.setCircleSize(4f);
  set2.setFillAlpha(65);
  set2.setFillColor(Color.RED);
  set2.setHighLightColor(Color.rgb(244,117,117));
  ArrayList<LineDataSet> dataSets=new ArrayList<LineDataSet>();
  dataSets.add(set1);
  dataSets.add(set2);
  LineData data=new LineData(xVals,dataSets);
  data.setValueTextColor(Color.WHITE);
  data.setValueTextSize(9f);
  mChart.setData(data);
}
Program: 18647
Project: 18647
Buggy source:
public void setData(){
  float mult=150;
  int cnt=9;
  ArrayList<Entry> yVals1=new ArrayList<Entry>();
  ArrayList<Entry> yVals2=new ArrayList<Entry>();
  for (int i=0; i < cnt; i++) {
    yVals1.add(new Entry((float)(Math.random() * mult) + mult / 2,i));
  }
  for (int i=0; i < cnt; i++) {
    yVals2.add(new Entry((float)(Math.random() * mult) + mult / 2,i));
  }
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < cnt; i++)   xVals.add(mParties[i % mParties.length]);
  RadarDataSet set1=new RadarDataSet(yVals1,"String_Node_Str");
  set1.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);
  set1.setDrawFilled(true);
  set1.setLineWidth(2f);
  RadarDataSet set2=new RadarDataSet(yVals2,"String_Node_Str");
  set2.setColor(ColorTemplate.VORDIPLOM_COLORS[4]);
  set2.setDrawFilled(true);
  set2.setLineWidth(2f);
  ArrayList<RadarDataSet> sets=new ArrayList<RadarDataSet>();
  sets.add(set1);
  sets.add(set2);
  RadarData data=new RadarData(xVals,sets);
  data.setValueTypeface(tf);
  data.setValueTextSize(8f);
  mChart.setData(data);
  mChart.invalidate();
}

Fixed version (ground truth):
public void setData(){
  float mult=150;
  int cnt=9;
  ArrayList<Entry> yVals1=new ArrayList<Entry>();
  ArrayList<Entry> yVals2=new ArrayList<Entry>();
  for (int i=0; i < cnt; i++) {
    yVals1.add(new Entry((float)(Math.random() * mult) + mult / 2,i));
  }
  for (int i=0; i < cnt; i++) {
    yVals2.add(new Entry((float)(Math.random() * mult) + mult / 2,i));
  }
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < cnt; i++)   xVals.add(mParties[i % mParties.length]);
  RadarDataSet set1=new RadarDataSet(yVals1,"String_Node_Str");
  set1.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);
  set1.setDrawFilled(true);
  set1.setLineWidth(2f);
  RadarDataSet set2=new RadarDataSet(yVals2,"String_Node_Str");
  set2.setColor(ColorTemplate.VORDIPLOM_COLORS[4]);
  set2.setDrawFilled(true);
  set2.setLineWidth(2f);
  ArrayList<RadarDataSet> sets=new ArrayList<RadarDataSet>();
  sets.add(set1);
  sets.add(set2);
  RadarData data=new RadarData(xVals,sets);
  data.setValueTypeface(tf);
  data.setValueTextSize(8f);
  data.setDrawValues(false);
  mChart.setData(data);
  mChart.invalidate();
}
Program: 18648
Project: 18648
Buggy source:
/** 
 * Returns the bounding box of the specified Entry in the specified DataSet. Returns null if the Entry could not be found in the charts data.
 * @param e
 * @param dataSetIndex
 * @return
 */
public RectF getBarBounds(BarEntry e){
  BarDataSet set=mData.getDataSetForEntry(e);
  if (set == null)   return null;
  float barspace=set.getBarSpace();
  float y=e.getVal();
  float x=e.getXIndex();
  float spaceHalf=barspace / 2f;
  float left=x - 0.5f + spaceHalf;
  float right=x + 0.5f - spaceHalf;
  float top=y >= 0 ? y : 0;
  float bottom=y <= 0 ? y : 0;
  RectF bounds=new RectF(left,top,right,bottom);
  getTransformer(set.getAxisDependency()).rectValueToPixel(bounds);
  return bounds;
}

Fixed version (ground truth):
/** 
 * Returns the bounding box of the specified Entry in the specified DataSet. Returns null if the Entry could not be found in the charts data.
 * @param e
 * @param dataSetIndex
 * @return
 */
public RectF getBarBounds(BarEntry e){
  BarDataSet set=mData.getDataSetForEntry(e);
  if (set == null)   return null;
  float barspace=set.getBarSpace();
  float y=e.getVal();
  float x=e.getXIndex();
  float barWidth=0.5f;
  float spaceHalf=barspace / 2f;
  float left=x - barWidth + spaceHalf;
  float right=x + barWidth - spaceHalf;
  float top=y >= 0 ? y : 0;
  float bottom=y <= 0 ? y : 0;
  RectF bounds=new RectF(left,top,right,bottom);
  getTransformer(set.getAxisDependency()).rectValueToPixel(bounds);
  return bounds;
}
Program: 18649
Project: 18649
Buggy source:
/** 
 * Returns the position (in pixels) the provided Entry has inside the chart view or null, if the provided Entry is null.
 * @param e
 * @return
 */
public PointF getPosition(Entry e,AxisDependency axis){
  if (e == null)   return null;
  float[] vals=new float[]{e.getXIndex(),e.getVal()};
  if (this instanceof BarChart) {
    BarDataSet set=(BarDataSet)mData.getDataSetForEntry(e);
    if (set != null)     vals[0]+=set.getBarSpace() / 2f;
  }
  getTransformer(axis).pointValuesToPixel(vals);
  return new PointF(vals[0],vals[1]);
}

Fixed version (ground truth):
/** 
 * Returns the position (in pixels) the provided Entry has inside the chart view or null, if the provided Entry is null.
 * @param e
 * @return
 */
public PointF getPosition(Entry e,AxisDependency axis){
  if (e == null)   return null;
  float[] vals=new float[]{e.getXIndex(),e.getVal()};
  getTransformer(axis).pointValuesToPixel(vals);
  return new PointF(vals[0],vals[1]);
}
Program: 18650
Project: 18650
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_barchart);
  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=(BarChart)findViewById(R.id.chart1);
  mChart.setDescription("String_Node_Str");
  mChart.setMaxVisibleValueCount(60);
  mChart.setPinchZoom(false);
  mChart.setDrawBarShadow(false);
  mChart.setDrawGridBackground(false);
  XAxis xAxis=mChart.getXAxis();
  xAxis.setPosition(XAxisPosition.BOTTOM);
  xAxis.setCenterXLabelText(true);
  xAxis.setSpaceBetweenLabels(0);
  xAxis.setDrawGridLines(false);
  mChart.getAxisLeft().setDrawGridLines(false);
  mChart.setDrawLegend(false);
  mSeekBarX.setProgress(10);
  mSeekBarY.setProgress(100);
  mChart.animateY(2500);
}

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_barchart);
  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=(BarChart)findViewById(R.id.chart1);
  mChart.setDescription("String_Node_Str");
  mChart.setMaxVisibleValueCount(60);
  mChart.setPinchZoom(false);
  mChart.setDrawBarShadow(false);
  mChart.setDrawGridBackground(false);
  XAxis xAxis=mChart.getXAxis();
  xAxis.setPosition(XAxisPosition.BOTTOM);
  xAxis.setSpaceBetweenLabels(0);
  xAxis.setDrawGridLines(false);
  mChart.getAxisLeft().setDrawGridLines(false);
  mChart.setDrawLegend(false);
  mSeekBarX.setProgress(10);
  mSeekBarY.setProgress(100);
  mChart.animateY(2500);
}
Program: 18651
Project: 18651
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_barchart);
  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=(BarChart)findViewById(R.id.chart1);
  mChart.setOnChartValueSelectedListener(this);
  mChart.setDescription("String_Node_Str");
  mChart.setPinchZoom(false);
  mChart.setValueFormatter(new LargeValueFormatter());
  mChart.setDrawBarShadow(false);
  mChart.setDrawGridBackground(false);
  MyMarkerView mv=new MyMarkerView(this,R.layout.custom_marker_view);
  mChart.setMarkerView(mv);
  mSeekBarX.setProgress(10);
  mSeekBarY.setProgress(100);
  Typeface tf=Typeface.createFromAsset(getAssets(),"String_Node_Str");
  Legend l=mChart.getLegend();
  l.setPosition(LegendPosition.RIGHT_OF_CHART_INSIDE);
  l.setTypeface(tf);
  XAxis xl=mChart.getXAxis();
  xl.setCenterXLabelText(true);
  xl.setTypeface(tf);
  YAxis leftAxis=mChart.getAxisLeft();
  leftAxis.setTypeface(tf);
  leftAxis.setFormatter(new LargeValueFormatter());
  leftAxis.setDrawGridLines(false);
  leftAxis.setSpaceTop(25f);
  mChart.getAxisRight().setEnabled(false);
  mChart.setValueTypeface(tf);
}

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_barchart);
  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=(BarChart)findViewById(R.id.chart1);
  mChart.setOnChartValueSelectedListener(this);
  mChart.setDescription("String_Node_Str");
  mChart.setPinchZoom(false);
  mChart.setValueFormatter(new LargeValueFormatter());
  mChart.setDrawBarShadow(false);
  mChart.setDrawGridBackground(false);
  MyMarkerView mv=new MyMarkerView(this,R.layout.custom_marker_view);
  mChart.setMarkerView(mv);
  mSeekBarX.setProgress(10);
  mSeekBarY.setProgress(100);
  Typeface tf=Typeface.createFromAsset(getAssets(),"String_Node_Str");
  Legend l=mChart.getLegend();
  l.setPosition(LegendPosition.RIGHT_OF_CHART_INSIDE);
  l.setTypeface(tf);
  XAxis xl=mChart.getXAxis();
  xl.setTypeface(tf);
  YAxis leftAxis=mChart.getAxisLeft();
  leftAxis.setTypeface(tf);
  leftAxis.setFormatter(new LargeValueFormatter());
  leftAxis.setDrawGridLines(false);
  leftAxis.setSpaceTop(25f);
  mChart.getAxisRight().setEnabled(false);
  mChart.setValueTypeface(tf);
}
Program: 18652
Project: 18652
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  BarData c=getItem(position);
  ViewHolder holder=null;
  if (convertView == null) {
    holder=new ViewHolder();
    convertView=LayoutInflater.from(getContext()).inflate(R.layout.list_item_barchart,null);
    holder.chart=(BarChart)convertView.findViewById(R.id.chart);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolder)convertView.getTag();
  }
  holder.chart.setValueTypeface(mTf);
  holder.chart.setDescription("String_Node_Str");
  holder.chart.setDrawGridBackground(false);
  holder.chart.setValueTextColor(Color.WHITE);
  XAxis xAxis=holder.chart.getXAxis();
  xAxis.setCenterXLabelText(true);
  xAxis.setPosition(XAxisPosition.BOTTOM);
  xAxis.setTypeface(mTf);
  xAxis.setDrawGridLines(false);
  YAxis leftAxis=holder.chart.getAxisLeft();
  leftAxis.setTypeface(mTf);
  leftAxis.setLabelCount(5);
  leftAxis.setSpaceTop(15f);
  YAxis rightAxis=holder.chart.getAxisRight();
  rightAxis.setTypeface(mTf);
  rightAxis.setLabelCount(5);
  rightAxis.setSpaceTop(15f);
  holder.chart.setData(c);
  holder.chart.animateY(700);
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  BarData c=getItem(position);
  ViewHolder holder=null;
  if (convertView == null) {
    holder=new ViewHolder();
    convertView=LayoutInflater.from(getContext()).inflate(R.layout.list_item_barchart,null);
    holder.chart=(BarChart)convertView.findViewById(R.id.chart);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolder)convertView.getTag();
  }
  holder.chart.setValueTypeface(mTf);
  holder.chart.setDescription("String_Node_Str");
  holder.chart.setDrawGridBackground(false);
  holder.chart.setValueTextColor(Color.WHITE);
  XAxis xAxis=holder.chart.getXAxis();
  xAxis.setPosition(XAxisPosition.BOTTOM);
  xAxis.setTypeface(mTf);
  xAxis.setDrawGridLines(false);
  YAxis leftAxis=holder.chart.getAxisLeft();
  leftAxis.setTypeface(mTf);
  leftAxis.setLabelCount(5);
  leftAxis.setSpaceTop(15f);
  YAxis rightAxis=holder.chart.getAxisRight();
  rightAxis.setTypeface(mTf);
  rightAxis.setLabelCount(5);
  rightAxis.setSpaceTop(15f);
  holder.chart.setData(c);
  holder.chart.animateY(700);
  return convertView;
}
Program: 18653
Project: 18653
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_barchart);
  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=(BarChart)findViewById(R.id.chart1);
  mChart.setOnChartValueSelectedListener(this);
  mChart.setDescription("String_Node_Str");
  mChart.setMaxVisibleValueCount(60);
  MyValueFormatter customFormatter=new MyValueFormatter();
  mChart.setValueFormatter(customFormatter);
  mChart.setDrawValuesForWholeStack(true);
  mChart.setPinchZoom(false);
  mChart.setDrawBarShadow(false);
  YAxis yLabels=mChart.getAxisLeft();
  yLabels.setLabelCount(5);
  yLabels.setFormatter(customFormatter);
  XAxis xLabels=mChart.getXAxis();
  xLabels.setPosition(XAxisPosition.TOP);
  xLabels.setCenterXLabelText(true);
  mSeekBarX.setProgress(12);
  mSeekBarY.setProgress(100);
  Legend l=mChart.getLegend();
  l.setPosition(LegendPosition.BELOW_CHART_RIGHT);
  l.setFormSize(8f);
  l.setFormToTextSpace(4f);
  l.setXEntrySpace(6f);
}

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_barchart);
  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=(BarChart)findViewById(R.id.chart1);
  mChart.setOnChartValueSelectedListener(this);
  mChart.setDescription("String_Node_Str");
  mChart.setMaxVisibleValueCount(60);
  MyValueFormatter customFormatter=new MyValueFormatter();
  mChart.setValueFormatter(customFormatter);
  mChart.setDrawValuesForWholeStack(true);
  mChart.setPinchZoom(false);
  mChart.setDrawBarShadow(false);
  YAxis yLabels=mChart.getAxisLeft();
  yLabels.setLabelCount(5);
  yLabels.setFormatter(customFormatter);
  XAxis xLabels=mChart.getXAxis();
  xLabels.setPosition(XAxisPosition.TOP);
  mSeekBarX.setProgress(12);
  mSeekBarY.setProgress(100);
  Legend l=mChart.getLegend();
  l.setPosition(LegendPosition.BELOW_CHART_RIGHT);
  l.setFormSize(8f);
  l.setFormToTextSpace(4f);
  l.setXEntrySpace(6f);
}
Program: 18654
Project: 18654
Buggy source:
@Override public View getView(int position,View convertView,Context c){
  ViewHolder holder=null;
  if (convertView == null) {
    holder=new ViewHolder();
    convertView=LayoutInflater.from(c).inflate(R.layout.list_item_barchart,null);
    holder.chart=(BarChart)convertView.findViewById(R.id.chart);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolder)convertView.getTag();
  }
  holder.chart.setValueTypeface(mTf);
  holder.chart.setDescription("String_Node_Str");
  holder.chart.setDrawGridBackground(false);
  holder.chart.setDrawBarShadow(false);
  XAxis xAxis=holder.chart.getXAxis();
  xAxis.setCenterXLabelText(true);
  xAxis.setPosition(XAxisPosition.BOTTOM);
  xAxis.setTypeface(mTf);
  xAxis.setDrawGridLines(false);
  YAxis leftAxis=holder.chart.getAxisLeft();
  leftAxis.setTypeface(mTf);
  leftAxis.setLabelCount(5);
  leftAxis.setSpaceTop(20f);
  YAxis rightAxis=holder.chart.getAxisRight();
  rightAxis.setTypeface(mTf);
  rightAxis.setLabelCount(5);
  rightAxis.setSpaceTop(20f);
  holder.chart.setData((BarData)mChartData);
  holder.chart.animateY(700);
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,Context c){
  ViewHolder holder=null;
  if (convertView == null) {
    holder=new ViewHolder();
    convertView=LayoutInflater.from(c).inflate(R.layout.list_item_barchart,null);
    holder.chart=(BarChart)convertView.findViewById(R.id.chart);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolder)convertView.getTag();
  }
  holder.chart.setValueTypeface(mTf);
  holder.chart.setDescription("String_Node_Str");
  holder.chart.setDrawGridBackground(false);
  holder.chart.setDrawBarShadow(false);
  XAxis xAxis=holder.chart.getXAxis();
  xAxis.setPosition(XAxisPosition.BOTTOM);
  xAxis.setTypeface(mTf);
  xAxis.setDrawGridLines(false);
  YAxis leftAxis=holder.chart.getAxisLeft();
  leftAxis.setTypeface(mTf);
  leftAxis.setLabelCount(5);
  leftAxis.setSpaceTop(20f);
  YAxis rightAxis=holder.chart.getAxisRight();
  rightAxis.setTypeface(mTf);
  rightAxis.setLabelCount(5);
  rightAxis.setSpaceTop(20f);
  holder.chart.setData((BarData)mChartData);
  holder.chart.animateY(700);
  return convertView;
}
Program: 18655
Project: 18655
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};
  for (int i=0; i < mXAxis.getValues().size(); i+=mXAxis.mAxisLabelModulus) {
    position[0]=i;
    if (mXAxis.isCenterXLabelsEnabled())     position[0]+=0.5f;
    mTrans.pointValuesToPixel(position);
    if (mViewPortHandler.isInBoundsX(position[0])) {
      String label=mXAxis.getValues().get(i);
      if (mXAxis.isAvoidFirstLastClippingEnabled()) {
        if (i == mXAxis.getValues().size() - 1 && mXAxis.getValues().size() > 1) {
          float width=Utils.calcTextWidth(mAxisPaint,label);
          if (width > mViewPortHandler.offsetRight() * 2 && position[0] + width > mViewPortHandler.getChartWidth())           position[0]-=width / 2;
        }
 else         if (i == 0) {
          float width=Utils.calcTextWidth(mAxisPaint,label);
          position[0]+=width / 2;
        }
      }
      c.drawText(label,position[0],pos,mAxisPaint);
    }
  }
}

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

Fixed version (ground truth):
/** 
 * draws the x-labels on the specified y-position
 * @param pos
 */
@Override protected void drawLabels(Canvas c,float pos){
  float[] position=new float[]{0f,0f};
  BarData bd=mChart.getData();
  int step=bd.getDataSetCount();
  for (int i=0; i < mXAxis.getValues().size(); i+=mXAxis.mAxisLabelModulus) {
    position[0]=i * step + i * bd.getGroupSpace() + bd.getGroupSpace() / 2f;
    if (step > 1) {
      position[0]+=((float)step - 1f) / 2f;
    }
    mTrans.pointValuesToPixel(position);
    if (mViewPortHandler.isInBoundsX(position[0])) {
      String label=mXAxis.getValues().get(i);
      if (mXAxis.isAvoidFirstLastClippingEnabled()) {
        if (i == mXAxis.getValues().size() - 1) {
          float width=Utils.calcTextWidth(mAxisPaint,label);
          if (width > mViewPortHandler.offsetRight() * 2 && position[0] + width > mViewPortHandler.getChartWidth())           position[0]-=width / 2;
        }
 else         if (i == 0) {
          float width=Utils.calcTextWidth(mAxisPaint,label);
          position[0]+=width / 2;
        }
      }
      c.drawText(label,position[0],pos,mAxisPaint);
    }
  }
}
Program: 18658
Project: 18658
Buggy source:
@Override public void notifyDataSetChanged(){
  super.notifyDataSetChanged();
  mYAxisRenderer.computeAxis(0f,mData.getYMax());
  mXAxisRenderer.computeAxis(mData.getXValAverageLength(),mData.getXVals());
}

Fixed version (ground truth):
@Override public void notifyDataSetChanged(){
  super.notifyDataSetChanged();
  if (mData != null) {
    mYAxisRenderer.computeAxis(0f,mData.getYMax());
    mXAxisRenderer.computeAxis(mData.getXValAverageLength(),mData.getXVals());
  }
}
Program: 18659
Project: 18659
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_barchart);
  tvX=(TextView)findViewById(R.id.tvXMax);
  tvY=(TextView)findViewById(R.id.tvYMax);
  mSeekBarX=(SeekBar)findViewById(R.id.seekBar1);
  mSeekBarY=(SeekBar)findViewById(R.id.seekBar2);
  mChart=(BarChart)findViewById(R.id.chart1);
  mChart.setOnChartValueSelectedListener(this);
  mChart.setDrawValueAboveBar(true);
  mChart.setDescription("String_Node_Str");
  mChart.setMaxVisibleValueCount(60);
  mChart.setPinchZoom(false);
  mChart.setDrawGridBackground(false);
  mChart.setValueTextSize(10f);
  mChart.setDrawBorder(false);
  Typeface tf=Typeface.createFromAsset(getAssets(),"String_Node_Str");
  XAxis xl=mChart.getXAxis();
  xl.setPosition(XLabelPosition.BOTTOM);
  xl.setCenterXLabelText(true);
  xl.setTypeface(tf);
  xl.setDrawGridLines(false);
  YAxis yl=mChart.getAxisLeft();
  yl.setTypeface(tf);
  yl.setLabelCount(8);
  mChart.getAxisRight().setDrawGridLines(false);
  mChart.setValueTypeface(tf);
  setData(12,50);
  mSeekBarY.setProgress(50);
  mSeekBarX.setProgress(12);
  mSeekBarY.setOnSeekBarChangeListener(this);
  mSeekBarX.setOnSeekBarChangeListener(this);
  Legend l=mChart.getLegend();
  l.setPosition(LegendPosition.BELOW_CHART_LEFT);
  l.setFormSize(8f);
  l.setXEntrySpace(4f);
}

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_barchart);
  tvX=(TextView)findViewById(R.id.tvXMax);
  tvY=(TextView)findViewById(R.id.tvYMax);
  mSeekBarX=(SeekBar)findViewById(R.id.seekBar1);
  mSeekBarY=(SeekBar)findViewById(R.id.seekBar2);
  mChart=(BarChart)findViewById(R.id.chart1);
  mChart.setOnChartValueSelectedListener(this);
  mChart.setDrawValueAboveBar(true);
  mChart.setDescription("String_Node_Str");
  mChart.setMaxVisibleValueCount(60);
  mChart.setPinchZoom(false);
  mChart.setDrawGridBackground(false);
  mChart.setValueTextSize(10f);
  mChart.setDrawBorder(false);
  Typeface tf=Typeface.createFromAsset(getAssets(),"String_Node_Str");
  XAxis xl=mChart.getXAxis();
  xl.setPosition(XLabelPosition.BOTTOM);
  xl.setCenterXLabelText(true);
  xl.setTypeface(tf);
  xl.setDrawGridLines(false);
  YAxis leftAxis=mChart.getAxisLeft();
  leftAxis.setTypeface(tf);
  leftAxis.setLabelCount(8);
  YAxis rightAxis=mChart.getAxisRight();
  rightAxis.setDrawGridLines(false);
  rightAxis.setTypeface(tf);
  rightAxis.setLabelCount(8);
  mChart.setValueFormatter(new MyValueFormatter());
  mChart.setValueTypeface(tf);
  setData(12,50);
  mSeekBarY.setProgress(50);
  mSeekBarX.setProgress(12);
  mSeekBarY.setOnSeekBarChangeListener(this);
  mSeekBarX.setOnSeekBarChangeListener(this);
  Legend l=mChart.getLegend();
  l.setPosition(LegendPosition.BELOW_CHART_LEFT);
  l.setFormSize(8f);
  l.setXEntrySpace(4f);
}
Program: 18660
Project: 18660
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  BarData c=getItem(position);
  ViewHolder holder=null;
  if (convertView == null) {
    holder=new ViewHolder();
    convertView=LayoutInflater.from(getContext()).inflate(R.layout.list_item_barchart,null);
    holder.chart=(BarChart)convertView.findViewById(R.id.chart);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolder)convertView.getTag();
  }
  holder.chart.setValueTypeface(mTf);
  holder.chart.setDescription("String_Node_Str");
  holder.chart.setDrawGridBackground(false);
  holder.chart.setValueTextColor(Color.WHITE);
  XAxis xl=holder.chart.getXAxis();
  xl.setCenterXLabelText(true);
  xl.setPosition(XLabelPosition.BOTTOM);
  xl.setTypeface(mTf);
  xl.setDrawGridLines(false);
  YAxis yl=holder.chart.getAxisLeft();
  yl.setTypeface(mTf);
  yl.setLabelCount(5);
  holder.chart.setData(c);
  holder.chart.animateY(700);
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  BarData c=getItem(position);
  ViewHolder holder=null;
  if (convertView == null) {
    holder=new ViewHolder();
    convertView=LayoutInflater.from(getContext()).inflate(R.layout.list_item_barchart,null);
    holder.chart=(BarChart)convertView.findViewById(R.id.chart);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolder)convertView.getTag();
  }
  holder.chart.setValueTypeface(mTf);
  holder.chart.setDescription("String_Node_Str");
  holder.chart.setDrawGridBackground(false);
  holder.chart.setValueTextColor(Color.WHITE);
  XAxis xAxis=holder.chart.getXAxis();
  xAxis.setCenterXLabelText(true);
  xAxis.setPosition(XLabelPosition.BOTTOM);
  xAxis.setTypeface(mTf);
  xAxis.setDrawGridLines(false);
  YAxis leftAxis=holder.chart.getAxisLeft();
  leftAxis.setTypeface(mTf);
  leftAxis.setLabelCount(5);
  leftAxis.setSpaceTop(15f);
  YAxis rightAxis=holder.chart.getAxisRight();
  rightAxis.setTypeface(mTf);
  rightAxis.setLabelCount(5);
  rightAxis.setSpaceTop(15f);
  holder.chart.setData(c);
  holder.chart.animateY(700);
  return convertView;
}
Program: 18661
Project: 18661
Buggy source:
/** 
 * generates a random ChartData object with just one DataSet
 * @return
 */
private LineData generateDataLine(int cnt){
  ArrayList<Entry> e1=new ArrayList<Entry>();
  for (int i=0; i < 12; i++) {
    e1.add(new Entry((int)(Math.random() * 65) + 40,i));
  }
  LineDataSet d1=new LineDataSet(e1,"String_Node_Str" + cnt + "String_Node_Str");
  d1.setLineWidth(3f);
  d1.setCircleSize(5f);
  d1.setHighLightColor(Color.rgb(244,117,117));
  ArrayList<Entry> e2=new ArrayList<Entry>();
  for (int i=0; i < 12; i++) {
    e2.add(new Entry(e1.get(i).getVal() - 30,i));
  }
  LineDataSet d2=new LineDataSet(e2,"String_Node_Str" + cnt + "String_Node_Str");
  d2.setLineWidth(3f);
  d2.setCircleSize(5f);
  d2.setHighLightColor(Color.rgb(244,117,117));
  d2.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);
  d2.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[0]);
  ArrayList<LineDataSet> sets=new ArrayList<LineDataSet>();
  sets.add(d1);
  sets.add(d2);
  LineData cd=new LineData(getMonths(),sets);
  return cd;
}

Fixed version (ground truth):
/** 
 * generates a random ChartData object with just one DataSet
 * @return
 */
private LineData generateDataLine(int cnt){
  ArrayList<Entry> e1=new ArrayList<Entry>();
  for (int i=0; i < 12; i++) {
    e1.add(new Entry((int)(Math.random() * 65) + 40,i));
  }
  LineDataSet d1=new LineDataSet(e1,"String_Node_Str" + cnt + "String_Node_Str");
  d1.setLineWidth(3f);
  d1.setCircleSize(5f);
  d1.setHighLightColor(Color.rgb(244,117,117));
  d1.setDrawValues(false);
  ArrayList<Entry> e2=new ArrayList<Entry>();
  for (int i=0; i < 12; i++) {
    e2.add(new Entry(e1.get(i).getVal() - 30,i));
  }
  LineDataSet d2=new LineDataSet(e2,"String_Node_Str" + cnt + "String_Node_Str");
  d2.setLineWidth(3f);
  d2.setCircleSize(5f);
  d2.setHighLightColor(Color.rgb(244,117,117));
  d2.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);
  d2.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[0]);
  d2.setDrawValues(false);
  ArrayList<LineDataSet> sets=new ArrayList<LineDataSet>();
  sets.add(d1);
  sets.add(d2);
  LineData cd=new LineData(getMonths(),sets);
  return cd;
}
Program: 18662
Project: 18662
Buggy source:
@Override public View getView(int position,View convertView,Context c){
  ViewHolder holder=null;
  if (convertView == null) {
    holder=new ViewHolder();
    convertView=LayoutInflater.from(c).inflate(R.layout.list_item_barchart,null);
    holder.chart=(BarChart)convertView.findViewById(R.id.chart);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolder)convertView.getTag();
  }
  holder.chart.setValueTypeface(mTf);
  holder.chart.setDescription("String_Node_Str");
  holder.chart.setDrawGridBackground(false);
  holder.chart.setDrawBarShadow(false);
  XAxis xl=holder.chart.getXAxis();
  xl.setCenterXLabelText(true);
  xl.setPosition(XLabelPosition.BOTTOM);
  xl.setTypeface(mTf);
  xl.setDrawGridLines(false);
  YAxis yl=holder.chart.getAxisLeft();
  yl.setTypeface(mTf);
  yl.setLabelCount(5);
  holder.chart.setData((BarData)mChartData);
  holder.chart.animateY(700);
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,Context c){
  ViewHolder holder=null;
  if (convertView == null) {
    holder=new ViewHolder();
    convertView=LayoutInflater.from(c).inflate(R.layout.list_item_barchart,null);
    holder.chart=(BarChart)convertView.findViewById(R.id.chart);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolder)convertView.getTag();
  }
  holder.chart.setValueTypeface(mTf);
  holder.chart.setDescription("String_Node_Str");
  holder.chart.setDrawGridBackground(false);
  holder.chart.setDrawBarShadow(false);
  XAxis xAxis=holder.chart.getXAxis();
  xAxis.setCenterXLabelText(true);
  xAxis.setPosition(XLabelPosition.BOTTOM);
  xAxis.setTypeface(mTf);
  xAxis.setDrawGridLines(false);
  YAxis leftAxis=holder.chart.getAxisLeft();
  leftAxis.setTypeface(mTf);
  leftAxis.setLabelCount(5);
  leftAxis.setSpaceTop(20f);
  YAxis rightAxis=holder.chart.getAxisRight();
  rightAxis.setTypeface(mTf);
  rightAxis.setLabelCount(5);
  rightAxis.setSpaceTop(20f);
  holder.chart.setData((BarData)mChartData);
  holder.chart.animateY(700);
  return convertView;
}
Program: 18663
Project: 18663
Buggy source:
@Override public View getView(int position,View convertView,Context c){
  ViewHolder holder=null;
  if (convertView == null) {
    holder=new ViewHolder();
    convertView=LayoutInflater.from(c).inflate(R.layout.list_item_linechart,null);
    holder.chart=(LineChart)convertView.findViewById(R.id.chart);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolder)convertView.getTag();
  }
  holder.chart.setDescription("String_Node_Str");
  holder.chart.setDrawGridBackground(false);
  XAxis xl=holder.chart.getXAxis();
  xl.setCenterXLabelText(true);
  xl.setPosition(XLabelPosition.BOTTOM);
  xl.setTypeface(mTf);
  xl.setDrawGridLines(false);
  YAxis yl=holder.chart.getAxisLeft();
  yl.setTypeface(mTf);
  yl.setLabelCount(5);
  holder.chart.setData((LineData)mChartData);
  holder.chart.animateX(1000);
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,Context c){
  ViewHolder holder=null;
  if (convertView == null) {
    holder=new ViewHolder();
    convertView=LayoutInflater.from(c).inflate(R.layout.list_item_linechart,null);
    holder.chart=(LineChart)convertView.findViewById(R.id.chart);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolder)convertView.getTag();
  }
  holder.chart.setDescription("String_Node_Str");
  holder.chart.setDrawGridBackground(false);
  XAxis xl=holder.chart.getXAxis();
  xl.setCenterXLabelText(true);
  xl.setPosition(XLabelPosition.BOTTOM);
  xl.setTypeface(mTf);
  xl.setDrawGridLines(false);
  YAxis leftAxis=holder.chart.getAxisLeft();
  leftAxis.setTypeface(mTf);
  leftAxis.setLabelCount(5);
  YAxis rightAxis=holder.chart.getAxisRight();
  rightAxis.setTypeface(mTf);
  rightAxis.setLabelCount(5);
  rightAxis.setDrawGridLines(false);
  holder.chart.setData((LineData)mChartData);
  holder.chart.animateX(1000);
  return convertView;
}
Program: 18664
Project: 18664
Buggy source:
@Override public View getView(int position,View convertView,Context c){
  ViewHolder holder=null;
  if (convertView == null) {
    holder=new ViewHolder();
    convertView=LayoutInflater.from(c).inflate(R.layout.list_item_piechart,null);
    holder.chart=(PieChart)convertView.findViewById(R.id.chart);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolder)convertView.getTag();
  }
  holder.chart.setValueTypeface(mTf);
  holder.chart.setDescription("String_Node_Str");
  holder.chart.setHoleRadius(60f);
  holder.chart.setTransparentCircleRadius(65f);
  holder.chart.setCenterText("String_Node_Str");
  holder.chart.setCenterTextTypeface(mTf);
  holder.chart.setCenterTextSize(18f);
  holder.chart.setData((PieData)mChartData);
  Legend l=holder.chart.getLegend();
  l.setPosition(LegendPosition.RIGHT_OF_CHART);
  holder.chart.animateXY(900,900);
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,Context c){
  ViewHolder holder=null;
  if (convertView == null) {
    holder=new ViewHolder();
    convertView=LayoutInflater.from(c).inflate(R.layout.list_item_piechart,null);
    holder.chart=(PieChart)convertView.findViewById(R.id.chart);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolder)convertView.getTag();
  }
  holder.chart.setValueTypeface(mTf);
  holder.chart.setDescription("String_Node_Str");
  holder.chart.setHoleRadius(52f);
  holder.chart.setTransparentCircleRadius(57f);
  holder.chart.setCenterText("String_Node_Str");
  holder.chart.setCenterTextTypeface(mTf);
  holder.chart.setCenterTextSize(18f);
  holder.chart.setValueTextSize(11f);
  holder.chart.setValueFormatter(new PercentFormatter(holder.chart));
  holder.chart.setData((PieData)mChartData);
  Legend l=holder.chart.getLegend();
  l.setPosition(LegendPosition.RIGHT_OF_CHART);
  holder.chart.animateXY(900,900);
  return convertView;
}
Program: 18665
Project: 18665
Buggy source:
@Override public void notifyDataSetChanged(){
  prepare();
  mRightAxisTransformer.prepareMatrixValuePx(mViewPortHandler,mDeltaX,mDeltaYRight,mAxisRight.mAxisMinimum);
  mLeftAxisTransformer.prepareMatrixValuePx(mViewPortHandler,mDeltaX,mDeltaYLeft,mAxisLeft.mAxisMinimum);
}

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

Fixed version (ground truth):
@Override protected void calcMinMax(boolean fixedValues){
  float minLeft=mData.getYMin(AxisDependency.LEFT);
  float maxLeft=mData.getYMax(AxisDependency.LEFT);
  float minRight=mData.getYMin(AxisDependency.RIGHT);
  float maxRight=mData.getYMax(AxisDependency.RIGHT);
  mDeltaX=mData.getXVals().size() - 1;
  mDeltaYLeft=Math.abs(maxLeft - minLeft);
  mDeltaYRight=Math.abs(maxRight - minRight);
  mAxisLeft.mAxisMaximum=maxLeft;
  mAxisRight.mAxisMaximum=maxRight;
  mAxisLeft.mAxisMinimum=minLeft;
  mAxisRight.mAxisMinimum=minRight;
}
Program: 18668
Project: 18668
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);
    mDrawCanvas=new Canvas(mDrawBitmap);
    mViewPortHandler.setChartDimens(w,h);
    if (mLogEnabled)     Log.i(LOG_TAG,"String_Node_Str" + w + "String_Node_Str"+ h);
  }
  prepare();
  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);
    mDrawCanvas=new Canvas(mDrawBitmap);
    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);
}
Program: 18669
Project: 18669
Buggy source:
/** 
 * Sets a new data object for the chart. The data object contains all values and information needed for displaying.
 * @param data
 */
public void setData(T data){
  if (data == null) {
    Log.e(LOG_TAG,"String_Node_Str");
    return;
  }
  mDataNotSet=false;
  mOffsetsCalculated=false;
  mData=data;
  mData=data;
  prepare();
  calcFormats(data.getYMin(),data.getYMax());
  Log.i(LOG_TAG,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Sets a new data object for the chart. The data object contains all values and information needed for displaying.
 * @param data
 */
public void setData(T data){
  if (data == null) {
    Log.e(LOG_TAG,"String_Node_Str");
    return;
  }
  mDataNotSet=false;
  mOffsetsCalculated=false;
  mData=data;
  mData=data;
  notifyDataSetChanged();
  calcFormats(data.getYMin(),data.getYMax());
  Log.i(LOG_TAG,"String_Node_Str");
}
Program: 18670
Project: 18670
Buggy source:
@Override public void notifyDataSetChanged(){
  prepare();
}

Fixed version (ground truth):
@Override public void notifyDataSetChanged(){
  if (mDataNotSet)   return;
  calcMinMax(false);
  prepareLegend();
  calculateOffsets();
}