<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <div class="moz-cite-prefix">On 02/09/2025 17:22, Charles Oliver
      Nutter wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:CAE-f1xQqvYTE1UPiECxJnX6POHGMvYFEj_jJVwv-97Ds5isCSw@mail.gmail.com">
      
      <div dir="ltr">
        <div class="gmail_quote gmail_quote_container">
          <div><br>
          </div>
          <div>> publicLookup has UNCONDITIONAL access so it assumes
            readability (like</div>
          > core reflection). The lookup object obtained with
          MethodsHandles.lookup<br>
          > does not so there may be cases where the caller needs to
          use<br>
          > Module.addReads to add the read edge at runtime. I can't
          tell if this is<br>
          > what you are running it but if you could create a small
          test case
          <div><br>
          </div>
          <div>My first thought after reading this was that perhaps I
            should be using `unreflect` rather than doing my own
            `findVirtual` but since that requires a Lookup object I'd
            expect I'm right back in the same situation.</div>
          <br>
        </div>
      </div>
    </blockquote>
    The access check fails because org.jruby.dist does not read
    jdk.proxy3. If you invoke
    j.l.Module.addReads(proxyClass.getModule()) from code in
    org.jruby.dist then it will add the read edge. Can you try that? <br>
    <br>
    As regards diagnosing this then I think we need improve the
    IllegalAccessExceptions exception messages. A lot of effort went
    into JDK 9 to ensure that the IAE thrown in the core reflection
    access spelled out the reason why the access check failed. Most
    reflection based frameworks used core reflection at the time. We
    should have put more effort into the having the IAE exception
    messages in j.l.invoke as "is not accessible" makes it hard to
    diagnose.<br>
    <br>
    -Alan<br>
  </body>
</html>