Program: 60552
Project: 60552
Buggy source:
@Override public void setSchemaModalPage(final PageReference pageRef,final ModalWindow window,AbstractBaseBean schemaTO,final boolean createFlag){
  final SchemaTO schema;
  if (schemaTO != null && schemaTO instanceof SchemaTO) {
    schema=(SchemaTO)schemaTO;
  }
 else {
    schema=new SchemaTO();
  }
  final Form schemaForm=new Form("String_Node_Str");
  schemaForm.setModel(new CompoundPropertyModel(schema));
  schemaForm.setOutputMarkupId(Boolean.TRUE);
  final AjaxTextFieldPanel name=new AjaxTextFieldPanel("String_Node_Str",getString("String_Node_Str"),new PropertyModel<String>(schema,"String_Node_Str"));
  name.addRequiredLabel();
  name.setEnabled(createFlag);
  final AjaxTextFieldPanel conversionPattern=new AjaxTextFieldPanel("String_Node_Str",getString("String_Node_Str"),new PropertyModel<String>(schema,"String_Node_Str"));
  final IModel<List<String>> validatorsList=new LoadableDetachableModel<List<String>>(){
    private static final long serialVersionUID=5275935387613157437L;
    @Override protected List<String> load(){
      return restClient.getAllValidatorClasses();
    }
  }
;
  final AjaxDropDownChoicePanel<String> validatorClass=new AjaxDropDownChoicePanel<String>("String_Node_Str",getString("String_Node_Str"),new PropertyModel(schema,"String_Node_Str"));
  ((DropDownChoice)validatorClass.getField()).setNullValid(true);
  validatorClass.setChoices(validatorsList.getObject());
  final AjaxDropDownChoicePanel<AttributeSchemaType> type=new AjaxDropDownChoicePanel<AttributeSchemaType>("String_Node_Str",getString("String_Node_Str"),new PropertyModel(schema,"String_Node_Str"));
  type.setChoices(Arrays.asList(AttributeSchemaType.values()));
  type.addRequiredLabel();
  final AjaxTextFieldPanel enumerationValuesPanel=new AjaxTextFieldPanel("String_Node_Str","String_Node_Str",new Model<String>(null));
  final MultiValueSelectorPanel<String> enumerationValues=new MultiValueSelectorPanel<String>("String_Node_Str",new Model(),enumerationValuesPanel);
  schemaForm.add(enumerationValues);
  enumerationValues.setModelObject((Serializable)getEnumValuesAsList(schema.getEnumerationValues()));
  final MultiValueSelectorPanel<String> enumerationKeys=new MultiValueSelectorPanel<String>("String_Node_Str",new Model(),new AjaxTextFieldPanel("String_Node_Str","String_Node_Str",new Model<String>(null)));
  schemaForm.add(enumerationKeys);
  enumerationKeys.setModelObject((Serializable)getEnumValuesAsList(schema.getEnumerationKeys()));
  if (schema == null || AttributeSchemaType.Enum.equals(schema.getType())) {
    enumerationValues.setEnabled(Boolean.FALSE);
    enumerationKeys.setEnabled(Boolean.FALSE);
  }
 else {
    enumerationValues.setEnabled(Boolean.TRUE);
    enumerationKeys.setEnabled(Boolean.TRUE);
    enumerationValuesPanel.addRequiredLabel();
  }
  type.getField().add(new AjaxFormComponentUpdatingBehavior("String_Node_Str"){
    private static final long serialVersionUID=-1107858522700306810L;
    @Override protected void onUpdate(    final AjaxRequestTarget target){
      if (AttributeSchemaType.Enum.ordinal() == Integer.parseInt(type.getField().getValue())) {
        if (!enumerationValuesPanel.isRequired()) {
          enumerationValuesPanel.addRequiredLabel();
        }
        enumerationValues.setEnabled(Boolean.TRUE);
        enumerationValues.setModelObject((Serializable)getEnumValuesAsList(schema.getEnumerationValues()));
        enumerationKeys.setEnabled(Boolean.TRUE);
        enumerationKeys.setModelObject((Serializable)getEnumValuesAsList(schema.getEnumerationKeys()));
      }
 else {
        if (enumerationValuesPanel.isRequired()) {
          enumerationValuesPanel.removeRequiredLabel();
        }
        final List<String> values=new ArrayList<String>();
        values.add("String_Node_Str");
        enumerationValues.setEnabled(Boolean.FALSE);
        enumerationValues.setModelObject((Serializable)values);
        final List<String> keys=new ArrayList<String>();
        keys.add("String_Node_Str");
        enumerationKeys.setEnabled(Boolean.FALSE);
        enumerationKeys.setModelObject((Serializable)keys);
      }
      target.add(schemaForm);
    }
  }
);
  final AutoCompleteTextField mandatoryCondition=new AutoCompleteTextField("String_Node_Str"){
    private static final long serialVersionUID=-2428903969518079100L;
    @Override protected Iterator<String> getChoices(    String input){
      List<String> choices=new ArrayList<String>();
      if (Strings.isEmpty(input)) {
        choices=Collections.emptyList();
        return choices.iterator();
      }
      if ("String_Node_Str".startsWith(input.toLowerCase())) {
        choices.add("String_Node_Str");
      }
 else       if ("String_Node_Str".startsWith(input.toLowerCase())) {
        choices.add("String_Node_Str");
      }
      return choices.iterator();
    }
  }
;
  mandatoryCondition.add(new AjaxFormComponentUpdatingBehavior("String_Node_Str"){
    private static final long serialVersionUID=-1107858522700306810L;
    @Override protected void onUpdate(    final AjaxRequestTarget target){
    }
  }
);
  final WebMarkupContainer pwdJexlHelp=JexlHelpUtil.getJexlHelpWebContainer("String_Node_Str");
  schemaForm.add(pwdJexlHelp);
  final AjaxLink<Void> pwdQuestionMarkJexlHelp=JexlHelpUtil.getAjaxLink(pwdJexlHelp,"String_Node_Str");
  schemaForm.add(pwdQuestionMarkJexlHelp);
  final AjaxCheckBoxPanel multivalue=new AjaxCheckBoxPanel("String_Node_Str",getString("String_Node_Str"),new PropertyModel<Boolean>(schema,"String_Node_Str"));
  final AjaxCheckBoxPanel readonly=new AjaxCheckBoxPanel("String_Node_Str",getString("String_Node_Str"),new PropertyModel<Boolean>(schema,"String_Node_Str"));
  final AjaxCheckBoxPanel uniqueConstraint=new AjaxCheckBoxPanel("String_Node_Str",getString("String_Node_Str"),new PropertyModel<Boolean>(schema,"String_Node_Str"));
  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 SchemaTO schemaTO=(SchemaTO)form.getDefaultModelObject();
      schemaTO.setEnumerationValues(getEnumValuesAsString(enumerationValues.getView().getModelObject()));
      schemaTO.setEnumerationKeys(getEnumValuesAsString(enumerationKeys.getView().getModelObject()));
      if (schemaTO.isMultivalue() && schemaTO.isUniqueConstraint()) {
        error(getString("String_Node_Str"));
        target.add(feedbackPanel);
        return;
      }
      try {
        if (createFlag) {
          restClient.createSchema(kind,schemaTO);
        }
 else {
          restClient.updateSchema(kind,schemaTO);
        }
        if (pageRef.getPage() instanceof BasePage) {
          ((BasePage)pageRef.getPage()).setModalResult(true);
        }
        window.close(target);
      }
 catch (      SyncopeClientCompositeErrorException e) {
        error(getString("String_Node_Str") + "String_Node_Str" + e.getMessage());
        target.add(feedbackPanel);
      }
    }
    @Override protected void onError(    final AjaxRequestTarget target,    final Form<?> form){
      target.add(feedbackPanel);
    }
  }
