nus-yam/ex-repair huggingface dataset:
Program: 62537
Project: 62537
Buggy source:
@Override protected void initEventAndData(){
  super.initEventAndData();
  initRecyclerView();
  mPresenter.getCollectList(mCurrentPage,true);
  setRefresh();
  if (CommonUtils.isNetworkConnected()) {
    showLoading();
  }
}

Fixed version (ground truth):
@Override protected void initEventAndData(){
  super.initEventAndData();
  mPresenter.getCollectList(mCurrentPage,true);
  setRefresh();
  if (CommonUtils.isNetworkConnected()) {
    showLoading();
  }
}
Program: 62538
Project: 62538
Buggy source:
private void initRecyclerView(){
  mArticles=new ArrayList<>();
  mAdapter=new ArticleListAdapter(R.layout.item_search_pager,mArticles);
  mAdapter.isCollectPage();
  mAdapter.setOnItemClickListener((adapter,view,position) -> startArticleDetailPager(view,position));
  mAdapter.setOnItemChildClickListener((adapter,view,position) -> clickChildEvent(view,position));
  mRecyclerView.setAdapter(mAdapter);
  mRecyclerView.setLayoutManager(new LinearLayoutManager(_mActivity));
  mRecyclerView.setHasFixedSize(true);
}

Fixed version (ground truth):
private void initRecyclerView(){
  mArticles=new ArrayList<>();
  mAdapter=new ArticleListAdapter(R.layout.item_search_pager,mArticles);
  mAdapter.isCollectPage();
  mAdapter.setOnItemClickListener((adapter,view,position) -> startArticleDetailPager(view,position));
  mAdapter.setOnItemChildClickListener((adapter,view,position) -> clickChildEvent(view,position));
  mRecyclerView.setLayoutManager(new LinearLayoutManager(_mActivity));
  mRecyclerView.setHasFixedSize(true);
  mRecyclerView.setAdapter(mAdapter);
}
Program: 62539
Project: 62539
Buggy source:
@Override protected void initEventAndData(){
  initCircleAnimation();
  mTopSearchDataList=new ArrayList<>();
  mSearchEdit.addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      if (TextUtils.isEmpty(mSearchEdit.getText().toString())) {
        mTintTv.setText(R.string.search_tint);
      }
 else {
        mTintTv.setText("String_Node_Str");
      }
    }
  }
);
  mPresenter.addRxBindingSubscribe(RxView.clicks(mSearchTv).throttleFirst(Constants.CLICK_TIME_AREA,TimeUnit.MILLISECONDS).filter(o -> !TextUtils.isEmpty(mSearchEdit.getText().toString().trim())).subscribe(o -> {
    mPresenter.addHistoryData(mSearchEdit.getText().toString().trim());
    setHistoryTvStatus(false);
  }
));
  showHistoryData(mPresenter.loadAllHistoryData());
  mPresenter.getTopSearchData();
}

Fixed version (ground truth):
@Override protected void initEventAndData(){
  initCircleAnimation();
  initRecyclerView();
  mTopSearchDataList=new ArrayList<>();
  mSearchEdit.addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      if (TextUtils.isEmpty(mSearchEdit.getText().toString())) {
        mTintTv.setText(R.string.search_tint);
      }
 else {
        mTintTv.setText("String_Node_Str");
      }
    }
  }
);
  mPresenter.addRxBindingSubscribe(RxView.clicks(mSearchTv).throttleFirst(Constants.CLICK_TIME_AREA,TimeUnit.MILLISECONDS).filter(o -> !TextUtils.isEmpty(mSearchEdit.getText().toString().trim())).subscribe(o -> {
    mPresenter.addHistoryData(mSearchEdit.getText().toString().trim());
    setHistoryTvStatus(false);
  }
));
  showHistoryData(mPresenter.loadAllHistoryData());
  mPresenter.getTopSearchData();
}
Program: 62540
Project: 62540
Buggy source:
private void initRecyclerView(List<HistoryData> historyDataList){
  historySearchAdapter=new HistorySearchAdapter(R.layout.item_search_history,historyDataList);
  historySearchAdapter.setOnItemChildClickListener((adapter,view,position) -> searchHistoryData(adapter,position));
  mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
  mRecyclerView.setAdapter(historySearchAdapter);
}

Fixed version (ground truth):
private void initRecyclerView(){
  historySearchAdapter=new HistorySearchAdapter(R.layout.item_search_history,null);
  historySearchAdapter.setOnItemChildClickListener((adapter,view,position) -> searchHistoryData(adapter,position));
  mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
  mRecyclerView.setAdapter(historySearchAdapter);
}
Program: 62541
Project: 62541
Buggy source:
@Override public void showHistoryData(List<HistoryData> historyDataList){
  if (historyDataList == null || historyDataList.size() <= 0) {
    setHistoryTvStatus(true);
    return;
  }
  setHistoryTvStatus(false);
  Collections.reverse(historyDataList);
  initRecyclerView(historyDataList);
}

Fixed version (ground truth):
@Override public void showHistoryData(List<HistoryData> historyDataList){
  if (historyDataList == null || historyDataList.size() <= 0) {
    setHistoryTvStatus(true);
    return;
  }
  setHistoryTvStatus(false);
  Collections.reverse(historyDataList);
  historySearchAdapter.replaceData(historyDataList);
}
Program: 62542
Project: 62542
Buggy source:
@Override protected void initEventAndData(){
  super.initEventAndData();
  initRecyclerView();
  setRefresh();
  if (loggedAndNotRebuilt()) {
    mPresenter.loadMainPagerData();
  }
 else {
    mPresenter.autoRefresh(true);
  }
  if (CommonUtils.isNetworkConnected()) {
    showLoading();
  }
}

Fixed version (ground truth):
@Override protected void initEventAndData(){
  super.initEventAndData();
  setRefresh();
  if (loggedAndNotRebuilt()) {
    mPresenter.loadMainPagerData();
  }
 else {
    mPresenter.autoRefresh(true);
  }
  if (CommonUtils.isNetworkConnected()) {
    showLoading();
  }
}
Program: 62543
Project: 62543
Buggy source:
private void initRecyclerView(List<NavigationListData> navigationDataList){
  NavigationAdapter adapter=new NavigationAdapter(R.layout.item_navigation,navigationDataList);
  mRecyclerView.setAdapter(adapter);
  mManager=new LinearLayoutManager(_mActivity);
  mRecyclerView.setLayoutManager(mManager);
  mRecyclerView.setHasFixedSize(true);
}

