Program: 60840
Project: 60840
Buggy source:
public UserModalPage(final PageReference callerPageRef,final ModalWindow window,final UserTO userTO){
  super();
  setBean(userTO);
  if (userTO.getId() > 0) {
    cloneOldUserTO(userTO);
  }
  add(new Label("String_Node_Str",String.valueOf(userTO.getId())));
  final Form form=new Form("String_Node_Str");
  form.setModel(new CompoundPropertyModel(userTO));
  form.add(new UserDetailsPanel("String_Node_Str",userTO,form));
  form.add(new AttributesPanel("String_Node_Str",userTO,form));
  form.add(new DerivedAttributesPanel("String_Node_Str",userTO));
  form.add(new VirtualAttributesPanel("String_Node_Str",userTO));
  form.add(new ResourcesPanel("String_Node_Str",userTO));
  form.add(new RolesPanel("String_Node_Str",userTO));
  final AjaxButton submit=new IndicatingAjaxButton("String_Node_Str",new ResourceModel("String_Node_Str")){
    private static final long serialVersionUID=-958724007591692537L;
    @Override protected void onSubmit(    final AjaxRequestTarget target,    final Form form){
      final UserTO userTO=(UserTO)form.getModelObject();
      try {
        if (userTO.getId() == 0) {
          userRestClient.create(userTO);
        }
 else {
          setupUserMod(userTO);
          if (userMod != null) {
            userRestClient.update(userMod);
          }
        }
        ((Users)callerPageRef.getPage()).setModalResult(true);
        ((Users)callerPageRef.getPage()).getPageParameters().set(Constants.PAGEPARAM_CREATE,userTO.getId() == 0);
        window.close(target);
      }
 catch (      SyncopeClientCompositeErrorException e) {
        LOG.error("String_Node_Str",e);
        error(getString("String_Node_Str") + "String_Node_Str" + e.getMessage());
        target.add(feedbackPanel);
      }
    }
    @Override protected void onError(    AjaxRequestTarget target,    Form form){
      target.add(feedbackPanel);
    }
  }
;
  String allowedRoles=null;
  if (userTO.getId() == 0) {
    allowedRoles=xmlRolesReader.getAllAllowedRoles("String_Node_Str","String_Node_Str");
  }
 else {
    allowedRoles=xmlRolesReader.getAllAllowedRoles("String_Node_Str","String_Node_Str");
  }
  MetaDataRoleAuthorizationStrategy.authorize(submit,RENDER,allowedRoles);
  form.add(submit);
  add(form);
}

Fixed version (ground truth):
public UserModalPage(final PageReference callerPageRef,final ModalWindow window,final UserTO userTO){
  super();
  setBean(userTO);
  if (userTO.getId() > 0) {
    cloneOldUserTO(userTO);
  }
  add(new Label("String_Node_Str",String.valueOf(userTO.getId())));
  final Form form=new Form("String_Node_Str");
  form.setModel(new CompoundPropertyModel(userTO));
  form.add(new UserDetailsPanel("String_Node_Str",userTO,form));
  form.add(new AttributesPanel("String_Node_Str",userTO,form));
  form.add(new DerivedAttributesPanel("String_Node_Str",userTO));
  form.add(new VirtualAttributesPanel("String_Node_Str",userTO));
  form.add(new ResourcesPanel("String_Node_Str",userTO));
  form.add(new RolesPanel("String_Node_Str",userTO));
  final AjaxButton submit=new IndicatingAjaxButton("String_Node_Str",new ResourceModel("String_Node_Str")){
    private static final long serialVersionUID=-958724007591692537L;
    @Override protected void onSubmit(    final AjaxRequestTarget target,    final Form form){
      final UserTO userTO=(UserTO)form.getModelObject();
      try {
        if (userTO.getId() == 0) {
          userRestClient.create(userTO);
        }
 else {
          setupUserMod(userTO);
          if (userMod != null) {
            userRestClient.update(userMod);
          }
        }
        ((Users)callerPageRef.getPage()).setModalResult(true);
        window.close(target);
      }
 catch (      SyncopeClientCompositeErrorException e) {
        LOG.error("String_Node_Str",e);
        error(getString("String_Node_Str") + "String_Node_Str" + e.getMessage());
        target.add(feedbackPanel);
      }
    }
    @Override protected void onError(    AjaxRequestTarget target,    Form form){
      target.add(feedbackPanel);
    }
  }
;
  String allowedRoles=null;
  if (userTO.getId() == 0) {
    allowedRoles=xmlRolesReader.getAllAllowedRoles("String_Node_Str","String_Node_Str");
  }
 else {
    allowedRoles=xmlRolesReader.getAllAllowedRoles("String_Node_Str","String_Node_Str");
  }
  MetaDataRoleAuthorizationStrategy.authorize(submit,RENDER,allowedRoles);
  form.add(submit);
  add(form);
}