26 package jdk.internal.module; 27 28 import java.lang.module.Configuration; 29 import java.lang.module.ModuleDescriptor; 30 import java.lang.module.ModuleFinder; 31 import java.lang.module.ModuleReference; 32 import java.lang.module.ResolvedModule; 33 import java.net.URI; 34 import java.security.AccessController; 35 import java.security.PrivilegedAction; 36 import java.util.List; 37 import java.util.Map; 38 import java.util.Optional; 39 import java.util.Set; 40 import java.util.function.Function; 41 import java.util.stream.Collectors; 42 43 import jdk.internal.loader.BootLoader; 44 import jdk.internal.loader.BuiltinClassLoader; 45 import jdk.internal.loader.ClassLoaders; 46 import jdk.internal.misc.JavaLangAccess; 47 import jdk.internal.misc.SharedSecrets; 48 49 /** 50 * A helper class for creating and updating modules. This class is intended to 51 * support command-line options, tests, and the instrumentation API. It is also 52 * used by the VM to load modules or add read edges when agents are instrumenting 53 * code that need to link to supporting classes. 54 * 55 * The parameters that are package names in this API are the fully-qualified 56 * names of the packages as defined in section 6.5.3 of <cite>The Java™ 57 * Language Specification </cite>, for example, {@code "java.lang"}. 58 */ 59 60 public class Modules { 61 private Modules() { } 62 63 private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess(); 64 65 /** 66 * Creates a new Module. The module has the given ModuleDescriptor and 67 * is defined to the given class loader. | 26 package jdk.internal.module; 27 28 import java.lang.module.Configuration; 29 import java.lang.module.ModuleDescriptor; 30 import java.lang.module.ModuleFinder; 31 import java.lang.module.ModuleReference; 32 import java.lang.module.ResolvedModule; 33 import java.net.URI; 34 import java.security.AccessController; 35 import java.security.PrivilegedAction; 36 import java.util.List; 37 import java.util.Map; 38 import java.util.Optional; 39 import java.util.Set; 40 import java.util.function.Function; 41 import java.util.stream.Collectors; 42 43 import jdk.internal.loader.BootLoader; 44 import jdk.internal.loader.BuiltinClassLoader; 45 import jdk.internal.loader.ClassLoaders; 46 import jdk.internal.access.JavaLangAccess; 47 import jdk.internal.access.SharedSecrets; 48 49 /** 50 * A helper class for creating and updating modules. This class is intended to 51 * support command-line options, tests, and the instrumentation API. It is also 52 * used by the VM to load modules or add read edges when agents are instrumenting 53 * code that need to link to supporting classes. 54 * 55 * The parameters that are package names in this API are the fully-qualified 56 * names of the packages as defined in section 6.5.3 of <cite>The Java™ 57 * Language Specification </cite>, for example, {@code "java.lang"}. 58 */ 59 60 public class Modules { 61 private Modules() { } 62 63 private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess(); 64 65 /** 66 * Creates a new Module. The module has the given ModuleDescriptor and 67 * is defined to the given class loader. |