Program: 175429
Project: 175429
Buggy source:
private void setUpDrawers(){
  mAddProject=new ProfileSettingDrawerItem().withName("String_Node_Str").withIcon(FontAwesome.Icon.faw_plus).withIdentifier(30).withSelectable(false).withOnDrawerItemClickListener(this);
  header=new AccountHeaderBuilder().withActivity(this).withHeaderBackground(R.drawable.header).withProfiles(mProfiles).addProfiles(mAddProject).withProfileImagesVisible(false).build();
  setUpSwitches();
  leftDrawer=new DrawerBuilder(this).withToolbar(mToolbar).withActionBarDrawerToggleAnimated(true).withSelectedItem(-1).withAccountHeader(header).addDrawerItems(new PrimaryDrawerItem().withIdentifier(1).withName(R.string.rename_pro).withIcon(FontAwesome.Icon.faw_i_cursor).withSelectable(false),new PrimaryDrawerItem().withIdentifier(2).withName(R.string.delete_pro).withIcon(FontAwesome.Icon.faw_trash).withSelectable(false),new DividerDrawerItem(),new PrimaryDrawerItem().withIdentifier(4).withName(R.string.all_pro).withIcon(GoogleMaterial.Icon.gmd_inbox).withSelectable(false),new PrimaryDrawerItem().withIdentifier(3).withName(R.string.new_pro).withIcon(FontAwesome.Icon.faw_plus).withSelectable(false),new DividerDrawerItem(),new ExpandableDrawerItem().withName(R.string.settings).withIcon(FontAwesome.Icon.faw_gear).withSelectable(false).withSubItems(doneSwitch,bigTextSwitch),new ExpandableDrawerItem().withName(R.string.help_feedback).withIcon(FontAwesome.Icon.faw_question_circle).withSelectable(false).withSubItems(new SecondaryDrawerItem().withName(R.string.see_app_intro).withLevel(2).withIcon(GoogleMaterial.Icon.gmd_camera_rear).withIdentifier(8).withSelectable(false),new SecondaryDrawerItem().withName(R.string.activate_tuto).withLevel(2).withIcon(GoogleMaterial.Icon.gmd_info).withIdentifier(9).withSelectable(false),new SecondaryDrawerItem().withName(R.string.rate_app).withLevel(2).withIcon(GoogleMaterial.Icon.gmd_star).withIdentifier(11).withSelectable(false),new SecondaryDrawerItem().withName(R.string.feedback).withLevel(2).withIcon(GoogleMaterial.Icon.gmd_bug).withIdentifier(10).withSelectable(false),new SecondaryDrawerItem().withName(R.string.source_code).withLevel(2).withIcon(GoogleMaterial.Icon.gmd_github).withIdentifier(12).withSelectable(false))).withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener(){
    @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;
}
}
return true;
}
}
).withOnDrawerListener(this).build();
mFavoriteButton=(MaterialFavoriteButton)header.getView().findViewById(R.id.favorite_button);
mFavoriteButton.setOnFavoriteChangeListener(new MaterialFavoriteButton.OnFavoriteChangeListener(){
@Override public void onFavoriteChanged(MaterialFavoriteButton buttonView,boolean favorite){
if (favorite) {
mTinyDB.putInt(getString(R.string.favorite_project),getProjectId());
}
 else if (mTinyDB.getInt(getString(R.string.favorite_project)) == mSelectedProfileIndex) {
mTinyDB.putInt(getString(R.string.favorite_project),-1);
}
}
}
);
mColorItem1=new PrimaryDrawerItem().withIdentifier(1).withName(R.string.primary_col).withIcon(FontAwesome.Icon.faw_paint_brush).withIconColor(mPrimaryColor).withSelectable(false);
mColorItem2=new PrimaryDrawerItem().withIdentifier(2).withName(R.string.secondary_col).withIcon(FontAwesome.Icon.faw_paint_brush).withIconColor(mSecondaryColor).withSelectable(false);
mColorItem3=new PrimaryDrawerItem().withIdentifier(3).withName(R.string.text_col).withIcon(FontAwesome.Icon.faw_paint_brush).withIconColor(mTextColor).withSelectable(false);
rightDrawer=new DrawerBuilder(this).withActionBarDrawerToggleAnimated(true).withSelectedItem(-1).addDrawerItems(new SectionDrawerItem().withName(R.string.color_prefs),mColorItem1,mColorItem2,mColorItem3,new PrimaryDrawerItem().withIdentifier(6).withName(R.string.reset_color_prefs).withIcon(FontAwesome.Icon.faw_tint).withSelectable(false),new SectionDrawerItem().withName(R.string.functions),new PrimaryDrawerItem().withIdentifier(4).withName(R.string.clear_done).withIcon(FontAwesome.Icon.faw_check_circle).withSelectable(false),new PrimaryDrawerItem().withIdentifier(5).withName(R.string.sort_priority).withIcon(FontAwesome.Icon.faw_sort_amount_desc).withSelectable(false)).withDrawerGravity(Gravity.END).withStickyFooter(R.layout.footer).withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener(){
@Override public boolean onItemClick(View view,int position,IDrawerItem drawerItem){
if (drawerItem != null && !mNoProject) {
int id=(int)drawerItem.getIdentifier();
switch (id) {
case 1:
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");
break;
case 2:
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");
break;
case 3:
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");
break;
case 4:
mDbHelper.clearDoneWithSnack(mViewPager);
rightDrawer.closeDrawer();
break;
case 5:
mDbHelper.sortByAscPriority();
rightDrawer.closeDrawer();
break;
case 6:
resetColorsDialog();
break;
}
}
 else {
noProjectSnack();
}
return true;
}
}
).append(leftDrawer);
if (!mNoProject) {
header.setActiveProfile(mProfiles.get(mSelectedProfileIndex));
displayIdeasCount();
refreshStar();
}
 else {
header.setProfiles(mProfiles);
header.setSelectionSecondLine(getString(R.string.no_project));
mPrimaryColor=defaultPrimaryColor;
mSecondaryColor=defaultSecondaryColor;
mTextColor=defaultTextColor;
updateColors();
refreshStar();
}
}

