nus-yam/ex-repair huggingface dataset:
Program: 57644
Project: 57644
Buggy source:
@Override public void onClick(View v){
  TextView tempToken=(TextView)view.findViewById(R.id.token);
  String token=tempToken.getText().toString();
  SharedPreferences preferences=getActivity().getSharedPreferences(PREF_FILE_NAME,Context.MODE_PRIVATE);
  SharedPreferences.Editor editor=preferences.edit();
  editor.putString("String_Node_Str",token);
  editor.commit();
  mListener.onTokenDialogPositiveClick();
  dismiss();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  TextView tempToken=(TextView)view.findViewById(R.id.token);
  String token=tempToken.getText().toString();
  SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(getView().getContext());
  SharedPreferences.Editor editor=preferences.edit();
  editor.putString("String_Node_Str",token);
  editor.commit();
  mListener.onTokenDialogPositiveClick();
  dismiss();
}
Program: 57645
Project: 57645
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  getDialog().setTitle(R.string.title_dialog_token);
  final View view=getActivity().getLayoutInflater().inflate(R.layout.dialog_token,null);
  final Button dismissBtn=(Button)view.findViewById(R.id.token_cancel_btn);
  dismissBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      mListener.onTokenDialogNegativeClick();
      dismiss();
    }
  }
);
  Button goSettingsBtn=(Button)view.findViewById(R.id.token_submit_btn);
  goSettingsBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      TextView tempToken=(TextView)view.findViewById(R.id.token);
      String token=tempToken.getText().toString();
      SharedPreferences preferences=getActivity().getSharedPreferences(PREF_FILE_NAME,Context.MODE_PRIVATE);
      SharedPreferences.Editor editor=preferences.edit();
      editor.putString("String_Node_Str",token);
      editor.commit();
      mListener.onTokenDialogPositiveClick();
      dismiss();
    }
  }
);
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  getDialog().setTitle(R.string.title_dialog_token);
  final View view=getActivity().getLayoutInflater().inflate(R.layout.dialog_token,null);
  final Button dismissBtn=(Button)view.findViewById(R.id.token_cancel_btn);
  dismissBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      mListener.onTokenDialogNegativeClick();
      dismiss();
    }
  }
);
  Button goSettingsBtn=(Button)view.findViewById(R.id.token_submit_btn);
  goSettingsBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      TextView tempToken=(TextView)view.findViewById(R.id.token);
      String token=tempToken.getText().toString();
      SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(getView().getContext());
      SharedPreferences.Editor editor=preferences.edit();
      editor.putString("String_Node_Str",token);
      editor.commit();
      mListener.onTokenDialogPositiveClick();
      dismiss();
    }
  }
);
  return view;
}
Program: 57646
Project: 57646
Buggy source:
@Override public void onWorkaroundPositiveClick(){
  final SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  final View checkboxView=getLayoutInflater().inflate(R.layout.dialog_workaroundwarning,null);
  CheckBox dontShowAgain=(CheckBox)checkboxView.findViewById(R.id.neverAgain);
  if (dontShowAgain.isChecked()) {
    Log.i(TAG,"String_Node_Str");
    SharedPreferences.Editor editor=preferences.edit();
    editor.putBoolean("String_Node_Str",true);
    editor.apply();
  }
  startActivity(new Intent(MainActivity.this,AboutWorkaroundActivity.class));
}

Fixed version (ground truth):
@Override public void onWorkaroundPositiveClick(View v){
  final SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  CheckBox dontShowAgain=(CheckBox)v.findViewById(R.id.neverAgain);
  if (dontShowAgain.isChecked()) {
    Log.i(TAG,"String_Node_Str");
    SharedPreferences.Editor editor=preferences.edit();
    editor.putBoolean("String_Node_Str",true);
    editor.apply();
  }
  startActivity(new Intent(MainActivity.this,AboutWorkaroundActivity.class));
}
Program: 57647
Project: 57647
Buggy source:
@Override public void onWorkaroundNegativeClick(){
  final SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  final View checkboxView=getLayoutInflater().inflate(R.layout.dialog_workaroundwarning,null);
  CheckBox dontShowAgain=(CheckBox)checkboxView.findViewById(R.id.neverAgain);
  if (dontShowAgain.isChecked()) {
    Log.i(TAG,"String_Node_Str");
    SharedPreferences.Editor editor=preferences.edit();
    editor.putBoolean("String_Node_Str",true);
    editor.apply();
  }
}

Fixed version (ground truth):
@Override public void onWorkaroundNegativeClick(View v){
  final SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  CheckBox dontShowAgain=(CheckBox)v.findViewById(R.id.neverAgain);
  if (dontShowAgain.isChecked()) {
    Log.i(TAG,"String_Node_Str");
    SharedPreferences.Editor editor=preferences.edit();
    editor.putBoolean("String_Node_Str",true);
    editor.apply();
  }
}
Program: 57648
Project: 57648
Buggy source:
@Override public void onClick(View v){
  mListener.onWorkaroundPositiveClick();
  dismiss();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  mListener.onWorkaroundPositiveClick(pushDialogView);
  dismiss();
}
Program: 57649
Project: 57649
Buggy source:
public void onWorkaroundPositiveClick();

Fixed version (ground truth):
public void onWorkaroundPositiveClick(View v);
Program: 57650
Project: 57650
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  getDialog().setTitle(R.string.BCMWarnHeader);
  View pushDialogView=getActivity().getLayoutInflater().inflate(R.layout.dialog_workaroundwarning,null);
  final Button dismissBtn=(Button)pushDialogView.findViewById(R.id.btnWorkaroundNo);
  dismissBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      mListener.onWorkaroundNegativeClick();
      dismiss();
    }
  }
);
  Button goSettingsBtn=(Button)pushDialogView.findViewById(R.id.btnWorkaroundYes);
  goSettingsBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      mListener.onWorkaroundPositiveClick();
      dismiss();
    }
  }
);
  return pushDialogView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  getDialog().setTitle(R.string.BCMWarnHeader);
  final View pushDialogView=getActivity().getLayoutInflater().inflate(R.layout.dialog_workaroundwarning,null);
  final Button dismissBtn=(Button)pushDialogView.findViewById(R.id.btnWorkaroundNo);
  dismissBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      mListener.onWorkaroundNegativeClick(pushDialogView);
      dismiss();
    }
  }
);
  Button goSettingsBtn=(Button)pushDialogView.findViewById(R.id.btnWorkaroundYes);
  goSettingsBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      mListener.onWorkaroundPositiveClick(pushDialogView);
      dismiss();
    }
  }
);
  return pushDialogView;
}
Program: 57651
Project: 57651
Buggy source:
public void onWorkaroundNegativeClick();

