nus-yam/ex-repair huggingface dataset:
Program: 174255
Project: 174255
Buggy source:
@Override public void onResponse(Call call,Response response){
  progressView.setVisibility(View.INVISIBLE);
  ArrayList<RequestModel> requestModels=(ArrayList<RequestModel>)response.body();
  this.requestModels.addAll(requestModels);
  adapter.notifyDataSetChanged();
  if (requestModels.size() > 0) {
    mRecyclerView.setVisibility(View.VISIBLE);
    mMessageTv.setVisibility(View.INVISIBLE);
  }
 else {
    mRecyclerView.setVisibility(View.INVISIBLE);
    mMessageTv.setVisibility(View.VISIBLE);
    mMessageTv.setText("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onResponse(Call call,Response response){
  progressView.setVisibility(View.INVISIBLE);
  ArrayList<RequestModel> requestModels=(ArrayList<RequestModel>)response.body();
  this.requestModels.addAll(requestModels);
  adapter.notifyDataSetChanged();
  if (this.requestModels.size() > 0) {
    mRecyclerView.setVisibility(View.VISIBLE);
    mMessageTv.setVisibility(View.INVISIBLE);
  }
 else {
    mRecyclerView.setVisibility(View.INVISIBLE);
    mMessageTv.setVisibility(View.VISIBLE);
    mMessageTv.setText("String_Node_Str");
  }
}
Program: 174256
Project: 174256
Buggy source:
@Override public void onResponse(Call call,Response response){
  progressView.setVisibility(View.INVISIBLE);
  ArrayList<RequestModel> requestModels=(ArrayList<RequestModel>)response.body();
  this.requestModels.addAll(requestModels);
  adapter.notifyDataSetChanged();
  if (requestModels.size() > 0) {
    mRecyclerView.setVisibility(View.VISIBLE);
    mMessageTv.setVisibility(View.INVISIBLE);
  }
 else {
    mRecyclerView.setVisibility(View.INVISIBLE);
    mMessageTv.setVisibility(View.VISIBLE);
    mMessageTv.setText("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onResponse(Call call,Response response){
  progressView.setVisibility(View.INVISIBLE);
  ArrayList<RequestModel> requestModels=(ArrayList<RequestModel>)response.body();
  this.requestModels.addAll(requestModels);
  adapter.notifyDataSetChanged();
  if (this.requestModels.size() > 0) {
    mRecyclerView.setVisibility(View.VISIBLE);
    mMessageTv.setVisibility(View.INVISIBLE);
  }
 else {
    mRecyclerView.setVisibility(View.INVISIBLE);
    mMessageTv.setVisibility(View.VISIBLE);
    mMessageTv.setText("String_Node_Str");
  }
}
Program: 174257
Project: 174257
Buggy source:
@Override protected void init(){
  super.init();
  adapter=new GiftListAdapter(context,gifts);
  mRecyclerView.setAdapter(adapter);
  linearLayoutManager=new LinearLayoutManager(context);
  mRecyclerView.setLayoutManager(linearLayoutManager);
  mRecyclerView.addOnScrollListener(new EndlessRecyclerViewScrollListener(linearLayoutManager){
    @Override public void onLoadMore(    int page,    int totalItemsCount){
      if (page > 1)       getBookmarks();
    }
  }
);
  getBookmarks();
}

Fixed version (ground truth):
@Override protected void init(){
  super.init();
  adapter=new GiftListAdapter(context,gifts);
  mRecyclerView.setAdapter(adapter);
  linearLayoutManager=new LinearLayoutManager(context);
  mRecyclerView.setLayoutManager(linearLayoutManager);
  mRecyclerView.addOnScrollListener(new EndlessRecyclerViewScrollListener(linearLayoutManager){
    @Override public void onLoadMore(    int page,    int totalItemsCount){
      if (page > 1)       getBookmarks();
    }
  }
);
}
Program: 174258
Project: 174258
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (rootView != null) {
    if (rootView.getParent() != null)     ((ViewGroup)rootView.getParent()).removeView(rootView);
    return rootView;
  }
  rootView=inflater.inflate(R.layout.fragment_bookmark,container,false);
  ButterKnife.bind(this,rootView);
  init();
  gifts.clear();
  if (AppController.getStoredString(Constants.Authorization) != null) {
  }
 else {
    mLoginBtn.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        startActivity(new Intent(getActivity(),LoginActivity.class));
      }
    }
);
  }
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (rootView != null) {
    if (rootView.getParent() != null)     ((ViewGroup)rootView.getParent()).removeView(rootView);
    return rootView;
  }
  rootView=inflater.inflate(R.layout.fragment_bookmark,container,false);
  ButterKnife.bind(this,rootView);
  init();
  gifts.clear();
  if (AppController.getStoredString(Constants.Authorization) != null) {
    getBookmarks();
  }
 else {
    mLoginBtn.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        startActivity(new Intent(getActivity(),LoginActivity.class));
      }
    }
);
  }
  return rootView;
}
Program: 174259
Project: 174259
Buggy source:
@Override public void onResume(){
  super.onResume();
  if (AppController.getStoredString(Constants.Authorization) != null) {
    mBookmarkTopLay.setVisibility(View.GONE);
    mBookmarkMainLay.setVisibility(View.VISIBLE);
    if (gifts.size() <= 0) {
      getBookmarks();
    }
  }
 else {
    mBookmarkTopLay.setVisibility(View.VISIBLE);
    mBookmarkMainLay.setVisibility(View.INVISIBLE);
  }
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  if (AppController.getStoredString(Constants.Authorization) != null) {
    mBookmarkTopLay.setVisibility(View.GONE);
    mBookmarkMainLay.setVisibility(View.VISIBLE);
    if (gifts.size() <= 0 && startIndex == 0) {
      getBookmarks();
    }
  }
 else {
    mBookmarkTopLay.setVisibility(View.VISIBLE);
    mBookmarkMainLay.setVisibility(View.INVISIBLE);
  }
}
Program: 174261
Project: 174261
Buggy source:
@FormUrlEncoded @POST("String_Node_Str") Call<TokenOutput> login(@Field("String_Node_Str") String username,@Field("String_Node_Str") String password,@Field("String_Node_Str") String grant_type);

