ICU-4529 serializable classes need serialization uids

X-SVN-Rev: 17783
This commit is contained in:
Doug Felt 2005-06-02 22:41:51 +00:00
parent e1f00a55d8
commit 9be1e50694
22 changed files with 50 additions and 18 deletions

View file

@ -219,7 +219,7 @@ public class DateFormatSymbols implements Serializable, Cloneable {
String localPatternChars = null;
/* use serialVersionUID from JDK 1.1.4 for interoperability */
static final long serialVersionUID = -5987973545549424702L;
private static final long serialVersionUID = -5987973545549424702L;
/**
* Gets era strings. For example: "AD" and "BC".

View file

@ -4360,7 +4360,7 @@ public class DecimalFormat extends NumberFormat {
static final int MAX_SCIENTIFIC_INTEGER_DIGITS = 8;
// Proclaim JDK 1.1 serial compatibility.
static final long serialVersionUID = 864413376551465018L;
private static final long serialVersionUID = 864413376551465018L;
/**
* Cache to hold the NumberPattern of a Locale.

View file

@ -830,7 +830,7 @@ final public class DecimalFormatSymbols implements Cloneable, Serializable {
private ULocale ulocale;
// Proclaim JDK 1.1 FCS compatibility
static final long serialVersionUID = 5772796243397350300L;
private static final long serialVersionUID = 5772796243397350300L;
// The internal serial version which says which version was written
// - 0 (default) for version up to JDK 1.1.5

View file

@ -25,6 +25,7 @@ import com.ibm.icu.util.ULocale;
* @deprecated This is a draft API and might change in a future release of ICU.
*/
public abstract class MeasureFormat extends UFormat {
// no serialVersionUID, can't instantiate
/**
* @internal

View file

@ -1471,7 +1471,7 @@ public abstract class NumberFormat extends UFormat {
// Removed "implements Cloneable" clause. Needs to update serialization
// ID for backward compatibility.
static final long serialVersionUID = -2308460125733713944L;
private static final long serialVersionUID = -2308460125733713944L;
/**
* Empty constructor. Public for compatibily with JDK which lets the

View file

@ -518,17 +518,18 @@ public class RuleBasedNumberFormat extends NumberFormat {
/**
* The formatter's rule sets.
*/
private NFRuleSet[] ruleSets = null;
private transient NFRuleSet[] ruleSets = null;
/**
* A pointer to the formatter's default rule set. This is always included
* in ruleSets.
*/
private NFRuleSet defaultRuleSet = null;
private transient NFRuleSet defaultRuleSet = null;
/**
* The formatter's locale. This is used to create DecimalFormatSymbols and
* Collator objects.
* @serial
*/
private ULocale locale = null;
@ -537,17 +538,18 @@ public class RuleBasedNumberFormat extends NumberFormat {
* the collator is actually created the first time the client does a parse
* with lenient-parse mode turned on.
*/
private Collator collator = null;
private transient Collator collator = null;
/**
* The DecimalFormatSymbols object that any DecimalFormat objects this
* formatter uses should use. This variable is lazy-evaluated: it isn't
* filled in if the rule set never uses a DecimalFormat pattern.
*/
private DecimalFormatSymbols decimalFormatSymbols = null;
private transient DecimalFormatSymbols decimalFormatSymbols = null;
/**
* Flag specifying whether lenient parse mode is on or off. Off by default.
* @serial
*/
private boolean lenientParse = false;
@ -555,26 +557,28 @@ public class RuleBasedNumberFormat extends NumberFormat {
* If the description specifies lenient-parse rules, they're stored here until
* the collator is created.
*/
private String lenientParseRules;
private transient String lenientParseRules;
/**
* If the description specifies post-process rules, they're stored here until
* post-processing is required.
*/
private String postProcessRules;
private transient String postProcessRules;
/**
* Post processor lazily constructed from the postProcessRules.
*/
private RBNFPostProcessor postProcessor;
private transient RBNFPostProcessor postProcessor;
/**
* Localizations for rule set names.
* @serial
*/
private Map ruleSetDisplayNames;
/**
* The public rule set names;
* @serial
*/
private String[] publicRuleSetNames;

View file

@ -206,7 +206,7 @@ public class SimpleDateFormat extends DateFormat {
// the official serial version ID which says cryptically
// which version we're compatible with
static final long serialVersionUID = 4774881970558875024L;
private static final long serialVersionUID = 4774881970558875024L;
// the internal serial version which says which version was written
// - 0 (default) for version up to JDK 1.1.3

View file

@ -21,6 +21,8 @@ import com.ibm.icu.util.ULocale;
* @deprecated This is a draft API and might change in a future release of ICU.
*/
public abstract class UFormat extends Format {
// jdk1.4.2 serialver
private static final long serialVersionUID = -4964390515840164416L;
/**
* @draft ICU 2.8

View file

@ -37,7 +37,8 @@ import java.util.Locale;
* @deprecated This is a draft API and might change in a future release of ICU.
*/
public class BuddhistCalendar extends GregorianCalendar {
// jdk1.4.2 serialver
private static final long serialVersionUID = 2583005278132380631L;
private static String copyright = "Copyright \u00a9 1998 IBM Corp. All Rights Reserved.";
//-------------------------------------------------------------------------

View file

@ -14,6 +14,8 @@ import java.util.Locale;
* @internal
*/
class CECalendar extends Calendar {
// jdk1.4.2 serialver
private static final long serialVersionUID = -999547623066414271L;
private static final int LIMITS[][] = {
// Minimum Greatest Least Maximum

View file

@ -1465,6 +1465,10 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable {
// Proclaim serialization compatibility with JDK 1.1
// static final long serialVersionUID = -1807547505821590642L;
// haven't been compatible for awhile, no longer try
// jdk1.4.2 serialver
private static final long serialVersionUID = 6222646104888790989L;
/**
* Bitmask for internalSet() defining which fields may legally be set
@ -3068,6 +3072,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable {
}
result = cal.handleGetDateFormat(pattern, loc);
} catch (MissingResourceException e) {
// !!! need dateformat subclass appropriate to calendar type here!
// No custom patterns
result = DateFormat.getDateTimeInstance(dateStyle, timeStyle, loc);

View file

@ -77,6 +77,8 @@ import java.util.Locale;
* @deprecated This is a draft API and might change in a future release of ICU.
*/
public class ChineseCalendar extends Calendar {
// jdk1.4.2 serialver
private static final long serialVersionUID = 7312110751940929420L;'
//------------------------------------------------------------------
// Developer Notes

View file

@ -11,6 +11,9 @@ import java.util.Locale;
public final class CopticCalendar extends CECalendar
{
// jdk1.4.2 serialver
private static final long serialVersionUID = 5903818751846742911L;
/**
* Constant for \u03c9\u03bf\u03b3\u03c4/\u062a\ufeee\ufe97,
* the 1st month of the Coptic year.

View file

@ -37,7 +37,7 @@ import com.ibm.icu.impl.LocaleUtility;
*/
public class Currency extends MeasureUnit implements Serializable {
// using serialver from jdk1.4.2_05
static final long serialVersionUID = -5839973855554750484L;
private static final long serialVersionUID = -5839973855554750484L;
/**
* ISO 4217 3-letter code.

View file

@ -11,6 +11,9 @@ import java.util.Locale;
public final class EthiopicCalendar extends CECalendar
{
//jdk1.4.2 serialver
private static final long serialVersionUID = -2438495771339315608L;
/**
* Constant for \u1218\u1235\u12a8\u1228\u121d, the 1st month of the Ethiopic year.
*/

View file

@ -165,6 +165,9 @@ import java.util.Locale;
* @stable ICU 2.0
*/
public class GregorianCalendar extends Calendar {
// jdk1.4.2 serialver
private static final long serialVersionUID = 9199388694351062137L;
/*
* Implementation Notes
*

View file

@ -67,6 +67,8 @@ import java.util.Locale;
* @deprecated This is a draft API and might change in a future release of ICU.
*/
public class HebrewCalendar extends Calendar {
// jdk1.4.2 serialver
private static final long serialVersionUID = -1952524560588825816L;
private static String copyright = "Copyright \u00a9 1997-1998 IBM Corp. All Rights Reserved.";

View file

@ -72,6 +72,8 @@ import java.util.Locale;
* @deprecated This is a draft API and might change in a future release of ICU.
*/
public class IslamicCalendar extends Calendar {
// jdk1.4.2 serialver
private static final long serialVersionUID = -6253365474073869325L;
private static String copyright = "Copyright \u00a9 1997-1998 IBM Corp. All Rights Reserved.";

View file

@ -44,7 +44,9 @@ import java.util.Locale;
* @deprecated This is a draft API and might change in a future release of ICU.
*/
public class JapaneseCalendar extends GregorianCalendar {
// jdk1.4.2 serialver
private static final long serialVersionUID = -2977189902603704691L;
private static String copyright = "Copyright \u00a9 1998 IBM Corp. All Rights Reserved.";
//-------------------------------------------------------------------------

View file

@ -11,7 +11,7 @@ import java.io.Serializable;
* @internal
*/
final class STZInfo implements Serializable {
static final long serialVersionUID = -7849612037842370168L;
private static final long serialVersionUID = -7849612037842370168L;
void setStart(int sm, int sdwm, int sdw, int st, int sdm, boolean sa) {
this.sm = sm;

View file

@ -71,7 +71,7 @@ import com.ibm.icu.text.SimpleDateFormat;
*/
abstract public class TimeZone implements Serializable, Cloneable {
// using serialver from jdk1.4.2_05
static final long serialVersionUID = -744942128318337471L;
private static final long serialVersionUID = -744942128318337471L;
/**
* Default constructor. (For invocation by subclass constructors,

View file

@ -85,7 +85,7 @@ import com.ibm.icu.impl.ICUResourceBundle;
*/
public final class ULocale implements Serializable {
// using serialver from jdk1.4.2_05
static final long serialVersionUID = 3715177670352309217L;
private static final long serialVersionUID = 3715177670352309217L;
/**
* Useful constant for language.