Program: 86988
Project: 86988
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_smart_lock_screen_settings);
  if (savedInstanceState == null) {
    getFragmentManager().beginTransaction().add(R.id.container,new ManageEnvironmentFragment()).commit();
  }
  if (!OneTimeInitializer.initialize(this)) {
    finish();
  }
  startService(BaseService.getServiceIntent(this,null,null));
  setUpActionBar();
  setUpNavDrawer();
  drawerLayout=(DrawerLayout)findViewById(R.id.drawer_layout_main_settings);
  actionBarDrawerToggle=new ActionBarDrawerToggle(this,drawerLayout,R.drawable.ic_drawer,R.string.drawer_open,R.string.drawer_close){
    /** 
 * Called when a drawer has settled in a completely closed state. 
 */
    public void onDrawerClosed(    View view){
      super.onDrawerClosed(view);
switch (listAdapter.getItemViewType(position)) {
case NavigationDrawerListAdapter.ITEM_TYPE_PROFILE:
        listAdapter.setSelectedProfileIndex(listAdapter.getItemArrayIndex(position));
      break;
case NavigationDrawerListAdapter.ITEM_TYPE_NEW_PROFILE:
    break;
case NavigationDrawerListAdapter.ITEM_TYPE_MAIN:
  FragmentManager fragmentManager=getFragmentManager();
boolean isValid=true;
int itemArrayIndex=listAdapter.getItemArrayIndex(position);
switch (itemArrayIndex) {
case INDEX_MANAGE_ENVIRONMENTS:
fragmentManager.beginTransaction().replace(R.id.container,new ManageEnvironmentFragment()).commit();
break;
case INDEX_ENVIRONMENT_OVERLAP:
fragmentManager.beginTransaction().replace(R.id.container,new OverlappingEnvironmentsFragment()).commit();
break;
case INDEX_MASTER_PASSWORD:
fragmentManager.beginTransaction().replace(R.id.container,new SetMasterPasswordFragment()).commit();
break;
default :
isValid=false;
}
if (isValid) {
mTitle=mainItemList.get(itemArrayIndex);
listAdapter.setSelectedMainItemIndex(itemArrayIndex);
listAdapter.notifyDataSetChanged();
}
break;
case NavigationDrawerListAdapter.ITEM_TYPE_SECONDARY:
fragmentManager=getFragmentManager();
switch (listAdapter.getItemArrayIndex(position)) {
default :
Toast.makeText(SmartLockScreenSettings.this,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
break;
default :
return;
}
if (mTitle != null) {
setTitle(mTitle);
}
position=-1;
}
/** 
 * Called when a drawer has settled in a completely open state. 
 */
public void onDrawerOpened(View drawerView){
super.onDrawerOpened(drawerView);
mTitle=getTitle().toString();
setTitle(getString(R.string.title_activity_smart_lock_screen_settings));
}
}
;
drawerLayout.setDrawerListener(actionBarDrawerToggle);
drawerLayout.openDrawer(Gravity.START);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_smart_lock_screen_settings);
  if (savedInstanceState == null) {
    getFragmentManager().beginTransaction().add(R.id.container,new ManageEnvironmentFragment()).commit();
  }
  OneTimeInitializer.initialize(this,MASTER_PASSWORD_REQUEST);
  startService(BaseService.getServiceIntent(this,null,null));
  setUpActionBar();
  setUpNavDrawer();
  drawerLayout=(DrawerLayout)findViewById(R.id.drawer_layout_main_settings);
  actionBarDrawerToggle=new ActionBarDrawerToggle(this,drawerLayout,R.drawable.ic_drawer,R.string.drawer_open,R.string.drawer_close){
    /** 
 * Called when a drawer has settled in a completely closed state. 
 */
    public void onDrawerClosed(    View view){
      super.onDrawerClosed(view);
switch (listAdapter.getItemViewType(position)) {
case NavigationDrawerListAdapter.ITEM_TYPE_PROFILE:
        listAdapter.setSelectedProfileIndex(listAdapter.getItemArrayIndex(position));
      break;
case NavigationDrawerListAdapter.ITEM_TYPE_NEW_PROFILE:
    break;
case NavigationDrawerListAdapter.ITEM_TYPE_MAIN:
  FragmentManager fragmentManager=getFragmentManager();
boolean isValid=true;
int itemArrayIndex=listAdapter.getItemArrayIndex(position);
switch (itemArrayIndex) {
case INDEX_MANAGE_ENVIRONMENTS:
fragmentManager.beginTransaction().replace(R.id.container,new ManageEnvironmentFragment()).commit();
break;
case INDEX_ENVIRONMENT_OVERLAP:
fragmentManager.beginTransaction().replace(R.id.container,new OverlappingEnvironmentsFragment()).commit();
break;
case INDEX_MASTER_PASSWORD:
fragmentManager.beginTransaction().replace(R.id.container,new SetMasterPasswordFragment()).commit();
break;
default :
isValid=false;
}
if (isValid) {
mTitle=mainItemList.get(itemArrayIndex);
listAdapter.setSelectedMainItemIndex(itemArrayIndex);
listAdapter.notifyDataSetChanged();
}
break;
case NavigationDrawerListAdapter.ITEM_TYPE_SECONDARY:
fragmentManager=getFragmentManager();
switch (listAdapter.getItemArrayIndex(position)) {
default :
Toast.makeText(SmartLockScreenSettings.this,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
break;
default :
return;
}
if (mTitle != null) {
setTitle(mTitle);
}
position=-1;
}
/** 
 * Called when a drawer has settled in a completely open state. 
 */
public void onDrawerOpened(View drawerView){
super.onDrawerOpened(drawerView);
mTitle=getTitle().toString();
setTitle(getString(R.string.title_activity_smart_lock_screen_settings));
}
}
;
drawerLayout.setDrawerListener(actionBarDrawerToggle);
drawerLayout.openDrawer(Gravity.START);
}