Fixed version (ground truth):
public void onWorkaroundNegativeClick(View v);
Program: 57652
Project: 57652
Buggy source:
protected void onListItemClick(View v,int pos,long id){
}

Fixed version (ground truth):
protected void onListItemClick(View v,int pos,long id){
  if (mlistAdapter.getItem(0) == "String_Node_Str" && pos == 0) {
    String[] temp=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
    this.setmItems(temp);
    mlistAdapter.clear();
    mlistAdapter.addAll(this.getmItems());
    mlistAdapter.notifyDataSetChanged();
  }
 else {
    this.setmItems(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"});
    mlistAdapter.clear();
    mlistAdapter.addAll(this.getmItems());
    mlistAdapter.notifyDataSetChanged();
  }
}
Program: 57653
Project: 57653
Buggy source:
protected boolean onLongListItemClick(View v,int pos,long id){
  return true;
}

Fixed version (ground truth):
protected boolean onLongListItemClick(View v,int pos,long id){
  String selectedItem=mlistAdapter.getItem(pos);
  mlistAdapter.remove(selectedItem);
  mlistAdapter.notifyDataSetChanged();
  Toast.makeText(getActivity(),"String_Node_Str" + pos + "String_Node_Str",Toast.LENGTH_LONG).show();
  return true;
}
Program: 57654
Project: 57654
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.fragment_logging_list,container,false);
  mListView=(ListView)v.findViewById(R.id.sessionList);
  mSessionItems=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  ArrayList<String> mSessionItemsList=new ArrayList<String>();
  mSessionItemsList.addAll(Arrays.asList(mSessionItems));
  mlistAdapterSession=new ArrayAdapter<String>(v.getContext(),R.layout.fragment_logging_row,mSessionItemsList);
  mListView.setAdapter(mlistAdapterSession);
  mListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> arg0,    View v,    int pos,    long id){
      onListItemClick(v,pos,id);
    }
  }
);
  mListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener(){
    @Override public boolean onItemLongClick(    AdapterView<?> av,    View v,    int pos,    long id){
      return onLongListItemClick(v,pos,id);
    }
  }
);
  return v;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.fragment_logging_list,container,false);
  mListView=(ListView)v.findViewById(R.id.sessionList);
  ArrayList<String> mSessionItemsList=new ArrayList<String>();
  mSessionItemsList.addAll(Arrays.asList(mItems));
  mlistAdapter=new ArrayAdapter<String>(v.getContext(),R.layout.fragment_logging_row,mSessionItemsList);
  mListView.setAdapter(mlistAdapter);
  mListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> arg0,    View v,    int pos,    long id){
      onListItemClick(v,pos,id);
    }
  }
);
  mListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener(){
    @Override public boolean onItemLongClick(    AdapterView<?> av,    View v,    int pos,    long id){
      return onLongListItemClick(v,pos,id);
    }
  }
);
  return v;
}
Program: 57655
Project: 57655
Buggy source:
public void showEnableNFCDialog(){
  DialogFragment dialog=new enablenfc_dialog();
  dialog.show(getActivity().getFragmentManager(),"String_Node_Str");
}

Fixed version (ground truth):
public void showEnableNFCDialog(){
  DialogFragment dialog=new enablenfc_dialog();
  dialog.show(getFragmentManager(),"String_Node_Str");
}
Program: 57656
Project: 57656
Buggy source:
@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
  LayoutInflater inflater=getActivity().getLayoutInflater();
  builder.setView(inflater.inflate(R.layout.enablenfc,null)).setMessage("String_Node_Str").setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
      mListener.onNFCDialogPositiveClick(enablenfc_dialog.this);
    }
  }
).setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
      mListener.onNFCDialogNegativeClick(enablenfc_dialog.this);
    }
  }
);
  return builder.create();
}

Fixed version (ground truth):
@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
  LayoutInflater inflater=getActivity().getLayoutInflater();
  builder.setView(inflater.inflate(R.layout.enablenfc,null)).setTitle("String_Node_Str").setMessage("String_Node_Str").setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
      Intent intent=new Intent(Settings.ACTION_NFC_SETTINGS);
      startActivity(intent);
    }
  }
).setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
    }
  }
).setIcon(android.R.drawable.ic_dialog_alert);
  return builder.create();
}
Program: 57657
Project: 57657
Buggy source:
public void onClick(DialogInterface dialog,int id){
  mListener.onNFCDialogNegativeClick(enablenfc_dialog.this);
}

