From 05faa7321bc076794048d3d069fa36b14f42ca70 Mon Sep 17 00:00:00 2001 From: Justin Lu Date: Wed, 1 Mar 2023 18:13:42 +0000 Subject: [PATCH] 8303232: java.util.Date.parse(String) and java.util.Date(String) don't declare thrown IllegalArgumentException Reviewed-by: jpai, lancea, naoto --- src/java.base/share/classes/java/util/Date.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/java.base/share/classes/java/util/Date.java b/src/java.base/share/classes/java/util/Date.java index 52b70b55d98..1850564d8b2 100644 --- a/src/java.base/share/classes/java/util/Date.java +++ b/src/java.base/share/classes/java/util/Date.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2023, 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 @@ -260,6 +260,8 @@ public class Date * {@link Date#parse} method. * * @param s a string representation of the date. + * @throws IllegalArgumentException if {@code s} cannot be interpreted as a + * representation of a date and time. * @see java.text.DateFormat * @see java.util.Date#parse(java.lang.String) * @deprecated As of JDK version 1.1, @@ -441,6 +443,8 @@ public class Date * @param s a string to be parsed as a date. * @return the number of milliseconds since January 1, 1970, 00:00:00 GMT * represented by the string argument. + * @throws IllegalArgumentException if {@code s} cannot be interpreted as a + * representation of a date and time. * @see java.text.DateFormat * @deprecated As of JDK version 1.1, * replaced by {@code DateFormat.parse(String s)}.