On Fri, 8 Aug 2025 18:48:43 GMT, Xueming Shen <sher...@openjdk.org> wrote:

>> Volkan Yazici has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Improve pretty-printers
>
> test/jdk/sun/nio/cs/TestEncoderReplaceLatin1.java line 132:
> 
>> 130:             replacement1[0] = (byte) i;
>> 131:             // Skip the default value, since we're verifying if a 
>> custom one works
>> 132:             if (replacement1[0] == replacementD[0]) {
> 
> nit-pick?
> if (replacementD.length == 1 && replacement1[0] == replacementD[0]) { ...}

`replacementD` is obtained from `CharsetEncoder#replacement()` and its Javadoc 
states the following:

     * @return  This encoder's current replacement,
     *          which is never {@code null} and is never empty

I had decided to fail when spec. doesn't hold, instead of being lenient against 
its violation, in particular, since this is a test.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2264610149

Reply via email to