On Mon, 22 Jun 2026 08:12:54 GMT, Man Cao <[email protected]> wrote:

>> src/java.base/share/classes/java/lang/Class.java line 96:
>> 
>>> 94: import sun.reflect.annotation.*;
>>> 95: 
>>> 96: import static 
>>> jdk.internal.reflect.ReflectionFactory.getReflectionFactory;
>> 
>> The changes look okay although I don't particularly like this static import 
>> - it's not at all obvious at the usages in Class that it gets it from 
>> ReflectionFactory.
>
> 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.

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

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

Reply via email to