Program: 42866
Project: 42866
Buggy source:
private void initTabsAndViewPager(){
  final List<DataSourceType> availableAgencyTypes=DataSourceProvider.get().getAvailableAgencyTypes(getActivity());
  if (CollectionUtils.getSize(availableAgencyTypes) == 0) {
    return;
  }
  this.agencyTypePagerAdapter=new AgencyTypePagerAdapter(getActivity(),getActivity().getSupportFragmentManager(),availableAgencyTypes);
  this.agencyTypePagerAdapter.setNearbyLocation(this.nearbyLocation);
  final ViewPager viewPager=(ViewPager)getView().findViewById(R.id.viewpager);
  viewPager.setAdapter(this.agencyTypePagerAdapter);
  viewPager.setOffscreenPageLimit(3);
  PagerSlidingTabStrip tabs=(PagerSlidingTabStrip)getView().findViewById(R.id.tabs);
  tabs.setViewPager(viewPager);
  tabs.setOnPageChangeListener(this);
  this.lastPageSelected=0;
  new MTAsyncTask<Void,Void,Integer>(){
    public String getLogTag(){
      return TAG;
    }
    @Override protected Integer doInBackgroundMT(    Void... params){
      try {
        final int typeId=PreferenceUtils.getPrefLcl(getActivity(),PreferenceUtils.PREFS_LCL_NEARBY_TAB_TYPE,PreferenceUtils.PREFS_LCL_NEARBY_TAB_TYPE_DEFAULT);
        for (int i=0; i < availableAgencyTypes.size(); i++) {
          if (availableAgencyTypes.get(i).getId() == typeId) {
            return i;
          }
        }
      }
 catch (      Exception e) {
        MTLog.w(TAG,e,"String_Node_Str");
      }
      return null;
    }
    @Override protected void onPostExecute(    Integer lastPageSelected){
      if (lastPageSelected != null) {
        if (NearbyFragment.this.lastPageSelected == 0) {
          viewPager.setCurrentItem(lastPageSelected.intValue());
          NearbyFragment.this.lastPageSelected=lastPageSelected.intValue();
          onPageSelected(NearbyFragment.this.lastPageSelected);
        }
      }
    }
  }
.execute();
}

Fixed version (ground truth):
private void initTabsAndViewPager(){
  final List<DataSourceType> availableAgencyTypes=DataSourceProvider.get().getAvailableAgencyTypes(getActivity());
  if (CollectionUtils.getSize(availableAgencyTypes) == 0) {
    return;
  }
  this.agencyTypePagerAdapter=new AgencyTypePagerAdapter(getActivity(),getActivity().getSupportFragmentManager(),availableAgencyTypes);
  this.agencyTypePagerAdapter.setNearbyLocation(this.nearbyLocation);
  final ViewPager viewPager=(ViewPager)getView().findViewById(R.id.viewpager);
  viewPager.setAdapter(this.agencyTypePagerAdapter);
  viewPager.setOffscreenPageLimit(3);
  PagerSlidingTabStrip tabs=(PagerSlidingTabStrip)getView().findViewById(R.id.tabs);
  tabs.setViewPager(viewPager);
  tabs.setOnPageChangeListener(this);
  this.lastPageSelected=0;
  new MTAsyncTask<Void,Void,Integer>(){
    private final String TAG=NearbyFragment.class.getSimpleName() + "String_Node_Str";
    public String getLogTag(){
      return TAG;
    }
    @Override protected Integer doInBackgroundMT(    Void... params){
      try {
        final int typeId=PreferenceUtils.getPrefLcl(getActivity(),PreferenceUtils.PREFS_LCL_NEARBY_TAB_TYPE,PreferenceUtils.PREFS_LCL_NEARBY_TAB_TYPE_DEFAULT);
        for (int i=0; i < availableAgencyTypes.size(); i++) {
          if (availableAgencyTypes.get(i).getId() == typeId) {
            return i;
          }
        }
      }
 catch (      Exception e) {
        MTLog.w(TAG,e,"String_Node_Str");
      }
      return null;
    }
    @Override protected void onPostExecute(    Integer lastPageSelected){
      if (NearbyFragment.this.lastPageSelected != 0) {
        return;
      }
      if (lastPageSelected != null) {
        NearbyFragment.this.lastPageSelected=lastPageSelected.intValue();
        viewPager.setCurrentItem(NearbyFragment.this.lastPageSelected);
      }
      onPageSelected(NearbyFragment.this.lastPageSelected);
    }
  }
.execute();
}