-
Feature Request
-
Resolution: Done
-
Major
-
4.0.0-BETA2
-
None
-
None
The Byteman compiler translates rules to bytecode which is attached to a class located in the unnamed module. This means that the generated bytecode may not reference public classes that are not generally exported by their containing module. To understand the distinction consider the expression
BIND
u = jdk.internal.misc.Unsafe.theUnsafe
The value used to initialise variable u is of type Unsafe. While Unsafe is indeed a public type it is not exported to the unnamed module. As a consequence, the generated bytecode suffers a verifier error at any point when the value u is consumed.
A poor solution to this problem would be to type the value as Object and perform accesses using reflection wherever possible. A better solution might be to generate the bytecode attached to a class located in a module dynamically created by Byteman to which the necessary packages were exported.
- is related to
-
BYTEMAN-330 Byteman should enable access to members of non-exported classes under Jigsaw
- Closed
-
BYTEMAN-288 Byteman should allow calls to methods of private static inner classes from generated bytecode
- Closed
-
BYTEMAN-318 IllegalAccessException when attempting to access the public method of a private class
- Closed