Program: 33174
Project: 33174
Buggy source:
private void writePropertyValue(final ServiceMetadata metadata,final EdmProperty edmProperty,final Property property,final Set<List<String>> selectedPaths,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(),writer);
      }
 else {
        writePrimitive((EdmPrimitiveType)edmProperty.getType(),property,edmProperty.isNullable(),edmProperty.getMaxLength(),edmProperty.getPrecision(),edmProperty.getScale(),edmProperty.isUnicode(),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,writer);
      }
 else {
        writer.writeAttribute(METADATA,NS_METADATA,Constants.ATTR_TYPE,"String_Node_Str" + complexType(metadata,(EdmComplexType)edmProperty.getType(),property.getType()));
        writeComplexValue(metadata,(EdmComplexType)edmProperty.getType(),property.asComplex().getValue(),selectedPaths,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 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(),writer);
      }
 else {
        writePrimitive((EdmPrimitiveType)edmProperty.getType(),property,edmProperty.isNullable(),edmProperty.getMaxLength(),edmProperty.getPrecision(),edmProperty.getScale(),edmProperty.isUnicode(),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,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,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());
  }
}