Skip to content
Permalink
Browse files
8220483: Calendar.setTime(Date date) throws NPE with Date date = null
Reviewed-by: lancea, joehw
  • Loading branch information
naotoj committed Sep 15, 2020
1 parent 65bfe09 commit 57f92d23b1049e7bfc1d54567757713ca1dd0f3c
Showing 1 changed file with 2 additions and 0 deletions.
@@ -1796,8 +1796,10 @@ public final Date getTime() {
* @param date the given Date.
* @see #getTime()
* @see #setTimeInMillis(long)
* @throws NullPointerException if {@code date} is {@code null}
*/
public final void setTime(Date date) {
Objects.requireNonNull(date, "date must not be null");
setTimeInMillis(date.getTime());
}

1 comment on commit 57f92d2

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 57f92d2 Sep 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.