Fixed version (ground truth):
public void onClick(DialogInterface dialog,int which){
}
Program: 57658
Project: 57658
Buggy source:
@Override public void onAttach(Activity activity){
  super.onAttach(activity);
  try {
    mListener=(NFCNoticeDialogListener)activity;
  }
 catch (  ClassCastException e) {
    throw new ClassCastException(activity.toString() + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onAttach(Activity activity){
  super.onAttach(activity);
  try {
    mListener=(NFCNoticeDialogListener)activity;
  }
 catch (  ClassCastException e) {
  }
}
Program: 57659
Project: 57659
Buggy source:
/** 
 * Called on nfc tag intent
 * @param tag nfc tag
 * @return true if a supported tag is found
 */
public boolean setTag(Tag tag){
  boolean found_supported_tag=false;
  for (  String type : tag.getTechList()) {
    Log.i(TAG,"String_Node_Str" + type);
    if ("String_Node_Str".equals(type)) {
      found_supported_tag=true;
      mReader=new IsoDepReader(tag);
      Log.d(TAG,"String_Node_Str");
    }
 else     if ("String_Node_Str".equals(type)) {
      found_supported_tag=true;
      mReader=new NfcAReader(tag);
      Log.d(TAG,"String_Node_Str");
    }
  }
  if (found_supported_tag) {
    LowLevelTCPHandler.getInstance().setCallback(this);
    byte[] uid=mReader.getUID();
    byte[] atqa=mReader.getAtqa();
    byte sak=mReader.getSak();
    byte[] hist=mReader.getHistoricalBytes();
    Log.d(TAG,"String_Node_Str" + Utils.bytesToHex(uid));
    Log.d(TAG,"String_Node_Str" + Utils.bytesToHex(atqa));
    Log.d(TAG,"String_Node_Str" + Utils.bytesToHex(sak));
    Log.d(TAG,"String_Node_Str" + Utils.bytesToHex(hist));
    Handler.sendAnticol(atqa,sak,hist,uid);
  }
  File bcmdevice=new File("String_Node_Str");
  if (bcmdevice.exists()) {
    Log.i(TAG,"String_Node_Str");
    mBroadcomWorkaroundRunnable=new BroadcomWorkaround(tag);
    mBroadcomWorkaroundThread=new Thread(mBroadcomWorkaroundRunnable);
    mBroadcomWorkaroundThread.start();
    Handler.notifyCardWorkaroundConnected();
  }
 else {
    Log.i(TAG,"String_Node_Str");
  }
  return found_supported_tag;
}

Fixed version (ground truth):
/** 
 * Called on nfc tag intent
 * @param tag nfc tag
 * @return true if a supported tag is found
 */
public boolean setTag(Tag tag){
  boolean found_supported_tag=false;
  for (  String type : tag.getTechList()) {
    Log.i(TAG,"String_Node_Str" + type);
    if ("String_Node_Str".equals(type)) {
      found_supported_tag=true;
      mReader=new IsoDepReader(tag);
      Log.d(TAG,"String_Node_Str");
      break;
    }
 else     if ("String_Node_Str".equals(type)) {
      found_supported_tag=true;
      mReader=new NfcAReader(tag);
      Log.d(TAG,"String_Node_Str");
      break;
    }
  }
  if (found_supported_tag) {
    Log.d(TAG,"String_Node_Str");
    LowLevelTCPHandler.getInstance().setCallback(this);
    byte[] uid=mReader.getUID();
    byte[] atqa=mReader.getAtqa();
    byte sak=mReader.getSak();
    byte[] hist=mReader.getHistoricalBytes();
    Log.d(TAG,"String_Node_Str" + Utils.bytesToHex(uid));
    Log.d(TAG,"String_Node_Str" + Utils.bytesToHex(atqa));
    Log.d(TAG,"String_Node_Str" + Utils.bytesToHex(sak));
    Log.d(TAG,"String_Node_Str" + Utils.bytesToHex(hist));
    Handler.sendAnticol(atqa,sak,hist,uid);
  }
  File bcmdevice=new File("String_Node_Str");
  if (bcmdevice.exists()) {
    Log.i(TAG,"String_Node_Str");
    mBroadcomWorkaroundRunnable=new BroadcomWorkaround(tag);
    mBroadcomWorkaroundThread=new Thread(mBroadcomWorkaroundRunnable);
    mBroadcomWorkaroundThread.start();
    Handler.notifyCardWorkaroundConnected();
  }
 else {
    Log.i(TAG,"String_Node_Str");
  }
  return found_supported_tag;
}
Program: 57660
Project: 57660
Buggy source:
@Override public void onResume(){
  super.onResume();
  Log.i("String_Node_Str","String_Node_Str" + getIntent().getAction());
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  if (mAdapter != null && mAdapter.isEnabled()) {
    mAdapter.enableForegroundDispatch(this,mPendingIntent,mFilters,mTechLists);
    if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(getIntent().getAction())) {
      Log.i("String_Node_Str","String_Node_Str");
      onNewIntent(getIntent());
    }
  }
  boolean chgsett;
  if (preferences.getBoolean("String_Node_Str",false)) {
    SharedPreferences.Editor editor=preferences.edit();
    ip=preferences.getString("String_Node_Str","String_Node_Str");
    port=preferences.getInt("String_Node_Str",5566);
    globalPort=preferences.getInt("String_Node_Str",5566);
    mIP.setText(ip);
    mPort.setText(String.valueOf(port));
    boolean lReaderMode=preferences.getBoolean("String_Node_Str",false);
    if (lReaderMode) {
      mAdapter.enableReaderMode(this,this,NfcAdapter.FLAG_READER_NFC_A | NfcAdapter.FLAG_READER_SKIP_NDEF_CHECK,null);
    }
 else {
      mAdapter.disableReaderMode(this);
    }
    chgsett=false;
    editor.putBoolean("String_Node_Str",chgsett);
    editor.commit();
  }
  mConnecttoSession.requestFocus();
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  Log.i("String_Node_Str","String_Node_Str" + getIntent().getAction());
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  if (mAdapter != null && mAdapter.isEnabled()) {
    mAdapter.enableForegroundDispatch(this,mPendingIntent,mFilters,mTechLists);
    if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(getIntent().getAction())) {
      Log.i("String_Node_Str","String_Node_Str");
      onNewIntent(getIntent());
    }
  }
  boolean chgsett;
  if (preferences.getBoolean("String_Node_Str",false)) {
    SharedPreferences.Editor editor=preferences.edit();
    ip=preferences.getString("String_Node_Str","String_Node_Str");
    port=preferences.getInt("String_Node_Str",5566);
    globalPort=preferences.getInt("String_Node_Str",5566);
    mIP.setText(ip);
    mPort.setText(String.valueOf(port));
    boolean isReaderModeEnabled=preferences.getBoolean("String_Node_Str",false);
    if (isReaderModeEnabled) {
      mAdapter.enableReaderMode(this,this,NfcAdapter.FLAG_READER_NFC_A | NfcAdapter.FLAG_READER_SKIP_NDEF_CHECK,null);
    }
 else {
      mAdapter.disableReaderMode(this);
    }
    chgsett=false;
    editor.putBoolean("String_Node_Str",chgsett);
    editor.commit();
  }
  mConnecttoSession.requestFocus();
}
Program: 57661
Project: 57661
Buggy source:
public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.settings);
  mDevMode=(CheckBox)findViewById(R.id.checkBoxDevMode);
  mReaderMode=(CheckBox)findViewById(R.id.checkReaderMode);
  mIP=(TextView)findViewById(R.id.editIP);
  mPort=(TextView)findViewById(R.id.editPort);
  supportedFeatures=(TextView)findViewById(R.id.textViewSupportedFeatures);
  mbtnSaveSettings=(Button)findViewById(R.id.btnSaveSettings);
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  mDevModeEnabled=preferences.getBoolean("String_Node_Str",false);
  mReaderModeEnabled=preferences.getBoolean("String_Node_Str",false);
  ip=preferences.getString("String_Node_Str","String_Node_Str");
  port=preferences.getInt("String_Node_Str",5566);
  mIP.setText(ip);
  mPort.setText(String.valueOf(port));
  mDevMode.setChecked(mDevModeEnabled);
  mReaderMode.setChecked(mReaderModeEnabled);
  nfcisActive=false;
  hce=getPackageManager().hasSystemFeature("String_Node_Str");
  mAdapter=NfcAdapter.getDefaultAdapter(this);
  if (mAdapter != null && mAdapter.isEnabled()) {
    nfcisActive=true;
  }
  String values="String_Node_Str";
  if (nfcisActive) {
    values=values + "String_Node_Str";
  }
 else {
    values=values + "String_Node_Str";
  }
  values=values + "String_Node_Str";
  if (hce) {
    values=values + "String_Node_Str";
  }
 else {
    values=values + "String_Node_Str";
  }
  supportedFeatures.setText("String_Node_Str" + values);
}

