db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ti...@apache.org
Subject svn commit: r1070190 - /db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/FormatableBitSet.java
Date Sun, 13 Feb 2011 07:08:56 GMT
Author: tiago
Date: Sun Feb 13 07:08:56 2011
New Revision: 1070190

URL: http://svn.apache.org/viewvc?rev=1070190&view=rev
Log:
DERBY-5022 : override equals correctly

Fix for the .equals() override

Patch contributed by Dave Brosius <dbrosius@apache.org>


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/FormatableBitSet.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/FormatableBitSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/FormatableBitSet.java?rev=1070190&r1=1070189&r2=1070190&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/FormatableBitSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/FormatableBitSet.java
Sun Feb 13 07:08:56 2011
@@ -373,14 +373,19 @@ public final class FormatableBitSet impl
 	 *
 	 * @return TRUE|FALSE
 	 */
-	public boolean equals(FormatableBitSet other)
+	public boolean equals(Object other)
 	{
-		if (this.getLength() != other.getLength())
-		{
-			return false;
-		}
+        if (other instanceof FormatableBitSet) 
+        {
+            FormatableBitSet that = (FormatableBitSet) other;
+		    if (this.getLength() != that.getLength())
+		    {
+			    return false;
+		    }
 
-		return (this.compare(other) == 0);
+		    return (this.compare(that) == 0);
+        }
+        return false;
 	}
 
 	/**



Mime
View raw message