RFR: 8294962: Convert java.base/jdk.internal.module package to use the Classfile API to modify and write module-info.class [v6]

Mandy Chung mchung at openjdk.org
Tue Mar 14 17:23:33 UTC 2023


On Tue, 14 Mar 2023 17:17:10 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/module/ModuleInfoWriter.java line 150:
>> 
>>> 148:                 // packages
>>> 149:                 var packages = md.packages().stream().sorted().map(PackageDesc::of).toList();
>>> 150:                 if (!packages.isEmpty()) {
>> 
>> This check should be `if (md.packages().size() > exportedOrOpen)` or a bug in ModuleInfoWriter?
>
> An oddity in ModuleInfoWriter that I think dates from when a prototype version of this attribute contains the set of concealed packages. There's no need for ModuleInfoWriter to emit the ModulePackages attribute, Adam has chosen to have it emit it. It has implications for one test for ModuleDescriptor.read, and he's changed that.

Ok.   We should move this out to the test library as you suggested since it's only used by the tests.  I will create a JBS issue for it.

-------------

PR: https://git.openjdk.org/jdk/pull/11368


More information about the core-libs-dev mailing list