On Mon, 21 Jul 2025 14:00:37 GMT, Volkan Yazici <vyaz...@openjdk.org> wrote:
> Would you mind elaborating on the rationale behind this preference, please? If you look at the history of `newStringNoRepl`, you will find it's originally added for JDK-8201276 in ca487166f4d18c162e8d8e4b2660d5d0381c5438. Since then, `newStringNoRepl` has been used by various other sites mostly as a utility. None of those further usages ever used the `CharacterCodingException`. In fact, in `String`, the actual implementation throws an IAE that is later wrapped in a CCE. I don't think we should punish all other users of this API just because `Files.readString` requires this CCE; the CCE wrapping can be moved to Files.readString. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26413#issuecomment-3097079813