nus-yam/ex-repair huggingface dataset:
Program: 40022
Project: 40022
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
    for (    String file : context.getFilesDir().list()) {
      ProcessRunner pr=new ProcessRunner();
      String fullFilePath=context.getFilesDir().toString() + "String_Node_Str" + file;
      int exitCode=pr.Run(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str",fullFilePath});
      if (exitCode == 0) {
        Log.d(TAG,"String_Node_Str" + file);
      }
 else {
        Log.d(TAG,String.format("String_Node_Str",file,exitCode,pr.getStdout(),pr.getStderr()));
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
    for (    String file : context.getFilesDir().list()) {
      ProcessRunner pr=new ProcessRunner();
      String fullFilePath=context.getFilesDir().toString() + "String_Node_Str" + file;
      int exitCode=pr.Run(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str" + fullFilePath});
      if (exitCode == 0) {
        Log.d(TAG,"String_Node_Str" + file);
      }
 else {
        Log.d(TAG,String.format("String_Node_Str",file,exitCode,pr.getStdout(),pr.getStderr()));
      }
    }
  }
}
Program: 40023
Project: 40023
Buggy source:
private void setupSwipeLayout(){
  Utils.print(TAG,"String_Node_Str");
  mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener(){
    @Override public void onRefresh(){
      connected=Utils.isInternetConnected(mContext);
      if (connected)       getNews(mSource,mPage=1);
 else {
        if (mListener != null)         mListener.showSnackBar(R.string.response_fail);
        if (mSwipeRefreshLayout != null && mSwipeRefreshLayout.isRefreshing())         mSwipeRefreshLayout.setRefreshing(false);
      }
    }
  }
);
}

Fixed version (ground truth):
private void setupSwipeLayout(){
  Utils.print(TAG,"String_Node_Str");
  mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener(){
    @Override public void onRefresh(){
      connected=Utils.isInternetConnected(mContext);
      if (connected)       if (mType == 1)       refreshRec();
 else       getNews(mSource,mPage=1);
 else {
        if (mListener != null)         mListener.showSnackBar(R.string.response_fail);
        if (mSwipeRefreshLayout != null && mSwipeRefreshLayout.isRefreshing())         mSwipeRefreshLayout.setRefreshing(false);
      }
    }
  }
);
}
Program: 40024
Project: 40024
Buggy source:
@Override public void onRefresh(){
  connected=Utils.isInternetConnected(mContext);
  if (connected)   getNews(mSource,mPage=1);
 else {
    if (mListener != null)     mListener.showSnackBar(R.string.response_fail);
    if (mSwipeRefreshLayout != null && mSwipeRefreshLayout.isRefreshing())     mSwipeRefreshLayout.setRefreshing(false);
  }
}

Fixed version (ground truth):
@Override public void onRefresh(){
  connected=Utils.isInternetConnected(mContext);
  if (connected)   if (mType == 1)   refreshRec();
 else   getNews(mSource,mPage=1);
 else {
    if (mListener != null)     mListener.showSnackBar(R.string.response_fail);
    if (mSwipeRefreshLayout != null && mSwipeRefreshLayout.isRefreshing())     mSwipeRefreshLayout.setRefreshing(false);
  }
}
Program: 40025
Project: 40025
Buggy source:
@Override public void onResponse(@NonNull Call<Register> call,@NonNull Response<Register> response){
  Utils.print(TAG,"String_Node_Str");
  Utils.print(TAG,"String_Node_Str" + response.raw().request().url());
  Utils.print(TAG,"String_Node_Str" + response.code());
  if (response.isSuccessful()) {
    Intent intent=new Intent(mContext,LoginActivity.class);
    Bundle bundle=new Bundle();
    bundle.putString("String_Node_Str",response.body().getMessage());
    intent.putExtras(bundle);
    startActivity(intent);
    finish();
  }
 else {
    Utils.print(TAG,"String_Node_Str" + response.message(),Log.ERROR);
    Utils.showSnackbar(mCoordinatorLayout,mContext,"String_Node_Str",true);
  }
}

Fixed version (ground truth):
@Override public void onResponse(@NonNull Call<DefaultMsg> call,@NonNull Response<DefaultMsg> response){
  Utils.print(TAG,"String_Node_Str");
  Utils.print(TAG,"String_Node_Str" + response.raw().request().url());
  Utils.print(TAG,"String_Node_Str" + response.code());
  if (response.isSuccessful()) {
    Intent intent=new Intent(mContext,LoginActivity.class);
    Bundle bundle=new Bundle();
    bundle.putString("String_Node_Str",response.body().getMessage());
    intent.putExtras(bundle);
    startActivity(intent);
    finish();
  }
 else {
    Utils.print(TAG,"String_Node_Str" + response.message(),Log.ERROR);
    Utils.showSnackbar(mCoordinatorLayout,mContext,"String_Node_Str",true);
  }
}
Program: 40026
Project: 40026
Buggy source:
@Override public void onFailure(@NonNull Call<Register> call,@NonNull Throwable t){
  Utils.print(TAG,"String_Node_Str",Log.ERROR);
  Utils.print(TAG,t.toString(),Log.ERROR);
  Utils.showSnackbar(mCoordinatorLayout,mContext,R.string.response_fail,true);
}

Fixed version (ground truth):
@Override public void onFailure(@NonNull Call<DefaultMsg> call,@NonNull Throwable t){
  Utils.print(TAG,"String_Node_Str",Log.ERROR);
  Utils.print(TAG,t.toString(),Log.ERROR);
  Utils.showSnackbar(mCoordinatorLayout,mContext,R.string.response_fail,true);
}
Program: 40027
Project: 40027
Buggy source:
private void register(String fullName,String username,String email,String password){
  Utils.print(TAG,"String_Node_Str");
  getApi().register(email,password,username,fullName).enqueue(new Callback<Register>(){
    @Override public void onResponse(    @NonNull Call<Register> call,    @NonNull Response<Register> response){
      Utils.print(TAG,"String_Node_Str");
      Utils.print(TAG,"String_Node_Str" + response.raw().request().url());
      Utils.print(TAG,"String_Node_Str" + response.code());
      if (response.isSuccessful()) {
        Intent intent=new Intent(mContext,LoginActivity.class);
        Bundle bundle=new Bundle();
        bundle.putString("String_Node_Str",response.body().getMessage());
        intent.putExtras(bundle);
        startActivity(intent);
        finish();
      }
 else {
        Utils.print(TAG,"String_Node_Str" + response.message(),Log.ERROR);
        Utils.showSnackbar(mCoordinatorLayout,mContext,"String_Node_Str",true);
      }
    }
    @Override public void onFailure(    @NonNull Call<Register> call,    @NonNull Throwable t){
      Utils.print(TAG,"String_Node_Str",Log.ERROR);
      Utils.print(TAG,t.toString(),Log.ERROR);
      Utils.showSnackbar(mCoordinatorLayout,mContext,R.string.response_fail,true);
    }
  }
);
}

