Program: 175430
Project: 175430
Buggy source:
@Override public boolean onItemClick(View view,int position,IDrawerItem drawerItem){
  if (drawerItem != null) {
    int id=(int)drawerItem.getIdentifier();
switch (id) {
case 1:
      if (!mNoProject) {
        renameProjectDialog();
      }
 else {
        noProjectSnack();
      }
    break;
case 2:
  if (!mNoProject) {
    deleteProjectDialog();
  }
 else {
    noProjectSnack();
  }
break;
case 3:
newProjectDialog();
break;
case 4:
if (!mNoProject) {
header.toggleSelectionList(getApplicationContext());
}
 else {
noProjectSnack();
}
break;
case 8:
forceIntro();
break;
case 9:
leftDrawer.closeDrawer();
Snackbar snackbar=Snackbar.make(findViewById(R.id.main_content),R.string.tuto_mode,Snackbar.LENGTH_SHORT).setCallback(new Snackbar.Callback(){
@Override public void onDismissed(Snackbar snackbar,int event){
mTinyDB.putBoolean(getString(R.string.handle_idea_pref),true);
mTinyDB.putBoolean(getString(R.string.first_project_pref),true);
mTinyDB.putBoolean(getString(R.string.first_idea_pref),true);
mTinyDB.putBoolean(getString(R.string.right_drawer_pref),true);
}
}
);
snackbar.show();
break;
case 10:
Intent browserIntent=new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str"));
startActivity(browserIntent);
break;
case 11:
Uri uri=Uri.parse("String_Node_Str" + getPackageName());
Intent goToMarket=new Intent(Intent.ACTION_VIEW,uri);
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_NEW_DOCUMENT | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
try {
startActivity(goToMarket);
}
 catch (ActivityNotFoundException e) {
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str" + getPackageName())));
}
break;
case 12:
Intent browserSource=new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str"));
startActivity(browserSource);
break;
case 21:
if (!mNoProject) {
new SpectrumDialog.Builder(getApplicationContext()).setTitle(R.string.select_prim_col).setColors(R.array.colors).setSelectedColor(mPrimaryColor).setDismissOnColorSelected(false).setFixedColumnCount(4).setOnColorSelectedListener(new SpectrumDialog.OnColorSelectedListener(){
@Override public void onColorSelected(boolean positiveResult,@ColorInt int color){
if (positiveResult) {
mPrimaryColor=color;
changePrimaryColor();
saveProjectColors();
Drawable disk=ContextCompat.getDrawable(getApplicationContext(),R.drawable.disk);
disk.setColorFilter(mPrimaryColor,PorterDuff.Mode.SRC_ATOP);
IProfile p=header.getActiveProfile();
p.withIcon(disk);
header.updateProfile(p);
}
}
}
).build().show(mFragmentManager,"String_Node_Str");
}
 else noProjectSnack();
break;
case 22:
if (!mNoProject) {
new SpectrumDialog.Builder(getApplicationContext()).setTitle(R.string.select_sec_col).setColors(R.array.accent_colors).setSelectedColor(mSecondaryColor).setDismissOnColorSelected(false).setFixedColumnCount(4).setOnColorSelectedListener(new SpectrumDialog.OnColorSelectedListener(){
@Override public void onColorSelected(boolean positiveResult,@ColorInt int color){
if (positiveResult) {
mSecondaryColor=color;
changeSecondaryColor();
saveProjectColors();
}
}
}
).build().show(mFragmentManager,"String_Node_Str");
}
 else noProjectSnack();
break;
case 23:
if (!mNoProject) {
new SpectrumDialog.Builder(getApplicationContext()).setTitle(R.string.select_text_col).setColors(R.array.textColors).setSelectedColor(mTextColor).setDismissOnColorSelected(false).setFixedColumnCount(4).setOutlineWidth(2).setOnColorSelectedListener(new SpectrumDialog.OnColorSelectedListener(){
@Override public void onColorSelected(boolean positiveResult,@ColorInt int color){
if (positiveResult) {
mTextColor=color;
changeTextColor();
saveProjectColors();
}
}
}
).build().show(mFragmentManager,"String_Node_Str");
}
 else noProjectSnack();
break;
case 24:
if (!mNoProject) {
mDbHelper.clearDoneWithSnack(mViewPager);
rightDrawer.closeDrawer();
}
 else noProjectSnack();
break;
case 25:
if (!mNoProject) {
mDbHelper.sortByAscPriority();
rightDrawer.closeDrawer();
}
 else noProjectSnack();
break;
case 26:
if (!mNoProject) {
resetColorsDialog();
}
 else noProjectSnack();
break;
case 30:
leftDrawer.openDrawer();
newProjectDialog();
break;
}
}
if (drawerItem != null && drawerItem instanceof IProfile) {
String projectName=((IProfile)drawerItem).getName().getText(MainActivity.this);
switchToProject(projectName);
}
return false;
}

