Program: 14504
Project: 14504
Buggy source:
/** 
 * called when user selects an item from the drawer
 */
private void drawerItemSelected(DrawerItem item){
  if (item == null || item.isSelected(this)) {
    closeDrawer();
    return;
  }
  ActivityId activityId=item.getDrawerItemId().toActivityId();
  if (activityId != ActivityId.UNKNOWN) {
    ActivityId.trackLastActivity(WPDrawerActivity.this,activityId);
  }
  final Intent intent;
switch (item.getDrawerItemId()) {
case READER:
    mShouldFinish=true;
  intent=WPActivityUtils.getIntentForActivityId(this,activityId);
break;
case NOTIFICATIONS:
mShouldFinish=true;
intent=WPActivityUtils.getIntentForActivityId(this,activityId);
break;
case POSTS:
mShouldFinish=true;
AnalyticsTracker.track(AnalyticsTracker.Stat.OPENED_POSTS);
intent=WPActivityUtils.getIntentForActivityId(this,activityId);
break;
case MEDIA:
mShouldFinish=true;
AnalyticsTracker.track(AnalyticsTracker.Stat.OPENED_MEDIA_LIBRARY);
intent=WPActivityUtils.getIntentForActivityId(this,activityId);
break;
case PAGES:
mShouldFinish=true;
AnalyticsTracker.track(AnalyticsTracker.Stat.OPENED_PAGES);
intent=WPActivityUtils.getIntentForActivityId(this,activityId);
break;
case COMMENTS:
mShouldFinish=true;
AnalyticsTracker.track(AnalyticsTracker.Stat.OPENED_COMMENTS);
intent=WPActivityUtils.getIntentForActivityId(this,activityId);
break;
case THEMES:
mShouldFinish=true;
intent=WPActivityUtils.getIntentForActivityId(this,activityId);
break;
case STATS:
mShouldFinish=true;
intent=WPActivityUtils.getIntentForActivityId(this,activityId);
break;
case VIEW_SITE:
mShouldFinish=true;
intent=WPActivityUtils.getIntentForActivityId(this,activityId);
break;
case QUICK_PHOTO:
mShouldFinish=false;
intent=new Intent(WPDrawerActivity.this,EditPostActivity.class);
intent.putExtra("String_Node_Str",DeviceUtils.getInstance().hasCamera(getApplicationContext()) ? Constants.QUICK_POST_PHOTO_CAMERA : Constants.QUICK_POST_PHOTO_LIBRARY);
break;
case QUICK_VIDEO:
mShouldFinish=false;
intent=new Intent(WPDrawerActivity.this,EditPostActivity.class);
intent.putExtra("String_Node_Str",DeviceUtils.getInstance().hasCamera(getApplicationContext()) ? Constants.QUICK_POST_VIDEO_CAMERA : Constants.QUICK_POST_VIDEO_LIBRARY);
break;
default :
mShouldFinish=false;
intent=null;
break;
}
if (intent == null) {
ToastUtils.showToast(this,R.string.reader_toast_err_generic);
return;
}
if (getSupportActionBar() != null) {
int titleResId=item.getTitleResId();
if (titleResId != 0) {
getSupportActionBar().setTitle(getString(titleResId));
}
 else {
getSupportActionBar().setTitle(null);
}
}
closeDrawer();
hideActivityContainer(true);
new Handler().postDelayed(new Runnable(){
@Override public void run(){
intent.putExtra(OPENED_FROM_DRAWER,true);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
intent.putExtra(OPENED_FROM_DRAWER,true);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
startActivity(intent);
}
}
,OPENED_FROM_DRAWER_DELAY);
}

Fixed version (ground truth):
/** 
 * called when user selects an item from the drawer
 */
private void drawerItemSelected(DrawerItem item){
  if (item == null || item.isSelected(this)) {
    closeDrawer();
    return;
  }
  ActivityId activityId=item.getDrawerItemId().toActivityId();
  if (activityId != ActivityId.UNKNOWN) {
    ActivityId.trackLastActivity(WPDrawerActivity.this,activityId);
  }
  final Intent intent;
switch (item.getDrawerItemId()) {
case READER:
    mShouldFinish=true;
  intent=WPActivityUtils.getIntentForActivityId(this,activityId);
break;
case NOTIFICATIONS:
mShouldFinish=true;
intent=WPActivityUtils.getIntentForActivityId(this,activityId);
break;
case POSTS:
mShouldFinish=true;
AnalyticsTracker.track(AnalyticsTracker.Stat.OPENED_POSTS);
intent=WPActivityUtils.getIntentForActivityId(this,activityId);
break;
case MEDIA:
mShouldFinish=true;
AnalyticsTracker.track(AnalyticsTracker.Stat.OPENED_MEDIA_LIBRARY);
intent=WPActivityUtils.getIntentForActivityId(this,activityId);
break;
case PAGES:
mShouldFinish=true;
AnalyticsTracker.track(AnalyticsTracker.Stat.OPENED_PAGES);
intent=WPActivityUtils.getIntentForActivityId(this,activityId);
break;
case COMMENTS:
mShouldFinish=true;
AnalyticsTracker.track(AnalyticsTracker.Stat.OPENED_COMMENTS);
intent=WPActivityUtils.getIntentForActivityId(this,activityId);
break;
case THEMES:
mShouldFinish=true;
intent=WPActivityUtils.getIntentForActivityId(this,activityId);
break;
case STATS:
mShouldFinish=true;
intent=WPActivityUtils.getIntentForActivityId(this,activityId);
break;
case VIEW_SITE:
mShouldFinish=true;
intent=WPActivityUtils.getIntentForActivityId(this,activityId);
break;
case QUICK_PHOTO:
mShouldFinish=false;
intent=new Intent(WPDrawerActivity.this,EditPostActivity.class);
intent.putExtra("String_Node_Str",DeviceUtils.getInstance().hasCamera(getApplicationContext()) ? Constants.QUICK_POST_PHOTO_CAMERA : Constants.QUICK_POST_PHOTO_LIBRARY);
break;
case QUICK_VIDEO:
mShouldFinish=false;
intent=new Intent(WPDrawerActivity.this,EditPostActivity.class);
intent.putExtra("String_Node_Str",DeviceUtils.getInstance().hasCamera(getApplicationContext()) ? Constants.QUICK_POST_VIDEO_CAMERA : Constants.QUICK_POST_VIDEO_LIBRARY);
break;
default :
mShouldFinish=false;
intent=null;
break;
}
if (intent == null) {
ToastUtils.showToast(this,R.string.reader_toast_err_generic);
return;
}
if (mShouldFinish) {
if (getSupportActionBar() != null) {
int titleResId=item.getTitleResId();
if (titleResId != 0) {
getSupportActionBar().setTitle(getString(titleResId));
}
 else {
getSupportActionBar().setTitle(null);
}
}
closeDrawer();
hideActivityContainer(true);
new Handler().postDelayed(new Runnable(){
@Override public void run(){
intent.putExtra(OPENED_FROM_DRAWER,true);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
intent.putExtra(OPENED_FROM_DRAWER,true);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
startActivity(intent);
}
}
,OPENED_FROM_DRAWER_DELAY);
}
 else {
closeDrawer();
startActivity(intent);
}
}