Program: 172240
Project: 172240
Buggy source:
/** 
 * Sets up the field definitions for the node's properties.
 * @param nodeRef The NodeRef of the node being setup
 * @param form The Form instance to populate
 * @param formData The FormData instance to populate
 */
@SuppressWarnings("String_Node_Str") protected void generatePropertyFields(NodeRef nodeRef,Form form,FormData formData){
  QName type=this.nodeService.getType(nodeRef);
  TypeDefinition typeDef=this.dictionaryService.getAnonymousType(type,this.nodeService.getAspects(nodeRef));
  Map<QName,PropertyDefinition> propDefs=typeDef.getProperties();
  Map<QName,Serializable> propValues=this.nodeService.getProperties(nodeRef);
  for (  PropertyDefinition propDef : propDefs.values()) {
    String propName=propDef.getName().toPrefixString(this.namespaceService);
    PropertyFieldDefinition fieldDef=new PropertyFieldDefinition(propName,propDef.getDataType().getName().toPrefixString(this.namespaceService));
    String title=propDef.getTitle();
    if (title == null) {
      title=propName;
    }
    fieldDef.setLabel(title);
    fieldDef.setDefaultValue(propDef.getDefaultValue());
    fieldDef.setDescription(propDef.getDescription());
    fieldDef.setMandatory(propDef.isMandatory());
    fieldDef.setProtectedField(propDef.isProtected());
    fieldDef.setRepeating(propDef.isMultiValued());
    List<ConstraintDefinition> constraints=propDef.getConstraints();
    if (constraints != null && constraints.size() > 0) {
      List<FieldConstraint> fieldConstraints=new ArrayList<FieldConstraint>(constraints.size());
      for (      ConstraintDefinition constraintDef : constraints) {
        Constraint constraint=constraintDef.getConstraint();
        Map<String,String> fieldConstraintParams=null;
        Map<String,Object> constraintParams=constraint.getParameters();
        if (constraintParams != null) {
          fieldConstraintParams=new HashMap<String,String>(constraintParams.size());
          for (          String name : constraintParams.keySet()) {
            Object paramValue=constraintParams.get(name);
            if (paramValue instanceof List) {
              paramValue=makeListString((List)paramValue);
            }
            fieldConstraintParams.put(name,paramValue.toString());
          }
        }
        FieldConstraint fieldConstraint=fieldDef.new FieldConstraint(constraint.getType(),fieldConstraintParams);
        fieldConstraints.add(fieldConstraint);
      }
      fieldDef.setConstraints(fieldConstraints);
    }
    form.addFieldDefinition(fieldDef);
    Serializable fieldData=propValues.get(propDef.getName());
    if (fieldData != null) {
      if (fieldData instanceof List) {
        fieldData=makeListString((List)fieldData);
      }
      formData.addData(PROP_PREFIX + fieldDef.getName(),fieldData);
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets up the field definitions for the node's properties.
 * @param nodeRef The NodeRef of the node being setup
 * @param form The Form instance to populate
 * @param formData The FormData instance to populate
 */
@SuppressWarnings("String_Node_Str") protected void generatePropertyFields(NodeRef nodeRef,Form form,FormData formData){
  QName type=this.nodeService.getType(nodeRef);
  Collection<QName> aspects=this.getAspectsToInclude(nodeRef);
  TypeDefinition typeDef=this.dictionaryService.getAnonymousType(type,aspects);
  Map<QName,PropertyDefinition> propDefs=typeDef.getProperties();
  Map<QName,Serializable> propValues=this.nodeService.getProperties(nodeRef);
  for (  PropertyDefinition propDef : propDefs.values()) {
    String propName=propDef.getName().toPrefixString(this.namespaceService);
    PropertyFieldDefinition fieldDef=new PropertyFieldDefinition(propName,propDef.getDataType().getName().toPrefixString(this.namespaceService));
    String title=propDef.getTitle();
    if (title == null) {
      title=propName;
    }
    fieldDef.setLabel(title);
    fieldDef.setDefaultValue(propDef.getDefaultValue());
    fieldDef.setDescription(propDef.getDescription());
    fieldDef.setMandatory(propDef.isMandatory());
    fieldDef.setProtectedField(propDef.isProtected());
    fieldDef.setRepeating(propDef.isMultiValued());
    List<ConstraintDefinition> constraints=propDef.getConstraints();
    if (constraints != null && constraints.size() > 0) {
      List<FieldConstraint> fieldConstraints=new ArrayList<FieldConstraint>(constraints.size());
      for (      ConstraintDefinition constraintDef : constraints) {
        Constraint constraint=constraintDef.getConstraint();
        Map<String,String> fieldConstraintParams=null;
        Map<String,Object> constraintParams=constraint.getParameters();
        if (constraintParams != null) {
          fieldConstraintParams=new HashMap<String,String>(constraintParams.size());
          for (          String name : constraintParams.keySet()) {
            Object paramValue=constraintParams.get(name);
            if (paramValue instanceof List) {
              paramValue=makeListString((List)paramValue);
            }
            fieldConstraintParams.put(name,paramValue.toString());
          }
        }
        FieldConstraint fieldConstraint=fieldDef.new FieldConstraint(constraint.getType(),fieldConstraintParams);
        fieldConstraints.add(fieldConstraint);
      }
      fieldDef.setConstraints(fieldConstraints);
    }
    form.addFieldDefinition(fieldDef);
    Serializable fieldData=propValues.get(propDef.getName());
    if (fieldData != null) {
      if (fieldData instanceof List) {
        fieldData=makeListString((List)fieldData);
      }
      formData.addData(PROP_PREFIX + fieldDef.getName(),fieldData);
    }
  }
}