On Mon, 22 Jun 2026 20:32:12 GMT, Rémi Forax <[email protected]> wrote:

>> 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
>
> You get the same simplification using a standard import instead of using a 
> **static** import.
> By replacing the call to `getReflectionFactory()` by 
> `ReflectionFactory.getReflectionFactory()`.
> 
> Using less bytecodes come from reusing an existing code nor the fact that the 
> import is 'static'.

Yes, I understand that part. The "static import approach" was referring to the 
commit 05eeabbf614bd42b61b2a2e66b45aa33dd53339c, which does not include 
replacing `getReflectionFactory()` with 
`ReflectionFactory.getReflectionFactory()`.

@liach @AlanBateman Do you prefer replacing the 19 references to 
`getReflectionFactory()` with `ReflectionFactory.getReflectionFactory()`?

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

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

Reply via email to