RFR: 8318200: String::newStringNoRepl and String::getBytesNoRepl does not throw CharacterCodingException [v4]

Chen Liang liach at openjdk.org
Tue Oct 17 14:43:52 UTC 2023


On Tue, 17 Oct 2023 14:30:26 GMT, Shaojin Wen <duke at openjdk.org> wrote:

> @wenshao The proposal changes the exception types for seemingly no reason.
> What concrete problem does this enhancement PR address?

@rgiulietti The API was exposed to create a String without duplicating an array in compatible encoding. Initially they are added for Files.readString and writeString, which has a custom exception logic. However, in the coming years, the usages for no-replication has grown, but no other user needs the CCE behavior, which makes code complex. As a result, we are proposing to localize the CCE logoc to Files.readString and writeString so other use sites can call the APIs without try-catch.

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

PR Comment: https://git.openjdk.org/jdk/pull/16209#issuecomment-1766561936



More information about the security-dev mailing list