RFR: 8341664: ReferenceClassDescImpl cache internalName

Chen Liang liach at openjdk.org
Mon Oct 7 16:49:05 UTC 2024


On Sun, 6 Oct 2024 01:22:33 GMT, Shaojin Wen <swen at openjdk.org> wrote:

> ReferenceClassDescImpl caches internalName to avoid creating a new String object for each call, which can also simplify the implementation of classfile.

Changes requested by liach (Reviewer).

The caching of class entry forms in ReferenceClassDescImpl may be controversial; I will consult with other engineers.

src/java.base/share/classes/jdk/internal/classfile/impl/Util.java line 152:

> 150:             return rcd.internalName();
> 151:         }
> 152:         return cd.descriptorString();

Suggestion:

        rthrow new IllegalArgumentException(desc);

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

PR Review: https://git.openjdk.org/jdk/pull/21373#pullrequestreview-2350548154
PR Comment: https://git.openjdk.org/jdk/pull/21373#issuecomment-2395467102
PR Review Comment: https://git.openjdk.org/jdk/pull/21373#discussion_r1789119065


More information about the core-libs-dev mailing list