Lokkup.find* do not add read edges like reflection does
Alan.Bateman at oracle.com
Tue Dec 6 21:04:40 UTC 2016
On 06/12/2016 19:41, Remi Forax wrote:
> Hi all,
> when using Method.invoke, we automatically add a read edge between the current class and the called class when invoking a method by reflection but if one uses methods lookup.find*,
> he had to add the read edge manually. I think we should harmonize the behavior and add a read edge when using java.lang.invoke API too.
Core reflection doesn't actually add read edges of course, it instead
just assumes readability. This avoids needing to change code using core
reflection when migrating that code to explicit modules.
The reason that java.lang.invoke checks readability is because it's
aligned with bytecode. It would be a significant change if the access
checks in java.lang.invoke differed to bytecode.
More information about the jigsaw-dev