< prev index next >
src/java.base/share/classes/java/net/URL.java
Print this page
*** 173,182 ****
--- 173,183 ----
* @since 1.0
*/
public final class URL implements java.io.Serializable {
static final String BUILTIN_HANDLERS_PREFIX = "sun.net.www.protocol";
+ @java.io.Serial
static final long serialVersionUID = -7627629688361524110L;
/**
* The property which specifies the package prefix list to be scanned
* for protocol handlers. The value of this property (if any) should
*** 1487,1496 ****
--- 1488,1498 ----
* @serialField ref String
*
* @serialField hashCode int
*
*/
+ @java.io.Serial
private static final ObjectStreamField[] serialPersistentFields = {
new ObjectStreamField("protocol", String.class),
new ObjectStreamField("host", String.class),
new ObjectStreamField("port", int.class),
new ObjectStreamField("authority", String.class),
*** 1506,1515 ****
--- 1508,1518 ----
* @serialData the default write object value. When read back in,
* the reader must ensure that calling getURLStreamHandler with
* the protocol variable returns a valid URLStreamHandler and
* throw an IOException if it does not.
*/
+ @java.io.Serial
private synchronized void writeObject(java.io.ObjectOutputStream s)
throws IOException
{
s.defaultWriteObject(); // write the fields
}
*** 1517,1526 ****
--- 1520,1530 ----
/**
* readObject is called to restore the state of the URL from the
* stream. It reads the components of the URL and finds the local
* stream handler.
*/
+ @java.io.Serial
private synchronized void readObject(java.io.ObjectInputStream s)
throws IOException, ClassNotFoundException {
GetField gf = s.readFields();
String protocol = (String)gf.get("protocol", null);
if (getURLStreamHandler(protocol) == null) {
*** 1548,1558 ****
* @return a newly created object from deserialized data
*
* @throws ObjectStreamException if a new object replacing this
* object could not be created
*/
!
private Object readResolve() throws ObjectStreamException {
URLStreamHandler handler = null;
// already been checked in readObject
handler = getURLStreamHandler(tempState.getProtocol());
--- 1552,1562 ----
* @return a newly created object from deserialized data
*
* @throws ObjectStreamException if a new object replacing this
* object could not be created
*/
! @java.io.Serial
private Object readResolve() throws ObjectStreamException {
URLStreamHandler handler = null;
// already been checked in readObject
handler = getURLStreamHandler(tempState.getProtocol());
< prev index next >