directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r946353 - in /directory/shared/trunk/ldap/src: main/java/org/apache/directory/shared/ldap/message/ main/java/org/apache/directory/shared/ldap/message/extended/ main/java/org/apache/directory/shared/ldap/message/internal/ main/java/org/apach...
Date Wed, 19 May 2010 19:50:04 GMT
Author: felixk
Date: Wed May 19 19:50:03 2010
New Revision: 946353

URL: http://svn.apache.org/viewvc?rev=946353&view=rev
Log:
Override hashCode when overriding equals

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindResponseImpl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyRequestImpl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelResponse.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationResponse.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownResponse.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/LaunchDiagnosticUiResponse.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/NoticeOfDisconnect.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/internal/InternalAbstractResultResponse.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITStructureRule.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindResponseImplTest.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindResponseImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindResponseImpl.java?rev=946353&r1=946352&r2=946353&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindResponseImpl.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindResponseImpl.java
Wed May 19 19:50:03 2010
@@ -104,6 +104,20 @@ public class BindResponseImpl extends In
 
 
     /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int hashCode()
+    {
+        int hash = 37;
+        hash = hash * 17 + Arrays.hashCode( serverSaslCreds );
+        hash = hash * 17 + super.hashCode();
+
+        return hash;
+    }
+
+
+    /**
      * Checks to see if this BindResponse is equal to another BindResponse. The
      * implementation and lockable properties are not factored into the
      * evaluation of equality. Only the messageId, saslCredentials and the

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyRequestImpl.java?rev=946353&r1=946352&r2=946353&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyRequestImpl.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyRequestImpl.java
Wed May 19 19:50:03 2010
@@ -21,7 +21,6 @@ package org.apache.directory.shared.ldap
 
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelResponse.java?rev=946353&r1=946352&r2=946353&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelResponse.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelResponse.java
Wed May 19 19:50:03 2010
@@ -103,8 +103,23 @@ public class CancelResponse extends Exte
 
 
     /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int hashCode()
+    {
+        int hash = 37;
+        // Seems simple but look at the equals() method ...
+        hash = hash * 17 + getClass().getName().hashCode();
+
+        return hash;
+    }
+
+
+    /**
      * @see Object#equals(Object)
      */
