This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: FYI: re-merge java.util


This re-merges two out-of-sync classes from java.util.
One such class remains, but re-synching it is currently difficult.
I'm checking this in.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* java/util/AbstractMap.java: Re-merged with Classpath.
	* java/util/IdentityHashMap.java: Re-merged with Classpath.

Index: java/util/AbstractMap.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/util/AbstractMap.java,v
retrieving revision 1.3
diff -u -r1.3 AbstractMap.java
--- java/util/AbstractMap.java 2000/12/11 03:47:47 1.3
+++ java/util/AbstractMap.java 2001/09/05 00:09:14
@@ -47,6 +47,14 @@
     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: java/util/IdentityHashMap.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/util/IdentityHashMap.java,v
retrieving revision 1.2
diff -u -r1.2 IdentityHashMap.java
--- java/util/IdentityHashMap.java 2001/08/21 14:24:48 1.2
+++ java/util/IdentityHashMap.java 2001/09/05 00:09:14
@@ -83,11 +83,21 @@
     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 ();
+      }
+    catch (CloneNotSupportedException e) 
+      {
+	// Can't happen.
+	return null;
+      }
   }
 
   public boolean containsKey (Object key)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]