Fixed version (ground truth):
public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.settings);
  mDevMode=(CheckBox)findViewById(R.id.checkBoxDevMode);
  mReaderMode=(CheckBox)findViewById(R.id.checkReaderMode);
  mIP=(TextView)findViewById(R.id.editIP);
  mPort=(TextView)findViewById(R.id.editPort);
  supportedFeatures=(TextView)findViewById(R.id.textViewSupportedFeatures);
  mbtnSaveSettings=(Button)findViewById(R.id.btnSaveSettings);
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  mDevModeEnabled=preferences.getBoolean("String_Node_Str",false);
  mReaderModeEnabled=preferences.getBoolean("String_Node_Str",false);
  ip=preferences.getString("String_Node_Str","String_Node_Str");
  port=preferences.getInt("String_Node_Str",5566);
  globalPort=port;
  mIP.setText(ip);
  mPort.setText(String.valueOf(port));
  mDevMode.setChecked(mDevModeEnabled);
  mReaderMode.setChecked(mReaderModeEnabled);
  nfcisActive=false;
  hce=getPackageManager().hasSystemFeature("String_Node_Str");
  mAdapter=NfcAdapter.getDefaultAdapter(this);
  if (mAdapter != null && mAdapter.isEnabled()) {
    nfcisActive=true;
  }
  String values="String_Node_Str";
  if (nfcisActive) {
    values=values + "String_Node_Str";
  }
 else {
    values=values + "String_Node_Str";
  }
  values=values + "String_Node_Str";
  if (hce) {
    values=values + "String_Node_Str";
  }
 else {
    values=values + "String_Node_Str";
  }
  supportedFeatures.setText("String_Node_Str" + values);
}
Program: 57662
Project: 57662
Buggy source:
public void btnSaveSettingsClicked(View view){
  ip=mIP.getText().toString();
  try {
    port=Integer.parseInt(mPort.getText().toString().trim());
  }
 catch (  NumberFormatException e) {
  }
  mDevModeEnabled=(((CheckBox)findViewById(R.id.checkBoxDevMode)).isChecked());
  mReaderModeEnabled=(((CheckBox)findViewById(R.id.checkReaderMode)).isChecked());
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  SharedPreferences.Editor editor=preferences.edit();
  editor.putBoolean("String_Node_Str",mDevModeEnabled);
  editor.putBoolean("String_Node_Str",mReaderModeEnabled);
  editor.putString("String_Node_Str",ip);
  editor.putInt("String_Node_Str",port);
  boolean chgsett=true;
  editor.putBoolean("String_Node_Str",chgsett);
  editor.commit();
  Toast.makeText(this,"String_Node_Str",Toast.LENGTH_SHORT).show();
  finish();
}

Fixed version (ground truth):
public void btnSaveSettingsClicked(View view){
  if (!checkIpPort(mIP.getText().toString(),mPort.getText().toString())) {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
    return;
  }
  mDevModeEnabled=(((CheckBox)findViewById(R.id.checkBoxDevMode)).isChecked());
  mReaderModeEnabled=(((CheckBox)findViewById(R.id.checkReaderMode)).isChecked());
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  SharedPreferences.Editor editor=preferences.edit();
  editor.putBoolean("String_Node_Str",mDevModeEnabled);
  editor.putBoolean("String_Node_Str",mReaderModeEnabled);
  editor.putString("String_Node_Str",mIP.getText().toString());
  editor.putInt("String_Node_Str",globalPort);
  boolean chgsett=true;
  editor.putBoolean("String_Node_Str",chgsett);
  editor.commit();
  Toast.makeText(this,"String_Node_Str",Toast.LENGTH_SHORT).show();
  finish();
}
Program: 57663
Project: 57663
Buggy source:
public void DevCheckboxClicked(View view){
  mDevModeEnabled=(((CheckBox)findViewById(R.id.checkBoxDevMode)).isChecked());
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  SharedPreferences.Editor editor=preferences.edit();
  editor.putBoolean("String_Node_Str",mDevModeEnabled);
  editor.commit();
}

