src/java.base/share/classes/java/time/ZoneId.java
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 54206 003cc64366da
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
   252         entry("HST", "-10:00")
   252         entry("HST", "-10:00")
   253     );
   253     );
   254     /**
   254     /**
   255      * Serialization version.
   255      * Serialization version.
   256      */
   256      */
       
   257     @java.io.Serial
   257     private static final long serialVersionUID = 8352817235686L;
   258     private static final long serialVersionUID = 8352817235686L;
   258 
   259 
   259     //-----------------------------------------------------------------------
   260     //-----------------------------------------------------------------------
   260     /**
   261     /**
   261      * Gets the system default time-zone.
   262      * Gets the system default time-zone.
   336      *  The result will be a {@code ZoneId} with the specified UTC/GMT/UT prefix
   337      *  The result will be a {@code ZoneId} with the specified UTC/GMT/UT prefix
   337      *  and the normalized offset ID as per {@link ZoneOffset#getId()}.
   338      *  and the normalized offset ID as per {@link ZoneOffset#getId()}.
   338      *  The rules of the returned {@code ZoneId} will be equivalent to the
   339      *  The rules of the returned {@code ZoneId} will be equivalent to the
   339      *  parsed {@code ZoneOffset}.
   340      *  parsed {@code ZoneOffset}.
   340      * <li>All other IDs are parsed as region-based zone IDs. Region IDs must
   341      * <li>All other IDs are parsed as region-based zone IDs. Region IDs must
   341      *  match the regular expression <code>[A-Za-z][A-Za-z0-9~/._+-]+</code>
   342      *  match the regular expression {@code [A-Za-z][A-Za-z0-9~/._+-]+}
   342      *  otherwise a {@code DateTimeException} is thrown. If the zone ID is not
   343      *  otherwise a {@code DateTimeException} is thrown. If the zone ID is not
   343      *  in the configured set of IDs, {@code ZoneRulesException} is thrown.
   344      *  in the configured set of IDs, {@code ZoneRulesException} is thrown.
   344      *  The detailed format of the region ID depends on the group supplying the data.
   345      *  The detailed format of the region ID depends on the group supplying the data.
   345      *  The default set of data is supplied by the IANA Time Zone Database (TZDB).
   346      *  The default set of data is supplied by the IANA Time Zone Database (TZDB).
   346      *  This has region IDs of the form '{area}/{city}', such as 'Europe/Paris' or 'America/New_York'.
   347      *  This has region IDs of the form '{area}/{city}', such as 'Europe/Paris' or 'America/New_York'.
   622      * Defend against malicious streams.
   623      * Defend against malicious streams.
   623      *
   624      *
   624      * @param s the stream to read
   625      * @param s the stream to read
   625      * @throws InvalidObjectException always
   626      * @throws InvalidObjectException always
   626      */
   627      */
       
   628     @java.io.Serial
   627     private void readObject(ObjectInputStream s) throws InvalidObjectException {
   629     private void readObject(ObjectInputStream s) throws InvalidObjectException {
   628         throw new InvalidObjectException("Deserialization via serialization delegate");
   630         throw new InvalidObjectException("Deserialization via serialization delegate");
   629     }
   631     }
   630 
   632 
   631     /**
   633     /**
   653      * ID has a valid format, but is not in the known set of region-based IDs.
   655      * ID has a valid format, but is not in the known set of region-based IDs.
   654      *
   656      *
   655      * @return the instance of {@code Ser}, not null
   657      * @return the instance of {@code Ser}, not null
   656      */
   658      */
   657     // this is here for serialization Javadoc
   659     // this is here for serialization Javadoc
       
   660     @java.io.Serial
   658     private Object writeReplace() {
   661     private Object writeReplace() {
   659         return new Ser(Ser.ZONE_REGION_TYPE, this);
   662         return new Ser(Ser.ZONE_REGION_TYPE, this);
   660     }
   663     }
   661 
   664 
   662     abstract void write(DataOutput out) throws IOException;
   665     abstract void write(DataOutput out) throws IOException;