8170987: Module system implementation refresh (12/2016)

Mandy Chung mandy.chung at oracle.com
Thu Dec 15 01:17:19 UTC 2016

> The webrevs with the changes for this update are here:
>   http://cr.openjdk.java.net/~alanb/8170987/1

I have pushed the change to rename jdk.crypto.pkcs11 and jdk.pack200
and dropped java.compact$N.  So module-info.java changes will not be 
needed when you sync with jdk9/dev.

I reviewed all changes except javac/javadoc changes.  Looks good in 


115 /**
116 * Returns {@code true} if the given name is a legal binary name.
117 */
118 public static boolean isJavaIdentifier(String name) {

Not sure if it’s intended to have the javadoc for isJavaIdentifier 
method be the same as isBinaryName.

When we use —-module-version for user modules, the runtime will load
regex.  The system modules jlink plugin uses the cached version if
JDK modules to be compiled with —0module-version in the future.
This might be something we should look at in the future for performance.


  64             throw new RuntimeException("cannot add deprecated to " + value);

This comment applies to ModuleResoluton::with* methods.  This should
probably be an InternalError?  

 108         return String.valueOf(value);

Nit: since you override toString method, might be helpful to print
an informative description.  


1102             if (value.equals("deprecated"))
1103                 return (new ModuleResolution(0)).withDeprecated();
1104             else if (value.equals("deprecated-for-removal"))
1105                 return (new ModuleResolution(0)).withDeprecatedForRemoval();
1106             else if (value.equals("incubating"))
1107                 return (new ModuleResolution(0)).withIncubating();

Why not passing the flag to ModuleResolution constructor?  Similar
statement is also in sun/tools/jar/GNUStyleOptions.java.

I was wondering if jmod describe and jar —-print-module-descriptor should
print all optional attributes.  While the module resolution is of limited
use, it would be handy to print all optional attributes, if present rather
than having to run javap.

It’s okay to follow up as a separate JBS issue if we want to do that.

  @modules jdk.jlink jdk.jartool are missing.  I have fixed it.


More information about the compiler-dev mailing list