Fixed version (ground truth):
private void register(String fullName,String username,String email,String password){
  Utils.print(TAG,"String_Node_Str");
  getApi().register(email,password,username,fullName).enqueue(new Callback<DefaultMsg>(){
    @Override public void onResponse(    @NonNull Call<DefaultMsg> call,    @NonNull Response<DefaultMsg> response){
      Utils.print(TAG,"String_Node_Str");
      Utils.print(TAG,"String_Node_Str" + response.raw().request().url());
      Utils.print(TAG,"String_Node_Str" + response.code());
      if (response.isSuccessful()) {
        Intent intent=new Intent(mContext,LoginActivity.class);
        Bundle bundle=new Bundle();
        bundle.putString("String_Node_Str",response.body().getMessage());
        intent.putExtras(bundle);
        startActivity(intent);
        finish();
      }
 else {
        Utils.print(TAG,"String_Node_Str" + response.message(),Log.ERROR);
        Utils.showSnackbar(mCoordinatorLayout,mContext,"String_Node_Str",true);
      }
    }
    @Override public void onFailure(    @NonNull Call<DefaultMsg> call,    @NonNull Throwable t){
      Utils.print(TAG,"String_Node_Str",Log.ERROR);
      Utils.print(TAG,t.toString(),Log.ERROR);
      Utils.showSnackbar(mCoordinatorLayout,mContext,R.string.response_fail,true);
    }
  }
);
}
Program: 40028
Project: 40028
Buggy source:
@FormUrlEncoded @POST("String_Node_Str") Call<Register> register(@NonNull @Field("String_Node_Str") String email,@NonNull @Field("String_Node_Str") String password,@NonNull @Field("String_Node_Str") String username,@NonNull @Field("String_Node_Str") String firstName);

