-
Feature Request
-
Resolution: Done
-
Major
-
4.0.0-ALPHA
-
None
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
BIND 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.
- relates to
-
BYTEMAN-331 Byteman should enable references to unexported module-public classes from compiled rules
- Closed