--- a/src/java.base/share/classes/java/util/Date.java Thu Oct 17 20:27:44 2019 +0100
+++ b/src/java.base/share/classes/java/util/Date.java Thu Oct 17 20:53:35 2019 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -154,6 +154,7 @@
* interoperability with JDK1.1. The Date was modified to write
* and read only the UTC time.
*/
+ @java.io.Serial
private static final long serialVersionUID = 7523967970034938905L;
/**
@@ -909,7 +910,7 @@
* represented by this {@code Date} object is strictly
* earlier than the instant represented by {@code when};
* {@code false} otherwise.
- * @exception NullPointerException if {@code when} is null.
+ * @throws NullPointerException if {@code when} is null.
*/
public boolean before(Date when) {
return getMillisOf(this) < getMillisOf(when);
@@ -923,7 +924,7 @@
* by this {@code Date} object is strictly later than the
* instant represented by {@code when};
* {@code false} otherwise.
- * @exception NullPointerException if {@code when} is null.
+ * @throws NullPointerException if {@code when} is null.
*/
public boolean after(Date when) {
return getMillisOf(this) > getMillisOf(when);
@@ -972,7 +973,7 @@
* is before the Date argument; and a value greater than
* {@code 0} if this Date is after the Date argument.
* @since 1.2
- * @exception NullPointerException if {@code anotherDate} is null.
+ * @throws NullPointerException if {@code anotherDate} is null.
*/
public int compareTo(Date anotherDate) {
long thisTime = getMillisOf(this);
@@ -1318,6 +1319,7 @@
* is emitted (long). This represents the offset from
* January 1, 1970, 00:00:00 GMT in milliseconds.
*/
+ @java.io.Serial
private void writeObject(ObjectOutputStream s)
throws IOException
{
@@ -1328,6 +1330,7 @@
/**
* Reconstitute this object from a stream (i.e., deserialize it).
*/
+ @java.io.Serial
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException
{
@@ -1350,8 +1353,8 @@
* @param instant the instant to convert
* @return a {@code Date} representing the same point on the time-line as
* the provided instant
- * @exception NullPointerException if {@code instant} is null.
- * @exception IllegalArgumentException if the instant is too large to
+ * @throws NullPointerException if {@code instant} is null.
+ * @throws IllegalArgumentException if the instant is too large to
* represent as a {@code Date}
* @since 1.8
*/