8229997: Apply java.io.Serial annotations in java.base

Reviewed-by: alanb, rriggs
This commit is contained in:
Joe Darcy 2019-08-29 16:31:34 -07:00
parent 6d064a747e
commit 9d764ee48e
315 changed files with 880 additions and 254 deletions

View file

@ -175,6 +175,7 @@ import sun.security.action.GetPropertyAction;
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;
/**
@ -1489,6 +1490,7 @@ public final class URL implements java.io.Serializable {
* @serialField hashCode int
*
*/
@java.io.Serial
private static final ObjectStreamField[] serialPersistentFields = {
new ObjectStreamField("protocol", String.class),
new ObjectStreamField("host", String.class),
@ -1508,6 +1510,7 @@ public final class URL implements java.io.Serializable {
* 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
{
@ -1519,6 +1522,7 @@ public final class URL implements java.io.Serializable {
* 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();
@ -1550,7 +1554,7 @@ public final class URL implements java.io.Serializable {
* @throws ObjectStreamException if a new object replacing this
* object could not be created
*/
@java.io.Serial
private Object readResolve() throws ObjectStreamException {
URLStreamHandler handler = null;