RFR: 8310901: Convert String::newStringNoRepl with Latin-1 to String::newStringLatin1NoRepl [v7]
Chen Liang
liach at openjdk.org
Fri Oct 20 04:35:39 UTC 2023
On Wed, 18 Oct 2023 18:13:38 GMT, Glavo <duke at openjdk.org> wrote:
>> Added a new method `newStringLatin1NoRepl` to the `JavaLangAccess`.
>>
>> Reasons:
>>
>> * Most use cases of `newStringNoRepl` use `ISO_8859_1` as the charset, creating a new shortcut can make writing shorter;
>> * Since all possible values of `byte` are legal Latin-1 characters, `newStringLatin1NoRepl` **will not throw `CharacterCodingException`**, so users can make the compiler happy without using useless try-catch statements.
>
> Glavo has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 10 additional commits since the last revision:
>
> - Merge branch 'openjdk:master' into latin1-no-repl
> - Use newStringLatin1NoRepl in UUID
> - Merge branch 'openjdk:master' into latin1-no-repl
> - Merge branch 'openjdk:master' into latin1-no-repl
> - Merge branch 'openjdk:master' into latin1-no-repl
> - update javadoc
> - clean newStringNoRepl1
> - clean newStringNoRepl1
> - Rename jla to JLA
> - Create new method JavaLangAccess::newStringLatin1NoRepl
See [#16260](https://github.com/openjdk/jdk/pull/16260#issuecomment-1770217422): `NoRepl` means to report encoding error as CCE. The API you are creating should be renamed to something like `newTrustedLatin1String` as we don't check encoding errors and this API solely focuses on sharing the array.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14655#issuecomment-1772064234
More information about the security-dev
mailing list