JDK-8256063 : Module::getPackages on an unnamed module may return packages that are in a named module
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang.module
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-11-09
  • Updated: 2020-11-19
  • Resolved: 2020-11-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16 b25Fixed
Related Reports
CSR :  
Sub Tasks
JDK-8256310 :  
Description
If Module::getPackages is invoked on the unnamed module of a class loader then the set of packages returned will include the packages of any named modules that are defined to that class loader.

Fixing this will require a small spec change because Module::getPackages is specified to return the same of packages as ClassLoader::getDefinePackages. It should only return the packages that are in the unnamed module.
Comments
Changeset: dff26a48 Author: Mandy Chung <mchung@openjdk.org> Date: 2020-11-13 00:32:29 +0000 URL: https://github.com/openjdk/jdk/commit/dff26a48
13-11-2020