nus-yam/ex-repair huggingface dataset:
Program: 174205
Project: 174205
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_my_requests);
  ButterKnife.bind(this);
  Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  FloatingActionButton fab=(FloatingActionButton)findViewById(R.id.fab);
  fab.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      Snackbar.make(view,"String_Node_Str",Snackbar.LENGTH_LONG).setAction("String_Node_Str",null).show();
    }
  }
);
  searchIV.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      startActivity(SearchActivity.createIntent());
    }
  }
);
  if (AppController.getStoredString(Constants.Authorization) != null) {
    setupViewPager(mainVp);
    mainTabs.setupWithViewPager(mainVp);
    mainVp.setCurrentItem(1,false);
  }
 else {
    hasNotAuthorityFirstTime=true;
    myGiftLoginBtn.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        startActivity(new Intent(MyRequestsActivity.this,LoginActivity.class));
      }
    }
);
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_my_requests);
  ButterKnife.bind(this);
  FloatingActionButton fab=(FloatingActionButton)findViewById(R.id.fab);
  fab.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      Snackbar.make(view,"String_Node_Str",Snackbar.LENGTH_LONG).setAction("String_Node_Str",null).show();
    }
  }
);
  searchIV.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      startActivity(SearchActivity.createIntent());
    }
  }
);
  backIV.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      onBackPressed();
    }
  }
);
  replaceFragment(new MyRequestsFragment(),MyRequestsFragment.class.getName());
}
Program: 174206
Project: 174206
Buggy source:
@Override public void onClick(View v){
  startActivity(new Intent(MyRequestsActivity.this,LoginActivity.class));
}

Fixed version (ground truth):
@Override public void onClick(View view){
  onBackPressed();
}
Program: 174207
Project: 174207
Buggy source:
@Override public void onClick(View view){
  RequestsToAGiftFragment requestsToAGiftFragment=new RequestsToAGiftFragment();
  Bundle bundle=new Bundle();
  bundle.putString(Constants.GIFT_ID,gifts.get(i).giftId);
  bundle.putString(Constants.GIFT_NAME,gifts.get(i).title);
  bundle.putString(Constants.GIFT_REQUEST_COUNT,gifts.get(i).requestCount);
  requestsToAGiftFragment.setArguments(bundle);
  ((BottomBarActivity)mContext).replaceFragment(requestsToAGiftFragment,RequestsToAGiftFragment.class.getName());
}

Fixed version (ground truth):
@Override public void onClick(View view){
  RequestsToAGiftFragment requestsToAGiftFragment=new RequestsToAGiftFragment();
  Bundle bundle=new Bundle();
  bundle.putString(Constants.GIFT_ID,gifts.get(i).giftId);
  bundle.putString(Constants.GIFT_NAME,gifts.get(i).title);
  bundle.putString(Constants.GIFT_REQUEST_COUNT,gifts.get(i).requestCount);
  requestsToAGiftFragment.setArguments(bundle);
  ((MyRequestsActivity)mContext).replaceFragment(requestsToAGiftFragment,RequestsToAGiftFragment.class.getName());
}
Program: 174208
Project: 174208
Buggy source:
@Override public void onBindViewHolder(final ReceiveGiftsRequestHolder myHolder,final int i){
  myHolder.mTitleTv.setText(gifts.get(i).title);
  myHolder.mUnseenMsgTv.setText(gifts.get(i).requestCount);
  myHolder.itemView.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      RequestsToAGiftFragment requestsToAGiftFragment=new RequestsToAGiftFragment();
      Bundle bundle=new Bundle();
      bundle.putString(Constants.GIFT_ID,gifts.get(i).giftId);
      bundle.putString(Constants.GIFT_NAME,gifts.get(i).title);
      bundle.putString(Constants.GIFT_REQUEST_COUNT,gifts.get(i).requestCount);
      requestsToAGiftFragment.setArguments(bundle);
      ((BottomBarActivity)mContext).replaceFragment(requestsToAGiftFragment,RequestsToAGiftFragment.class.getName());
    }
  }
);
}

Fixed version (ground truth):
@Override public void onBindViewHolder(final ReceiveGiftsRequestHolder myHolder,final int i){
  myHolder.mTitleTv.setText(gifts.get(i).title);
  myHolder.mUnseenMsgTv.setText(gifts.get(i).requestCount);
  myHolder.itemView.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      RequestsToAGiftFragment requestsToAGiftFragment=new RequestsToAGiftFragment();
      Bundle bundle=new Bundle();
      bundle.putString(Constants.GIFT_ID,gifts.get(i).giftId);
      bundle.putString(Constants.GIFT_NAME,gifts.get(i).title);
      bundle.putString(Constants.GIFT_REQUEST_COUNT,gifts.get(i).requestCount);
      requestsToAGiftFragment.setArguments(bundle);
      ((MyRequestsActivity)mContext).replaceFragment(requestsToAGiftFragment,RequestsToAGiftFragment.class.getName());
    }
  }
);
}
Program: 174209
Project: 174209
Buggy source:
@Override protected void init(){
  super.init();
  ((BottomBarActivity)getActivity()).mToolbarTitleTextView.setText("String_Node_Str");
}

