leosimons    2004/01/11 13:58:28

  Modified:    framework/api/src/java/org/apache/avalon/framework Enum.java
  Log:
  The TestCase I will add in a moment was failing because hashCode() was not being 
consistent with equals() as the contract for these two methods specifies. This is 
because equals() dependended on the className whereas hashCode did not.
  
  Revision  Changes    Path
  1.25      +2 -2      
avalon/framework/api/src/java/org/apache/avalon/framework/Enum.java
  
  Index: Enum.java
  ===================================================================
  RCS file: 
/home/cvs/avalon/framework/api/src/java/org/apache/avalon/framework/Enum.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- Enum.java 7 Apr 2003 08:31:15 -0000       1.24
  +++ Enum.java 11 Jan 2004 21:58:28 -0000      1.25
  @@ -180,7 +180,7 @@
        */
       public int hashCode()
       {
  -        return m_name.hashCode();
  +        return m_name.hashCode() ^ this.getClass().getName().hashCode();
       }
   
       /**
  
  
  

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

Reply via email to