nus-yam/ex-repair huggingface dataset:
Program: 18715
Project: 18715
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.frag_simple_scatter,container,false);
  mChart=(ScatterChart)v.findViewById(R.id.scatterChart1);
  mChart.setDescription("String_Node_Str");
  Typeface tf=Typeface.createFromAsset(getActivity().getAssets(),"String_Node_Str");
  YAxis labels=mChart.getAxisLeft();
  labels.setTypeface(tf);
  MyMarkerView mv=new MyMarkerView(getActivity(),R.layout.custom_marker_view);
  mChart.setMarkerView(mv);
  mChart.setHighlightIndicatorEnabled(false);
  mChart.setDrawBorder(false);
  mChart.setDrawGridBackground(false);
  mChart.setDrawXLabels(false);
  mChart.setData(generateScatterData(3,10000,150));
  XAxis xAxis=mChart.getXAxis();
  xAxis.setDrawGridLines(false);
  Legend l=mChart.getLegend();
  l.setTypeface(tf);
  return v;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.frag_simple_scatter,container,false);
  mChart=(ScatterChart)v.findViewById(R.id.scatterChart1);
  mChart.setDescription("String_Node_Str");
  Typeface tf=Typeface.createFromAsset(getActivity().getAssets(),"String_Node_Str");
  MyMarkerView mv=new MyMarkerView(getActivity(),R.layout.custom_marker_view);
  mChart.setMarkerView(mv);
  mChart.setHighlightIndicatorEnabled(false);
  mChart.setDrawBorder(false);
  mChart.setDrawGridBackground(false);
  mChart.setData(generateScatterData(3,10000,150));
  XAxis xAxis=mChart.getXAxis();
  xAxis.setEnabled(false);
  YAxis leftAxis=mChart.getAxisLeft();
  leftAxis.setTypeface(tf);
  YAxis rightAxis=mChart.getAxisRight();
  rightAxis.setTypeface(tf);
  rightAxis.setDrawGridLines(false);
  Legend l=mChart.getLegend();
  l.setTypeface(tf);
  return v;
}
Program: 18716
Project: 18716
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.frag_simple_line,container,false);
  mChart=(LineChart)v.findViewById(R.id.lineChart1);
  mChart.setDescription("String_Node_Str");
  mChart.setHighlightIndicatorEnabled(false);
  mChart.setDrawBorder(false);
  mChart.setDrawGridBackground(false);
  mChart.setDrawXLabels(false);
  mChart.setData(generateLineData());
  mChart.animateX(3000);
  Typeface tf=Typeface.createFromAsset(getActivity().getAssets(),"String_Node_Str");
  Legend l=mChart.getLegend();
  l.setTypeface(tf);
  YAxis labels=mChart.getAxisLeft();
  labels.setTypeface(tf);
  XAxis xAxis=mChart.getXAxis();
  xAxis.setDrawGridLines(false);
  return v;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.frag_simple_line,container,false);
  mChart=(LineChart)v.findViewById(R.id.lineChart1);
  mChart.setDescription("String_Node_Str");
  mChart.setHighlightIndicatorEnabled(false);
  mChart.setDrawBorder(false);
  mChart.setDrawGridBackground(false);
  mChart.setData(generateLineData());
  mChart.animateX(3000);
  Typeface tf=Typeface.createFromAsset(getActivity().getAssets(),"String_Node_Str");
  Legend l=mChart.getLegend();
  l.setTypeface(tf);
  YAxis leftAxis=mChart.getAxisLeft();
  leftAxis.setTypeface(tf);
  leftAxis.setStartAtZero(false);
  leftAxis.setAxisMaxValue(1.2f);
  leftAxis.setAxisMinValue(-1.2f);
  mChart.getAxisRight().setEnabled(false);
  XAxis xAxis=mChart.getXAxis();
  xAxis.setEnabled(false);
  return v;
}
Program: 18717
Project: 18717
Buggy source:
public BarChartItem(ChartData cd,Context c){
  super(cd);
  mTf=Typeface.createFromAsset(c.getAssets(),"String_Node_Str");
}

Fixed version (ground truth):
public BarChartItem(ChartData<?> cd,Context c){
  super(cd);
  mTf=Typeface.createFromAsset(c.getAssets(),"String_Node_Str");
}
Program: 18718
Project: 18718
Buggy source:
public ChartItem(ChartData cd){
  this.mChartData=cd;
}

Fixed version (ground truth):
public ChartItem(ChartData<?> cd){
  this.mChartData=cd;
}
Program: 18719
Project: 18719
Buggy source:
public LineChartItem(ChartData cd,Context c){
  super(cd);
  mTf=Typeface.createFromAsset(c.getAssets(),"String_Node_Str");
}

Fixed version (ground truth):
public LineChartItem(ChartData<?> cd,Context c){
  super(cd);
  mTf=Typeface.createFromAsset(c.getAssets(),"String_Node_Str");
}
Program: 18720
Project: 18720
Buggy source:
public PieChartItem(ChartData cd,Context c){
  super(cd);
  mTf=Typeface.createFromAsset(c.getAssets(),"String_Node_Str");
}