Fixed version (ground truth):
@FormUrlEncoded @POST("String_Node_Str") Call<TokenOutput> login(@Field("String_Node_Str") String username,@Field("String_Node_Str") String password,@Field("String_Node_Str") String registerationId,@Field("String_Node_Str") String deviceId,@Field("String_Node_Str") String grant_type);
Program: 174262
Project: 174262
Buggy source:
@GET("String_Node_Str") Call<Map<String,String>> getStatistics(@Header(Constants.ContentType) String contentType);

Fixed version (ground truth):
@GET("String_Node_Str") Call<StatisticsOutput> getStatistics(@Header(Constants.ContentType) String contentType);
Program: 174263
Project: 174263
Buggy source:
@Override public void onResponse(Call call,Response response){
  super.onResponse(call,response);
  Map<String,String> characteristics=(Map<String,String>)response.body();
  int i=0;
  for (  Map.Entry<String,String> entry : characteristics.entrySet()) {
    i++;
    if (i > 1) {
      break;
    }
    String key=entry.getKey();
    String value=entry.getValue();
    TextView valueTxt=(TextView)rootView.findViewById(AppController.getAppContext().getResources().getIdentifier("String_Node_Str" + i,"String_Node_Str",getActivity().getPackageName()));
    valueTxt.setText(value);
    valueTxt.setVisibility(View.VISIBLE);
    TextView keyTxt=(TextView)rootView.findViewById(AppController.getAppContext().getResources().getIdentifier("String_Node_Str" + i,"String_Node_Str",getActivity().getPackageName()));
    keyTxt.setText(key);
    keyTxt.setVisibility(View.VISIBLE);
  }
}

Fixed version (ground truth):
@Override public void onResponse(Call call,Response response){
  super.onResponse(call,response);
  StatisticsOutput statisticsOutput=(StatisticsOutput)response.body();
  int i=0;
  for (  Map.Entry<String,String> entry : statisticsOutput.statistics.entrySet()) {
    i++;
    if (i > 10) {
      break;
    }
    String key=entry.getKey();
    String value=entry.getValue();
    TextView valueTxt=(TextView)rootView.findViewById(AppController.getAppContext().getResources().getIdentifier("String_Node_Str" + i,"String_Node_Str",getActivity().getPackageName()));
    valueTxt.setText(value);
    valueTxt.setVisibility(View.VISIBLE);
    TextView keyTxt=(TextView)rootView.findViewById(AppController.getAppContext().getResources().getIdentifier("String_Node_Str" + i,"String_Node_Str",getActivity().getPackageName()));
    keyTxt.setText(key);
    keyTxt.setVisibility(View.VISIBLE);
  }
}
Program: 174264
Project: 174264
Buggy source:
public void getStatistics(){
  Call<Map<String,String>> call=AppController.service.getStatistics(Constants.JSON_TYPE);
  call.enqueue(new CallbackWithRetry<Map<String,String>>(call,mContext){
    @Override public void onResponse(    Call<Map<String,String>> call,    Response<Map<String,String>> response){
      handlingOnResponse(new HandlingResponse(call,response,this));
    }
    @Override public void onFailure(    Call<Map<String,String>> call,    Throwable t){
      super.onFailure(call,t);
    }
  }
);
}

Fixed version (ground truth):
public void getStatistics(){
  Call<StatisticsOutput> call=AppController.service.getStatistics(Constants.JSON_TYPE);
  call.enqueue(new CallbackWithRetry<StatisticsOutput>(call,mContext){
    @Override public void onResponse(    Call<StatisticsOutput> call,    Response<StatisticsOutput> response){
      handlingOnResponse(new HandlingResponse(call,response,this));
    }
    @Override public void onFailure(    Call<StatisticsOutput> call,    Throwable t){
      super.onFailure(call,t);
    }
  }
);
}
Program: 174265
Project: 174265
Buggy source:
public void login(String verificationCode){
  Call<TokenOutput> call=AppController.accountService.login(AppController.getStoredString(Constants.TELEPHONE),verificationCode,"String_Node_Str");
  call.enqueue(new CallbackWithRetry<TokenOutput>(call,mContext){
    @Override public void onResponse(    Call<TokenOutput> call,    Response<TokenOutput> response){
      handlingOnResponse(new HandlingResponse(call,response,this));
    }
    @Override public void onFailure(    Call<TokenOutput> call,    Throwable t){
      super.onFailure(call,t);
    }
  }
);
}

Fixed version (ground truth):
public void login(String verificationCode,String deviceId){
  Call<TokenOutput> call=AppController.accountService.login(AppController.getStoredString(Constants.TELEPHONE),verificationCode,AppController.getStoredString(Constants.FIREBASE_REG_TOKEN),deviceId,"String_Node_Str");
  call.enqueue(new CallbackWithRetry<TokenOutput>(call,mContext){
    @Override public void onResponse(    Call<TokenOutput> call,    Response<TokenOutput> response){
      handlingOnResponse(new HandlingResponse(call,response,this));
    }
    @Override public void onFailure(    Call<TokenOutput> call,    Throwable t){
      super.onFailure(call,t);
    }
  }
);
}
Program: 174266
Project: 174266
Buggy source:
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  mBottomBar.onSaveInstanceState(outState);
}

Fixed version (ground truth):
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  if (mBottomBar != null)   mBottomBar.onSaveInstanceState(outState);
}
Program: 174268
Project: 174268
Buggy source:
@Override public void onClick(View v){
  AppController.storeString(SHARED_PREFERENCE_LAST_VERSION,version);
  dialog.dismiss();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  AppController.storeString(Constants.VERSION_SKIP_UPDATE,version);
  dialog.dismiss();
}
Program: 174269
Project: 174269
Buggy source:
private void findViews(){
  titleTextView=(TextView)dialog.findViewById(R.id.title_dialog_tv);
  contentTextView=(TextView)dialog.findViewById(R.id.notes_text_dialog_tv);
  updaterProgressbar=(ProgressBar)dialog.findViewById(R.id.update_progressbar);
  bodyTextView=(TextView)dialog.findViewById(R.id.main_text_dialog_tv);
  positiveBtn=(TextView)dialog.findViewById(R.id.posetive_btn_text);
  negtiveBtn=(TextView)dialog.findViewById(R.id.negative_btn_text);
  neverBtn=(TextView)dialog.findViewById(R.id.never_btn_text);
  progressPer=(TextView)dialog.findViewById(R.id.progressPercentage);
  cancelView=dialog.findViewById(R.id.cancel_lay);
}