+    @Override
     public boolean equals( Object obj )
     {
         if ( obj == this )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationResponse.java?rev=946353&r1=946352&r2=946353&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationResponse.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationResponse.java
Wed May 19 19:50:03 2010
@@ -123,6 +123,24 @@ public class CertGenerationResponse exte
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int hashCode()
+    {
+        int hash = 37;
+        // Seems simple but look at the equals() method ...
+        hash = hash * 17 + getClass().getName().hashCode();
+
+        return hash;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public boolean equals( Object obj )
     {
         if ( obj == this )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownResponse.java?rev=946353&r1=946352&r2=946353&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownResponse.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownResponse.java
Wed May 19 19:50:03 2010
@@ -127,6 +127,24 @@ public class GracefulShutdownResponse ex
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int hashCode()
+    {
+        int hash = 37;
+        // Seems simple but look at the equals() method ...
+        hash = hash * 17 + getClass().getName().hashCode();
+
+        return hash;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public boolean equals( Object obj )
     {
         if ( obj == this )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/LaunchDiagnosticUiResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/LaunchDiagnosticUiResponse.java?rev=946353&r1=946352&r2=946353&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/LaunchDiagnosticUiResponse.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/LaunchDiagnosticUiResponse.java
Wed May 19 19:50:03 2010
@@ -126,6 +126,24 @@ public class LaunchDiagnosticUiResponse 
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int hashCode()
+    {
+        int hash = 37;
+        // Seems simple but look at the equals() method ...
+        hash = hash * 17 + getClass().getName().hashCode();
+
+        return hash;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public boolean equals( Object obj )
     {
         if ( obj == this )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/NoticeOfDisconnect.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/NoticeOfDisconnect.java?rev=946353&r1=946352&r2=946353&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/NoticeOfDisconnect.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/NoticeOfDisconnect.java
Wed May 19 19:50:03 2010
@@ -196,6 +196,24 @@ public class NoticeOfDisconnect extends 
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int hashCode()
+    {
+        int hash = 37;
+        // Seems simple but look at the equals() method ...
+        hash = hash * 17 + getClass().getName().hashCode();
+
+        return hash;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public boolean equals( Object obj )
     {
         if ( obj == this )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/internal/InternalAbstractResultResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/internal/InternalAbstractResultResponse.java?rev=946353&r1=946352&r2=946353&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/internal/InternalAbstractResultResponse.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/internal/InternalAbstractResultResponse.java
Wed May 19 19:50:03 2010
@@ -71,6 +71,23 @@ public abstract class InternalAbstractRe
 
 
     /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int hashCode()
+    {
+        int hash = 37;
+        if ( getLdapResult() != null )
+        {
+            hash = hash * 17 + getLdapResult().hashCode();
+        }
+        hash = hash * 17 + super.hashCode();
+        
+        return hash;
+    }
+
+
+    /**
      * Checks to see if an object is equal to this AbstractResultResponse. First
      * the object is checked to see if it is this AbstractResultResponse
      * instance if so it returns true. Next it checks if the super method
@@ -82,6 +99,7 @@ public abstract class InternalAbstractRe
      *            the object to compare to this LdapResult containing response
      * @return true if they objects are equivalent false otherwise
      */
+    @Override
     public boolean equals( Object obj )
     {
         if ( obj == this )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java?rev=946353&r1=946352&r2=946353&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java
Wed May 19 19:50:03 2010
@@ -694,8 +694,24 @@ public class DITContentRule extends Abst
 
 
     /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int hashCode()
+    {
+        int hash = 37;
+        
+        // TODO: Fix me when equals() is implemented
+        hash = hash * 17 + getClass().getName().hashCode();
+
+        return hash;
+    }
+
+
+    /**
      * @see Object#equals(Object)
      */
+    @Override
     @SuppressWarnings("PMD.UnusedLocalVariable") // Remove me when the TODO is fixed 
     public boolean equals( Object o )
     {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITStructureRule.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITStructureRule.java?rev=946353&r1=946352&r2=946353&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITStructureRule.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITStructureRule.java
Wed May 19 19:50:03 2010
@@ -252,8 +252,24 @@ public class DITStructureRule extends Ab
 
 
     /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int hashCode()
+    {
+        int hash = 37;
+        
+        // TODO: Fix me when equals() is implemented
+        hash = hash * 17 + getClass().getName().hashCode();
+
+        return hash;
+    }
+
+
+    /**
      * @see Object#equals(Object)
      */
+    @Override
     @SuppressWarnings("PMD.UnusedLocalVariable") // Remove me when the TODO is fixed 
     public boolean equals( Object o )
     {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java?rev=946353&r1=946352&r2=946353&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java
Wed May 19 19:50:03 2010
@@ -285,8 +285,24 @@ public class LdapSyntax extends Abstract
 
 
     /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int hashCode()
+    {
+        int hash = 37;
+        hash = hash * 17 + ( isHumanReadable ? 0 : 1 );
+        hash = hash * 17 + syntaxChecker.getOid().hashCode(); 
+        hash = hash * 17 + super.hashCode();
+        
+        return hash;
+    }
+
+
+    /**
      * @see Object#equals()
      */
+    @Override
     public boolean equals( Object o )
     {
         if ( !super.equals( o ) )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.java?rev=946353&r1=946352&r2=946353&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.java
Wed May 19 19:50:03 2010
@@ -151,8 +151,29 @@ public abstract class LoadableSchemaObje
 
 
     /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int hashCode()
+    {
+        int hash = 37;
+        
+        // Add hashCodes from fields used in equals() 'Check the byteCode' TODO
+        // TODO
+        if ( fqcn != null )
+        {
+            hash = hash * 17 + fqcn.hashCode();
+        }
+        hash = hash * 17 + super.hashCode();
+        
+        return hash;
+    }
+
+
+    /**
      * @see Object#equals()
      */
+    @Override
     public boolean equals( Object o )
     {
         if ( !super.equals( o ) )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java?rev=946353&r1=946352&r2=946353&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java
Wed May 19 19:50:03 2010
@@ -424,8 +424,34 @@ public class MatchingRule extends Abstra
 
 
     /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int hashCode()
+    {
+        int hash = 37;
+        if ( ldapComparator != null )
+        {
+            hash = hash * 17 + ldapComparator.hashCode();
+        }
+        if ( normalizer != null )
+        {
+            hash = hash * 17 + normalizer.hashCode();
+        }
+        if ( ldapSyntaxOid != null )
+        {
+            hash = hash * 17 + ldapSyntaxOid.hashCode();
+        }
+        hash = hash * 17 + super.hashCode();
+        
+        return hash;
+    }
+
+
+    /**
      * @see Object#equals()
      */
+    @Override
     public boolean equals( Object o )
     {
         if ( !super.equals( o ) )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java?rev=946353&r1=946352&r2=946353&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java
Wed May 19 19:50:03 2010
@@ -280,8 +280,24 @@ public class MatchingRuleUse extends Abs
 
 
     /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int hashCode()
+    {
+        int hash = 37;
+        
+        // TODO complete when equals() is complete
+        hash = hash * 17 + super.hashCode();
+        
+        return hash;
+    }
+
+
+    /**
      * @see Object#equals(Object)
      */
+    @Override
     @SuppressWarnings("PMD.UnusedLocalVariable") // Remove me when the TODO is fixed 
     public boolean equals( Object o )
     {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java?rev=946353&r1=946352&r2=946353&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java
Wed May 19 19:50:03 2010
@@ -514,8 +514,24 @@ public class NameForm extends AbstractSc
 
 
     /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int hashCode()
+    {
+        int hash = 37;
+        
+        // TODO complete when equals() is complete
+        hash = hash * 17 + super.hashCode();
+        
+        return hash;
+    }
+
+
+    /**
      * @see Object#equals(Object)
      */
+    @Override
     @SuppressWarnings("PMD.UnusedLocalVariable") // Remove me when the TODO is fixed 
     public boolean equals( Object o )
     {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java?rev=946353&r1=946352&r2=946353&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
Wed May 19 19:50:03 2010
@@ -91,8 +91,23 @@ public abstract class Normalizer extends
 
 
     /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int hashCode()
+    {
+        int hash = 37;
+        hash = hash * 17 + super.hashCode();
+        hash = hash * 17 + getClass().getName().hashCode();
+        
+        return hash;
+    }
+
+
+    /**
      * @see Object#equals()
      */
+    @Override
     public boolean equals( Object o )
     {
         if ( !super.equals( o ) )

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindResponseImplTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindResponseImplTest.java?rev=946353&r1=946352&r2=946353&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindResponseImplTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindResponseImplTest.java
Wed May 19 19:50:03 2010
@@ -66,6 +66,29 @@ public class BindResponseImplTest
 
 
     /**
+     * Tests to make sure the same object has the same hashCode.
+     */
+    @Test
+    public void testHashCodeSameObj()
+    {
+        BindResponseImpl resp = new BindResponseImpl( 1 );
+        assertTrue( resp.hashCode() == resp.hashCode() );
+    }
+
+
+    /**
+     * Tests to make sure newly created objects with same id have the same hashCode.
+     */
+    @Test
+    public void testHashCodeNewWithSameId()
+    {
+        BindResponseImpl resp0 = new BindResponseImpl( 1 );
+        BindResponseImpl resp1 = new BindResponseImpl( 1 );
+        assertTrue( resp1.hashCode() == resp0.hashCode() );
+    }
+
+
+    /**
      * Tests to make sure newly created objects with same different id are not
      * equal.
      */
@@ -130,4 +153,40 @@ public class BindResponseImplTest
         assertTrue( "loaded carbon copies should be equal", resp0.equals( resp1 ) );
         assertTrue( "loaded carbon copies should be equal", resp1.equals( resp0 ) );
     }
+
+
+    /**
+     * Tests for equal hashCode of two fully loaded identical BindResponse PDUs.
+     */
+    @Test
+    public void testHashCodeWithTheWorks() throws LdapException
+    {
+        LdapResultImpl r0 = new LdapResultImpl();
+        LdapResultImpl r1 = new LdapResultImpl();
+
+        r0.setErrorMessage( "blah blah blah" );
+        r1.setErrorMessage( "blah blah blah" );
+
+        r0.setMatchedDn( new DN( "dc=example,dc=com" ) );
+        r1.setMatchedDn( new DN( "dc=example,dc=com" ) );
+
+        r0.setResultCode( ResultCodeEnum.TIME_LIMIT_EXCEEDED );
+        r1.setResultCode( ResultCodeEnum.TIME_LIMIT_EXCEEDED );
+
+        InternalReferral refs0 = new ReferralImpl();
+        refs0.addLdapUrl( "ldap://someserver.com" );
+        refs0.addLdapUrl( "ldap://anotherserver.org" );
+
+        InternalReferral refs1 = new ReferralImpl();
+        refs1.addLdapUrl( "ldap://someserver.com" );
+        refs1.addLdapUrl( "ldap://anotherserver.org" );
+
+        BindResponseImpl resp0 = new BindResponseImpl( 1 );
+        BindResponseImpl resp1 = new BindResponseImpl( 1 );
+
+        resp0.setServerSaslCreds( "password".getBytes() );
+        resp1.setServerSaslCreds( "password".getBytes() );
+
+        assertTrue( resp0.hashCode() == resp1.hashCode() );
+    }
 }



Mime
View raw message