On Fri, 9 Dec 2022 18:32:37 GMT, Naoto Sato <na...@openjdk.org> wrote:
> The example in `Scanner` directly uses `System.in` which may cause unwanted > behavior when the default charset and the console charset differ. Using > `Console.reader()` is more appropriate. Also changed examples into snippets. src/java.base/share/classes/java/util/Scanner.java line 58: > 56: * var con = System.console(); > 57: * if (con != null) { > 58: * Scanner sc = new Scanner(con.reader()); // @link > substring="reader()" target="java.io.Console#reader()" The link tag can be put on the previous line if you want. It just requires terminating it with a colon (":"). I've found that useful in a few places. ------------- PR: https://git.openjdk.org/jdk20/pull/14