[Mono-dev] Behavior question / possible patch for NameValueCollection

Peter Williams peter at newton.cx
Thu Sep 1 01:49:35 EDT 2005


Hello all,

In the process of tracking down an XSP crash I ran into what I *think*
is a misbehavior in the current implementation of NameValueCollection.
>From my reading of the MSDN documentation, if you Add ("foo", null) to a
collection, the null value should get stored. The attached simple patch
does that. However the documentation doesn't elsewhere saw how nulls are
treated -- eg, what do they become when stringifying, equivalent to ""?

If people think this patch has the right idea, I guess I'll make some
test cases (I haven't checked if the rest of the implementation can
handle stored nulls gracefully; probably not.) If not, then the
Add(NameValueFollection) implementation needs to be fixed to handle the
empty ArrayLists that Add("foo",null) can leave behind ...

Peter

-- 
Peter Williams / peter at newton.cx

-------------- next part --------------
A non-text attachment was scrubbed...
Name: nvc.diff
Type: text/x-patch
Size: 1180 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050901/1829fdad/attachment.bin 


More information about the Mono-devel-list mailing list