nus-yam/ex-repair huggingface dataset:
Program: 29759
Project: 29759
Buggy source:
public void sendItemCommand(String itemName,String command){
  try {
    StringEntity se=new StringEntity(command);
    mAsyncHttpClient.post(this,openHABBaseUrl + "String_Node_Str" + itemName,se,"String_Node_Str",new AsyncHttpResponseHandler(){
      @Override public void onSuccess(      String response){
        Log.d(TAG,"String_Node_Str");
      }
      @Override public void onFailure(      Throwable error,      String errorResponse){
        Log.e(TAG,"String_Node_Str" + error.getMessage());
        if (errorResponse != null)         Log.e(TAG,"String_Node_Str" + errorResponse);
      }
    }
);
  }
 catch (  UnsupportedEncodingException e) {
    if (e != null)     Log.e(TAG,e.getMessage());
  }
}

Fixed version (ground truth):
public void sendItemCommand(String itemName,String command){
  try {
    StringEntity se=new StringEntity(command);
    mAsyncHttpClient.post(this,openHABBaseUrl + "String_Node_Str" + itemName,se,"String_Node_Str",new AsyncHttpResponseHandler(){
      @Override public void onSuccess(      String response){
        Log.d(TAG,"String_Node_Str");
      }
      @Override public void onFailure(      Throwable error,      String errorResponse){
        Log.e(TAG,"String_Node_Str" + error.getMessage());
        if (errorResponse != null)         Log.e(TAG,"String_Node_Str" + errorResponse);
      }
    }
);
  }
 catch (  UnsupportedEncodingException e) {
    if (e.getMessage() != null)     Log.e(TAG,e.getMessage());
  }
}
Program: 29760
Project: 29760
Buggy source:
/** 
 * This method is called when activity receives a new intent while running
 */
@Override public void onNewIntent(Intent newIntent){
  if (newIntent.getAction() != null) {
    Log.d(TAG,"String_Node_Str" + newIntent.getAction().toString());
    if (newIntent.getAction().equals("String_Node_Str")) {
      Log.d(TAG,"String_Node_Str");
      if (newIntent.getDataString() != null) {
        Log.d(TAG,"String_Node_Str" + newIntent.getDataString());
        onNfcTag(newIntent.getDataString());
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * This method is called when activity receives a new intent while running
 */
@Override public void onNewIntent(Intent newIntent){
  if (newIntent.getAction() != null) {
    Log.d(TAG,"String_Node_Str" + newIntent.getAction());
    if (newIntent.getAction().equals("String_Node_Str")) {
      Log.d(TAG,"String_Node_Str");
      if (newIntent.getDataString() != null) {
        Log.d(TAG,"String_Node_Str" + newIntent.getDataString());
        onNfcTag(newIntent.getDataString());
      }
    }
  }
}
Program: 29764
Project: 29764
Buggy source:
@Override protected void onDestroy(){
  super.onDestroy();
  Log.d(TAG,"String_Node_Str" + this.displayPageUrl);
  if (pageAsyncHttpClient != null)   pageAsyncHttpClient.cancelRequests(this,true);
}

Fixed version (ground truth):
@Override protected void onDestroy(){
  super.onDestroy();
  Log.d(TAG,"String_Node_Str" + this.displayPageUrl);
  if (this.progressDialog != null)   this.progressDialog.dismiss();
  if (this.serviceResolver != null)   this.serviceResolver.interrupt();
  if (pageAsyncHttpClient != null)   pageAsyncHttpClient.cancelRequests(this,true);
}
Program: 29765
Project: 29765
Buggy source:
@Override public void onServiceResolveFailed(){
  progressDialog.dismiss();
  Log.i(TAG,"String_Node_Str");
  SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(this);
  openHABBaseUrl=normalizeUrl(settings.getString("String_Node_Str","String_Node_Str"));
  if (openHABBaseUrl.length() > 0) {
    Toast.makeText(getApplicationContext(),getString(R.string.info_conn_rem_url),Toast.LENGTH_SHORT).show();
    Log.i(TAG,"String_Node_Str" + openHABBaseUrl);
    showTime();
  }
 else {
    Toast.makeText(getApplicationContext(),getString(R.string.error_no_url),Toast.LENGTH_LONG).show();
  }
}

Fixed version (ground truth):
@Override public void onServiceResolveFailed(){
  if (progressDialog.isShowing())   progressDialog.dismiss();
  Log.i(TAG,"String_Node_Str");
  SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(this);
  openHABBaseUrl=normalizeUrl(settings.getString("String_Node_Str","String_Node_Str"));
  if (openHABBaseUrl.length() > 0) {
    Toast.makeText(getApplicationContext(),getString(R.string.info_conn_rem_url),Toast.LENGTH_SHORT).show();
    Log.i(TAG,"String_Node_Str" + openHABBaseUrl);
    showTime();
  }
 else {
    Toast.makeText(getApplicationContext(),getString(R.string.error_no_url),Toast.LENGTH_LONG).show();
  }
}
Program: 29766
Project: 29766
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  addPreferencesFromResource(R.xml.preferences);
  Preference urlPreference=getPreferenceScreen().findPreference("String_Node_Str");
  Preference altUrlPreference=getPreferenceScreen().findPreference("String_Node_Str");
  urlPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){
    @Override public boolean onPreferenceChange(    Preference preference,    Object newValue){
      String newUrl=(String)newValue;
      if (newUrl.length() == 0)       return true;
      if (urlIsValid(newUrl)) {
        return true;
      }
      showAlertDialog("String_Node_Str");
      return false;
    }
  }
);
  altUrlPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){
    @Override public boolean onPreferenceChange(    Preference preference,    Object newValue){
      String newUrl=(String)newValue;
      if (newUrl.length() == 0)       return true;
      if (urlIsValid(newUrl)) {
        return true;
      }
      showAlertDialog("String_Node_Str");
      return false;
    }
  }
);
  setResult(RESULT_OK);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  addPreferencesFromResource(R.xml.preferences);
  Preference urlPreference=getPreferenceScreen().findPreference("String_Node_Str");
  Preference altUrlPreference=getPreferenceScreen().findPreference("String_Node_Str");
  urlPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){
    @Override public boolean onPreferenceChange(    Preference preference,    Object newValue){
      Log.d("String_Node_Str","String_Node_Str" + (String)newValue);
      String newUrl=(String)newValue;
      if (newUrl.length() == 0)       return true;
      if (urlIsValid(newUrl)) {
        return true;
      }
      showAlertDialog(getString(R.string.erorr_invalid_url));
      return false;
    }
  }
);
  altUrlPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){
    @Override public boolean onPreferenceChange(    Preference preference,    Object newValue){
      String newUrl=(String)newValue;
      if (newUrl.length() == 0)       return true;
      if (urlIsValid(newUrl)) {
        return true;
      }
      showAlertDialog(getString(R.string.erorr_invalid_url));
      return false;
    }
  }
);
  setResult(RESULT_OK);
}
Program: 29767
Project: 29767
Buggy source:
@Override public boolean onPreferenceChange(Preference preference,Object newValue){
  String newUrl=(String)newValue;
  if (newUrl.length() == 0)   return true;
  if (urlIsValid(newUrl)) {
    return true;
  }
  showAlertDialog("String_Node_Str");
  return false;
}

