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:
parent
dcbaa800c3
commit
a86f03720b
2 changed files with 8 additions and 3 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue