Program: 33122
Project: 33122
Buggy source:
private void writePropertyValue(final ServiceMetadata metadata,final EdmProperty edmProperty,final Property property,final Set<List<String>> selectedPaths,final String xml10InvalidCharReplacement,final XMLStreamWriter writer) throws XMLStreamException, SerializerException {
  try {
    if (edmProperty.isPrimitive() || edmProperty.getType().getKind() == EdmTypeKind.ENUM || edmProperty.getType().getKind() == EdmTypeKind.DEFINITION) {
      if (edmProperty.isCollection()) {
        writer.writeAttribute(METADATA,NS_METADATA,Constants.ATTR_TYPE,edmProperty.isPrimitive() ? "String_Node_Str" + edmProperty.getType().getName() + "String_Node_Str" : collectionType(edmProperty.getType()));
        writePrimitiveCollection((EdmPrimitiveType)edmProperty.getType(),property,edmProperty.isNullable(),edmProperty.getMaxLength(),edmProperty.getPrecision(),edmProperty.getScale(),edmProperty.isUnicode(),xml10InvalidCharReplacement,writer);
      }
 else {
        writePrimitive((EdmPrimitiveType)edmProperty.getType(),property,edmProperty.isNullable(),edmProperty.getMaxLength(),edmProperty.getPrecision(),edmProperty.getScale(),edmProperty.isUnicode(),xml10InvalidCharReplacement,writer);
      }
    }
 else     if (property.isComplex()) {
      if (edmProperty.isCollection()) {
        writer.writeAttribute(METADATA,NS_METADATA,Constants.ATTR_TYPE,collectionType(edmProperty.getType()));
        writeComplexCollection(metadata,(EdmComplexType)edmProperty.getType(),property,selectedPaths,xml10InvalidCharReplacement,writer);
      }
 else {
        writer.writeAttribute(METADATA,NS_METADATA,Constants.ATTR_TYPE,"String_Node_Str" + complexType(metadata,(EdmComplexType)edmProperty.getType(),property.getType()));
        writeComplexValue(metadata,property,(EdmComplexType)edmProperty.getType(),property.asComplex().getValue(),selectedPaths,xml10InvalidCharReplacement,writer);
      }
    }
 else {
      throw new SerializerException("String_Node_Str",SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE,edmProperty.getName());
    }
  }
 catch (  final EdmPrimitiveTypeException e) {
    throw new SerializerException("String_Node_Str",e,SerializerException.MessageKeys.WRONG_PROPERTY_VALUE,edmProperty.getName(),property.getValue().toString());
  }
}

Fixed version (ground truth):
private void writePropertyValue(final ServiceMetadata metadata,final EdmProperty edmProperty,final Property property,final Set<List<String>> selectedPaths,final String xml10InvalidCharReplacement,final XMLStreamWriter writer) throws XMLStreamException, SerializerException {
  try {
    if (edmProperty.isPrimitive() || edmProperty.getType().getKind() == EdmTypeKind.ENUM || edmProperty.getType().getKind() == EdmTypeKind.DEFINITION) {
      if (edmProperty.isCollection()) {
        writer.writeAttribute(METADATA,NS_METADATA,Constants.ATTR_TYPE,edmProperty.isPrimitive() ? "String_Node_Str" + edmProperty.getType().getName() + "String_Node_Str" : collectionType(edmProperty.getType()));
        writePrimitiveCollection((EdmPrimitiveType)edmProperty.getType(),property,edmProperty.isNullable(),edmProperty.getMaxLength(),edmProperty.getPrecision(),edmProperty.getScale(),edmProperty.isUnicode(),xml10InvalidCharReplacement,writer);
      }
 else {
        writePrimitive((EdmPrimitiveType)edmProperty.getType(),property,edmProperty.isNullable(),edmProperty.getMaxLength(),edmProperty.getPrecision(),edmProperty.getScale(),edmProperty.isUnicode(),xml10InvalidCharReplacement,writer);
      }
    }
 else     if (property.isComplex()) {
      if (edmProperty.isCollection()) {
        writer.writeAttribute(METADATA,NS_METADATA,Constants.ATTR_TYPE,collectionType(edmProperty.getType()));
        writeComplexCollection(metadata,(EdmComplexType)edmProperty.getType(),property,selectedPaths,xml10InvalidCharReplacement,writer);
      }
 else {
        writeComplex(metadata,edmProperty,property,selectedPaths,xml10InvalidCharReplacement,writer);
      }
    }
 else {
      throw new SerializerException("String_Node_Str",SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE,edmProperty.getName());
    }
  }
 catch (  final EdmPrimitiveTypeException e) {
    throw new SerializerException("String_Node_Str",e,SerializerException.MessageKeys.WRONG_PROPERTY_VALUE,edmProperty.getName(),property.getValue().toString());
  }
}