Merged gcj-eclipse branch to trunk.

From-SVN: r120621
This commit is contained in:
Tom Tromey 2007-01-09 19:58:05 +00:00
parent c648dedbde
commit 97b8365caf
17478 changed files with 606493 additions and 100744 deletions

View file

@ -1,5 +1,5 @@
/* Locale.java -- i18n locales
Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2001, 2002, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@ -192,7 +192,7 @@ public final class Locale implements Serializable, Cloneable
*
* @serial should be -1 in serial streams
*/
private transient int hashcode;
private int hashcode;
/**
* Array storing all available locales.
@ -917,8 +917,8 @@ public final class Locale implements Serializable, Cloneable
return false;
Locale l = (Locale) obj;
return (language == l.language
&& country == l.country
return (language == l.language
&& country == l.country
&& variant == l.variant);
}
@ -935,11 +935,9 @@ public final class Locale implements Serializable, Cloneable
private void writeObject(ObjectOutputStream s)
throws IOException
{
s.writeObject(language);
s.writeObject(country);
s.writeObject(variant);
// Hashcode field is always written as -1.
s.writeInt(-1);
ObjectOutputStream.PutField fields = s.putFields();
fields.put("hashcode", -1);
s.defaultWriteObject();
}
/**
@ -953,10 +951,10 @@ public final class Locale implements Serializable, Cloneable
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException
{
language = ((String) s.readObject()).intern();
country = ((String) s.readObject()).intern();
variant = ((String) s.readObject()).intern();
// Recompute hashcode.
s.defaultReadObject();
language = language.intern();
country = country.intern();
variant = variant.intern();
hashcode = language.hashCode() ^ country.hashCode() ^ variant.hashCode();
}
} // class Locale