Service configuration/context <was> Re: ServiceLoader.load* take 2

Mandy Chung mandy.chung at oracle.com
Thu Jun 28 00:37:21 PDT 2012


On 6/27/2012 7:52 AM, Paul Sandoz wrote:
> [*] I notice that ContextBuilderSetBuilder is adding aliases to the map of context for module view:
>
>    96     private void addContextForModuleView(CB cx, ModuleView mv) {
>    97         contextForModuleView.put(mv.id().name(), cx);
>    98         for (ModuleId alias : mv.aliases()) {
>    99             contextForModuleView.put(alias.name(), cx);
>   100         }
>   101     }
>
> but that information is never re-generated when a stored configuration is loaded in SimpleLibrary:
>
>   598                 Context c = cx.build();
>   599                 assert c.name().equals(cxn);
>   600                 cf.add(c);
>   601
>   602                 for (ModuleId m: c.modules()) {
>   603                     for (ModuleId v: c.views(m)) {
>   604                         cf.put(v.name(), c);
>   605                     }
>   606                 }
>
>   Bug?


In fact, the aliases information are not stored in the configuration.  
It's a bug - good catch.  Currently the jdk implementation doesn't 
depend on it.  This only affects 
ModuleClassLoader.isModulePresent("java.xml") if the parameter is an 
alias name.

Mandy
P.S. I'll try to look at your webrev and understand your proposed 
approach next week.



More information about the jigsaw-dev mailing list