Program: 35586
Project: 35586
Buggy source:
/** 
 * Builds the nevigation links.
 * @param menuPanel The menu panel.
 */
private void buildNavLinks(final ContentPanel menuPanel){
  if (ProfileUtils.isGranted(authentication,GlobalPermissionEnum.CREATE_PROJECT)) {
    addNavLink(eventBus,menuPanel,I18N.CONSTANTS.createProjectNewProject(),IconImageBundle.ICONS.add(),new Listener<ButtonEvent>(){
      private final CreateProjectWindow window=new CreateProjectWindow(dispatcher,authentication,cache);
{
        window.addListener(new CreateProjectListener(){
          @Override public void projectCreated(          ProjectDTOLight project){
            projectsListPanel.getProjectsStore().clearFilters();
            projectsListPanel.getProjectsStore().add(project,false);
            projectsListPanel.getProjectsStore().applyFilters(null);
            Notification.show(I18N.CONSTANTS.createProjectSucceeded(),I18N.CONSTANTS.createProjectSucceededDetails());
          }
          @Override public void projectCreatedAsFunded(          ProjectDTOLight project,          double percentage){
          }
          @Override public void projectCreatedAsFunding(          ProjectDTOLight project,          double percentage){
          }
          @Override public void projectCreatedAsTest(          ProjectDTOLight project){
          }
          @Override public void projectDeletedAsTest(          ProjectDTOLight project){
          }
        }
);
      }
      @Override public void handleEvent(      ButtonEvent be){
        window.show();
      }
    }
);
  }
  if (ProfileUtils.isGranted(authentication,GlobalPermissionEnum.VIEW_ADMIN)) {
    addNavLink(eventBus,menuPanel,I18N.CONSTANTS.createTestProject(),IconImageBundle.ICONS.add(),new Listener<ButtonEvent>(){
      private final CreateProjectWindow window=new CreateProjectWindow(dispatcher,authentication,cache);
{
        window.addListener(new CreateProjectListener(){
          @Override public void projectCreated(          ProjectDTOLight project){
          }
          @Override public void projectCreatedAsFunded(          ProjectDTOLight project,          double percentage){
          }
          @Override public void projectCreatedAsFunding(          ProjectDTOLight project,          double percentage){
          }
          public void projectCreatedAsTest(          ProjectDTOLight project){
            projectsListPanel.getProjectsStore().clearFilters();
            projectsListPanel.getProjectsStore().add(project,false);
            projectsListPanel.getProjectsStore().commitChanges();
            projectsListPanel.getProjectsStore().applyFilters(null);
            Notification.show(I18N.CONSTANTS.createProjectSucceeded(),I18N.CONSTANTS.createTestProjectSucceededDetails());
          }
          @Override public void projectDeletedAsTest(          ProjectDTOLight project){
            menuPanel.mask(I18N.CONSTANTS.loadingDeleteProject());
            ProjectStore store=projectsListPanel.getProjectsStore();
            store.clearFilters();
            final int projectId=project.getId();
            List<ProjectDTOLight> parents=store.getRootItems();
            for (            ProjectDTOLight parent : parents) {
              List<ProjectDTOLight> childrens=parent.getChildrenProjects();
              for (              ProjectDTOLight child : childrens) {
                if (child.getId() == projectId || child.getProjectId() == projectId) {
                  store.remove(parent,child);
                }
              }
            }
            if (store.findModel("String_Node_Str",projectId) != null) {
              store.removeAll(store.findModel("String_Node_Str",projectId));
              store.remove(store.findModel("String_Node_Str",projectId));
            }
 else {
              store.removeAll(store.findModel("String_Node_Str",projectId));
              store.remove(store.findModel("String_Node_Str",projectId));
            }
            store.applyFilters(null);
            menuPanel.unmask();
            Notification.show(I18N.CONSTANTS.deleteTestProjectHeader(),I18N.CONSTANTS.deleteTestProjectSucceededDetails());
          }
        }
);
      }
      @Override public void handleEvent(      ButtonEvent be){
        window.showProjectTest();
      }
    }
);
  }
  if (ProfileUtils.isGranted(authentication,GlobalPermissionEnum.VIEW_ADMIN)) {
    addNavLink(eventBus,menuPanel,I18N.CONSTANTS.adminboard(),IconImageBundle.ICONS.setup(),new AdminPageState());
  }
  if (authentication.isShowMenus() || ProfileUtils.isGranted(authentication,GlobalPermissionEnum.VIEW_ACTIVITYINFO)) {
    addNavLink(eventBus,menuPanel,I18N.CONSTANTS.dataEntry(),IconImageBundle.ICONS.dataEntry(),new SiteGridPageState());
    addNavLink(eventBus,menuPanel,I18N.CONSTANTS.reports(),IconImageBundle.ICONS.report(),new ReportListPageState());
    addNavLink(eventBus,menuPanel,I18N.CONSTANTS.charts(),IconImageBundle.ICONS.barChart(),new ChartPageState());
    addNavLink(eventBus,menuPanel,I18N.CONSTANTS.maps(),IconImageBundle.ICONS.map(),new MapPageState());
    addNavLink(eventBus,menuPanel,I18N.CONSTANTS.tables(),IconImageBundle.ICONS.table(),new PivotPageState());
    addNavLink(eventBus,menuPanel,I18N.CONSTANTS.setup(),IconImageBundle.ICONS.setup(),new DbListPageState());
  }
}