Fixed version (ground truth):
private void initRecyclerView(){
  List<NavigationListData> navigationDataList=new ArrayList<>();
  mNavigationAdapter=new NavigationAdapter(R.layout.item_navigation,navigationDataList);
  mManager=new LinearLayoutManager(_mActivity);
  mRecyclerView.setLayoutManager(mManager);
  mRecyclerView.setHasFixedSize(true);
  mRecyclerView.setAdapter(mNavigationAdapter);
}
Program: 62544
Project: 62544
Buggy source:
@Override public void showNavigationListData(List<NavigationListData> navigationDataList){
  mTabLayout.setTabAdapter(new TabAdapter(){
    @Override public int getCount(){
      return navigationDataList == null ? 0 : navigationDataList.size();
    }
    @Override public ITabView.TabBadge getBadge(    int i){
      return null;
    }
    @Override public ITabView.TabIcon getIcon(    int i){
      return null;
    }
    @Override public ITabView.TabTitle getTitle(    int i){
      return new TabView.TabTitle.Builder().setContent(navigationDataList.get(i).getName()).setTextColor(ContextCompat.getColor(_mActivity,R.color.shallow_green),ContextCompat.getColor(_mActivity,R.color.shallow_grey)).build();
    }
    @Override public int getBackground(    int i){
      return -1;
    }
  }
);
  if (mPresenter.getCurrentPage() == Constants.TYPE_NAVIGATION) {
    setChildViewVisibility(View.VISIBLE);
  }
 else {
    setChildViewVisibility(View.INVISIBLE);
  }
  initRecyclerView(navigationDataList);
  leftRightLinkage();
  showNormal();
}

Fixed version (ground truth):
@Override public void showNavigationListData(List<NavigationListData> navigationDataList){
  mTabLayout.setTabAdapter(new TabAdapter(){
    @Override public int getCount(){
      return navigationDataList == null ? 0 : navigationDataList.size();
    }
    @Override public ITabView.TabBadge getBadge(    int i){
      return null;
    }
    @Override public ITabView.TabIcon getIcon(    int i){
      return null;
    }
    @Override public ITabView.TabTitle getTitle(    int i){
      return new TabView.TabTitle.Builder().setContent(navigationDataList.get(i).getName()).setTextColor(ContextCompat.getColor(_mActivity,R.color.shallow_green),ContextCompat.getColor(_mActivity,R.color.shallow_grey)).build();
    }
    @Override public int getBackground(    int i){
      return -1;
    }
  }
);
  if (mPresenter.getCurrentPage() == Constants.TYPE_NAVIGATION) {
    setChildViewVisibility(View.VISIBLE);
  }
 else {
    setChildViewVisibility(View.INVISIBLE);
  }
  mNavigationAdapter.replaceData(navigationDataList);
  leftRightLinkage();
  showNormal();
}
Program: 62545
Project: 62545
Buggy source:
@Override protected void initEventAndData(){
  super.initEventAndData();
  setRefresh();
  Bundle bundle=getArguments();
  cid=bundle.getInt(Constants.ARG_PARAM1);
  initRecyclerView();
  mPresenter.getProjectListData(mCurrentPage,cid,true);
  if (CommonUtils.isNetworkConnected()) {
    showLoading();
  }
}

Fixed version (ground truth):
@Override protected void initEventAndData(){
  super.initEventAndData();
  setRefresh();
  Bundle bundle=getArguments();
  cid=bundle.getInt(Constants.ARG_PARAM1);
  mPresenter.getProjectListData(mCurrentPage,cid,true);
  if (CommonUtils.isNetworkConnected()) {
    showLoading();
  }
}
Program: 62546
Project: 62546
Buggy source:
private void initRecyclerView(){
  mDatas=new ArrayList<>();
  mAdapter=new ProjectListAdapter(R.layout.item_project_list,mDatas);
  mAdapter.setOnItemClickListener((adapter,view,position) -> startProjectPager(position));
  mAdapter.setOnItemChildClickListener((adapter,view,position) -> clickChildEvent(view,position));
  mRecyclerView.setAdapter(mAdapter);
  mRecyclerView.setLayoutManager(new LinearLayoutManager(_mActivity));
  mRecyclerView.setHasFixedSize(true);
}

Fixed version (ground truth):
private void initRecyclerView(){
  List<FeedArticleData> mDatas=new ArrayList<>();
  mAdapter=new ProjectListAdapter(R.layout.item_project_list,mDatas);
  mAdapter.setOnItemClickListener((adapter,view,position) -> startProjectPager(position));
  mAdapter.setOnItemChildClickListener((adapter,view,position) -> clickChildEvent(view,position));
  mRecyclerView.setLayoutManager(new LinearLayoutManager(_mActivity));
  mRecyclerView.setHasFixedSize(true);
  mRecyclerView.setAdapter(mAdapter);
}
Program: 62547
Project: 62547
Buggy source:
@Override public void showProjectListData(ProjectListData projectListData){
  mDatas=projectListData.getDatas();
  if (isRefresh) {
    mAdapter.replaceData(mDatas);
  }
 else {
    if (mDatas.size() > 0) {
      mAdapter.addData(mDatas);
    }
 else {
      CommonUtils.showMessage(_mActivity,getString(R.string.load_more_no_data));
    }
  }
  showNormal();
}

Fixed version (ground truth):
@Override public void showProjectListData(ProjectListData projectListData){
  if (isRefresh) {
    mAdapter.replaceData(projectListData.getDatas());
  }
 else {
    if (projectListData.getDatas().size() > 0) {
      mAdapter.addData(projectListData.getDatas());
    }
 else {
      CommonUtils.showMessage(_mActivity,getString(R.string.load_more_no_data));
    }
  }
  showNormal();
}
Program: 62548
Project: 62548
Buggy source:
/** 
 * Show message
 * @param activity Activity
 * @param msg message
 */
public static void showSnackMessage(Activity activity,String msg){
  LogHelper.e("String_Node_Str" + msg);
  Snackbar snackbar=Snackbar.make(activity.getWindow().getDecorView(),msg,Snackbar.LENGTH_SHORT);
  View view=snackbar.getView();
  ((TextView)view.findViewById(R.id.snackbar_text)).setTextColor(ContextCompat.getColor(activity,R.color.white));
  snackbar.show();
}

Fixed version (ground truth):
/** 
 * Show message
 * @param activity Activity
 * @param msg message
 */
public static void showSnackMessage(Activity activity,String msg){
  LogHelper.e("String_Node_Str" + msg);
  activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE);
  final Snackbar snackbar=Snackbar.make(activity.getWindow().getDecorView(),msg,Snackbar.LENGTH_SHORT);
  View view=snackbar.getView();
  ((TextView)view.findViewById(R.id.snackbar_text)).setTextColor(ContextCompat.getColor(activity,R.color.white));
  snackbar.setAction("String_Node_Str",v -> {
    snackbar.dismiss();
    activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
  }
).show();
}
Program: 62549
Project: 62549
Buggy source:
@Override public void showCancelCollectArticleData(BaseResponse<FeedArticleListData> feedArticleListResponse){
  isCollect=false;
  if (!isCollectPage) {
    mCollectItem.setTitle(R.string.collect);
    mCollectItem.setIcon(R.mipmap.ic_toolbar_like_n);
  }
  CommonUtils.showSnackMessage(this,getString(R.string.cancel_collect_success));
}