Fixed version (ground truth):
@FormUrlEncoded @POST("String_Node_Str") Call<DefaultMsg> register(@NonNull @Field("String_Node_Str") String email,@NonNull @Field("String_Node_Str") String password,@NonNull @Field("String_Node_Str") String username,@NonNull @Field("String_Node_Str") String firstName);
Program: 40029
Project: 40029
Buggy source:
@SuppressLint("String_Node_Str") public void login(User user,String token){
  if (!TextUtils.isEmpty(token)) {
    accessToken=token;
    isLoggedIn=true;
    userFullName=user.getFullName();
    userUsername=user.getUsername();
    userType=user.getType();
    userEmail=user.getEmail();
    SharedPreferences.Editor editor=prefs.edit();
    editor.putString(KEY_USER_FULL_NAME,userFullName);
    editor.putString(KEY_USER_USERNAME,userUsername);
    editor.putString(KEY_USER_EMAIL,userEmail);
    editor.putInt(KEY_USER_TYPE,userType);
    editor.commit();
  }
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") public void login(User user,String token){
  if (!TextUtils.isEmpty(token)) {
    accessToken=token;
    isLoggedIn=true;
    userFullName=user.getFullName();
    userUsername=user.getUsername();
    userType=user.getType();
    userEmail=user.getEmail();
    SharedPreferences.Editor editor=prefs.edit();
    editor.putString(KEY_ACCESS_TOKEN,accessToken);
    editor.putString(KEY_USER_FULL_NAME,userFullName);
    editor.putString(KEY_USER_USERNAME,userUsername);
    editor.putString(KEY_USER_EMAIL,userEmail);
    editor.putInt(KEY_USER_TYPE,userType);
    editor.commit();
  }
}
Program: 40030
Project: 40030
Buggy source:
public boolean logout(){
  if (isLoggedIn) {
    isLoggedIn=false;
    accessToken=null;
    userFullName=null;
    userUsername=null;
    userType=0;
    userEmail=null;
    SharedPreferences.Editor editor=prefs.edit();
    editor.putString(KEY_ACCESS_TOKEN,accessToken);
    editor.putString(KEY_USER_FULL_NAME,userFullName);
    editor.putInt(KEY_USER_TYPE,userType);
    editor.apply();
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean logout(){
  if (isLoggedIn) {
    isLoggedIn=false;
    accessToken=null;
    userFullName=null;
    userUsername=null;
    userType=0;
    userEmail=null;
    SharedPreferences.Editor editor=prefs.edit();
    editor.putString(KEY_ACCESS_TOKEN,accessToken);
    editor.putString(KEY_USER_FULL_NAME,userFullName);
    editor.putString(KEY_USER_USERNAME,userUsername);
    editor.putString(KEY_USER_EMAIL,userEmail);
    editor.putInt(KEY_USER_TYPE,userType);
    editor.apply();
    return true;
  }
  return false;
}
Program: 40031
Project: 40031
Buggy source:
private ApiPrefs(Context context){
  prefs=context.getApplicationContext().getSharedPreferences(APP_PREF,Context.MODE_PRIVATE);
  accessToken=prefs.getString(KEY_ACCESS_TOKEN,null);
  isLoggedIn=!TextUtils.isEmpty(accessToken);
  if (isLoggedIn) {
    userFullName=prefs.getString(KEY_USER_FULL_NAME,null);
    userUsername=prefs.getString(KEY_USER_USERNAME,null);
    userEmail=prefs.getString(KEY_USER_EMAIL,null);
    userType=prefs.getInt(KEY_USER_TYPE,0);
  }
}

Fixed version (ground truth):
private ApiPrefs(Context context){
  prefs=context.getApplicationContext().getSharedPreferences(APP_PREF,Context.MODE_PRIVATE);
  accessToken=prefs.getString(KEY_ACCESS_TOKEN,null);
  Utils.print("String_Node_Str",accessToken + "String_Node_Str");
  isLoggedIn=!TextUtils.isEmpty(accessToken);
  if (isLoggedIn) {
    userFullName=prefs.getString(KEY_USER_FULL_NAME,null);
    userUsername=prefs.getString(KEY_USER_USERNAME,null);
    userEmail=prefs.getString(KEY_USER_EMAIL,null);
    userType=prefs.getInt(KEY_USER_TYPE,0);
  }
}
Program: 40032
Project: 40032
Buggy source:
@Override public void onResponse(@NonNull Call<Ping> call,@NonNull Response<Ping> response){
  Utils.print(TAG,"String_Node_Str");
  Utils.print(TAG,"String_Node_Str" + response.raw().request().url());
  Utils.print(TAG,"String_Node_Str" + response.code());
  if (response.isSuccessful()) {
    mAppPrefs.login(response.body().getUser(),response.body().getToken());
    updateUi();
  }
 else {
    Utils.print(TAG,"String_Node_Str" + response.message(),Log.ERROR);
    updateUi();
    mAppPrefs.logout();
  }
}

Fixed version (ground truth):
@Override public void onResponse(@NonNull Call<Ping> call,@NonNull Response<Ping> response){
  Utils.print(TAG,"String_Node_Str");
  Utils.print(TAG,"String_Node_Str" + response.raw().request().url());
  Utils.print(TAG,"String_Node_Str" + response.code());
  if (response.isSuccessful()) {
    mAppPrefs.login(response.body().getUser(),response.body().getToken());
    updateUi();
  }
 else {
    Utils.print(TAG,"String_Node_Str" + response.message(),Log.ERROR);
    updateUi();
  }
}
Program: 40033
Project: 40033
Buggy source:
private void ping(){
  Utils.print(TAG,"String_Node_Str");
  mAppPrefs.getApi().ping(mAppPrefs.getAccessToken()).enqueue(new Callback<Ping>(){
    @Override public void onResponse(    @NonNull Call<Ping> call,    @NonNull Response<Ping> response){
      Utils.print(TAG,"String_Node_Str");
      Utils.print(TAG,"String_Node_Str" + response.raw().request().url());
      Utils.print(TAG,"String_Node_Str" + response.code());
      if (response.isSuccessful()) {
        mAppPrefs.login(response.body().getUser(),response.body().getToken());
        updateUi();
      }
 else {
        Utils.print(TAG,"String_Node_Str" + response.message(),Log.ERROR);
        updateUi();
        mAppPrefs.logout();
      }
    }
    @Override public void onFailure(    @NonNull Call<Ping> call,    @NonNull Throwable t){
      Utils.print(TAG,"String_Node_Str",Log.ERROR);
      Utils.print(TAG,t.toString(),Log.ERROR);
      updateUi();
      mAppPrefs.logout();
    }
  }
);
}

Fixed version (ground truth):
private void ping(){
  Utils.print(TAG,"String_Node_Str");
  mAppPrefs.getApi().ping(mAppPrefs.getAccessToken()).enqueue(new Callback<Ping>(){
    @Override public void onResponse(    @NonNull Call<Ping> call,    @NonNull Response<Ping> response){
      Utils.print(TAG,"String_Node_Str");
      Utils.print(TAG,"String_Node_Str" + response.raw().request().url());
      Utils.print(TAG,"String_Node_Str" + response.code());
      if (response.isSuccessful()) {
        mAppPrefs.login(response.body().getUser(),response.body().getToken());
        updateUi();
      }
 else {
        Utils.print(TAG,"String_Node_Str" + response.message(),Log.ERROR);
        updateUi();
      }
    }
    @Override public void onFailure(    @NonNull Call<Ping> call,    @NonNull Throwable t){
      Utils.print(TAG,"String_Node_Str",Log.ERROR);
      Utils.print(TAG,t.toString(),Log.ERROR);
      updateUi();
    }
  }
);
}
Program: 40034
Project: 40034
Buggy source:
@Override public void onFailure(@NonNull Call<Ping> call,@NonNull Throwable t){
  Utils.print(TAG,"String_Node_Str",Log.ERROR);
  Utils.print(TAG,t.toString(),Log.ERROR);
  updateUi();
  mAppPrefs.logout();
}

Fixed version (ground truth):
@Override public void onFailure(@NonNull Call<Ping> call,@NonNull Throwable t){
  Utils.print(TAG,"String_Node_Str",Log.ERROR);
  Utils.print(TAG,t.toString(),Log.ERROR);
  updateUi();
}
Program: 40035
Project: 40035
Buggy source:
@Override public void onResponse(@NonNull Call<Ping> call,@NonNull Response<Ping> response){
  Utils.print(TAG,"String_Node_Str");
  Utils.print(TAG,"String_Node_Str" + response.raw().request().url());
  Utils.print(TAG,"String_Node_Str" + response.code());
  if (response.isSuccessful()) {
    mAppPrefs.login(response.body().getUser(),response.body().getToken());
    updateUi();
  }
 else {
    Utils.print(TAG,"String_Node_Str" + response.message(),Log.ERROR);
    updateUi();
  }
}

Fixed version (ground truth):
@Override public void onResponse(@NonNull Call<Ping> call,@NonNull Response<Ping> response){
  Utils.print(TAG,"String_Node_Str");
  Utils.print(TAG,"String_Node_Str" + response.raw().request().url());
  Utils.print(TAG,"String_Node_Str" + response.code());
  if (response.isSuccessful()) {
    mAppPrefs.login(response.body().getUser(),response.body().getToken());
    updateUi();
  }
 else {
    Utils.print(TAG,"String_Node_Str" + response.message(),Log.ERROR);
    updateUi();
    mAppPrefs.logout();
  }
}
Program: 40036
Project: 40036
Buggy source:
private void ping(){
  Utils.print(TAG,"String_Node_Str");
  mAppPrefs.getApi().ping(mAppPrefs.getAccessToken()).enqueue(new Callback<Ping>(){
    @Override public void onResponse(    @NonNull Call<Ping> call,    @NonNull Response<Ping> response){
      Utils.print(TAG,"String_Node_Str");
      Utils.print(TAG,"String_Node_Str" + response.raw().request().url());
      Utils.print(TAG,"String_Node_Str" + response.code());
      if (response.isSuccessful()) {
        mAppPrefs.login(response.body().getUser(),response.body().getToken());
        updateUi();
      }
 else {
        Utils.print(TAG,"String_Node_Str" + response.message(),Log.ERROR);
        updateUi();
      }
    }
    @Override public void onFailure(    @NonNull Call<Ping> call,    @NonNull Throwable t){
      Utils.print(TAG,"String_Node_Str",Log.ERROR);
      Utils.print(TAG,t.toString(),Log.ERROR);
      updateUi();
    }
  }
);
}

Fixed version (ground truth):
private void ping(){
  Utils.print(TAG,"String_Node_Str");
  mAppPrefs.getApi().ping(mAppPrefs.getAccessToken()).enqueue(new Callback<Ping>(){
    @Override public void onResponse(    @NonNull Call<Ping> call,    @NonNull Response<Ping> response){
      Utils.print(TAG,"String_Node_Str");
      Utils.print(TAG,"String_Node_Str" + response.raw().request().url());
      Utils.print(TAG,"String_Node_Str" + response.code());
      if (response.isSuccessful()) {
        mAppPrefs.login(response.body().getUser(),response.body().getToken());
        updateUi();
      }
 else {
        Utils.print(TAG,"String_Node_Str" + response.message(),Log.ERROR);
        updateUi();
        mAppPrefs.logout();
      }
    }
    @Override public void onFailure(    @NonNull Call<Ping> call,    @NonNull Throwable t){
      Utils.print(TAG,"String_Node_Str",Log.ERROR);
      Utils.print(TAG,t.toString(),Log.ERROR);
      updateUi();
      mAppPrefs.logout();
    }
  }
);
}
Program: 40037
Project: 40037
Buggy source:
@Override public void onFailure(@NonNull Call<Ping> call,@NonNull Throwable t){
  Utils.print(TAG,"String_Node_Str",Log.ERROR);
  Utils.print(TAG,t.toString(),Log.ERROR);
  updateUi();
}

Fixed version (ground truth):
@Override public void onFailure(@NonNull Call<Ping> call,@NonNull Throwable t){
  Utils.print(TAG,"String_Node_Str",Log.ERROR);
  Utils.print(TAG,t.toString(),Log.ERROR);
  updateUi();
  mAppPrefs.logout();
}
Program: 40038
Project: 40038
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Element adsElement=new Element();
  adsElement.setTitle("String_Node_Str");
  View aboutPage=new AboutPage(this).isRTL(false).setImage(R.drawable.smaplelogo).setDescription("String_Node_Str").addItem(new Element().setTitle("String_Node_Str")).addItem(new Element().setTitle("String_Node_Str").setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      Log.d("String_Node_Str","String_Node_Str");
      Intent intent=new Intent();
      intent.setClass(getApplicationContext(),PrivatePolicyActivity.class);
      startActivityForResult(intent,100);
    }
  }
)).addItem(new Element().setTitle("String_Node_Str").setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      Log.d("String_Node_Str","String_Node_Str");
      Intent intent=new Intent();
      intent.setClass(getApplicationContext(),LibActivity.class);
      startActivityForResult(intent,100);
    }
  }
)).addGroup("String_Node_Str").addEmail("String_Node_Str").addGitHub("String_Node_Str").addPlayStore("String_Node_Str").addItem(createCopyright()).create();
  setContentView(aboutPage);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_about);
  toolbar=findViewById(R.id.toolbar);
  setupToolbar(false,true);
  ConstraintLayout mRoot=findViewById(R.id.main_view);
  Element adsElement=new Element();
  adsElement.setTitle("String_Node_Str");
  View aboutPage=new AboutPage(this).isRTL(false).setImage(R.drawable.smaplelogo).setDescription("String_Node_Str").addItem(new Element().setTitle("String_Node_Str")).addItem(new Element().setTitle("String_Node_Str").setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      Log.d("String_Node_Str","String_Node_Str");
      Intent intent=new Intent();
      intent.setClass(getApplicationContext(),PrivatePolicyActivity.class);
      startActivityForResult(intent,100);
    }
  }
)).addItem(new Element().setTitle("String_Node_Str").setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      Log.d("String_Node_Str","String_Node_Str");
      Intent intent=new Intent();
      intent.setClass(getApplicationContext(),LibActivity.class);
      startActivityForResult(intent,100);
    }
  }
)).addGroup("String_Node_Str").addEmail("String_Node_Str").addGitHub("String_Node_Str").addPlayStore("String_Node_Str").addItem(createCopyright()).create();
  mRoot.addView(aboutPage,1);
}
Program: 40039
Project: 40039
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (mContext == null)   mContext=getActivity().getApplicationContext();
  Utils.print(TAG,"String_Node_Str");
  mApiPrefs=ApiPrefs.get(mContext);
  if (getArguments() != null) {
    mColumnCount=getArguments().getInt(ARG_COLUMN_COUNT,1);
    mSource=getArguments().getString(ARG_PARAM_SOURCE,"String_Node_Str");
  }
  Utils.print("String_Node_Str","String_Node_Str" + mSource + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (mContext == null)   mContext=getActivity().getApplicationContext();
  Utils.print(TAG,"String_Node_Str");
  mApiPrefs=ApiPrefs.get(mContext);
  if (getArguments() != null) {
    mColumnCount=getArguments().getInt(ARG_COLUMN_COUNT,1);
    mSource=getArguments().getString(ARG_PARAM_SOURCE,"String_Node_Str");
  }
}
Program: 40040
Project: 40040
Buggy source:
void bindNews(final boolean postponeEnterTransition){
  createMap();
  Glide.with(this).load(newsItem.getCover()).apply(new RequestOptions().centerCrop().error(R.drawable.sample)).into(ivCover);
  if (postponeEnterTransition)   postponeEnterTransition();
  ivCover.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
    @Override public boolean onPreDraw(){
      ivCover.getViewTreeObserver().removeOnPreDrawListener(this);
      calculateFabPosition();
      if (postponeEnterTransition)       startPostponedEnterTransition();
      return true;
    }
  }
);
  tvTitle.setText(newsItem.getTitle());
  tvArticle.setText(newsItem.getArticle());
  if (newsItem.getViews() > 0) {
    tvViews.setVisibility(View.VISIBLE);
    String views=getResources().getQuantityString(R.plurals.views,newsItem.getViews(),newsItem.getViews());
    tvViews.setText(views);
  }
 else {
    tvViews.setVisibility(View.GONE);
  }
  String date=Utils.getDateAgo(getApplicationContext(),newsItem.getCreatedAt());
  tvDate.setText(date);
  String source=mSources.get(newsItem.getSource());
  if (source != null)   tvSource.setText(source);
 else   tvSource.setText(R.string.news);
}

