You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by sm...@apache.org on 2006/05/19 06:06:05 UTC

svn commit: r407701 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util: HashMap.java WeakHashMap.java

Author: smishura
Date: Thu May 18 21:06:05 2006
New Revision: 407701

URL: http://svn.apache.org/viewvc?rev=407701&view=rev
Log:
Update signatures to generics

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/HashMap.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/WeakHashMap.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/HashMap.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/HashMap.java?rev=407701&r1=407700&r2=407701&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/HashMap.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/HashMap.java Thu May 18 21:06:05 2006
@@ -471,9 +471,9 @@
      * @return the value of any previous mapping with the specified key or null
      *         if there was no mapping
      */
-    public Object put(Object key, Object value) {
+    public V put(K key, V value) {
         int index = getModuloHash(key);
-        Entry entry = findEntry(key, index);
+        Entry<K,V> entry = findEntry(key, index);
 
         if (entry == null) {
             modCount++;
@@ -484,7 +484,7 @@
             }
             entry = createEntry(key, index, null);
         }
-        Object result = entry.value;
+        V result = entry.value;
         entry.value = value;
         return result;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/WeakHashMap.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/WeakHashMap.java?rev=407701&r1=407700&r2=407701&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/WeakHashMap.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/WeakHashMap.java Thu May 18 21:06:05 2006
@@ -516,10 +516,10 @@
      * @return the value of any previous mapping with the specified key or null
      *         if there was no mapping
      */
-    public Object put(Object key, Object value) {
+    public V put(K key, V value) {
         poll();
         int index = 0;
-        Entry entry;
+        Entry<K,V> entry;
         if (key != null) {
             index = (key.hashCode() & 0x7FFFFFFF) % elementData.length;
             entry = elementData[index];
@@ -542,7 +542,7 @@
             elementData[index] = entry;
             return null;
         }
-        Object result = entry.value;
+        V result = entry.value;
         entry.value = value;
         return result;
     }