Fixed version (ground truth):
@Override protected void init(){
  super.init();
}
Program: 174210
Project: 174210
Buggy source:
@Override public void onResume(){
  super.onResume();
  if (AppController.getStoredString(Constants.Authorization) != null) {
    myGiftTopLay.setVisibility(View.GONE);
    myGiftBottomLay.setVisibility(View.VISIBLE);
    if (hasNotAuthorityFirstTime) {
      setupViewPager(mainVp);
      mainTabs.setupWithViewPager(mainVp);
      mainVp.setCurrentItem(1,false);
    }
  }
 else {
    myGiftTopLay.setVisibility(View.VISIBLE);
    myGiftBottomLay.setVisibility(View.INVISIBLE);
  }
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  ((MyRequestsActivity)getActivity()).mToolbarTitleTextView.setText("String_Node_Str");
  if (AppController.getStoredString(Constants.Authorization) != null) {
    myGiftTopLay.setVisibility(View.GONE);
    myGiftBottomLay.setVisibility(View.VISIBLE);
    if (hasNotAuthorityFirstTime) {
      setupViewPager(mainVp);
      mainTabs.setupWithViewPager(mainVp);
      mainVp.setCurrentItem(1,false);
    }
  }
 else {
    myGiftTopLay.setVisibility(View.VISIBLE);
    myGiftBottomLay.setVisibility(View.INVISIBLE);
  }
}
Program: 174211
Project: 174211
Buggy source:
@Override public void onBindViewHolder(GiftHolder myHolder,final int i){
  String image_url;
  if (gifts.get(i).giftImages != null && gifts.get(i).giftImages.size() > 0) {
    image_url=gifts.get(i).giftImages.get(0);
  }
 else {
    image_url="String_Node_Str";
  }
  Glide.with(mContext).load(image_url).centerCrop().placeholder(R.color.background).crossFade().into(myHolder.getmItemIv());
  myHolder.getGiftTitleTv().setText(gifts.get(i).title);
  myHolder.getGiftLocationTv().setText(gifts.get(i).address);
  myHolder.getGiftCreatedTimeTv().setText(gifts.get(i).createDateTime);
  myHolder.itemView.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      mContext.startActivity(GiftDetailActivity.createIntent(gifts.get(i)));
    }
  }
);
}

Fixed version (ground truth):
@Override public void onBindViewHolder(GiftHolder myHolder,final int i){
  String image_url;
  if (gifts.get(i).giftImages != null && gifts.get(i).giftImages.size() > 0) {
    image_url=gifts.get(i).giftImages.get(0);
  }
 else {
    image_url="String_Node_Str";
  }
  Glide.with(mContext).load(image_url).centerCrop().placeholder(R.color.background).crossFade().into(myHolder.getmItemIv());
  myHolder.getGiftTitleTv().setText(gifts.get(i).title);
  myHolder.getGiftLocationTv().setText(gifts.get(i).address);
  myHolder.getGiftCreatedTimeTv().setText(gifts.get(i).description);
  myHolder.itemView.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      mContext.startActivity(GiftDetailActivity.createIntent(gifts.get(i)));
    }
  }
);
}
Program: 174212
Project: 174212
Buggy source:
public ViewHolder(View view){
  super(view);
  coverImageView=(ImageView)view.findViewById(R.id.cell_movie_iv);
  mCellNameMovieTv=(TextView)view.findViewById(R.id.cell_name_movie_tv);
  mCellPriceMovieTv=(TextView)view.findViewById(R.id.cell_price_movie_tv);
  mShowcaseMoreInfoCategoryTv=(TextView)view.findViewById(R.id.showcase_more_info_category_tv);
  mRippleCardview=(RippleView)view.findViewById(R.id.ripple_cell_showcase);
}

Fixed version (ground truth):
public ViewHolder(View view){
  super(view);
  this.view=view;
  coverImageView=(ImageView)view.findViewById(R.id.cell_movie_iv);
  mCellNameMovieTv=(TextView)view.findViewById(R.id.cell_name_movie_tv);
  mCellPriceMovieTv=(TextView)view.findViewById(R.id.cell_price_movie_tv);
  mShowcaseMoreInfoCategoryTv=(TextView)view.findViewById(R.id.showcase_more_info_category_tv);
}
Program: 174213
Project: 174213
Buggy source:
@Override public void onBindViewHolder(final ViewHolder holder,final int i){
  String image_url;
  if (gifts.get(i).giftImages != null && gifts.get(i).giftImages.size() > 0) {
    image_url=gifts.get(i).giftImages.get(0);
  }
 else {
    image_url="String_Node_Str";
  }
  Glide.with(mContext).load(image_url).centerCrop().placeholder(R.color.white).crossFade().into(holder.coverImageView);
  holder.mCellNameMovieTv.setText(gifts.get(i).title);
  holder.mShowcaseMoreInfoCategoryTv.setText(gifts.get(i).address);
  holder.mRippleCardview.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener(){
    @Override public void onComplete(    RippleView rippleMoviePic){
      mContext.startActivity(GiftDetailActivity.createIntent(gifts.get(i)));
    }
  }
);
}

