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(); }