Fixed version (ground truth):
private void findViews(){
  titleTextView=(TextView)dialog.findViewById(R.id.title_dialog_tv);
  contentTextView=(TextView)dialog.findViewById(R.id.notes_text_dialog_tv);
  updaterProgressbar=(ProgressBar)dialog.findViewById(R.id.update_progressbar);
  bodyTextView=(TextView)dialog.findViewById(R.id.main_text_dialog_tv);
  positiveBtn=(TextView)dialog.findViewById(R.id.posetive_btn_text);
  notNowBtn=(TextView)dialog.findViewById(R.id.not_now_btn_text);
  neverBtn=(TextView)dialog.findViewById(R.id.never_btn_text);
  progressPer=(TextView)dialog.findViewById(R.id.progressPercentage);
  cancelView=dialog.findViewById(R.id.cancel_lay);
}
Program: 174270
Project: 174270
Buggy source:
public void showUpdaterDialog(final Context context,String title,String body,ArrayList<String> textArray,String version,Intent[] intents,final boolean isForcedUpdate){
  this.isForcedUpdate=isForcedUpdate;
  String sharePrefAnswer=AppController.getStoredString(SHARED_PREFERENCE_LAST_VERSION);
  if (sharePrefAnswer != null && sharePrefAnswer.equals(getAppVersion(context)) && !isForcedUpdate)   return;
  this.intents=intents;
  this.context=context;
  mDownloadManager=DownloadManager.getInstance();
  mNotificationManager=NotificationManagerCompat.from(context);
  mDownloadDir=new File(Environment.getExternalStorageDirectory(),"String_Node_Str");
  fileDownloadPath=mDownloadDir.getPath() + File.separator + mUpdateDetail.updateApk.getName()+ "String_Node_Str";
  builder=MaterialDialogBuilder.create(context);
  dialog=builder.customView(R.layout.updater_dialog,false).show();
  dialog.setCancelable(!isForcedUpdate);
  findViews();
  init(title,body,textArray,version);
}

Fixed version (ground truth):
public void showUpdaterDialog(final Context context,String title,String body,ArrayList<String> textArray,String version,Intent[] intents,final boolean isForcedUpdate){
  this.isForcedUpdate=isForcedUpdate;
  String sharePrefAnswer=AppController.getStoredString(Constants.VERSION_SKIP_UPDATE);
  if (sharePrefAnswer != null && (getAppVersion(context).equals(version) || sharePrefAnswer.equals(version)) && !isForcedUpdate)   return;
  this.intents=intents;
  this.context=context;
  mDownloadManager=DownloadManager.getInstance();
  mNotificationManager=NotificationManagerCompat.from(context);
  mDownloadDir=new File(Environment.getExternalStorageDirectory(),"String_Node_Str");
  fileDownloadPath=mDownloadDir.getPath() + File.separator + mUpdateDetail.updateApk.getName()+ "String_Node_Str";
  builder=MaterialDialogBuilder.create(context);
  dialog=builder.customView(R.layout.updater_dialog,false).show();
  dialog.setCancelable(!isForcedUpdate);
  findViews();
  init(title,body,textArray,version);
}
Program: 174271
Project: 174271
Buggy source:
public static String getAppVersion(Context context){
  String version="String_Node_Str";
  try {
    PackageManager manager=context.getPackageManager();
    PackageInfo info=manager.getPackageInfo(context.getPackageName(),0);
    version=info.versionName;
  }
 catch (  PackageManager.NameNotFoundException e) {
    e.printStackTrace();
  }
  return version;
}

Fixed version (ground truth):
public static String getAppVersion(Context context){
  String version="String_Node_Str";
  try {
    PackageManager manager=context.getPackageManager();
    PackageInfo info=manager.getPackageInfo(context.getPackageName(),0);
    version=String.valueOf(info.versionCode);
  }
 catch (  PackageManager.NameNotFoundException e) {
    e.printStackTrace();
  }
  return version;
}
Program: 174272
Project: 174272
Buggy source:
private void cancelDownload(){
  mDownloadManager.cancel(mUpdateDetail.latestDownloadLink);
  progressPer.setText("String_Node_Str");
  positiveBtn.setEnabled(true);
  updaterProgressbar.setVisibility(View.GONE);
  progressPer.setVisibility(View.GONE);
  cancelView.setVisibility(View.GONE);
  positiveBtn.setVisibility(View.VISIBLE);
  if (!isForcedUpdate) {
    negtiveBtn.setVisibility(View.VISIBLE);
    neverBtn.setVisibility(View.VISIBLE);
  }
}