Fixed version (ground truth):
private void setUpDrawers(){
  mAddProject=new ProfileSettingDrawerItem().withName("String_Node_Str").withIcon(FontAwesome.Icon.faw_plus).withIdentifier(30).withSelectable(false).withOnDrawerItemClickListener(this);
  header=new AccountHeaderBuilder().withActivity(this).withHeaderBackground(R.drawable.header).withProfiles(mProfiles).addProfiles(mAddProject).withProfileImagesVisible(false).build();
  setUpSwitches();
  leftDrawer=new DrawerBuilder(this).withToolbar(mToolbar).withActionBarDrawerToggleAnimated(true).withSelectedItem(-1).withAccountHeader(header).addDrawerItems(new PrimaryDrawerItem().withIdentifier(1).withName(R.string.rename_pro).withIcon(FontAwesome.Icon.faw_i_cursor).withSelectable(false),new PrimaryDrawerItem().withIdentifier(2).withName(R.string.delete_pro).withIcon(FontAwesome.Icon.faw_trash).withSelectable(false),new DividerDrawerItem(),new PrimaryDrawerItem().withIdentifier(4).withName(R.string.all_pro).withIcon(GoogleMaterial.Icon.gmd_inbox).withSelectable(false),new PrimaryDrawerItem().withIdentifier(3).withName(R.string.new_pro).withIcon(FontAwesome.Icon.faw_plus).withSelectable(false),new DividerDrawerItem(),new ExpandableDrawerItem().withName(R.string.settings).withIcon(FontAwesome.Icon.faw_gear).withSelectable(false).withSubItems(doneSwitch,bigTextSwitch),new ExpandableDrawerItem().withName(R.string.help_feedback).withIcon(FontAwesome.Icon.faw_question_circle).withSelectable(false).withSubItems(new SecondaryDrawerItem().withName(R.string.see_app_intro).withLevel(2).withIcon(GoogleMaterial.Icon.gmd_camera_rear).withIdentifier(8).withSelectable(false),new SecondaryDrawerItem().withName(R.string.activate_tuto).withLevel(2).withIcon(GoogleMaterial.Icon.gmd_info).withIdentifier(9).withSelectable(false),new SecondaryDrawerItem().withName(R.string.rate_app).withLevel(2).withIcon(GoogleMaterial.Icon.gmd_star).withIdentifier(11).withSelectable(false),new SecondaryDrawerItem().withName(R.string.feedback).withLevel(2).withIcon(GoogleMaterial.Icon.gmd_bug).withIdentifier(10).withSelectable(false),new SecondaryDrawerItem().withName(R.string.source_code).withLevel(2).withIcon(GoogleMaterial.Icon.gmd_github).withIdentifier(12).withSelectable(false))).withOnDrawerItemClickListener(this).withOnDrawerListener(this).build();
  mFavoriteButton=(MaterialFavoriteButton)header.getView().findViewById(R.id.favorite_button);
  mFavoriteButton.setOnFavoriteChangeListener(new MaterialFavoriteButton.OnFavoriteChangeListener(){
    @Override public void onFavoriteChanged(    MaterialFavoriteButton buttonView,    boolean favorite){
      if (favorite) {
        mTinyDB.putInt(getString(R.string.favorite_project),getProjectId());
      }
 else       if (mTinyDB.getInt(getString(R.string.favorite_project)) == mSelectedProfileIndex) {
        mTinyDB.putInt(getString(R.string.favorite_project),-1);
      }
    }
  }
);
  mColorItem1=new PrimaryDrawerItem().withIdentifier(1).withName(R.string.primary_col).withIcon(FontAwesome.Icon.faw_paint_brush).withIconColor(mPrimaryColor).withSelectable(false);
  mColorItem2=new PrimaryDrawerItem().withIdentifier(2).withName(R.string.secondary_col).withIcon(FontAwesome.Icon.faw_paint_brush).withIconColor(mSecondaryColor).withSelectable(false);
  mColorItem3=new PrimaryDrawerItem().withIdentifier(3).withName(R.string.text_col).withIcon(FontAwesome.Icon.faw_paint_brush).withIconColor(mTextColor).withSelectable(false);
  rightDrawer=new DrawerBuilder(this).withActionBarDrawerToggleAnimated(true).withSelectedItem(-1).addDrawerItems(new SectionDrawerItem().withName(R.string.color_prefs),mColorItem1,mColorItem2,mColorItem3,new PrimaryDrawerItem().withIdentifier(6).withName(R.string.reset_color_prefs).withIcon(FontAwesome.Icon.faw_tint).withSelectable(false),new SectionDrawerItem().withName(R.string.functions),new PrimaryDrawerItem().withIdentifier(4).withName(R.string.clear_done).withIcon(FontAwesome.Icon.faw_check_circle).withSelectable(false),new PrimaryDrawerItem().withIdentifier(5).withName(R.string.sort_priority).withIcon(FontAwesome.Icon.faw_sort_amount_desc).withSelectable(false)).withDrawerGravity(Gravity.END).withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener(){
    @Override public boolean onItemClick(    View view,    int position,    IDrawerItem drawerItem){
      if (drawerItem != null && !mNoProject) {
        int id=(int)drawerItem.getIdentifier();
switch (id) {
case 1:
          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");
        break;
case 2:
      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");
    break;
case 3:
  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");
break;
case 4:
mDbHelper.clearDoneWithSnack(mViewPager);
rightDrawer.closeDrawer();
break;
case 5:
mDbHelper.sortByAscPriority();
rightDrawer.closeDrawer();
break;
case 6:
resetColorsDialog();
break;
}
}
 else {
noProjectSnack();
}
return true;
}
}
).append(leftDrawer);
if (!mNoProject) {
header.setActiveProfile(mProfiles.get(mSelectedProfileIndex));
displayIdeasCount();
refreshStar();
}
 else {
header.setProfiles(mProfiles);
header.setSelectionSecondLine(getString(R.string.no_project));
mPrimaryColor=defaultPrimaryColor;
mSecondaryColor=defaultSecondaryColor;
mTextColor=defaultTextColor;
updateColors();
refreshStar();
}
}