Uploaded image for project: 'Byteman'
  1. Byteman
  2. BYTEMAN-330

Byteman should enable access to members of non-exported classes under Jigsaw



      Byteman has always supported access to private members (fields and methods/constructors) in rule code. However that is challenged by the arrival of the Java Platform Module System (JPMS aka Jigsaw) in JDK9. Rules governing accessibility of members have been changed which means Byteman needs to be updated in order to bypass these restrictions and retain the ability to access private members.

      n.b. there is a related issue to do with rules referencing exported types which are not exported to the unnamed package (it only affects compiled rules). To undertsand the distinction consider the expression

       u = jdk.internal.misc.Unsafe.theUnsafe

      This issue addresses the problem of accessing the private static field of unexported public class. Byteman implements this using reflection and Jigsaw forces Byteman to do a lot more work to obtain a working reflective handle. The related problem arises form the fact that the value used to initialise variable u is of type Unsafe. While it is indeed a public type it is not exported generally. Byteman cannot generate bytecode which references values of this type unless the owning class belongs to a module to which Unsafe is exported. This related issue will be dealt with in a separate issue and a later release.

        Gliffy Diagrams


            Issue Links



                • Assignee:
                  adinn Andrew Dinn
                  adinn Andrew Dinn
                • Votes:
                  0 Vote for this issue
                  1 Start watching this issue


                  • Created: