aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorBryce McKinlay <mckinlay@redhat.com>2004-07-05 22:33:24 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>2004-07-05 23:33:24 +0100
commita86f03720b3e13269d3e1f1853df4239ef0ffef1 (patch)
treebbfcd116b53a2cbfc372d791a0a52f5c75cee3d0 /libjava
parentdcbaa800c3e9789c649c21c02f16faab79116dfc (diff)
downloadgcc-a86f03720b3e13269d3e1f1853df4239ef0ffef1.zip
gcc-a86f03720b3e13269d3e1f1853df4239ef0ffef1.tar.gz
gcc-a86f03720b3e13269d3e1f1853df4239ef0ffef1.tar.bz2
Locale.java (readObject): Intern strings read from object stream.
2004-07-05 Bryce McKinlay <mckinlay@redhat.com> * java/util/Locale.java (readObject): Intern strings read from object stream. From-SVN: r84137
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog5
-rw-r--r--libjava/java/util/Locale.java6
2 files changed, 8 insertions, 3 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 17c097b..1a3822d 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,8 @@
+2004-07-05 Bryce McKinlay <mckinlay@redhat.com>
+
+ * java/util/Locale.java (readObject): Intern strings read from object
+ stream.
+
2004-07-04 Michael Koch <konqueror@gmx.de>
* gnu/gcj/runtime/FirstThread.java,
diff --git a/libjava/java/util/Locale.java b/libjava/java/util/Locale.java
index ca6334c..4e88839 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();
}