jdk/src/share/classes/java/time/ZoneId.java
changeset 19841 15c8e97d6a14
parent 19030 32f129cb6351
child 20747 86a86a94b367
equal deleted inserted replaced
19822:4e10a58fa28f 19841:15c8e97d6a14
    61  */
    61  */
    62 package java.time;
    62 package java.time;
    63 
    63 
    64 import java.io.DataOutput;
    64 import java.io.DataOutput;
    65 import java.io.IOException;
    65 import java.io.IOException;
       
    66 import java.io.InvalidObjectException;
    66 import java.io.Serializable;
    67 import java.io.Serializable;
    67 import java.time.format.DateTimeFormatterBuilder;
    68 import java.time.format.DateTimeFormatterBuilder;
    68 import java.time.format.TextStyle;
    69 import java.time.format.TextStyle;
    69 import java.time.temporal.TemporalAccessor;
    70 import java.time.temporal.TemporalAccessor;
    70 import java.time.temporal.TemporalField;
    71 import java.time.temporal.TemporalField;
   660         return getId().hashCode();
   661         return getId().hashCode();
   661     }
   662     }
   662 
   663 
   663     //-----------------------------------------------------------------------
   664     //-----------------------------------------------------------------------
   664     /**
   665     /**
       
   666      * Defend against malicious streams.
       
   667      * @return never
       
   668      * @throws InvalidObjectException always
       
   669      */
       
   670     private Object readResolve() throws InvalidObjectException {
       
   671         throw new InvalidObjectException("Deserialization via serialization delegate");
       
   672     }
       
   673 
       
   674     /**
   665      * Outputs this zone as a {@code String}, using the ID.
   675      * Outputs this zone as a {@code String}, using the ID.
   666      *
   676      *
   667      * @return a string representation of this time-zone ID, not null
   677      * @return a string representation of this time-zone ID, not null
   668      */
   678      */
   669     @Override
   679     @Override
   673 
   683 
   674     //-----------------------------------------------------------------------
   684     //-----------------------------------------------------------------------
   675     /**
   685     /**
   676      * Writes the object using a
   686      * Writes the object using a
   677      * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
   687      * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
       
   688      * @serialData
   678      * <pre>
   689      * <pre>
   679      *  out.writeByte(7);  // identifies this as a ZoneId (not ZoneOffset)
   690      *  out.writeByte(7);  // identifies a ZoneId (not ZoneOffset)
   680      *  out.writeUTF(zoneId);
   691      *  out.writeUTF(getId());
   681      * </pre>
   692      * </pre>
   682      * <p>
   693      * <p>
   683      * When read back in, the {@code ZoneId} will be created as though using
   694      * When read back in, the {@code ZoneId} will be created as though using
   684      * {@link #of(String)}, but without any exception in the case where the
   695      * {@link #of(String)}, but without any exception in the case where the
   685      * ID has a valid format, but is not in the known set of region-based IDs.
   696      * ID has a valid format, but is not in the known set of region-based IDs.