JD 9 RFR: JDK-8177311: Denied access when named module accesses unreferences package from the unnamed module

Jan Lahoda jan.lahoda at oracle.com
Tue Mar 21 09:51:04 UTC 2017


I'd like to ask for a review for:
Bug: https://bugs.openjdk.java.net/browse/JDK-8177311

Webrev: http://cr.openjdk.java.net/~jlahoda/8177311/webrev.00/

The problem is this: in Resolve.isAccessible when checks if a module can 
access types from other modules does:
currModule.visiblePackages.get(p.fullname) == p

But if "p" is from an unnamed module, then it may or may not be in the 
visiblePackages (depending on whether Symtab.lookupPackage was called on 
the given package in the context of currModule), as unnamed module 
packages are computed lazily. So this check may fail incorrectly.

The proposal here is to add one more check for the dependency on the 
unnamed module.

How does this look?


More information about the compiler-dev mailing list