;
  final AjaxButton cancel=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){
      window.close(target);
    }
  }
;
  cancel.setDefaultFormProcessing(false);
  String allowedRoles;
  if (createFlag) {
    allowedRoles=xmlRolesReader.getAllAllowedRoles("String_Node_Str","String_Node_Str");
  }
 else {
    allowedRoles=xmlRolesReader.getAllAllowedRoles("String_Node_Str","String_Node_Str");
  }
  MetaDataRoleAuthorizationStrategy.authorize(submit,ENABLE,allowedRoles);
  schemaForm.add(name);
  schemaForm.add(conversionPattern);
  schemaForm.add(validatorClass);
  schemaForm.add(type);
  schemaForm.add(mandatoryCondition);
  schemaForm.add(multivalue);
  schemaForm.add(readonly);
  schemaForm.add(uniqueConstraint);
  schemaForm.add(submit);
  schemaForm.add(cancel);
  add(schemaForm);
}

Fixed version (ground truth):
@Override public void setSchemaModalPage(final PageReference pageRef,final ModalWindow window,AbstractBaseBean schemaTO,final boolean createFlag){
  final SchemaTO schema;
  if (schemaTO != null && schemaTO instanceof SchemaTO) {
    schema=(SchemaTO)schemaTO;
  }
 else {
    schema=new SchemaTO();
  }
  final Form schemaForm=new Form("String_Node_Str");
  schemaForm.setModel(new CompoundPropertyModel(schema));
  schemaForm.setOutputMarkupId(Boolean.TRUE);
  final AjaxTextFieldPanel name=new AjaxTextFieldPanel("String_Node_Str",getString("String_Node_Str"),new PropertyModel<String>(schema,"String_Node_Str"));
  name.addRequiredLabel();
  name.setEnabled(createFlag);
  final AjaxTextFieldPanel conversionPattern=new AjaxTextFieldPanel("String_Node_Str",getString("String_Node_Str"),new PropertyModel<String>(schema,"String_Node_Str"));
  final IModel<List<String>> validatorsList=new LoadableDetachableModel<List<String>>(){
    private static final long serialVersionUID=5275935387613157437L;
    @Override protected List<String> load(){
      return restClient.getAllValidatorClasses();
    }
  }
;
  final AjaxDropDownChoicePanel<String> validatorClass=new AjaxDropDownChoicePanel<String>("String_Node_Str",getString("String_Node_Str"),new PropertyModel(schema,"String_Node_Str"));
  ((DropDownChoice)validatorClass.getField()).setNullValid(true);
  validatorClass.setChoices(validatorsList.getObject());
  final AjaxDropDownChoicePanel<AttributeSchemaType> type=new AjaxDropDownChoicePanel<AttributeSchemaType>("String_Node_Str",getString("String_Node_Str"),new PropertyModel(schema,"String_Node_Str"));
  type.setChoices(Arrays.asList(AttributeSchemaType.values()));
  type.addRequiredLabel();
  final AjaxTextFieldPanel enumerationValuesPanel=new AjaxTextFieldPanel("String_Node_Str","String_Node_Str",new Model<String>(null));
  final MultiValueSelectorPanel<String> enumerationValues=new MultiValueSelectorPanel<String>("String_Node_Str",new Model(),enumerationValuesPanel);
  schemaForm.add(enumerationValues);
  enumerationValues.setModelObject((Serializable)getEnumValuesAsList(schema.getEnumerationValues()));
  final MultiValueSelectorPanel<String> enumerationKeys=new MultiValueSelectorPanel<String>("String_Node_Str",new Model(),new AjaxTextFieldPanel("String_Node_Str","String_Node_Str",new Model<String>(null)));
  schemaForm.add(enumerationKeys);
  enumerationKeys.setModelObject((Serializable)getEnumValuesAsList(schema.getEnumerationKeys()));
  if (AttributeSchemaType.Enum == schema.getType()) {
    enumerationValues.setEnabled(Boolean.TRUE);
    enumerationKeys.setEnabled(Boolean.TRUE);
    enumerationValuesPanel.addRequiredLabel();
  }
 else {
    enumerationValues.setEnabled(Boolean.FALSE);
    enumerationKeys.setEnabled(Boolean.FALSE);
  }
  type.getField().add(new AjaxFormComponentUpdatingBehavior("String_Node_Str"){
    private static final long serialVersionUID=-1107858522700306810L;
    @Override protected void onUpdate(    final AjaxRequestTarget target){
      if (AttributeSchemaType.Enum.ordinal() == Integer.parseInt(type.getField().getValue())) {
        if (!enumerationValuesPanel.isRequired()) {
          enumerationValuesPanel.addRequiredLabel();
        }
        enumerationValues.setEnabled(Boolean.TRUE);
        enumerationValues.setModelObject((Serializable)getEnumValuesAsList(schema.getEnumerationValues()));
        enumerationKeys.setEnabled(Boolean.TRUE);
        enumerationKeys.setModelObject((Serializable)getEnumValuesAsList(schema.getEnumerationKeys()));
      }
 else {
        if (enumerationValuesPanel.isRequired()) {
          enumerationValuesPanel.removeRequiredLabel();
        }
        final List<String> values=new ArrayList<String>();
        values.add("String_Node_Str");
        enumerationValues.setEnabled(Boolean.FALSE);
        enumerationValues.setModelObject((Serializable)values);
        final List<String> keys=new ArrayList<String>();
        keys.add("String_Node_Str");
        enumerationKeys.setEnabled(Boolean.FALSE);
        enumerationKeys.setModelObject((Serializable)keys);
      }
      target.add(schemaForm);
    }
  }
);
  final AutoCompleteTextField mandatoryCondition=new AutoCompleteTextField("String_Node_Str"){
    private static final long serialVersionUID=-2428903969518079100L;
    @Override protected Iterator<String> getChoices(    String input){
      List<String> choices=new ArrayList<String>();
      if (Strings.isEmpty(input)) {
        choices=Collections.emptyList();
        return choices.iterator();
      }
      if ("String_Node_Str".startsWith(input.toLowerCase())) {
        choices.add("String_Node_Str");
      }
 else       if ("String_Node_Str".startsWith(input.toLowerCase())) {
        choices.add("String_Node_Str");
      }
      return choices.iterator();
    }
  }
;
  mandatoryCondition.add(new AjaxFormComponentUpdatingBehavior("String_Node_Str"){
    private static final long serialVersionUID=-1107858522700306810L;
    @Override protected void onUpdate(    final AjaxRequestTarget target){
    }
  }
);
  final WebMarkupContainer pwdJexlHelp=JexlHelpUtil.getJexlHelpWebContainer("String_Node_Str");
  schemaForm.add(pwdJexlHelp);
  final AjaxLink<Void> pwdQuestionMarkJexlHelp=JexlHelpUtil.getAjaxLink(pwdJexlHelp,"String_Node_Str");
  schemaForm.add(pwdQuestionMarkJexlHelp);
  final AjaxCheckBoxPanel multivalue=new AjaxCheckBoxPanel("String_Node_Str",getString("String_Node_Str"),new PropertyModel<Boolean>(schema,"String_Node_Str"));
  final AjaxCheckBoxPanel readonly=new AjaxCheckBoxPanel("String_Node_Str",getString("String_Node_Str"),new PropertyModel<Boolean>(schema,"String_Node_Str"));
  final AjaxCheckBoxPanel uniqueConstraint=new AjaxCheckBoxPanel("String_Node_Str",getString("String_Node_Str"),new PropertyModel<Boolean>(schema,"String_Node_Str"));
  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 SchemaTO schemaTO=(SchemaTO)form.getDefaultModelObject();
      schemaTO.setEnumerationValues(getEnumValuesAsString(enumerationValues.getView().getModelObject()));
      schemaTO.setEnumerationKeys(getEnumValuesAsString(enumerationKeys.getView().getModelObject()));
      if (schemaTO.isMultivalue() && schemaTO.isUniqueConstraint()) {
        error(getString("String_Node_Str"));
        target.add(feedbackPanel);
        return;
      }
      try {
        if (createFlag) {
          restClient.createSchema(kind,schemaTO);
        }
 else {
          restClient.updateSchema(kind,schemaTO);
        }
        if (pageRef.getPage() instanceof BasePage) {
          ((BasePage)pageRef.getPage()).setModalResult(true);
        }
        window.close(target);
      }
 catch (      SyncopeClientCompositeErrorException e) {
        error(getString("String_Node_Str") + "String_Node_Str" + e.getMessage());
        target.add(feedbackPanel);
      }
    }
    @Override protected void onError(    final AjaxRequestTarget target,    final Form<?> form){
      target.add(feedbackPanel);
    }
  }
;
  final AjaxButton cancel=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){
      window.close(target);
    }
  }
;
  cancel.setDefaultFormProcessing(false);
  String allowedRoles;
  if (createFlag) {
    allowedRoles=xmlRolesReader.getAllAllowedRoles("String_Node_Str","String_Node_Str");
  }
 else {
    allowedRoles=xmlRolesReader.getAllAllowedRoles("String_Node_Str","String_Node_Str");
  }
  MetaDataRoleAuthorizationStrategy.authorize(submit,ENABLE,allowedRoles);
  schemaForm.add(name);
  schemaForm.add(conversionPattern);
  schemaForm.add(validatorClass);
  schemaForm.add(type);
  schemaForm.add(mandatoryCondition);
  schemaForm.add(multivalue);
  schemaForm.add(readonly);
  schemaForm.add(uniqueConstraint);
  schemaForm.add(submit);
  schemaForm.add(cancel);
  add(schemaForm);
}