nus-yam/ex-repair huggingface dataset:
Program: 27054
Project: 27054
Buggy source:
@Override public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser){
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < mSeekBarX.getProgress(); i++) {
    xVals.add((i) + "String_Node_Str");
  }
  ArrayList<Series> yVals=new ArrayList<Series>();
  for (int i=0; i < mSeekBarX.getProgress(); i++) {
    float mult=(mSeekBarY.getProgress() + 1);
    float val=(float)(Math.random() * mult * 0.1) + 3;
    yVals.add(new Series(val,i));
  }
  tvX.setText("String_Node_Str" + (mSeekBarX.getProgress() + 1));
  tvY.setText("String_Node_Str" + (mSeekBarY.getProgress() / 10));
  DataSet set=new DataSet(yVals,0);
  ArrayList<DataSet> dataSets=new ArrayList<DataSet>();
  dataSets.add(set);
  ChartData data=new ChartData(xVals,dataSets);
  mChart.setData(data);
  mChart.invalidate();
}

Fixed version (ground truth):
@Override public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser){
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < mSeekBarX.getProgress(); i++) {
    xVals.add((i) + "String_Node_Str");
  }
  ArrayList<Series> yVals=new ArrayList<Series>();
  for (int i=0; i < mSeekBarX.getProgress(); i++) {
    float mult=(mSeekBarY.getProgress() + 1);
    float val=(float)(Math.random() * mult * 0.1) + 3;
    yVals.add(new Series(val,i));
  }
  tvX.setText("String_Node_Str" + (mSeekBarX.getProgress() + 1));
  tvY.setText("String_Node_Str" + (mSeekBarY.getProgress() / 10));
  DataSet set1=new DataSet(yVals,0);
  ArrayList<DataSet> dataSets=new ArrayList<DataSet>();
  dataSets.add(set1);
  ChartData data=new ChartData(xVals,dataSets);
  mChart.setData(data);
  mChart.invalidate();
}
Program: 27055
Project: 27055
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);
  mSeekBarX.setOnSeekBarChangeListener(this);
  mSeekBarY=(SeekBar)findViewById(R.id.seekBar2);
  mSeekBarY.setOnSeekBarChangeListener(this);
  mChart=(LineChart)findViewById(R.id.chart1);
  mChart.setDrawYValues(false);
  mChart.setLineWidth(4f);
  mChart.setCircleSize(4f);
  mChart.setYLegendCount(6);
  mChart.setTouchEnabled(true);
  mChart.setHighlightEnabled(true);
  mChart.setDragEnabled(true);
  mChart.setTouchEnabled(true);
  TextView textView=new TextView(this);
  textView.setVisibility(View.VISIBLE);
  textView.setBackgroundColor(Color.WHITE);
  textView.setPadding(15,15,15,15);
  textView.setText("String_Node_Str");
  mChart.setDrawMarkerView(true);
  mChart.setMarkerView(textView);
  mSeekBarX.setProgress(45);
  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_linechart);
  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=(LineChart)findViewById(R.id.chart1);
  mChart.setColorTemplate(new ColorTemplate(ColorTemplate.getColors(this,ColorTemplate.JOYFUL_COLORS)));
  mChart.setDrawTopYLegendEntry(false);
  mChart.setDrawYValues(false);
  mChart.setLineWidth(5f);
  mChart.setCircleSize(5f);
  mChart.setYLegendCount(6);
  mChart.setTouchEnabled(true);
  mChart.setHighlightEnabled(true);
  mChart.setDragEnabled(true);
  mChart.setTouchEnabled(true);
  TextView textView=new TextView(this);
  textView.setVisibility(View.VISIBLE);
  textView.setBackgroundColor(Color.WHITE);
  textView.setPadding(15,15,15,15);
  textView.setText("String_Node_Str");
  mChart.setDrawMarkerView(true);
  mChart.setMarkerView(textView);
  mSeekBarX.setProgress(45);
  mSeekBarY.setProgress(100);
}
Program: 27056
Project: 27056
Buggy source:
/** 
 * draws the circle value indicators
 */
