configuration being stored for modules that don't have entry points.

Alan Bateman Alan.Bateman at oracle.com
Wed Feb 22 13:57:52 PST 2012


On 22/02/2012 20:27, Mandy Chung wrote:
> Alan,
>
> I agree with you that both of these install methods should be 
> consistent.  As for your patch,  should it call 
> configure(res.modulesNeeded()) instead of configure(null)? That's what 
> the install(Collection<File>....) method calls.  Although the current 
> implementation ignores the given mids for the installed modules, 
> ultimately we want to re-generate the configurations according some 
> policy which will probably be smart to take the list of installed 
> modules into account.
>
> It might be my issue of incorrect reading of the code - this install 
> method (from a given Resolution) only configures one root module while 
> the install from jmod files configures all root modules in the current 
> prototype.  I would have thought it's smaller.  Probably I'm missing 
> some key point here - can you help and explain?
You're right, we should pass in the set of modules, even if it's just 
not used yet.

The current code creates a configuration for the root module without 
checking if it has an entry point. Also the installation may have 
includes modules that would change the configuration of other modules. 
So for now I think re-generating the configuration of all modules with 
entry points is okay. Clearly there needs to be policy discussion.

-Alan


diff --git a/src/share/classes/org/openjdk/jigsaw/SimpleLibrary.java 
b/src/share/classes/org/openjdk/jigsaw/SimpleLibrary.java
--- a/src/share/classes/org/openjdk/jigsaw/SimpleLibrary.java
+++ b/src/share/classes/org/openjdk/jigsaw/SimpleLibrary.java
@@ -1486,9 +1486,7 @@

          // Configure
          //
-        Configuration<Context> cf
-            = Configurator.configure(this, res);
-        new StoredConfiguration(findModuleDir(root.id()), cf).store();
+       configure(res.modulesNeeded());
      }

      @Override
@@ -1538,7 +1536,7 @@
       *          {@code null} if the configuration of every root module
       *          should be (re)computed
       */
-    public void configure(List<ModuleId> mids)
+    public void configure(Collection<ModuleId> mids)
          throws ConfigurationException, IOException
      {
          // ## mids not used yet



More information about the jigsaw-dev mailing list