-
Bug
-
Resolution: Done
-
Major
-
2.2.2
-
None
Byteman bypasses the normal restrictions limiting access to private, protected or package-private/protected methods and fields. When interpreting code this happens automatically because the interpreter uses reflection to do the access. When compilation of rules to bytecode is enabled Byteman has to be smarter because bytecode level security checks throw a java.lang.IllegalAccessError bytecode if the accessis attempted from the wrong scope (i.e. the associated helper class). The trick is to make the relevant Field or Method instance available to the bytecode and plant instructions in the bytecode which perform the access reflectively.
This trick has been used to enable calls to private, protected and package-private/protected methods from generated bytecode. However, it has been omitted from a specific corner case: invoking public methods of private, protected or package-protected static inner classes. These cases need to be detected and the same trick applied as per the existing cases.
- causes
-
BYTEMAN-318 IllegalAccessException when attempting to access the public method of a private class
- Closed
- duplicates
-
BYTEMAN-236 Instances of anonymous classes cannot be accessed via bound vars in compiled rule code
- Closed
- relates to
-
BYTEMAN-331 Byteman should enable references to unexported module-public classes from compiled rules
- Closed