Avoiding sun.misc.Unsafe and embracing modules in Java libraries: missing links

Alan Bateman Alan.Bateman at oracle.com
Tue Apr 10 09:54:52 UTC 2018

On 09/04/2018 20:48, Rafael Winterhalter wrote:
> Hei Alan,
> maybe I am doing it wrong but this is my example. I created a module 
> with two interfaces bar.Bar and qux.Qux that both define a default 
> method String foo() { return "foo"; }. The module exports bar and 
> exports and opens qux.
> From another module that reads that first module I run the following code:
Thanks for the test.

I think the issue is that findSpecial can never work when invoked on a 
Lookup to a lookup class in a named module and the proposed caller class 
for invokespecial (specialCaller) is in a different module. It's not an 
issue when the lookup class in an unnamed module, or when the lookup 
class in a named module and specialCaller is in the same module.

I'm sure John will jump in but I think if JDK-8173978 is implemented 
then it will go a long way to address this anomaly.


[1] https://bugs.openjdk.java.net/browse/JDK-8173978

More information about the jigsaw-dev mailing list