DecimalFormatSymbols.java (locale): New field.
authorGuilhem Lavaux <guilhem@kaffe.org>
Thu, 27 Nov 2003 09:49:22 +0000 (09:49 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Thu, 27 Nov 2003 09:49:22 +0000 (09:49 +0000)
2003-11-27  Guilhem Lavaux <guilhem@kaffe.org>

* java/text/DecimalFormatSymbols.java (locale): New field.
(DecimalFormatSymbols (Locale)): Set locale.
(serialVersionOnStream): Upgraded to number 2.
(readObject): Assign locale if it wasn't by the serializer.

From-SVN: r73987

libjava/ChangeLog
libjava/java/text/DecimalFormatSymbols.java

index 544f2c48ef414b2dd8cc7d9e6637372ba8fe75d7..fb7e8f7cd9db8e04c967e0a7372546a1f3b8ad4d 100644 (file)
@@ -1,3 +1,10 @@
+2003-11-27  Guilhem Lavaux <guilhem@kaffe.org>
+
+       * java/text/DecimalFormatSymbols.java (locale): New field.
+       (DecimalFormatSymbols (Locale)): Set locale.
+       (serialVersionOnStream): Upgraded to number 2.
+       (readObject): Assign locale if it wasn't by the serializer.
+
 2003-11-27  Guilhem Lavaux <guilhem@kaffe.org>
 
        * java/text/FormatCharacterIterator.java: Documented the class and
index 1cb8f4f17690c2300449f887a03723f75a9e10c2..268fe2cf987350158b31b973446b4d0ca086dfa7 100644 (file)
@@ -158,6 +158,7 @@ public final class DecimalFormatSymbols implements Cloneable, Serializable
     percent = safeGetChar (res, "percent", '%');
     perMill = safeGetChar (res, "perMill", '\u2030');
     zeroDigit = safeGetChar (res, "zeroDigit", '0');
+    locale = loc;
   }
 
   /**
@@ -580,13 +581,20 @@ public final class DecimalFormatSymbols implements Cloneable, Serializable
   /**
    * @serial This value represents the type of object being de-serialized.
    * 0 indicates a pre-Java 1.1.6 version, 1 indicates 1.1.6 or later.
-   */
-  private int serialVersionOnStream = 1;
+   * 0 indicates a pre-Java 1.1.6 version, 1 indicates 1.1.6 or later,
+   * 2 indicates 1.4 or later
+    */
+  private int serialVersionOnStream = 2;
   /**
    * @serial This is the character used to represent 0.
    */
   private char zeroDigit;
 
+  /**
+   * @serial The locale of these currency symbols.
+   */
+  private Locale locale;
   private static final long serialVersionUID = 5772796243397350300L;
 
   private void readObject(ObjectInputStream stream)
@@ -597,7 +605,10 @@ public final class DecimalFormatSymbols implements Cloneable, Serializable
       {
         monetarySeparator = decimalSeparator;
        exponential = 'E';
-       serialVersionOnStream = 1;
       }
+    if (serialVersionOnStream < 2)
+       locale = Locale.getDefault();
+
+    serialVersionOnStream = 2;
   }
 }