Title: [1287] trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaMethod.java: Optimize equals()
Revision
1287
Author
rfscholte
Date
2011-08-09 16:27:16 -0500 (Tue, 09 Aug 2011)

Log Message

Optimize equals()

Modified Paths


Diff

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaMethod.java (1286 => 1287)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaMethod.java	2011-08-04 22:15:58 UTC (rev 1286)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaMethod.java	2011-08-09 21:27:16 UTC (rev 1287)
@@ -162,23 +162,15 @@
 
         JavaMethod other = (JavaMethod) obj;
         //use 'this' from here to make it better readable
-        if ( other.getName() != null && !other.getName().equals( this.getName() ) )
+        if ( other.getName() != null ? !other.getName().equals( this.getName() ) :  this.getName() != null )
         {
             return false;
         }
-        if ( this.getName() != null && !this.getName().equals( other.getName() ) )
-        {
-            return false;
-        }
 
-        if ( other.getReturns() != null && !other.getReturns().equals( this.getReturns() ) )
+        if ( other.getReturnType() != null ? !other.getReturnType().equals( this.getReturns() ) : this.getReturns() != null )
         {
             return false;
         }
-        if ( this.getReturns() != null && !this.getReturns().equals( other.getReturns() ) )
-        {
-            return false;
-        }
 
         List<JavaParameter> thisParams = this.getParameters();
         List<JavaParameter> otherParams = other.getParameters();


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to