directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 37061 - incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message
Date Thu, 26 Aug 2004 06:29:40 GMT
Author: akarasulu
Date: Wed Aug 25 23:29:40 2004
New Revision: 37061

Modified:
   incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/AbstractResultResponse.java
   incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/BindResponseImpl.java
Log:
Commit changes ...

 o equals() override in AbstractResultResponse produced a NPE
 o added checks for null to AbstractResultResponse
 o old checks for null LdapResult in BindResponseImpl.equals() are not needed
 


Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/AbstractResultResponse.java
==============================================================================
--- incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/AbstractResultResponse.java
(original)
+++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/AbstractResultResponse.java
Wed Aug 25 23:29:40 2004
@@ -107,9 +107,23 @@
         }
 
         ResultResponse resp = ( ResultResponse ) obj;
-        if ( ! resp.getLdapResult().equals( result ) )
+
+        if ( getLdapResult() != null && resp.getLdapResult() == null )
         {
             return false;
+        }
+
+        if ( getLdapResult() == null && resp.getLdapResult() != null )
+        {
+            return false;
+        }
+
+        if ( getLdapResult() != null && resp.getLdapResult() != null )
+        {
+            if ( ! getLdapResult().equals( resp.getLdapResult() ) )
+            {
+                return false;
+            }
         }
 
         return true;

Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/BindResponseImpl.java
==============================================================================
--- incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/BindResponseImpl.java
(original)
+++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/BindResponseImpl.java
Wed Aug 25 23:29:40 2004
@@ -106,24 +106,6 @@
 
         BindResponse response = ( BindResponse ) obj;
 
-        if ( getLdapResult() != null && response.getLdapResult() == null )
-        {
-            return false;
-        }
-
-        if ( getLdapResult() == null && response.getLdapResult() != null )
-        {
-            return false;
-        }
-
-        if ( getLdapResult() != null && response.getLdapResult() != null )
-        {
-            if ( ! getLdapResult().equals( response.getLdapResult() ) )
-            {
-                return false;
-            }
-        }
-
         byte[] creds = response.getServerSaslCreds();
         if ( serverSaslCreds == null && creds != null )
         {

Mime
View raw message