Skip to content

Commit 8a1c712

Browse files
committedFeb 19, 2021
8261728: SimpleDateFormat should link to DateTimeFormatter
Reviewed-by: bpb, rriggs, lancea, iris
1 parent 851b2e3 commit 8a1c712

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
 

‎src/java.base/share/classes/java/text/DateFormat.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2021, 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
@@ -147,6 +147,8 @@
147147
* It is recommended to create separate format instances for each thread.
148148
* If multiple threads access a format concurrently, it must be synchronized
149149
* externally.
150+
* @apiNote Consider using {@link java.time.format.DateTimeFormatter} as an
151+
* immutable and thread-safe alternative.
150152
*
151153
* @implSpec
152154
* <ul><li>The {@link #format(Date, StringBuffer, FieldPosition)} and
@@ -173,6 +175,7 @@
173175
* @see java.util.Calendar
174176
* @see java.util.GregorianCalendar
175177
* @see java.util.TimeZone
178+
* @see java.time.format.DateTimeFormatter
176179
* @author Mark Davis, Chen-Lieh Huang, Alan Liu
177180
* @since 1.1
178181
*/

‎src/java.base/share/classes/java/text/SimpleDateFormat.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2021, 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
@@ -428,12 +428,15 @@
428428
* It is recommended to create separate format instances for each thread.
429429
* If multiple threads access a format concurrently, it must be synchronized
430430
* externally.
431+
* @apiNote Consider using {@link java.time.format.DateTimeFormatter} as an
432+
* immutable and thread-safe alternative.
431433
*
432434
* @see <a href="http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html">Java Tutorial</a>
433435
* @see java.util.Calendar
434436
* @see java.util.TimeZone
435437
* @see DateFormat
436438
* @see DateFormatSymbols
439+
* @see java.time.format.DateTimeFormatter
437440
* @author Mark Davis, Chen-Lieh Huang, Alan Liu
438441
* @since 1.1
439442
*/

0 commit comments

Comments
 (0)
Please sign in to comment.