Program: 61017
Project: 61017
Buggy source:
@Override protected void populateItem(final ListItem<SchemaMappingTO> item){
  final SchemaMappingTO mappingTO=item.getModelObject();
  item.add(new AjaxDecoratedCheckbox("String_Node_Str",new Model(Boolean.FALSE)){
    private static final long serialVersionUID=7170946748485726506L;
    @Override protected void onUpdate(    final AjaxRequestTarget target){
      int index=-1;
      for (int i=0; i < resourceTO.getMappings().size() && index == -1; i++) {
        if (mappingTO.equals(resourceTO.getMappings().get(i))) {
          index=i;
        }
      }
      if (index != -1) {
        resourceTO.getMappings().remove(index);
        item.getParent().removeAll();
        target.addComponent(mappingContainer);
      }
    }
    @Override protected IAjaxCallDecorator getAjaxCallDecorator(){
      return new AjaxPreprocessingCallDecorator(super.getAjaxCallDecorator()){
        private static final long serialVersionUID=-7927968187160354605L;
        @Override public CharSequence preDecorateScript(        final CharSequence script){
          return "String_Node_Str" + getString("String_Node_Str") + "String_Node_Str"+ "String_Node_Str"+ script+ "String_Node_Str"+ "String_Node_Str";
        }
      }
;
    }
  }
);
  final DropDownChoice<String> schemaAttrChoice=new DropDownChoice<String>("String_Node_Str",new PropertyModel<String>(mappingTO,"String_Node_Str"),(IModel)null);
  schemaAttrChoice.add(new AjaxFormComponentUpdatingBehavior("String_Node_Str"){
    private static final long serialVersionUID=-1107858522700306810L;
    @Override protected void onUpdate(    AjaxRequestTarget art){
      mappingTO.setSourceAttrName(schemaAttrChoice.getModelObject());
    }
  }
);
  schemaAttrChoice.setOutputMarkupId(true);
  if (mappingTO.getSourceMappingType() == null) {
    schemaAttrChoice.setChoices(Collections.EMPTY_LIST);
  }
 else {
switch (mappingTO.getSourceMappingType()) {
case UserSchema:
      schemaAttrChoice.setChoices(uSchemaAttrNames);
    break;
case UserDerivedSchema:
  schemaAttrChoice.setChoices(uDerSchemaAttrNames);
break;
case UserVirtualSchema:
schemaAttrChoice.setChoices(uVirSchemaAttrNames);
break;
case SyncopeUserId:
schemaAttrChoice.setEnabled(false);
schemaAttrChoice.setRequired(false);
schemaAttrChoice.setChoices(Collections.EMPTY_LIST);
mappingTO.setSourceAttrName("String_Node_Str");
break;
case Password:
schemaAttrChoice.setEnabled(false);
schemaAttrChoice.setRequired(false);
schemaAttrChoice.setChoices(Collections.EMPTY_LIST);
mappingTO.setSourceAttrName("String_Node_Str");
break;
default :
schemaAttrChoice.setChoices(Collections.EMPTY_LIST);
}
}
item.add(schemaAttrChoice);
item.add(new SourceMappingTypesDropDownChoice("String_Node_Str",new PropertyModel<SourceMappingType>(mappingTO,"String_Node_Str"),sourceMappingTypes,schemaAttrChoice).setRequired(true).setOutputMarkupId(true));
final TextField<String> destAttrName=new TextField<String>("String_Node_Str",new PropertyModel(mappingTO,"String_Node_Str"));
destAttrName.setRequired(true);
destAttrName.setLabel(new ResourceModel("String_Node_Str"));
destAttrName.setOutputMarkupId(true);
destAttrName.add(new AjaxFormComponentUpdatingBehavior("String_Node_Str"){
private static final long serialVersionUID=-1107858522700306810L;
@Override protected void onUpdate(AjaxRequestTarget art){
mappingTO.setDestAttrName(destAttrName.getModelObject());
}
}
);
item.add(destAttrName);
final AutoCompleteTextField<String> mandatoryCondirion=new AutoCompleteTextField<String>("String_Node_Str",new PropertyModel(mappingTO,"String_Node_Str")){
private static final long serialVersionUID=-6648767303091874219L;
@Override protected Iterator getChoices(final String input){
List<String> choices;
if ("String_Node_Str".startsWith(input.toLowerCase())) {
choices=Collections.singletonList("String_Node_Str");
}
 else if ("String_Node_Str".startsWith(input.toLowerCase())) {
choices=Collections.singletonList("String_Node_Str");
}
 else {
choices=Collections.EMPTY_LIST;
}
return choices.iterator();
}
}
;
mandatoryCondirion.add(new AjaxFormComponentUpdatingBehavior("String_Node_Str"){
private static final long serialVersionUID=-1107858522700306810L;
@Override protected void onUpdate(AjaxRequestTarget art){
mappingTO.setMandatoryCondition(mandatoryCondirion.getModelObject());
}
}
);
item.add(mandatoryCondirion);
final CheckBox accountId=new CheckBox("String_Node_Str",new PropertyModel(mappingTO,"String_Node_Str"));
accountId.add(new AjaxFormComponentUpdatingBehavior("String_Node_Str"){
private static final long serialVersionUID=-1107858522700306810L;
@Override protected void onUpdate(AjaxRequestTarget art){
mappingTO.setAccountid(accountId.getModelObject());
}
}
);
item.add(accountId);
final CheckBox password=new CheckBox("String_Node_Str",new PropertyModel(mappingTO,"String_Node_Str"));
password.add(new AjaxFormComponentUpdatingBehavior("String_Node_Str"){
private static final long serialVersionUID=-1107858522700306810L;
@Override protected void onUpdate(AjaxRequestTarget art){
mappingTO.setPassword(password.getModelObject());
}
}
);
item.add(password);
}