Fixed version (ground truth):
public void DevCheckboxClicked(View view){
  mDevModeEnabled=(((CheckBox)findViewById(R.id.checkBoxDevMode)).isChecked());
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  SharedPreferences.Editor editor=preferences.edit();
  editor.putBoolean("String_Node_Str",mDevModeEnabled);
  boolean chgsett=true;
  editor.putBoolean("String_Node_Str",chgsett);
  editor.commit();
}
Program: 57664
Project: 57664
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.action_settings:
    startActivity(new Intent(MainActivity.this,SettingsActivity.class));
  return true;
case R.id.action_about:
startActivity(new Intent(MainActivity.this,AboutActivity.class));
return true;
default :
return super.onOptionsItemSelected(item);
}
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.action_settings:
    startActivityForResult(new Intent(MainActivity.this,SettingsActivity.class),0);
  return true;
case R.id.action_about:
startActivity(new Intent(MainActivity.this,AboutActivity.class));
return true;
default :
return super.onOptionsItemSelected(item);
}
}
Program: 57665
Project: 57665
Buggy source:
/** 
 * Called when the user touches the button 'btnSaveSettingsClicked'  -- Code by Tom 
 */
public void btnSaveSettingsClicked(View view){
  ip=mIP.getText().toString();
  try {
    port=Integer.parseInt(mPort.getText().toString().trim());
  }
 catch (  NumberFormatException e) {
  }
  mDevModeEnabled=(((CheckBox)findViewById(R.id.checkBoxDevMode)).isChecked());
  mReaderModeEnabled=(((CheckBox)findViewById(R.id.checkReaderMode)).isChecked());
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  SharedPreferences.Editor editor=preferences.edit();
  editor.putBoolean("String_Node_Str",mDevModeEnabled);
  editor.putBoolean("String_Node_Str",mReaderModeEnabled);
  editor.putString("String_Node_Str",ip);
  editor.putInt("String_Node_Str",port);
  boolean chgsett=true;
  editor.putBoolean("String_Node_Str",chgsett);
  editor.commit();
}

Fixed version (ground truth):
/** 
 * Called when the user touches the button 'btnSaveSettingsClicked'  -- Code by Tom 
 */
public void btnSaveSettingsClicked(View view){
  ip=mIP.getText().toString();
  try {
    port=Integer.parseInt(mPort.getText().toString().trim());
  }
 catch (  NumberFormatException e) {
  }
  mDevModeEnabled=(((CheckBox)findViewById(R.id.checkBoxDevMode)).isChecked());
  mReaderModeEnabled=(((CheckBox)findViewById(R.id.checkReaderMode)).isChecked());
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  SharedPreferences.Editor editor=preferences.edit();
  editor.putBoolean("String_Node_Str",mDevModeEnabled);
  editor.putBoolean("String_Node_Str",mReaderModeEnabled);
  editor.putString("String_Node_Str",ip);
  editor.putInt("String_Node_Str",port);
  boolean chgsett=true;
  editor.putBoolean("String_Node_Str",chgsett);
  editor.commit();
  Toast.makeText(this,"String_Node_Str",Toast.LENGTH_SHORT).show();
  finish();
}
Program: 57667
Project: 57667
Buggy source:
/** 
 * called when app is already open and intent is fired
 * @param intent intent
 */
@Override public void onNewIntent(Intent intent){
  Log.i("String_Node_Str","String_Node_Str");
  if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(intent.getAction())) {
    Log.i("String_Node_Str","String_Node_Str" + intent);
    Tag tag=intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
    String tagId="String_Node_Str";
    mNetCallback.setTag(tag);
    mNetCallback.setUpdateButton(mDebuginfo);
    mOwnID.setText("String_Node_Str" + tagId);
    Toast.makeText(this,"String_Node_Str" + tagId,Toast.LENGTH_SHORT).show();
  }
}

Fixed version (ground truth):
@Override public void onNewIntent(Intent intent){
  Log.i("String_Node_Str","String_Node_Str");
  if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(intent.getAction())) {
    Log.i("String_Node_Str","String_Node_Str" + intent);
    Tag tag=intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
    String tagId="String_Node_Str";
    mNetCallback.setTag(tag);
    mNetCallback.setUpdateButton(mDebuginfo);
    mOwnID.setText("String_Node_Str" + tagId);
    Toast.makeText(this,"String_Node_Str" + tagId,Toast.LENGTH_SHORT).show();
  }
}
Program: 57668
Project: 57668
Buggy source:
/** 
 * Called when activity is paused
 */
@Override public void onPause(){
  super.onPause();
  unregisterReceiver(mReceiver);
}

Fixed version (ground truth):
@Override public void onPause(){
  super.onPause();
  unregisterReceiver(mReceiver);
}
Program: 57669
Project: 57669
Buggy source:
public void ButtonResetClicked(View view){
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  SharedPreferences.Editor editor=preferences.edit();
  editor.putBoolean("String_Node_Str",false);
  editor.putString("String_Node_Str","String_Node_Str");
  editor.putInt("String_Node_Str",5566);
  editor.commit();
  mIP.setText(ip);
  mPort.setText(String.valueOf(port));
  mDevModeEnabled=false;
  mOwnID.setText("String_Node_Str");
  mInfo.setText("String_Node_Str");
  mDebuginfo.setText("String_Node_Str");
  this.setTitle("String_Node_Str");
  onResume();
}

Fixed version (ground truth):
/** 
 * Called when the user touches the button 'ButtonResetClicked application'  -- Code by Tom 
 */
public void ButtonResetClicked(View view){
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  SharedPreferences.Editor editor=preferences.edit();
  editor.putBoolean("String_Node_Str",false);
  editor.putString("String_Node_Str","String_Node_Str");
  editor.putInt("String_Node_Str",5566);
  editor.commit();
  mIP.setText(ip);
  mPort.setText(String.valueOf(port));
  mDevModeEnabled=false;
  mOwnID.setText("String_Node_Str");
  mInfo.setText("String_Node_Str");
  mDebuginfo.setText("String_Node_Str");
  this.setTitle("String_Node_Str");
  onResume();
}
Program: 57670
Project: 57670
Buggy source:
public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.settings);
  mDevMode=(CheckBox)findViewById(R.id.checkBoxDevMode);
  mIP=(TextView)findViewById(R.id.editIP);
  mPort=(TextView)findViewById(R.id.editPort);
  mbtnSaveSettings=(Button)findViewById(R.id.btnSaveSettings);
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  mDevModeEnabled=preferences.getBoolean("String_Node_Str",false);
  ip=preferences.getString("String_Node_Str","String_Node_Str");
  port=preferences.getInt("String_Node_Str",5566);
  mIP.setText(ip);
  mPort.setText(String.valueOf(port));
  mDevMode.setChecked(mDevModeEnabled);
}