Fixed version (ground truth):
@Override public void showCancelCollectArticleData(BaseResponse<FeedArticleListData> feedArticleListResponse){
  isCollect=false;
  if (!isCollectPage) {
    mCollectItem.setTitle(R.string.collect);
  }
  mCollectItem.setIcon(R.mipmap.ic_toolbar_like_n);
  CommonUtils.showSnackMessage(this,getString(R.string.cancel_collect_success));
}
Program: 62550
Project: 62550
Buggy source:
/** 
 * 使用Glide加载圆形ImageView(如头像)时，不要使用占位图
 * @param context context
 * @param url image url
 * @param iv imageView
 */
public static void load(Context context,String url,ImageView iv){
  if (!WanAndroidApp.getAppComponent().preferencesHelper().getNoImageState()) {
    Glide.with(context).load(url).into(iv);
  }
}

Fixed version (ground truth):
/** 
 * 使用Glide加载圆形ImageView(如头像)时，不要使用占位图
 * @param context context
 * @param url image url
 * @param iv imageView
 */
public static void load(Context context,String url,ImageView iv){
  if (!WanAndroidApp.getAppComponent().getDataManager().getNoImageState()) {
    Glide.with(context).load(url).into(iv);
  }
}
Program: 62551
Project: 62551
Buggy source:
@Override protected void initEventAndData(){
  super.initEventAndData();
  setRefresh();
  mAdapter=new KnowledgeHierarchyAdapter(R.layout.item_knowledge_hierarchy,mKnowledgeHierarchyDataList);
  mAdapter.setOnItemClickListener((adapter,view,position) -> {
    ActivityOptions options=ActivityOptions.makeSceneTransitionAnimation(_mActivity,view,getString(R.string.share_view));
    Intent intent=new Intent(_mActivity,KnowledgeHierarchyDetailActivity.class);
    intent.putExtra(Constants.ARG_PARAM1,mAdapter.getData().get(position));
    startActivity(intent,options.toBundle());
  }
);
  mRecyclerView.setAdapter(mAdapter);
  mRecyclerView.setLayoutManager(new LinearLayoutManager(_mActivity));
  mPresenter.getKnowledgeHierarchyData();
  if (CommonUtils.isNetworkConnected()) {
    showLoading();
  }
}

Fixed version (ground truth):
@Override protected void initEventAndData(){
  super.initEventAndData();
  setRefresh();
  mAdapter=new KnowledgeHierarchyAdapter(R.layout.item_knowledge_hierarchy,mKnowledgeHierarchyDataList);
  mAdapter.setOnItemClickListener((adapter,view,position) -> {
    if (mAdapter.getData().size() <= 0 || mAdapter.getData().size() <= position) {
      return;
    }
    ActivityOptions options=ActivityOptions.makeSceneTransitionAnimation(_mActivity,view,getString(R.string.share_view));
    Intent intent=new Intent(_mActivity,KnowledgeHierarchyDetailActivity.class);
    intent.putExtra(Constants.ARG_PARAM1,mAdapter.getData().get(position));
    startActivity(intent,options.toBundle());
  }
);
  mRecyclerView.setAdapter(mAdapter);
  mRecyclerView.setLayoutManager(new LinearLayoutManager(_mActivity));
  mPresenter.getKnowledgeHierarchyData();
  if (CommonUtils.isNetworkConnected()) {
    showLoading();
  }
}
Program: 62553
Project: 62553
Buggy source:
private void likeEvent(int position){
  if (!mPresenter.getLoginStatus()) {
    startActivity(new Intent(_mActivity,LoginActivity.class));
    CommonUtils.showMessage(_mActivity,getString(R.string.login_tint));
    return;
  }
  if (mAdapter.getData().get(position).isCollect()) {
    mPresenter.cancelCollectArticle(position,mAdapter.getData().get(position));
  }
 else {
    mPresenter.addCollectArticle(position,mAdapter.getData().get(position));
  }
}

Fixed version (ground truth):
private void likeEvent(int position){
  if (!mPresenter.getLoginStatus()) {
    startActivity(new Intent(_mActivity,LoginActivity.class));
    CommonUtils.showMessage(_mActivity,getString(R.string.login_tint));
    return;
  }
  if (mAdapter.getData().size() <= 0 || mAdapter.getData().size() <= position) {
    return;
  }
  if (mAdapter.getData().get(position).isCollect()) {
    mPresenter.cancelCollectArticle(position,mAdapter.getData().get(position));
  }
 else {
    mPresenter.addCollectArticle(position,mAdapter.getData().get(position));
  }
}
Program: 62554
Project: 62554
Buggy source:
@Override public void onBackPressedSupport(){
  if (getSupportFragmentManager().getBackStackEntryCount() > 1) {
    pop();
  }
 else {
    finishAfterTransition();
  }
}

Fixed version (ground truth):
@Override public void onBackPressedSupport(){
  if (getSupportFragmentManager().getBackStackEntryCount() > 1) {
    pop();
  }
 else {
    supportFinishAfterTransition();
  }
}
Program: 62555
Project: 62555
Buggy source:
private void initView(){
  mArticles=new ArrayList<>();
  mAdapter=new ArticleListAdapter(R.layout.item_search_pager,mArticles);
  mAdapter.isCollectPage();
  mAdapter.setOnItemClickListener((adapter,view,position) -> {
    mOptions=ActivityOptions.makeSceneTransitionAnimation(_mActivity,view,getString(R.string.share_view));
    JudgeUtils.startArticleDetailActivity(_mActivity,mOptions,mAdapter.getData().get(position).getId(),mAdapter.getData().get(position).getTitle(),mAdapter.getData().get(position).getLink(),true,true,false);
  }
);
  mAdapter.setOnItemChildClickListener((adapter,view,position) -> {
switch (view.getId()) {
case R.id.item_search_pager_chapterName:
      JudgeUtils.startKnowledgeHierarchyDetailActivity(_mActivity,true,mAdapter.getData().get(position).getChapterName(),mAdapter.getData().get(position).getChapterName(),mAdapter.getData().get(position).getChapterId());
    break;
case R.id.item_search_pager_like_iv:
  mPresenter.cancelCollectPageArticle(position,mAdapter.getData().get(position));
break;
default :
break;
}
}
);
mRecyclerView.setAdapter(mAdapter);
mRecyclerView.setLayoutManager(new LinearLayoutManager(_mActivity));
mPresenter.getCollectList(mCurrentPage);
}