Fixed version (ground truth):
@Override protected void populateItem(final ListItem<SchemaMappingTO> item){
  final SchemaMappingTO mappingTO=item.getModelObject();
  item.add(new AjaxDecoratedCheckbox("String_Node_Str",new Model(Boolean.FALSE)){
    private static final long serialVersionUID=7170946748485726506L;
    @Override protected void onUpdate(    final AjaxRequestTarget target){
      int index=-1;
      for (int i=0; i < resourceTO.getMappings().size() && index == -1; i++) {
        if (mappingTO.equals(resourceTO.getMappings().get(i))) {
          index=i;
        }
      }
      if (index != -1) {
        resourceTO.getMappings().remove(index);
        item.getParent().removeAll();
        target.addComponent(mappingContainer);
      }
    }
    @Override protected IAjaxCallDecorator getAjaxCallDecorator(){
      return new AjaxPreprocessingCallDecorator(super.getAjaxCallDecorator()){
        private static final long serialVersionUID=-7927968187160354605L;
        @Override public CharSequence preDecorateScript(        final CharSequence script){
          return "String_Node_Str" + getString("String_Node_Str") + "String_Node_Str"+ "String_Node_Str"+ script+ "String_Node_Str"+ "String_Node_Str";
        }
      }
;
    }
  }
);
  final AjaxDropDownChoicePanel sourceAttrNames=new AjaxDropDownChoicePanel<String>("String_Node_Str",getString("String_Node_Str"),new PropertyModel(mappingTO,"String_Node_Str"),true);
  sourceAttrNames.setChoices(resourceSchemaNames);
  sourceAttrNames.setRequired(true);
  sourceAttrNames.setStyleShet("String_Node_Str");
  if (mappingTO.getSourceMappingType() == null) {
    sourceAttrNames.setChoices(Collections.EMPTY_LIST);
  }
 else {
switch (mappingTO.getSourceMappingType()) {
case UserSchema:
      sourceAttrNames.setChoices(uSchemaAttrNames);
    break;
case UserDerivedSchema:
  sourceAttrNames.setChoices(uDerSchemaAttrNames);
break;
case UserVirtualSchema:
sourceAttrNames.setChoices(uVirSchemaAttrNames);
break;
case SyncopeUserId:
sourceAttrNames.setEnabled(false);
sourceAttrNames.setRequired(false);
sourceAttrNames.setChoices(Collections.EMPTY_LIST);
mappingTO.setSourceAttrName("String_Node_Str");
break;
case Password:
sourceAttrNames.setEnabled(false);
sourceAttrNames.setRequired(false);
sourceAttrNames.setChoices(Collections.EMPTY_LIST);
mappingTO.setSourceAttrName("String_Node_Str");
break;
default :
sourceAttrNames.setChoices(Collections.EMPTY_LIST);
}
}
item.add(sourceAttrNames);
final SourceMappingTypesDropDownChoice mappingTypesPanel=new SourceMappingTypesDropDownChoice("String_Node_Str",getString("String_Node_Str"),new PropertyModel<SourceMappingType>(mappingTO,"String_Node_Str"),sourceAttrNames);
mappingTypesPanel.setRequired(true);
mappingTypesPanel.setChoices(sourceMappingTypes.getObject());
mappingTypesPanel.setStyleShet("String_Node_Str");
item.add(mappingTypesPanel);
final FieldPanel destAttrName;
if (resourceSchemaNames.isEmpty()) {
destAttrName=new AjaxTextFieldPanel("String_Node_Str",getString("String_Node_Str"),new PropertyModel<String>(mappingTO,"String_Node_Str"),true);
}
 else {
destAttrName=new AjaxDropDownChoicePanel<String>("String_Node_Str",getString("String_Node_Str"),new PropertyModel(mappingTO,"String_Node_Str"),true);
((AjaxDropDownChoicePanel)destAttrName).setChoices(resourceSchemaNames);
}
boolean required=mappingTO != null && !mappingTO.isAccountid() && !mappingTO.isPassword();
destAttrName.setRequired(required);
destAttrName.setEnabled(required);
destAttrName.setStyleShet("String_Node_Str");
item.add(destAttrName);
final AjaxTextFieldPanel mandatoryCondition=new AjaxTextFieldPanel("String_Node_Str",getString("String_Node_Str"),new PropertyModel(mappingTO,"String_Node_Str"),true);
mandatoryCondition.setChoices(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str"}));
mandatoryCondition.setStyleShet("String_Node_Str");
item.add(mandatoryCondition);
final AjaxCheckBoxPanel accountId=new AjaxCheckBoxPanel("String_Node_Str",getString("String_Node_Str"),new PropertyModel(mappingTO,"String_Node_Str"),false);
accountId.getField().add(new AjaxFormComponentUpdatingBehavior("String_Node_Str"){
private static final long serialVersionUID=-1107858522700306810L;
@Override protected void onUpdate(AjaxRequestTarget target){
destAttrName.setEnabled(!accountId.getModelObject() && !mappingTO.isPassword());
destAttrName.setModelObject(null);
destAttrName.setRequired(!accountId.getModelObject());
target.addComponent(destAttrName);
}
}
);
item.add(accountId);
final AjaxCheckBoxPanel password=new AjaxCheckBoxPanel("String_Node_Str",getString("String_Node_Str"),new PropertyModel(mappingTO,"String_Node_Str"),true);
password.getField().add(new AjaxFormComponentUpdatingBehavior("String_Node_Str"){
private static final long serialVersionUID=-1107858522700306810L;
@Override protected void onUpdate(AjaxRequestTarget target){
destAttrName.setEnabled(!mappingTO.isAccountid() && !password.getModelObject());
destAttrName.setModelObject(null);
destAttrName.setRequired(!password.getModelObject());
target.addComponent(destAttrName);
}
}
);
item.add(password);
}