Fixed version (ground truth):
public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.settings);
  mDevMode=(CheckBox)findViewById(R.id.checkBoxDevMode);
  mIP=(TextView)findViewById(R.id.editIP);
  mPort=(TextView)findViewById(R.id.editPort);
  supportedFeatures=(TextView)findViewById(R.id.textViewSupportedFeatures);
  mbtnSaveSettings=(Button)findViewById(R.id.btnSaveSettings);
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  mDevModeEnabled=preferences.getBoolean("String_Node_Str",false);
  ip=preferences.getString("String_Node_Str","String_Node_Str");
  port=preferences.getInt("String_Node_Str",5566);
  mIP.setText(ip);
  mPort.setText(String.valueOf(port));
  mDevMode.setChecked(mDevModeEnabled);
  nfcisActive=false;
  hce=getPackageManager().hasSystemFeature("String_Node_Str");
  mAdapter=NfcAdapter.getDefaultAdapter(this);
  if (mAdapter != null && mAdapter.isEnabled()) {
    nfcisActive=true;
  }
  String values="String_Node_Str";
  if (nfcisActive) {
    values=values + "String_Node_Str";
  }
 else {
    values=values + "String_Node_Str";
  }
  values=values + "String_Node_Str";
  if (hce) {
    values=values + "String_Node_Str";
  }
 else {
    values=values + "String_Node_Str";
  }
  supportedFeatures.setText("String_Node_Str" + values);
}
Program: 57671
Project: 57671
Buggy source:
/** 
 * Called when the user touches the button 'btnSaveSettingsClicked'  -- Code by Tom 
 */
public void btnSaveSettingsClicked(View view){
  ip=mIP.getText().toString();
  try {
    port=Integer.parseInt(mPort.getText().toString().trim());
  }
 catch (  NumberFormatException e) {
  }
  boolean checked=(((CheckBox)findViewById(R.id.checkBoxDevMode)).isChecked());
  if (checked) {
    this.mDevModeEnabled=true;
  }
 else {
    this.mDevModeEnabled=false;
  }
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  SharedPreferences.Editor editor=preferences.edit();
  editor.putBoolean("String_Node_Str",mDevModeEnabled);
  editor.putString("String_Node_Str",ip);
  editor.putInt("String_Node_Str",port);
  editor.commit();
}

Fixed version (ground truth):
/** 
 * Called when the user touches the button 'btnSaveSettingsClicked'  -- Code by Tom 
 */
public void btnSaveSettingsClicked(View view){
  ip=mIP.getText().toString();
  try {
    port=Integer.parseInt(mPort.getText().toString().trim());
  }
 catch (  NumberFormatException e) {
  }
  mDevModeEnabled=(((CheckBox)findViewById(R.id.checkBoxDevMode)).isChecked());
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  SharedPreferences.Editor editor=preferences.edit();
  editor.putBoolean("String_Node_Str",mDevModeEnabled);
  editor.putString("String_Node_Str",ip);
  editor.putInt("String_Node_Str",port);
  editor.commit();
}
Program: 57672
Project: 57672
Buggy source:
public void DevCheckboxClicked(View view){
  boolean checked=(((CheckBox)findViewById(R.id.checkBoxDevMode)).isChecked());
  if (checked) {
    this.mDevModeEnabled=true;
  }
 else {
    this.mDevModeEnabled=false;
  }
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  SharedPreferences.Editor editor=preferences.edit();
  editor.putBoolean("String_Node_Str",mDevModeEnabled);
  editor.commit();
}

Fixed version (ground truth):
public void DevCheckboxClicked(View view){
  mDevModeEnabled=(((CheckBox)findViewById(R.id.checkBoxDevMode)).isChecked());
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  SharedPreferences.Editor editor=preferences.edit();
  editor.putBoolean("String_Node_Str",mDevModeEnabled);
  editor.commit();
}
Program: 57673
Project: 57673
Buggy source:
/** 
 * Called when the user touches the button 'Abort'  -- Code by Tom 
 */
public void ButtonAbortClicked(View view){
  boolean isHceSupported=getPackageManager().hasSystemFeature("String_Node_Str");
  Toast.makeText(this,"String_Node_Str" + (isHceSupported ? "String_Node_Str" : "String_Node_Str"),Toast.LENGTH_SHORT).show();
  this.setTitle("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Called when the user touches the button 'Abort'  -- Code by Tom 
 */
public void ButtonAbortClicked(View view){
  this.setTitle("String_Node_Str");
}
Program: 57674
Project: 57674
Buggy source:
@Override public void onResume(){
  super.onResume();
  Log.i("String_Node_Str","String_Node_Str" + getIntent().getAction());
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  mDevModeEnabled=preferences.getBoolean("String_Node_Str",false);
  mDebuginfo=(TextView)findViewById(R.id.editTextDevModeEnabledDebugging);
  if (mDevModeEnabled) {
    mDebuginfo.setVisibility(View.VISIBLE);
  }
 else {
    mDebuginfo.setVisibility(View.INVISIBLE);
  }
  ip=preferences.getString("String_Node_Str","String_Node_Str");
  port=preferences.getInt("String_Node_Str",5566);
  mIP.setText(ip);
  mPort.setText(String.valueOf(port));
  if (mAdapter != null && mAdapter.isEnabled()) {
    mAdapter.enableForegroundDispatch(this,mPendingIntent,mFilters,mTechLists);
    if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(getIntent().getAction())) {
      Log.i("String_Node_Str","String_Node_Str");
      onNewIntent(getIntent());
    }
  }
  mReceiver=new WiFiDirectBroadcastReceiver(mManager,mChannel,this);
  registerReceiver(mReceiver,mIntentFilter);
  mConnect.requestFocus();
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  Log.i("String_Node_Str","String_Node_Str" + getIntent().getAction());
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  if (mAdapter != null && mAdapter.isEnabled()) {
    mAdapter.enableForegroundDispatch(this,mPendingIntent,mFilters,mTechLists);
    if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(getIntent().getAction())) {
      Log.i("String_Node_Str","String_Node_Str");
      onNewIntent(getIntent());
    }
  }
  boolean chgsett;
  if (preferences.getBoolean("String_Node_Str",false)) {
    SharedPreferences.Editor editor=preferences.edit();
    ip=preferences.getString("String_Node_Str","String_Node_Str");
    port=preferences.getInt("String_Node_Str",5566);
    mIP.setText(ip);
    mPort.setText(String.valueOf(port));
    chgsett=false;
    editor.putBoolean("String_Node_Str",chgsett);
    editor.commit();
  }
  mReceiver=new WiFiDirectBroadcastReceiver(mManager,mChannel,this);
  registerReceiver(mReceiver,mIntentFilter);
  mConnect.requestFocus();
}
Program: 57675
Project: 57675
Buggy source:
/** 
 * Called when the user touches the button 'ButtonResetClicked application'  -- Code by Tom 
 */