Fixed version (ground truth):
private void initView(){
  mArticles=new ArrayList<>();
  mAdapter=new ArticleListAdapter(R.layout.item_search_pager,mArticles);
  mAdapter.isCollectPage();
  mAdapter.setOnItemClickListener((adapter,view,position) -> {
    if (mAdapter.getData().size() <= 0 || mAdapter.getData().size() <= position) {
      return;
    }
    mOptions=ActivityOptions.makeSceneTransitionAnimation(_mActivity,view,getString(R.string.share_view));
    JudgeUtils.startArticleDetailActivity(_mActivity,mOptions,mAdapter.getData().get(position).getId(),mAdapter.getData().get(position).getTitle(),mAdapter.getData().get(position).getLink(),true,true,false);
  }
);
  mAdapter.setOnItemChildClickListener((adapter,view,position) -> {
switch (view.getId()) {
case R.id.item_search_pager_chapterName:
      if (mAdapter.getData().size() <= 0 || mAdapter.getData().size() <= position) {
        return;
      }
    JudgeUtils.startKnowledgeHierarchyDetailActivity(_mActivity,true,mAdapter.getData().get(position).getChapterName(),mAdapter.getData().get(position).getChapterName(),mAdapter.getData().get(position).getChapterId());
  break;
case R.id.item_search_pager_like_iv:
if (mAdapter.getData().size() <= 0 || mAdapter.getData().size() <= position) {
  return;
}
mPresenter.cancelCollectPageArticle(position,mAdapter.getData().get(position));
break;
default :
break;
}
}
);
mRecyclerView.setAdapter(mAdapter);
mRecyclerView.setLayoutManager(new LinearLayoutManager(_mActivity));
mPresenter.getCollectList(mCurrentPage);
}
Program: 62556
Project: 62556
Buggy source:
private void startMainPager(){
  mTitleTv.setText(getString(R.string.home_pager));
  bottomNavigationBar.setVisibility(View.VISIBLE);
  bottomNavigationBar.setSelectedItemId(R.id.tab_main_pager);
  mDrawerLayout.closeDrawers();
}

Fixed version (ground truth):
private void startMainPager(){
  mTitleTv.setText(getString(R.string.home_pager));
  mBottomNavigationView.setVisibility(View.VISIBLE);
  mBottomNavigationView.setSelectedItemId(R.id.tab_main_pager);
  mDrawerLayout.closeDrawers();
}
Program: 62557
Project: 62557
Buggy source:
/** 
 * 切换fragment
 * @param position 要显示的fragment的下标
 */
private void switchFragment(int position){
  if (position >= Constants.TYPE_COLLECT) {
    mFloatingActionButton.setVisibility(View.INVISIBLE);
    bottomNavigationBar.setVisibility(View.INVISIBLE);
  }
 else {
    mFloatingActionButton.setVisibility(View.VISIBLE);
    bottomNavigationBar.setVisibility(View.VISIBLE);
  }
  if (position >= mFragments.size()) {
    return;
  }
  FragmentTransaction ft=getSupportFragmentManager().beginTransaction();
  Fragment targetFg=mFragments.get(position);
  Fragment lastFg=mFragments.get(mLastFgIndex);
  mLastFgIndex=position;
  ft.hide(lastFg);
  if (!targetFg.isAdded()) {
    ft.add(R.id.fragment_group,targetFg);
  }
  ft.show(targetFg);
  ft.commitAllowingStateLoss();
}

Fixed version (ground truth):
/** 
 * 切换fragment
 * @param position 要显示的fragment的下标
 */
private void switchFragment(int position){
  if (position >= Constants.TYPE_COLLECT) {
    mFloatingActionButton.setVisibility(View.INVISIBLE);
    mBottomNavigationView.setVisibility(View.INVISIBLE);
  }
 else {
    mFloatingActionButton.setVisibility(View.VISIBLE);
    mBottomNavigationView.setVisibility(View.VISIBLE);
  }
  if (position >= mFragments.size()) {
    return;
  }
  FragmentTransaction ft=getSupportFragmentManager().beginTransaction();
  Fragment targetFg=mFragments.get(position);
  Fragment lastFg=mFragments.get(mLastFgIndex);
  mLastFgIndex=position;
  ft.hide(lastFg);
  if (!targetFg.isAdded()) {
    getSupportFragmentManager().beginTransaction().remove(targetFg).commit();
    ft.add(R.id.fragment_group,targetFg);
  }
  ft.show(targetFg);
  ft.commitAllowingStateLoss();
}
Program: 62558
Project: 62558
Buggy source:
@Override protected void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mFragments=new ArrayList<>();
  if (savedInstanceState == null) {
    mPresenter.setNightModeState(false);
    mMainPagerFragment=MainPagerFragment.getInstance(false,null);
    mFragments.add(mMainPagerFragment);
    initData();
    init();
    switchFragment(Constants.TYPE_MAIN_PAGER);
  }
 else {
    bottomNavigationBar.setSelectedItemId(R.id.tab_main_pager);
    mMainPagerFragment=MainPagerFragment.getInstance(true,null);
    mFragments.add(mMainPagerFragment);
    initData();
    init();
    switchFragment(Constants.TYPE_SETTING);
  }
}

Fixed version (ground truth):
@Override protected void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mFragments=new ArrayList<>();
  if (savedInstanceState == null) {
    mPresenter.setNightModeState(false);
    mMainPagerFragment=MainPagerFragment.getInstance(false,null);
    mFragments.add(mMainPagerFragment);
    initData();
    init();
    switchFragment(Constants.TYPE_MAIN_PAGER);
  }
 else {
    mBottomNavigationView.setSelectedItemId(R.id.tab_main_pager);
    mMainPagerFragment=MainPagerFragment.getInstance(true,null);
    mFragments.add(mMainPagerFragment);
    initData();
    init();
    switchFragment(Constants.TYPE_SETTING);
  }
}
Program: 62559
Project: 62559
Buggy source:
private void init(){
  initNavigationView();
  BottomNavigationViewHelper.disableShiftMode(bottomNavigationBar);
  mPresenter.setCurrentPage(Constants.TYPE_MAIN_PAGER);
  bottomNavigationBar.setOnNavigationItemSelectedListener(item -> {
switch (item.getItemId()) {
case R.id.tab_main_pager:
      mTitleTv.setText(getString(R.string.home_pager));
    switchFragment(0);
  mMainPagerFragment.reload();
mPresenter.setCurrentPage(Constants.TYPE_MAIN_PAGER);
break;
case R.id.tab_knowledge_hierarchy:
mTitleTv.setText(getString(R.string.knowledge_hierarchy));
switchFragment(1);
mKnowledgeHierarchyFragment.reload();
mPresenter.setCurrentPage(Constants.TYPE_KNOWLEDGE);
break;
case R.id.tab_navigation:
switchNavigation();
break;
case R.id.tab_project:
switchProject();
break;
default :
break;
}
return true;
}
);
ActionBarDrawerToggle toggle=new ActionBarDrawerToggle(this,mDrawerLayout,mToolbar,R.string.navigation_drawer_open,R.string.navigation_drawer_close){
@Override public void onDrawerSlide(View drawerView,float slideOffset){
View mContent=mDrawerLayout.getChildAt(0);
float scale=1 - slideOffset;
float endScale=0.8f + scale * 0.2f;
float startScale=1 - 0.3f * scale;
drawerView.setScaleX(startScale);
drawerView.setScaleY(startScale);
drawerView.setAlpha(0.6f + 0.4f * (1 - scale));
mContent.setTranslationX(drawerView.getMeasuredWidth() * (1 - scale));
mContent.invalidate();
mContent.setScaleX(endScale);
mContent.setScaleY(endScale);
}
}
;
toggle.syncState();
mDrawerLayout.addDrawerListener(toggle);
}

