click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r956493 - /click/trunk/click/framework/src/org/apache/click/util/SessionMap.java
Date Mon, 21 Jun 2010 08:41:43 GMT
Author: sabob
Date: Mon Jun 21 08:41:43 2010
New Revision: 956493

URL: http://svn.apache.org/viewvc?rev=956493&view=rev
Log:
added SessionMap hashcode impl

Modified:
    click/trunk/click/framework/src/org/apache/click/util/SessionMap.java

Modified: click/trunk/click/framework/src/org/apache/click/util/SessionMap.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/util/SessionMap.java?rev=956493&r1=956492&r2=956493&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/util/SessionMap.java (original)
+++ click/trunk/click/framework/src/org/apache/click/util/SessionMap.java Mon Jun 21 08:41:43
2010
@@ -209,9 +209,6 @@ public class SessionMap implements Map<S
     }
 
     /**
-     * This method is not supported and will throw
-     * <tt>UnsupportedOperationException</tt> if invoked.
-     *
      * @see java.util.Map#values()
      */
     public Collection<Object> values() {
@@ -252,9 +249,11 @@ public class SessionMap implements Map<S
             return Collections.emptySet();
         }
     }
-    
+
     static class Entry implements Map.Entry<String, Object> {
+
         final String key;
+
         Object value;
 
         /**
@@ -279,6 +278,9 @@ public class SessionMap implements Map<S
             return oldValue;
         }
 
+        /**
+         * @see java.lang.Object#equals(java.lang.Object)
+         */
         @Override
         public final boolean equals(Object o) {
             if (!(o instanceof Entry)) {
@@ -296,6 +298,20 @@ public class SessionMap implements Map<S
             }
             return false;
         }
+
+        /**
+         * @see java.lang.Object#hashCode()
+         */
+        @Override
+        public int hashCode() {
+            String k = getKey();
+            Object v = getValue();
+
+            int hash = 17;
+            hash = hash * 37 + (k == null ? 0 : k.hashCode());
+            hash = hash * 37 + (v == null ? 0 : v.hashCode());
+
+            return hash;
+        }
     }
 }
-



Mime
View raw message