The hashcode for the Uri object is calculated once by a call to parseUri() and 
stored in a field called "pk".  Unfortunately the "parseUri" method takes a 
String parameter called "uri", which somtimes differs from the String field 
called "uri"; the difference is a trailing slash.  The breaks the 
relationship between equals and hashcode, since two instances can now be 
equal but have different hash codes.

$ cvs diff -u src/share/org/apache/slide/common/Uri.java
Index: src/share/org/apache/slide/common/Uri.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-slide/src/share/org/apache/slide/common/Uri.java,v
retrieving revision 1.14
diff -u -r1.14 Uri.java
--- src/share/org/apache/slide/common/Uri.java  12 Dec 2003 02:48:30 -0000     
1.14
+++ src/share/org/apache/slide/common/Uri.java  12 Dec 2003 17:42:49 -0000
@@ -385,7 +385,7 @@
                         // The PK in the current descriptorsStore is the
                         // portion of the URI relative
                         // to the Data Source.
-                        this.pk = uri.substring(scope.toString().length())
+                        this.pk = 
this.uri.substring(scope.toString().length())
                             .hashCode();
                     }
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to