Fixed version (ground truth):
@Override public void onBindViewHolder(final ViewHolder holder,final int i){
  String image_url;
  if (gifts.get(i).giftImages != null && gifts.get(i).giftImages.size() > 0) {
    image_url=gifts.get(i).giftImages.get(0);
  }
 else {
    image_url="String_Node_Str";
  }
  Glide.with(mContext).load(image_url).centerCrop().placeholder(R.color.white).crossFade().into(holder.coverImageView);
  holder.mCellNameMovieTv.setText(gifts.get(i).title);
  holder.mShowcaseMoreInfoCategoryTv.setText(gifts.get(i).address);
  holder.view.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      mContext.startActivity(GiftDetailActivity.createIntent(gifts.get(i)));
    }
  }
);
}
Program: 174214
Project: 174214
Buggy source:
@Override protected void init(){
  super.init();
  adapter=new ContactUsAdapter(context);
  mRecyclerView.setAdapter(adapter);
  GridLayoutManager layoutManager=new RtlGridAutofitLayoutManager(AppController.getAppContext(),(int)MetricConverter.dp2px(context,80));
  mRecyclerView.setLayoutManager(layoutManager);
}

Fixed version (ground truth):
@Override protected void init(){
  super.init();
  adapter=new ContactUsAdapter(context);
  mRecyclerView.setAdapter(adapter);
  GridLayoutManager layoutManager=new RtlGridAutofitLayoutManager(AppController.getAppContext(),(int)MetricConverter.dp2px(context,80));
  mRecyclerView.setLayoutManager(layoutManager);
  mRecyclerView.setVisibility(View.VISIBLE);
  fragmentProgressBar.setVisibility(View.INVISIBLE);
}
Program: 174215
Project: 174215
Buggy source:
void findViews(View view){
  more=(TextView)view.findViewById(R.id.more);
  mMoreLayout=(RelativeLayout)view.findViewById(R.id.more_layout);
  description=(TextView)view.findViewById(R.id.description);
  mHorizontalRecycleView=(RecyclerView)view.findViewById(R.id.recycler_view_collection);
  mRippleBtnMore=(RippleView)view.findViewById(R.id.ripple_btn_more);
  categoryImg=(ImageView)view.findViewById(R.id.category_img);
}

Fixed version (ground truth):
void findViews(View view){
  more=(TextView)view.findViewById(R.id.more_tv);
  mMoreLayout=(RelativeLayout)view.findViewById(R.id.more_layout);
  description=(TextView)view.findViewById(R.id.description);
  mHorizontalRecycleView=(RecyclerView)view.findViewById(R.id.recycler_view_collection);
  categoryImg=(ImageView)view.findViewById(R.id.category_img);
}
Program: 174216
Project: 174216
Buggy source:
@Override public void onBindViewHolder(ShowcaseMoreInfoHolder showcaseMoreInfoHolder,final int position){
  showcaseMoreInfoHolder.description.setText(categories.get(position).title);
  Glide.with(mContext).load(categories.get(position).imageUrl).centerCrop().placeholder(R.color.background).crossFade().into(showcaseMoreInfoHolder.categoryImg);
  showcaseMoreInfoHolder.mRippleBtnMore.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener(){
    @Override public void onComplete(    RippleView rippleView){
      ((BottomBarActivity)mContext).replaceFragment(HomeFragment.newInstance(Constants.CATEGORY_PAGETYPE,categories.get(position)),HomeFragment.class.getName() + CategoriesGridFragment.class.getName());
    }
  }
);
  mLayoutManager=new LinearLayoutManager(mContext);
  mLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
  mLayoutManager.setReverseLayout(true);
  showcaseMoreInfoHolder.mHorizontalRecycleView.setNestedScrollingEnabled(false);
  if (mGiftPositionMap.get(position).gifts.size() == 0) {
    mGiftPositionMap.get(position).showcaseMoreInfoAdapter=new ShowcaseMoreInfoAdapter(mContext,mGiftPositionMap.get(position).gifts);
    getGifts(position,mGiftPositionMap.get(position).start_index);
  }
  showcaseMoreInfoHolder.mHorizontalRecycleView.setAdapter(mGiftPositionMap.get(position).showcaseMoreInfoAdapter);
  showcaseMoreInfoHolder.mHorizontalRecycleView.setLayoutManager(mLayoutManager);
}

