directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r581277 - /directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/common/AbstractValue.java
Date Tue, 02 Oct 2007 15:21:25 GMT
Author: elecharny
Date: Tue Oct  2 08:21:24 2007
New Revision: 581277

URL: http://svn.apache.org/viewvc?rev=581277&view=rev
Log:
- Removed a useless tests (when inside this method, we don't have to check that the obj is
an instance of Value, as we will compare its class with this)
- Refactored the code for better readability (ternary operators are not cool, nor is a list
of OR tests )

Modified:
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/common/AbstractValue.java

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/common/AbstractValue.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/common/AbstractValue.java?rev=581277&r1=581276&r2=581277&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/common/AbstractValue.java
(original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/common/AbstractValue.java
Tue Oct  2 08:21:24 2007
@@ -133,6 +133,17 @@
      */
     public boolean equals( Object obj )
     {
-        return obj == this || !( ( obj == null ) || !( obj instanceof Value ) ) &&
obj.getClass() == this.getClass();
+        if ( obj == this )
+        {
+            return true;
+        }
+
+        if ( obj == null )
+        {
+            return false;
+        }
+
+        // At the end, both classes should be equal
+        return ( obj.getClass() == this.getClass() );
     }
 }



Mime
View raw message