Fixed version (ground truth):
/** 
 * Builds the nevigation links.
 * @param menuPanel The menu panel.
 */
private void buildNavLinks(final ContentPanel menuPanel){
  if (ProfileUtils.isGranted(authentication,GlobalPermissionEnum.CREATE_PROJECT)) {
    addNavLink(eventBus,menuPanel,I18N.CONSTANTS.createProjectNewProject(),IconImageBundle.ICONS.add(),new Listener<ButtonEvent>(){
      private final CreateProjectWindow window=new CreateProjectWindow(dispatcher,authentication,cache);
{
        window.addListener(new CreateProjectListener(){
          @Override public void projectCreated(          ProjectDTOLight project){
            projectsListPanel.getProjectsStore().clearFilters();
            projectsListPanel.getProjectsStore().add(project,false);
            projectsListPanel.getProjectsStore().applyFilters(null);
            Notification.show(I18N.CONSTANTS.createProjectSucceeded(),I18N.CONSTANTS.createProjectSucceededDetails());
          }
          @Override public void projectCreatedAsFunded(          ProjectDTOLight project,          double percentage){
          }
          @Override public void projectCreatedAsFunding(          ProjectDTOLight project,          double percentage){
          }
          @Override public void projectCreatedAsTest(          ProjectDTOLight project){
          }
          @Override public void projectDeletedAsTest(          ProjectDTOLight project){
          }
        }
);
      }
      @Override public void handleEvent(      ButtonEvent be){
        window.show();
      }
    }
);
  }
  if (ProfileUtils.isGranted(authentication,GlobalPermissionEnum.VIEW_ADMIN)) {
    addNavLink(eventBus,menuPanel,I18N.CONSTANTS.createTestProject(),IconImageBundle.ICONS.add(),new Listener<ButtonEvent>(){
      private final CreateProjectWindow window=new CreateProjectWindow(dispatcher,authentication,cache);
{
        window.addListener(new CreateProjectListener(){
          @Override public void projectCreated(          ProjectDTOLight project){
          }
          @Override public void projectCreatedAsFunded(          ProjectDTOLight project,          double percentage){
          }
          @Override public void projectCreatedAsFunding(          ProjectDTOLight project,          double percentage){
          }
          public void projectCreatedAsTest(          ProjectDTOLight project){
            projectsListPanel.getProjectsStore().clearFilters();
            projectsListPanel.getProjectsStore().add(project,false);
            projectsListPanel.getProjectsStore().commitChanges();
            projectsListPanel.getProjectsStore().applyFilters(null);
            Notification.show(I18N.CONSTANTS.createProjectSucceeded(),I18N.CONSTANTS.createTestProjectSucceededDetails());
          }
          @Override public void projectDeletedAsTest(          ProjectDTOLight project){
            menuPanel.mask(I18N.CONSTANTS.loadingDeleteProject());
            ProjectStore store=projectsListPanel.getProjectsStore();
            store.clearFilters();
            final int projectId=project.getId();
            List<ProjectDTOLight> parents=store.getRootItems();
            for (            ProjectDTOLight parent : parents) {
              List<ProjectDTOLight> childrens=parent.getChildrenProjects();
              for (              ProjectDTOLight child : childrens) {
                if (child.getId() == projectId || child.getProjectId() == projectId) {
                  store.remove(parent,child);
                }
              }
            }
            if (store.findModel("String_Node_Str",projectId) != null) {
              store.removeAll(store.findModel("String_Node_Str",projectId));
              store.remove(store.findModel("String_Node_Str",projectId));
            }
 else {
              store.removeAll(store.findModel("String_Node_Str",projectId));
              store.remove(store.findModel("String_Node_Str",projectId));
            }
            store.applyFilters(null);
            menuPanel.unmask();
            Notification.show(I18N.CONSTANTS.deleteTestProjectHeader(),I18N.CONSTANTS.deleteTestProjectSucceededDetails());
          }
        }
);
      }
      @Override public void handleEvent(      ButtonEvent be){
        window.showProjectTest();
      }
    }
);
  }
  if (ProfileUtils.isGranted(authentication,GlobalPermissionEnum.VIEW_ADMIN)) {
    addNavLink(eventBus,menuPanel,I18N.CONSTANTS.adminboard(),IconImageBundle.ICONS.setup(),new AdminPageState());
  }
  if (authentication.isShowMenus()) {
    addNavLink(eventBus,menuPanel,I18N.CONSTANTS.dataEntry(),IconImageBundle.ICONS.dataEntry(),new SiteGridPageState());
    addNavLink(eventBus,menuPanel,I18N.CONSTANTS.reports(),IconImageBundle.ICONS.report(),new ReportListPageState());
    addNavLink(eventBus,menuPanel,I18N.CONSTANTS.charts(),IconImageBundle.ICONS.barChart(),new ChartPageState());
    addNavLink(eventBus,menuPanel,I18N.CONSTANTS.maps(),IconImageBundle.ICONS.map(),new MapPageState());
    addNavLink(eventBus,menuPanel,I18N.CONSTANTS.tables(),IconImageBundle.ICONS.table(),new PivotPageState());
    addNavLink(eventBus,menuPanel,I18N.CONSTANTS.setup(),IconImageBundle.ICONS.setup(),new DbListPageState());
  }
}