ozeigermann    2003/12/15 04:42:40

  Modified:    src/share/org/apache/slide/common Uri.java
  Log:
  Patch by Steve Vaughan
  
  Bug: 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.
  
  Fix: Take the internally stored - not the parameter - uri to generate pk
  
  Revision  Changes    Path
  1.15      +5 -5      jakarta-slide/src/share/org/apache/slide/common/Uri.java
  
  Index: Uri.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Uri.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Uri.java  12 Dec 2003 02:48:30 -0000      1.14
  +++ Uri.java  15 Dec 2003 12:42:40 -0000      1.15
  @@ -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