Program: 60475
Project: 60475
Buggy source:
public BasePage(final PageParameters parameters){
  super(parameters);
  add(new Label("String_Node_Str",SyncopeConsoleApplication.get().getVersion()));
  add(new Label("String_Node_Str",SyncopeConsoleSession.get().getSelfTO().getUsername()));
  final WebMarkupContainer todosContainer=new WebMarkupContainer("String_Node_Str");
  add(todosContainer);
  Label todos=new Label("String_Node_Str","String_Node_Str");
  todosContainer.add(todos);
  if (SyncopeConsoleSession.get().owns(StandardEntitlement.WORKFLOW_FORM_LIST)) {
    todos.setDefaultModelObject(userWorkflowRestClient.getForms().size());
  }
  MetaDataRoleAuthorizationStrategy.authorize(todosContainer,WebPage.RENDER,StandardEntitlement.WORKFLOW_FORM_LIST);
  WebMarkupContainer liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  add(liContainer);
  liContainer.add(new BookmarkablePageLink<>("String_Node_Str",Dashboard.class));
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  add(liContainer);
  liContainer.add(new BookmarkablePageLink<>("String_Node_Str",Realms.class));
  MetaDataRoleAuthorizationStrategy.authorize(liContainer,WebPage.RENDER,StandardEntitlement.REALM_LIST);
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  add(liContainer);
  liContainer.add(new BookmarkablePageLink<>("String_Node_Str",Topology.class));
  MetaDataRoleAuthorizationStrategy.authorize(liContainer,WebPage.RENDER,String.format("String_Node_Str",StandardEntitlement.CONNECTOR_LIST,StandardEntitlement.RESOURCE_LIST));
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  add(liContainer);
  liContainer.add(new BookmarkablePageLink<>("String_Node_Str",Reports.class));
  MetaDataRoleAuthorizationStrategy.authorize(liContainer,WebPage.RENDER,StandardEntitlement.REPORT_LIST);
  WebMarkupContainer confLIContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  add(confLIContainer);
  WebMarkupContainer confULContainer=new WebMarkupContainer(getULContainerId("String_Node_Str"));
  confLIContainer.add(confULContainer);
  MetaDataRoleAuthorizationStrategy.authorize(liContainer,WebPage.RENDER,StandardEntitlement.CONFIGURATION_LIST);
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  confULContainer.add(liContainer);
  final BookmarkablePageLink<Page> securityQuestionLink=new BookmarkablePageLink<>("String_Node_Str",SecurityQuestions.class);
  liContainer.add(securityQuestionLink);
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  confULContainer.add(liContainer);
  final BookmarkablePageLink<Page> workflowLink=new BookmarkablePageLink<>("String_Node_Str",Workflow.class);
  MetaDataRoleAuthorizationStrategy.authorize(workflowLink,WebPage.ENABLE,StandardEntitlement.WORKFLOW_DEF_READ);
  liContainer.add(workflowLink);
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  confULContainer.add(liContainer);
  final BookmarkablePageLink<Page> logsLink=new BookmarkablePageLink<>("String_Node_Str",Logs.class);
  MetaDataRoleAuthorizationStrategy.authorize(logsLink,WebPage.ENABLE,StandardEntitlement.LOG_LIST);
  liContainer.add(logsLink);
  MetaDataRoleAuthorizationStrategy.authorize(liContainer,WebPage.RENDER,StandardEntitlement.LOG_LIST);
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  confULContainer.add(liContainer);
  BookmarkablePageLink<Page> typesLink=new BookmarkablePageLink<>("String_Node_Str",Types.class);
  MetaDataRoleAuthorizationStrategy.authorize(typesLink,WebPage.ENABLE,StandardEntitlement.SCHEMA_LIST);
  liContainer.add(typesLink);
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  confULContainer.add(liContainer);
  liContainer.add(new BookmarkablePageLink<>("String_Node_Str",Policies.class));
  MetaDataRoleAuthorizationStrategy.authorize(liContainer,WebPage.RENDER,StandardEntitlement.POLICY_LIST);
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  confULContainer.add(liContainer);
  liContainer.add(new BookmarkablePageLink<>("String_Node_Str",Layouts.class));
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  confULContainer.add(liContainer);
  liContainer.add(new BookmarkablePageLink<>("String_Node_Str",Notifications.class));
  MetaDataRoleAuthorizationStrategy.authorize(liContainer,WebPage.RENDER,StandardEntitlement.NOTIFICATION_LIST);
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  add(liContainer);
  liContainer.add(new BookmarkablePageLink<>("String_Node_Str",CamelRoutes.class));
  add(new Label("String_Node_Str",SyncopeConsoleSession.get().getDomain()));
  add(new BookmarkablePageLink<Page>("String_Node_Str",Logout.class));
  Component containingLI=get(getLIContainerId(getClass().getSimpleName().toLowerCase()));
  if (containingLI == null) {
    containingLI=confULContainer.get(getLIContainerId(getClass().getSimpleName().toLowerCase()));
  }
  if (containingLI != null) {
    containingLI.add(new Behavior(){
      private static final long serialVersionUID=1469628524240283489L;
      @Override public void onComponentTag(      final Component component,      final ComponentTag tag){
        tag.put("String_Node_Str","String_Node_Str");
      }
    }
);
    if (confULContainer.getId().equals(containingLI.getParent().getId())) {
      confULContainer.add(new Behavior(){
        private static final long serialVersionUID=3109256773218160485L;
        @Override public void onComponentTag(        final Component component,        final ComponentTag tag){
          tag.put("String_Node_Str","String_Node_Str");
          tag.put("String_Node_Str","String_Node_Str");
        }
      }
);
      confLIContainer.add(new Behavior(){
        private static final long serialVersionUID=3109256773218160485L;
        @Override public void onComponentTag(        final Component component,        final ComponentTag tag){
          tag.put("String_Node_Str","String_Node_Str");
        }
      }
);
    }
  }
}