Fixed version (ground truth):
private void cancelDownload(){
  mDownloadManager.cancel(mUpdateDetail.latestDownloadLink);
  progressPer.setText("String_Node_Str");
  positiveBtn.setEnabled(true);
  updaterProgressbar.setVisibility(View.GONE);
  progressPer.setVisibility(View.GONE);
  cancelView.setVisibility(View.GONE);
  positiveBtn.setVisibility(View.VISIBLE);
  if (!isForcedUpdate) {
    notNowBtn.setVisibility(View.VISIBLE);
    neverBtn.setVisibility(View.VISIBLE);
  }
}
Program: 174273
Project: 174273
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_bottombar);
  ButterKnife.bind(this);
  context=this;
  currentVersionName=UpdateChecker.getAppVersion(context);
  homeFragment=HomeFragment.newInstance(Constants.HOME_PAGETYPE,null);
  searchFragment=HomeFragment.newInstance(Constants.SEARCH_PAGETYPE,null);
  categoriesGridFragment=new CategoriesGridFragment();
  myWallFragment=new MyWallFragment();
  settingToolbar();
  settingBottomBar(savedInstanceState);
  mToolbarNewGiftBtnTv.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (AppController.getStoredString(Constants.Authorization) != null) {
        startActivity(RegisterGiftActivity.createIntent());
      }
 else {
        startActivity(LoginActivity.createIntent());
      }
    }
  }
);
  mBottomBar.selectTabAtPosition(3,false);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  this.savedInstanceState=savedInstanceState;
  setContentView(R.layout.activity_bottombar);
  ButterKnife.bind(this);
  context=this;
  settingToolbar();
  currentVersionName=UpdateChecker.getAppVersion(context);
  mToolbarNewGiftBtnTv.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (AppController.getStoredString(Constants.Authorization) != null) {
        startActivity(RegisterGiftActivity.createIntent());
      }
 else {
        startActivity(LoginActivity.createIntent());
      }
    }
  }
);
  ApiRequest apiRequest=new ApiRequest(this,this);
  apiRequest.getUpdatedVersion();
}
Program: 174274
Project: 174274
Buggy source:
private void onUpdateVersionResponse(UpdateOutput updateOutput){
  boolean isForcedUpdate;
  if (updateOutput.force_update != null && updateOutput.force_update.equalsIgnoreCase("String_Node_Str")) {
    isForcedUpdate=true;
  }
 else {
    isForcedUpdate=false;
  }
  UpdateChecker updateChecker=new UpdateChecker(getResources().getString(R.string.app_name),updateOutput.version,updateOutput.apk_url,null,updateOutput.changes);
  if (!isForcedUpdate) {
  }
  if (currentVersionName.compareToIgnoreCase(updateChecker.mUpdateDetail.latestVersion) < 0) {
    Intent[] intents=new Intent[1];
    intents[0]=Intent.makeMainActivity(new ComponentName(AppController.getAppContext(),BottomBarActivity.class));
    updateChecker.showUpdaterDialog(context,getString(R.string.update_to_new_version),getString(R.string.exist_new_version),updateOutput.changes,updateOutput.version,intents,isForcedUpdate);
    AppController.getInstance().setIsCheckedUpdate(true);
  }
}

Fixed version (ground truth):
private void onUpdateVersionResponse(UpdateOutput updateOutput){
  boolean isForcedUpdate;
  if (updateOutput.force_update != null && updateOutput.force_update.equalsIgnoreCase("String_Node_Str")) {
    isForcedUpdate=true;
  }
 else {
    isForcedUpdate=false;
  }
  UpdateChecker updateChecker=new UpdateChecker(getResources().getString(R.string.app_name),updateOutput.version,updateOutput.apk_url,null,updateOutput.changes);
  if (!isForcedUpdate) {
    setContent();
  }
  if (DeviceInfo.getAppVersionCode() < Integer.valueOf(updateChecker.mUpdateDetail.latestVersion)) {
    Intent[] intents=new Intent[1];
    intents[0]=Intent.makeMainActivity(new ComponentName(AppController.getAppContext(),BottomBarActivity.class));
    updateChecker.showUpdaterDialog(context,getString(R.string.update_to_new_version),getString(R.string.exist_new_version),updateOutput.changes,updateOutput.version,intents,isForcedUpdate);
    AppController.getInstance().setIsCheckedUpdate(true);
  }
}
Program: 174276
Project: 174276
Buggy source:
@Override public void onCreate(){
  super.onCreate();
  mInstance=this;
  AppController.context=getApplicationContext();
  preferences=this.getSharedPreferences("String_Node_Str",MODE_PRIVATE);
  editor=preferences.edit();
  notificationManager=(NotificationManager)mInstance.getSystemService(Context.NOTIFICATION_SERVICE);
  retrofitInitialization();
}

Fixed version (ground truth):
@Override public void onCreate(){
  super.onCreate();
  mInstance=this;
  AppController.context=getApplicationContext();
  DownloadConfiguration configuration=new DownloadConfiguration();
  configuration.setMaxThreadNum(10);
  configuration.setThreadNum(3);
  DownloadManager.getInstance().init(getApplicationContext(),configuration);
  preferences=this.getSharedPreferences("String_Node_Str",MODE_PRIVATE);
  editor=preferences.edit();
  notificationManager=(NotificationManager)mInstance.getSystemService(Context.NOTIFICATION_SERVICE);
  retrofitInitialization();
}
Program: 174277
Project: 174277
Buggy source:
@POST("String_Node_Str") Call<UpdateOutput> getUpdatedVersion(@Body UpdateInput updateInput);

Fixed version (ground truth):
@GET("String_Node_Str" + Constants.VERSION_NAME + "String_Node_Str") Call<UpdateOutput> getUpdatedVersion(@Path(Constants.VERSION_NAME) int versionName);
Program: 174278
Project: 174278
Buggy source:
@Override public void retry(){
  if (progressView != null)   progressView.setVisibility(View.VISIBLE);
  super.retry();
}

Fixed version (ground truth):
@Override public void retry(){
  super.retry();
}
Program: 174279
Project: 174279
Buggy source:
public void getUpdatedVersion(UpdateInput updateInput,final ProgressView progressView){
  Call<UpdateOutput> result=AppController.service.getUpdatedVersion(updateInput);
  result.enqueue(new CallbackWithRetry<UpdateOutput>(result,mContext){
    @Override public void onResponse(    Call<UpdateOutput> call,    Response<UpdateOutput> response){
      handlingOnResponse(new HandlingResponse(call,response,this));
    }
    @Override public void retry(){
      if (progressView != null)       progressView.setVisibility(View.VISIBLE);
      super.retry();
    }
    @Override public void onFailure(    Call<UpdateOutput> call,    Throwable t){
      super.onFailure(call,t);
    }
  }
);
}

Fixed version (ground truth):
public void getUpdatedVersion(){
  Call<UpdateOutput> result=AppController.service.getUpdatedVersion(DeviceInfo.getAppVersionCode());
  result.enqueue(new CallbackWithRetry<UpdateOutput>(result,mContext){
    @Override public void onResponse(    Call<UpdateOutput> call,    Response<UpdateOutput> response){
      handlingOnResponse(new HandlingResponse(call,response,this));
    }
    @Override public void retry(){
      super.retry();
    }
    @Override public void onFailure(    Call<UpdateOutput> call,    Throwable t){
      super.onFailure(call,t);
    }
  }
);
}
Program: 174280
Project: 174280
Buggy source:
@Override public void onFailed(DownloadException e){
  super.onFailed(e);
  cancelDownload();
}

