On Tue, 17 Oct 2023 14:22:10 GMT, Shaojin Wen <d...@openjdk.org> wrote:
>> When calling String::newStringNoRepl and String::getBytesNoRepl, we need to >> use try...catch to handle CharacterCodingException and throw >> IllegalArgumentException instead of CharacterCodingException to make the >> calling code cleaner. > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision: > > fix from @AlanBateman 's review Hacking around the exception types isn't a good fix. If the exception is thrown, it is because of a charset conversion error. IllegalArgumentException is for cases where the arguments are incorrect. ------------- Changes requested by rriggs (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/16209#pullrequestreview-1683043411