Fixed version (ground truth):
public BasePage(final PageParameters parameters){
  super(parameters);
  add(new Label("String_Node_Str",SyncopeConsoleApplication.get().getVersion()));
  add(new Label("String_Node_Str",SyncopeConsoleSession.get().getSelfTO().getUsername()));
  final WebMarkupContainer todosContainer=new WebMarkupContainer("String_Node_Str");
  add(todosContainer);
  Label todos=new Label("String_Node_Str","String_Node_Str");
  todosContainer.add(todos);
  if (SyncopeConsoleSession.get().owns(StandardEntitlement.WORKFLOW_FORM_LIST)) {
    todos.setDefaultModelObject(userWorkflowRestClient.getForms().size());
  }
  MetaDataRoleAuthorizationStrategy.authorize(todosContainer,WebPage.RENDER,StandardEntitlement.WORKFLOW_FORM_LIST);
  WebMarkupContainer liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  add(liContainer);
  liContainer.add(new BookmarkablePageLink<>("String_Node_Str",Dashboard.class));
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  add(liContainer);
  liContainer.add(new BookmarkablePageLink<>("String_Node_Str",Realms.class));
  MetaDataRoleAuthorizationStrategy.authorize(liContainer,WebPage.RENDER,StandardEntitlement.REALM_LIST);
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  add(liContainer);
  liContainer.add(new BookmarkablePageLink<>("String_Node_Str",Topology.class));
  MetaDataRoleAuthorizationStrategy.authorize(liContainer,WebPage.RENDER,String.format("String_Node_Str",StandardEntitlement.CONNECTOR_LIST,StandardEntitlement.RESOURCE_LIST));
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  add(liContainer);
  liContainer.add(new BookmarkablePageLink<>("String_Node_Str",Reports.class));
  MetaDataRoleAuthorizationStrategy.authorize(liContainer,WebPage.RENDER,StandardEntitlement.REPORT_LIST);
  WebMarkupContainer confLIContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  add(confLIContainer);
  WebMarkupContainer confULContainer=new WebMarkupContainer(getULContainerId("String_Node_Str"));
  confLIContainer.add(confULContainer);
  MetaDataRoleAuthorizationStrategy.authorize(liContainer,WebPage.RENDER,StandardEntitlement.CONFIGURATION_LIST);
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  confULContainer.add(liContainer);
  final BookmarkablePageLink<Page> workflowLink=new BookmarkablePageLink<>("String_Node_Str",Workflow.class);
  MetaDataRoleAuthorizationStrategy.authorize(workflowLink,WebPage.ENABLE,StandardEntitlement.WORKFLOW_DEF_READ);
  liContainer.add(workflowLink);
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  confULContainer.add(liContainer);
  final BookmarkablePageLink<Page> logsLink=new BookmarkablePageLink<>("String_Node_Str",Logs.class);
  MetaDataRoleAuthorizationStrategy.authorize(logsLink,WebPage.ENABLE,StandardEntitlement.LOG_LIST);
  liContainer.add(logsLink);
  MetaDataRoleAuthorizationStrategy.authorize(liContainer,WebPage.RENDER,StandardEntitlement.LOG_LIST);
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  confULContainer.add(liContainer);
  final BookmarkablePageLink<Page> secuityQuestionsLink=new BookmarkablePageLink<>("String_Node_Str",SecurityQuestions.class);
  liContainer.add(secuityQuestionsLink);
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  confULContainer.add(liContainer);
  BookmarkablePageLink<Page> typesLink=new BookmarkablePageLink<>("String_Node_Str",Types.class);
  MetaDataRoleAuthorizationStrategy.authorize(typesLink,WebPage.ENABLE,StandardEntitlement.SCHEMA_LIST);
  liContainer.add(typesLink);
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  confULContainer.add(liContainer);
  liContainer.add(new BookmarkablePageLink<>("String_Node_Str",Policies.class));
  MetaDataRoleAuthorizationStrategy.authorize(liContainer,WebPage.RENDER,StandardEntitlement.POLICY_LIST);
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  confULContainer.add(liContainer);
  liContainer.add(new BookmarkablePageLink<>("String_Node_Str",Layouts.class));
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  confULContainer.add(liContainer);
  liContainer.add(new BookmarkablePageLink<>("String_Node_Str",Notifications.class));
  MetaDataRoleAuthorizationStrategy.authorize(liContainer,WebPage.RENDER,StandardEntitlement.NOTIFICATION_LIST);
  liContainer=new WebMarkupContainer(getLIContainerId("String_Node_Str"));
  add(liContainer);
  liContainer.add(new BookmarkablePageLink<>("String_Node_Str",CamelRoutes.class));
  add(new Label("String_Node_Str",SyncopeConsoleSession.get().getDomain()));
  add(new BookmarkablePageLink<Page>("String_Node_Str",Logout.class));
  Component containingLI=get(getLIContainerId(getClass().getSimpleName().toLowerCase()));
  if (containingLI == null) {
    containingLI=confULContainer.get(getLIContainerId(getClass().getSimpleName().toLowerCase()));
  }
  if (containingLI != null) {
    containingLI.add(new Behavior(){
      private static final long serialVersionUID=1469628524240283489L;
      @Override public void onComponentTag(      final Component component,      final ComponentTag tag){
        tag.put("String_Node_Str","String_Node_Str");
      }
    }
);
    if (confULContainer.getId().equals(containingLI.getParent().getId())) {
      confULContainer.add(new Behavior(){
        private static final long serialVersionUID=3109256773218160485L;
        @Override public void onComponentTag(        final Component component,        final ComponentTag tag){
          tag.put("String_Node_Str","String_Node_Str");
          tag.put("String_Node_Str","String_Node_Str");
        }
      }
);
      confLIContainer.add(new Behavior(){
        private static final long serialVersionUID=3109256773218160485L;
        @Override public void onComponentTag(        final Component component,        final ComponentTag tag){
          tag.put("String_Node_Str","String_Node_Str");
        }
      }
);
    }
  }
}