Fixed version (ground truth):
@Override public void onBindViewHolder(ShowcaseMoreInfoHolder showcaseMoreInfoHolder,final int position){
  showcaseMoreInfoHolder.description.setText(categories.get(position).title);
  Glide.with(mContext).load(categories.get(position).imageUrl).centerCrop().placeholder(R.color.background).crossFade().into(showcaseMoreInfoHolder.categoryImg);
  showcaseMoreInfoHolder.more.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      ((BottomBarActivity)mContext).replaceFragment(HomeFragment.newInstance(Constants.CATEGORY_PAGETYPE,categories.get(position)),HomeFragment.class.getName() + CategoriesGridFragment.class.getName());
    }
  }
);
  mLayoutManager=new LinearLayoutManager(mContext);
  mLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
  mLayoutManager.setReverseLayout(true);
  showcaseMoreInfoHolder.mHorizontalRecycleView.setNestedScrollingEnabled(false);
  if (mGiftPositionMap.get(position).gifts.size() == 0) {
    mGiftPositionMap.get(position).showcaseMoreInfoAdapter=new ShowcaseMoreInfoAdapter(mContext,mGiftPositionMap.get(position).gifts);
    getGifts(position,mGiftPositionMap.get(position).start_index);
  }
  showcaseMoreInfoHolder.mHorizontalRecycleView.setAdapter(mGiftPositionMap.get(position).showcaseMoreInfoAdapter);
  showcaseMoreInfoHolder.mHorizontalRecycleView.setLayoutManager(mLayoutManager);
}
Program: 174217
Project: 174217
Buggy source:
private void setListeners(){
}

Fixed version (ground truth):
private void setListeners(){
  mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener(){
    @Override public void onRefresh(){
      apiRequest.getCategories();
    }
  }
);
}
Program: 174218
Project: 174218
Buggy source:
@Override public void onResponse(Call call,Response response){
  mRecyclerView.setVisibility(View.VISIBLE);
  mProgressView.setVisibility(View.INVISIBLE);
  messageTextview.setVisibility(View.INVISIBLE);
  ArrayList<Category> categories=(ArrayList<Category>)response.body();
  this.categories.clear();
  this.categories.addAll(categories);
  homeCategoriesAdapter=new HomeCategoriesAdapter(context,this.categories);
  mRecyclerView.setAdapter(homeCategoriesAdapter);
  linearLayoutManager=new LinearLayoutManager(context);
  mRecyclerView.setLayoutManager(linearLayoutManager);
}

Fixed version (ground truth):
@Override public void onResponse(Call call,Response response){
  mRecyclerView.setVisibility(View.VISIBLE);
  mProgressView.setVisibility(View.INVISIBLE);
  messageTextview.setVisibility(View.INVISIBLE);
  mSwipeRefreshLayout.setRefreshing(false);
  ArrayList<Category> categories=(ArrayList<Category>)response.body();
  this.categories.clear();
  this.categories.addAll(categories);
  homeCategoriesAdapter=new HomeCategoriesAdapter(context,this.categories);
  mRecyclerView.setAdapter(homeCategoriesAdapter);
  linearLayoutManager=new LinearLayoutManager(context);
  mRecyclerView.setLayoutManager(linearLayoutManager);
}
Program: 174219
Project: 174219
Buggy source:
@Override public void onApplyFiltering(Place place,Place region,Category category){
  this.place=place;
  this.category=category;
  this.region=region;
  progressView.setVisibility(View.VISIBLE);
  mRecyclerView.setVisibility(View.INVISIBLE);
  mMessageTextView.setVisibility(View.INVISIBLE);
  if (place != null || category != null) {
    setFilteringBtnColor(R.color.colorPrimary);
  }
  gifts.clear();
  startIndex=0;
}

Fixed version (ground truth):
@Override public void onApplyFiltering(Place place,Place region,Category category){
  this.place=place;
  this.category=category;
  this.region=region;
  progressView.setVisibility(View.VISIBLE);
  mRecyclerView.setVisibility(View.INVISIBLE);
  mMessageTextView.setVisibility(View.INVISIBLE);
  if (place != null || category != null) {
    setFilteringBtnColor(R.color.colorPrimary);
  }
  gifts.clear();
  startIndex=0;
  getGifts();
}
Program: 174221
Project: 174221
Buggy source:
@Override public void onClick(View v){
  ((HomeFilteringCallback)getTargetFragment()).onApplyFiltering(null,null,null);
  dismiss();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  homeFilteringCallback.onApplyFiltering(null,null,null);
  dismiss();
}
Program: 174222
Project: 174222
Buggy source:
private void loginWithCode(String confirmationCode){
  phoneConfirimationCodeEt.setText(confirmationCode);
  if (!confirmationCode.trim().matches(regexStr)) {
    closeKeyboard();
    Snackbari.showS(mBackBtn,"String_Node_Str");
    return;
  }
  AppController.storeString(Constants.FIREBASE_REG_TOKEN,"String_Node_Str");
  if (AppController.getStoredString(Constants.FIREBASE_REG_TOKEN) == null) {
    closeKeyboard();
    Snackbari.showL(mBackBtn,"String_Node_Str");
    return;
  }
  if (!AppController.getStoredBoolean(Constants.CALLED_SETDEVICE_BEFORE,false)) {
    String deviceID=DeviceInfo.getDeviceID(this);
    Log.d("String_Node_Str",deviceID);
    apiRequest.setDevice(new SetDeviceInput(AppController.getStoredString(Constants.FIREBASE_REG_TOKEN),deviceID));
    closeKeyboard();
    Snackbari.showL(mBackBtn,"String_Node_Str");
    return;
  }
  apiRequest.login(confirmationCode,DeviceInfo.getDeviceID(context));
  progressView.setVisibility(View.VISIBLE);
  login_get_verification_tv.setVisibility(View.INVISIBLE);
  secondBtnLay.setOnClickListener(notRecievedCode);
}