Fixed version (ground truth):
@Override public void onFailed(DownloadException e){
  super.onFailed(e);
  cancelDownload();
  if (e.getErrorCode() == 108) {
    Toasti.showS("String_Node_Str");
  }
 else {
    Toasti.showS("String_Node_Str");
  }
}
Program: 174281
Project: 174281
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (rootView != null) {
    if (rootView.getParent() != null)     ((ViewGroup)rootView.getParent()).removeView(rootView);
    return rootView;
  }
  rootView=inflater.inflate(R.layout.fragment_my_gifts,container,false);
  ButterKnife.bind(this,rootView);
  init();
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (rootView != null) {
    if (rootView.getParent() != null)     ((ViewGroup)rootView.getParent()).removeView(rootView);
    return rootView;
  }
  rootView=inflater.inflate(R.layout.fragment_my_gifts,container,false);
  ButterKnife.bind(this,rootView);
  init();
  if (AppController.getStoredString(Constants.Authorization) != null) {
    setupViewPager(mainVp);
    mainTabs.setupWithViewPager(mainVp);
    mainVp.setCurrentItem(2,false);
  }
 else {
    myGiftLoginBtn.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        startActivity(new Intent(getActivity(),LoginActivity.class));
      }
    }
);
  }
  return rootView;
}
Program: 174282
Project: 174282
Buggy source:
@Override public void onResume(){
  super.onResume();
  if (AppController.getStoredString(Constants.Authorization) != null) {
    setupViewPager(mainVp);
    mainTabs.setupWithViewPager(mainVp);
    myGiftTopLay.setVisibility(View.GONE);
    myGiftBottomLay.setVisibility(View.VISIBLE);
    mainVp.setCurrentItem(2,false);
  }
 else {
    myGiftTopLay.setVisibility(View.VISIBLE);
    myGiftBottomLay.setVisibility(View.INVISIBLE);
    myGiftLoginBtn.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        startActivity(new Intent(getActivity(),LoginActivity.class));
      }
    }
);
  }
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  if (AppController.getStoredString(Constants.Authorization) != null) {
    myGiftTopLay.setVisibility(View.GONE);
    myGiftBottomLay.setVisibility(View.VISIBLE);
  }
 else {
    myGiftTopLay.setVisibility(View.VISIBLE);
    myGiftBottomLay.setVisibility(View.INVISIBLE);
  }
}
Program: 174283
Project: 174283
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (rootView != null) {
    if (rootView.getParent() != null)     ((ViewGroup)rootView.getParent()).removeView(rootView);
    return rootView;
  }
  rootView=inflater.inflate(R.layout.fragment_my_requests,container,false);
  ButterKnife.bind(this,rootView);
  init();
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (rootView != null) {
    if (rootView.getParent() != null)     ((ViewGroup)rootView.getParent()).removeView(rootView);
    return rootView;
  }
  rootView=inflater.inflate(R.layout.fragment_my_requests,container,false);
  ButterKnife.bind(this,rootView);
  init();
  if (AppController.getStoredString(Constants.Authorization) != null) {
    setupViewPager(mainVp);
    mainTabs.setupWithViewPager(mainVp);
    mainVp.setCurrentItem(1,false);
  }
 else {
    myGiftLoginBtn.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        startActivity(new Intent(getActivity(),LoginActivity.class));
      }
    }
);
  }
  return rootView;
}
Program: 174284
Project: 174284
Buggy source:
@Override public void onResume(){
  super.onResume();
  if (AppController.getStoredString(Constants.Authorization) != null) {
    setupViewPager(mainVp);
    mainTabs.setupWithViewPager(mainVp);
    mainVp.setCurrentItem(1,false);
    myGiftTopLay.setVisibility(View.GONE);
    myGiftBottomLay.setVisibility(View.VISIBLE);
    mainVp.setCurrentItem(1,false);
  }
 else {
    myGiftTopLay.setVisibility(View.VISIBLE);
    myGiftBottomLay.setVisibility(View.INVISIBLE);
    myGiftLoginBtn.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        startActivity(new Intent(getActivity(),LoginActivity.class));
      }
    }
);
  }
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  if (AppController.getStoredString(Constants.Authorization) != null) {
    myGiftTopLay.setVisibility(View.GONE);
    myGiftBottomLay.setVisibility(View.VISIBLE);
  }
 else {
    myGiftTopLay.setVisibility(View.VISIBLE);
    myGiftBottomLay.setVisibility(View.INVISIBLE);
  }
}
Program: 174285
Project: 174285
Buggy source:
private void setListeners(){
  editTextIranSans.addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence charSequence,    int i,    int i1,    int i2){
    }
    @Override public void onTextChanged(    CharSequence charSequence,    int i,    int i1,    int i2){
      if (level4Original.getPlaces().size() > 0) {
        level4.getPlaces().clear();
        for (        Place p : level4Original.getPlaces()) {
          if (p.name.startsWith(charSequence.toString())) {
            level4.addPlace(p);
          }
        }
      }
 else {
        level2.getPlaces().clear();
        for (        Place p : level2Original.getPlaces()) {
          if (p.name.startsWith(charSequence.toString())) {
            level2.addPlace(p);
          }
        }
      }
      choosePlaceAdapter.notifyDataSetChanged();
    }
    @Override public void afterTextChanged(    Editable editable){
    }
  }
);
}

Fixed version (ground truth):
private void setListeners(){
  editTextIranSans.addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence charSequence,    int i,    int i1,    int i2){
    }
    @Override public void onTextChanged(    CharSequence charSequence,    int i,    int i1,    int i2){
      if (level4Original != null && level4Original.getPlaces().size() > 0) {
        level4.getPlaces().clear();
        for (        Place p : level4Original.getPlaces()) {
          if (p.name.startsWith(charSequence.toString())) {
            level4.addPlace(p);
          }
        }
      }
 else {
        level2.getPlaces().clear();
        for (        Place p : level2Original.getPlaces()) {
          if (p.name.startsWith(charSequence.toString())) {
            level2.addPlace(p);
          }
        }
      }
      choosePlaceAdapter.notifyDataSetChanged();
    }
    @Override public void afterTextChanged(    Editable editable){
    }
  }
);
}
Program: 174286
Project: 174286
Buggy source:
@Override public void onTextChanged(CharSequence charSequence,int i,int i1,int i2){
  if (level4Original.getPlaces().size() > 0) {
    level4.getPlaces().clear();
    for (    Place p : level4Original.getPlaces()) {
      if (p.name.startsWith(charSequence.toString())) {
        level4.addPlace(p);
      }
    }
  }
 else {
    level2.getPlaces().clear();
    for (    Place p : level2Original.getPlaces()) {
      if (p.name.startsWith(charSequence.toString())) {
        level2.addPlace(p);
      }
    }
  }
  choosePlaceAdapter.notifyDataSetChanged();
}

