]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
AbstractMap.java: Re-merged with Classpath.
authorTom Tromey <tromey@redhat.com>
Wed, 5 Sep 2001 00:14:15 +0000 (00:14 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Wed, 5 Sep 2001 00:14:15 +0000 (00:14 +0000)
* java/util/AbstractMap.java: Re-merged with Classpath.
* java/util/IdentityHashMap.java: Re-merged with Classpath.

From-SVN: r45391

libjava/ChangeLog
libjava/java/util/AbstractMap.java
libjava/java/util/IdentityHashMap.java

index 1a542aaa22f2b14ca350998949d0f57a5b8bfe8b..0a9400f0128074c4bc5042e6b549dca4c807eba6 100644 (file)
@@ -1,5 +1,8 @@
 2001-09-04  Tom Tromey  <tromey@redhat.com>
 
+       * java/util/AbstractMap.java: Re-merged with Classpath.
+       * java/util/IdentityHashMap.java: Re-merged with Classpath.
+
        * java/text/SimpleDateFormat.java: Re-merged with Classpath.
        * gnu/gcj/text/LocaleData.java, gnu/gcj/text/LocaleData_en.java,
        gnu/gcj/text/LocaleData_en_US.java: Removed.
index 7ce73053a08694f7b9663441e2254e4fc488b3f6..e28ce919beb8121d5c368b1f4bcb7325c16a4427 100644 (file)
@@ -47,6 +47,14 @@ public abstract class AbstractMap implements Map
     entrySet().clear();
   }
 
+  /**
+   * Create a shallow copy of this Map, no keys or values are copied.
+   */
+  protected Object clone () throws CloneNotSupportedException
+  {
+    return super.clone ();
+  }
+
   public boolean containsKey(Object key)
   {
     Object k;
index 5a1d76b2941a07e76ac3ade2c3160f5f76855190..c23f8ac3dd4b35e8d837ab8fd1181fecc35b3dd2 100644 (file)
@@ -83,11 +83,22 @@ public class IdentityHashMap extends AbstractMap
     size = 0;
   }
 
+  /**
+   * Creates a shallow copy where keys and values are not cloned.
+   */
   public Object clone ()
   {
-    IdentityHashMap copy = (IdentityHashMap) super.clone ();
-    copy.table = (Object[]) table.clone ();
-    return copy;
+    try 
+      {
+        IdentityHashMap copy = (IdentityHashMap) super.clone ();
+       copy.table = (Object[]) table.clone ();
+       return copy;
+      }
+    catch (CloneNotSupportedException e) 
+      {
+       // Can't happen.
+       return null;
+      }
   }
 
   public boolean containsKey (Object key)