8177530: Module system implementation refresh (4/2017)

Co-authored-by: Harold Seigel <harold.seigel@oracle.com>
Co-authored-by: Mandy Chung <mandy.chung@oracle.com>
Reviewed-by: lfoltan, sspitsyn
This commit is contained in:
Alan Bateman 2017-04-07 08:04:46 +00:00
parent 4ffa7d7bfc
commit a3ab143c64
90 changed files with 477 additions and 464 deletions

View file

@ -25,7 +25,6 @@
import static jdk.test.lib.Asserts.*;
import java.lang.reflect.Layer;
import java.lang.module.Configuration;
import java.lang.module.ModuleDescriptor;
import java.lang.module.ModuleFinder;
@ -45,7 +44,7 @@ import java.util.Set;
//
public class ModuleSameCLMain {
// Create a Layer over the boot layer.
// Create a layer over the boot layer.
// Define modules within this layer to test access between
// publically defined classes within packages of those modules.
public void createLayerOnBoot() throws Throwable {
@ -75,7 +74,7 @@ public class ModuleSameCLMain {
ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
// Resolves "m1x"
Configuration cf = Layer.boot()
Configuration cf = ModuleLayer.boot()
.configuration()
.resolve(finder, ModuleFinder.of(), Set.of("m1x"));
@ -85,8 +84,8 @@ public class ModuleSameCLMain {
map.put("m1x", cl1);
map.put("m2x", cl1);
// Create Layer that contains m1x & m2x
Layer layer = Layer.boot().defineModules(cf, map::get);
// Create layer that contains m1x & m2x
ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
assertTrue(layer.findLoader("m1x") == cl1);
assertTrue(layer.findLoader("m2x") == cl1);
assertTrue(layer.findLoader("java.base") == null);