Fixed version (ground truth):
@Override public void onTextChanged(CharSequence charSequence,int i,int i1,int i2){
  if (level4Original != null && level4Original.getPlaces().size() > 0) {
    level4.getPlaces().clear();
    for (    Place p : level4Original.getPlaces()) {
      if (p.name.startsWith(charSequence.toString())) {
        level4.addPlace(p);
      }
    }
  }
 else {
    level2.getPlaces().clear();
    for (    Place p : level2Original.getPlaces()) {
      if (p.name.startsWith(charSequence.toString())) {
        level2.addPlace(p);
      }
    }
  }
  choosePlaceAdapter.notifyDataSetChanged();
}
Program: 174287
Project: 174287
Buggy source:
@POST("String_Node_Str") Call<ResponseBody> logout(@Header(Constants.ContentType) String contentType,@Header(Constants.Authorization) String authorization,@Path("String_Node_Str") String registerationId);

Fixed version (ground truth):
@POST("String_Node_Str") Call<ResponseBody> logout(@Header(Constants.ContentType) String contentType,@Header(Constants.Authorization) String authorization,@Body LogoutInput logoutInput);
Program: 174288
Project: 174288
Buggy source:
@Override protected void init(){
  super.init();
  adapter=new GiftListAdapter(context,gifts);
  mRecyclerView.setAdapter(adapter);
  linearLayoutManager=new LinearLayoutManager(context);
  mRecyclerView.setLayoutManager(linearLayoutManager);
  mRecyclerView.addOnScrollListener(new EndlessRecyclerViewScrollListener(linearLayoutManager){
    @Override public void onLoadMore(    int page,    int totalItemsCount){
      getDonatedGifts();
    }
  }
);
  getDonatedGifts();
  if (getArguments() != null) {
    userId=getArguments().getString(Constants.USER_ID);
  }
  if (userId == null)   userId=AppController.getStoredString(Constants.USER_ID);
}

Fixed version (ground truth):
@Override protected void init(){
  super.init();
  adapter=new GiftListAdapter(context,gifts);
  mRecyclerView.setAdapter(adapter);
  linearLayoutManager=new LinearLayoutManager(context);
  mRecyclerView.setLayoutManager(linearLayoutManager);
  if (getArguments() != null) {
    userId=getArguments().getString(Constants.USER_ID);
  }
  if (userId == null)   userId=AppController.getStoredString(Constants.USER_ID);
  mRecyclerView.addOnScrollListener(new EndlessRecyclerViewScrollListener(linearLayoutManager){
    @Override public void onLoadMore(    int page,    int totalItemsCount){
      getDonatedGifts();
    }
  }
);
  getDonatedGifts();
}
Program: 174289
Project: 174289
Buggy source:
@Override protected void init(){
  super.init();
  adapter=new GiftListAdapter(context,gifts);
  mRecyclerView.setAdapter(adapter);
  linearLayoutManager=new LinearLayoutManager(context);
  mRecyclerView.setLayoutManager(linearLayoutManager);
  mRecyclerView.addOnScrollListener(new EndlessRecyclerViewScrollListener(linearLayoutManager){
    @Override public void onLoadMore(    int page,    int totalItemsCount){
      getReceivedGifts();
    }
  }
);
  getReceivedGifts();
  if (getArguments() != null) {
    userId=getArguments().getString(Constants.USER_ID);
  }
  if (userId == null)   userId=AppController.getStoredString(Constants.USER_ID);
}

Fixed version (ground truth):
@Override protected void init(){
  super.init();
  adapter=new GiftListAdapter(context,gifts);
  mRecyclerView.setAdapter(adapter);
  linearLayoutManager=new LinearLayoutManager(context);
  mRecyclerView.setLayoutManager(linearLayoutManager);
  if (getArguments() != null) {
    userId=getArguments().getString(Constants.USER_ID);
  }
  if (userId == null)   userId=AppController.getStoredString(Constants.USER_ID);
  mRecyclerView.addOnScrollListener(new EndlessRecyclerViewScrollListener(linearLayoutManager){
    @Override public void onLoadMore(    int page,    int totalItemsCount){
      getReceivedGifts();
    }
  }
);
  getReceivedGifts();
}
Program: 174290
Project: 174290
Buggy source:
@Override protected void init(){
  super.init();
  adapter=new GiftListAdapter(context,gifts);
  mRecyclerView.setAdapter(adapter);
  linearLayoutManager=new LinearLayoutManager(context);
  mRecyclerView.setLayoutManager(linearLayoutManager);
  mRecyclerView.addOnScrollListener(new EndlessRecyclerViewScrollListener(linearLayoutManager){
    @Override public void onLoadMore(    int page,    int totalItemsCount){
      getRegisteredGifts();
    }
  }
);
  getRegisteredGifts();
  if (getArguments() != null) {
    userId=getArguments().getString(Constants.USER_ID);
  }
  if (userId == null)   userId=AppController.getStoredString(Constants.USER_ID);
}

Fixed version (ground truth):
@Override protected void init(){
  super.init();
  adapter=new GiftListAdapter(context,gifts);
  mRecyclerView.setAdapter(adapter);
  linearLayoutManager=new LinearLayoutManager(context);
  mRecyclerView.setLayoutManager(linearLayoutManager);
  if (getArguments() != null) {
    userId=getArguments().getString(Constants.USER_ID);
  }
  if (userId == null)   userId=AppController.getStoredString(Constants.USER_ID);
  mRecyclerView.addOnScrollListener(new EndlessRecyclerViewScrollListener(linearLayoutManager){
    @Override public void onLoadMore(    int page,    int totalItemsCount){
      getRegisteredGifts();
    }
  }
);
  getRegisteredGifts();
}
Program: 174294
Project: 174294
Buggy source:
public void enterTelephoneNumber(){
  AppController.storeString(Constants.TELEPHONE,null);
  phoneConfirimationCodeEt.setHint(getString(R.string.hint_telephone_field));
  phoneConfirimationCodeEt.setText("String_Node_Str");
  login_get_verification_tv.setText(getString(R.string.sign_up));
  not_recieved_code_btn.setVisibility(View.INVISIBLE);
  loginGetVerificationBtn.setOnClickListener(enterPhoneNumber);
}