public void ButtonResetClicked(View view){
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  SharedPreferences.Editor editor=preferences.edit();
  editor.putBoolean("String_Node_Str",false);
  editor.putString("String_Node_Str","String_Node_Str");
  editor.putInt("String_Node_Str",5566);
  editor.commit();
  mIP.setText(ip);
  mPort.setText(String.valueOf(port));
  mDevModeEnabled=false;
  mOwnID.setText("String_Node_Str");
  mInfo.setText("String_Node_Str");
  mDebuginfo.setText("String_Node_Str");
  this.setTitle("String_Node_Str");
  onResume();
}

Fixed version (ground truth):
/** 
 * Called when the user touches the button 'ButtonResetClicked application'  -- Code by Tom 
 */
public void ButtonResetClicked(View view){
  mOwnID.setText("String_Node_Str");
  mInfo.setText("String_Node_Str");
  mDebuginfo.setText("String_Node_Str");
  this.setTitle("String_Node_Str");
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  mDevModeEnabled=preferences.getBoolean("String_Node_Str",false);
  mDebuginfo=(TextView)findViewById(R.id.editTextDevModeEnabledDebugging);
  if (mDevModeEnabled) {
    mDebuginfo.setVisibility(View.VISIBLE);
    mDebuginfo.requestFocus();
  }
 else {
    mDebuginfo.setVisibility(View.GONE);
  }
  ip=preferences.getString("String_Node_Str","String_Node_Str");
  port=preferences.getInt("String_Node_Str",5566);
  mIP.setText(ip);
  mPort.setText(String.valueOf(port));
}
Program: 57676
Project: 57676
Buggy source:
/** 
 * Called when the user touches the button 'btnSaveSettingsClicked'  -- Code by Tom 
 */
public void btnSaveSettingsClicked(View view){
  ip=mIP.getText().toString();
  try {
    port=Integer.parseInt(mPort.getText().toString().trim());
  }
 catch (  NumberFormatException e) {
  }
  mDevModeEnabled=(((CheckBox)findViewById(R.id.checkBoxDevMode)).isChecked());
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  SharedPreferences.Editor editor=preferences.edit();
  editor.putBoolean("String_Node_Str",mDevModeEnabled);
  editor.putString("String_Node_Str",ip);
  editor.putInt("String_Node_Str",port);
  editor.commit();
}

Fixed version (ground truth):
/** 
 * Called when the user touches the button 'btnSaveSettingsClicked'  -- Code by Tom 
 */
public void btnSaveSettingsClicked(View view){
  ip=mIP.getText().toString();
  try {
    port=Integer.parseInt(mPort.getText().toString().trim());
  }
 catch (  NumberFormatException e) {
  }
  mDevModeEnabled=(((CheckBox)findViewById(R.id.checkBoxDevMode)).isChecked());
  SharedPreferences preferences=getSharedPreferences(PREF_FILE_NAME,MODE_PRIVATE);
  SharedPreferences.Editor editor=preferences.edit();
  editor.putBoolean("String_Node_Str",mDevModeEnabled);
  editor.putString("String_Node_Str",ip);
  editor.putInt("String_Node_Str",port);
  boolean chgsett=true;
  editor.putBoolean("String_Node_Str",chgsett);
  editor.commit();
}
Program: 57677
Project: 57677
Buggy source:
/** 
 * called after onStart()
 */
@Override public void onResume(){
  super.onResume();
  Log.i("String_Node_Str","String_Node_Str" + getIntent().getAction());
  mReceiver=new WiFiDirectBroadcastReceiver(mManager,mChannel,this);
  registerReceiver(mReceiver,mIntentFilter);
}

Fixed version (ground truth):
/** 
 * called after onStart()
 */
@Override public void onResume(){
  super.onResume();
  Log.i("String_Node_Str","String_Node_Str" + getIntent().getAction());
  mAdapter.enableForegroundDispatch(this,mPendingIntent,mFilters,mTechLists);
  if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(getIntent().getAction())) {
    Log.i("String_Node_Str","String_Node_Str");
    onNewIntent(getIntent());
  }
  mReceiver=new WiFiDirectBroadcastReceiver(mManager,mChannel,this);
  registerReceiver(mReceiver,mIntentFilter);
}
Program: 57678
Project: 57678
Buggy source:
/** 
 * 获取某竞赛中某个用户各试题的提交记录.
 * @param contestId - 竞赛的唯一标识符
 * @param contestant - 参赛者
 * @return 包含用户提交记录的Map对象, 按试题ID索引
 */
