JavaLangAccess::xxNoRepl methods have their NoRepl suffix changed to ReportError.
NoRepl can be incorrectly interpreted as "no replication", which is not what these APIs are for. They instead expose the report-error coding error action fast paths in String, allowing ZipCoder to quickly throw encoding exceptions wrapped in IllegalArgumentException.
In addition, newStringNoRepl and getBytesNoRepl in JavaLangAccess can be used to avoid copying arrays for trusted usages. They should not be used so and such Latin-1 string creation should be done with a different internal API.
NoRepl can be incorrectly interpreted as "no replication", which is not what these APIs are for. They instead expose the report-error coding error action fast paths in String, allowing ZipCoder to quickly throw encoding exceptions wrapped in IllegalArgumentException.
In addition, newStringNoRepl and getBytesNoRepl in JavaLangAccess can be used to avoid copying arrays for trusted usages. They should not be used so and such Latin-1 string creation should be done with a different internal API.
- links to
-
Review openjdk/jdk/16260