Fixed version (ground truth):
private void init(){
  initNavigationView();
  BottomNavigationViewHelper.disableShiftMode(mBottomNavigationView);
  mPresenter.setCurrentPage(Constants.TYPE_MAIN_PAGER);
  mBottomNavigationView.setOnNavigationItemSelectedListener(item -> {
switch (item.getItemId()) {
case R.id.tab_main_pager:
      mTitleTv.setText(getString(R.string.home_pager));
    switchFragment(0);
  mMainPagerFragment.reload();
mPresenter.setCurrentPage(Constants.TYPE_MAIN_PAGER);
break;
case R.id.tab_knowledge_hierarchy:
mTitleTv.setText(getString(R.string.knowledge_hierarchy));
switchFragment(1);
mKnowledgeHierarchyFragment.reload();
mPresenter.setCurrentPage(Constants.TYPE_KNOWLEDGE);
break;
case R.id.tab_navigation:
switchNavigation();
break;
case R.id.tab_project:
switchProject();
break;
default :
break;
}
return true;
}
);
ActionBarDrawerToggle toggle=new ActionBarDrawerToggle(this,mDrawerLayout,mToolbar,R.string.navigation_drawer_open,R.string.navigation_drawer_close){
@Override public void onDrawerSlide(View drawerView,float slideOffset){
View mContent=mDrawerLayout.getChildAt(0);
float scale=1 - slideOffset;
float endScale=0.8f + scale * 0.2f;
float startScale=1 - 0.3f * scale;
drawerView.setScaleX(startScale);
drawerView.setScaleY(startScale);
drawerView.setAlpha(0.6f + 0.4f * (1 - scale));
mContent.setTranslationX(drawerView.getMeasuredWidth() * (1 - scale));
mContent.invalidate();
mContent.setScaleX(endScale);
mContent.setScaleY(endScale);
}
}
;
toggle.syncState();
mDrawerLayout.addDrawerListener(toggle);
}
Program: 62560
Project: 62560
Buggy source:
@Override public void showSwitchProject(){
  bottomNavigationBar.setSelectedItemId(R.id.tab_project);
}

Fixed version (ground truth):
@Override public void showSwitchProject(){
  mBottomNavigationView.setSelectedItemId(R.id.tab_project);
}
Program: 62561
Project: 62561
Buggy source:
@Override public void showSwitchNavigation(){
  bottomNavigationBar.setSelectedItemId(R.id.tab_navigation);
}

Fixed version (ground truth):
@Override public void showSwitchNavigation(){
  mBottomNavigationView.setSelectedItemId(R.id.tab_navigation);
}
Program: 62563
Project: 62563
Buggy source:
private void likeEvent(int position){
  if (!mPresenter.getLoginStatus()) {
    startActivity(new Intent(this,LoginActivity.class));
    CommonUtils.showMessage(this,getString(R.string.login_tint));
    return;
  }
  if (mAdapter.getData().get(position).isCollect()) {
    mPresenter.cancelCollectArticle(position,mAdapter.getData().get(position));
  }
 else {
    mPresenter.addCollectArticle(position,mAdapter.getData().get(position));
  }
}

Fixed version (ground truth):
private void likeEvent(int position){
  if (!mPresenter.getLoginStatus()) {
    startActivity(new Intent(this,LoginActivity.class));
    CommonUtils.showMessage(this,getString(R.string.login_tint));
    return;
  }
  if (mAdapter.getData().size() <= 0 || mAdapter.getData().size() <= position) {
    return;
  }
  if (mAdapter.getData().get(position).isCollect()) {
    mPresenter.cancelCollectArticle(position,mAdapter.getData().get(position));
  }
 else {
    mPresenter.addCollectArticle(position,mAdapter.getData().get(position));
  }
}
Program: 62564
Project: 62564
Buggy source:
@Override public void onHideAnimationEnd(){
  mSearchEdit.setText("String_Node_Str");
  dismiss();
}

Fixed version (ground truth):
@Override public void onHideAnimationEnd(){
  mSearchEdit.setText("String_Node_Str");
  dismissAllowingStateLoss();
}
Program: 62565
Project: 62565
Buggy source:
@Override public void onHideAnimationEnd(){
  dismiss();
}

Fixed version (ground truth):
@Override public void onHideAnimationEnd(){
  dismissAllowingStateLoss();
}
Program: 62567
Project: 62567
Buggy source:
private void likeEvent(int position){
  if (!mPresenter.getLoginStatus()) {
    startActivity(new Intent(_mActivity,LoginActivity.class));
    CommonUtils.showMessage(_mActivity,getString(R.string.login_tint));
    return;
  }
  if (mAdapter.getData().get(position).isCollect()) {
    mPresenter.cancelCollectArticle(position,mAdapter.getData().get(position));
  }
 else {
    mPresenter.addCollectArticle(position,mAdapter.getData().get(position));
  }
}

Fixed version (ground truth):
private void likeEvent(int position){
  if (!mPresenter.getLoginStatus()) {
    startActivity(new Intent(_mActivity,LoginActivity.class));
    CommonUtils.showMessage(_mActivity,getString(R.string.login_tint));
    return;
  }
  if (mAdapter.getData().size() <= 0 || mAdapter.getData().size() <= position) {
    return;
  }
  if (mAdapter.getData().get(position).isCollect()) {
    mPresenter.cancelCollectArticle(position,mAdapter.getData().get(position));
  }
 else {
    mPresenter.addCollectArticle(position,mAdapter.getData().get(position));
  }
}
Program: 62568
Project: 62568
Buggy source:
@Override protected void initEventAndData(){
  super.initEventAndData();
  setRefresh();
  Bundle bundle=getArguments();
  cid=bundle.getInt(Constants.ARG_PARAM1);
  mDatas=new ArrayList<>();
  mAdapter=new ProjectListAdapter(R.layout.item_project_list,mDatas);
  mAdapter.setOnItemClickListener((adapter,view,position) -> JudgeUtils.startArticleDetailActivity(_mActivity,null,mAdapter.getData().get(position).getId(),mAdapter.getData().get(position).getTitle().trim(),mAdapter.getData().get(position).getLink().trim(),mAdapter.getData().get(position).isCollect(),false,true));
  mAdapter.setOnItemChildClickListener((adapter,view,position) -> {
switch (view.getId()) {
case R.id.item_project_list_install_tv:
      if (TextUtils.isEmpty(mAdapter.getData().get(position).getApkLink())) {
        return;
      }
    startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(mAdapter.getData().get(position).getApkLink())));
  break;
default :
break;
}
}
);
mRecyclerView.setAdapter(mAdapter);
mRecyclerView.setLayoutManager(new LinearLayoutManager(_mActivity));
mPresenter.getProjectListData(mCurrentPage,cid);
if (CommonUtils.isNetworkConnected()) {
showLoading();
}
}

