* gnu/gcj/text/LocaleData_en.java (monetarySeparator): Added.
* java/sql/Date.java (serialVersionUID): New field.
* java/sql/Time.java (serialVersionUID): New field.
* java/sql/Timestamp.java (serialVersionUID): New field.
* java/text/ChoiceFormat.java (serialVersionUID): New field.
* java/text/DateFormat.java (getDateTimeInstance (int)): Removed.
* java/text/DateFormatSymbols.java (serialVersionUID): New field.
* java/text/DecimalFormat.java (serialVersionOnStream): New field.
(readObject): New serialization method.
* java/text/DecimalFormatSymbols.java (monetarySeparator): New field.
(serialVersionOnStream): New field.
(readObject): New serialization method.
(getMonetaryDecimalSeparator): New method.
(setMonetaryDecimalSeparator): New method.
* java/text/NumberFormat.java (maxFractionDigits): New field.
(maxIntegerDigits): New field.
(minFractionDigits): New field.
(minIntegerDigits): New field.
(serialVersionOnStream): New field.
(serialVersionUID): New field.
(readObject): New serialization method.
(writeObject): New serialization method.
* java/text/SimpleDateFormat.java (defaultCenturyStart): Initialized.
(serialVersionOnStream): New field.
(serialVersionUID): New field.
(readObject): New serialization method.
Serialization mods.
From-SVN: r36831
+2000-10-10 Warren Levy <warrenl@cygnus.com>
+
+ * gnu/gcj/text/LocaleData_en.java (monetarySeparator): Added.
+ * java/sql/Date.java (serialVersionUID): New field.
+ * java/sql/Time.java (serialVersionUID): New field.
+ * java/sql/Timestamp.java (serialVersionUID): New field.
+ * java/text/ChoiceFormat.java (serialVersionUID): New field.
+ * java/text/DateFormat.java (getDateTimeInstance (int)): Removed.
+ * java/text/DateFormatSymbols.java (serialVersionUID): New field.
+ * java/text/DecimalFormat.java (serialVersionOnStream): New field.
+ (readObject): New serialization method.
+ * java/text/DecimalFormatSymbols.java (monetarySeparator): New field.
+ (serialVersionOnStream): New field.
+ (readObject): New serialization method.
+ (getMonetaryDecimalSeparator): New method.
+ (setMonetaryDecimalSeparator): New method.
+ * java/text/NumberFormat.java (maxFractionDigits): New field.
+ (maxIntegerDigits): New field.
+ (minFractionDigits): New field.
+ (minIntegerDigits): New field.
+ (serialVersionOnStream): New field.
+ (serialVersionUID): New field.
+ (readObject): New serialization method.
+ (writeObject): New serialization method.
+ * java/text/SimpleDateFormat.java (defaultCenturyStart): Initialized.
+ (serialVersionOnStream): New field.
+ (serialVersionUID): New field.
+ (readObject): New serialization method.
+
2000-10-09 Alexandre Oliva <aoliva@redhat.com>
* configure.in (GCJ): Avoid bogus error message when looking for
// Generic English locale data for java.text.
-/* Copyright (C) 1999 Free Software Foundation
+/* Copyright (C) 1999, 2000 Free Software Foundation
This file is part of libgcj.
{ "groupingSeparator", "," },
{ "infinity", "\u221e" },
{ "minusSign", "-" },
+ { "monetarySeparator", "." },
{ "NaN", "\ufffd" },
{ "patternSeparator", ";" },
{ "percent", "%" },
/* Date.java -- Wrapper around java.util.Date
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU Classpath.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
-public class Date extends java.util.Date implements java.io.Serializable
+public class Date extends java.util.Date
{
/*
*/
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+/**
+ * This is the serialization UID for this class.
+ */
+private static final long serialVersionUID = 1511598038487230103L;
+
/*************************************************************************/
/*
/* Time.java -- Wrapper around java.util.Date
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU Classpath.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
-public class Time extends java.util.Date implements java.io.Serializable
+public class Time extends java.util.Date
{
/*
*/
private static SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
+/**
+ * This is the serialization UID for this class.
+ */
+private static final long serialVersionUID = 8397324403548013681L;
+
/*************************************************************************/
/*
/* Time.java -- Wrapper around java.util.Date
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU Classpath.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
-public class Timestamp extends java.util.Date implements java.io.Serializable
+public class Timestamp extends java.util.Date
{
/*
private static SimpleDateFormat format_sdf =
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+/**
+ * This is the serialization UID for this class.
+ */
+private static final long serialVersionUID = 3581463369166924961L;
+
/*************************************************************************/
/*
private static final int mantissaBits = 52;
// Number of exponent bits in a double.
private static final int exponentBits = 11;
+
+ private static final long serialVersionUID = 1795184449645032964L;
}
return getDateTimeInstance (DEFAULT, DEFAULT, Locale.getDefault());
}
- public static final DateFormat getDateTimeInstance (int style)
- {
- return getDateTimeInstance (style, style, Locale.getDefault());
- }
-
public static final DateFormat getDateTimeInstance (int dateStyle,
int timeStyle)
{
private String[] weekdays;
private String[][] zoneStrings;
+ private static final long serialVersionUID = -5987973545549424702L;
+
private static final String[] ampmsDefault = {"AM", "PM" };
private static final String[] erasDefault = {"BC", "AD" };
// localPatternCharsDefault is used by SimpleDateFormat.
// DecimalFormat.java - Localized number formatting.
-/* Copyright (C) 1999 Free Software Foundation
+/* Copyright (C) 1999, 2000 Free Software Foundation
This file is part of libgcj.
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
+import java.io.ObjectInputStream;
+import java.io.IOException;
/**
* @author Tom Tromey <tromey@cygnus.com>
*/
/* Written using "Java Class Libraries", 2nd edition, plus online
* API docs for JDK 1.2 from http://www.javasoft.com.
- * Status: Believed complete and correct to 1.2, except serialization.
+ * Status: Believed complete and correct to 1.2.
* Note however that the docs are very unclear about how format parsing
* should work. No doubt there are problems here.
*/
private String negativeSuffix;
private String positivePrefix;
private String positiveSuffix;
+ private int serialVersionOnStream = 1;
private DecimalFormatSymbols symbols;
private boolean useExponentialNotation;
+ private static final long serialVersionUID = 864413376551465018L;
+
+ private void readObject(ObjectInputStream stream)
+ throws IOException, ClassNotFoundException
+ {
+ stream.defaultReadObject();
+ if (serialVersionOnStream < 1)
+ {
+ useExponentialNotation = false;
+ serialVersionOnStream = 1;
+ }
+ }
// The locale-independent pattern symbols happen to be the same as
// the US symbols.
// DecimalFormatSymbols.java - Symbols used to format numbers.
-/* Copyright (C) 1999 Free Software Foundation
+/* Copyright (C) 1999, 2000 Free Software Foundation
This file is part of libgcj.
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
+import java.io.ObjectInputStream;
+import java.io.IOException;
/**
* @author Tom Tromey <tromey@cygnus.com>
*/
/* Written using "Java Class Libraries", 2nd edition, plus online
* API docs for JDK 1.2 from http://www.javasoft.com.
- * Status: Believed complete and correct to 1.2, except serialization.
+ * Status: Believed complete and correct to 1.2.
*/
public final class DecimalFormatSymbols implements Cloneable, Serializable
this.groupingSeparator = orig.groupingSeparator;
this.infinity = orig.infinity;
this.intlCurrencySymbol = orig.intlCurrencySymbol;
+ this.monetarySeparator = orig.monetarySeparator;
this.minusSign = orig.minusSign;
this.NaN = orig.NaN;
this.patternSeparator = orig.patternSeparator;
infinity = safeGetString (res, "infinity", "\u221e");
// FIXME: default?
intlCurrencySymbol = safeGetString (res, "intlCurrencySymbol", "$");
+ try
+ {
+ monetarySeparator = safeGetChar (res, "monetarySeparator", '.');
+ }
+ catch (MissingResourceException x)
+ {
+ monetarySeparator = decimalSeparator;
+ }
minusSign = safeGetChar (res, "minusSign", '-');
NaN = safeGetString (res, "NaN", "\ufffd");
patternSeparator = safeGetChar (res, "patternSeparator", ';');
&& infinity.equals(dfs.infinity)
&& intlCurrencySymbol.equals(dfs.intlCurrencySymbol)
&& minusSign == dfs.minusSign
+ && monetarySeparator == dfs.monetarySeparator
&& NaN.equals(dfs.NaN)
&& patternSeparator == dfs.patternSeparator
&& percent == dfs.percent
return minusSign;
}
+ public char getMonetaryDecimalSeparator ()
+ {
+ return monetarySeparator;
+ }
+
public String getNaN ()
{
return NaN;
this.minusSign = minusSign;
}
+ public void setMonetaryDecimalSeparator (char decimalSep)
+ {
+ monetarySeparator = decimalSep;
+ }
+
public void setNaN (String nan)
{
NaN = nan;
private String infinity;
private String intlCurrencySymbol;
private char minusSign;
+ private char monetarySeparator;
private String NaN;
private char patternSeparator;
private char percent;
private char perMill;
+ private int serialVersionOnStream = 1;
private char zeroDigit;
+ private static final long serialVersionUID = 5772796243397350300L;
+
+ private void readObject(ObjectInputStream stream)
+ throws IOException, ClassNotFoundException
+ {
+ stream.defaultReadObject();
+ if (serialVersionOnStream < 1)
+ {
+ monetarySeparator = decimalSeparator;
+ exponential = 'E';
+ serialVersionOnStream = 1;
+ }
+ }
}
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.MissingResourceException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.IOException;
/**
* @author Tom Tromey <tromey@cygnus.com>
*/
/* Written using "Java Class Libraries", 2nd edition, plus online
* API docs for JDK 1.2 from http://www.javasoft.com.
- * Status: Believed complete and correct to 1.2, except serialization
- * and getAvailableLocales.
+ * Status: Believed complete and correct to 1.2, except getAvailableLocales.
*/
public abstract class NumberFormat extends Format implements Cloneable
}
// These field names are fixed by the serialization spec.
- // FIXME: serialization spec also mentions `byte' versions of the
- // min/max fields. We have no use for those, so for now they are
- // omitted.
protected boolean groupingUsed;
protected int maximumFractionDigits;
+ private byte maxFractionDigits;
protected int maximumIntegerDigits;
+ private byte maxIntegerDigits;
protected int minimumFractionDigits;
+ private byte minFractionDigits;
protected int minimumIntegerDigits;
+ private byte minIntegerDigits;
protected boolean parseIntegerOnly;
+ private int serialVersionOnStream;
+ private static final long serialVersionUID = -2308460125733713944L;
+
+ private void readObject(ObjectInputStream stream)
+ throws IOException, ClassNotFoundException
+ {
+ stream.defaultReadObject();
+ if (serialVersionOnStream < 1)
+ {
+ maximumFractionDigits = maxFractionDigits;
+ maximumIntegerDigits = maxIntegerDigits;
+ minimumFractionDigits = minFractionDigits;
+ minimumIntegerDigits = minIntegerDigits;
+ serialVersionOnStream = 1;
+ }
+ }
+
+ private void writeObject(ObjectOutputStream stream) throws IOException
+ {
+ maxFractionDigits = maximumFractionDigits < Byte.MAX_VALUE ?
+ (byte) maximumFractionDigits : Byte.MAX_VALUE;
+ maxIntegerDigits = maximumIntegerDigits < Byte.MAX_VALUE ?
+ (byte) maximumIntegerDigits : Byte.MAX_VALUE;
+ minFractionDigits = minimumFractionDigits < Byte.MAX_VALUE ?
+ (byte) minimumFractionDigits : Byte.MAX_VALUE;
+ minIntegerDigits = minimumIntegerDigits < Byte.MAX_VALUE ?
+ (byte) minimumIntegerDigits : Byte.MAX_VALUE;
+ serialVersionOnStream = 1;
+ stream.defaultWriteObject();
+ }
}
package java.text;
import java.util.*;
+import java.io.ObjectInputStream;
+import java.io.IOException;
/**
* @author Per Bothner <bothner@cygnus.com>
*/
/* Written using "Java Class Libraries", 2nd edition, plus online
* API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: parse is not implemented.
+ * Status: Believed complete and correct to 1.2.
*/
public class SimpleDateFormat extends DateFormat
{
- private Date defaultCenturyStart;
+ // Serialization fields.
+ private Date defaultCenturyStart = new Date();
private DateFormatSymbols formatData;
private String pattern;
+ private int serialVersionOnStream = 1;
+ private static final long serialVersionUID = 4774881970558875024L;
+
+ // Serialization method.
+ private void readObject(ObjectInputStream stream)
+ throws IOException, ClassNotFoundException
+ {
+ stream.defaultReadObject();
+ if (serialVersionOnStream < 1)
+ {
+ defaultCenturyStart = new Date();
+ serialVersionOnStream = 1;
+ }
+ }
public SimpleDateFormat ()
{