Fixed version (ground truth):
private void loginWithCode(String confirmationCode){
  phoneConfirimationCodeEt.setText(confirmationCode);
  if (!confirmationCode.trim().matches(regexStr)) {
    closeKeyboard();
    Snackbari.showS(mBackBtn,"String_Node_Str");
    return;
  }
  if (AppController.getStoredString(Constants.FIREBASE_REG_TOKEN) == null) {
    closeKeyboard();
    Snackbari.showL(mBackBtn,"String_Node_Str");
    return;
  }
  if (!AppController.getStoredBoolean(Constants.CALLED_SETDEVICE_BEFORE,false)) {
    String deviceID=DeviceInfo.getDeviceID(this);
    Log.d("String_Node_Str",deviceID);
    apiRequest.setDevice(new SetDeviceInput(AppController.getStoredString(Constants.FIREBASE_REG_TOKEN),deviceID));
    closeKeyboard();
    Snackbari.showL(mBackBtn,"String_Node_Str");
    return;
  }
  apiRequest.login(confirmationCode,DeviceInfo.getDeviceID(context));
  progressView.setVisibility(View.VISIBLE);
  login_get_verification_tv.setVisibility(View.INVISIBLE);
  secondBtnLay.setOnClickListener(notRecievedCode);
}
Program: 174224
Project: 174224
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(RequestsToAGiftFragment.class.getName())|| tag.equals(MyGiftsFragment.class.getName())|| tag.equals(OurTeamFragment.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(OurTeamFragment.class.getName())|| tag.equals(ContactUsFragment.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: 174225
Project: 174225
Buggy source:
@Override protected void onResume(){
  super.onResume();
  if (giftId != null) {
    apiRequest.getGift(giftId);
  }
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  if (giftId != null) {
    apiRequest.getGift(giftId);
  }
  ViewTreeObserver viewTreeObserver=viewPager.getViewTreeObserver();
  viewTreeObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      RelativeLayout.LayoutParams layoutParams=new RelativeLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT);
      int viewPagerWidth=viewPager.getWidth();
      float viewPagerHeight=(float)(viewPagerWidth * 1);
      layoutParams.width=viewPagerWidth;
      layoutParams.height=(int)viewPagerHeight;
      viewPager.setLayoutParams(layoutParams);
      viewPager.getViewTreeObserver().removeGlobalOnLayoutListener(this);
    }
  }
);
}
Program: 174226
Project: 174226
Buggy source:
@Override public void onResponse(Call call,Response response){
  super.onResponse(call,response);
  progressView.setVisibility(View.INVISIBLE);
  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);
    View divider=rootView.findViewById(AppController.getAppContext().getResources().getIdentifier("String_Node_Str" + i,"String_Node_Str",getActivity().getPackageName()));
    divider.setVisibility(View.VISIBLE);
  }
}

Fixed version (ground truth):
@Override public void onResponse(Call call,Response response){
  super.onResponse(call,response);
  progressView.setVisibility(View.INVISIBLE);
  StatisticsOutput statisticsOutput=(StatisticsOutput)response.body();
  adapter=new StatisticAdapter(context,statisticsOutput.statistics);
  recyclerView.setAdapter(adapter);
  linearLayoutManager=new LinearLayoutManager(context);
  recyclerView.setLayoutManager(linearLayoutManager);
}
Program: 174227
Project: 174227
Buggy source:
@Override public void onResponse(Call call,Response response,final int position,String tag){
  if (response.body() instanceof ResponseBody) {
    if (tag.equals(RequestName.DenyRequest)) {
      requestModels.remove(position);
      notifyDataSetChanged();
    }
 else     if (tag.equals(RequestName.AcceptRequest)) {
      afterAcceptDialog=MaterialDialogBuilder.create(mContext).customView(R.layout.dialog_after_accept_request,false).build();
      TextView message=(TextView)afterAcceptDialog.findViewById(R.id.message_textview);
      message.setText("String_Node_Str" + requestModels.get(position).fromUser + "String_Node_Str");
      ImageView callIV=(ImageView)afterAcceptDialog.findViewById(R.id.call_iv);
      callIV.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          String uri="String_Node_Str" + requestModels.get(position).fromUser;
          Intent intent=new Intent(Intent.ACTION_DIAL);
          intent.setData(Uri.parse(uri));
          mContext.startActivity(intent);
        }
      }
);
      ImageView smsIV=(ImageView)afterAcceptDialog.findViewById(R.id.sms_iv);
      smsIV.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          mContext.startActivity(new Intent(Intent.ACTION_VIEW,Uri.fromParts("String_Node_Str",requestModels.get(position).fromUser,null)));
        }
      }
);
      ImageView profileIV=(ImageView)afterAcceptDialog.findViewById(R.id.profile_iv);
      profileIV.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          mContext.startActivity(UserProfileActivity.createIntent(requestModels.get(position).fromUserId));
        }
      }
);
      RippleView giftPageRv=(RippleView)afterAcceptDialog.findViewById(R.id.gift_page_ripple_btn);
      giftPageRv.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener(){
        @Override public void onComplete(        RippleView rippleView){
          mContext.startActivity(GiftDetailActivity.createIntent(requestModels.get(position).giftId));
        }
      }
);
      RippleView okRv=(RippleView)afterAcceptDialog.findViewById(R.id.ok_ripple_btn);
      okRv.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener(){
        @Override public void onComplete(        RippleView rippleView){
          Toasti.showS("String_Node_Str");
        }
      }
);
      afterAcceptDialog.show();
    }
    yesNoDialog.dismiss();
  }
}