public Map<Long,ContestSubmission> getSubmissionsOfContestantOfContest(long contestId,User contestant){
  if (contestant == null) {
    return null;
  }
  Map<Long,ContestSubmission> submissionsGroupByProblems=new HashMap<>();
  List<ContestSubmission> submissions=contestSubmissionMapper.getSubmissionOfContestOfContest(contestId,contestant.getUid());
  for (  ContestSubmission cs : submissions) {
    long problemId=cs.getSubmission().getProblem().getProblemId();
    if (submissionsGroupByProblems.containsKey(problemId)) {
      ContestSubmission prevSubmission=submissionsGroupByProblems.get(problemId);
      if (prevSubmission.getSubmission().getJudgeResult().equals("String_Node_Str") && !cs.getSubmission().getJudgeResult().equals("String_Node_Str")) {
        continue;
      }
    }
    submissionsGroupByProblems.put(problemId,cs);
  }
  return submissionsGroupByProblems;
}

Fixed version (ground truth):
/** 
 * 获取某竞赛中某个用户各试题的提交记录.
 * @param contestId - 竞赛的唯一标识符
 * @param contestant - 参赛者
 * @return 包含用户提交记录的Map对象, 按试题ID索引
 */
public Map<Long,ContestSubmission> getSubmissionsOfContestantOfContest(long contestId,User contestant){
  if (contestant == null) {
    return null;
  }
  Map<Long,ContestSubmission> submissionsGroupByProblems=new HashMap<>();
  List<ContestSubmission> submissions=contestSubmissionMapper.getSubmissionOfContestOfContest(contestId,contestant.getUid());
  for (  ContestSubmission cs : submissions) {
    long problemId=cs.getSubmission().getProblem().getProblemId();
    if (submissionsGroupByProblems.containsKey(problemId)) {
      ContestSubmission prevSubmission=submissionsGroupByProblems.get(problemId);
      if (prevSubmission.getSubmission().getJudgeResult().getJudgeResultSlug().equals("String_Node_Str") && !cs.getSubmission().getJudgeResult().getJudgeResultSlug().equals("String_Node_Str")) {
        continue;
      }
    }
    submissionsGroupByProblems.put(problemId,cs);
  }
  return submissionsGroupByProblems;
}
Program: 57679
Project: 57679
Buggy source:
public int compareTo(Object o){
  if (!(o instanceof ContestContestant)) {
    throw new ClassCastException("String_Node_Str");
  }
  ContestContestant occ=(ContestContestant)o;
  if (occ.getScore() == this.score) {
    return this.time > occ.getTime() ? 1 : -1;
  }
  return this.score - occ.getScore();
}

Fixed version (ground truth):
public int compareTo(Object o){
  if (!(o instanceof ContestContestant)) {
    throw new ClassCastException("String_Node_Str");
  }
  ContestContestant occ=(ContestContestant)o;
  if (occ.getScore() == this.score) {
    return this.time < occ.getTime() ? -1 : 1;
  }
  return occ.getScore() - this.score;
}
Program: 57680
Project: 57680
Buggy source:
/** 
 * 获取ACM赛制的排行榜.
 * @param contestId - 竞赛的唯一标识符
 * @return 包含参赛者和提交记录信息的Map对象
 */
public Map<String,Object> getLeaderBoardForAcm(long contestId){
  Contest contest=contestMapper.getContest(contestId);
  Map<String,Object> result=new HashMap<>(3,1);
  List<ContestContestant> contestants=contestContestantMapper.getContestantsOfContestForAcm(contestId,0,Integer.MAX_VALUE);
  Map<Long,Map<Long,Submission>> submissions=getSubmissionsGroupByContestant(contestSubmissionMapper.getAcceptedSubmissionsOfContest(contestId),false);
  Collections.sort(contestants);
  for (  ContestContestant cc : contestants) {
    long numberOfRejected=cc.getTime();
    long penalty=numberOfRejected * 1200;
    if (submissions.containsKey(cc.getContestant().getUid())) {
      Map<Long,Submission> submissionsOfContestant=submissions.get(cc.getContestant().getUid());
      for (      Map.Entry<Long,Submission> e : submissionsOfContestant.entrySet()) {
        Submission s=e.getValue();
        long usedTimeInMilliseconds=s.getSubmitTime().getTime() - contest.getStartTime().getTime();
        s.setUsedTime(usedTimeInMilliseconds / 1000);
        penalty+=s.getUsedTime();
      }
      cc.setTime(penalty);
    }
  }
  rankingContestants(contestants);
  result.put("String_Node_Str",contestants);
  result.put("String_Node_Str",submissions);
  return result;
}

Fixed version (ground truth):
/** 
 * 获取ACM赛制的排行榜.
 * @param contestId - 竞赛的唯一标识符
 * @return 包含参赛者和提交记录信息的Map对象
 */
public Map<String,Object> getLeaderBoardForAcm(long contestId){
  Contest contest=contestMapper.getContest(contestId);
  Map<String,Object> result=new HashMap<>(3,1);
  List<ContestContestant> contestants=contestContestantMapper.getContestantsOfContestForAcm(contestId,0,Integer.MAX_VALUE);
  Map<Long,Map<Long,Submission>> submissions=getSubmissionsGroupByContestant(contestSubmissionMapper.getAcceptedSubmissionsOfContest(contestId),false);
  for (  ContestContestant cc : contestants) {
    long numberOfRejected=cc.getTime();
    long penalty=numberOfRejected * 1200;
    if (submissions.containsKey(cc.getContestant().getUid())) {
      Map<Long,Submission> submissionsOfContestant=submissions.get(cc.getContestant().getUid());
      for (      Map.Entry<Long,Submission> e : submissionsOfContestant.entrySet()) {
        Submission s=e.getValue();
        long usedTimeInMilliseconds=s.getSubmitTime().getTime() - contest.getStartTime().getTime();
        s.setUsedTime(usedTimeInMilliseconds / 1000);
        penalty+=s.getUsedTime();
      }
      cc.setTime(penalty);
    }
  }
  Collections.sort(contestants);
  rankingContestants(contestants);
  result.put("String_Node_Str",contestants);
  result.put("String_Node_Str",submissions);
  return result;
}