RFR 8177471: jlink should use the version from java.base.jmod to find modules

Alan Bateman Alan.Bateman at oracle.com
Mon Nov 13 15:09:44 UTC 2017


On 13/11/2017 08:02, Sundararajan Athijegannathan wrote:
> Please review.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8177471
>
> Webrev: http://cr.openjdk.java.net/~sundar/8177471/webrev.00/index.html
>
> Thanks to Mandy for initial (internal) round of review and suggesting 
> me simplifications on my initial version of test.
The update to newModuleFinder looks okay although at L450 then checking 
the major version is probably enough (re-creating the module finder when 
the versions aren't equal is okay too).

The changes to ImageHelper bring several questions on whether 
NoSuchElementException is possible. I think this is closer to what you 
want there:

         Runtime.Version v = cf.findModule("java.base")
                 .map(ResolvedModule::reference)
                 .map(ModuleReference::descriptor)
                 .flatMap(ModuleDescriptor::version)
                 .map(ModuleDescriptor.Version::toString)
                 .map(Runtime.Version::parse)
                 .orElse(Runtime.version());

-Alan.


More information about the jigsaw-dev mailing list