Fixed version (ground truth):
@Override public boolean onItemClick(View view,int position,IDrawerItem drawerItem){
  if (drawerItem != null) {
    int id=(int)drawerItem.getIdentifier();
switch (id) {
case 1:
      if (!mNoProject) {
        renameProjectDialog();
      }
 else {
        noProjectSnack();
      }
    break;
case 2:
  if (!mNoProject) {
    deleteProjectDialog();
  }
 else {
    noProjectSnack();
  }
break;
case 3:
newProjectDialog();
break;
case 4:
if (!mNoProject) {
header.toggleSelectionList(getApplicationContext());
}
 else {
noProjectSnack();
}
break;
case 8:
forceIntro();
break;
case 9:
leftDrawer.closeDrawer();
Snackbar snackbar=Snackbar.make(findViewById(R.id.main_content),R.string.tuto_mode,Snackbar.LENGTH_SHORT).setCallback(new Snackbar.Callback(){
@Override public void onDismissed(Snackbar snackbar,int event){
mTinyDB.putBoolean(getString(R.string.handle_idea_pref),true);
mTinyDB.putBoolean(getString(R.string.first_project_pref),true);
mTinyDB.putBoolean(getString(R.string.first_idea_pref),true);
mTinyDB.putBoolean(getString(R.string.right_drawer_pref),true);
}
}
);
snackbar.show();
break;
case 10:
Intent browserIntent=new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str"));
startActivity(browserIntent);
break;
case 11:
Uri uri=Uri.parse("String_Node_Str" + getPackageName());
Intent goToMarket=new Intent(Intent.ACTION_VIEW,uri);
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_NEW_DOCUMENT | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
try {
startActivity(goToMarket);
}
 catch (ActivityNotFoundException e) {
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str" + getPackageName())));
}
break;
case 12:
Intent browserSource=new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str"));
startActivity(browserSource);
break;
case 21:
if (!mNoProject) {
new SpectrumDialog.Builder(getApplicationContext()).setTitle(R.string.select_prim_col).setColors(R.array.colors).setSelectedColor(mPrimaryColor).setDismissOnColorSelected(false).setFixedColumnCount(4).setOnColorSelectedListener(new SpectrumDialog.OnColorSelectedListener(){
@Override public void onColorSelected(boolean positiveResult,@ColorInt int color){
if (positiveResult) {
mPrimaryColor=color;
changePrimaryColor();
saveProjectColors();
Drawable disk=ContextCompat.getDrawable(getApplicationContext(),R.drawable.disk);
disk.setColorFilter(mPrimaryColor,PorterDuff.Mode.SRC_ATOP);
IProfile p=header.getActiveProfile();
p.withIcon(disk);
header.updateProfile(p);
}
}
}
).build().show(mFragmentManager,"String_Node_Str");
}
 else noProjectSnack();
break;
case 22:
if (!mNoProject) {
new SpectrumDialog.Builder(getApplicationContext()).setTitle(R.string.select_sec_col).setColors(R.array.accent_colors).setSelectedColor(mSecondaryColor).setDismissOnColorSelected(false).setFixedColumnCount(4).setOnColorSelectedListener(new SpectrumDialog.OnColorSelectedListener(){
@Override public void onColorSelected(boolean positiveResult,@ColorInt int color){
if (positiveResult) {
mSecondaryColor=color;
changeSecondaryColor();
saveProjectColors();
}
}
}
).build().show(mFragmentManager,"String_Node_Str");
}
 else noProjectSnack();
break;
case 23:
if (!mNoProject) {
new SpectrumDialog.Builder(getApplicationContext()).setTitle(R.string.select_text_col).setColors(R.array.textColors).setSelectedColor(mTextColor).setDismissOnColorSelected(false).setFixedColumnCount(4).setOutlineWidth(2).setOnColorSelectedListener(new SpectrumDialog.OnColorSelectedListener(){
@Override public void onColorSelected(boolean positiveResult,@ColorInt int color){
if (positiveResult) {
mTextColor=color;
changeTextColor();
saveProjectColors();
}
}
}
).build().show(mFragmentManager,"String_Node_Str");
}
 else noProjectSnack();
break;
case 24:
if (!mNoProject) {
mDbHelper.clearDoneWithSnack(mViewPager);
rightDrawer.closeDrawer();
}
 else noProjectSnack();
break;
case 25:
if (!mNoProject) {
mDbHelper.sortByAscPriority();
rightDrawer.closeDrawer();
}
 else noProjectSnack();
break;
case 26:
if (!mNoProject) {
resetColorsDialog();
}
 else noProjectSnack();
break;
case 30:
newProjectDialog();
return false;
}
}
if (drawerItem != null && drawerItem instanceof IProfile) {
String projectName=((IProfile)drawerItem).getName().getText(MainActivity.this);
switchToProject(projectName);
}
return false;
}