dlr         2003/02/06 13:59:28

  Modified:    src/java/org/apache/jcs/engine/control/group
                        GroupAttrName.java
  Log:
  * src/java/org/apache/jcs/engine/control/group/GroupAttrName.java
    Reverted to CVS revision 1.2, backing out hashCode() and equals() changes.
    Kept new equals() JavaDoc, and added some for hashCode().
  
  Revision  Changes    Path
  1.4       +9 -6      
jakarta-turbine-jcs/src/java/org/apache/jcs/engine/control/group/GroupAttrName.java
  
  Index: GroupAttrName.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/engine/control/group/GroupAttrName.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -u -r1.3 -r1.4
  --- GroupAttrName.java        6 Feb 2003 00:37:59 -0000       1.3
  +++ GroupAttrName.java        6 Feb 2003 21:59:28 -0000       1.4
  @@ -15,7 +15,6 @@
       /** Description of the Field */
       public final GroupId groupId;
       public final Object attrName;
  -    private String hashString;
       private String toString;
   
       /**
  @@ -28,12 +27,12 @@
       {
           this.groupId = groupId;
           this.attrName = attrName;
  +
           if ( groupId == null || attrName == null )
           {
               throw new IllegalArgumentException( "groupId " + groupId + 
                   " and attrName " + attrName + ", must not be null." );
           }
  -        this.hashString = groupId.toString() + attrName.toString();
       }
   
   
  @@ -49,14 +48,18 @@
           {
               return false;
           }
  -        return hashString.equals( ((GroupAttrName) obj).hashString );
  +        GroupAttrName to = ( GroupAttrName ) obj;
  +        return groupId.equals( to.groupId ) && attrName.equals( to.attrName );
       }
   
   
  -    /** Description of the Method */
  -    public int hashCode()
  +    /**
  +     * @return A hash code based on the hash code of {@ #groupid} and
  +     * {@link #attrName}.
  +     */
  +    ppublic int hashCode()
       {
  -        return hashString.hashCode();
  +        return groupId.hashCode() ^ attrName.hashCode();
       }
   
   
  
  
  

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

Reply via email to