Fixed version (ground truth):
public PieChartItem(ChartData<?> cd,Context c){
  super(cd);
  mTf=Typeface.createFromAsset(c.getAssets(),"String_Node_Str");
}
Program: 18722
Project: 18722
Buggy source:
@Override protected void init(){
  super.init();
  setDrawXLabels(false);
}

Fixed version (ground truth):
@Override protected void init(){
  super.init();
}
Program: 18724
Project: 18724
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));
  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;
}

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(2.5f);
  d1.setCircleSize(4.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(2.5f);
  d2.setCircleSize(4.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: 18725
Project: 18725
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.actionToggleValues:
{
      for (      DataSet<?> set : mChart.getData().getDataSets())       set.setDrawValues(!set.isDrawValuesEnabled());
      mChart.invalidate();
      break;
    }
case R.id.actionToggleHole:
{
    if (mChart.isDrawHoleEnabled())     mChart.setDrawHoleEnabled(false);
 else     mChart.setDrawHoleEnabled(true);
    mChart.invalidate();
    break;
  }
case R.id.actionDrawCenter:
{
  if (mChart.isDrawCenterTextEnabled())   mChart.setDrawCenterText(false);
 else   mChart.setDrawCenterText(true);
  mChart.invalidate();
  break;
}
case R.id.actionToggleXVals:
{
mChart.setDrawAxisLabels(!mChart.isDrawAxisLabelsEnabled());
mChart.invalidate();
break;
}
case R.id.actionSave:
{
mChart.saveToPath("String_Node_Str" + System.currentTimeMillis(),"String_Node_Str");
break;
}
case R.id.animateX:
{
mChart.animateX(1800);
break;
}
case R.id.animateY:
{
mChart.animateY(1800);
break;
}
case R.id.animateXY:
{
mChart.animateXY(1800,1800);
break;
}
}
return true;
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.actionToggleValues:
{
      for (      DataSet<?> set : mChart.getData().getDataSets())       set.setDrawValues(!set.isDrawValuesEnabled());
      mChart.invalidate();
      break;
    }
case R.id.actionToggleHole:
{
    if (mChart.isDrawHoleEnabled())     mChart.setDrawHoleEnabled(false);
 else     mChart.setDrawHoleEnabled(true);
    mChart.invalidate();
    break;
  }
case R.id.actionDrawCenter:
{
  if (mChart.isDrawCenterTextEnabled())   mChart.setDrawCenterText(false);
 else   mChart.setDrawCenterText(true);
  mChart.invalidate();
  break;
}
case R.id.actionToggleXVals:
{
mChart.setDrawSliceText(!mChart.isDrawSliceTextEnabled());
mChart.invalidate();
break;
}
case R.id.actionSave:
{
mChart.saveToPath("String_Node_Str" + System.currentTimeMillis(),"String_Node_Str");
break;
}
case R.id.animateX:
{
mChart.animateX(1800);
break;
}
case R.id.animateY:
{
mChart.animateY(1800);
break;
}
case R.id.animateXY:
{
mChart.animateXY(1800,1800);
break;
}
}
return true;
}
Program: 18727
Project: 18727
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;
  }
  if (axis == AxisDependency.LEFT)   mLeftAxisTransformer.pointValuesToPixel(vals);
 else   mRightAxisTransformer.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()};
  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]);
}
Program: 18728
Project: 18728
Buggy source:
/** 
 * Highlights the value selected by touch gesture. Unlike highlightValues(...), this generates a callback to the OnChartValueSelectedListener.
 * @param highs
 */
public void highlightTouch(Highlight high){
  if (high == null)   mIndicesToHightlight=null;
 else {
    mIndicesToHightlight=new Highlight[]{high};
  }
  invalidate();
  if (mSelectionListener != null) {
    if (!valuesToHighlight())     mSelectionListener.onNothingSelected();
 else {
      Entry e=getEntryByDataSetIndex(high.getXIndex(),high.getDataSetIndex());
      mSelectionListener.onValueSelected(e,high.getDataSetIndex());
    }
  }
}

Fixed version (ground truth):
/** 
 * Highlights the value selected by touch gesture. Unlike highlightValues(...), this generates a callback to the OnChartValueSelectedListener.
 * @param highs
 */
