Program: 172233
Project: 172233
Buggy source:
/** 
 * Processes the given field data for persistence as a property.
 * @param nodeRef The NodeRef to persist the properties on
 * @param propDefs Map of PropertyDefinition's for the node being persisted
 * @param fieldData Data to persist for the property
 * @param propsToPersist Map of properties to be persisted
 */
protected void processPropertyPersist(NodeRef nodeRef,Map<QName,PropertyDefinition> propDefs,FieldData fieldData,Map<QName,Serializable> propsToPersist){
  if (logger.isDebugEnabled())   logger.debug("String_Node_Str" + fieldData + "String_Node_Str");
  Matcher m=this.propertyNamePattern.matcher(fieldData.getName());
  if (m.matches()) {
    String qNamePrefix=m.group(1);
    String localName=m.group(2);
    QName fullQName=QName.createQName(qNamePrefix,localName,namespaceService);
    PropertyDefinition propDef=propDefs.get(fullQName);
    if (propDef == null) {
      propDef=this.dictionaryService.getProperty(fullQName);
    }
    if (propDef != null) {
      if (fullQName.equals(ContentModel.PROP_NAME)) {
        processNamePropertyPersist(nodeRef,fieldData);
      }
 else {
        Object value=fieldData.getValue();
        if ((value instanceof String) && ((String)value).length() == 0) {
          if (propDef.getDataType().getName().equals(DataTypeDefinition.DOUBLE) || propDef.getDataType().getName().equals(DataTypeDefinition.FLOAT) || propDef.getDataType().getName().equals(DataTypeDefinition.INT)|| propDef.getDataType().getName().equals(DataTypeDefinition.LONG)|| propDef.getDataType().getName().equals(DataTypeDefinition.DATE)|| propDef.getDataType().getName().equals(DataTypeDefinition.DATETIME)) {
            value=null;
          }
        }
 else         if (propDef.isMultiValued()) {
          StringTokenizer tokenizer=new StringTokenizer((String)value,"String_Node_Str");
          List<String> list=new ArrayList<String>(8);
          while (tokenizer.hasMoreTokens()) {
            list.add(tokenizer.nextToken());
          }
          value=list;
        }
 else         if (propDef.getDataType().getName().equals(DataTypeDefinition.BOOLEAN)) {
          if (value instanceof String && ON.equals(value)) {
            value=Boolean.TRUE;
          }
        }
 else         if (propDef.getDataType().getName().equals(DataTypeDefinition.LOCALE)) {
          value=I18NUtil.parseLocale((String)value);
        }
        propsToPersist.put(fullQName,(Serializable)value);
      }
    }
 else     if (logger.isWarnEnabled()) {
      logger.warn("String_Node_Str" + fieldData.getName() + "String_Node_Str");
    }
  }
 else {
    Matcher tppm=this.transientPropertyPattern.matcher(fieldData.getName());
    if (tppm.matches()) {
      String fieldName=tppm.group(1);
      if (fieldName.equals(TRANSIENT_MIMETYPE)) {
        processMimetypePropertyPersist(nodeRef,fieldData,propsToPersist);
      }
 else       if (fieldName.equals(TRANSIENT_ENCODING)) {
        processEncodingPropertyPersist(nodeRef,fieldData,propsToPersist);
      }
 else       if (fieldName.equals(TRANSIENT_SIZE)) {
      }
 else       if (logger.isWarnEnabled()) {
        logger.warn("String_Node_Str" + fieldData.getName() + "String_Node_Str");
      }
    }
 else     if (logger.isWarnEnabled()) {
      logger.warn("String_Node_Str" + fieldData.getName() + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Processes the given field data for persistence as a property.
 * @param nodeRef The NodeRef to persist the properties on
 * @param propDefs Map of PropertyDefinition's for the node being persisted
 * @param fieldData Data to persist for the property
 * @param propsToPersist Map of properties to be persisted
 */
protected void processPropertyPersist(NodeRef nodeRef,Map<QName,PropertyDefinition> propDefs,FieldData fieldData,Map<QName,Serializable> propsToPersist){
  if (logger.isDebugEnabled())   logger.debug("String_Node_Str" + fieldData + "String_Node_Str");
  Matcher m=this.propertyNamePattern.matcher(fieldData.getName());
  if (m.matches()) {
    String qNamePrefix=m.group(1);
    String localName=m.group(2);
    QName fullQName=QName.createQName(qNamePrefix,localName,namespaceService);
    PropertyDefinition propDef=propDefs.get(fullQName);
    if (propDef == null) {
      propDef=this.dictionaryService.getProperty(fullQName);
    }
    if (propDef != null) {
      if (fullQName.equals(ContentModel.PROP_NAME)) {
        processNamePropertyPersist(nodeRef,fieldData);
      }
 else {
        Object value=fieldData.getValue();
        if ((value instanceof String) && ((String)value).length() == 0) {
          if (!propDef.getDataType().getName().equals(DataTypeDefinition.TEXT) && !propDef.getDataType().getName().equals(DataTypeDefinition.MLTEXT)) {
            value=null;
          }
        }
 else         if (propDef.isMultiValued()) {
          StringTokenizer tokenizer=new StringTokenizer((String)value,"String_Node_Str");
          List<String> list=new ArrayList<String>(8);
          while (tokenizer.hasMoreTokens()) {
            list.add(tokenizer.nextToken());
          }
          value=list;
        }
 else         if (propDef.getDataType().getName().equals(DataTypeDefinition.BOOLEAN)) {
          if (value instanceof String && ON.equals(value)) {
            value=Boolean.TRUE;
          }
        }
 else         if (propDef.getDataType().getName().equals(DataTypeDefinition.LOCALE)) {
          value=I18NUtil.parseLocale((String)value);
        }
        propsToPersist.put(fullQName,(Serializable)value);
      }
    }
 else     if (logger.isWarnEnabled()) {
      logger.warn("String_Node_Str" + fieldData.getName() + "String_Node_Str");
    }
  }
 else {
    Matcher tppm=this.transientPropertyPattern.matcher(fieldData.getName());
    if (tppm.matches()) {
      String fieldName=tppm.group(1);
      if (fieldName.equals(TRANSIENT_MIMETYPE)) {
        processMimetypePropertyPersist(nodeRef,fieldData,propsToPersist);
      }
 else       if (fieldName.equals(TRANSIENT_ENCODING)) {
        processEncodingPropertyPersist(nodeRef,fieldData,propsToPersist);
      }
 else       if (fieldName.equals(TRANSIENT_SIZE)) {
      }
 else       if (logger.isWarnEnabled()) {
        logger.warn("String_Node_Str" + fieldData.getName() + "String_Node_Str");
      }
    }
 else     if (logger.isWarnEnabled()) {
      logger.warn("String_Node_Str" + fieldData.getName() + "String_Node_Str");
    }
  }
}