Program: 60380
Project: 60380
Buggy source:
public void setUp(int fragmentId,DrawerLayout drawerLayout){
  mFragmentContainerView=getActivity().findViewById(fragmentId);
  mDrawerLayout=drawerLayout;
  mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow,GravityCompat.START);
  ActionBar actionBar=getActionBar();
  actionBar.setDisplayHomeAsUpEnabled(true);
  actionBar.setHomeButtonEnabled(true);
  mDrawerToggle=new ActionBarDrawerToggle(getActivity(),mDrawerLayout,R.drawable.ic_navigation_drawer,R.string.navigation_drawer_open,R.string.navigation_drawer_close){
    @Override public void onDrawerClosed(    View drawerView){
      super.onDrawerClosed(drawerView);
      if (!isAdded()) {
        return;
      }
      getActivity().setTitle(mTitle);
      getActivity().invalidateOptionsMenu();
    }
    @Override public void onDrawerOpened(    View drawerView){
      super.onDrawerOpened(drawerView);
      if (!isAdded()) {
        return;
      }
      mTitle=getActivity().getTitle();
      getActivity().setTitle(R.string.app_name);
      if (!mUserLearnedDrawer) {
        Toast.makeText(getActivity(),R.string.drawer_longpress_hint,Toast.LENGTH_LONG).show();
        mUserLearnedDrawer=true;
        SharedPreferences sp=PreferenceManager.getDefaultSharedPreferences(getActivity());
        sp.edit().putBoolean(PREF_USER_LEARNED_DRAWER,true).apply();
      }
      getActivity().invalidateOptionsMenu();
    }
  }
;
  if (!mUserLearnedDrawer && !mFromSavedInstanceState) {
    mDrawerLayout.openDrawer(mFragmentContainerView);
  }
  mDrawerLayout.post(new Runnable(){
    @Override public void run(){
      mDrawerToggle.syncState();
    }
  }
);
  mDrawerLayout.setDrawerListener(mDrawerToggle);
  selectItem(mCurrentSelectedPosition);
}

Fixed version (ground truth):
public void setUp(int fragmentId,DrawerLayout drawerLayout,boolean selectDefault){
  mFragmentContainerView=getActivity().findViewById(fragmentId);
  mDrawerLayout=drawerLayout;
  mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow,GravityCompat.START);
  ActionBar actionBar=getActionBar();
  actionBar.setDisplayHomeAsUpEnabled(true);
  actionBar.setHomeButtonEnabled(true);
  mDrawerToggle=new ActionBarDrawerToggle(getActivity(),mDrawerLayout,R.drawable.ic_navigation_drawer,R.string.navigation_drawer_open,R.string.navigation_drawer_close){
    @Override public void onDrawerClosed(    View drawerView){
      super.onDrawerClosed(drawerView);
      if (!isAdded()) {
        return;
      }
      getActivity().setTitle(mTitle);
      getActivity().invalidateOptionsMenu();
    }
    @Override public void onDrawerOpened(    View drawerView){
      super.onDrawerOpened(drawerView);
      if (!isAdded()) {
        return;
      }
      mTitle=getActivity().getTitle();
      getActivity().setTitle(R.string.app_name);
      if (!mUserLearnedDrawer) {
        Toast.makeText(getActivity(),R.string.drawer_longpress_hint,Toast.LENGTH_LONG).show();
        mUserLearnedDrawer=true;
        SharedPreferences sp=PreferenceManager.getDefaultSharedPreferences(getActivity());
        sp.edit().putBoolean(PREF_USER_LEARNED_DRAWER,true).apply();
      }
      getActivity().invalidateOptionsMenu();
    }
  }
;
  if (!mUserLearnedDrawer && !mFromSavedInstanceState) {
    mDrawerLayout.openDrawer(mFragmentContainerView);
  }
  mDrawerLayout.post(new Runnable(){
    @Override public void run(){
      mDrawerToggle.syncState();
    }
  }
);
  mDrawerLayout.setDrawerListener(mDrawerToggle);
  if (selectDefault)   selectItem(mCurrentSelectedPosition);
}