Fixed version (ground truth):
@Override protected void initEventAndData(){
  super.initEventAndData();
  setRefresh();
  Bundle bundle=getArguments();
  cid=bundle.getInt(Constants.ARG_PARAM1);
  mDatas=new ArrayList<>();
  mAdapter=new ProjectListAdapter(R.layout.item_project_list,mDatas);
  mAdapter.setOnItemClickListener((adapter,view,position) -> {
    if (mAdapter.getData().size() <= 0 || mAdapter.getData().size() <= position) {
      return;
    }
    JudgeUtils.startArticleDetailActivity(_mActivity,null,mAdapter.getData().get(position).getId(),mAdapter.getData().get(position).getTitle().trim(),mAdapter.getData().get(position).getLink().trim(),mAdapter.getData().get(position).isCollect(),false,true);
  }
);
  mAdapter.setOnItemChildClickListener((adapter,view,position) -> {
switch (view.getId()) {
case R.id.item_project_list_install_tv:
      if (mAdapter.getData().size() <= 0 || mAdapter.getData().size() <= position) {
        return;
      }
    if (TextUtils.isEmpty(mAdapter.getData().get(position).getApkLink())) {
      return;
    }
  startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(mAdapter.getData().get(position).getApkLink())));
break;
default :
break;
}
}
);
mRecyclerView.setAdapter(mAdapter);
mRecyclerView.setLayoutManager(new LinearLayoutManager(_mActivity));
mPresenter.getProjectListData(mCurrentPage,cid);
if (CommonUtils.isNetworkConnected()) {
showLoading();
}
}
Program: 62569
Project: 62569
Buggy source:
/** 
 * 切换fragment
 * @param position 要显示的fragment的下标
 */
private void switchFragment(int position){
  if (position >= mFragments.size()) {
    return;
  }
  FragmentTransaction ft=getSupportFragmentManager().beginTransaction();
  Fragment targetFg=mFragments.get(position);
  Fragment lastFg=mFragments.get(mLastFgIndex);
  mLastFgIndex=position;
  ft.hide(lastFg);
  if (!targetFg.isAdded()) {
    ft.add(R.id.fragment_group,targetFg);
  }
  ft.show(targetFg);
  ft.commitAllowingStateLoss();
}

Fixed version (ground truth):
/** 
 * 切换fragment
 * @param position 要显示的fragment的下标
 */
private void switchFragment(int position){
  if (position >= mFragments.size()) {
    return;
  }
  FragmentTransaction ft=getSupportFragmentManager().beginTransaction();
  Fragment targetFg=mFragments.get(position);
  Fragment lastFg=mFragments.get(mLastFgIndex);
  mLastFgIndex=position;
  ft.hide(lastFg);
  if (!targetFg.isAdded()) {
    ft.remove(targetFg);
    ft.add(R.id.fragment_group,targetFg);
  }
  ft.show(targetFg);
  ft.commitAllowingStateLoss();
}
Program: 62570
Project: 62570
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.item_share:
    mPresenter.shareEventPermissionVerify(new RxPermissions(this));
  shareEvent();
break;
case R.id.item_collect:
collectEvent();
break;
case R.id.item_system_browser:
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(articleLink)));
break;
default :
break;
}
return super.onOptionsItemSelected(item);
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.item_share:
    mPresenter.shareEventPermissionVerify(new RxPermissions(this));
  break;
case R.id.item_collect:
collectEvent();
break;
case R.id.item_system_browser:
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(articleLink)));
break;
default :
break;
}
return super.onOptionsItemSelected(item);
}
Program: 62571
Project: 62571
Buggy source:
/** 
 * Show content
 * @param feedArticleListResponse BaseResponse<FeedArticleListData>
 * @param isReLogin If reLogin
 */
void showArticleList(BaseResponse<FeedArticleListData> feedArticleListResponse,boolean isReLogin);

Fixed version (ground truth):
/** 
 * Show content
 * @param feedArticleListResponse BaseResponse<FeedArticleListData>
 */
void showArticleList(BaseResponse<FeedArticleListData> feedArticleListResponse);
Program: 62572
Project: 62572
Buggy source:
@Override public void getFeedArticleList(int page){
  addSubscribe(mDataManager.getFeedArticleList(page).compose(RxUtils.rxSchedulerHelper()).filter(feedArticleListResponse -> mView != null).subscribeWith(new BaseObserver<BaseResponse<FeedArticleListData>>(mView){
    @Override public void onNext(    BaseResponse<FeedArticleListData> feedArticleListResponse){
      if (feedArticleListResponse.getErrorCode() == BaseResponse.SUCCESS) {
        mView.showArticleList(feedArticleListResponse,false);
      }
 else {
        mView.showArticleListFail();
      }
    }
  }
));
}

