Top Description Fields Constructors Methods
jdk.internal.module

pack-priv Class ModulePathValidator

extends Object
Class Inheritance
Imports
java.io.File, .IOException, .PrintStream, java.lang.module.FindException, .ModuleDescriptor, .ModuleFinder, .ModuleReference, java.net.URI, java.nio.file.DirectoryStream, .Files, .NoSuchFileException, .Path, java.nio.file.attribute.BasicFileAttributes, java.util.Comparator, .HashMap, .Map, .Optional, java.util.stream.Stream

A validator to check for errors and conflicts between modules.

Field Summary

Modifier and TypeField and Description
private int
private static final String
private static final String
private final Map<String, ModuleReference>
private final PrintStream
private final Map<String, ModuleReference>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static boolean
isJrt(URI uri)

Returns true if the given URI is a jrt URI

private void
printModule(ModuleReference mref)

Prints the module location and name.

private void
process(ModuleReference mref)

Prints the module location and name, checks if the module is shadowed by a previously seen module, and finally checks for package conflicts with previously seen modules.

private void
scan(Path entry)

Scan an element on a module path.

pack-priv static int

Returns:

the number of errors found
scanAllModules
(PrintStream
the print stream for output messages
out
)

Scans and the validates all modules on the module path.

private void
scanDirectory(Path dir)

Scan the JAR files and exploded modules in a directory.

private Optional<ModuleReference>
scanModule(Path entry)

Scan a JAR file or exploded module.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

errorCountback to summary
private int errorCount
INDENTback to summary
private static final String INDENT
MODULE_INFOback to summary
private static final String MODULE_INFO
nameToModuleback to summary
private final Map<String, ModuleReference> nameToModule
outback to summary
private final PrintStream out
packageToModuleback to summary
private final Map<String, ModuleReference> packageToModule

Constructor Detail

ModulePathValidatorback to summary
private ModulePathValidator(PrintStream out)

Method Detail

isJrtback to summary
private static boolean isJrt(URI uri)

Returns true if the given URI is a jrt URI

printModuleback to summary
private void printModule(ModuleReference mref)

Prints the module location and name.

processback to summary
private void process(ModuleReference mref)

Prints the module location and name, checks if the module is shadowed by a previously seen module, and finally checks for package conflicts with previously seen modules.

scanback to summary
private void scan(Path entry)

Scan an element on a module path. The element is a directory of modules, an exploded module, or a JAR file.

scanAllModulesback to summary
pack-priv static int scanAllModules(PrintStream out)

Scans and the validates all modules on the module path. The module path comprises the upgrade module path, system modules, and the application module path.

Parameters
out:PrintStream

the print stream for output messages

Returns:int

the number of errors found

scanDirectoryback to summary
private void scanDirectory(Path dir)

Scan the JAR files and exploded modules in a directory.

scanModuleback to summary
private Optional<ModuleReference> scanModule(Path entry)

Scan a JAR file or exploded module.