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
This commit is contained in:
Bryce McKinlay 2004-07-05 22:33:24 +00:00 committed by Bryce McKinlay
parent dcbaa800c3
commit a86f03720b
2 changed files with 8 additions and 3 deletions

View File

@ -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,

View File

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