8291512: Snippetize modules API examples

Reviewed-by: darcy
This commit is contained in:
Mark Reinhold 2022-07-28 18:22:59 +00:00
parent 36c00fdd74
commit 1d16c91ba7
4 changed files with 14 additions and 21 deletions

View file

@ -83,11 +83,10 @@ import jdk.internal.vm.annotation.Stable;
* parent configuration. It prints the name of each resolved module and the
* names of the modules that each module reads. </p>
*
* <pre>{@code
* {@snippet :
* Path dir1 = ..., dir2 = ..., dir3 = ...;
* ModuleFinder finder = ModuleFinder.of(dir1, dir2, dir3);
*
* Configuration parent = ModuleLayer.boot().configuration();
*
* Configuration cf = parent.resolve(finder, ModuleFinder.of(), Set.of("myapp"));
* cf.modules().forEach(m -> {
* System.out.format("%s -> %s%n",
@ -96,7 +95,7 @@ import jdk.internal.vm.annotation.Stable;
* .map(ResolvedModule::name)
* .collect(Collectors.joining(", ")));
* });
* }</pre>
* }
*
* @since 9
* @see java.lang.ModuleLayer