Program: 60850
Project: 60850
Buggy source:
public PolicyModalPage(final ModalWindow window,final T policyTO){
  super();
  final Form form=new Form("String_Node_Str");
  form.setOutputMarkupId(true);
  add(form);
  final AjaxTextFieldPanel policyid=new AjaxTextFieldPanel("String_Node_Str","String_Node_Str",new PropertyModel<String>(policyTO,"String_Node_Str"),false);
  policyid.setEnabled(false);
  policyid.setStyleShet("String_Node_Str");
  form.add(policyid);
  final AjaxTextFieldPanel description=new AjaxTextFieldPanel("String_Node_Str","String_Node_Str",new PropertyModel<String>(policyTO,"String_Node_Str"),false);
  description.addRequiredLabel();
  description.setStyleShet("String_Node_Str");
  form.add(description);
  final AjaxDropDownChoicePanel<PolicyType> type=new AjaxDropDownChoicePanel<PolicyType>("String_Node_Str","String_Node_Str",new PropertyModel<PolicyType>(policyTO,"String_Node_Str"),false);
switch (policyTO.getType()) {
case GLOBAL_ACCOUNT:
case ACCOUNT:
    type.setChoices(Arrays.asList(new PolicyType[]{PolicyType.GLOBAL_ACCOUNT,PolicyType.ACCOUNT}));
  break;
case GLOBAL_PASSWORD:
case PASSWORD:
type.setChoices(Arrays.asList(new PolicyType[]{PolicyType.GLOBAL_PASSWORD,PolicyType.PASSWORD}));
break;
case GLOBAL_SYNC:
case SYNC:
type.setChoices(Arrays.asList(new PolicyType[]{PolicyType.GLOBAL_SYNC,PolicyType.SYNC}));
}
type.addRequiredLabel();
form.add(type);
final AbstractPolicySpec policy=getPolicySpecification(policyTO);
form.add(new PolicyBeanPanel("String_Node_Str",policy));
final IndicatingAjaxButton 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){
setPolicySpecification(policyTO,policy);
try {
if (policyTO.getId() > 0) {
policyRestClient.updatePolicy(policyTO);
}
 else {
policyRestClient.createPolicy(policyTO);
}
window.close(target);
}
 catch (Exception e) {
LOG.error("String_Node_Str",e);
error(getString("String_Node_Str"));
target.add(getPage().get("String_Node_Str"));
}
}
@Override protected void onError(final AjaxRequestTarget target,final Form form){
target.add(getPage().get("String_Node_Str"));
}
}
;
form.add(submit);
}

Fixed version (ground truth):
public PolicyModalPage(final ModalWindow window,final T policyTO){
  super();
  final Form form=new Form("String_Node_Str");
  form.setOutputMarkupId(true);
  add(form);
  final AjaxTextFieldPanel policyid=new AjaxTextFieldPanel("String_Node_Str","String_Node_Str",new PropertyModel<String>(policyTO,"String_Node_Str"),false);
  policyid.setEnabled(false);
  policyid.setStyleShet("String_Node_Str");
  form.add(policyid);
  final AjaxTextFieldPanel description=new AjaxTextFieldPanel("String_Node_Str","String_Node_Str",new PropertyModel<String>(policyTO,"String_Node_Str"),false);
  description.addRequiredLabel();
  description.setStyleShet("String_Node_Str");
  form.add(description);
  final AjaxDropDownChoicePanel<PolicyType> type=new AjaxDropDownChoicePanel<PolicyType>("String_Node_Str","String_Node_Str",new PropertyModel<PolicyType>(policyTO,"String_Node_Str"),false);
switch (policyTO.getType()) {
case GLOBAL_ACCOUNT:
case ACCOUNT:
    type.setChoices(Arrays.asList(new PolicyType[]{PolicyType.GLOBAL_ACCOUNT,PolicyType.ACCOUNT}));
  break;
case GLOBAL_PASSWORD:
case PASSWORD:
type.setChoices(Arrays.asList(new PolicyType[]{PolicyType.GLOBAL_PASSWORD,PolicyType.PASSWORD}));
break;
case GLOBAL_SYNC:
case SYNC:
type.setChoices(Arrays.asList(new PolicyType[]{PolicyType.GLOBAL_SYNC,PolicyType.SYNC}));
default :
}
type.setChoiceRenderer(new PolicyTypeRenderer());
type.addRequiredLabel();
form.add(type);
final AbstractPolicySpec policy=getPolicySpecification(policyTO);
form.add(new PolicyBeanPanel("String_Node_Str",policy));
final IndicatingAjaxButton 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){
setPolicySpecification(policyTO,policy);
try {
if (policyTO.getId() > 0) {
policyRestClient.updatePolicy(policyTO);
}
 else {
policyRestClient.createPolicy(policyTO);
}
window.close(target);
}
 catch (Exception e) {
LOG.error("String_Node_Str",e);
error(getString("String_Node_Str"));
target.add(getPage().get("String_Node_Str"));
}
}
@Override protected void onError(final AjaxRequestTarget target,final Form form){
target.add(getPage().get("String_Node_Str"));
}
}
;
form.add(submit);
}