|
|
@@ -1,5 +1,5 @@ |
|
|
/* |
|
|
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. |
|
|
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. |
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
|
* |
|
|
* This code is free software; you can redistribute it and/or modify it |
|
@@ -489,7 +489,7 @@ public static Controller defineModulesWithOneLoader(Configuration cf, |
|
|
List<ModuleLayer> parentLayers, |
|
|
ClassLoader parentLoader) |
|
|
{ |
|
|
List<ModuleLayer> parents = new ArrayList<>(parentLayers); |
|
|
List<ModuleLayer> parents = List.copyOf(parentLayers); |
|
|
checkConfiguration(cf, parents); |
|
|
|
|
|
checkCreateClassLoaderPermission(); |
|
@@ -565,7 +565,7 @@ public static Controller defineModulesWithManyLoaders(Configuration cf, |
|
|
List<ModuleLayer> parentLayers, |
|
|
ClassLoader parentLoader) |
|
|
{ |
|
|
List<ModuleLayer> parents = new ArrayList<>(parentLayers); |
|
|
List<ModuleLayer> parents = List.copyOf(parentLayers); |
|
|
checkConfiguration(cf, parents); |
|
|
|
|
|
checkCreateClassLoaderPermission(); |
|
@@ -649,7 +649,7 @@ public static Controller defineModules(Configuration cf, |
|
|
List<ModuleLayer> parentLayers, |
|
|
Function<String, ClassLoader> clf) |
|
|
{ |
|
|
List<ModuleLayer> parents = new ArrayList<>(parentLayers); |
|
|
List<ModuleLayer> parents = List.copyOf(parentLayers); |
|
|
checkConfiguration(cf, parents); |
|
|
Objects.requireNonNull(clf); |
|
|
|
|
@@ -752,13 +752,12 @@ public Configuration configuration() { |
|
|
return cf; |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
* Returns the list of this layer's parents unless this is the |
|
|
* {@linkplain #empty empty layer}, which has no parents and so an |
|
|
* Returns an unmodifiable list of this layer's parents, in search |
|
|
* order. If this is the {@linkplain #empty() empty layer} then an |
|
|
* empty list is returned. |
|
|
* |
|
|
* @return The list of this layer's parents |
|
|
* @return A possibly-empty unmodifiable list of this layer's parents |
|
|
*/ |
|
|
public List<ModuleLayer> parents() { |
|
|
return parents; |
|
@@ -803,7 +802,7 @@ public Configuration configuration() { |
|
|
private volatile List<ModuleLayer> allLayers; |
|
|
|
|
|
/** |
|
|
* Returns the set of the modules in this layer. |
|
|
* Returns an unmodifiable set of the modules in this layer. |
|
|
* |
|
|
* @return A possibly-empty unmodifiable set of the modules in this layer |
|
|
*/ |
|
|