On Mon, 26 Feb 2024 14:47:06 GMT, Roger Riggs <rri...@openjdk.org> wrote:
>> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Remove temporary microbenchmark > > src/java.base/share/classes/jdk/internal/reflect/ClassFileAssembler.java line > 28: > >> 26: package jdk.internal.reflect; >> 27: >> 28: import sun.nio.cs.UTF_8; > > I see about equal numbers of uses of `StandardCharsets.UTF_8` and > `sun.nio.cs.UTF_8.INSTANCE` in java.base but would lean toward the one in > `StandardCharsets` unless there's a bootstrap order dependency. Using `UTF_8.INSTANCE` avoids a dependency on a couple of unrelated charset classes and thus _could_ help avoid bootstrap issues. It definitely makes sense in `java.lang` and classes being loaded very early in the bootstrap. Less so here in a utility class used by legacy reflective class spinning, but since there was primordial concern about bootstrap issues it seemed like the safer choice. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/18006#discussion_r1502750058