On Sun, 22 Mar 2026 05:10:10 GMT, Kirill Shirokov <[email protected]> wrote:

> Just a straightforward implementation of the requested change.
> 
> Tested using tier1 tests on linux-x64, macosx-aarch64, windows-x64.

One of my comments seems to have vanished.

> Though I wonder now why isNestmateOf is expressed as a comparison of 
> nest-hosts rather than calling JVM_AreNestmates itself? (I'd have to dig 
> deeper into the development of JEP-181 for that.).

At one stage we had this:

public boolean isNestmateOf(Class<?> c) {
        // We could use Reflection.areNestmates(this, c) and ignore
        // any IllegalAccessError, but prefer to minimize exception
        // creation by using getNestHost() directly.
        return getNestHost() == c.getNestHost();

but I think the exception model must have changed because I don't see any 
throwing of IllegalAccessError. So we could, and IMO should, change the above 
code to use `JVM_AreNestmates` rather than what is proposed.

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

PR Comment: https://git.openjdk.org/jdk/pull/30358#issuecomment-4107545856

Reply via email to