public void highlightTouch(Highlight high){
  if (high == null)   mIndicesToHightlight=null;
 else {
    mIndicesToHightlight=new Highlight[]{high};
  }
  invalidate();
  if (mSelectionListener != null) {
    if (!valuesToHighlight())     mSelectionListener.onNothingSelected();
 else {
      Entry e=mData.getEntryForHighlight(high);
      mSelectionListener.onValueSelected(e,high.getDataSetIndex());
    }
  }
}
Program: 18729
Project: 18729
Buggy source:
@Override protected void onDraw(Canvas canvas){
  if (mDataNotSet) {
    canvas.drawText(mNoDataText,getWidth() / 2,getHeight() / 2,mInfoPaint);
    if (!TextUtils.isEmpty(mNoDataTextDescription)) {
      float textOffset=-mInfoPaint.ascent() + mInfoPaint.descent();
      canvas.drawText(mNoDataTextDescription,getWidth() / 2,(getHeight() / 2) + textOffset,mInfoPaint);
    }
    return;
  }
  if (!mOffsetsCalculated) {
    calculateOffsets();
    mOffsetsCalculated=true;
  }
  if (mDrawBitmap == null || mDrawCanvas == null) {
    mDrawBitmap=Bitmap.createBitmap(getWidth(),getHeight(),Bitmap.Config.ARGB_4444);
    mDrawCanvas=new Canvas(mDrawBitmap);
  }
  mDrawBitmap.eraseColor(Color.TRANSPARENT);
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  if (mDataNotSet) {
    canvas.drawText(mNoDataText,getWidth() / 2,getHeight() / 2,mInfoPaint);
    if (!TextUtils.isEmpty(mNoDataTextDescription)) {
      float textOffset=-mInfoPaint.ascent() + mInfoPaint.descent();
      canvas.drawText(mNoDataTextDescription,getWidth() / 2,(getHeight() / 2) + textOffset,mInfoPaint);
    }
    return;
  }
  if (!mOffsetsCalculated) {
    calculateOffsets();
    mOffsetsCalculated=true;
  }
  if (mDrawCanvas == null) {
    mDrawCanvas=new Canvas(mDrawBitmap);
  }
  mDrawBitmap.eraseColor(Color.TRANSPARENT);
}
Program: 18730
Project: 18730
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;
  notifyDataSetChanged();
  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;
  notifyDataSetChanged();
  calcFormats(data.getYMin(),data.getYMax());
  Log.i(LOG_TAG,"String_Node_Str");
}
Program: 18731
Project: 18731
Buggy source:
/** 
 * Clears the chart from all data and refreshes it (by calling invalidate()).
 */
public void clear(){
  mData=null;
  mData=null;
  mDataNotSet=true;
  invalidate();
}

Fixed version (ground truth):
/** 
 * Clears the chart from all data and refreshes it (by calling invalidate()).
 */
public void clear(){
  mData=null;
  mDataNotSet=true;
  invalidate();
}
Program: 18732
Project: 18732
Buggy source:
/** 
 * draws all MarkerViews on the highlighted positions
 */
protected void drawMarkers(){
  if (mMarkerView == null || !mDrawMarkerViews || !valuesToHighlight())   return;
  for (int i=0; i < mIndicesToHightlight.length; i++) {
    int xIndex=mIndicesToHightlight[i].getXIndex();
    int dataSetIndex=mIndicesToHightlight[i].getDataSetIndex();
    if (xIndex <= mDeltaX && xIndex <= mDeltaX * mAnimator.getPhaseX()) {
      Entry e=getEntryByDataSetIndex(xIndex,dataSetIndex);
      if (e == null)       continue;
      float[] pos=getMarkerPosition(e,dataSetIndex);
      if (!mViewPortHandler.isInBounds(pos[0],pos[1]))       continue;
      mMarkerView.refreshContent(e,dataSetIndex);
      mMarkerView.measure(MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED),MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED));
      mMarkerView.layout(0,0,mMarkerView.getMeasuredWidth(),mMarkerView.getMeasuredHeight());
      if (pos[1] - mMarkerView.getHeight() <= 0) {
        float y=mMarkerView.getHeight() - pos[1];
        mMarkerView.draw(mDrawCanvas,pos[0],pos[1] + y);
      }
 else {
        mMarkerView.draw(mDrawCanvas,pos[0],pos[1]);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * draws all MarkerViews on the highlighted positions
 */
protected void drawMarkers(){
  if (mMarkerView == null || !mDrawMarkerViews || !valuesToHighlight())   return;
  for (int i=0; i < mIndicesToHightlight.length; i++) {
    int xIndex=mIndicesToHightlight[i].getXIndex();
    int dataSetIndex=mIndicesToHightlight[i].getDataSetIndex();
    if (xIndex <= mDeltaX && xIndex <= mDeltaX * mAnimator.getPhaseX()) {
      Entry e=mData.getEntryForHighlight(mIndicesToHightlight[i]);
      if (e == null)       continue;
      float[] pos=getMarkerPosition(e,dataSetIndex);
      if (!mViewPortHandler.isInBounds(pos[0],pos[1]))       continue;
      mMarkerView.refreshContent(e,dataSetIndex);
      mMarkerView.measure(MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED),MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED));
      mMarkerView.layout(0,0,mMarkerView.getMeasuredWidth(),mMarkerView.getMeasuredHeight());
      if (pos[1] - mMarkerView.getHeight() <= 0) {
        float y=mMarkerView.getHeight() - pos[1];
        mMarkerView.draw(mDrawCanvas,pos[0],pos[1] + y);
      }
 else {
        mMarkerView.draw(mDrawCanvas,pos[0],pos[1]);
      }
    }
  }
}
Program: 18734
Project: 18734
Buggy source:
private void prepareValuePxMatrix(){
  if (mLogEnabled)   Log.i(LOG_TAG,"String_Node_Str" + mDeltaYLeft + "String_Node_Str"+ mDeltaYRight);
  mRightAxisTransformer.prepareMatrixValuePx(mDeltaX,mDeltaYRight,mAxisRight.mAxisMinimum);
  mLeftAxisTransformer.prepareMatrixValuePx(mDeltaX,mDeltaYLeft,mAxisLeft.mAxisMinimum);
}

