< prev index next >
src/java.base/share/classes/java/util/Date.java
Print this page
rev 56290 : 8230648: Replace @exception tag with @throws in java.base
Summary: Minor coding style update of javadoc tag in any file in java.base
Reviewed-by: prappo, lancea
*** 908,918 ****
* @param when a date.
* @return {@code true} if and only if the instant of time
* 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.
*/
public boolean before(Date when) {
return getMillisOf(this) < getMillisOf(when);
}
--- 908,918 ----
* @param when a date.
* @return {@code true} if and only if the instant of time
* represented by this {@code Date} object is strictly
* earlier than the instant represented by {@code when};
* {@code false} otherwise.
! * @throws NullPointerException if {@code when} is null.
*/
public boolean before(Date when) {
return getMillisOf(this) < getMillisOf(when);
}
*** 922,932 ****
* @param when a date.
* @return {@code true} if and only if the instant represented
* 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.
*/
public boolean after(Date when) {
return getMillisOf(this) > getMillisOf(when);
}
--- 922,932 ----
* @param when a date.
* @return {@code true} if and only if the instant represented
* by this {@code Date} object is strictly later than the
* instant represented by {@code when};
* {@code false} otherwise.
! * @throws NullPointerException if {@code when} is null.
*/
public boolean after(Date when) {
return getMillisOf(this) > getMillisOf(when);
}
*** 971,981 ****
* @return the value {@code 0} if the argument Date is equal to
* this Date; a value less than {@code 0} if this Date
* 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.
*/
public int compareTo(Date anotherDate) {
long thisTime = getMillisOf(this);
long anotherTime = getMillisOf(anotherDate);
return (thisTime<anotherTime ? -1 : (thisTime==anotherTime ? 0 : 1));
--- 971,981 ----
* @return the value {@code 0} if the argument Date is equal to
* this Date; a value less than {@code 0} if this Date
* is before the Date argument; and a value greater than
* {@code 0} if this Date is after the Date argument.
* @since 1.2
! * @throws NullPointerException if {@code anotherDate} is null.
*/
public int compareTo(Date anotherDate) {
long thisTime = getMillisOf(this);
long anotherTime = getMillisOf(anotherDate);
return (thisTime<anotherTime ? -1 : (thisTime==anotherTime ? 0 : 1));
*** 1351,1362 ****
* will throw an exception.
*
* @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
* represent as a {@code Date}
* @since 1.8
*/
public static Date from(Instant instant) {
try {
--- 1351,1362 ----
* will throw an exception.
*
* @param instant the instant to convert
* @return a {@code Date} representing the same point on the time-line as
* the provided instant
! * @throws NullPointerException if {@code instant} is null.
! * @throws IllegalArgumentException if the instant is too large to
* represent as a {@code Date}
* @since 1.8
*/
public static Date from(Instant instant) {
try {
< prev index next >