Fixed version (ground truth):
@Override public boolean onPreferenceChange(Preference preference,Object newValue){
  String newUrl=(String)newValue;
  if (newUrl.length() == 0)   return true;
  if (urlIsValid(newUrl)) {
    return true;
  }
  showAlertDialog(getString(R.string.erorr_invalid_url));
  return false;
}
Program: 29768
Project: 29768
Buggy source:
private String normalizeUrl(String sourceUrl){
  String normalizedUrl="String_Node_Str";
  try {
    URL url=new URL(sourceUrl);
    normalizedUrl=url.toString();
    if (!normalizedUrl.endsWith("String_Node_Str"))     normalizedUrl=normalizedUrl + "String_Node_Str";
  }
 catch (  MalformedURLException e) {
    Log.d(TAG,"String_Node_Str");
  }
  return normalizedUrl;
}

Fixed version (ground truth):
private String normalizeUrl(String sourceUrl){
  String normalizedUrl="String_Node_Str";
  try {
    URL url=new URL(sourceUrl);
    normalizedUrl=url.toString();
    normalizedUrl=normalizedUrl.replace("String_Node_Str","String_Node_Str");
    normalizedUrl=normalizedUrl.replace("String_Node_Str","String_Node_Str");
    if (!normalizedUrl.endsWith("String_Node_Str"))     normalizedUrl=normalizedUrl + "String_Node_Str";
  }
 catch (  MalformedURLException e) {
    Log.d(TAG,"String_Node_Str");
  }
  return normalizedUrl;
}
Program: 29769
Project: 29769
Buggy source:
@Override public void onResume(){
  Log.i(TAG,"String_Node_Str");
  super.onResume();
  PendingIntent pendingIntent=PendingIntent.getActivity(this,0,new Intent(this,getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP),0);
  NfcAdapter.getDefaultAdapter(this).enableForegroundDispatch(this,pendingIntent,null,null);
}