Fixed version (ground truth):
private void prepareValuePxMatrix(){
  if (mLogEnabled)   Log.i(LOG_TAG,"String_Node_Str" + mAxisLeft.mAxisRange + "String_Node_Str"+ mAxisRight.mAxisRange);
  mRightAxisTransformer.prepareMatrixValuePx(mDeltaX,mAxisRight.mAxisRange,mAxisRight.mAxisMinimum);
  mLeftAxisTransformer.prepareMatrixValuePx(mDeltaX,mAxisLeft.mAxisRange,mAxisLeft.mAxisMinimum);
}
Program: 18735
Project: 18735
Buggy source:
@Override protected void calcMinMax(){
  float minLeft=mData.getYMin(AxisDependency.LEFT);
  float maxLeft=mData.getYMax(AxisDependency.LEFT);
  float minRight=mData.getYMin(AxisDependency.RIGHT);
  float maxRight=mData.getYMax(AxisDependency.RIGHT);
  float leftRange=Math.abs(maxLeft - minLeft);
  float rightRange=Math.abs(maxRight - minRight);
  float topSpaceLeft=leftRange / 100f * mAxisLeft.getSpaceTop();
  float topSpaceRight=rightRange / 100f * mAxisRight.getSpaceTop();
  float bottomSpaceLeft=leftRange / 100f * mAxisLeft.getSpaceBottom();
  float bottomSpaceRight=rightRange / 100f * mAxisRight.getSpaceBottom();
  mDeltaX=mData.getXVals().size() - 1;
  mAxisLeft.mAxisMaximum=maxLeft + topSpaceLeft;
  mAxisRight.mAxisMaximum=maxRight + topSpaceRight;
  mAxisLeft.mAxisMinimum=minLeft - bottomSpaceLeft;
  mAxisRight.mAxisMinimum=minRight - bottomSpaceRight;
  mDeltaYLeft=Math.abs(mAxisLeft.mAxisMaximum - mAxisLeft.mAxisMinimum);
  mDeltaYRight=Math.abs(mAxisRight.mAxisMaximum - mAxisRight.mAxisMinimum);
}

Fixed version (ground truth):
@Override protected void calcMinMax(){
  float minLeft=mData.getYMin(AxisDependency.LEFT);
  float maxLeft=mData.getYMax(AxisDependency.LEFT);
  float minRight=mData.getYMin(AxisDependency.RIGHT);
  float maxRight=mData.getYMax(AxisDependency.RIGHT);
  float leftRange=Math.abs(maxLeft - minLeft);
  float rightRange=Math.abs(maxRight - minRight);
  float topSpaceLeft=leftRange / 100f * mAxisLeft.getSpaceTop();
  float topSpaceRight=rightRange / 100f * mAxisRight.getSpaceTop();
  float bottomSpaceLeft=leftRange / 100f * mAxisLeft.getSpaceBottom();
  float bottomSpaceRight=rightRange / 100f * mAxisRight.getSpaceBottom();
  mDeltaX=mData.getXVals().size() - 1;
  mAxisLeft.mAxisMaximum=!Float.isNaN(mAxisLeft.getAxisMaxValue()) ? mAxisLeft.getAxisMaxValue() : maxLeft + topSpaceLeft;
  mAxisRight.mAxisMaximum=!Float.isNaN(mAxisRight.getAxisMaxValue()) ? mAxisRight.getAxisMaxValue() : maxRight + topSpaceRight;
  mAxisLeft.mAxisMinimum=!Float.isNaN(mAxisLeft.getAxisMinValue()) ? mAxisLeft.getAxisMinValue() : minLeft - bottomSpaceLeft;
  mAxisRight.mAxisMinimum=!Float.isNaN(mAxisRight.getAxisMinValue()) ? mAxisRight.getAxisMinValue() : minRight - bottomSpaceRight;
  mAxisLeft.mAxisRange=Math.abs(mAxisLeft.mAxisMaximum - mAxisLeft.mAxisMinimum);
  mAxisRight.mAxisRange=Math.abs(mAxisRight.mAxisMaximum - mAxisRight.mAxisMinimum);
}
Program: 18736
Project: 18736
Buggy source:
/** 
 * Returns the delta-y value (y-value range) of the specified axis.
 * @param axis
 * @return
 */
public float getDeltaY(AxisDependency axis){
  if (axis == AxisDependency.LEFT)   return mDeltaYLeft;
 else   return mDeltaYRight;
}

Fixed version (ground truth):
/** 
 * Returns the delta-y value (y-value range) of the specified axis.
 * @param axis
 * @return
 */
public float getDeltaY(AxisDependency axis){
  if (axis == AxisDependency.LEFT)   return mAxisLeft.mAxisRange;
 else   return mAxisRight.mAxisRange;
}
Program: 18737
Project: 18737
Buggy source:
/** 
 * Computes the axis values.
 * @param yMin - the minimum y-value in the data object for this axis
 * @param yMax - the maximum y-value in the data object for this axis
 */