@Override protected void drawAdditional(){
  if (mDrawCircles) {
    ArrayList<DataSet> dataSets=mData.getDataSets();
    for (int i=0; i < mData.getDataSetCount(); i++) {
      DataSet dataSet=dataSets.get(i);
      ArrayList<Series> series=dataSet.getYVals();
      float[] positions=new float[dataSet.getYValCount() * 2];
      for (int j=0; j < positions.length; j+=2) {
        positions[j]=series.get(j / 2).getXIndex();
        positions[j + 1]=series.get(j / 2).getVal();
      }
      transformPointArray(positions);
      for (int j=0; j < positions.length; j+=2) {
        if (positions[j] < mContentRect.left || positions[j] > mContentRect.right)         continue;
        mDrawCanvas.drawCircle(positions[j],positions[j + 1],mCircleSize,mCirclePaintOuter);
        mDrawCanvas.drawCircle(positions[j],positions[j + 1],mCircleSize / 2,mCirclePaintInner);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * draws the circle value indicators
 */
@Override protected void drawAdditional(){
  if (mDrawCircles) {
    ArrayList<DataSet> dataSets=mData.getDataSets();
    for (int i=0; i < mData.getDataSetCount(); i++) {
      DataSet dataSet=dataSets.get(i);
      ArrayList<Series> series=dataSet.getYVals();
      float[] positions=new float[dataSet.getYValCount() * 2];
      for (int j=0; j < positions.length; j+=2) {
        positions[j]=series.get(j / 2).getXIndex();
        positions[j + 1]=series.get(j / 2).getVal();
      }
      transformPointArray(positions);
      for (int j=0; j < positions.length; j+=2) {
        if (positions[j] < mContentRect.left || positions[j] > mContentRect.right)         continue;
        mDrawCanvas.drawCircle(positions[j],positions[j + 1],mCircleSize,mDrawPaints[i % mDrawPaints.length]);
        mDrawCanvas.drawCircle(positions[j],positions[j + 1],mCircleSize / 2,mCirclePaintInner);
      }
    }
  }
}
Program: 27057
Project: 27057
Buggy source:
@Override protected void prepareDataPaints(ColorTemplate ct){
  if (ct == null)   return;
  mDrawPaints=new Paint[ct.getColors().size()];
  for (int i=0; i < ct.getColors().size(); i++) {
    mDrawPaints[i]=new Paint(Paint.ANTI_ALIAS_FLAG);
    mDrawPaints[i].setStrokeWidth(mLineWidth);
    mDrawPaints[i].setStyle(Style.STROKE);
    mDrawPaints[i].setColor(ct.getColors().get(i));
  }
}

Fixed version (ground truth):
@Override protected void prepareDataPaints(ColorTemplate ct){
  if (ct == null)   return;
  mDrawPaints=new Paint[ct.getColors().size()];
  for (int i=0; i < ct.getColors().size(); i++) {
    mDrawPaints[i]=new Paint(Paint.ANTI_ALIAS_FLAG);
    mDrawPaints[i].setStrokeWidth(mLineWidth);
    mDrawPaints[i].setStyle(Style.FILL);
    mDrawPaints[i].setColor(ct.getColors().get(i));
  }
}
Program: 27058
Project: 27058
Buggy source:
/** 
 * returns the color value at the given index from the DataSet at the given index
 * @param dataSetIndex
 * @param colorIndex
 * @return
 */
public int getDataSetColor(int dataSetIndex,int colorIndex){
  return mDataSetColors.get(dataSetIndex).get(colorIndex);
}

Fixed version (ground truth):
/** 
 * Returns the color value at the given index from the DataSet at the given index. If index is outofbounds, it restart at lower indices.
 * @param dataSetIndex
 * @param colorIndex
 * @return
 */
public int getDataSetColor(int dataSetIndex,int colorIndex){
  return mDataSetColors.get(dataSetIndex).get(colorIndex % mDataSetColors.get(dataSetIndex).size());
}
Program: 27059
Project: 27059
Buggy source:
@Override protected void drawHighlights(){
  if (mHighlightEnabled && valuesToHighlight()) {
    float angle=0f;
    for (int i=0; i < mIndicesToHightlight.length; i++) {
      int index=mIndicesToHightlight[i].getXIndex();
      if (index >= mDrawAngles.length || index > mDeltaX)       continue;
      if (index == 0)       angle=mChartAngle;
 else       angle=mChartAngle + mAbsoluteAngles[index - 1];
      float sliceDegrees=mDrawAngles[index];
      float shiftangle=(float)Math.toRadians(angle + sliceDegrees / 2f);
      float xShift=mShift * (float)Math.cos(shiftangle);
      float yShift=mShift * (float)Math.sin(shiftangle);
      RectF highlighted=new RectF(mCircleBox.left + xShift,mCircleBox.top + yShift,mCircleBox.right + xShift,mCircleBox.bottom + yShift);
      ArrayList<Integer> colors=mCt.getDataSetColors(mIndicesToHightlight[i].getDataSetIndex());
      mRenderPaint.setColor(colors.get(index % colors.size()));
      mDrawCanvas.drawArc(highlighted,angle,sliceDegrees,true,mRenderPaint);
    }
  }
}

Fixed version (ground truth):
@Override protected void drawHighlights(){
  if (mHighlightEnabled && valuesToHighlight()) {
    float angle=0f;
    for (int i=0; i < mIndicesToHightlight.length; i++) {
      int xIndex=mIndicesToHightlight[i].getXIndex();
      if (xIndex >= mDrawAngles.length || xIndex > mDeltaX)       continue;
      if (xIndex == 0)       angle=mChartAngle;
 else       angle=mChartAngle + mAbsoluteAngles[xIndex - 1];
      float sliceDegrees=mDrawAngles[xIndex];
      float shiftangle=(float)Math.toRadians(angle + sliceDegrees / 2f);
      float xShift=mShift * (float)Math.cos(shiftangle);
      float yShift=mShift * (float)Math.sin(shiftangle);
      RectF highlighted=new RectF(mCircleBox.left + xShift,mCircleBox.top + yShift,mCircleBox.right + xShift,mCircleBox.bottom + yShift);
      DataSet set=mData.getDataSetByIndex(mIndicesToHightlight[i].getDataSetIndex());
      int color=mCt.getDataSetColor(mIndicesToHightlight[i].getDataSetIndex(),set.getIndexInSeries(xIndex));
      mRenderPaint.setColor(color);
      mDrawCanvas.drawArc(highlighted,angle,sliceDegrees,true,mRenderPaint);
    }
  }
}
Program: 27060
Project: 27060
Buggy source:
@Override protected void drawData(){
  float angle=mChartAngle;
  ArrayList<DataSet> dataSets=mData.getDataSets();
  int cnt=0;
  for (int i=0; i < mData.getDataSetCount(); i++) {
    DataSet dataSet=dataSets.get(i);
    ArrayList<Series> series=dataSet.getYVals();
    ArrayList<Integer> colors=mCt.getDataSetColors(i % mCt.getColors().size());
    for (int j=0; j < series.size(); j++) {
      mRenderPaint.setColor(colors.get(j % colors.size()));
      float newangle=mDrawAngles[cnt];
      if (!needsHighlight(series.get(j).getXIndex(),i)) {
        mDrawCanvas.drawArc(mCircleBox,angle,newangle,true,mRenderPaint);
      }
      angle+=newangle;
      cnt++;
    }
  }
}

Fixed version (ground truth):
@Override protected void drawData(){
  float angle=mChartAngle;
  ArrayList<DataSet> dataSets=mData.getDataSets();
  int cnt=0;
  for (int i=0; i < mData.getDataSetCount(); i++) {
    DataSet dataSet=dataSets.get(i);
    ArrayList<Series> series=dataSet.getYVals();
    ArrayList<Integer> colors=mCt.getDataSetColors(i % mCt.getColors().size());
    for (int j=0; j < series.size(); j++) {
      float newangle=mDrawAngles[cnt];
      if (!needsHighlight(series.get(j).getXIndex(),i)) {
        mRenderPaint.setColor(colors.get(j % colors.size()));
        mDrawCanvas.drawArc(mCircleBox,angle,newangle,true,mRenderPaint);
      }
      angle+=newangle;
      cnt++;
    }
  }
}
Program: 27061
Project: 27061
Buggy source:
@Override protected void drawHighlights(){
  if (mHighlightEnabled && valuesToHighlight()) {
    float offsetY=mDeltaY * 0.04f;
    for (int i=0; i < mIndicesToHightlight.length; i++) {
      int index=mIndicesToHightlight[i];
      if (index < mYVals.size()) {
        mHighlightPaint.setAlpha(120);
        float y=mYVals.get(index).getVal();
        float left=index + mBarSpace / 2f;
        float right=index + 1f - mBarSpace / 2f;
        float top=y >= 0 ? y : 0;
        float bottom=y <= 0 ? y : 0;
        RectF highlight=new RectF(left,top,right,bottom);
        transformRect(highlight);
        mDrawCanvas.drawRect(highlight,mHighlightPaint);
        if (mDrawHighlightArrow) {
          mHighlightPaint.setAlpha(200);
          Path arrow=new Path();
          arrow.moveTo(index + 0.5f,y + offsetY * 0.3f);
          arrow.lineTo(index + 0.2f,y + offsetY);
          arrow.lineTo(index + 0.8f,y + offsetY);
          transformPath(arrow);
          mDrawCanvas.drawPath(arrow,mHighlightPaint);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void drawHighlights(){
  if (mHighlightEnabled && valuesToHighlight()) {
    float offsetY=mDeltaY * 0.04f;
    for (int i=0; i < mIndicesToHightlight.length; i++) {
      int index=mIndicesToHightlight[i];
      if (index < mYVals.size() && index >= 0) {
        mHighlightPaint.setAlpha(120);
        float y=mYVals.get(index).getVal();
        float left=index + mBarSpace / 2f;
        float right=index + 1f - mBarSpace / 2f;
        float top=y >= 0 ? y : 0;
        float bottom=y <= 0 ? y : 0;
        RectF highlight=new RectF(left,top,right,bottom);
        transformRect(highlight);
        mDrawCanvas.drawRect(highlight,mHighlightPaint);
        if (mDrawHighlightArrow) {
          mHighlightPaint.setAlpha(200);
          Path arrow=new Path();
          arrow.moveTo(index + 0.5f,y + offsetY * 0.3f);
          arrow.lineTo(index + 0.2f,y + offsetY);
          arrow.lineTo(index + 0.8f,y + offsetY);
          transformPath(arrow);
          mDrawCanvas.drawPath(arrow,mHighlightPaint);
        }
      }
    }
  }
}
Program: 27062
Project: 27062
Buggy source:
/** 
 * returns the index of the value (on the x-axis) for the given touch point
 * @param x
 * @param y
 * @return
 */
public int getIndexByTouchPoint(float x,float y){
  float[] pts=new float[2];
  pts[0]=x;
  pts[1]=y;
  Matrix tmp=new Matrix();
  mMatrixOffset.invert(tmp);
  tmp.mapPoints(pts);
  mMatrixTouch.invert(tmp);
  tmp.mapPoints(pts);
  mMatrixValueToPx.invert(tmp);
  tmp.mapPoints(pts);
  double touchPointIndex=pts[0];
  double base=Math.floor(touchPointIndex);
  int index=(int)base;
  if (this instanceof LineChart) {
    if (touchPointIndex - base > 0.5) {
      index=(int)base + 1;
    }
  }
  return index;
}

Fixed version (ground truth):
/** 
 * returns the index of the value (on the x-axis) for the given touch point
 * @param x
 * @param y
 * @return
 */
public int getIndexByTouchPoint(float x,float y){
  float[] pts=new float[2];
  pts[0]=x;
  pts[1]=y;
  Matrix tmp=new Matrix();
  mMatrixOffset.invert(tmp);
  tmp.mapPoints(pts);
  mMatrixTouch.invert(tmp);
  tmp.mapPoints(pts);
  mMatrixValueToPx.invert(tmp);
  tmp.mapPoints(pts);
  double touchPointIndex=pts[0];
  double base=Math.floor(touchPointIndex);
  if (touchPointIndex < 0 || touchPointIndex > getValueCount() - 1)   return -1;
  int index=(int)base;
  if (this instanceof LineChart) {
    if (touchPointIndex - base > 0.5) {
      index=(int)base + 1;
    }
  }
  return index;
}
Program: 27063
Project: 27063
Buggy source:
/** 
 * returns the x-value at the given index
 * @param index
 * @return
 */
public String getXValue(int index){
  if (mXVals == null || mXVals.size() >= index)   return null;
 else   return mXVals.get(index);
}

Fixed version (ground truth):
/** 
 * returns the x-value at the given index
 * @param index
 * @return
 */
public String getXValue(int index){
  if (mXVals == null || mXVals.size() <= index)   return null;
 else   return mXVals.get(index);
}
Program: 27064
Project: 27064
Buggy source:
/** 
 * returns true if there are values to highlight, false if there are not checks if the highlight array is null, has a length of zero or contains -1
 * @return
 */
public boolean valuesToHighlight(){
  return mIndicesToHightlight == null || mIndicesToHightlight.length == 0 || mIndicesToHightlight[0] == -1 ? false : true;
}

Fixed version (ground truth):
/** 
 * returns true if there are values to highlight, false if there are not checks if the highlight array is null, has a length of zero or contains -1
 * @return
 */
public boolean valuesToHighlight(){
  return mIndicesToHightlight == null || mIndicesToHightlight.length == 0 || mIndicesToHightlight[0] < 0 ? false : true;
}
Program: 27065
Project: 27065
Buggy source:
@Override protected void drawHighlights(){
  if (mHighlightEnabled && valuesToHighlight()) {
    for (int i=0; i < mIndicesToHightlight.length; i++) {
      int index=mIndicesToHightlight[i];
      if (index < mYVals.size()) {
        float[] pts=new float[]{index,mYChartMax,index,mYChartMin,0,mYVals.get(index).getVal(),mDeltaX,mYVals.get(index).getVal()};
        transformPointArray(pts);
        mDrawCanvas.drawLines(pts,mHighlightPaint);
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void drawHighlights(){
  if (mHighlightEnabled && valuesToHighlight()) {
    for (int i=0; i < mIndicesToHightlight.length; i++) {
      int index=mIndicesToHightlight[i];
      if (index < mYVals.size() && index >= 0) {
        float[] pts=new float[]{index,mYChartMax,index,mYChartMin,0,mYVals.get(index).getVal(),mDeltaX,mYVals.get(index).getVal()};
        transformPointArray(pts);
        mDrawCanvas.drawLines(pts,mHighlightPaint);
      }
    }
  }
}
Program: 27066
Project: 27066
Buggy source:
@Override public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser){
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < mSeekBarX.getProgress(); i++) {
    xVals.add((i) + "String_Node_Str");
  }
  ArrayList<Series> yVals=new ArrayList<Series>();
  for (int i=0; i < mSeekBarX.getProgress(); i++) {
    float mult=(mSeekBarY.getProgress() + 1);
    float val=(float)(Math.random() * mult * 0.1) + 3;
    yVals.add(new Series(val,i));
  }
  tvX.setText("String_Node_Str" + (mSeekBarX.getProgress() + 1));
  tvY.setText("String_Node_Str" + (mSeekBarY.getProgress() / 10));
  DataSet set=new DataSet(yVals,0);
  ArrayList<DataSet> dataSets=new ArrayList<DataSet>();
  dataSets.add(set);
  ChartData data=new ChartData(xVals,dataSets);
  mChart.setData(data);
  mChart.invalidate();
}

Fixed version (ground truth):
@Override public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser){
  ArrayList<String> xVals=new ArrayList<String>();
  for (int i=0; i < mSeekBarX.getProgress(); i++) {
    xVals.add((i) + "String_Node_Str");
  }
  ArrayList<Series> yVals1=new ArrayList<Series>();
  for (int i=0; i < mSeekBarX.getProgress(); i++) {
    float mult=(mSeekBarY.getProgress() + 1);
    float val=(float)(Math.random() * mult * 0.1) + 3;
    yVals1.add(new Series(val,i));
  }
  tvX.setText("String_Node_Str" + (mSeekBarX.getProgress() + 1));
  tvY.setText("String_Node_Str" + (mSeekBarY.getProgress() / 10));
  DataSet set1=new DataSet(yVals1,0);
  ArrayList<DataSet> dataSets=new ArrayList<DataSet>();
  dataSets.add(set1);
  ChartData data=new ChartData(xVals,dataSets);
  mChart.setData(data);
  mChart.invalidate();
}
Program: 27068
Project: 27068
Buggy source:
@Override protected void drawHighlights(){
  if (mHighlightEnabled && valuesToHighlight()) {
    float offsetY=mDeltaY * 0.04f;
    for (int i=0; i < mIndicesToHightlight.length; i++) {
      int index=mIndicesToHightlight[i].getXIndex();
      if (index < mData.getYValCount() && index >= 0) {
        mHighlightPaint.setAlpha(120);
        float y=getYValue(index);
        float left=index + mBarSpace / 2f;
        float right=index + 1f - mBarSpace / 2f;
        float top=y >= 0 ? y : 0;
        float bottom=y <= 0 ? y : 0;
        RectF highlight=new RectF(left,top,right,bottom);
        transformRect(highlight);
        mDrawCanvas.drawRect(highlight,mHighlightPaint);
        if (mDrawHighlightArrow) {
          mHighlightPaint.setAlpha(200);
          Path arrow=new Path();
          arrow.moveTo(index + 0.5f,y + offsetY * 0.3f);
          arrow.lineTo(index + 0.2f,y + offsetY);
          arrow.lineTo(index + 0.8f,y + offsetY);
          transformPath(arrow);
          mDrawCanvas.drawPath(arrow,mHighlightPaint);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void drawHighlights(){
  if (mHighlightEnabled && valuesToHighlight()) {
    float offsetY=mDeltaY * 0.04f;
    for (int i=0; i < mIndicesToHightlight.length; i++) {
      int index=mIndicesToHightlight[i].getXIndex();
      if (index < mData.getYValCount() && index >= 0) {
        mHighlightPaint.setAlpha(120);
        float y=getYValueByDataSetIndex(index,mIndicesToHightlight[i].getDataSetIndex());
        float left=index + mBarSpace / 2f;
        float right=index + 1f - mBarSpace / 2f;
        float top=y >= 0 ? y : 0;
        float bottom=y <= 0 ? y : 0;
        RectF highlight=new RectF(left,top,right,bottom);
        transformRect(highlight);
        mDrawCanvas.drawRect(highlight,mHighlightPaint);
        if (mDrawHighlightArrow) {
          mHighlightPaint.setAlpha(200);
          Path arrow=new Path();
          arrow.moveTo(index + 0.5f,y + offsetY * 0.3f);
          arrow.lineTo(index + 0.2f,y + offsetY);
          arrow.lineTo(index + 0.8f,y + offsetY);
          transformPath(arrow);
          mDrawCanvas.drawPath(arrow,mHighlightPaint);
        }
      }
    }
  }
}
Program: 27069
Project: 27069
Buggy source:
/** 
 * returns the Highlight object (x index and DataSet index) of the selected value at the given touch point
 * @param x
 * @param y
 * @return
 */
public Highlight getIndexByTouchPoint(float x,float y){
  float[] pts=new float[2];
  pts[0]=x;
  pts[1]=y;
  Matrix tmp=new Matrix();
  mMatrixOffset.invert(tmp);
  tmp.mapPoints(pts);
  mMatrixTouch.invert(tmp);
  tmp.mapPoints(pts);
  mMatrixValueToPx.invert(tmp);
  tmp.mapPoints(pts);
  double xTouchVal=pts[0];
  double yTouchVal=pts[1];
  double base=Math.floor(xTouchVal);
  Log.i(LOG_TAG,"String_Node_Str" + xTouchVal + "String_Node_Str"+ yTouchVal);
  if (this instanceof LineChart && (xTouchVal < 0 || xTouchVal > mDeltaX))   return null;
  if (this instanceof BarChart && (xTouchVal < 0 || xTouchVal > mDeltaX + 1))   return null;
  int xIndex=(int)base;
  int yIndex=0;
  if (this instanceof LineChart) {
    if (xTouchVal - base > 0.5) {
      xIndex=(int)base + 1;
    }
  }
  ArrayList<Float> valsAtIndex=getYValsAtIndex(xIndex);
  yIndex=getClosestDataSetIndex(valsAtIndex,(float)yTouchVal);
  if (yIndex == -1)   return null;
  return new Highlight(xIndex,yIndex);
}

Fixed version (ground truth):
/** 
 * returns the Highlight object (x index and DataSet index) of the selected value at the given touch point
 * @param x
 * @param y
 * @return
 */
public Highlight getIndexByTouchPoint(float x,float y){
  float[] pts=new float[2];
  pts[0]=x;
  pts[1]=y;
  Matrix tmp=new Matrix();
  mMatrixOffset.invert(tmp);
  tmp.mapPoints(pts);
  mMatrixTouch.invert(tmp);
  tmp.mapPoints(pts);
  mMatrixValueToPx.invert(tmp);
  tmp.mapPoints(pts);
  double xTouchVal=pts[0];
  double yTouchVal=pts[1];
  double base=Math.floor(xTouchVal);
  Log.i(LOG_TAG,"String_Node_Str" + xTouchVal + "String_Node_Str"+ yTouchVal);
  if (this instanceof LineChart && (xTouchVal < 0 || xTouchVal > mDeltaX))   return null;
  if (this instanceof BarChart && (xTouchVal < 0 || xTouchVal > mDeltaX + 1))   return null;
  int xIndex=(int)base;
  int yIndex=0;
  if (this instanceof LineChart) {
    if (xTouchVal - base > 0.5) {
      xIndex=(int)base + 1;
    }
  }
  ArrayList<SelInfo> valsAtIndex=getYValsAtIndex(xIndex);
  yIndex=getClosestDataSetIndex(valsAtIndex,(float)yTouchVal);
  if (yIndex == -1)   return null;
  return new Highlight(xIndex,yIndex);
}
Program: 27070
Project: 27070
Buggy source:
/** 
 * returns the index DataSet that contains the closest value    
 * @param valsAtIndex
 * @return
 */
private int getClosestDataSetIndex(ArrayList<Float> valsAtIndex,float val){
  int index=-1;
  float distance=Float.MAX_VALUE;
  for (int c=0; c < valsAtIndex.size(); c++) {
    float cdistance=Math.abs((float)valsAtIndex.get(c) - val);
    if (cdistance < distance) {
      index=c;
      distance=cdistance;
    }
  }
  Log.i(LOG_TAG,"String_Node_Str" + index);
  return index;
}

Fixed version (ground truth):
/** 
 * returns the index DataSet that contains the closest value    
 * @param valsAtIndex
 * @return
 */
private int getClosestDataSetIndex(ArrayList<SelInfo> valsAtIndex,float val){
  int index=-1;
  float distance=Float.MAX_VALUE;
  for (int i=0; i < valsAtIndex.size(); i++) {
    float cdistance=Math.abs((float)valsAtIndex.get(i).val - val);
    if (cdistance < distance) {
      index=valsAtIndex.get(i).dataSetIndex;
      distance=cdistance;
    }
  }
  Log.i(LOG_TAG,"String_Node_Str" + index);
  return index;
}
Program: 27071
Project: 27071
Buggy source:
/** 
 * returns the y-value for the given x-index and DataSet index
 * @param index
 * @param dataSet
 * @return
 */
public float getYValueByDataSetIndex(int index,int dataSet){
  DataSet set=mData.getDataSetByIndex(dataSet);
  return set.getYVals().get(index).getVal();
}

Fixed version (ground truth):
/** 
 * returns the y-value for the given x-index and DataSet index
 * @param index
 * @param dataSet
 * @return
 */
public float getYValueByDataSetIndex(int xIndex,int dataSet){
  DataSet set=mData.getDataSetByIndex(dataSet);
  return set.getYValForXIndex(xIndex);
}
Program: 27072
Project: 27072
Buggy source:
/** 
 * Get the y-values from the Series object at the given index across all DataSets. INFORMATION: This method does calculations at runtime. Do not over-use in performance critical situations.
 * @param xIndex
 * @return
 */
public ArrayList<Float> getYValsAtIndex(int xIndex){
  ArrayList<Float> vals=new ArrayList<Float>();
  for (int i=0; i < mData.getDataSetCount(); i++) {
    float yVal=mData.getDataSetByIndex(i).getYValForXIndex(xIndex);
    if (!Float.isNaN(yVal))     vals.add(yVal);
  }
  return vals;
}

Fixed version (ground truth):
/** 
 * Returns an array of SelInfo objects for the given x-index. The SelInfo objects give information about the value at the selected index and the DataSet it belongs to. INFORMATION: This method does calculations at runtime. Do not over-use in performance critical situations.
 * @param xIndex
 * @return
 */
protected ArrayList<SelInfo> getYValsAtIndex(int xIndex){
  ArrayList<SelInfo> vals=new ArrayList<SelInfo>();
  for (int i=0; i < mData.getDataSetCount(); i++) {
    float yVal=mData.getDataSetByIndex(i).getYValForXIndex(xIndex);
    if (!Float.isNaN(yVal)) {
      vals.add(new SelInfo(yVal,i));
    }
  }
  return vals;
}
Program: 27073
Project: 27073
Buggy source:
/** 
 * Returns the Series object at the given xIndex. INFORMATION: This method does calculations at runtime. Do not over-use in performance critical situations.
 * @param xIndex
 * @return
 */
public Series getSeriesForXIndex(int xIndex){
  for (int i=0; i < mYVals.size(); i++) {
    if (xIndex == mYVals.get(i).getXIndex())     return mYVals.get(i);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the Series object at the given xIndex. Returns null if no Series object at that index. INFORMATION: This method does calculations at runtime. Do not over-use in performance critical situations.
 * @param xIndex
 * @return
 */
public Series getSeriesForXIndex(int xIndex){
  for (int i=0; i < mYVals.size(); i++) {
    if (xIndex == mYVals.get(i).getXIndex())     return mYVals.get(i);
  }
  return null;
}
Program: 27074
Project: 27074
Buggy source:
public int getType(){
  return mType;
}

Fixed version (ground truth):
/** 
 * returns the type of the DataSet, specified via constructor
 * @return
 */
public int getType(){
  return mType;
}
Program: 27075
Project: 27075
Buggy source:
public float getYMax(){
  return mYMax;
}

Fixed version (ground truth):
/** 
 * returns the maximum y-value this DataSet holds
 * @return
 */
public float getYMax(){
  return mYMax;
}
Program: 27076
Project: 27076
Buggy source:
public float getYMin(){
  return mYMin;
}

Fixed version (ground truth):
/** 
 * returns the minimum y-value this DataSet holds
 * @return
 */
public float getYMin(){
  return mYMin;
}
Program: 27077
Project: 27077
Buggy source:
public ArrayList<Series> getYVals(){
  return mYVals;
}

Fixed version (ground truth):
/** 
 * returns the DataSets Series array
 * @return
 */
public ArrayList<Series> getYVals(){
  return mYVals;
}
Program: 27078
Project: 27078
Buggy source:
public float getYValueSum(){
  return mYValueSum;
}

Fixed version (ground truth):
/** 
 * gets the sum of all y-values
 * @return
 */
public float getYValueSum(){
  return mYValueSum;
}
Program: 27079
Project: 27079
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);
  ColorTemplate ct=new ColorTemplate();
  ct.addDataSetColors(ColorTemplate.FRESH_COLORS,this);
  ct.addDataSetColors(new int[]{R.color.liberty_2},this);
  ct.addDataSetColors(ColorTemplate.COLORFUL_COLORS,this);
  mChart.setColorTemplate(ct);
  mChart.setDrawYValues(false);
  mChart.set3DEnabled(false);
  mChart.setYLegendCount(5);
  mChart.setTouchEnabled(true);
  mSeekBarX.setProgress(45);
  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_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);
  ColorTemplate ct=new ColorTemplate();
  ct.addDataSetColors(ColorTemplate.FRESH_COLORS,this);
  ct.addDataSetColors(new int[]{R.color.liberty_2},this);
  ct.addDataSetColors(ColorTemplate.COLORFUL_COLORS,this);
  mChart.setColorTemplate(ct);
  mChart.setDrawYValues(false);
  mChart.set3DEnabled(false);
  mChart.setYLegendCount(5);
  mChart.setTouchEnabled(true);
  mChart.setDescription("String_Node_Str");
  mSeekBarX.setProgress(45);
  mSeekBarY.setProgress(100);
}
Program: 27080
Project: 27080
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
  setContentView(R.layout.activity_piechart);
  tvX=(TextView)findViewById(R.id.tvXMax);
  tvY=(TextView)findViewById(R.id.tvYMax);
  mSeekBarX=(SeekBar)findViewById(R.id.seekBar1);
  mSeekBarY=(SeekBar)findViewById(R.id.seekBar2);
  mSeekBarX.setOnSeekBarChangeListener(this);
  mSeekBarY.setOnSeekBarChangeListener(this);
  mChart=(PieChart)findViewById(R.id.chart1);
  ColorTemplate ct=new ColorTemplate();
  ct.addDataSetColors(ColorTemplate.COLORFUL_COLORS,this);
  ct.addDataSetColors(ColorTemplate.LIBERTY_COLORS,this);
  mChart.setColorTemplate(ct);
  mChart.setDrawYValues(true);
  mChart.setDrawCenterText(true);
  mChart.setDescription("String_Node_Str");
  mChart.setDrawHoleEnabled(true);
  mChart.setDrawXValues(true);
  mChart.setTouchEnabled(true);
  mChart.setUsePercentValues(false);
  mChart.setOnChartValueSelectedListener(this);
  mSeekBarX.setProgress(10);
  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_piechart);
  tvX=(TextView)findViewById(R.id.tvXMax);
  tvY=(TextView)findViewById(R.id.tvYMax);
  mSeekBarX=(SeekBar)findViewById(R.id.seekBar1);
  mSeekBarY=(SeekBar)findViewById(R.id.seekBar2);
  mSeekBarX.setOnSeekBarChangeListener(this);
  mSeekBarY.setOnSeekBarChangeListener(this);
  mChart=(PieChart)findViewById(R.id.chart1);
  ColorTemplate ct=new ColorTemplate();
  ct.addDataSetColors(ColorTemplate.COLORFUL_COLORS,this);
  ct.addDataSetColors(ColorTemplate.FRESH_COLORS,this);
  mChart.setColorTemplate(ct);
  mChart.setDrawYValues(true);
  mChart.setDrawCenterText(true);
  mChart.setDescription("String_Node_Str");
  mChart.setDrawHoleEnabled(true);
  mChart.setDrawXValues(true);
  mChart.setTouchEnabled(true);
  mChart.setUsePercentValues(false);
  mChart.setOnChartValueSelectedListener(this);
  mSeekBarX.setProgress(10);
  mSeekBarY.setProgress(100);
}
Program: 27082
Project: 27082
Buggy source:
/** 
 * Sets a colortemplate for the chart that defindes the colors used for drawing. If more values need to be drawn than provided colors available in the colortemplate, colors are repeated.
 * @param ct
 */
public void setColorTemplate(ColorTemplate ct){
  this.mCt=ct;
  prepareDataPaints(ct);
}

Fixed version (ground truth):
/** 
 * Sets a colortemplate for the chart that defindes the colors used for drawing. If more values need to be drawn than provided colors available in the colortemplate, colors are repeated.
 * @param ct
 */
public void setColorTemplate(ColorTemplate ct){
  this.mCt=ct;
}
Program: 27083
Project: 27083
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.setColorTemplate(new ColorTemplate(ColorTemplate.getColors(this,ColorTemplate.FRESH_COLORS)));
  mChart.setDrawValues(false);
  mChart.set3DEnabled(false);
  mChart.setDrawAdditional(true);
  mChart.setYLegendCount(5);
  mChart.setTouchEnabled(true);
  mSeekBarX.setProgress(45);
  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_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.setColorTemplate(new ColorTemplate(ColorTemplate.getColors(this,ColorTemplate.FRESH_COLORS)));
  mChart.setDrawValues(false);
  mChart.set3DEnabled(false);
  mChart.setYLegendCount(5);
  mChart.setTouchEnabled(true);
  mSeekBarX.setProgress(45);
  mSeekBarY.setProgress(100);
}
Program: 27084
Project: 27084
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);
  mSeekBarX.setOnSeekBarChangeListener(this);
  mSeekBarY=(SeekBar)findViewById(R.id.seekBar2);
  mSeekBarY.setOnSeekBarChangeListener(this);
  mChart=(LineChart)findViewById(R.id.chart1);
  mChart.setDrawValues(false);
  mChart.setLineWidth(5f);
  mChart.setCircleSize(5f);
  mChart.setDrawAdditional(true);
  mChart.setYLegendCount(6);
  mChart.setTouchEnabled(true);
  mSeekBarX.setProgress(45);
  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_linechart);
  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=(LineChart)findViewById(R.id.chart1);
  mChart.setDrawValues(false);
  mChart.setLineWidth(5f);
  mChart.setCircleSize(5f);
  mChart.setYLegendCount(6);
  mChart.setTouchEnabled(true);
  mSeekBarX.setProgress(45);
  mSeekBarY.setProgress(100);
}
Program: 27085
Project: 27085
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.actionToggleRound:
{
      if (mChart.isYLegendRounded())       mChart.setRoundedYLegend(false);
 else       mChart.setRoundedYLegend(true);
      mChart.invalidate();
      break;
    }
case R.id.actionToggleValues:
{
    if (mChart.isDrawValuesEnabled())     mChart.setDrawValues(false);
 else     mChart.setDrawValues(true);
    mChart.invalidate();
    break;
  }
case R.id.actionToggleFilled:
{
  if (mChart.isDrawFilledEnabled())   mChart.setDrawFilled(false);
 else   mChart.setDrawFilled(true);
  mChart.invalidate();
  break;
}
case R.id.actionToggleCircles:
{
if (mChart.isDrawAdditionalEnabled()) mChart.setDrawAdditional(false);
 else mChart.setDrawAdditional(true);
mChart.invalidate();
break;
}
case R.id.actionToggleStartzero:
{
if (mChart.isStartAtZeroEnabled()) mChart.setStartAtZero(false);
 else mChart.setStartAtZero(true);
mChart.invalidate();
break;
}
case R.id.actionToggleAdjustXLegend:
{
if (mChart.isAdjustXLegendEnabled()) mChart.setAdjustXLegend(false);
 else mChart.setAdjustXLegend(true);
mChart.invalidate();
break;
}
case R.id.actionSave:
{
mChart.saveToPath("String_Node_Str" + System.currentTimeMillis(),"String_Node_Str");
break;
}
}
return true;
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.actionToggleRound:
{
      if (mChart.isYLegendRounded())       mChart.setRoundedYLegend(false);
 else       mChart.setRoundedYLegend(true);
      mChart.invalidate();
      break;
    }
case R.id.actionToggleValues:
{
    if (mChart.isDrawValuesEnabled())     mChart.setDrawValues(false);
 else     mChart.setDrawValues(true);
    mChart.invalidate();
    break;
  }
case R.id.actionToggleFilled:
{
  if (mChart.isDrawFilledEnabled())   mChart.setDrawFilled(false);
 else   mChart.setDrawFilled(true);
  mChart.invalidate();
  break;
}
case R.id.actionToggleCircles:
{
if (mChart.isDrawCirclesEnabled()) mChart.setDrawCircles(false);
 else mChart.setDrawCircles(true);
mChart.invalidate();
break;
}
case R.id.actionToggleStartzero:
{
if (mChart.isStartAtZeroEnabled()) mChart.setStartAtZero(false);
 else mChart.setStartAtZero(true);
mChart.invalidate();
break;
}
case R.id.actionToggleAdjustXLegend:
{
if (mChart.isAdjustXLegendEnabled()) mChart.setAdjustXLegend(false);
 else mChart.setAdjustXLegend(true);
mChart.invalidate();
break;
}
case R.id.actionSave:
{
mChart.saveToPath("String_Node_Str" + System.currentTimeMillis(),"String_Node_Str");
break;
}
}
return true;
}
Program: 27086
Project: 27086
Buggy source:
/** 
 * draws the circle value indicators
 */
@Override protected void drawAdditional(){
  if (!mDrawAdditional)   return;
  if (mDrawCircles) {
    float[] positions=new float[mYVals.size() * 2];
    for (int i=0; i < positions.length; i+=2) {
      positions[i]=i / 2;
      positions[i + 1]=mYVals.get(i / 2);
    }
    transformPointArray(positions);
    for (int i=0; i < positions.length; i+=2) {
      mDrawCanvas.drawCircle(positions[i],positions[i + 1],mCircleSize,mCirclePaintOuter);
      mDrawCanvas.drawCircle(positions[i],positions[i + 1],mCircleSize / 2,mCirclePaintInner);
    }
  }
}

Fixed version (ground truth):
/** 
 * draws the circle value indicators
 */
@Override protected void drawAdditional(){
  if (mDrawCircles) {
    float[] positions=new float[mYVals.size() * 2];
    for (int i=0; i < positions.length; i+=2) {
      positions[i]=i / 2;
      positions[i + 1]=mYVals.get(i / 2);
    }
    transformPointArray(positions);
    for (int i=0; i < positions.length; i+=2) {
      mDrawCanvas.drawCircle(positions[i],positions[i + 1],mCircleSize,mCirclePaintOuter);
      mDrawCanvas.drawCircle(positions[i],positions[i + 1],mCircleSize / 2,mCirclePaintInner);
    }
  }
}
Program: 27087
Project: 27087
Buggy source:
public void isEqualTo(Node node){
  check("String_Node_Str",node).that(actual().checkTreeEquals(node)).isNull();
}

Fixed version (ground truth):
@Override public void isEqualTo(Object o){
  check().that(actual()).isInstanceOf(Node.class);
  Node node=(Node)o;
  check("String_Node_Str",node).that(actual().checkTreeEquals(node)).isNull();
}
Program: 27088
Project: 27088
Buggy source:
private void validateExpressionType(Node n){
switch (n.getToken()) {
case NAME:
    validateNameType(n);
  break;
case CALL:
if (!n.getFirstChild().isSuper()) {
  validateCallType(n);
}
break;
default :
expectSomeTypeInformation(n);
}
}

Fixed version (ground truth):
private void validateExpressionType(Node n){
switch (n.getToken()) {
case NAME:
    validateNameType(n);
  break;
case CALL:
if (!n.getFirstChild().isSuper()) {
  validateCallType(n);
}
break;
case SPREAD:
break;
default :
expectSomeTypeInformation(n);
}
}
Program: 27092
Project: 27092
Buggy source:
public void testClassSuperConstructorParameterMismatch(){
  testTypes(lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),"String_Node_Str" + "String_Node_Str");
}

Fixed version (ground truth):
public void testClassSuperConstructorParameterMismatch(){
  testTypes(lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),lines("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27093
Project: 27093
Buggy source:
/** 
 * Look at the   {@code extends} clause to find the instance type being extended.Returns  {@code null} if there is no such clause, and unknown if the type cannotbe determined.
 */
@Nullable private ObjectType findSuperClassFromNodes(Node extendsNode,@Nullable JSDocInfo info){
  if (extendsNode.isEmpty()) {
    return null;
  }
  JSType ctorType=extendsNode.getJSType();
  if (ctorType == null) {
    if (extendsNode.isQualifiedName()) {
      TypedVar var=currentScope.getVar(extendsNode.getQualifiedName());
      if (var != null) {
        ctorType=var.getType();
      }
    }
 else {
      if (info == null || !info.hasBaseType()) {
        report(JSError.make(extendsNode,DYNAMIC_EXTENDS_WITHOUT_JSDOC));
      }
    }
  }
  if (ctorType != null && (ctorType.isConstructor() || ctorType.isInterface())) {
    return ctorType.toMaybeFunctionType().getInstanceType();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Look at the   {@code extends} clause to find the instance type being extended.Returns  {@code null} if there is no such clause, and unknown if the type cannotbe determined.
 */
@Nullable private ObjectType findSuperClassFromNodes(Node extendsNode,@Nullable JSDocInfo info){
  if (extendsNode.isEmpty()) {
    return null;
  }
  JSType ctorType=extendsNode.getJSType();
  if (ctorType == null) {
    if (extendsNode.isQualifiedName()) {
      TypedVar var=currentScope.getVar(extendsNode.getQualifiedName());
      if (var != null) {
        ctorType=var.getType();
      }
      if (ctorType == null) {
        return ObjectType.cast(typeRegistry.getType(currentScope,extendsNode.getQualifiedName(),extendsNode.getSourceFileName(),extendsNode.getLineno(),extendsNode.getCharno()));
      }
    }
 else {
      if (info == null || !info.hasBaseType()) {
        report(JSError.make(extendsNode,DYNAMIC_EXTENDS_WITHOUT_JSDOC));
      }
    }
  }
  if (ctorType != null && (ctorType.isConstructor() || ctorType.isInterface())) {
    return ctorType.toMaybeFunctionType().getInstanceType();
  }
  return null;
}
Program: 27094
Project: 27094
Buggy source:
/** 
 * Returns true if this is a global this type. 
 */
public final boolean isGlobalThisType(){
  return this == registry.getNativeType(JSTypeNative.GLOBAL_THIS);
}

Fixed version (ground truth):
/** 
 * Returns true if this is a global this type. 
 */
public final boolean isGlobalThisType(){
  return areIdentical(this,registry.getNativeType(JSTypeNative.GLOBAL_THIS));
}
Program: 27095
Project: 27095
Buggy source:
/** 
 * A generic implementation meant to be used as a helper for common getLeastSupertype implementations.
 */
static JSType getLeastSupertype(JSType thisType,JSType thatType){
  boolean areEquivalent=thisType.isEquivalentTo(thatType);
  return areEquivalent ? thisType : filterNoResolvedType(thisType.registry.createUnionType(thisType,thatType));
}

Fixed version (ground truth):
/** 
 * A generic implementation meant to be used as a helper for common getLeastSupertype implementations.
 */
@SuppressWarnings("String_Node_Str") static JSType getLeastSupertype(JSType thisType,JSType thatType){
  boolean areEquivalent=thisType.isEquivalentTo(thatType);
  return areEquivalent ? thisType : filterNoResolvedType(thisType.registry.createUnionType(thisType,thatType));
}
Program: 27096
Project: 27096
Buggy source:
/** 
 * Null-safe version of toMaybeFunctionType().
 */
public static FunctionType toMaybeFunctionType(JSType type){
  return type == null ? null : type.toMaybeFunctionType();
}

Fixed version (ground truth):
/** 
 * Null-safe version of toMaybeFunctionType(). 
 */
@SuppressWarnings("String_Node_Str") public static FunctionType toMaybeFunctionType(JSType type){
  return type == null ? null : type.toMaybeFunctionType();
}
Program: 27097
Project: 27097
Buggy source:
/** 
 * Tests whether   {@code this} and {@code that} are meaningfullycomparable using shallow comparison. By meaningfully, we mean compatible types that are not rejected by step 1 of the definition of the Strict Equality Comparison Algorithm (11.9.6, page 56&ndash;57) of the ECMA-262 specification.<p>
 */
public final boolean canTestForShallowEqualityWith(JSType that){
  if (isEmptyType() || that.isEmptyType()) {
    return isSubtypeOf(that) || that.isSubtypeOf(this);
  }
  JSType inf=getGreatestSubtype(that);
  return !inf.isEmptyType() || inf == registry.getNativeType(JSTypeNative.LEAST_FUNCTION_TYPE);
}

Fixed version (ground truth):
/** 
 * Tests whether   {@code this} and {@code that} are meaningfullycomparable using shallow comparison. By meaningfully, we mean compatible types that are not rejected by step 1 of the definition of the Strict Equality Comparison Algorithm (11.9.6, page 56&ndash;57) of the ECMA-262 specification.<p>
 */
public final boolean canTestForShallowEqualityWith(JSType that){
  if (isEmptyType() || that.isEmptyType()) {
    return isSubtypeOf(that) || that.isSubtypeOf(this);
  }
  JSType inf=getGreatestSubtype(that);
  return !inf.isEmptyType() || areIdentical(inf,registry.getNativeType(JSTypeNative.LEAST_FUNCTION_TYPE));
}
Program: 27098
Project: 27098
Buggy source:
public final boolean isEmptyType(){
  return isNoType() || isNoObjectType() || isNoResolvedType()|| (registry.getNativeFunctionType(JSTypeNative.LEAST_FUNCTION_TYPE) == this);
}

Fixed version (ground truth):
public final boolean isEmptyType(){
  return isNoType() || isNoObjectType() || isNoResolvedType()|| areIdentical(this,registry.getNativeFunctionType(JSTypeNative.LEAST_FUNCTION_TYPE));
}