Fixed version (ground truth):
void bindNews(final boolean postponeEnterTransition){
  createMap();
  Glide.with(this).load(newsItem.getCover()).apply(new RequestOptions().centerCrop().error(R.drawable.sample)).into(ivCover);
  if (postponeEnterTransition)   postponeEnterTransition();
  ivCover.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
    @Override public boolean onPreDraw(){
      ivCover.getViewTreeObserver().removeOnPreDrawListener(this);
      calculateFabPosition();
      if (postponeEnterTransition)       startPostponedEnterTransition();
      return true;
    }
  }
);
  Utils.print(TAG,newsItem.getArticle());
  tvTitle.setText(newsItem.getTitle());
  tvArticle.setText(newsItem.getArticle());
  if (newsItem.getViews() > 0) {
    tvViews.setVisibility(View.VISIBLE);
    String views=getResources().getQuantityString(R.plurals.views,newsItem.getViews(),newsItem.getViews());
    tvViews.setText(views);
  }
 else {
    tvViews.setVisibility(View.GONE);
  }
  String date=Utils.getDateAgo(getApplicationContext(),newsItem.getCreatedAt());
  tvDate.setText(date);
  String source=mSources.get(newsItem.getSource());
  if (source != null)   tvSource.setText(source);
 else   tvSource.setText(R.string.news);
}
Program: 40041
Project: 40041
Buggy source:
public String getSubtitle(){
  return article.substring(0,Math.min(article.length(),100)).replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public String getSubtitle(){
  return "String_Node_Str";
}
Program: 40042
Project: 40042
Buggy source:
void bindNews(final boolean postponeEnterTransition){
  createMap();
  Glide.with(this).load(newsItem.getCover()).apply(new RequestOptions().centerCrop().error(R.drawable.sample)).into(ivCover);
  if (postponeEnterTransition)   postponeEnterTransition();
  ivCover.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
    @Override public boolean onPreDraw(){
      ivCover.getViewTreeObserver().removeOnPreDrawListener(this);
      calculateFabPosition();
      if (postponeEnterTransition)       startPostponedEnterTransition();
      return true;
    }
  }
);
  Utils.print(TAG,newsItem.getArticle());
  tvTitle.setText(newsItem.getTitle());
  tvArticle.setText(newsItem.getArticle());
  if (newsItem.getViews() > 0) {
    tvViews.setVisibility(View.VISIBLE);
    String views=getResources().getQuantityString(R.plurals.views,newsItem.getViews(),newsItem.getViews());
    tvViews.setText(views);
  }
 else {
    tvViews.setVisibility(View.GONE);
  }
  String date=Utils.getDateAgo(getApplicationContext(),newsItem.getCreatedAt());
  tvDate.setText(date);
  String source=mSources.get(newsItem.getSource());
  if (source != null)   tvSource.setText(source);
 else   tvSource.setText(R.string.news);
}

