RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v4]
Roger Riggs
rriggs at openjdk.org
Tue Aug 19 16:48:43 UTC 2025
On Tue, 12 Aug 2025 19:29:28 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:
>> `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 removes `NoRepl` suffix from method names and consistently uses `throws CCE` in method footprints. (b4845109e18 passes `tier1,2`.)
>
> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:
>
> Remove redundant type parameters
src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java line 361:
> 359: * @throws CharacterCodingException For malformed input or unmappable characters
> 360: */
> 361: String newStringUTF8NoReplacement(byte[] bytes, int offset, int length) throws CharacterCodingException;
This method is only used by ZipCoder and could be refactored to use `uncheckedNewStringNoReplacement` as in PR#https://github.com/openjdk/jdk/pull/26822.
It is a refactoring cleanup not directly related to renaming the NoRepl methods.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2285806922
More information about the nio-dev
mailing list