[jdk20] RFR: 8297288: Example code in Scanner class

Naoto Sato naoto at openjdk.org
Fri Dec 9 20:05:34 UTC 2022


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.

-------------

Commit messages:
 - 8297288: Example code in Scanner class

Changes: https://git.openjdk.org/jdk20/pull/14/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk20&pr=14&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8297288
  Stats: 15 lines in 1 file changed: 3 ins; 0 del; 12 mod
  Patch: https://git.openjdk.org/jdk20/pull/14.diff
  Fetch: git fetch https://git.openjdk.org/jdk20 pull/14/head:pull/14

PR: https://git.openjdk.org/jdk20/pull/14


More information about the core-libs-dev mailing list