Skip to content

Commit 05faa73

Browse files
Justin Lunaotoj
authored andcommitted
8303232: java.util.Date.parse(String) and java.util.Date(String) don't declare thrown IllegalArgumentException
Reviewed-by: jpai, lancea, naoto
1 parent 4c985e5 commit 05faa73

File tree

1 file changed

+5
-1
lines changed
  • src/java.base/share/classes/java/util

1 file changed

+5
-1
lines changed

src/java.base/share/classes/java/util/Date.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1994, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1994, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -260,6 +260,8 @@ public Date(int year, int month, int date, int hrs, int min, int sec) {
260260
* {@link Date#parse} method.
261261
*
262262
* @param s a string representation of the date.
263+
* @throws IllegalArgumentException if {@code s} cannot be interpreted as a
264+
* representation of a date and time.
263265
* @see java.text.DateFormat
264266
* @see java.util.Date#parse(java.lang.String)
265267
* @deprecated As of JDK version 1.1,
@@ -441,6 +443,8 @@ public static long UTC(int year, int month, int date,
441443
* @param s a string to be parsed as a date.
442444
* @return the number of milliseconds since January 1, 1970, 00:00:00 GMT
443445
* represented by the string argument.
446+
* @throws IllegalArgumentException if {@code s} cannot be interpreted as a
447+
* representation of a date and time.
444448
* @see java.text.DateFormat
445449
* @deprecated As of JDK version 1.1,
446450
* replaced by {@code DateFormat.parse(String s)}.

0 commit comments

Comments
 (0)