< prev index next >

src/java.base/share/classes/java/text/MessageFormat.java

Print this page

        

@@ -347,10 +347,11 @@
  * @since 1.1
  */
 
 public class MessageFormat extends Format {
 
+    @java.io.Serial
     private static final long serialVersionUID = 6479157306784022952L;
 
     /**
      * Constructs a MessageFormat for the default
      * {@link java.util.Locale.Category#FORMAT FORMAT} locale and the

@@ -1151,10 +1152,11 @@
      * @since 1.4
      */
     public static class Field extends Format.Field {
 
         // Proclaim serial compatibility with 1.4 FCS
+        @java.io.Serial
         private static final long serialVersionUID = 7899943957617360810L;
 
         /**
          * Creates a Field with the specified name.
          *

@@ -1169,10 +1171,11 @@
          *
          * @throws InvalidObjectException if the constant could not be
          *         resolved.
          * @return resolved MessageFormat.Field constant
          */
+        @java.io.Serial
         protected Object readResolve() throws InvalidObjectException {
             if (this.getClass() != MessageFormat.Field.class) {
                 throw new InvalidObjectException("subclass didn't correctly implement readResolve");
             }
 

@@ -1599,10 +1602,11 @@
     /**
      * After reading an object from the input stream, do a simple verification
      * to maintain class invariants.
      * @throws InvalidObjectException if the objects read from the stream is invalid.
      */
+    @java.io.Serial
     private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
         in.defaultReadObject();
         boolean isValid = maxOffset >= -1
                 && formats.length > maxOffset
                 && offsets.length > maxOffset
< prev index next >