Fixed version (ground truth):
public void enterTelephoneNumber(){
  AppController.storeString(Constants.TELEPHONE,null);
  phoneConfirimationCodeEt.setHint(getString(R.string.hint_telephone_field));
  phoneConfirimationCodeEt.setText("String_Node_Str");
  login_get_verification_tv.setText(getString(R.string.sign_up));
  secondBtnTv.setText("String_Node_Str");
  secondBtnLay.setOnClickListener(enterVerificationCodeState);
  loginGetVerificationBtn.setOnClickListener(enterPhoneNumber);
}
Program: 174295
Project: 174295
Buggy source:
@Override public void onResponse(Call call,Response response){
  progressView.setVisibility(View.INVISIBLE);
  login_get_verification_tv.setVisibility(View.VISIBLE);
  if (response.body() instanceof TokenOutput) {
    TokenOutput tokenOutput=(TokenOutput)response.body();
    AppController.storeString(Constants.Authorization,Constants.BEARER + "String_Node_Str" + tokenOutput.access_token);
    AppController.storeString(Constants.USERNAME,tokenOutput.userName);
    AppController.storeString(Constants.USER_ID,tokenOutput.userId);
    Toasti.showL("String_Node_Str" + NumberTranslator.toPersian(AppController.getStoredString(Constants.TELEPHONE)) + "String_Node_Str");
    finish();
  }
 else {
    enterVerificationCode();
  }
}

Fixed version (ground truth):
@Override public void onResponse(Call call,Response response){
  progressView.setVisibility(View.INVISIBLE);
  login_get_verification_tv.setVisibility(View.VISIBLE);
  if (response.body() instanceof TokenOutput) {
    TokenOutput tokenOutput=(TokenOutput)response.body();
    AppController.storeString(Constants.Authorization,Constants.BEARER + "String_Node_Str" + tokenOutput.access_token);
    AppController.storeString(Constants.USERNAME,tokenOutput.userName);
    AppController.storeString(Constants.USER_ID,tokenOutput.userId);
    Toasti.showS("String_Node_Str" + NumberTranslator.toPersian(AppController.getStoredString(Constants.TELEPHONE)) + "String_Node_Str");
    finish();
  }
 else   if (response.body() instanceof RegisterOutput) {
    String remainingSeconds=((RegisterOutput)response.body()).remainingSeconds;
    if (remainingSeconds != null && !remainingSeconds.equals("String_Node_Str")) {
      View view=this.getCurrentFocus();
      if (view != null) {
        InputMethodManager imm=(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(view.getWindowToken(),0);
      }
      Snackbari.showS(mToolbarTitleTextView,"String_Node_Str" + remainingSeconds + "String_Node_Str");
    }
 else {
      enterVerificationCode();
    }
  }
}
Program: 174296
Project: 174296
Buggy source:
@Override public void onClick(View v){
  AppController.storeString(Constants.TELEPHONE,null);
  enterTelephoneNumber();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  String phoneNumber=NumberTranslator.toEnglish(phoneConfirimationCodeEt.getText().toString());
  if (phoneNumber.length() != 11 || !phoneNumber.startsWith("String_Node_Str") || !phoneNumber.trim().matches(regexStr)) {
    Snackbari.showS(mBackBtn,"String_Node_Str");
    return;
  }
  AppController.storeString(Constants.TELEPHONE,phoneNumber);
  enterVerificationCode();
}
Program: 174297
Project: 174297
Buggy source:
public void enterVerificationCode(){
  phoneConfirimationCodeEt.setHint(getString(R.string.field_hint_verification_code));
  phoneConfirimationCodeEt.setText("String_Node_Str");
  login_get_verification_tv.setText(getString(R.string.sign_in));
  not_recieved_code_btn.setVisibility(View.VISIBLE);
  loginGetVerificationBtn.setOnClickListener(enterVerificationCodeListener);
}

Fixed version (ground truth):
public void enterVerificationCode(){
  phoneConfirimationCodeEt.setHint(getString(R.string.field_hint_verification_code));
  phoneConfirimationCodeEt.setText("String_Node_Str");
  login_get_verification_tv.setText(getString(R.string.sign_in));
  secondBtnTv.setText(getResources().getString(R.string.verification_not_received));
  secondBtnLay.setOnClickListener(notRecievedCode);
  loginGetVerificationBtn.setOnClickListener(enterVerificationCodeListener);
}
Program: 174298
Project: 174298
Buggy source:
@Override public void onFailure(Call call,Throwable t){
  progressView.setVisibility(View.INVISIBLE);
  login_get_verification_tv.setVisibility(View.VISIBLE);
  Toasti.showS("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onFailure(Call call,Throwable t){
  progressView.setVisibility(View.INVISIBLE);
  login_get_verification_tv.setVisibility(View.VISIBLE);
}
Program: 174299
Project: 174299
Buggy source:
@Override public void onClick(View view){
  Toasti.showS("String_Node_Str");
  giftImageUrls.remove(i);
  notifyDataSetChanged();
  ((UpdateImageGallery)mContext).onUpdateGallery();
}

Fixed version (ground truth):
@Override public void onClick(View view){
  giftImageUrls.remove(i);
  notifyDataSetChanged();
  ((UpdateImageGallery)mContext).onUpdateGallery();
}
Program: 174300
Project: 174300
Buggy source:
@Override public void onBindViewHolder(GiftGalleryHolder giftGalleryHolder,final int i){
  giftGalleryHolder.mCloseBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      Toasti.showS("String_Node_Str");
      giftImageUrls.remove(i);
      notifyDataSetChanged();
      ((UpdateImageGallery)mContext).onUpdateGallery();
    }
  }
);
  Glide.with(mContext).load(giftImageUrls.get(i)).centerCrop().placeholder(R.color.background).crossFade().into(giftGalleryHolder.mImageView);
}

