This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: real java.util merge patch
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Subject: Patch: real java.util merge patch
- From: Tom Tromey <tromey at redhat dot com>
- Date: 04 Sep 2001 18:23:22 -0600
- Reply-To: tromey at redhat dot com
I accidentally sent the wrong version of my java.util merge patch.
Here's the right one.
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:11:47
@@ -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:11:48
@@ -83,11 +83,22 @@
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)