mcconnell    2003/07/12 05:40:49

  Modified:    framework/src/impl/org/apache/avalon/framework/configuration
                        DefaultConfiguration.java
  Log:
  Add hashCode() implementation on DefaultConfiguration.
  
  Revision  Changes    Path
  1.34      +20 -1     
avalon/framework/src/impl/org/apache/avalon/framework/configuration/DefaultConfiguration.java
  
  Index: DefaultConfiguration.java
  ===================================================================
  RCS file: 
/home/cvs/avalon/framework/src/impl/org/apache/avalon/framework/configuration/DefaultConfiguration.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- DefaultConfiguration.java 12 Jul 2003 08:56:26 -0000      1.33
  +++ DefaultConfiguration.java 12 Jul 2003 12:40:49 -0000      1.34
  @@ -545,4 +545,23 @@
           if( !( other instanceof Configuration ) ) return false;
           return ConfigurationUtil.equals( this, (Configuration) other );
       }
  +
  +    public int hashCode()
  +    {
  +        int hash = m_prefix.hashCode();
  +        if( m_name != null ) hash ^= m_name.hashCode();
  +        hash >>>= 7;
  +        if( m_location != null ) hash ^= m_location.hashCode();
  +        hash >>>= 7;
  +        if( m_namespace != null ) hash ^= m_namespace.hashCode();
  +        hash >>>= 7;
  +        if( m_attributes != null ) hash ^= m_attributes.hashCode();
  +        hash >>>= 7;
  +        if( m_children != null ) hash ^= m_children.hashCode();
  +        hash >>>= 7;
  +        if( m_value != null ) hash ^= m_value.hashCode();
  +        hash >>>= 7;
  +        hash ^= ( m_readOnly ) ? 1 : 3;
  +        return hash;
  +    }
   }
  
  
  

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

Reply via email to