Fixed version (ground truth):
@Override public void onBindViewHolder(GiftGalleryHolder giftGalleryHolder,final int i){
  giftGalleryHolder.mCloseBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      giftImageUrls.remove(i);
      notifyDataSetChanged();
      ((UpdateImageGallery)mContext).onUpdateGallery();
    }
  }
);
  Glide.with(mContext).load(giftImageUrls.get(i)).centerCrop().placeholder(R.color.background).crossFade().into(giftGalleryHolder.mImageView);
}
Program: 174301
Project: 174301
Buggy source:
@POST("String_Node_Str") Call<ResponseBody> register(@Path("String_Node_Str") String telephone);

Fixed version (ground truth):
@POST("String_Node_Str") Call<RegisterOutput> register(@Path("String_Node_Str") String telephone);
Program: 174302
Project: 174302
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (rootView != null) {
    if (rootView.getParent() != null)     ((ViewGroup)rootView.getParent()).removeView(rootView);
    return rootView;
  }
  rootView=inflater.inflate(R.layout.fragment_recyclerview,container,false);
  ButterKnife.bind(this,rootView);
  init();
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (rootView != null) {
    if (rootView.getParent() != null)     ((ViewGroup)rootView.getParent()).removeView(rootView);
    return rootView;
  }
  rootView=inflater.inflate(R.layout.fragment_bookmark,container,false);
  ButterKnife.bind(this,rootView);
  init();
  gifts.clear();
  if (AppController.getStoredString(Constants.Authorization) != null) {
  }
 else {
    mLoginBtn.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        startActivity(new Intent(getActivity(),LoginActivity.class));
      }
    }
);
  }
  return rootView;
}
Program: 174303
Project: 174303
Buggy source:
@Override public void onResume(){
  super.onResume();
  gifts.clear();
  apiRequest.getBookmarkList(new StartLastIndex(startIndex + "String_Node_Str",startIndex + Constants.LIMIT + "String_Node_Str"));
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  if (AppController.getStoredString(Constants.Authorization) != null) {
    mBookmarkTopLay.setVisibility(View.GONE);
    mBookmarkMainLay.setVisibility(View.VISIBLE);
    if (gifts.size() <= 0) {
      apiRequest.getBookmarkList(new StartLastIndex(startIndex + "String_Node_Str",startIndex + Constants.LIMIT + "String_Node_Str"));
    }
  }
 else {
    mBookmarkTopLay.setVisibility(View.VISIBLE);
    mBookmarkMainLay.setVisibility(View.INVISIBLE);
  }
}
Program: 174304
Project: 174304
Buggy source:
@Override public void onBackPressed(){
  if (getSupportFragmentManager().getBackStackEntryCount() > 0) {
    int index=getSupportFragmentManager().getBackStackEntryCount() - 1;
    FragmentManager.BackStackEntry backEntry=getSupportFragmentManager().getBackStackEntryAt(index);
    String tag=backEntry.getName();
    if (tag.equals(HomeFragment.class.getName() + Constants.HOME_PAGETYPE)) {
      finish();
    }
 else     if (tag.equals(BookmarkFragment.class.getName()) || tag.equals(StatisticFragment.class.getName()) || tag.equals(MyRequestsFragment.class.getName())|| tag.equals(MyGiftsFragment.class.getName())|| tag.equals(HomeFragment.class.getName() + CategoriesGridFragment.class.getName())) {
      super.onBackPressed();
    }
 else {
      mToolbarTitleTextView.setText("String_Node_Str" + AppController.getStoredString(Constants.MY_LOCATION_NAME));
      replaceFragment(homeFragment,HomeFragment.class.getName() + Constants.HOME_PAGETYPE);
    }
  }
}

Fixed version (ground truth):
@Override public void onBackPressed(){
  if (getSupportFragmentManager().getBackStackEntryCount() > 0) {
    int index=getSupportFragmentManager().getBackStackEntryCount() - 1;
    FragmentManager.BackStackEntry backEntry=getSupportFragmentManager().getBackStackEntryAt(index);
    String tag=backEntry.getName();
    if (tag.equals(HomeFragment.class.getName() + Constants.HOME_PAGETYPE)) {
      finish();
    }
 else     if (tag.equals(BookmarkFragment.class.getName()) || tag.equals(StatisticFragment.class.getName()) || tag.equals(MyRequestsFragment.class.getName())|| tag.equals(RequestsToAGiftFragment.class.getName())|| tag.equals(MyGiftsFragment.class.getName())|| tag.equals(HomeFragment.class.getName() + CategoriesGridFragment.class.getName())) {
      super.onBackPressed();
    }
 else {
      mToolbarTitleTextView.setText("String_Node_Str" + AppController.getStoredString(Constants.MY_LOCATION_NAME));
      replaceFragment(homeFragment,HomeFragment.class.getName() + Constants.HOME_PAGETYPE);
    }
  }
}
Program: 174305
Project: 174305
Buggy source:
private void setupViewPager(ViewPager viewPager){
  ViewPagerAdapter adapter=new ViewPagerAdapter(mainActivity.getSupportFragmentManager());
  RegisteredGiftsFragment registeredGiftsFragment=new RegisteredGiftsFragment();
  DonatedGiftsFragment donatedGiftsFragment=new DonatedGiftsFragment();
  ReceivedGiftsFragment receivedGiftsFragment=new ReceivedGiftsFragment();
  adapter.addFrag(registeredGiftsFragment,"String_Node_Str");
  adapter.addFrag(donatedGiftsFragment,"String_Node_Str");
  adapter.addFrag(receivedGiftsFragment,"String_Node_Str");
  viewPager.setAdapter(adapter);
  adapter.notifyDataSetChanged();
}

Fixed version (ground truth):
private void setupViewPager(ViewPager viewPager){
  ViewPagerAdapter adapter=new ViewPagerAdapter(getChildFragmentManager());
  RegisteredGiftsFragment registeredGiftsFragment=new RegisteredGiftsFragment();
  DonatedGiftsFragment donatedGiftsFragment=new DonatedGiftsFragment();
  ReceivedGiftsFragment receivedGiftsFragment=new ReceivedGiftsFragment();
  adapter.addFrag(registeredGiftsFragment,"String_Node_Str");
  adapter.addFrag(donatedGiftsFragment,"String_Node_Str");
  adapter.addFrag(receivedGiftsFragment,"String_Node_Str");
  viewPager.setAdapter(adapter);
  adapter.notifyDataSetChanged();
}