[Mono-bugs] [Bug 80857][Nor] Changed - [2.0] URI UriKind.Relative GetHashCode always returns -1
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Mon Feb 26 04:46:20 EST 2007
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by peter.dettman at iinet.net.au.
http://bugzilla.ximian.com/show_bug.cgi?id=80857
--- shadow/80857 2007-02-26 04:40:08.000000000 -0500
+++ shadow/80857.tmp.2679 2007-02-26 04:46:20.000000000 -0500
@@ -10,13 +10,12 @@
Component: System
AssignedTo: mono-bugs at ximian.com
ReportedBy: grompf at sublimeintervention.com
QAContact: mono-bugs at ximian.com
TargetMilestone: ---
URL:
-Cc:
Summary: [2.0] URI UriKind.Relative GetHashCode always returns -1
The following code snippet generates the same hash code for 2 different uris (-1 comes from the
uninitialized port)
using System;
@@ -30,6 +29,16 @@
}
------- Additional Comments From peter.dettman at iinet.net.au 2007-02-26 04:40 -------
Created an attachment (id=18781)
Proposed patch
+
+------- Additional Comments From peter.dettman at iinet.net.au 2007-02-26 04:46 -------
+The above patch straightens out Equals/GetHashCode for the Uri class:
+- GetHashCode gives sensible values for relative Uri's.
+- Uri's that compare equal will give same hashcode.
+- operator == now uses Equals.
+
+All existing tests still pass, and I have added some extra test cases
+specifically for Equals/GetHashCode on relative Uri's (included in patch).
+
More information about the mono-bugs
mailing list