From 88b8ffc8a9d5f6751939b8a4ac8d458abf3a3083 Mon Sep 17 00:00:00 2001 From: Chris Povirk Date: Sat, 5 Oct 2024 20:58:27 -0400 Subject: [PATCH] Annotate new `Console` APIs. (#81) --- src/java.base/share/classes/java/io/Console.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/java.base/share/classes/java/io/Console.java b/src/java.base/share/classes/java/io/Console.java index 0b9210fe670..95a6066c6e4 100644 --- a/src/java.base/share/classes/java/io/Console.java +++ b/src/java.base/share/classes/java/io/Console.java @@ -172,7 +172,7 @@ public Reader reader() { * @since 23 */ @PreviewFeature(feature = PreviewFeature.Feature.IMPLICIT_CLASSES) - public Console println(Object obj) { + public Console println(@Nullable Object obj) { throw newUnsupportedOperationException(); } @@ -192,7 +192,7 @@ public Console println(Object obj) { * @since 23 */ @PreviewFeature(feature = PreviewFeature.Feature.IMPLICIT_CLASSES) - public Console print(Object obj) { + public Console print(@Nullable Object obj) { throw newUnsupportedOperationException(); } @@ -214,7 +214,7 @@ public Console print(Object obj) { * @since 23 */ @PreviewFeature(feature = PreviewFeature.Feature.IMPLICIT_CLASSES) - public String readln(String prompt) { + public String readln(@Nullable String prompt) { throw newUnsupportedOperationException(); } @@ -289,7 +289,7 @@ public Console format(String format, @Nullable Object ... args) { * @return This console * @since 23 */ - public Console format(Locale locale, String format, Object ... args) { + public Console format(@Nullable Locale locale, String format, @Nullable Object ... args) { throw newUnsupportedOperationException(); } @@ -369,7 +369,7 @@ public Console printf(String format, @Nullable Object ... args) { * @return This console * @since 23 */ - public Console printf(Locale locale, String format, Object ... args) { + public Console printf(@Nullable Locale locale, String format, @Nullable Object ... args) { throw newUnsupportedOperationException(); } @@ -453,7 +453,7 @@ public Console printf(Locale locale, String format, Object ... args) { * if an end of stream has been reached. * @since 23 */ - public String readLine(Locale locale, String format, Object ... args) { + public @Nullable String readLine(@Nullable Locale locale, String format, @Nullable Object ... args) { throw newUnsupportedOperationException(); } @@ -553,7 +553,7 @@ public String readLine(Locale locale, String format, Object ... args) { * or {@code null} if an end of stream has been reached. * @since 23 */ - public char[] readPassword(Locale locale, String format, Object ... args) { + public char @Nullable [] readPassword(@Nullable Locale locale, String format, @Nullable Object ... args) { throw newUnsupportedOperationException(); }