Program: 60665
Project: 60665
Buggy source:
@Override protected void populateItem(final ListItem<WorkflowFormPropertyTO> item){
  final WorkflowFormPropertyTO prop=item.getModelObject();
  Label label=new Label("String_Node_Str",prop.getName() == null ? prop.getId() : prop.getName());
  item.add(label);
  FieldPanel field=null;
switch (prop.getType()) {
case Boolean:
    field=new AjaxDropDownChoicePanel("String_Node_Str",label.getDefaultModelObjectAsString(),new Model(Boolean.valueOf(prop.getValue())),true).setChoices(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str"}));
  break;
case Date:
SimpleDateFormat df=StringUtils.isNotBlank(prop.getDatePattern()) ? new SimpleDateFormat(prop.getDatePattern()) : new SimpleDateFormat();
Date parsedDate=null;
if (StringUtils.isNotBlank(prop.getValue())) {
try {
parsedDate=df.parse(prop.getValue());
}
 catch (ParseException e) {
LOG.error("String_Node_Str",prop.getValue(),e);
}
}
field=new DateTimeFieldPanel("String_Node_Str",label.getDefaultModelObjectAsString(),new Model(parsedDate),true,df.toLocalizedPattern());
break;
case Enum:
MapChoiceRenderer<String,String> enumCR=new MapChoiceRenderer<String,String>(prop.getEnumValues());
field=new AjaxDropDownChoicePanel("String_Node_Str",label.getDefaultModelObjectAsString(),new Model(prop.getValue()),true).setChoiceRenderer(enumCR).setChoices(new Model(){
private static final long serialVersionUID=-858521070366432018L;
@Override public Serializable getObject(){
return new ArrayList(prop.getEnumValues().keySet());
}
}
);
break;
case Long:
field=new AjaxNumberFieldPanel("String_Node_Str",label.getDefaultModelObjectAsString(),new Model(Long.valueOf(prop.getValue())),true);
break;
case String:
default :
field=new AjaxTextFieldPanel("String_Node_Str",PARENT_PATH,new Model(prop.getValue()),true);
break;
}
field.setReadOnly(!prop.isWritable());
if (prop.isRequired()) {
field.addRequiredLabel();
}
item.add(field);
}

Fixed version (ground truth):
@Override protected void populateItem(final ListItem<WorkflowFormPropertyTO> item){
  final WorkflowFormPropertyTO prop=item.getModelObject();
  Label label=new Label("String_Node_Str",prop.getName() == null ? prop.getId() : prop.getName());
  item.add(label);
  FieldPanel field=null;
switch (prop.getType()) {
case Boolean:
    field=new AjaxDropDownChoicePanel("String_Node_Str",label.getDefaultModelObjectAsString(),new Model(Boolean.valueOf(prop.getValue())),true).setChoices(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str"}));
  break;
case Date:
SimpleDateFormat df=StringUtils.isNotBlank(prop.getDatePattern()) ? new SimpleDateFormat(prop.getDatePattern()) : new SimpleDateFormat();
Date parsedDate=null;
if (StringUtils.isNotBlank(prop.getValue())) {
try {
parsedDate=df.parse(prop.getValue());
}
 catch (ParseException e) {
LOG.error("String_Node_Str",prop.getValue(),e);
}
}
field=new DateTimeFieldPanel("String_Node_Str",label.getDefaultModelObjectAsString(),new Model(parsedDate),true,df.toLocalizedPattern());
break;
case Enum:
MapChoiceRenderer<String,String> enumCR=new MapChoiceRenderer<String,String>(prop.getEnumValues());
field=new AjaxDropDownChoicePanel("String_Node_Str",label.getDefaultModelObjectAsString(),new Model(prop.getValue()),true).setChoiceRenderer(enumCR).setChoices(new Model(){
private static final long serialVersionUID=-858521070366432018L;
@Override public Serializable getObject(){
return new ArrayList(prop.getEnumValues().keySet());
}
}
);
break;
case Long:
field=new AjaxNumberFieldPanel("String_Node_Str",label.getDefaultModelObjectAsString(),new Model(Long.valueOf(prop.getValue())),Long.class,true);
break;
case String:
default :
field=new AjaxTextFieldPanel("String_Node_Str",PARENT_PATH,new Model(prop.getValue()),true);
break;
}
field.setReadOnly(!prop.isWritable());
if (prop.isRequired()) {
field.addRequiredLabel();
}
item.add(field);
}