Fixed version (ground truth):
@Override public void onResponse(Call call,Response response,final int position,String tag){
  if (response.body() instanceof ResponseBody) {
    if (tag.equals(RequestName.DenyRequest)) {
      requestModels.remove(position);
      notifyDataSetChanged();
    }
 else     if (tag.equals(RequestName.AcceptRequest)) {
      showAfterAcceptDialog(position);
    }
    yesNoDialog.dismiss();
  }
}
Program: 174228
Project: 174228
Buggy source:
@Override public void onComplete(RippleView rippleView){
  Toasti.showS("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onComplete(RippleView rippleView){
  Toasti.showS("String_Node_Str");
  afterAcceptDialog.dismiss();
  ((BottomBarActivity)mContext).onBackPressed();
}
Program: 174229
Project: 174229
Buggy source:
public static void clearInfo(){
  AppController.storeString(Constants.Authorization,null);
  AppController.storeString(Constants.TELEPHONE,null);
  deleteSavedGift();
}

Fixed version (ground truth):
public static void clearInfo(){
  AppController.storeString(Constants.Authorization,null);
  AppController.storeString(Constants.USER_ID,null);
  AppController.storeString(Constants.TELEPHONE,null);
  deleteSavedGift();
}
Program: 174230
Project: 174230
Buggy source:
private void settingToolbar(){
  mToolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
  setSupportActionBar(mToolbar);
  try {
    getSupportActionBar().setDisplayShowTitleEnabled(false);
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
private void settingToolbar(){
  mToolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
  setSupportActionBar(mToolbar);
  try {
    getSupportActionBar().setDisplayShowTitleEnabled(false);
  }
 catch (  Exception e) {
  }
  mToolbarTitleTextView.setText("String_Node_Str");
}
Program: 174232
Project: 174232
Buggy source:
private void setCallSmsBtn(){
  mContactLay.setVisibility(View.VISIBLE);
  mRequestLay.setVisibility(View.GONE);
  mEditDeleteLay.setVisibility(View.GONE);
  mCallBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      String uri="String_Node_Str" + "String_Node_Str";
      Intent intent=new Intent(Intent.ACTION_DIAL);
      intent.setData(Uri.parse(uri));
      mContext.startActivity(intent);
    }
  }
);
  mSmsBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      mContext.startActivity(new Intent(Intent.ACTION_VIEW,Uri.fromParts("String_Node_Str","String_Node_Str",null)));
    }
  }
);
}

