8152650: ModuleFinder.compose should accept varargs

Reviewed-by: mchung
This commit is contained in:
Alan Bateman 2016-05-21 08:00:14 +01:00
parent f56536a6bf
commit f243b8ec01
2 changed files with 6 additions and 7 deletions

View File

@ -427,7 +427,7 @@ public final class TemplatesImpl implements Templates, Serializable {
Layer bootLayer = Layer.boot();
Configuration cf = bootLayer.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of(mn));
.resolveRequires(finder, ModuleFinder.of(), Set.of(mn));
PrivilegedAction<Layer> pa = () -> bootLayer.defineModules(cf, name -> loader);
Layer layer = AccessController.doPrivileged(pa);

View File

@ -21,7 +21,6 @@
* questions.
*/
import static java.lang.module.ModuleFinder.empty;
import static org.testng.Assert.assertSame;
import static org.testng.Assert.assertTrue;
@ -97,7 +96,7 @@ public class LayerModularXMLParserTest {
public void testOneLayer() throws Exception {
ModuleFinder finder1 = ModuleFinder.of(MOD_DIR1);
Configuration cf1 = Layer.boot().configuration()
.resolveRequiresAndUses(finder1, empty(), Set.of("test"));
.resolveRequiresAndUses(finder1, ModuleFinder.of(), Set.of("test"));
ClassLoader scl = ClassLoader.getSystemClassLoader();
Layer layer1 = Layer.boot().defineModulesWithManyLoaders(cf1, scl);
ClassLoader cl1 = layer1.findLoader("test");
@ -127,12 +126,12 @@ public class LayerModularXMLParserTest {
public void testTwoLayer() throws Exception {
ModuleFinder finder1 = ModuleFinder.of(MOD_DIR1);
Configuration cf1 = Layer.boot().configuration()
.resolveRequiresAndUses(finder1, empty(), Set.of("test"));
.resolveRequiresAndUses(finder1, ModuleFinder.of(), Set.of("test"));
ClassLoader scl = ClassLoader.getSystemClassLoader();
Layer layer1 = Layer.boot().defineModulesWithManyLoaders(cf1, scl);
ModuleFinder finder2 = ModuleFinder.of(MOD_DIR2);
Configuration cf2 = cf1.resolveRequiresAndUses(finder2, empty(), Set.of("test"));
Configuration cf2 = cf1.resolveRequiresAndUses(finder2, ModuleFinder.of(), Set.of("test"));
Layer layer2 = layer1.defineModulesWithOneLoader(cf2, layer1.findLoader("test"));
ClassLoader cl2 = layer2.findLoader("test");
@ -161,12 +160,12 @@ public class LayerModularXMLParserTest {
public void testTwoLayerWithDuplicate() throws Exception {
ModuleFinder finder1 = ModuleFinder.of(MOD_DIR1, MOD_DIR2);
Configuration cf1 = Layer.boot().configuration()
.resolveRequiresAndUses(finder1, empty(), Set.of("test"));
.resolveRequiresAndUses(finder1, ModuleFinder.of(), Set.of("test"));
ClassLoader scl = ClassLoader.getSystemClassLoader();
Layer layer1 = Layer.boot().defineModulesWithManyLoaders(cf1, scl);
ModuleFinder finder2 = ModuleFinder.of(MOD_DIR2);
Configuration cf2 = cf1.resolveRequiresAndUses(finder2, empty(), Set.of("test"));
Configuration cf2 = cf1.resolveRequiresAndUses(finder2, ModuleFinder.of(), Set.of("test"));
Layer layer2 = layer1.defineModulesWithOneLoader(cf2, layer1.findLoader("test"));
ClassLoader cl2 = layer2.findLoader("test");