Fixed version (ground truth):
void bindNews(final boolean postponeEnterTransition){
  createMap();
  Glide.with(this).load(newsItem.getCover()).apply(new RequestOptions().centerCrop().error(R.drawable.sample)).into(ivCover);
  if (postponeEnterTransition)   postponeEnterTransition();
  ivCover.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
    @Override public boolean onPreDraw(){
      ivCover.getViewTreeObserver().removeOnPreDrawListener(this);
      calculateFabPosition();
      if (postponeEnterTransition)       startPostponedEnterTransition();
      return true;
    }
  }
);
  tvTitle.setText(newsItem.getTitle());
  tvArticle.setText(newsItem.getArticle());
  if (newsItem.getViews() > 0) {
    tvViews.setVisibility(View.VISIBLE);
    String views=getResources().getQuantityString(R.plurals.views,newsItem.getViews(),newsItem.getViews());
    tvViews.setText(views);
  }
 else {
    tvViews.setVisibility(View.GONE);
  }
  String date=Utils.getDateAgo(getApplicationContext(),newsItem.getCreatedAt());
  tvDate.setText(date);
  String source=mSources.get(newsItem.getSource());
  if (source != null)   tvSource.setText(source);
 else   tvSource.setText(R.string.news);
}
Program: 40043
Project: 40043
Buggy source:
@Override public void start(){
  if (!started.compareAndSet(false,true)) {
    return;
  }
  ThreadFactory f=(  Runnable r) -> new Thread(r,"String_Node_Str");
  scheduler=new ScheduledThreadPoolExecutor(1,f);
  scheduler.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
  scheduler.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
  scheduler.setRemoveOnCancelPolicy(true);
  Runnable poller=() -> {
    poll();
  }
;
  scheduler.scheduleWithFixedDelay(poller,ackPollInterval,ackPollInterval,TimeUnit.SECONDS);
  ThreadFactory e=(  Runnable r) -> new Thread(r,"String_Node_Str");
  executorService=Executors.newFixedThreadPool(pollThreads,e);
}

Fixed version (ground truth):
@Override public void start(){
  if (!started.compareAndSet(false,true)) {
    return;
  }
  ThreadFactory f=(  Runnable r) -> new Thread(r,"String_Node_Str");
  scheduler=new ScheduledThreadPoolExecutor(1,f);
  scheduler.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
  scheduler.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
  scheduler.setRemoveOnCancelPolicy(true);
  Runnable poller=() -> {
    try {
      poll();
    }
 catch (    HecException e) {
      log.error("String_Node_Str",e);
    }
  }
;
  scheduler.scheduleWithFixedDelay(poller,ackPollInterval,ackPollInterval,TimeUnit.SECONDS);
  ThreadFactory e=(  Runnable r) -> new Thread(r,"String_Node_Str");
  executorService=Executors.newFixedThreadPool(pollThreads,e);
}
Program: 40044
Project: 40044
Buggy source:
private void findAndRemoveTimedoutBatches(Map<Long,EventBatch> batches,List<EventBatch> timeouts){
  Iterator<Map.Entry<Long,EventBatch>> iterator=batches.entrySet().iterator();
  while (iterator.hasNext()) {
    EventBatch batch=iterator.next().getValue();
    if (batch.isTimedout(eventBatchTimeout)) {
      timeouts.add(batch);
      iterator.remove();
    }
  }
}

Fixed version (ground truth):
private void findAndRemoveTimedoutBatches(Map<Long,EventBatch> batches,List<EventBatch> timeouts){
  Iterator<Map.Entry<Long,EventBatch>> iterator=batches.entrySet().iterator();
  while (iterator.hasNext()) {
    EventBatch batch=iterator.next().getValue();
    if (batch.isTimedout(eventBatchTimeout)) {
      batch.fail();
      timeouts.add(batch);
      iterator.remove();
    }
  }
}
Program: 40045
Project: 40045
Buggy source:
private void handleAckPollResponse(String resp,HecChannel channel){
  log.debug("String_Node_Str",resp);
  HecAckPollResponse ackPollResult;
  try {
    ackPollResult=jsonMapper.readValue(resp,HecAckPollResponse.class);
  }
 catch (  Exception ex) {
    log.error("String_Node_Str",ex);
    return;
  }
  handleAckPollResult(channel,ackPollResult);
}

Fixed version (ground truth):
private void handleAckPollResponse(String resp,HecChannel channel){
  log.debug("String_Node_Str",resp,channel);
  HecAckPollResponse ackPollResult;
  try {
    ackPollResult=jsonMapper.readValue(resp,HecAckPollResponse.class);
  }
 catch (  Exception ex) {
    log.error("String_Node_Str",ex);
    return;
  }
  handleAckPollResult(channel,ackPollResult);
}
Program: 40046
Project: 40046
Buggy source:
public void addFailedEventBatch(final EventBatch batch){
  if (!batch.isFailed()) {
    throw new RuntimeException("String_Node_Str");
  }
  failed.add(batch);
}