public void computeAxis(float yMin,float yMax){
  if (mViewPortHandler.contentWidth() > 10 && !mViewPortHandler.isFullyZoomedOutY()) {
    PointD p1=mTrans.getValuesByTouchPoint(mViewPortHandler.contentLeft(),mViewPortHandler.contentTop());
    PointD p2=mTrans.getValuesByTouchPoint(mViewPortHandler.contentLeft(),mViewPortHandler.contentBottom());
    if (!mYAxis.isInverted()) {
      yMin=(float)p2.y;
      yMax=(float)p1.y;
    }
 else {
      if (!mYAxis.isStartAtZeroEnabled())       yMin=(float)Math.min(p1.y,p2.y);
 else       yMin=0;
      yMax=(float)Math.max(p1.y,p2.y);
    }
  }
 else {
    if (!Float.isNaN(mYAxis.getAxisMaxValue())) {
      yMax=mYAxis.getAxisMaxValue();
    }
    if (!Float.isNaN(mYAxis.getAxisMinValue())) {
      yMin=mYAxis.getAxisMinValue();
    }
  }
  computeAxisValues(yMin,yMax);
}

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

Fixed version (ground truth):
@Override protected void init(){
  super.init();
  mRenderer=new BarChartRenderer(this,mAnimator,mViewPortHandler);
  mXAxisRenderer=new XAxisRendererBarChart(mViewPortHandler,mXAxis,mLeftAxisTransformer,this);
}
Program: 18739
Project: 18739
Buggy source:
/** 
 * does all necessary preparations, needed when data is changed or flags that effect the data are changed
 */
@Override public void prepare(){
  if (mDataNotSet)   return;
  calcMinMax(mFixedYValues);
  mAxisRendererLeft.computeAxis(this);
  mAxisRendererRight.computeAxis(this);
  mXAxisRenderer.computeAxis(mData.getXValAverageLength(),mData.getXVals());
  prepareLegend();
  calculateOffsets();
}

Fixed version (ground truth):
/** 
 * does all necessary preparations, needed when data is changed or flags that effect the data are changed
 */
@Override public void prepare(){
  if (mDataNotSet) {
    if (mLogEnabled)     Log.i(LOG_TAG,"String_Node_Str");
    return;
  }
 else {
    if (mLogEnabled)     Log.i(LOG_TAG,"String_Node_Str");
  }
  calcMinMax(mFixedYValues);
  mAxisRendererLeft.computeAxis(this);
  mAxisRendererRight.computeAxis(this);
  mXAxisRenderer.computeAxis(mData.getXValAverageLength(),mData.getXVals());
  prepareLegend();
  calculateOffsets();
}
Program: 18740
Project: 18740
Buggy source:
@Override protected void init(){
  super.init();
  mLeftAxisTransformer=new Transformer(mViewPortHandler);
  mRightAxisTransformer=new Transformer(mViewPortHandler);
  mAxisRendererLeft=new YAxisRenderer(mViewPortHandler,mAxisLeft,mLeftAxisTransformer);
  mAxisRendererRight=new YAxisRenderer(mViewPortHandler,mAxisRight,mRightAxisTransformer);
  mXAxisRenderer=new XAxisRenderer(mViewPortHandler,mXAxis,mLeftAxisTransformer);
  mListener=new BarLineChartTouchListener(this,mViewPortHandler.getMatrixTouch());
  mBorderPaint=new Paint();
  mBorderPaint.setColor(Color.BLACK);
  mBorderPaint.setStrokeWidth(mGridWidth * 2f);
  mBorderPaint.setStyle(Style.STROKE);
  mGridBackgroundPaint=new Paint();
  mGridBackgroundPaint.setStyle(Style.FILL);
  mGridBackgroundPaint.setColor(Color.rgb(240,240,240));
}

Fixed version (ground truth):
@Override protected void init(){
  super.init();
  mAxisLeft=new YAxis(AxisDependency.LEFT);
  mAxisRight=new YAxis(AxisDependency.RIGHT);
  mXAxis=new XAxis();
  mLeftAxisTransformer=new Transformer(mViewPortHandler);
  mRightAxisTransformer=new Transformer(mViewPortHandler);
  mAxisRendererLeft=new YAxisRenderer(mViewPortHandler,mAxisLeft,mLeftAxisTransformer);
  mAxisRendererRight=new YAxisRenderer(mViewPortHandler,mAxisRight,mRightAxisTransformer);
  mXAxisRenderer=new XAxisRenderer(mViewPortHandler,mXAxis,mLeftAxisTransformer);
  mListener=new BarLineChartTouchListener(this,mViewPortHandler.getMatrixTouch());
  mBorderPaint=new Paint();
  mBorderPaint.setColor(Color.BLACK);
  mBorderPaint.setStrokeWidth(mGridWidth * 2f);
  mBorderPaint.setStyle(Style.STROKE);
  mGridBackgroundPaint=new Paint();
  mGridBackgroundPaint.setStyle(Style.FILL);
  mGridBackgroundPaint.setColor(Color.rgb(240,240,240));
}
Program: 18741
Project: 18741
Buggy source:
@Override public void notifyDataSetChanged(){
  if (!mFixedYValues) {
    prepare();
    mRightAxisTransformer.prepareMatrixValuePx(this,mDeltaX,mDeltaY);
    mLeftAxisTransformer.prepareMatrixValuePx(this,mDeltaX,mDeltaY);
  }
 else {
    calcMinMax(mFixedYValues);
  }
}