Fixed version (ground truth):
private void setCallSmsBtn(){
  mContactLay.setVisibility(View.VISIBLE);
  mRequestLay.setVisibility(View.GONE);
  mEditDeleteLay.setVisibility(View.GONE);
  mCallBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      String uri="String_Node_Str" + gift.user;
      Intent intent=new Intent(Intent.ACTION_DIAL);
      intent.setData(Uri.parse(uri));
      mContext.startActivity(intent);
    }
  }
);
  mSmsBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      mContext.startActivity(new Intent(Intent.ACTION_VIEW,Uri.fromParts("String_Node_Str",gift.user,null)));
    }
  }
);
}
Program: 174236
Project: 174236
Buggy source:
@Override public void onClick(View view){
  Toasti.showS("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onClick(View view){
  mContext.startActivity(UserProfileActivity.createIntent(requestModels.get(position).fromUserId));
}
Program: 174239
Project: 174239
Buggy source:
@Override protected void init(){
  super.init();
  adapter=new GiftListAdapter(context,gifts);
  mRecyclerView.setAdapter(adapter);
  mRecyclerView.addOnScrollListener(new EndlessRecyclerViewScrollListener(linearLayoutManager){
    @Override public void onLoadMore(    int page,    int totalItemsCount){
      getBookmarks();
    }
  }
);
  linearLayoutManager=new LinearLayoutManager(context);
  mRecyclerView.setLayoutManager(linearLayoutManager);
}

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();
    }
  }
);
  getBookmarks();
}
Program: 174240
Project: 174240
Buggy source:
@Override public void onResponse(Call call,Response response){
  mRecyclerView.setVisibility(View.VISIBLE);
  progressView.setVisibility(View.INVISIBLE);
  ArrayList<Gift> gifts=(ArrayList<Gift>)response.body();
  this.gifts.addAll(gifts);
  adapter.notifyDataSetChanged();
  if (gifts.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){
  mRecyclerView.setVisibility(View.VISIBLE);
  progressView.setVisibility(View.INVISIBLE);
  ArrayList<Gift> gifts=(ArrayList<Gift>)response.body();
  this.gifts.addAll(gifts);
  adapter.notifyDataSetChanged();
  if (this.gifts.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: 174241
Project: 174241
Buggy source:
@Override public void onLoadMore(int page,int totalItemsCount){
  getBookmarks();
}

Fixed version (ground truth):
@Override public void onLoadMore(int page,int totalItemsCount){
  if (page > 1)   getBookmarks();
}
Program: 174242
Project: 174242
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();
  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;
}

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 {
    hasNotAuthorityFirstTime=true;
    myGiftLoginBtn.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        startActivity(new Intent(getActivity(),LoginActivity.class));
      }
    }
);
  }
  return rootView;
}
Program: 174243
Project: 174243
Buggy source:
@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);
  }
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  if (AppController.getStoredString(Constants.Authorization) != null) {
    myGiftTopLay.setVisibility(View.GONE);
    myGiftBottomLay.setVisibility(View.VISIBLE);
    if (hasNotAuthorityFirstTime) {
      setupViewPager(mainVp);
      mainTabs.setupWithViewPager(mainVp);
      mainVp.setCurrentItem(2,false);
    }
  }
 else {
    myGiftTopLay.setVisibility(View.VISIBLE);
    myGiftBottomLay.setVisibility(View.INVISIBLE);
  }
}
Program: 174244
Project: 174244
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();
  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;
}

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 {
    hasNotAuthorityFirstTime=true;
    myGiftLoginBtn.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        startActivity(new Intent(getActivity(),LoginActivity.class));
      }
    }
);
  }
  return rootView;
}
Program: 174245
Project: 174245
Buggy source:
private void setupViewPager(ViewPager viewPager){
  ViewPagerAdapter adapter=new ViewPagerAdapter(getChildFragmentManager());
  SentRequestsFragment sentRequestsFragment=new SentRequestsFragment();
  ReceivedRequestsFragment receivedRequestsFragment=new ReceivedRequestsFragment();
  adapter.addFrag(sentRequestsFragment,"String_Node_Str");
  adapter.addFrag(receivedRequestsFragment,"String_Node_Str");
  viewPager.setAdapter(adapter);
  adapter.notifyDataSetChanged();
}

Fixed version (ground truth):
private void setupViewPager(ViewPager viewPager){
  adapter=new ViewPagerAdapter(getChildFragmentManager());
  SentRequestsFragment sentRequestsFragment=new SentRequestsFragment();
  ReceivedRequestsFragment receivedRequestsFragment=new ReceivedRequestsFragment();
  adapter.addFrag(sentRequestsFragment,"String_Node_Str");
  adapter.addFrag(receivedRequestsFragment,"String_Node_Str");
  viewPager.setAdapter(adapter);
  adapter.notifyDataSetChanged();
}
Program: 174246
Project: 174246
Buggy source:
@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);
  }
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  if (AppController.getStoredString(Constants.Authorization) != null) {
    myGiftTopLay.setVisibility(View.GONE);
    myGiftBottomLay.setVisibility(View.VISIBLE);
    if (hasNotAuthorityFirstTime) {
      setupViewPager(mainVp);
      mainTabs.setupWithViewPager(mainVp);
      mainVp.setCurrentItem(1,false);
    }
  }
 else {
    myGiftTopLay.setVisibility(View.VISIBLE);
    myGiftBottomLay.setVisibility(View.INVISIBLE);
  }
}
Program: 174248
Project: 174248
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_login);
  ButterKnife.bind(this);
  init();
  setListeners();
  IntentFilter filter=new IntentFilter();
  filter.addAction("String_Node_Str");
  registerReceiver(receiver,filter);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_login);
  ButterKnife.bind(this);
  init();
  setListeners();
  filter=new IntentFilter();
  filter.addAction("String_Node_Str");
}
Program: 174249
Project: 174249
Buggy source:
private void longTimeoutRetrofitInitialization(){
  HttpLoggingInterceptor logging=new HttpLoggingInterceptor();
  logging.setLevel(HttpLoggingInterceptor.Level.BODY);
  longTimeOutHttpClient=new OkHttpClient.Builder().readTimeout(120,TimeUnit.SECONDS).connectTimeout(120,TimeUnit.SECONDS).addInterceptor(new Interceptor(){
    @Override public Response intercept(    Interceptor.Chain chain) throws IOException {
      Request request=chain.request().newBuilder().build();
      return chain.proceed(request);
    }
  }
).addInterceptor(logging).build();
  longTimeoutRetrofitBuilder=new Retrofit.Builder().addConverterFactory(GsonConverterFactory.create()).client(httpClient);
  longTimeOutRetrofit=longTimeoutRetrofitBuilder.baseUrl(URIs.BASE_URL + URIs.API_VERSION).build();
  service=retrofit.create(RestAPI.class);
}

