On Mon, 22 Jun 2026 17:58:33 GMT, Rémi Forax <[email protected]> wrote:

>> Thanks all for the reviews.
>> 
>> For static import, I'm OK with either way. It has the benefit of smaller 
>> bytecode, but a bit less readable for users without an IDE to navigate the 
>> source.
>> 
>> I can go either way if someone has a strong preference.
>
> I think you mean smaller Java code, not smaller bytecode, the bytecode 
> generated by javac is identical if you use an import static or not.

I mean bytecode. With the static import, the `Class.getReflectionFactory()` 
method is entirely removed, resulting a 47-byte reduction of `Class.class`:

Size of `jdk/modules/java.base/java/lang/Class.class`:
- With import static and method removal: 52936
- Without: 52983

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31591#discussion_r3454815857

Reply via email to