On Mon, 4 Oct 2021 07:13:37 GMT, Ichiroh Takiguchi <itakigu...@openjdk.org> wrote:
>> JEP-400 (UTF-8 by Default) was eabled on JDK18-b13. >> After JDK18-b13, javac and some other langtool command's usage were garbled >> on Japanese Windows. >> These commands use PrintWriter instead of standard out/err with PrintStream. > > Ichiroh Takiguchi has updated the pull request incrementally with one > additional commit since the last revision: > > 8274544: Langtools command's usage were garbled on Japanese Windows src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java line 265: > 263: * @return a map of writers > 264: */ > 265: private final static Charset nativeCharset; Inserting this static initializer in the middle of a method, between its javadoc and impl, is odd. src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java line 267: > 265: private final static Charset nativeCharset; > 266: static { > 267: Charset cs = Charset.defaultCharset(); This could move into the `catch` section as a last resort. src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java line 419: > 417: return new PrintWriter(System.err, true, nativeCharset); > 418: } else { > 419: if (s.equals((OutputStream)System.err) || > s.equals((OutputStream)System.out)) { Can we use `==` here? src/jdk.jpackage/share/classes/jdk/jpackage/main/Main.java line 50: > 48: * @param args command line arguments > 49: */ > 50: private final static Charset nativeCharset; Static initializer dissecting main method (javadoc/impl) ------------- PR: https://git.openjdk.java.net/jdk/pull/5771