src/java.base/share/classes/jdk/internal/module/ArchivedModuleGraph.java
changeset 51371 3ab8b84e93cd
parent 50951 b96466cdfc45
child 52872 357d2b80748d
--- a/src/java.base/share/classes/jdk/internal/module/ArchivedModuleGraph.java	Thu Aug 09 15:52:23 2018 -0700
+++ b/src/java.base/share/classes/jdk/internal/module/ArchivedModuleGraph.java	Fri Aug 10 00:35:57 2018 -0400
@@ -25,6 +25,7 @@
 
 package jdk.internal.module;
 
+import java.lang.module.Configuration;
 import java.lang.module.ModuleFinder;
 import java.util.Objects;
 import jdk.internal.misc.VM;
@@ -36,13 +37,18 @@
     private static String archivedMainModule;
     private static SystemModules archivedSystemModules;
     private static ModuleFinder archivedModuleFinder;
+    private static Configuration archivedConfiguration;
 
     private final SystemModules systemModules;
     private final ModuleFinder finder;
+    private final Configuration configuration;
 
-    private ArchivedModuleGraph(SystemModules modules, ModuleFinder finder) {
+    private ArchivedModuleGraph(SystemModules modules,
+                                ModuleFinder finder,
+                                Configuration configuration) {
         this.systemModules = modules;
         this.finder = finder;
+        this.configuration = configuration;
     }
 
     SystemModules systemModules() {
@@ -53,27 +59,36 @@
         return finder;
     }
 
+    Configuration configuration() {
+        return configuration;
+    }
+
     // A factory method that ModuleBootstrap can use to obtain the
     // ArchivedModuleGraph.
     static ArchivedModuleGraph get(String mainModule) {
         if (Objects.equals(mainModule, archivedMainModule)
                 && archivedSystemModules != null
-                && archivedModuleFinder != null) {
+                && archivedModuleFinder != null
+                && archivedConfiguration != null) {
             return new ArchivedModuleGraph(archivedSystemModules,
-                                           archivedModuleFinder);
+                                           archivedModuleFinder,
+                                           archivedConfiguration);
         } else {
             return null;
         }
     }
 
     // Used at CDS dump time
-    static void archive(String mainModule, SystemModules systemModules,
-                        ModuleFinder finder) {
+    static void archive(String mainModule,
+                        SystemModules systemModules,
+                        ModuleFinder finder,
+                        Configuration configuration) {
         if (archivedMainModule != null)
             throw new UnsupportedOperationException();
         archivedMainModule = mainModule;
         archivedSystemModules = systemModules;
         archivedModuleFinder = finder;
+        archivedConfiguration = configuration;
     }
 
     static {