Substitution (aka aliases)

Alan Bateman Alan.Bateman at oracle.com
Thu Apr 12 11:47:21 PDT 2012


On 05/04/2012 23:58, Mandy Chung wrote:
> I have implemented the runtime support for substitution, aka aliases, 
> that supports refactoring via aggregation and also allows a module to 
> resolve against any one of a set of equivalent implementation modules 
> [1].   The provides clause declares an alias name for a module:
>    module foo {
>         provides bar;
>    }
>
> Any module requiring bar can be satisfied by foo.
>
> Webrev:
>     http://cr.openjdk.java.net/~mchung/jigsaw/webrevs/aliases/
I went through all the changes, good work! It's nice to get rid of the 
directories for the views along with the copy of the module info classes.

As you pointed out, most of the changes are in SimpleLibrary so I spent 
the most time there.

On the lock file, it only need only be opened for writing to get an 
exclusive lock.

What would you think of Dictionary instead of ModuleDirectory for the 
inner case name (Catalog comes to mind too but that's already used)? 
Could it extend MetaData too?

Minor comment but the private modifier on every method is a bit of a 
distraction in ModuleDirectory.

ModuleDirectory.refresh could use DirectoryStream to iterate over the 
directory and would avoid the canRead check (which isn't reliable on all 
platforms anyway). The newDirectoryStream method will fail if the 
directory can't be opened which is what is needed.

A couple of minor nits, inconsistent indent in Catalog.java L143, 
RemoteRepository.java L337, Commands.java L182. One other nit is the 
copyright date on hello-alias.sh.

Otherwise I think this is good. As you noted, the main open question 
here is whether aliases should have version numbers.

-Alan.







More information about the jigsaw-dev mailing list