On Fri, 19 Jul 2024 13:03:31 GMT, Chen Liang <li...@openjdk.org> wrote:
>> lingjun-cg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> 8333396: Use StringBuilder internally for java.text.Format.* formatting > > src/java.base/share/classes/java/text/Format.java line 164: > >> 162: */ >> 163: public final String format (Object obj) { >> 164: if ("java.text".equals(getClass().getPackageName())) { > > We can use `==` for performance as getPackageName is interned. Using equals() is fine and the performance is the same. Using "==" may be fewer characters but carries with it the need to understand that the arguments are interned and that's not always obvious or known. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/19513#discussion_r1684469032