Fixed version (ground truth):
public void addFailedEventBatch(final EventBatch batch){
  if (!batch.isFailed()) {
    throw new RuntimeException("String_Node_Str");
  }
  failed.add(batch);
  log.info("String_Node_Str",failed.size());
}
Program: 40047
Project: 40047
Buggy source:
public void onEventFailure(final List<EventBatch> batches,Exception ex){
  for (  EventBatch batch : batches) {
    tracker.addFailedEventBatch(batch);
  }
}

Fixed version (ground truth):
public void onEventFailure(final List<EventBatch> batches,Exception ex){
  log.info("String_Node_Str",batches.size());
  for (  EventBatch batch : batches) {
    tracker.addFailedEventBatch(batch);
  }
}
Program: 40048
Project: 40048
Buggy source:
public void addEventBatch(final EventBatch batch){
  for (  final Event event : batch.getEvents()) {
    if (event.getTied() instanceof SinkRecord) {
      final SinkRecord record=(SinkRecord)event.getTied();
      TopicPartition tp=new TopicPartition(record.topic(),record.kafkaPartition());
      TreeMap<Long,EventBatch> tpRecords=all.get(tp);
      if (tpRecords == null) {
        tpRecords=new TreeMap<>();
        all.put(tp,tpRecords);
      }
      tpRecords.put(record.kafkaOffset(),batch);
      total+=1;
    }
  }
}

Fixed version (ground truth):
public void addEventBatch(final EventBatch batch){
  for (  final Event event : batch.getEvents()) {
    if (event.getTied() instanceof SinkRecord) {
      final SinkRecord record=(SinkRecord)event.getTied();
      TopicPartition tp=new TopicPartition(record.topic(),record.kafkaPartition());
      TreeMap<Long,EventBatch> tpRecords=all.get(tp);
      if (tpRecords == null) {
        tpRecords=new TreeMap<>();
        all.put(tp,tpRecords);
      }
      if (!tpRecords.containsKey(record.kafkaOffset())) {
        tpRecords.put(record.kafkaOffset(),batch);
        total+=1;
      }
    }
  }
}
Program: 40049
Project: 40049
Buggy source:
@Override public void put(Collection<SinkRecord> records){
  log.info("String_Node_Str",records.size());
  handleFailedBatches();
  preventTooManyOutstandingEvents();
  bufferedRecords.addAll(records);
  if (bufferedRecords.size() < connectorConfig.maxBatchSize) {
    if (System.currentTimeMillis() - lastFlushed < flushWindow) {
      return;
    }
    if (bufferedRecords.isEmpty()) {
      lastFlushed=System.currentTimeMillis();
      return;
    }
  }
  records=bufferedRecords;
  bufferedRecords=new ArrayList<>();
  lastFlushed=System.currentTimeMillis();
  if (connectorConfig.raw) {
    handleRaw(records);
  }
 else {
    handleEvent(records);
  }
}

Fixed version (ground truth):
@Override public void put(Collection<SinkRecord> records){
  log.debug("String_Node_Str",records.size(),tracker.totalEvents());
  handleFailedBatches();
  preventTooManyOutstandingEvents();
  bufferedRecords.addAll(records);
  if (bufferedRecords.size() < connectorConfig.maxBatchSize) {
    if (System.currentTimeMillis() - lastFlushed < flushWindow) {
      return;
    }
    if (bufferedRecords.isEmpty()) {
      lastFlushed=System.currentTimeMillis();
      return;
    }
  }
  records=bufferedRecords;
  bufferedRecords=new ArrayList<>();
  lastFlushed=System.currentTimeMillis();
  if (connectorConfig.raw) {
    handleRaw(records);
  }
 else {
    handleEvent(records);
  }
}
Program: 40050
Project: 40050
Buggy source:
private void preventTooManyOutstandingEvents(){
  if (tracker.totalEventBatches() >= connectorConfig.maxOutstandingEvents) {
    String msg=String.format("String_Node_Str",connectorConfig.maxOutstandingEvents);
    throw new RetriableException(new HecException(msg));
  }
}

Fixed version (ground truth):
private void preventTooManyOutstandingEvents(){
  if (tracker.totalEvents() >= connectorConfig.maxOutstandingEvents) {
    String msg=String.format("String_Node_Str",connectorConfig.maxOutstandingEvents);
    throw new RetriableException(new HecException(msg));
  }
}
Program: 40051
Project: 40051
Buggy source:
private void handleFailedBatches(){
  Collection<EventBatch> failed=tracker.getAndRemoveFailedRecords();
  if (failed.isEmpty()) {
    return;
  }
  long failedEvents=0;
  for (  final EventBatch batch : failed) {
    failedEvents+=batch.size();
    if (connectorConfig.maxRetries > 0 && batch.getFailureCount() > connectorConfig.maxRetries) {
      log.error("String_Node_Str",batch.size(),connectorConfig.maxRetries);
      continue;
    }
    send(batch);
  }
  log.info("String_Node_Str",failed.size());
  if (failedEvents * 10 > connectorConfig.maxOutstandingEvents) {
    String msg=String.format("String_Node_Str",connectorConfig.maxOutstandingEvents);
    throw new RetriableException(new HecException(msg));
  }
}

Fixed version (ground truth):
private void handleFailedBatches(){
  Collection<EventBatch> failed=tracker.getAndRemoveFailedRecords();
  if (failed.isEmpty()) {
    return;
  }
  log.debug("String_Node_Str",failed.size());
  long failedEvents=0;
  for (  final EventBatch batch : failed) {
    failedEvents+=batch.size();
    if (connectorConfig.maxRetries > 0 && batch.getFailureCount() > connectorConfig.maxRetries) {
      log.error("String_Node_Str",batch.size(),connectorConfig.maxRetries);
      continue;
    }
    send(batch);
  }
  log.info("String_Node_Str",failed.size(),failedEvents);
  if (failedEvents * 10 > connectorConfig.maxOutstandingEvents) {
    String msg=String.format("String_Node_Str",connectorConfig.maxOutstandingEvents);
    throw new RetriableException(new HecException(msg));
  }
}
Program: 40052
Project: 40052
Buggy source:
@Override public synchronized String executeHttpRequest(final HttpUriRequest req){
  CloseableHttpResponse resp;
  try {
    resp=httpClient.execute(req,context);
  }
 catch (  Exception ex) {
    log.error("String_Node_Str",ex);
    throw new HecException("String_Node_Str",ex);
  }
  return readAndCloseResponse(resp);
}

