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

Byteman fails to access members of some unnamed package classes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 4.0.5
    • 4.0.4
    • Parser/Type Checker
    • None

      Byteman employs a private module for use when creating MethodHandles to access non-public fields or methods. Byteman redefines user-defined or system modules to add opens and exports links to the 'byteman' module whenever it needs to access members of non-public classes. The redefine also ensures the 'byteman' module can read the other module.

      On JDK9 this 'byteman' module was automatically able to read /every/ unnamed module without the need explicitly to add a read edge. This changed on JDK10/11. This presents no problem accessing JDK classes or system classpath classes that are located in the unnamed module. Read edges are always added to the bootstrap and system loaders' unnamed modules. However, it fails to allow access to classes loaded by, for example, JBoss Modules loaders which exist in their own unnamed modules.

      So, ti sum up: the code which creates a MethodHandle instance to implement a non-public access needs to ensure that a read edge is in place even when the target class belongs to an unnamed module.

              rhn-engineering-adinn Andrew Dinn
              rhn-engineering-adinn Andrew Dinn
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: