[kaffe] CVS kaffe (dalibor): Resynced with GNU Classpath

Kaffe CVS cvs-commits at kaffe.org
Sat Jan 10 10:54:09 PST 2004


PatchSet 4305 
Date: 2004/01/10 18:29:28
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath

2004-01-09  Dalibor Topic <robilad at kaffe.org>

        Resynced with GNU Classpath.

        2004-01-04  Michael Koch  <konqueror at gmx.de>

        * java/util/HashMap.java (HashMap(Map)): As above.
        (putAllInternal): As above.
        * java/util/Hashtable.java (Hashtable(Map)): Use putAll, not
        putAllInternal.
        (putAllInternal): Correct comment.
        (internalContainsValue): Removed.
        (containsValue): Don't delegate to internalContainsValue.

Members: 
	ChangeLog:1.1892->1.1893 
	libraries/javalib/java/util/HashMap.java:1.19->1.20 
	libraries/javalib/java/util/Hashtable.java:1.31->1.32 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1892 kaffe/ChangeLog:1.1893
--- kaffe/ChangeLog:1.1892	Fri Jan  9 18:14:07 2004
+++ kaffe/ChangeLog	Sat Jan 10 18:29:28 2004
@@ -2,6 +2,20 @@
 
         Resynced with GNU Classpath.
 
+	2004-01-04  Michael Koch  <konqueror at gmx.de>
+
+        * java/util/HashMap.java (HashMap(Map)): As above.
+        (putAllInternal): As above.
+        * java/util/Hashtable.java (Hashtable(Map)): Use putAll, not
+        putAllInternal.
+        (putAllInternal): Correct comment.
+        (internalContainsValue): Removed.
+        (containsValue): Don't delegate to internalContainsValue.
+
+2004-01-09  Dalibor Topic <robilad at kaffe.org>
+
+        Resynced with GNU Classpath.
+
 	2004-01-06  Per Bothner  <per at bothner.com>
 
         * java/util/Date.java (parse):  Fix a number of problems.
Index: kaffe/libraries/javalib/java/util/HashMap.java
diff -u kaffe/libraries/javalib/java/util/HashMap.java:1.19 kaffe/libraries/javalib/java/util/HashMap.java:1.20
--- kaffe/libraries/javalib/java/util/HashMap.java:1.19	Sun Oct  5 17:06:58 2003
+++ kaffe/libraries/javalib/java/util/HashMap.java	Sat Jan 10 18:29:30 2004
@@ -223,7 +223,7 @@
   public HashMap(Map m)
   {
     this(Math.max(m.size() * 2, DEFAULT_CAPACITY), DEFAULT_LOAD_FACTOR);
-    putAllInternal(m);
+    putAll(m);
   }
 
   /**
@@ -699,9 +699,9 @@
   }
 
   /**
-   * A simplified, more efficient internal implementation of putAll(). The 
-   * Map constructor and clone() should not call putAll or put, in order to 
-   * be compatible with the JDK implementation with respect to subclasses.
+   * A simplified, more efficient internal implementation of putAll(). clone() 
+   * should not call putAll or put, in order to be compatible with the JDK 
+   * implementation with respect to subclasses.
    *
    * @param m the map to initialize this from
    */
Index: kaffe/libraries/javalib/java/util/Hashtable.java
diff -u kaffe/libraries/javalib/java/util/Hashtable.java:1.31 kaffe/libraries/javalib/java/util/Hashtable.java:1.32
--- kaffe/libraries/javalib/java/util/Hashtable.java:1.31	Fri Nov 28 16:15:18 2003
+++ kaffe/libraries/javalib/java/util/Hashtable.java	Sat Jan 10 18:29:30 2004
@@ -234,7 +234,7 @@
   public Hashtable(Map m)
   {
     this(Math.max(m.size() * 2, DEFAULT_CAPACITY), DEFAULT_LOAD_FACTOR);
-    putAllInternal(m);
+    putAll(m);
   }
 
   /**
@@ -333,11 +333,22 @@
    */
   public synchronized boolean contains(Object value)
   {
-    /* delegate to non-overridable worker method 
-     * to avoid blowing up the stack, when called 
-     * from overridden contains[Value]() method.
-     */
-    return internalContainsValue(value);
+    for (int i = buckets.length - 1; i >= 0; i--)
+      {
+        HashEntry e = buckets[i];
+        while (e != null)
+          {
+            if (value.equals(e.value))
+              return true;
+            e = e.next;
+          }
+      }
+
+    // Must throw on null argument even if the table is empty
+    if (value == null)
+      throw new NullPointerException();
+ 
+    return false;  
   }
 
   /**
@@ -354,44 +365,12 @@
    */
   public boolean containsValue(Object value)
   {
-    /* delegate to older method to make sure code overwriting it 
-     * continues to work.
-     */
+    // Delegate to older method to make sure code overriding it continues 
+    // to work.
     return contains(value);
   }
 
   /**
-   * Returns true if this Hashtable contains a value <code>o</code>, such that
-   * <code>o.equals(value)</code>. This is an internal worker method
-   * called by <code>contains()</code> and <code>containsValue()</code>.
-   *
-   * @param value the value to search for in this Hashtable
-   * @return true if at least one key maps to the value
-   * @see #contains(Object)
-   * @see #containsKey(Object)
-   * @throws NullPointerException if <code>value</code> is null
-   */
-  private boolean internalContainsValue(Object value)
-  {
-    for (int i = buckets.length - 1; i >= 0; i--)
-      {
-        HashEntry e = buckets[i];
-        while (e != null)
-          {
-            if (value.equals(e.value))
-              return true;
-            e = e.next;
-          }
-      }
-
-    // Must throw on null argument even if the table is empty
-    if (value == null)
-      throw new NullPointerException();
- 
-    return false;
-  }
-
-  /**
    * Returns true if the supplied object <code>equals()</code> a key
    * in this Hashtable.
    *
@@ -873,9 +852,9 @@
   }
 
   /**
-   * A simplified, more efficient internal implementation of putAll(). The 
-   * Map constructor and clone() should not call putAll or put, in order to 
-   * be compatible with the JDK implementation with respect to subclasses.
+   * A simplified, more efficient internal implementation of putAll(). clone() 
+   * should not call putAll or put, in order to be compatible with the JDK 
+   * implementation with respect to subclasses.
    *
    * @param m the map to initialize this from
    */




More information about the kaffe mailing list