RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v11]

Volkan Yazici vyazici at openjdk.org
Mon Sep 1 16:16:23 UTC 2025


> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints.

Volkan Yazici has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 27 commits:

 - Fix `ClassCastException` spotted by `ReadWriteString`
 - Merge remote-tracking branch 'upstream/master' into jlaNoRepl
 - Improve Javadoc of touched `encode*()` methods
 - Rename `exceptionClass` to `exClass`
 - Rename `NoReplacement` suffix to `OrThrow`
 - Simplify `encodeWithEncoder` and trim long lines
 - Improve docs
 - Improve "sneaky throws"
 - Improve comment style
 - Renamed to `malformedASCII`
 - ... and 17 more: https://git.openjdk.org/jdk/compare/7f0cd648...a69f9fd3

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

Changes: https://git.openjdk.org/jdk/pull/26413/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26413&range=10
  Stats: 462 lines in 8 files changed: 242 ins; 122 del; 98 mod
  Patch: https://git.openjdk.org/jdk/pull/26413.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26413/head:pull/26413

PR: https://git.openjdk.org/jdk/pull/26413


More information about the security-dev mailing list