Skip to content

Commit d7c05d1

Browse files
Justin Lunaotoj
Justin Lu
authored andcommitted
8300011: Refactor code examples to use @snippet in java.util.TimeZone
Reviewed-by: lancea, naoto, iris
1 parent 8c12ae8 commit d7c05d1

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

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

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@
6363
* along with a time zone ID. For instance, the time zone ID for the
6464
* U.S. Pacific Time zone is "America/Los_Angeles". So, you can get a
6565
* U.S. Pacific Time {@code TimeZone} object with:
66-
* <blockquote><pre>
66+
* <blockquote>
67+
* {@snippet lang=java :
6768
* TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");
68-
* </pre></blockquote>
69+
* }
70+
* </blockquote>
6971
* You can use the {@code getAvailableIDs} method to iterate through
7072
* all the supported time zone IDs. You can then choose a
7173
* supported ID to get a {@code TimeZone}.
@@ -309,10 +311,14 @@ public void setID(String ID)
309311
* presentation to the user in the default locale.
310312
*
311313
* <p>This method is equivalent to:
312-
* <blockquote><pre>
313-
* getDisplayName(false, {@link #LONG},
314-
* Locale.getDefault({@link Locale.Category#DISPLAY}))
315-
* </pre></blockquote>
314+
* <blockquote>
315+
* {@snippet lang=java :
316+
* // @link substring="LONG" target="#LONG" :
317+
* getDisplayName(false, LONG,
318+
* // @link substring="Locale.Category.DISPLAY" target="Locale.Category#DISPLAY" :
319+
* Locale.getDefault(Locale.Category.DISPLAY));
320+
* }
321+
* </blockquote>
316322
*
317323
* @return the human-readable name of this time zone in the default locale.
318324
* @since 1.2
@@ -330,9 +336,12 @@ public final String getDisplayName() {
330336
* presentation to the user in the specified {@code locale}.
331337
*
332338
* <p>This method is equivalent to:
333-
* <blockquote><pre>
334-
* getDisplayName(false, {@link #LONG}, locale)
335-
* </pre></blockquote>
339+
* <blockquote>
340+
* {@snippet lang=java :
341+
* // @link substring="LONG" target="#LONG" :
342+
* getDisplayName(false, LONG, locale);
343+
* }
344+
* </blockquote>
336345
*
337346
* @param locale the locale in which to supply the display name.
338347
* @return the human-readable name of this time zone in the given locale.
@@ -352,10 +361,13 @@ public final String getDisplayName(Locale locale) {
352361
* Time). Otherwise, a Standard Time name is returned.
353362
*
354363
* <p>This method is equivalent to:
355-
* <blockquote><pre>
364+
* <blockquote>
365+
* {@snippet lang=java :
356366
* getDisplayName(daylight, style,
357-
* Locale.getDefault({@link Locale.Category#DISPLAY}))
358-
* </pre></blockquote>
367+
* // @link substring="Locale.Category.DISPLAY" target="Locale.Category#DISPLAY" :
368+
* Locale.getDefault(Locale.Category.DISPLAY));
369+
* }
370+
* </blockquote>
359371
*
360372
* @param daylight {@code true} specifying a Daylight Saving Time name, or
361373
* {@code false} specifying a Standard Time name

0 commit comments

Comments
 (0)