On Fri, 25 Nov 2022 14:38:55 GMT, Adam Sotona <asot...@openjdk.org> wrote:

> 8294962: java.base jdk.internal.module package uses ASM to modify and write 
> module-info.class.
> This patch converts it to use Classfile API.
> 
> Please review.
> Thanks,
> Adam

src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java line 
165:

> 163:                 List<PackageDesc> packageNames = packages.stream()
> 164:                         .sorted()
> 165:                         .map(s -> PackageDesc.of(s))

Suggestion:

                        .map(PackageDesc::of)

src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java line 
170:

> 168:             }
> 169: 
> 170:             // add ModuleTarget, ModuleResolution and ModuleHashes 
> attributes

This adds or replaces if the attribute exists.  Perhaps just drop "add" from 
the comment?

src/java.base/share/classes/jdk/internal/module/ModuleInfoWriter.java line 138:

> 136:                     for (ModuleDescriptor.Provides p : md.provides()) {
> 137:                         mb.provides(ClassDesc.of(p.service()),
> 138:                                         p.providers()

Formatting nit: align `p.providers()` with the first parameter to `mb.provides` 
- a little confusing with current indentation.

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

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

Reply via email to