On Sun, 9 Mar 2025 14:38:45 GMT, Alan Bateman <al...@openjdk.org> wrote:

>> JDK-8349989: jlink can use String.replace instead of String.replaceAll
>
> src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java line 794:
> 
>> 792:                     log.format("%-40s %s%n",
>> 793:                                "-".repeat(internalApiTitle.length()),
>> 794:                                
>> "_".repeat(replacementApiTitle.length()));
> 
> Using replaceAll to replace all characters with "-" is indeed a bit unusual. 
> Are you sure String::length is what you want, I'm just wondering if you need 
> the number of Unicode code points  here rather than length.

These seem to be strings from localization, so I think it's unlikely to have 
4-byte unicode characters appearing.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23954#discussion_r1986384392

Reply via email to