diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-09-05 00:14:15 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-09-05 00:14:15 +0000 |
commit | b278167b14b47cf9d4dfa1e94a545fcc687ec9d2 (patch) | |
tree | b7dd4d926364b268113ef2244884dd0c479dce1b /libjava | |
parent | 539418d42a4b63ab64a51ab11e808de7edbd4589 (diff) | |
download | gcc-b278167b14b47cf9d4dfa1e94a545fcc687ec9d2.tar.gz |
* java/util/AbstractMap.java: Re-merged with Classpath.
* java/util/IdentityHashMap.java: Re-merged with Classpath.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45391 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 3 | ||||
-rw-r--r-- | libjava/java/util/AbstractMap.java | 8 | ||||
-rw-r--r-- | libjava/java/util/IdentityHashMap.java | 17 |
3 files changed, 25 insertions, 3 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 1a542aaa22f..0a9400f0128 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -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. diff --git a/libjava/java/util/AbstractMap.java b/libjava/java/util/AbstractMap.java index 7ce73053a08..e28ce919beb 100644 --- a/libjava/java/util/AbstractMap.java +++ b/libjava/java/util/AbstractMap.java @@ -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; diff --git a/libjava/java/util/IdentityHashMap.java b/libjava/java/util/IdentityHashMap.java index 5a1d76b2941..c23f8ac3dd4 100644 --- a/libjava/java/util/IdentityHashMap.java +++ b/libjava/java/util/IdentityHashMap.java @@ -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) |