On Fri, 22 Aug 2025 13:26:37 GMT, Volkan Yazici <vyaz...@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 replaces the `NoRepl` suffix with `NoReplacement` in method names 
>> and consistently uses `throws CCE` in method footprints.
>
> Volkan Yazici has updated the pull request incrementally with five additional 
> commits since the last revision:
> 
>  - Renamed to `malformedASCII`
>  - Improve exception parametrization
>  - Document parametrization on the exception type
>  - Avoid using links in the Javadoc title line
>  - Rename `NoReplTest` and fix its copyright year

Thanks for the updates.

src/java.base/share/classes/java/lang/String.java line 1316:

> 1314: 
> 1315:     @SuppressWarnings("unchecked")
> 1316:     private static <E extends Exception> E malformedInputException(int 
> off, int nb, Class<E> exceptionClass) {

The argument name can be "_", since it is ignored and is unused in the body.
Comment the method as always throwing MalformedInputException.
Similarly in the other malformedInput methods*.

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

PR Review: https://git.openjdk.org/jdk/pull/26413#pullrequestreview-3144650993
PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2293885424

Reply via email to