<div dir="ltr"><div>I've run into various versions of this situation and I wonder if my expectations about MethodHandles.lookup vs publicLookup are flawed.</div><div><br></div><div>This issue shows an IllegalAccessException "symbolic reference class is not accessible: class jdk.proxy4.$Proxy49" when using a Lookup produced by MethodHandles.lookup, but it works correctly when using publicLookup:</div><div><br></div><div><a href="https://github.com/jruby/jruby/issues/8987#issuecomment-3245803956">https://github.com/jruby/jruby/issues/8987#issuecomment-3245803956</a></div><div><br></div><div>My expectation would be that if publicLookup works, then lookup should also work. I've filed a similar issue in the past (unresolved) where I was forced to use publicLookup instead of lookup:</div><div><br></div><div><a href="https://bugs.openjdk.org/browse/JDK-8313913">https://bugs.openjdk.org/browse/JDK-8313913</a></div><div><br></div><div>The error is similar here, but I'm not sure if it's related (module system should have been fully booted by the time of the JRuby failure).</div><div><br></div><div>If my expectation is correct, this is a new version of the bug and I can file an issue. It's happening at least as late as JDK 24.0.2.</div><div><br></div><div>If my expectation is not correct, please explain to me how I can know whether lookup will produce errors when publicLookup does not.</div><div><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><b>Charles Oliver Nutter</b><div><i>Architect and Technologist</i></div><div>Headius Enterprises</div><a href="https://www.headius.com" target="_blank">https://www.headius.com</a><div><div><a href="mailto:headius@headius.com" target="_blank">headius@headius.com</a></div></div></div></div></div></div>