Fixed version (ground truth):
private void longTimeoutRetrofitInitialization(){
  HttpLoggingInterceptor logging=new HttpLoggingInterceptor();
  logging.setLevel(HttpLoggingInterceptor.Level.BODY);
  longTimeOutHttpClient=new OkHttpClient.Builder().readTimeout(120,TimeUnit.SECONDS).connectTimeout(120,TimeUnit.SECONDS).addInterceptor(new Interceptor(){
    @Override public Response intercept(    Interceptor.Chain chain) throws IOException {
      Request request=chain.request().newBuilder().build();
      return chain.proceed(request);
    }
  }
).addInterceptor(logging).build();
  longTimeoutRetrofitBuilder=new Retrofit.Builder().addConverterFactory(GsonConverterFactory.create()).client(httpClient);
  longTimeOutRetrofit=longTimeoutRetrofitBuilder.baseUrl(URIs.BASE_URL + URIs.API_VERSION).build();
  longTimeoutService=longTimeOutRetrofit.create(RestAPI.class);
}
Program: 174250
Project: 174250
Buggy source:
private void retrofitInitialization(){
  HttpLoggingInterceptor logging=new HttpLoggingInterceptor();
  logging.setLevel(HttpLoggingInterceptor.Level.BODY);
  httpClient=new OkHttpClient.Builder().addInterceptor(new Interceptor(){
    @Override public Response intercept(    Interceptor.Chain chain) throws IOException {
      Request request=chain.request().newBuilder().build();
      return chain.proceed(request);
    }
  }
).addInterceptor(logging).build();
  retrofitBuilder=new Retrofit.Builder().addConverterFactory(GsonConverterFactory.create()).client(httpClient);
  retrofit=retrofitBuilder.baseUrl(URIs.BASE_URL + URIs.API_VERSION).build();
  accountRetrofit=retrofitBuilder.baseUrl(URIs.BASE_URL).build();
}

Fixed version (ground truth):
private void retrofitInitialization(){
  HttpLoggingInterceptor logging=new HttpLoggingInterceptor();
  logging.setLevel(HttpLoggingInterceptor.Level.BODY);
  httpClient=new OkHttpClient.Builder().addInterceptor(new Interceptor(){
    @Override public Response intercept(    Interceptor.Chain chain) throws IOException {
      Request request=chain.request().newBuilder().build();
      return chain.proceed(request);
    }
  }
).addInterceptor(logging).build();
  retrofitBuilder=new Retrofit.Builder().addConverterFactory(GsonConverterFactory.create()).client(httpClient);
  retrofit=retrofitBuilder.baseUrl(URIs.BASE_URL + URIs.API_VERSION).build();
  accountRetrofit=retrofitBuilder.baseUrl(URIs.BASE_URL).build();
  service=retrofit.create(RestAPI.class);
  accountService=accountRetrofit.create(AccountRestAPI.class);
}
Program: 174251
Project: 174251
Buggy source:
@Override public void onResponse(Call call,Response response){
  progressView.setVisibility(View.INVISIBLE);
  ArrayList<Gift> gifts=(ArrayList<Gift>)response.body();
  this.gifts.addAll(gifts);
  adapter.notifyDataSetChanged();
  if (gifts.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<Gift> gifts=(ArrayList<Gift>)response.body();
  this.gifts.addAll(gifts);
  adapter.notifyDataSetChanged();
  if (this.gifts.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: 174252
Project: 174252
Buggy source:
@Override public void onResponse(Call call,Response response){
  progressView.setVisibility(View.INVISIBLE);
  ArrayList<Gift> gifts=(ArrayList<Gift>)response.body();
  this.gifts.addAll(gifts);
  adapter.notifyDataSetChanged();
  if (gifts.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<Gift> gifts=(ArrayList<Gift>)response.body();
  this.gifts.addAll(gifts);
  adapter.notifyDataSetChanged();
  if (this.gifts.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: 174253
Project: 174253
Buggy source:
@Override public void onResponse(Call call,Response response){
  mRecyclerView.setVisibility(View.VISIBLE);
  progressView.setVisibility(View.INVISIBLE);
  ArrayList<Gift> gifts=(ArrayList<Gift>)response.body();
  this.gifts.addAll(gifts);
  adapter.notifyDataSetChanged();
  if (gifts.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){
  mRecyclerView.setVisibility(View.VISIBLE);
  progressView.setVisibility(View.INVISIBLE);
  ArrayList<Gift> gifts=(ArrayList<Gift>)response.body();
  this.gifts.addAll(gifts);
  adapter.notifyDataSetChanged();
  if (this.gifts.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: 174254
Project: 174254
Buggy source:
@Override public void onResponse(Call call,Response response){
  progressView.setVisibility(View.INVISIBLE);
  ArrayList<Gift> gifts=(ArrayList<Gift>)response.body();
  this.gifts.addAll(gifts);
  adapter.notifyDataSetChanged();
  if (gifts.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<Gift> gifts=(ArrayList<Gift>)response.body();
  this.gifts.addAll(gifts);
  adapter.notifyDataSetChanged();
  if (this.gifts.size() > 0) {
    mRecyclerView.setVisibility(View.VISIBLE);
    mMessageTv.setVisibility(View.INVISIBLE);
  }
 else {
    mRecyclerView.setVisibility(View.INVISIBLE);
    mMessageTv.setVisibility(View.VISIBLE);
    mMessageTv.setText("String_Node_Str");
  }
}