directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r1033231 - /directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddresses.java
Date Tue, 09 Nov 2010 21:11:33 GMT
Author: felixk
Date: Tue Nov  9 21:11:33 2010
New Revision: 1033231

URL: http://svn.apache.org/viewvc?rev=1033231&view=rev
Log:
Override super equals instead of creating custom equals method. Both (hashCode and equals)
should be overridden in case of.

Modified:
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddresses.java

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddresses.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddresses.java?rev=1033231&r1=1033230&r2=1033231&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddresses.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddresses.java
Tue Nov  9 21:11:33 2010
@@ -138,12 +138,15 @@ public class HostAddresses extends Abstr
      * @param that
      * @return true if two {@link HostAddresses} are equal.
      */
-    public boolean equals( HostAddresses that )
+    @Override
+    public boolean equals( Object obj )
     {
-        if( that == null ) {
+        if( obj == null || !( obj instanceof HostAddresses ) ) {
             return false;
         }
         
+        HostAddresses that = ( HostAddresses )obj;
+        
         if ( ( addresses == null && that.addresses != null )
             || ( addresses != null && that.addresses == null ) )
         {



Mime
View raw message