Oracle Corporation
Confining reflective access based on module boundaries
Last updated:
Abstract:
A module (m1) is allowed to gain private reflective access to any class in any module (C2 in m2), if and only if m2 grants to m1 deep reflective access for C2. A caller class may invoke a method to generate a second lookup object associated with a second principal class based on a first lookup object associated with a first principal class. The method is successfully executed only if (a) an access mode of the first lookup object allows for teleporting with private reflective access and (b) a module including the second principal class grants to a module including the first principal class deep reflective access for the second principal class. The second lookup object drops the access mode allowing for teleporting with private reflective access. Hence reflective access is confined within the limits imposed by module boundaries, as relaxed by access agreements between pairs of modules. The bilateral agreements are not transferable to other modules.
Utility
21 Nov 2019
31 May 2022