Fixed version (ground truth):
@Override public void notifyDataSetChanged(){
  if (!mFixedYValues) {
    prepare();
    mRightAxisTransformer.prepareMatrixValuePx(mViewPortHandler,mDeltaX,mDeltaY,mYChartMin);
    mLeftAxisTransformer.prepareMatrixValuePx(mViewPortHandler,mDeltaX,mDeltaY,mYChartMin);
  }
 else {
    calcMinMax(mFixedYValues);
  }
}
Program: 18742
Project: 18742
Buggy source:
/** 
 * Sets up all the matrices that will be used for scaling the coordinates to the display. Offset and Value-px.
 */
protected void prepareMatrix(){
  mRightAxisTransformer.prepareMatrixValuePx(this,mDeltaX,mDeltaY);
  mLeftAxisTransformer.prepareMatrixValuePx(this,mDeltaX,mDeltaY);
  mRightAxisTransformer.prepareMatrixOffset(mViewPortHandler,mAxisRight.isInverted());
  mLeftAxisTransformer.prepareMatrixOffset(mViewPortHandler,mAxisLeft.isInverted());
  if (mLogEnabled)   Log.i(LOG_TAG,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Sets up all the matrices that will be used for scaling the coordinates to the display. Offset and Value-px.
 */
protected void prepareMatrix(){
  mRightAxisTransformer.prepareMatrixValuePx(mViewPortHandler,mDeltaX,mDeltaY,mYChartMin);
  mLeftAxisTransformer.prepareMatrixValuePx(mViewPortHandler,mDeltaX,mDeltaY,mYChartMin);
  mRightAxisTransformer.prepareMatrixOffset(mViewPortHandler,mAxisRight.isInverted());
  mLeftAxisTransformer.prepareMatrixOffset(mViewPortHandler,mAxisLeft.isInverted());
  if (mLogEnabled)   Log.i(LOG_TAG,"String_Node_Str");
}
Program: 18744
Project: 18744
Buggy source:
/** 
 * calculates the modulus for x-labels and grid
 */
protected void calcModulus(){
  float[] values=new float[9];
  mViewPortHandler.getMatrixTouch().getValues(values);
  mXAxis.mXAxisLabelModulus=(int)Math.ceil((mData.getXValCount() * mXAxis.mLabelWidth) / (mViewPortHandler.contentWidth() * values[Matrix.MSCALE_X]));
}

Fixed version (ground truth):
/** 
 * calculates the modulus for x-labels and grid
 */
protected void calcModulus(){
  float[] values=new float[9];
  mViewPortHandler.getMatrixTouch().getValues(values);
  mXAxis.mAxisLabelModulus=(int)Math.ceil((mData.getXValCount() * mXAxis.mLabelWidth) / (mViewPortHandler.contentWidth() * values[Matrix.MSCALE_X]));
  if (mLogEnabled)   Log.i(LOG_TAG,"String_Node_Str" + mXAxis.mAxisLabelModulus + "String_Node_Str"+ mXAxis.mLabelWidth+ "String_Node_Str"+ mViewPortHandler.contentWidth());
}
Program: 18745
Project: 18745
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
  setContentView(R.layout.activity_combined);
  mChart=(CombinedChart)findViewById(R.id.chart1);
  mChart.setDescription("String_Node_Str");
  mChart.setDrawGridBackground(false);
  YAxis rightAxis=mChart.getAxisRight();
  rightAxis.setDrawGridLines(false);
  CombinedData data=new CombinedData(mMonths);
  data.setData(generateLineData());
  data.setData(generateBarData());
  data.setData(generateScatterData());
  data.setData(generateCandleData());
  mChart.setData(data);
  mChart.invalidate();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
  setContentView(R.layout.activity_combined);
  mChart=(CombinedChart)findViewById(R.id.chart1);
  mChart.setDescription("String_Node_Str");
  mChart.setDrawGridBackground(false);
  YAxis rightAxis=mChart.getAxisRight();
  rightAxis.setDrawGridLines(false);
  CombinedData data=new CombinedData(mMonths);
  data.setData(generateLineData());
  data.setData(generateBarData());
  data.setData(generateCandleData());
  mChart.setData(data);
  mChart.invalidate();
}
Program: 18746
Project: 18746
Buggy source:
private LineData generateLineData(){
  LineData d=new LineData();
  ArrayList<Entry> entries=new ArrayList<Entry>();
  for (int index=0; index < itemcount; index++)   entries.add(new Entry(getRandom(),index));
  LineDataSet set=new LineDataSet(entries,"String_Node_Str");
  set.setColor(Color.RED);
  set.setLineWidth(2.5f);
  set.setCircleColor(Color.RED);
  set.setCircleSize(5f);
  set.setFillColor(Color.RED);
  set.setDrawCubic(true);
  d.addDataSet(set);
  return d;
}

Fixed version (ground truth):
private LineData generateLineData(){
  LineData d=new LineData();
  ArrayList<Entry> entries=new ArrayList<Entry>();
  for (int index=0; index < itemcount; index++)   entries.add(new Entry(getRandom(),index));
  LineDataSet set=new LineDataSet(entries,"String_Node_Str");
  set.setColor(Color.RED);
  set.setLineWidth(2.5f);
  set.setCircleColor(Color.RED);
  set.setCircleSize(5f);
  set.setFillColor(Color.RED);
  set.setDrawCubic(true);
  set.setDrawValues(false);
  d.addDataSet(set);
  return d;
}
Program: 18747
Project: 18747
Buggy source:
private CandleData generateCandleData(){
  CandleData d=new CandleData();
  ArrayList<CandleEntry> entries=new ArrayList<CandleEntry>();
  for (int index=0; index < itemcount; index++)   entries.add(new CandleEntry(index,25f,10f,12f,22f));
  CandleDataSet set=new CandleDataSet(entries,"String_Node_Str");
  set.setColor(Color.rgb(80,80,80));
  d.addDataSet(set);
  return d;
}

Fixed version (ground truth):
private CandleData generateCandleData(){
  CandleData d=new CandleData();
  ArrayList<CandleEntry> entries=new ArrayList<CandleEntry>();
  for (int index=0; index < itemcount; index++)   entries.add(new CandleEntry(index,20f,10f,13f,17f));
  CandleDataSet set=new CandleDataSet(entries,"String_Node_Str");
  set.setColor(Color.rgb(80,80,80));
  set.setBodySpace(0.3f);
  set.setDrawValues(false);
  d.addDataSet(set);
  return d;
}
Program: 18748
Project: 18748
Buggy source:
private ScatterData generateScatterData(){
  ScatterData d=new ScatterData();
  ArrayList<Entry> entries=new ArrayList<Entry>();
  for (int index=0; index < itemcount; index++)   entries.add(new Entry(getRandom(),index));
  ScatterDataSet set=new ScatterDataSet(entries,"String_Node_Str");
  set.setColor(Color.GREEN);
  set.setScatterShapeSize(7.5f);
  d.addDataSet(set);
  return d;
}

Fixed version (ground truth):
private ScatterData generateScatterData(){
  ScatterData d=new ScatterData();
  ArrayList<Entry> entries=new ArrayList<Entry>();
  for (int index=0; index < itemcount; index++)   entries.add(new Entry(getRandom(),index));
  ScatterDataSet set=new ScatterDataSet(entries,"String_Node_Str");
  set.setColor(Color.GREEN);
  set.setScatterShapeSize(7.5f);
  set.setDrawValues(false);
  d.addDataSet(set);
  return d;
}
Program: 18749
Project: 18749
Buggy source:
@Override protected void calcMinMax(){
  super.calcMinMax();
  mDeltaX=Math.abs(mXChartMax - mXChartMin);
}

Fixed version (ground truth):
@Override protected void calcMinMax(){
  super.calcMinMax();
  mXChartMax+=0.5f;
  mDeltaX=Math.abs(mXChartMax - mXChartMin);
}
Program: 18750
Project: 18750
Buggy source:
@Override public void drawValues(Canvas c){
}

Fixed version (ground truth):
@Override public void drawValues(Canvas c){
  if (mChart.getCandleData().getYValCount() < mChart.getMaxVisibleCount() * mViewPortHandler.getScaleX()) {
    ArrayList<CandleDataSet> dataSets=mChart.getCandleData().getDataSets();
    for (int i=0; i < dataSets.size(); i++) {
      CandleDataSet dataSet=dataSets.get(i);
      Transformer trans=mChart.getTransformer(dataSet.getAxisDependency());
      if (!dataSet.isDrawValuesEnabled())       continue;
      ArrayList<CandleEntry> entries=dataSet.getYVals();
      float[] positions=trans.generateTransformedValuesCandle(entries,mAnimator.getPhaseY());
      float yOffset=Utils.convertDpToPixel(5f);
      for (int j=0; j < positions.length * mAnimator.getPhaseX(); j+=2) {
        float x=positions[j];
        float y=positions[j + 1];
        if (!mViewPortHandler.isInBoundsRight(x))         break;
        if (!mViewPortHandler.isInBoundsLeft(x) || !mViewPortHandler.isInBoundsY(y))         continue;
        float val=entries.get(j / 2).getVal();
        c.drawText(mChart.getValueFormatter().getFormattedValue(val),x,y - yOffset,mValuePaint);
      }
    }
  }
}
Program: 18751
Project: 18751
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.setDrawVerticalGrid(false);
  mChart.setDrawHorizontalGrid(false);
  mChart.setDrawGridBackground(false);
  XAxis xAxis=mChart.getXAxis();
  xAxis.setPosition(XLabelPosition.BOTTOM);
  xAxis.setCenterXLabelText(true);
  xAxis.setSpaceBetweenLabels(0);
  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(XLabelPosition.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);
}
Program: 18752
Project: 18752
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.setDrawHorizontalGrid(true);
  mChart.setDrawVerticalGrid(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);
  YAxis yl=mChart.getAxisLeft();
  yl.setTypeface(tf);
  yl.setLabelCount(8);
  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 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);
}
Program: 18753
Project: 18753
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);
  mChart.setDrawHorizontalGrid(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 yl=mChart.getAxisLeft();
  yl.setTypeface(tf);
  yl.setFormatter(new LargeValueFormatter());
  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.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);
}
Program: 18754
Project: 18754
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_candlechart);
  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=(CandleStickChart)findViewById(R.id.chart1);
  mChart.setDescription("String_Node_Str");
  mChart.setMaxVisibleValueCount(60);
  mChart.setPinchZoom(false);
  mChart.setDrawVerticalGrid(false);
  mChart.setDrawGridBackground(false);
  XAxis xLabels=mChart.getXAxis();
  xLabels.setPosition(XLabelPosition.BOTTOM);
  xLabels.setCenterXLabelText(true);
  xLabels.setSpaceBetweenLabels(2);
  YAxis yLabels=mChart.getAxisLeft();
  yLabels.setLabelCount(7);
  mChart.setDrawLegend(false);
  mSeekBarX.setProgress(15);
  mSeekBarY.setProgress(100);
}

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_candlechart);
  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=(CandleStickChart)findViewById(R.id.chart1);
  mChart.setDescription("String_Node_Str");
  mChart.setMaxVisibleValueCount(60);
  mChart.setPinchZoom(false);
  mChart.setDrawGridBackground(false);
  XAxis xLabels=mChart.getXAxis();
  xLabels.setPosition(XLabelPosition.BOTTOM);
  xLabels.setCenterXLabelText(true);
  xLabels.setSpaceBetweenLabels(2);
  YAxis yLabels=mChart.getAxisLeft();
  yLabels.setLabelCount(7);
  yLabels.setDrawGridLines(false);
  mChart.setDrawLegend(false);
  mSeekBarX.setProgress(15);
  mSeekBarY.setProgress(100);
}
Program: 18755
Project: 18755
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_linechart);
  tvX=(TextView)findViewById(R.id.tvXMax);
  tvY=(TextView)findViewById(R.id.tvYMax);
  mSeekBarX=(SeekBar)findViewById(R.id.seekBar1);
  mSeekBarY=(SeekBar)findViewById(R.id.seekBar2);
  mSeekBarX.setProgress(45);
  mSeekBarY.setProgress(100);
  mSeekBarY.setOnSeekBarChangeListener(this);
  mSeekBarX.setOnSeekBarChangeListener(this);
  mChart=(LineChart)findViewById(R.id.chart1);
  mChart.setDrawBorder(false);
  mChart.setDrawLegend(false);
  mChart.setDescription("String_Node_Str");
  mChart.setHighlightEnabled(true);
  mChart.setTouchEnabled(true);
  mChart.setDragEnabled(true);
  mChart.setScaleEnabled(true);
  mChart.setPinchZoom(false);
  mChart.setDrawGridBackground(false);
  mChart.setDrawVerticalGrid(false);
  Typeface tf=Typeface.createFromAsset(getAssets(),"String_Node_Str");
  mChart.setValueTypeface(tf);
  XAxis x=mChart.getXAxis();
  x.setTypeface(tf);
  YAxis y=mChart.getAxisLeft();
  y.setTypeface(tf);
  y.setLabelCount(5);
  setData(45,100);
  mChart.animateXY(2000,2000);
  mChart.invalidate();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
  setContentView(R.layout.activity_linechart);
  tvX=(TextView)findViewById(R.id.tvXMax);
  tvY=(TextView)findViewById(R.id.tvYMax);
  mSeekBarX=(SeekBar)findViewById(R.id.seekBar1);
  mSeekBarY=(SeekBar)findViewById(R.id.seekBar2);
  mSeekBarX.setProgress(45);
  mSeekBarY.setProgress(100);
  mSeekBarY.setOnSeekBarChangeListener(this);
  mSeekBarX.setOnSeekBarChangeListener(this);
  mChart=(LineChart)findViewById(R.id.chart1);
  mChart.setDrawBorder(false);
  mChart.setDrawLegend(false);
  mChart.setDescription("String_Node_Str");
  mChart.setHighlightEnabled(true);
  mChart.setTouchEnabled(true);
  mChart.setDragEnabled(true);
  mChart.setScaleEnabled(true);
  mChart.setPinchZoom(false);
  mChart.setDrawGridBackground(false);
  Typeface tf=Typeface.createFromAsset(getAssets(),"String_Node_Str");
  mChart.setValueTypeface(tf);
  XAxis x=mChart.getXAxis();
  x.setTypeface(tf);
  YAxis y=mChart.getAxisLeft();
  y.setTypeface(tf);
  y.setLabelCount(5);
  y.setDrawGridLines(false);
  setData(45,100);
  mChart.animateXY(2000,2000);
  mChart.invalidate();
}