RFR: 8356439: Rename JavaLangAccess::*NoRepl methods
Volkan Yazici
vyazici at openjdk.org
Mon Jul 28 09:47:04 UTC 2025
On Mon, 21 Jul 2025 13:01:30 GMT, Chen Liang <liach 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`.)
>
> I strongly suggest against using CCE as the standard exception. The only place that relies on CCE is `Files`; IAE is more suitable for everywhere else. I recommend adding the special CCE handling in `Files` alone so we can remove the redundant try-catch everywhere else.
@liach, thanks so much for the prompt feedback!
> I strongly suggest against using CCE as the standard exception.
Would you mind elaborating on the rationale behind this preference, please?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26413#issuecomment-3096905451
More information about the core-libs-dev
mailing list