On Sat, 8 Mar 2025 00:28:15 GMT, Henry Jen <[email protected]> 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.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23954#discussion_r1986339411