< prev index next >

src/java.base/share/classes/java/time/temporal/WeekFields.java

Print this page

        

@@ -240,10 +240,11 @@
     public static final TemporalUnit WEEK_BASED_YEARS = IsoFields.WEEK_BASED_YEARS;
 
     /**
      * Serialization version.
      */
+    @java.io.Serial
     private static final long serialVersionUID = -1177360819670808121L;
 
     /**
      * The first day-of-week.
      */

@@ -360,10 +361,11 @@
      * @param s the stream to read
      * @throws InvalidObjectException if the serialized object has an invalid
      *     value for firstDayOfWeek or minimalDays.
      * @throws ClassNotFoundException if a class cannot be resolved
      */
+    @java.io.Serial
     private void readObject(ObjectInputStream s)
          throws IOException, ClassNotFoundException, InvalidObjectException
     {
         s.defaultReadObject();
         if (firstDayOfWeek == null) {

@@ -380,10 +382,11 @@
      * {@code firstDayOfWeek} and {@code minimalDays}.
      * @return the singleton WeekFields for the firstDayOfWeek and minimalDays.
      * @throws InvalidObjectException if the serialized object has invalid
      *     values for firstDayOfWeek or minimalDays.
      */
+    @java.io.Serial
     private Object readResolve() throws InvalidObjectException {
         try {
             return WeekFields.of(firstDayOfWeek, minimalDays);
         } catch (IllegalArgumentException iae) {
             throw new InvalidObjectException("Invalid serialized WeekFields: " + iae.getMessage());
< prev index next >