Fixed version (ground truth):
@Override public synchronized String executeHttpRequest(final HttpUriRequest req){
  CloseableHttpResponse resp;
  try {
    resp=httpClient.execute(req,context);
  }
 catch (  ConnectException ex) {
    backPressure+=1;
    log.error("String_Node_Str",ex);
    throw new HecException("String_Node_Str",ex);
  }
catch (  Exception ex) {
    log.error("String_Node_Str",ex);
    throw new HecException("String_Node_Str",ex);
  }
  return readAndCloseResponse(resp);
}
Program: 40053
Project: 40053
Buggy source:
public Map<TopicPartition,OffsetAndMetadata> computeOffsets(){
  Map<TopicPartition,OffsetAndMetadata> offsets=new HashMap<>();
  for (  Map.Entry<TopicPartition,TreeMap<Long,EventBatch>> entry : all.entrySet()) {
    long offset=-1;
    Iterator<Map.Entry<Long,EventBatch>> iter=entry.getValue().entrySet().iterator();
    for (; iter.hasNext(); ) {
      Map.Entry<Long,EventBatch> e=iter.next();
      if (e.getValue().isCommitted()) {
        offset=e.getKey();
        iter.remove();
      }
 else {
        break;
      }
    }
    if (offset >= 0) {
      offsets.put(entry.getKey(),new OffsetAndMetadata(offset + 1));
    }
  }
  return offsets;
}

Fixed version (ground truth):
public Map<TopicPartition,OffsetAndMetadata> computeOffsets(){
  Map<TopicPartition,OffsetAndMetadata> offsets=new HashMap<>();
  for (  Map.Entry<TopicPartition,TreeMap<Long,EventBatch>> entry : all.entrySet()) {
    long offset=-1;
    Iterator<Map.Entry<Long,EventBatch>> iter=entry.getValue().entrySet().iterator();
    for (; iter.hasNext(); ) {
      Map.Entry<Long,EventBatch> e=iter.next();
      if (e.getValue().isCommitted()) {
        offset=e.getKey();
        iter.remove();
        total-=1;
      }
 else {
        break;
      }
    }
    if (offset >= 0) {
      offsets.put(entry.getKey(),new OffsetAndMetadata(offset + 1));
    }
  }
  return offsets;
}
Program: 40054
Project: 40054
Buggy source:
public KafkaRecordTracker(){
  all=new HashMap<>();
  failed=new ConcurrentLinkedQueue<>();
}

Fixed version (ground truth):
public KafkaRecordTracker(){
  all=new HashMap<>();
  failed=new ConcurrentLinkedQueue<>();
  total=0;
}
Program: 40055
Project: 40055
Buggy source:
public void addEventBatch(final EventBatch batch){
  for (  final Event event : batch.getEvents()) {
    if (event.getTied() instanceof SinkRecord) {
      final SinkRecord record=(SinkRecord)event.getTied();
      TopicPartition tp=new TopicPartition(record.topic(),record.kafkaPartition());
      TreeMap<Long,EventBatch> tpRecords=all.get(tp);
      if (tpRecords == null) {
        tpRecords=new TreeMap<>();
        all.put(tp,tpRecords);
      }
      tpRecords.put(record.kafkaOffset(),batch);
    }
  }
}

Fixed version (ground truth):
public void addEventBatch(final EventBatch batch){
  for (  final Event event : batch.getEvents()) {
    if (event.getTied() instanceof SinkRecord) {
      final SinkRecord record=(SinkRecord)event.getTied();
      TopicPartition tp=new TopicPartition(record.topic(),record.kafkaPartition());
      TreeMap<Long,EventBatch> tpRecords=all.get(tp);
      if (tpRecords == null) {
        tpRecords=new TreeMap<>();
        all.put(tp,tpRecords);
      }
      tpRecords.put(record.kafkaOffset(),batch);
      total+=1;
    }
  }
}
Program: 40056
Project: 40056
Buggy source:
SplunkSinkConnectorConfig(Map<String,String> taskConfig){
  super(conf(),taskConfig);
  splunkToken=getPassword(TOKEN_CONF).value();
  splunkURI=getString(URI_CONF);
  raw=getBoolean(RAW_CONF);
  ack=getBoolean(ACK_CONF);
  indexes=getString(INDEX_CONF);
  sourcetypes=getString(SOURCETYPE_CONF);
  sources=getString(SOURCE_CONF);
  httpKeepAlive=getBoolean(HTTP_KEEPALIVE_CONF);
  validateCertificates=getBoolean(SSL_VALIDATE_CERTIFICATES_CONF);
  trustStorePath=getString(SSL_TRUSTSTORE_PATH_CONF);
  trustStorePassword=getPassword(SSL_TRUSTSTORE_PASSWORD_CONF).value();
  eventBatchTimeout=getInt(EVENT_TIMEOUT_CONF);
  ackPollInterval=getInt(ACK_POLL_INTERVAL_CONF);
  ackPollThreads=getInt(ACK_POLL_THREADS_CONF);
  maxHttpConnPerChannel=getInt(MAX_HTTP_CONNECTION_PER_CHANNEL_CONF);
  totalHecChannels=getInt(TOTAL_HEC_CHANNEL_CONF);
  socketTimeout=getInt(SOCKET_TIMEOUT_CONF);
  enrichements=parseEnrichements(getString(ENRICHEMENT_CONF));
  trackData=getBoolean(TRACK_DATA_CONF);
  maxBatchSize=getInt(MAX_BATCH_SIZE_CONF);
  numberOfThreads=getInt(HEC_THREDS_CONF);
  lineBreaker=getString(LINE_BREAKER_CONF);
  topicMetas=initMetaMap(taskConfig);
}

