You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 80bab69
Browse filesBrowse the repository at this point in the historyBrowse files
A plugin author now writes `opens com.example to org.scijava.context;`
and nothing more. Context.privateLookupIn(Class) hands out a lookup
created inside the container, and the execution layer reads and writes
@parameter fields through it, since reflective access is checked against
the lookup's module rather than the module calling.
Two things measured rather than assumed, both of which would have been
easy to get wrong:
- privateLookupIn also requires the lookup's module to READ the target's
module. A container never declares that -- plugins depend on it, not
the reverse -- so it must add the edge at runtime with addReads, and
only a module's own code may do that. That is the second reason this
method has to live in Context.
- The capability is scoped to one class. Exposing the container's
general-purpose lookup would let any holder reflect into anything
opened to the container; returning privateLookupIn(type, ...) instead
yields a lookup limited to that class, and makes the execution layer's
side simpler too.
Field access moves from Field.setAccessible to a VarHandle obtained from
the lookup, resolved once per member.
A test asserts the command package is not open to org.scijava.execute, so
that a regression names itself instead of surfacing as a puzzling access
error at run time.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013gJpzGd3ksbME4CN6Tu2ni
0 commit comments