myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grantsm...@apache.org
Subject svn commit: r169233 - in /myfaces/trunk/src/jsfapi/javax/faces/validator: DoubleRangeValidator.java LengthValidator.java LongRangeValidator.java
Date Mon, 09 May 2005 04:50:20 GMT
Author: grantsmith
Date: Sun May  8 21:50:20 2005
New Revision: 169233

URL: http://svn.apache.org/viewcvs?rev=169233&view=rev
Log:
Validators overide equals(), but not hashcode(). Added hashcode() override to prevent problems
adding validators to Collections.


Modified:
    myfaces/trunk/src/jsfapi/javax/faces/validator/DoubleRangeValidator.java
    myfaces/trunk/src/jsfapi/javax/faces/validator/LengthValidator.java
    myfaces/trunk/src/jsfapi/javax/faces/validator/LongRangeValidator.java

Modified: myfaces/trunk/src/jsfapi/javax/faces/validator/DoubleRangeValidator.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/jsfapi/javax/faces/validator/DoubleRangeValidator.java?rev=169233&r1=169232&r2=169233&view=diff
==============================================================================
--- myfaces/trunk/src/jsfapi/javax/faces/validator/DoubleRangeValidator.java (original)
+++ myfaces/trunk/src/jsfapi/javax/faces/validator/DoubleRangeValidator.java Sun May  8 21:50:20
2005
@@ -173,7 +173,7 @@
     {
         _transient = transientValue;
     }
-
+ 
     // MISC
     public boolean equals(Object o)
     {
@@ -187,5 +187,14 @@
 
         return true;
     }
+
+    public int hashCode() {
+         int result;
+         result = (_minimum != null ? _minimum.hashCode() : 0);
+         result = 29 * result + (_maximum != null ? _maximum.hashCode() : 0);
+         result = 29 * result + (_transient ? 1 : 0);
+         return result;
+     }
+
 
 }

Modified: myfaces/trunk/src/jsfapi/javax/faces/validator/LengthValidator.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/jsfapi/javax/faces/validator/LengthValidator.java?rev=169233&r1=169232&r2=169233&view=diff
==============================================================================
--- myfaces/trunk/src/jsfapi/javax/faces/validator/LengthValidator.java (original)
+++ myfaces/trunk/src/jsfapi/javax/faces/validator/LengthValidator.java Sun May  8 21:50:20
2005
@@ -157,4 +157,12 @@
 
         return true;
     }
+
+    public int hashCode() {
+        int result;
+        result = (_minimum != null ? _minimum.hashCode() : 0);
+        result = 29 * result + (_maximum != null ? _maximum.hashCode() : 0);
+        result = 29 * result + (_transient ? 1 : 0);
+        return result;
+    }
 }

Modified: myfaces/trunk/src/jsfapi/javax/faces/validator/LongRangeValidator.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/src/jsfapi/javax/faces/validator/LongRangeValidator.java?rev=169233&r1=169232&r2=169233&view=diff
==============================================================================
--- myfaces/trunk/src/jsfapi/javax/faces/validator/LongRangeValidator.java (original)
+++ myfaces/trunk/src/jsfapi/javax/faces/validator/LongRangeValidator.java Sun May  8 21:50:20
2005
@@ -187,4 +187,12 @@
         return true;
     }
 
+    public int hashCode() {
+        int result;
+        result = (_minimum != null ? _minimum.hashCode() : 0);
+        result = 29 * result + (_maximum != null ? _maximum.hashCode() : 0);
+        result = 29 * result + (_transient ? 1 : 0);
+        return result;
+    }
+
 }



Mime
View raw message