tor 2010-04-22 klockan 21:40 +0200 skrev Robert Jordan:
> On 22.04.2010 19:57, Simon Lindgren wrote:
> >     string path = "path";
> >     try {
> 
> This is a very interesting way of iterating over a dictionary ;)

Indeed :)

> 
> >             for (IDictionaryEnumerator n = parameters.GetEnumerator(); ;) {
> >                     n.MoveNext();
> >                     if (((string)n.Value) == "/Page1") {
> >                             Console.WriteLine("path.GetHashCode(): {0}", 
> > path.GetHashCode());
> >                             Console.WriteLine("Key.GetHashCode(): {0}", 
> > n.Key.GetHashCode());
> >                             Console.WriteLine("Key.Equals(path): {0}", 
> > n.Key.Equals(path));
> >                             Console.WriteLine("ReferenceEquals(Key, path): 
> > {0}", ReferenceEquals(n.Key, path));
> >                             Console.WriteLine("Key == path: {0}", n.Key == 
> > path);
> 
> n.Key == path will always be false here, because String.Equals
> will *not* be called.

Not really an error, just me forgetting to remove it after adding the
ReferenceEquals call...

> 
> You must cast n.Key to string:
> 
>       (string)n.Key == path
> 
> Check your code for similar errors and if you still think you've
> found a bug, please file a case in Bugzilla with a self-contained
> test case anyone can compile.

I don't know how to reproduce this without the ASP.NET stack or the
dozen libs that is required for the Castle Framework. The code for this
is pretty small though, something like 200 lines or so including
configuration, but I don't believe it can be automated very easily.

The fact remains that I can get what seems to be a duplicate key into a
Hashtable, so something is not right, but I don't really know what to
try next.

-- 
Simon Lindgren

Attachment: signature.asc
Description: Detta är en digitalt signerad meddelandedel

_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to