From a86f03720b3e13269d3e1f1853df4239ef0ffef1 Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Mon, 5 Jul 2004 22:33:24 +0000 Subject: [PATCH] Locale.java (readObject): Intern strings read from object stream. 2004-07-05 Bryce McKinlay * java/util/Locale.java (readObject): Intern strings read from object stream. From-SVN: r84137 --- libjava/ChangeLog | 5 +++++ libjava/java/util/Locale.java | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 17c097b307f..1a3822d1d51 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2004-07-05 Bryce McKinlay + + * java/util/Locale.java (readObject): Intern strings read from object + stream. + 2004-07-04 Michael Koch * gnu/gcj/runtime/FirstThread.java, diff --git a/libjava/java/util/Locale.java b/libjava/java/util/Locale.java index ca6334cb334..4e8883994ed 100644 --- a/libjava/java/util/Locale.java +++ b/libjava/java/util/Locale.java @@ -765,9 +765,9 @@ public final class Locale implements Serializable, Cloneable private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { - language = (String) s.readObject(); - country = (String) s.readObject(); - variant = (String) s.readObject(); + language = ((String) s.readObject()).intern(); + country = ((String) s.readObject()).intern(); + variant = ((String) s.readObject()).intern(); // Recompute hashcode. hashcode = language.hashCode() ^ country.hashCode() ^ variant.hashCode(); } -- 2.30.2