ws-soap-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bill-s...@carpenter.ORG (WJCarpenter)
Subject MutableBoolean.equals() method?
Date Sun, 29 Feb 2004 19:29:00 GMT
Maybe not important, but I just stumbled across this. 

The utility class MutableBoolean has a method
"equals(MuteableBoolean)".  (I couldn't find any calls to that method
in the current CVS code.)  I wonder if that method was intended to
override Object.equals rather than overload it with a new signature?
If so, it should be "equals(Object)" and there should also probably be
an override of hashCode().

As the method doesn't seem to be called anywhere, and as the class
doesn't look like it's intended to be used outside Apache SOAP, I'd
suggest just getting rid of it.  Messing with "equals()" is a common
source of confusion and bugs.  Not that it's needed, but trivial patch
below .sig.
-- 
bill@carpenter.ORG (WJCarpenter)    PGP 0x91865119
38 95 1B 69 C9 C6 3D 25    73 46 32 04 69 D6 ED F3


Index: MutableBoolean.java
===================================================================
retrieving revision 1.1
diff -u -r1.1 MutableBoolean.java
--- MutableBoolean.java	4 Oct 2002 19:50:19 -0000	1.1
+++ MutableBoolean.java	29 Feb 2004 19:26:23 -0000
@@ -77,10 +77,6 @@
         this.value = value;
     }
 
-    public boolean equals(MutableBoolean mb) {
-        return this.value == mb.value;
-    }
-
     public String toString() {
         return value ? "true" : "false";
     }


Mime
View raw message