FYI, we just had a useful conversation about how the
new readability
restrictions from Jigsaw modules should affect the
MHs.Lookup API.
Specifically, we need a couple more access modes to
represent the new
layers of type readability (interacts with lookup
and accessibility),
plus a special behavior (another access mode bit)
for publicLookup,
to represent the fact that there is no longer a true
global scope.
Given the increased complexity of access layers we
also want to
add a (trivial) API point to directly drop access
mode bits from a Lookup.
See http://mail.openjdk.java.net/pipermail/jigsaw-dev/2015-December/005829.html
(copied below) and nearby messages.
The Jigsaw guys have a charming name for what
Lookup.in does:
It "teleports" a lookup to another location.
 Teleporting outside a module
tends to shut down all access rights (to preserve
monotonicity of privilege),
except for publicLookup which retains its special
globalized viewpoint.
This is a refinement on the current Lookup
enhancement in the Jigsaw repo.
As one consequence, the publicLookup.lookupClass can
go back to
being Object, and is usefully teleportable
elsewhere, so that (in turn)
it is broadly useful with the new API point
Lookup.findClass, which
uses the lookupClass as a starting point for name
resolution.
— John
Begin forwarded message:
Subject: Re: MethodHandles.Lookup
and modules
Date: December 18, 2015 at 12:20:08 AM PST