Configuration#resolve and Configuration#resolveAndBind.
Implementation Note
The resolver is used at VM startup and so deliberately avoids using lambda and stream usages in code paths used during startup.
| Modifier and Type | Field and Description |
|---|---|
| private final ModuleFinder | |
| private final ModuleFinder | |
| private boolean | |
| private final Map | |
| private final List | |
| private String | |
| private final PrintStream | |
| private Set | |
| private Set |
| Access | Constructor and Description |
|---|---|
| pack-priv | Resolver(ModuleFinder beforeFinder, List<Configuration> parents, ModuleFinder afterFinder, PrintStream traceOutput)
|
| Modifier and Type | Method and Description |
|---|---|
| private Set | addFoundAutomaticModules()
Add all automatic modules that have not already been found to the nameToReference map. |
| private void | |
| pack-priv Resolver | |
| pack-priv Resolver | bind(boolean
true if incubator modules are candidates to
add to the module graph bindIncubatorModules)Augments the set of resolved modules with modules induced by the service-use relation. |
| private void | checkExportSuppliers(Map<ResolvedModule, Set<ResolvedModule>> graph)
Checks the readability graph to ensure that
|
| private void | checkHashes()
Checks the hashes in the module descriptor to ensure that they match any recorded hashes. |
| private void | checkTargetPlatform(String mn, ModuleTarget target)
Check that the module's constraints on the target platform does conflict with the constraint of other modules resolved so far. |
| private ResolvedModule | computeIfAbsent(Map<String, ResolvedModule> map, String name, Configuration cf, ModuleReference mref)
Equivalent to |
| private String | cycleAsString(ModuleDescriptor descriptor)
Returns a String with a list of the modules in a detected cycle. |
| private void | |
| private void | failTwoSuppliers(ModuleDescriptor descriptor, String source, ModuleDescriptor supplier1, ModuleDescriptor supplier2)
Fail because a module in the configuration exports the same package to a module that reads both. |
| private Set | findAll()
Returns the set of all modules that are observable with the before and after ModuleFinders. |
| private static void | |
| private ResolvedModule | |
| private ModuleReference | |
| private ModuleReference | |
| pack-priv Map | finish(Configuration cf)
Execute post-resolution checks and returns the module graph of resolved modules as a map. |
| private boolean | |
| private Map | makeGraph(Configuration cf)
Computes the readability graph for the modules in the given Configuration. |
| private String | |
| private static String | |
| private boolean | requiresStaticMissingModule(ModuleDescriptor descriptor, Set<ResolvedModule> reads)
Returns true if a module 'requires static' a module that is not in the readability graph, or reads a module that 'requires static transitive' a module that is not in the readability graph. |
| pack-priv Resolver | |
| private Set | Returns: The set of module resolved by this invocation of resolveResolve all modules in the given queue. |
| private static void | resolveFail(String fmt, Object... args)
Throw ResolutionException with the given format string and arguments |
| pack-priv String | |
| private void | |
| private void |
| afterFinder | back to summary |
|---|---|
| private final ModuleFinder afterFinder | |
| beforeFinder | back to summary |
|---|---|
| private final ModuleFinder beforeFinder | |
| haveAllAutomaticModules | back to summary |
|---|---|
| private boolean haveAllAutomaticModules | |
| nameToReference | back to summary |
|---|---|
| private final Map<String, ModuleReference> nameToReference | |
| parents | back to summary |
|---|---|
| private final List<Configuration> parents | |
| targetPlatform | back to summary |
|---|---|
| private String targetPlatform | |
| traceOutput | back to summary |
|---|---|
| private final PrintStream traceOutput | |
| visited | back to summary |
|---|---|
| private Set<ModuleDescriptor> visited | |
| visitPath | back to summary |
|---|---|
| private Set<ModuleDescriptor> visitPath | |
| Resolver | back to summary |
|---|---|
pack-priv Resolver(ModuleFinder beforeFinder, List<Configuration> parents, ModuleFinder afterFinder, PrintStream traceOutput)
| |
| addFoundAutomaticModules | back to summary |
|---|---|
| private Set Add all automatic modules that have not already been found to the nameToReference map. | |
| addFoundModule | back to summary |
|---|---|
| private void addFoundModule(ModuleReference mref) Add the module to the nameToReference map. Also check any constraints on the target platform with the constraints of other modules. | |
| bind | back to summary |
|---|---|
| pack-priv Resolver bind() Augments the set of resolved modules with modules induced by the service-use relation. | |
| bind | back to summary |
|---|---|
| pack-priv Resolver bind(boolean bindIncubatorModules) Augments the set of resolved modules with modules induced by the service-use relation.
| |
| checkExportSuppliers | back to summary |
|---|---|
| private void checkExportSuppliers(Map<ResolvedModule, Set<ResolvedModule>> graph) Checks the readability graph to ensure that
| |
| checkHashes | back to summary |
|---|---|
| private void checkHashes() Checks the hashes in the module descriptor to ensure that they match any recorded hashes. | |
| checkTargetPlatform | back to summary |
|---|---|
| private void checkTargetPlatform(String mn, ModuleTarget target) Check that the module's constraints on the target platform does conflict with the constraint of other modules resolved so far. | |
| computeIfAbsent | back to summary |
|---|---|
| private ResolvedModule computeIfAbsent(Map<String, ResolvedModule> map, String name, Configuration cf, ModuleReference mref) Equivalent to | |
| cycleAsString | back to summary |
|---|---|
| private String cycleAsString(ModuleDescriptor descriptor) Returns a String with a list of the modules in a detected cycle. | |
| detectCycles | back to summary |
|---|---|
| private void detectCycles() Checks the given module graph for cycles. For now the implementation is a simple depth first search on the dependency graph. We'll replace this later, maybe with Tarjan. | |
| failTwoSuppliers | back to summary |
|---|---|
| private void failTwoSuppliers(ModuleDescriptor descriptor, String source, ModuleDescriptor supplier1, ModuleDescriptor supplier2) Fail because a module in the configuration exports the same package to a module that reads both. This includes the case where a module M containing a package p reads another module that exports p to at least module M. | |
| findAll | back to summary |
|---|---|
| private Set Returns the set of all modules that are observable with the before and after ModuleFinders. | |
| findFail | back to summary |
|---|---|
| private static void findFail(String fmt, Object... args) Throw FindException with the given format string and arguments | |
| findInParent | back to summary |
|---|---|
| private ResolvedModule findInParent(String mn) Find a module of the given name in the parent configurations | |
| findWithAfterFinder | back to summary |
|---|---|
| private ModuleReference findWithAfterFinder(String mn) Invokes the afterFinder to find method to find the given module. | |
| findWithBeforeFinder | back to summary |
|---|---|
| private ModuleReference findWithBeforeFinder(String mn) Invokes the beforeFinder to find method to find the given module. | |
| finish | back to summary |
|---|---|
| pack-priv Map Execute post-resolution checks and returns the module graph of resolved modules as a map. | |
| isTracing | back to summary |
|---|---|
| private boolean isTracing() Tracing support | |
| makeGraph | back to summary |
|---|---|
| private Map Computes the readability graph for the modules in the given Configuration. The readability graph is created by propagating "requires" through the "requires transitive" edges of the module dependence graph. So if the module dependence graph has m1 requires m2 && m2 requires transitive m3 then the resulting readability graph will contain m1 reads m2, m1 reads m3, and m2 reads m3. | |
| nameAndInfo | back to summary |
|---|---|
| private String nameAndInfo(ModuleReference mref) | |
| packageName | back to summary |
|---|---|
| private static String packageName(String cn) Returns the package name | |
| requiresStaticMissingModule | back to summary |
|---|---|
| private boolean requiresStaticMissingModule(ModuleDescriptor descriptor, Set<ResolvedModule> reads) Returns true if a module 'requires static' a module that is not in the readability graph, or reads a module that 'requires static transitive' a module that is not in the readability graph. | |
| resolve | back to summary |
|---|---|
| pack-priv Resolver resolve(Collection<String> roots) Resolves the given named modules. | |
| resolve | back to summary |
|---|---|
| private Set Resolve all modules in the given queue. On completion the queue will be
empty and any resolved modules will be added to
| |
| resolveFail | back to summary |
|---|---|
| private static void resolveFail(String fmt, Object... args) Throw ResolutionException with the given format string and arguments | |
| targetPlatform | back to summary |
|---|---|
| pack-priv String targetPlatform() | |
| trace | back to summary |
|---|---|
| private void trace(String fmt, Object... args) | |
| visit | back to summary |
|---|---|
| private void visit(ModuleDescriptor descriptor) | |