Fixed version (ground truth):
@Override public void getFeedArticleList(int page){
  addSubscribe(mDataManager.getFeedArticleList(page).compose(RxUtils.rxSchedulerHelper()).filter(feedArticleListResponse -> mView != null).subscribeWith(new BaseObserver<BaseResponse<FeedArticleListData>>(mView){
    @Override public void onNext(    BaseResponse<FeedArticleListData> feedArticleListResponse){
      if (feedArticleListResponse.getErrorCode() == BaseResponse.SUCCESS) {
        mView.showArticleList(feedArticleListResponse);
      }
 else {
        mView.showArticleListFail();
      }
    }
  }
));
}
Program: 62573
Project: 62573
Buggy source:
@Override public void loadMainPagerData(){
  String account=mDataManager.getLoginAccount();
  String password=mDataManager.getLoginPassword();
  Observable<BaseResponse<LoginData>> mLoginObservable=mDataManager.getLoginData(account,password);
  Observable<BaseResponse<List<BannerData>>> mBannerObservable=mDataManager.getBannerData();
  Observable<BaseResponse<FeedArticleListData>> mArticleObservable=mDataManager.getFeedArticleList(Constants.FIRST);
  Observable.zip(mLoginObservable,mBannerObservable,mArticleObservable,(loginResponse,bannerResponse,feedArticleListResponse) -> {
    HashMap<String,Object> map=new HashMap<>(3);
    map.put(Constants.LOGIN_DATA,loginResponse);
    map.put(Constants.BANNER_DATA,bannerResponse);
    map.put(Constants.ARTICLE_DATA,feedArticleListResponse);
    return map;
  }
).compose(RxUtils.rxSchedulerHelper()).subscribeWith(new BaseObserver<HashMap<String,Object>>(mView){
    @Override public void onNext(    HashMap<String,Object> map){
      BaseResponse<LoginData> loginResponse=CommonUtils.cast(map.get(Constants.LOGIN_DATA));
      if (loginResponse.getErrorCode() == BaseResponse.SUCCESS) {
        mView.showAutoLoginSuccess();
      }
      mView.showBannerData(CommonUtils.cast(map.get(Constants.BANNER_DATA)));
      mView.showArticleList(CommonUtils.cast(map.get(Constants.ARTICLE_DATA)),true);
    }
    @Override public void onError(    Throwable e){
      super.onError(e);
      mView.showAutoLoginFail();
    }
  }
);
}

Fixed version (ground truth):
@Override public void loadMainPagerData(){
  String account=mDataManager.getLoginAccount();
  String password=mDataManager.getLoginPassword();
  Observable<BaseResponse<LoginData>> mLoginObservable=mDataManager.getLoginData(account,password);
  Observable<BaseResponse<List<BannerData>>> mBannerObservable=mDataManager.getBannerData();
  Observable<BaseResponse<FeedArticleListData>> mArticleObservable=mDataManager.getFeedArticleList(Constants.FIRST);
  Observable.zip(mLoginObservable,mBannerObservable,mArticleObservable,(loginResponse,bannerResponse,feedArticleListResponse) -> {
    HashMap<String,Object> map=new HashMap<>(3);
    map.put(Constants.LOGIN_DATA,loginResponse);
    map.put(Constants.BANNER_DATA,bannerResponse);
    map.put(Constants.ARTICLE_DATA,feedArticleListResponse);
    return map;
  }
).compose(RxUtils.rxSchedulerHelper()).subscribeWith(new BaseObserver<HashMap<String,Object>>(mView){
    @Override public void onNext(    HashMap<String,Object> map){
      BaseResponse<LoginData> loginResponse=CommonUtils.cast(map.get(Constants.LOGIN_DATA));
      if (loginResponse.getErrorCode() == BaseResponse.SUCCESS) {
        mView.showAutoLoginSuccess();
      }
      mView.showBannerData(CommonUtils.cast(map.get(Constants.BANNER_DATA)));
      mView.showArticleList(CommonUtils.cast(map.get(Constants.ARTICLE_DATA)));
    }
    @Override public void onError(    Throwable e){
      super.onError(e);
      mView.showAutoLoginFail();
    }
  }
);
}
Program: 62575
Project: 62575
Buggy source:
@Override public void showArticleList(BaseResponse<FeedArticleListData> feedArticleListResponse,boolean isReLogin){
  if (feedArticleListResponse == null || feedArticleListResponse.getData() == null || feedArticleListResponse.getData().getDatas() == null) {
    showArticleListFail();
    return;
  }
  RxBus.getDefault().post(new DismissErrorView());
  if (isReLogin || mDataManager.getCurrentPage() == Constants.FIRST) {
    mRefreshLayout.setVisibility(View.VISIBLE);
  }
 else {
    mRefreshLayout.setVisibility(View.INVISIBLE);
  }
  if (isRefresh) {
    mFeedArticleDataList=feedArticleListResponse.getData().getDatas();
    mAdapter.replaceData(feedArticleListResponse.getData().getDatas());
  }
 else {
    mFeedArticleDataList.addAll(feedArticleListResponse.getData().getDatas());
    mAdapter.addData(feedArticleListResponse.getData().getDatas());
  }
}

Fixed version (ground truth):
@Override public void showArticleList(BaseResponse<FeedArticleListData> feedArticleListResponse){
  if (feedArticleListResponse == null || feedArticleListResponse.getData() == null || feedArticleListResponse.getData().getDatas() == null) {
    showArticleListFail();
    return;
  }
  RxBus.getDefault().post(new DismissErrorView());
  if (mDataManager.getCurrentPage() == Constants.FIRST) {
    mRefreshLayout.setVisibility(View.VISIBLE);
  }
 else {
    mRefreshLayout.setVisibility(View.INVISIBLE);
  }
  if (isRefresh) {
    mFeedArticleDataList=feedArticleListResponse.getData().getDatas();
    mAdapter.replaceData(feedArticleListResponse.getData().getDatas());
  }
 else {
    mFeedArticleDataList.addAll(feedArticleListResponse.getData().getDatas());
    mAdapter.addData(feedArticleListResponse.getData().getDatas());
  }
}
Program: 62576
Project: 62576
Buggy source:
/** 
 * 切换fragment
 * @param position 要显示的fragment的下标
 */
private void switchFragment(int position){
  if (position >= mFragments.size()) {
    return;
  }
  FragmentTransaction ft=getSupportFragmentManager().beginTransaction();
  Fragment targetFg=mFragments.get(position);
  Fragment lastFg=mFragments.get(mLastFgIndex);
  mLastFgIndex=position;
  ft.hide(lastFg);
  if (!targetFg.isAdded()) {
    ft.remove(targetFg);
    ft.add(R.id.fragment_group,targetFg);
  }
  ft.show(targetFg);
  ft.commitAllowingStateLoss();
}

Fixed version (ground truth):
/** 
 * 切换fragment
 * @param position 要显示的fragment的下标
 */
private void switchFragment(int position){
  if (position >= mFragments.size()) {
    return;
  }
  FragmentTransaction ft=getSupportFragmentManager().beginTransaction();
  Fragment targetFg=mFragments.get(position);
  Fragment lastFg=mFragments.get(mLastFgIndex);
  mLastFgIndex=position;
  ft.hide(lastFg);
  if (!targetFg.isAdded()) {
    ft.add(R.id.fragment_group,targetFg);
  }
  ft.show(targetFg);
  ft.commitAllowingStateLoss();
}
Program: 62577
Project: 62577
Buggy source:
/** 
 * Show content
 * @param feedArticleListResponse BaseResponse<FeedArticleListData>
 */
void showArticleList(BaseResponse<FeedArticleListData> feedArticleListResponse);

Fixed version (ground truth):
/** 
 * Show content
 * @param feedArticleListResponse BaseResponse<FeedArticleListData>
 * @param isReLogin If reLogin
 */