Fixed version (ground truth):
@Override public void onResume(){
  Log.i(TAG,"String_Node_Str");
  super.onResume();
  PendingIntent pendingIntent=PendingIntent.getActivity(this,0,new Intent(this,getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP),0);
  if (NfcAdapter.getDefaultAdapter(this) != null)   NfcAdapter.getDefaultAdapter(this).enableForegroundDispatch(this,pendingIntent,null,null);
}
Program: 29770
Project: 29770
Buggy source:
@Override public void onNewIntent(Intent newIntent){
  Log.i(TAG,"String_Node_Str" + newIntent.toString());
  try {
    URI openhabURI=new URI(newIntent.getDataString());
    Log.i(TAG,openhabURI.getScheme());
    Log.i(TAG,openhabURI.getHost());
    Log.i(TAG,openhabURI.getPath());
    if (openhabURI.getHost().equals("String_Node_Str")) {
      Log.i(TAG,"String_Node_Str");
      String newPageUrl=this.openHABBaseUrl + "String_Node_Str" + openhabURI.getPath();
      Log.i(TAG,"String_Node_Str" + newPageUrl);
      navigateToPage(newPageUrl);
    }
  }
 catch (  URISyntaxException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void onNewIntent(Intent newIntent){
  Log.i(TAG,"String_Node_Str" + newIntent.toString());
  if (newIntent.getDataString() != null)   try {
    URI openhabURI=new URI(newIntent.getDataString());
    Log.i(TAG,openhabURI.getScheme());
    Log.i(TAG,openhabURI.getHost());
    Log.i(TAG,openhabURI.getPath());
    if (openhabURI.getHost().equals("String_Node_Str")) {
      Log.i(TAG,"String_Node_Str");
      String newPageUrl=this.openHABBaseUrl + "String_Node_Str" + openhabURI.getPath();
      Log.i(TAG,"String_Node_Str" + newPageUrl);
      navigateToPage(newPageUrl);
    }
  }
 catch (  URISyntaxException e) {
    e.printStackTrace();
  }
}
Program: 29771
Project: 29771
Buggy source:
public void writeTag(Tag tag,String openhabUri){
  Log.i(TAG,"String_Node_Str");
  Ndef ndef=Ndef.get(tag);
  if (ndef != null) {
    try {
      NdefRecord[] ndefRecords;
      ndefRecords=new NdefRecord[1];
      ndefRecords[0]=NdefRecord.createUri(openhabUri);
      NdefMessage message=new NdefMessage(ndefRecords);
      Log.i(TAG,"String_Node_Str");
      ndef.connect();
      Log.i(TAG,"String_Node_Str");
      if (ndef.isWritable()) {
        ndef.writeNdefMessage(message);
      }
      Log.i(TAG,"String_Node_Str");
      ndef.close();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
catch (    FormatException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void writeTag(Tag tag,String openhabUri){
  Log.i(TAG,"String_Node_Str");
  NdefRecord[] ndefRecords;
  ndefRecords=new NdefRecord[1];
  ndefRecords[0]=NdefRecord.createUri(openhabUri);
  NdefMessage message=new NdefMessage(ndefRecords);
  NdefFormatable ndefFormatable=NdefFormatable.get(tag);
  if (ndefFormatable != null) {
    Log.i(TAG,"String_Node_Str");
    try {
      ndefFormatable.connect();
      ndefFormatable.format(message);
      ndefFormatable.close();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
catch (    FormatException e) {
      e.printStackTrace();
    }
  }
 else {
    Log.i(TAG,"String_Node_Str");
    Ndef ndef=Ndef.get(tag);
    if (ndef != null) {
      try {
        Log.i(TAG,"String_Node_Str");
        ndef.connect();
        Log.i(TAG,"String_Node_Str");
        if (ndef.isWritable()) {
          ndef.writeNdefMessage(message);
        }
        Log.i(TAG,"String_Node_Str");
        ndef.close();
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
catch (      FormatException e) {
        e.printStackTrace();
      }
    }
  }
}
Program: 29772
Project: 29772
Buggy source:
@Override public void onResume(){
  Log.i(TAG,"String_Node_Str");
  super.onResume();
  PendingIntent pendingIntent=PendingIntent.getActivity(this,0,new Intent(this,getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP),0);
  NfcAdapter.getDefaultAdapter(this).enableForegroundDispatch(this,pendingIntent,null,null);
}

Fixed version (ground truth):
@Override public void onResume(){
  Log.i(TAG,"String_Node_Str");
  super.onResume();
  PendingIntent pendingIntent=PendingIntent.getActivity(this,0,new Intent(this,getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP),0);
  if (NfcAdapter.getDefaultAdapter(this) != null)   NfcAdapter.getDefaultAdapter(this).enableForegroundDispatch(this,pendingIntent,null,null);
}
Program: 29773
Project: 29773
Buggy source:
public float[] getStateAsHSV(){
  String[] stateSplit=state.split("String_Node_Str");
  if (stateSplit.length == 3) {
    float[] result={Float.parseFloat(stateSplit[0]),Float.parseFloat(stateSplit[1]),Float.parseFloat(stateSplit[2])};
    return result;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public float[] getStateAsHSV(){
  String[] stateSplit=state.split("String_Node_Str");
  if (stateSplit.length == 3) {
    float[] result={Float.parseFloat(stateSplit[0]),Float.parseFloat(stateSplit[1]) / 100,Float.parseFloat(stateSplit[2]) / 100};
    return result;
  }
 else {
    return null;
  }
}
Program: 29774
Project: 29774
Buggy source:
public void setHSVColor(float[] hsv){
  mAngle=this.colorToAngle(Color.HSVToColor(hsv));
  mSaturation=hsv[1];
  mBrightness=1 - hsv[2];
  mPointerColor.setColor(calculateColor(mAngle));
  updateBrightnessAndSaturation();
  postInvalidate();
}

Fixed version (ground truth):
public void setHSVColor(float[] hsv){
  Log.i("String_Node_Str",String.format("String_Node_Str",hsv[0],hsv[1],hsv[2]));
  mAngle=this.colorToAngle(Color.HSVToColor(hsv));
  mSaturation=hsv[1];
  mBrightness=1 - hsv[2];
  mPointerColor.setColor(calculateColor(mAngle));
  updateBrightnessAndSaturation();
  postInvalidate();
}
Program: 29775
Project: 29775
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  OnColorChangedListener l=new OnColorChangedListener(){
    public void colorChanged(    int color,    View v){
      mListener.colorChanged(color,v);
      dismiss();
    }
  }
;
  this.colorPickerView=new ColorPicker(getContext());
  if (this.tag != null)   this.colorPickerView.setTag(this.tag);
  setContentView(this.colorPickerView);
  setTitle("String_Node_Str");
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  OnColorChangedListener l=new OnColorChangedListener(){
    public void colorChanged(    int color,    View v){
      mListener.colorChanged(color,v);
      dismiss();
    }
  }
;
  this.colorPickerView=new ColorPicker(getContext());
  this.colorPickerView.setHSVColor(mInitialColor);
  if (this.tag != null)   this.colorPickerView.setTag(this.tag);
  setContentView(this.colorPickerView);
  setTitle("String_Node_Str");
}
Program: 29776
Project: 29776
Buggy source:
public ColorPickerDialog(Context context,OnColorChangedListener listener,int initialColor){
  super(context);
  mListener=listener;
  mInitialColor=initialColor;
}

Fixed version (ground truth):
public ColorPickerDialog(Context context,OnColorChangedListener listener,float[] initialColor){
  super(context);
  mListener=listener;
  mInitialColor=initialColor;
}
Program: 29778
Project: 29778
Buggy source:
public OpenHABWidgetAdapter(Context context,int resource,List<OpenHABWidget> objects){
  super(context,resource,objects);
  videoWidgetList=new ArrayList<VideoView>();
}

Fixed version (ground truth):
public OpenHABWidgetAdapter(Context context,int resource,List<OpenHABWidget> objects){
  super(context,resource,objects);
  videoWidgetList=new ArrayList<VideoView>();
  refreshImageList=new ArrayList<MySmartImageView>();
}
Program: 29783
Project: 29783
Buggy source:
@Override public void onFailure(Throwable e){
  if (e.getMessage() != null) {
    if (e.getMessage().equals("String_Node_Str")) {
      showAlertDialog("String_Node_Str");
    }
 else {
      showAlertDialog("String_Node_Str" + e.getMessage());
    }
  }
 else {
    showAlertDialog("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onFailure(Throwable e){
  if (e.getMessage() != null) {
    if (e.getMessage().equals("String_Node_Str")) {
      showAlertDialog("String_Node_Str");
    }
 else {
      showAlertDialog("String_Node_Str" + e.getMessage());
    }
  }
 else {
  }
}
Program: 29786
Project: 29786
Buggy source:
/** 
 * We run all openHAB browsing in a single activity, so we need to intercept 'Back' key to get back to previous sitemap page. If no pages in stack - simulate typical android app behaviour - exit application.
 */
@Override public boolean onKeyDown(int keyCode,KeyEvent event){
  Log.i(TAG,"String_Node_Str" + keyCode);
  if (keyCode == 4) {
    Log.i(TAG,"String_Node_Str");
    if (pageStack.size() > 0) {
      displayPageUrl=pageStack.get(0).getPageUrl();
      pageStack.remove(0);
      showPage(displayPageUrl,false);
    }
 else {
      Log.i(TAG,"String_Node_Str");
      finish();
    }
    return true;
  }
 else {
    return super.onKeyDown(keyCode,event);
  }
}

Fixed version (ground truth):
/** 
 * We run all openHAB browsing in a single activity, so we need to intercept 'Back' key to get back to previous sitemap page. If no pages in stack - simulate typical android app behaviour - exit application.
 */
@Override public boolean onKeyDown(int keyCode,KeyEvent event){
  Log.i(TAG,"String_Node_Str" + keyCode);
  if (keyCode == 4) {
    Log.i(TAG,"String_Node_Str");
    if (pageStack.size() > 0) {
      displayPageUrl=pageStack.get(0).getPageUrl();
      Log.i(TAG,String.format("String_Node_Str",pageStack.get(0).getWidgetListPosition()));
      widgetListPosition=pageStack.get(0).getWidgetListPosition();
      pageStack.remove(0);
      showPage(displayPageUrl,false);
    }
 else {
      Log.i(TAG,"String_Node_Str");
      finish();
    }
    return true;
  }
 else {
    return super.onKeyDown(keyCode,event);
  }
}
Program: 29788
Project: 29788
Buggy source:
@Override public void afterAll(ExtensionContext context) throws Exception {
  new CommonReportHelper().finishReport((ReportModel)context.getStore(NAMESPACE).get(REPORT_MODEL));
}

Fixed version (ground truth):
@Override public void afterAll(ExtensionContext context) throws Exception {
  ScenarioHolder.get().removeScenarioOfCurrentThread();
  new CommonReportHelper().finishReport((ReportModel)context.getStore(NAMESPACE).get(REPORT_MODEL));
}
Program: 29789
Project: 29789
Buggy source:
public void some_failing_step(){
  Assertions.assertTrue(false,"String_Node_Str");
}

Fixed version (ground truth):
public WhenStage some_failing_step(){
  Assertions.assertTrue(false,"String_Node_Str");
  return this;
}
Program: 29790
Project: 29790
Buggy source:
private <T>void updateScenarioState(T t){
  injector.updateValues(t);
}

Fixed version (ground truth):
private <T>void updateScenarioState(T t){
  try {
    injector.updateValues(t);
  }
 catch (  JGivenMissingRequiredScenarioStateException e) {
    if (!suppressExceptions) {
      throw e;
    }
  }
}
Program: 29791
Project: 29791
Buggy source:
@SuppressWarnings("String_Node_Str") public void updateValues(Object object){
  validateFields(object);
  for (  ScenarioStateField field : getScenarioFields(object)) {
    Object value=getValue(field);
    if (value != null) {
      try {
        field.getField().set(object,value);
      }
 catch (      IllegalAccessException e) {
        throw new RuntimeException("String_Node_Str" + field.getField(),e);
      }
      log.debug("String_Node_Str",field.getField(),value);
    }
 else     if (field.isRequired()) {
      throw new JGivenMissingRequiredScenarioStateException(field.getField());
    }
  }
}

Fixed version (ground truth):
/** 
 * @throws JGivenMissingRequiredScenarioStateException in case a field requiresa value and the value is not present
 */
@SuppressWarnings("String_Node_Str") public void updateValues(Object object){
  validateFields(object);
  for (  ScenarioStateField field : getScenarioFields(object)) {
    Object value=getValue(field);
    if (value != null) {
      try {
        field.getField().set(object,value);
      }
 catch (      IllegalAccessException e) {
        throw new RuntimeException("String_Node_Str" + field.getField(),e);
      }
      log.debug("String_Node_Str",field.getField(),value);
    }
 else     if (field.isRequired()) {
      throw new JGivenMissingRequiredScenarioStateException(field.getField());
    }
  }
}
Program: 29792
Project: 29792
Buggy source:
@Test @Ignore("String_Node_Str") @Pending public void required_does_not_fail_for_pending_scenarios() throws Throwable {
  when().some_action();
}

Fixed version (ground truth):
@Test @Pending public void required_does_not_fail_for_pending_scenarios() throws Throwable {
  when().some_action();
}
Program: 29793
Project: 29793
Buggy source:
public THEN then(String translatedGiven){
  addIntroWord(translatedGiven);
  return getThenStage();
}

Fixed version (ground truth):
public THEN then(String translatedThen){
  addIntroWord(translatedThen);
  return getThenStage();
}
Program: 29794
Project: 29794
Buggy source:
public WHEN when(String translatedGiven){
  addIntroWord(translatedGiven);
  return getWhenStage();
}

Fixed version (ground truth):
public WHEN when(String translatedWhen){
  addIntroWord(translatedWhen);
  return getWhenStage();
}
Program: 29795
Project: 29795
Buggy source:
private List<ColumnSpec> getColumnSpecs(List<List<String>> dataTableModel){
  ColumnSpec[] result=new ColumnSpec[dataTableModel.get(0).size()];
  for (int nrow=0; nrow < dataTableModel.size(); nrow++) {
    List<String> row=dataTableModel.get(nrow);
    for (int ncol=0; ncol < row.size(); ncol++) {
      String value=row.get(ncol);
      int width=value.length();
      ColumnSpec spec=result[ncol];
      if (spec == null) {
        spec=new ColumnSpec();
        result[ncol]=spec;
      }
      if (width > spec.width) {
        spec.width=width;
      }
      if (nrow > 0 && Doubles.tryParse(value) == null) {
        spec.leftAligned=true;
      }
    }
  }
  return Lists.newArrayList(result);
}

Fixed version (ground truth):
private List<ColumnSpec> getColumnSpecs(List<List<String>> dataTableModel){
  ColumnSpec[] result=new ColumnSpec[dataTableModel.get(0).size()];
  for (int nrow=0; nrow < dataTableModel.size(); nrow++) {
    List<String> row=dataTableModel.get(nrow);
    for (int ncol=0; ncol < row.size(); ncol++) {
      String value=row.get(ncol);
      int width=Math.max(value.length(),1);
      ColumnSpec spec=result[ncol];
      if (spec == null) {
        spec=new ColumnSpec();
        result[ncol]=spec;
      }
      if (width > spec.width) {
        spec.width=width;
      }
      if (nrow > 0 && Doubles.tryParse(value) == null) {
        spec.leftAligned=true;
      }
    }
  }
  return Lists.newArrayList(result);
}
Program: 29796
Project: 29796
Buggy source:
static private Collection<List<String>> splitRow(List<String> row){
  List<List<String>> columns=Lists.newArrayListWithExpectedSize(row.size());
  int nRows=0;
  for (  String cell : row) {
    List<String> lines=FluentIterable.from(Splitter.on('\n').split(cell)).toList();
    if (lines.size() > nRows) {
      nRows=lines.size();
    }
    columns.add(lines);
  }
  List<List<String>> rows=Lists.newArrayListWithCapacity(nRows);
  for (int iRow=0; iRow < nRows; iRow++) {
    List<String> newRow=Lists.newArrayListWithExpectedSize(row.size());
    for (int iCol=0; iCol < columns.size(); iCol++) {
      List<String> column=columns.get(iCol);
      String cell="String_Node_Str";
      if (iRow < column.size()) {
        cell=column.get(iRow);
      }
      newRow.add(cell);
    }
    rows.add(newRow);
  }
  return rows;
}

Fixed version (ground truth):
static private Collection<List<String>> splitRow(List<String> row){
  List<List<String>> columns=Lists.newArrayListWithExpectedSize(row.size());
  int nRows=0;
  for (  String cell : row) {
    List<String> lines=FluentIterable.from(Splitter.onPattern("String_Node_Str").split(cell)).toList();
    if (lines.size() > nRows) {
      nRows=lines.size();
    }
    columns.add(lines);
  }
  List<List<String>> rows=Lists.newArrayListWithCapacity(nRows);
  for (int iRow=0; iRow < nRows; iRow++) {
    List<String> newRow=Lists.newArrayListWithExpectedSize(row.size());
    for (int iCol=0; iCol < columns.size(); iCol++) {
      List<String> column=columns.get(iCol);
      String cell="String_Node_Str";
      if (iRow < column.size()) {
        cell=column.get(iRow);
      }
      newRow.add(cell);
    }
    rows.add(newRow);
  }
  return rows;
}
Program: 29797
Project: 29797
Buggy source:
@Test public void handleNewLinesOneNewLine() throws Exception {
  String[][] testData=new String[][]{{"String_Node_Str","String_Node_Str"}};
  List<List<String>> result=PlainTextTableWriter.handleNewLines(toListOfList(testData));
  List<List<String>> expected=toListOfList(new String[][]{{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"}});
  assertThat(result).isEqualTo(expected);
}

Fixed version (ground truth):
@Test @DataProvider({"String_Node_Str","String_Node_Str"}) public void handleNewLinesOneNewLine(String testString) throws Exception {
  String[][] testData=new String[][]{{testString,"String_Node_Str"}};
  List<List<String>> result=PlainTextTableWriter.handleNewLines(toListOfList(testData));
  List<List<String>> expected=toListOfList(new String[][]{{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"}});
  assertThat(result).isEqualTo(expected);
}
Program: 29798
Project: 29798
Buggy source:
private boolean wordsAreDifferent(StepModel firstStep,StepModel stepModel){
  for (int iWord=0; iWord < firstStep.getWords().size(); iWord++) {
    Word firstWord=firstStep.getWord(iWord);
    Word word=stepModel.getWord(iWord);
    if (firstWord.isArg() != word.isArg()) {
      return true;
    }
    if (!firstWord.isArg() && !firstWord.getValue().equals(word.getValue())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean wordsAreDifferent(StepModel firstStep,StepModel stepModel){
  for (int iWord=0; iWord < firstStep.getWords().size(); iWord++) {
    Word firstWord=firstStep.getWord(iWord);
    Word word=stepModel.getWord(iWord);
    if (firstWord.isArg() != word.isArg()) {
      return true;
    }
    if (!firstWord.isArg() && !firstWord.getValue().equals(word.getValue())) {
      return true;
    }
    if (firstWord.isArg() && firstWord.isDataTable() && !firstWord.getArgumentInfo().getDataTable().equals(word.getArgumentInfo().getDataTable())) {
      return true;
    }
  }
  return false;
}
Program: 29799
Project: 29799
Buggy source:
/** 
 * Returns a list with argument words that are not equal in all cases
 */
List<List<Word>> getDifferentArguments(List<List<Word>> argumentWords){
  List<List<Word>> result=Lists.newArrayList();
  for (int i=0; i < argumentWords.size(); i++) {
    result.add(Lists.<Word>newArrayList());
  }
  int nWords=argumentWords.get(0).size();
  for (int iWord=0; iWord < nWords; iWord++) {
    Word wordOfFirstCase=argumentWords.get(0).get(iWord);
    boolean different=false;
    for (int iCase=1; iCase < argumentWords.size(); iCase++) {
      Word wordOfCase=argumentWords.get(iCase).get(iWord);
      if (!wordOfCase.getFormattedValue().equals(wordOfFirstCase.getFormattedValue())) {
        different=true;
        break;
      }
    }
    if (different) {
      for (int iCase=0; iCase < argumentWords.size(); iCase++) {
        result.get(iCase).add(argumentWords.get(iCase).get(iWord));
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Returns a list with argument words that are not equal in all cases
 */
List<List<Word>> getDifferentArguments(List<List<Word>> argumentWords){
  List<List<Word>> result=Lists.newArrayList();
  for (int i=0; i < argumentWords.size(); i++) {
    result.add(Lists.<Word>newArrayList());
  }
  int nWords=argumentWords.get(0).size();
  for (int iWord=0; iWord < nWords; iWord++) {
    Word wordOfFirstCase=argumentWords.get(0).get(iWord);
    if (wordOfFirstCase.isDataTable()) {
      continue;
    }
    boolean different=false;
    for (int iCase=1; iCase < argumentWords.size(); iCase++) {
      Word wordOfCase=argumentWords.get(iCase).get(iWord);
      if (!wordOfCase.getFormattedValue().equals(wordOfFirstCase.getFormattedValue())) {
        different=true;
        break;
      }
    }
    if (different) {
      for (int iCase=0; iCase < argumentWords.size(); iCase++) {
        result.get(iCase).add(argumentWords.get(iCase).get(iWord));
      }
    }
  }
  return result;
}
Program: 29800
Project: 29800
Buggy source:
private static Iterable<?> toIterable(Object value){
  if (value instanceof Iterable<?>) {
    return (Iterable<?>)value;
  }
  if (value.getClass().isArray()) {
    Object[] array=(Object[])value;
    return Arrays.asList(array);
  }
  return null;
}

Fixed version (ground truth):
private static Iterable<?> toIterable(Object value){
  if (value instanceof Iterable<?>) {
    return (Iterable<?>)value;
  }
  if (value.getClass().isArray()) {
    return arrayToList(value);
  }
  return null;
}
Program: 29801
Project: 29801
Buggy source:
public void analyze(ScenarioModel scenarioModel){
  if (scenarioModel.getScenarioCases().size() < 2) {
    return;
  }
  CollectPhase collectPhase=new CollectPhase(scenarioModel);
  scenarioModel.accept(collectPhase);
  try {
    reduceMatrix(scenarioModel,collectPhase.argumentMatrix);
    scenarioModel.setCasesAsTable(allStepsEqual(collectPhase.allWords));
    if (!scenarioModel.isCasesAsTable()) {
      new CaseDifferenceAnalyzer().analyze(scenarioModel);
    }
  }
 catch (  IndexOutOfBoundsException e) {
    log.info("String_Node_Str" + scenarioModel.getClassName() + "String_Node_Str"+ scenarioModel.getTestMethodName()+ "String_Node_Str"+ "String_Node_Str");
    scenarioModel.setCasesAsTable(false);
  }
}

Fixed version (ground truth):
public void analyze(ScenarioModel scenarioModel){
  if (scenarioModel.getScenarioCases().size() < 2) {
    return;
  }
  CollectPhase collectPhase=new CollectPhase(scenarioModel);
  scenarioModel.accept(collectPhase);
  if (collectPhase.noDataTablePossible) {
    scenarioModel.setCasesAsTable(false);
    return;
  }
  try {
    reduceMatrix(scenarioModel,collectPhase.argumentMatrix);
    scenarioModel.setCasesAsTable(allStepsEqual(collectPhase.allWords));
    if (!scenarioModel.isCasesAsTable()) {
      new CaseDifferenceAnalyzer().analyze(scenarioModel);
    }
  }
 catch (  IndexOutOfBoundsException e) {
    log.info("String_Node_Str" + scenarioModel.getClassName() + "String_Node_Str"+ scenarioModel.getTestMethodName()+ "String_Node_Str"+ "String_Node_Str");
    scenarioModel.setCasesAsTable(false);
  }
}
Program: 29802
Project: 29802
Buggy source:
@Override public void visit(StepModel stepModel){
  for (  Word word : stepModel.words) {
    if (word.isArg()) {
      ArgumentHolder holder=new ArgumentHolder();
      holder.word=word;
      holder.params=getMatchingParameters(word);
      argumentsOfCurrentCase.add(holder);
    }
    allWordsOfCurrentCase.add(word);
  }
}

Fixed version (ground truth):
@Override public void visit(StepModel stepModel){
  if (stepModel.getAttachment() != null && stepModel.getAttachment().isShowDirectly()) {
    this.noDataTablePossible=true;
  }
  for (  Word word : stepModel.words) {
    if (word.isArg()) {
      ArgumentHolder holder=new ArgumentHolder();
      holder.word=word;
      holder.params=getMatchingParameters(word);
      argumentsOfCurrentCase.add(holder);
    }
    allWordsOfCurrentCase.add(word);
  }
}
Program: 29803
Project: 29803
Buggy source:
private void drawOval(int width,int height) throws IOException {
  BufferedImage image=new BufferedImage(width,height,BufferedImage.TYPE_INT_ARGB);
  Graphics2D g=image.createGraphics();
  g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  g.setStroke(new BasicStroke(10));
  g.setPaint(Color.BLUE);
  g.drawOval(10,10,width - 20,height - 20);
  ByteArrayOutputStream outputStream=new ByteArrayOutputStream();
  try {
    ImageIO.write(image,"String_Node_Str",outputStream);
    byte[] bytes=outputStream.toByteArray();
    currentStep.addAttachment(Attachment.fromBinaryBytes(bytes,MediaType.PNG).withTitle("String_Node_Str").showDirectly());
  }
  finally {
    outputStream.close();
  }
}

Fixed version (ground truth):
private void drawOval(int width,int height,Color color) throws IOException {
  BufferedImage image=new BufferedImage(width,height,BufferedImage.TYPE_INT_ARGB);
  Graphics2D g=image.createGraphics();
  g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  g.setStroke(new BasicStroke(10));
  g.setPaint(color);
  g.drawOval(10,10,width - 20,height - 20);
  ByteArrayOutputStream outputStream=new ByteArrayOutputStream();
  try {
    ImageIO.write(image,"String_Node_Str",outputStream);
    byte[] bytes=outputStream.toByteArray();
    currentStep.addAttachment(Attachment.fromBinaryBytes(bytes,MediaType.PNG).withTitle("String_Node_Str").showDirectly());
  }
  finally {
    outputStream.close();
  }
}
Program: 29804
Project: 29804
Buggy source:
public void an_oval_circle() throws IOException {
  drawOval(300,200);
}

Fixed version (ground truth):
public void an_oval_circle() throws IOException {
  drawOval(300,200,Color.BLUE);
}
Program: 29805
Project: 29805
Buggy source:
public void a_large_oval_circle() throws IOException {
  drawOval(800,600);
}

Fixed version (ground truth):
public void a_large_oval_circle() throws IOException {
  drawOval(800,600,Color.BLUE);
}
Program: 29806
Project: 29806
Buggy source:
public SELF the_tag_with_name_$_is_clicked(String tagName){
  List<WebElement> links=webDriver.findElements(By.linkText(tagName));
  for (  WebElement link : links) {
    WebElement tag=link.findElement(By.className("String_Node_Str"));
    if (tag != null) {
      link.click();
      break;
    }
  }
  return self();
}

Fixed version (ground truth):
public SELF the_tag_with_name_$_is_clicked(String tagName){
  List<WebElement> links=webDriver.findElements(By.xpath(String.format("String_Node_Str",tagName)));
  links.get(0).click();
  return self();
}
Program: 29807
Project: 29807
Buggy source:
/** 
 * Creates a   {@code DataTable} with {@code numberOfColumns} columns from the given {@code data} including the header <p/> Example: <pre> table(2, "name", "age", // header "Peter", 20,   // first row of data "Susan", 35);  // second row of data </pre>
 * @param numberOfColumns the number of columns the resulting table should have
 * @param data            the data of the table represented as a one-dimensional list,the number of entries must be a multiple of  {@code numberOfColumns}. The first   {@numberOfColumns} elements are taken as the header of the table,the remaining values as data
 * @return a list of list that contains the same data as {@code data}, but in a two-dimensional form
 * @throws java.lang.IllegalArgumentException if {@code data.length % numberOfColumns != 0} 
 */
public static Iterable<? extends Iterable<?>> table(int numberOfColumns,Object... data){
  if (data.length % numberOfColumns != 0) {
    throw new IllegalArgumentException("String_Node_Str" + data.length + "String_Node_Str"+ numberOfColumns);
  }
  return Iterables.partition(Arrays.asList(data),numberOfColumns);
}

Fixed version (ground truth):
/** 
 * Creates a   {@code DataTable} with {@code numberOfColumns} columns from the given {@code data} including the header <p/> Example: <pre> table(2, "name", "age", // header "Peter", 20,   // first row of data "Susan", 35);  // second row of data </pre>
 * @param numberOfColumns the number of columns the resulting table should have
 * @param data            the data of the table represented as a one-dimensional list,the number of entries must be a multiple of  {@code numberOfColumns}. The first   {@code numberOfColumns} elements are taken as the header of the table,the remaining values as data
 * @return a list of list that contains the same data as {@code data}, but in a two-dimensional form
 * @throws java.lang.IllegalArgumentException if {@code data.length % numberOfColumns != 0} 
 */
public static Iterable<? extends Iterable<?>> table(int numberOfColumns,Object... data){
  if (data.length % numberOfColumns != 0) {
    throw new IllegalArgumentException("String_Node_Str" + data.length + "String_Node_Str"+ numberOfColumns);
  }
  return Iterables.partition(Arrays.asList(data),numberOfColumns);
}
Program: 29808
Project: 29808
Buggy source:
private boolean hasMultipleExplicitCases(){
  return !this.scenarioCase.getExplicitArguments().isEmpty() && !scenarioModel.isCasesAsTable();
}

Fixed version (ground truth):
private boolean hasMultipleExplicitCases(){
  return scenarioModel.getScenarioCases().size() > 1 && !scenarioModel.isCasesAsTable();
}
Program: 29809
Project: 29809
Buggy source:
@Override public void visitEnd(ScenarioCaseModel scenarioCase){
  if (!scenarioCase.success) {
    writer.println("String_Node_Str" + scenarioCase.errorMessage + "String_Node_Str");
  }
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
}

Fixed version (ground truth):
@Override public void visitEnd(ScenarioCaseModel scenarioCase){
  if (!scenarioCase.success) {
    writer.println("String_Node_Str" + scenarioCase.errorMessage + "String_Node_Str");
  }
  writer.println("String_Node_Str");
  if (hasMultipleExplicitCases()) {
    writer.println("String_Node_Str");
  }
  writer.println("String_Node_Str");
}
Program: 29810
Project: 29810
Buggy source:
@Override public void visit(StepModel stepModel){
  String intro="String_Node_Str";
  List<Word> words=stepModel.words;
  if (words.get(0).isIntroWord()) {
    intro=withColor(Color.BLUE,Attribute.INTENSITY_BOLD,INDENT + String.format("String_Node_Str" + maxFillWordLength + "String_Node_Str",WordUtil.capitalize(words.get(0).getValue())));
  }
 else {
    intro=INDENT + words.get(0).getValue();
  }
  String rest=joinWords(words.subList(1,words.size()));
  if (stepModel.isNotImplementedYet()) {
    rest=withColor(Color.BLACK,true,Attribute.INTENSITY_FAINT,rest + "String_Node_Str");
  }
 else   if (stepModel.isSkipped()) {
    rest=withColor(Color.BLACK,true,Attribute.INTENSITY_FAINT,rest + "String_Node_Str");
  }
 else   if (stepModel.isFailed()) {
    rest=withColor(Color.RED,true,Attribute.INTENSITY_FAINT,rest);
    rest+=withColor(Color.RED,true,Attribute.INTENSITY_BOLD,"String_Node_Str");
  }
  writer.println(intro + rest);
}

Fixed version (ground truth):
@Override public void visit(StepModel stepModel){
  String intro="String_Node_Str";
  List<Word> words=stepModel.words;
  if (words.get(0).isIntroWord()) {
    intro=withColor(Color.BLUE,Attribute.INTENSITY_BOLD,INDENT + String.format("String_Node_Str" + maxFillWordLength + "String_Node_Str",WordUtil.capitalize(words.get(0).getValue())));
  }
 else {
    intro=INDENT + words.get(0).getValue() + "String_Node_Str";
  }
  String rest=joinWords(words.subList(1,words.size()));
  if (stepModel.isNotImplementedYet()) {
    rest=withColor(Color.BLACK,true,Attribute.INTENSITY_FAINT,rest + "String_Node_Str");
  }
 else   if (stepModel.isSkipped()) {
    rest=withColor(Color.BLACK,true,Attribute.INTENSITY_FAINT,rest + "String_Node_Str");
  }
 else   if (stepModel.isFailed()) {
    rest=withColor(Color.RED,true,Attribute.INTENSITY_FAINT,rest);
    rest+=withColor(Color.RED,true,Attribute.INTENSITY_BOLD,"String_Node_Str");
  }
  writer.println(intro + rest);
}
Program: 29811
Project: 29811
Buggy source:
private void writeStatistics(){
  printWriter.write("String_Node_Str" + statistics.numClasses + "String_Node_Str");
  printWriter.write("String_Node_Str" + statistics.numScenarios + "String_Node_Str");
  printWriter.write("String_Node_Str" + statistics.numCases + "String_Node_Str");
  printWriter.write("String_Node_Str" + statistics.numFailedCases + "String_Node_Str");
  printWriter.write("String_Node_Str" + statistics.numSteps + "String_Node_Str");
  printWriter.write("String_Node_Str" + DurationFormatter.format(statistics.durationInNanos) + "String_Node_Str");
  printWriter.write("String_Node_Str" + DurationFormatter.format(statistics.durationInNanos / statistics.numCases));
}

Fixed version (ground truth):
private void writeStatistics(){
  printWriter.write("String_Node_Str" + statistics.numClasses + "String_Node_Str");
  printWriter.write("String_Node_Str" + statistics.numScenarios + "String_Node_Str");
  printWriter.write("String_Node_Str" + statistics.numCases + "String_Node_Str");
  printWriter.write("String_Node_Str" + statistics.numFailedCases + "String_Node_Str");
  printWriter.write("String_Node_Str" + statistics.numSteps + "String_Node_Str");
  printWriter.write("String_Node_Str" + DurationFormatter.format(statistics.durationInNanos) + "String_Node_Str");
  long averageNanos=statistics.numCases != 0 ? statistics.durationInNanos / statistics.numCases : 0;
  printWriter.write("String_Node_Str" + DurationFormatter.format(averageNanos));
}
Program: 29812
Project: 29812
Buggy source:
protected void starting(Statement base,FrameworkMethod testMethod,Object target){
  scenario.setModel(reportRule.getTestCaseModel());
  scenario.getExecutor().injectSteps(testInstance);
  Class<?> testClass=target.getClass();
  ReportModelBuilder modelBuilder=scenario.getModelBuilder();
  modelBuilder.setClassName(testClass.getName());
  scenario.getExecutor().startScenario(testMethod.getMethod(),getNamedArguments(base,testMethod,target));
  scenario.getExecutor().readScenarioState(testInstance);
}

Fixed version (ground truth):
protected void starting(Statement base,FrameworkMethod testMethod,Object target){
  scenario.setModel(reportRule.getTestCaseModel());
  scenario.getExecutor().injectSteps(testInstance);
  Class<?> testClass=target.getClass();
  ReportModelBuilder modelBuilder=scenario.getModelBuilder();
  modelBuilder.setTestClass(testClass);
  scenario.getExecutor().startScenario(testMethod.getMethod(),getNamedArguments(base,testMethod,target));
  scenario.getExecutor().readScenarioState(testInstance);
}
Program: 29813
Project: 29813
Buggy source:
@Override public void onTestStart(ITestResult paramITestResult){
  Object instance=paramITestResult.getInstance();
  scenarioCollectionModel.setClassName(instance.getClass().getName());
  if (instance instanceof ScenarioTestBase<?,?,?>) {
    ScenarioTestBase<?,?,?> testInstance=(ScenarioTestBase<?,?,?>)instance;
    scenario=testInstance.createNewScenario();
  }
 else {
    scenario=new ScenarioBase();
  }
  scenario.setModel(scenarioCollectionModel);
  Method method=paramITestResult.getMethod().getConstructorOrMethod().getMethod();
  scenario.getExecutor().startScenario(method,getArgumentsFrom(method,paramITestResult));
}

Fixed version (ground truth):
@Override public void onTestStart(ITestResult paramITestResult){
  Object instance=paramITestResult.getInstance();
  ReportModelBuilder builder=new ReportModelBuilder(scenarioCollectionModel);
  builder.setTestClass(instance.getClass());
  if (instance instanceof ScenarioTestBase<?,?,?>) {
    ScenarioTestBase<?,?,?> testInstance=(ScenarioTestBase<?,?,?>)instance;
    scenario=testInstance.createNewScenario();
  }
 else {
    scenario=new ScenarioBase();
  }
  scenario.setModel(scenarioCollectionModel);
  Method method=paramITestResult.getMethod().getConstructorOrMethod().getMethod();
  scenario.getExecutor().startScenario(method,getArgumentsFrom(method,paramITestResult));
}
Program: 29814
Project: 29814
Buggy source:
public TestScenario(String testMethod){
  this.testMethod=testMethod;
}

Fixed version (ground truth):
public TestScenario(String testMethod){
  this.testMethod=testMethod;
  this.testClass=TestScenarios.class;
}
Program: 29815
Project: 29815
Buggy source:
public boolean matches(ScenarioCriteria criteria){
  if (notImplementedYet != criteria.notImplementedYet) {
    return false;
  }
  if (failIfPassed != null && !failIfPassed.equals(criteria.failIfPassed)) {
    return false;
  }
  if (executeSteps != null && !executeSteps.equals(criteria.executeSteps)) {
    return false;
  }
  if (failing != criteria.failing) {
    return false;
  }
  if (numberOfSteps != null && numberOfSteps != criteria.numberOfSteps) {
    return false;
  }
  if (numberOfFailingStages != null && numberOfFailingStages != criteria.numberOfFailingStages) {
    return false;
  }
  if (failingStep != null && !failingStep.equals(criteria.failingStep)) {
    return false;
  }
  if (stageWithFailingAfterStageMethod != null && !stageWithFailingAfterStageMethod.equals(criteria.stageWithFailingAfterStageMethod)) {
    return false;
  }
  if (tagAnnotation != null && !tagAnnotation.equals(criteria.tagAnnotation)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean matches(ScenarioCriteria criteria){
  if (notImplementedYet != criteria.notImplementedYet) {
    return false;
  }
  if (failIfPassed != null && !failIfPassed.equals(criteria.failIfPassed)) {
    return false;
  }
  if (executeSteps != null && !executeSteps.equals(criteria.executeSteps)) {
    return false;
  }
  if (failing != criteria.failing) {
    return false;
  }
  if (numberOfSteps != null && numberOfSteps != criteria.numberOfSteps) {
    return false;
  }
  if (numberOfFailingStages != null && numberOfFailingStages != criteria.numberOfFailingStages) {
    return false;
  }
  if (failingStep != null && !failingStep.equals(criteria.failingStep)) {
    return false;
  }
  if (stageWithFailingAfterStageMethod != null && !stageWithFailingAfterStageMethod.equals(criteria.stageWithFailingAfterStageMethod)) {
    return false;
  }
  if (tagAnnotation != null && !tagAnnotation.equals(criteria.tagAnnotation)) {
    return false;
  }
  if (parameterizedRunner != null && !parameterizedRunner.equals(criteria.parameterizedRunner)) {
    return false;
  }
  if (numberOfParameters != null && numberOfParameters != criteria.numberOfParameters) {
    return false;
  }
  if (testClassDescription != null && !testClassDescription.equals(criteria.testClassDescription)) {
    return false;
  }
  return true;
}
Program: 29816
Project: 29816
Buggy source:
private static ScenarioCriteria addTestScenario(List<TestScenario> list,String testMethod){
  TestScenario testScenario=new TestScenario(testMethod);
  list.add(testScenario);
  return testScenario.criteria;
}

Fixed version (ground truth):
private static ScenarioCriteria addTestScenario(List<TestScenario> list,Class<?> testClass,String testMethod){
  TestScenario testScenario=new TestScenario(testClass);
  testScenario.testMethod=testMethod;
  list.add(testScenario);
  return testScenario.criteria;
}