Fixed version (ground truth):
SplunkSinkConnectorConfig(Map<String,String> taskConfig){
  super(conf(),taskConfig);
  splunkToken=getPassword(TOKEN_CONF).value();
  splunkURI=getString(URI_CONF);
  raw=getBoolean(RAW_CONF);
  ack=getBoolean(ACK_CONF);
  indexes=getString(INDEX_CONF);
  sourcetypes=getString(SOURCETYPE_CONF);
  sources=getString(SOURCE_CONF);
  httpKeepAlive=getBoolean(HTTP_KEEPALIVE_CONF);
  validateCertificates=getBoolean(SSL_VALIDATE_CERTIFICATES_CONF);
  trustStorePath=getString(SSL_TRUSTSTORE_PATH_CONF);
  trustStorePassword=getPassword(SSL_TRUSTSTORE_PASSWORD_CONF).value();
  eventBatchTimeout=getInt(EVENT_TIMEOUT_CONF);
  ackPollInterval=getInt(ACK_POLL_INTERVAL_CONF);
  ackPollThreads=getInt(ACK_POLL_THREADS_CONF);
  maxHttpConnPerChannel=getInt(MAX_HTTP_CONNECTION_PER_CHANNEL_CONF);
  totalHecChannels=getInt(TOTAL_HEC_CHANNEL_CONF);
  socketTimeout=getInt(SOCKET_TIMEOUT_CONF);
  enrichments=parseEnrichments(getString(ENRICHMENT_CONF));
  trackData=getBoolean(TRACK_DATA_CONF);
  maxBatchSize=getInt(MAX_BATCH_SIZE_CONF);
  numberOfThreads=getInt(HEC_THREDS_CONF);
  lineBreaker=getString(LINE_BREAKER_CONF);
  maxOutstandingEvents=getInt(MAX_OUTSTANDING_EVENTS_CONF);
  maxRetries=getInt(MAX_RETRIES_CONF);
  topicMetas=initMetaMap(taskConfig);
}
Program: 40058
Project: 40058
Buggy source:
public String toString(){
  return "String_Node_Str" + splunkURI + "String_Node_Str"+ "String_Node_Str"+ raw+ "String_Node_Str"+ "String_Node_Str"+ ack+ "String_Node_Str"+ "String_Node_Str"+ indexes+ "String_Node_Str"+ "String_Node_Str"+ sourcetypes+ "String_Node_Str"+ "String_Node_Str"+ sources+ "String_Node_Str"+ "String_Node_Str"+ httpKeepAlive+ "String_Node_Str"+ "String_Node_Str"+ validateCertificates+ "String_Node_Str"+ "String_Node_Str"+ trustStorePath+ "String_Node_Str"+ "String_Node_Str"+ socketTimeout+ "String_Node_Str"+ "String_Node_Str"+ eventBatchTimeout+ "String_Node_Str"+ "String_Node_Str"+ ackPollInterval+ "String_Node_Str"+ "String_Node_Str"+ ackPollThreads+ "String_Node_Str"+ "String_Node_Str"+ maxHttpConnPerChannel+ "String_Node_Str"+ "String_Node_Str"+ totalHecChannels+ "String_Node_Str"+ "String_Node_Str"+ getString(ENRICHEMENT_CONF)+ "String_Node_Str"+ "String_Node_Str"+ maxBatchSize+ "String_Node_Str"+ "String_Node_Str"+ numberOfThreads+ "String_Node_Str"+ "String_Node_Str"+ lineBreaker+ "String_Node_Str"+ "String_Node_Str"+ trackData;
}

Fixed version (ground truth):
public String toString(){
  return "String_Node_Str" + splunkURI + "String_Node_Str"+ "String_Node_Str"+ raw+ "String_Node_Str"+ "String_Node_Str"+ ack+ "String_Node_Str"+ "String_Node_Str"+ indexes+ "String_Node_Str"+ "String_Node_Str"+ sourcetypes+ "String_Node_Str"+ "String_Node_Str"+ sources+ "String_Node_Str"+ "String_Node_Str"+ httpKeepAlive+ "String_Node_Str"+ "String_Node_Str"+ validateCertificates+ "String_Node_Str"+ "String_Node_Str"+ trustStorePath+ "String_Node_Str"+ "String_Node_Str"+ socketTimeout+ "String_Node_Str"+ "String_Node_Str"+ eventBatchTimeout+ "String_Node_Str"+ "String_Node_Str"+ ackPollInterval+ "String_Node_Str"+ "String_Node_Str"+ ackPollThreads+ "String_Node_Str"+ "String_Node_Str"+ maxHttpConnPerChannel+ "String_Node_Str"+ "String_Node_Str"+ totalHecChannels+ "String_Node_Str"+ "String_Node_Str"+ getString(ENRICHMENT_CONF)+ "String_Node_Str"+ "String_Node_Str"+ maxBatchSize+ "String_Node_Str"+ "String_Node_Str"+ numberOfThreads+ "String_Node_Str"+ "String_Node_Str"+ lineBreaker+ "String_Node_Str"+ "String_Node_Str"+ maxOutstandingEvents+ "String_Node_Str"+ "String_Node_Str"+ maxRetries+ "String_Node_Str"+ "String_Node_Str"+ trackData;
}
Program: 40059
Project: 40059
Buggy source:
public void onEventCommitted(final List<EventBatch> batches){
  for (  final EventBatch batch : batches) {
  }
}

Fixed version (ground truth):
public void onEventCommitted(final List<EventBatch> batches){
}
Program: 40060
Project: 40060
Buggy source:
private Event createHecEventFrom(SinkRecord record){
  if (connectorConfig.raw) {
    RawEvent event=new RawEvent(record.value(),record);
    event.setLineBreaker(connectorConfig.lineBreaker);
    return event;
  }
  JsonEvent event=new JsonEvent(record.value(),record);
  Map<String,String> metas=connectorConfig.topicMetas.get(record.topic());
  if (metas != null) {
    event.setIndex(metas.get(SplunkSinkConnectorConfig.INDEX));
    event.setSourcetype(metas.get(SplunkSinkConnectorConfig.SOURCETYPE));
    event.setSource(metas.get(SplunkSinkConnectorConfig.SOURCE));
    event.addFields(connectorConfig.enrichements);
  }
  if (connectorConfig.trackData) {
    Map<String,String> trackMetas=new HashMap<>();
    trackMetas.put("String_Node_Str",String.valueOf(record.kafkaOffset()));
    trackMetas.put("String_Node_Str",String.valueOf(record.timestamp()));
    trackMetas.put("String_Node_Str",record.topic());
    trackMetas.put("String_Node_Str",String.valueOf(record.kafkaPartition()));
    event.addFields(trackMetas);
  }
  return event;
}

Fixed version (ground truth):
private Event createHecEventFrom(SinkRecord record){
  if (connectorConfig.raw) {
    RawEvent event=new RawEvent(record.value(),record);
    event.setLineBreaker(connectorConfig.lineBreaker);
    return event;
  }
  JsonEvent event=new JsonEvent(record.value(),record);
  Map<String,String> metas=connectorConfig.topicMetas.get(record.topic());
  if (metas != null) {
    event.setIndex(metas.get(SplunkSinkConnectorConfig.INDEX));
    event.setSourcetype(metas.get(SplunkSinkConnectorConfig.SOURCETYPE));
    event.setSource(metas.get(SplunkSinkConnectorConfig.SOURCE));
    event.addFields(connectorConfig.enrichments);
  }
  if (connectorConfig.trackData) {
    Map<String,String> trackMetas=new HashMap<>();
    trackMetas.put("String_Node_Str",String.valueOf(record.kafkaOffset()));
    trackMetas.put("String_Node_Str",String.valueOf(record.timestamp()));
    trackMetas.put("String_Node_Str",record.topic());
    trackMetas.put("String_Node_Str",String.valueOf(record.kafkaPartition()));
    event.addFields(trackMetas);
  }
  return event;
}