void showArticleList(BaseResponse<FeedArticleListData> feedArticleListResponse,boolean isReLogin);
Program: 62578
Project: 62578
Buggy source:
@Override public void getFeedArticleList(int page){
  addSubscribe(mDataManager.getFeedArticleList(page).compose(RxUtils.rxSchedulerHelper()).filter(feedArticleListResponse -> mView != null).subscribeWith(new BaseObserver<BaseResponse<FeedArticleListData>>(mView){
    @Override public void onNext(    BaseResponse<FeedArticleListData> feedArticleListResponse){
      if (feedArticleListResponse.getErrorCode() == BaseResponse.SUCCESS) {
        mView.showArticleList(feedArticleListResponse);
      }
 else {
        mView.showArticleListFail();
      }
    }
  }
));
}

Fixed version (ground truth):
@Override public void getFeedArticleList(int page){
  addSubscribe(mDataManager.getFeedArticleList(page).compose(RxUtils.rxSchedulerHelper()).filter(feedArticleListResponse -> mView != null).subscribeWith(new BaseObserver<BaseResponse<FeedArticleListData>>(mView){
    @Override public void onNext(    BaseResponse<FeedArticleListData> feedArticleListResponse){
      if (feedArticleListResponse.getErrorCode() == BaseResponse.SUCCESS) {
        mView.showArticleList(feedArticleListResponse,false);
      }
 else {
        mView.showArticleListFail();
      }
    }
  }
));
}
Program: 62579
Project: 62579
Buggy source:
@Override public void loadMainPagerData(){
  String account=mDataManager.getLoginAccount();
  String password=mDataManager.getLoginPassword();
  Observable<BaseResponse<LoginData>> mLoginObservable=mDataManager.getLoginData(account,password);
  Observable<BaseResponse<List<BannerData>>> mBannerObservable=mDataManager.getBannerData();
  Observable<BaseResponse<FeedArticleListData>> mArticleObservable=mDataManager.getFeedArticleList(Constants.FIRST);
  Observable.zip(mLoginObservable,mBannerObservable,mArticleObservable,(loginResponse,bannerResponse,feedArticleListResponse) -> {
    HashMap<String,Object> map=new HashMap<>(3);
    map.put(Constants.LOGIN_DATA,loginResponse);
    map.put(Constants.BANNER_DATA,bannerResponse);
    map.put(Constants.ARTICLE_DATA,feedArticleListResponse);
    return map;
  }
).compose(RxUtils.rxSchedulerHelper()).subscribeWith(new BaseObserver<HashMap<String,Object>>(mView){
    @Override public void onNext(    HashMap<String,Object> map){
      BaseResponse<LoginData> loginResponse=CommonUtils.cast(map.get(Constants.LOGIN_DATA));
      if (loginResponse.getErrorCode() == BaseResponse.SUCCESS) {
        mView.showAutoLoginSuccess();
      }
      mView.showBannerData(CommonUtils.cast(map.get(Constants.BANNER_DATA)));
      mView.showArticleList(CommonUtils.cast(map.get(Constants.ARTICLE_DATA)));
    }
    @Override public void onError(    Throwable e){
      super.onError(e);
      mView.showAutoLoginFail();
    }
  }
);
}

Fixed version (ground truth):
@Override public void loadMainPagerData(){
  String account=mDataManager.getLoginAccount();
  String password=mDataManager.getLoginPassword();
  Observable<BaseResponse<LoginData>> mLoginObservable=mDataManager.getLoginData(account,password);
  Observable<BaseResponse<List<BannerData>>> mBannerObservable=mDataManager.getBannerData();
  Observable<BaseResponse<FeedArticleListData>> mArticleObservable=mDataManager.getFeedArticleList(Constants.FIRST);
  Observable.zip(mLoginObservable,mBannerObservable,mArticleObservable,(loginResponse,bannerResponse,feedArticleListResponse) -> {
    HashMap<String,Object> map=new HashMap<>(3);
    map.put(Constants.LOGIN_DATA,loginResponse);
    map.put(Constants.BANNER_DATA,bannerResponse);
    map.put(Constants.ARTICLE_DATA,feedArticleListResponse);
    return map;
  }
).compose(RxUtils.rxSchedulerHelper()).subscribeWith(new BaseObserver<HashMap<String,Object>>(mView){
    @Override public void onNext(    HashMap<String,Object> map){
      BaseResponse<LoginData> loginResponse=CommonUtils.cast(map.get(Constants.LOGIN_DATA));
      if (loginResponse.getErrorCode() == BaseResponse.SUCCESS) {
        mView.showAutoLoginSuccess();
      }
      mView.showBannerData(CommonUtils.cast(map.get(Constants.BANNER_DATA)));
      mView.showArticleList(CommonUtils.cast(map.get(Constants.ARTICLE_DATA)),true);
    }
    @Override public void onError(    Throwable e){
      super.onError(e);
      mView.showAutoLoginFail();
    }
  }
);
}
Program: 62580
Project: 62580
Buggy source:
@Override public void showArticleList(BaseResponse<FeedArticleListData> feedArticleListResponse){
  if (feedArticleListResponse == null || feedArticleListResponse.getData() == null || feedArticleListResponse.getData().getDatas() == null) {
    showArticleListFail();
    return;
  }
  RxBus.getDefault().post(new DismissErrorView());
  if (mDataManager.getCurrentPage() == Constants.FIRST) {
    mRefreshLayout.setVisibility(View.VISIBLE);
  }
 else {
    mRefreshLayout.setVisibility(View.INVISIBLE);
  }
  if (isRefresh) {
    mFeedArticleDataList=feedArticleListResponse.getData().getDatas();
    mAdapter.replaceData(feedArticleListResponse.getData().getDatas());
  }
 else {
    mFeedArticleDataList.addAll(feedArticleListResponse.getData().getDatas());
    mAdapter.addData(feedArticleListResponse.getData().getDatas());
  }
}

Fixed version (ground truth):
@Override public void showArticleList(BaseResponse<FeedArticleListData> feedArticleListResponse,boolean isReLogin){
  if (feedArticleListResponse == null || feedArticleListResponse.getData() == null || feedArticleListResponse.getData().getDatas() == null) {
    showArticleListFail();
    return;
  }
  RxBus.getDefault().post(new DismissErrorView());
  if (isReLogin || mDataManager.getCurrentPage() == Constants.FIRST) {
    mRefreshLayout.setVisibility(View.VISIBLE);
  }
 else {
    mRefreshLayout.setVisibility(View.INVISIBLE);
  }
  if (isRefresh) {
    mFeedArticleDataList=feedArticleListResponse.getData().getDatas();
    mAdapter.replaceData(feedArticleListResponse.getData().getDatas());
  }
 else {
    mFeedArticleDataList.addAll(feedArticleListResponse.getData().getDatas());
    mAdapter.addData(feedArticleListResponse.getData().getDatas());
  }
}