< prev index next >

src/java.base/share/classes/jdk/internal/module/Builder.java

Print this page




  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package jdk.internal.module;
  26 
  27 import java.lang.module.ModuleDescriptor;
  28 import java.lang.module.ModuleDescriptor.Exports;
  29 import java.lang.module.ModuleDescriptor.Opens;
  30 import java.lang.module.ModuleDescriptor.Provides;
  31 import java.lang.module.ModuleDescriptor.Requires;
  32 import java.lang.module.ModuleDescriptor.Version;
  33 import java.util.List;
  34 import java.util.Set;
  35 
  36 import jdk.internal.misc.JavaLangModuleAccess;
  37 import jdk.internal.misc.SharedSecrets;
  38 
  39 /**
  40  * This builder is optimized for reconstituting the {@code ModuleDescriptor}s
  41  * for system modules.  The validation should be done at jlink time.
  42  *
  43  * 1. skip name validation
  44  * 2. ignores dependency hashes.
  45  * 3. ModuleDescriptor skips the defensive copy and directly uses the
  46  *    sets/maps created in this Builder.
  47  *
  48  * SystemModules should contain modules for the boot layer.
  49  */
  50 final class Builder {
  51     private static final JavaLangModuleAccess JLMA =
  52         SharedSecrets.getJavaLangModuleAccess();
  53 
  54     // Static cache of the most recently seen Version to cheaply deduplicate
  55     // most Version objects.  JDK modules have the same version.
  56     static Version cachedVersion;
  57 




  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package jdk.internal.module;
  26 
  27 import java.lang.module.ModuleDescriptor;
  28 import java.lang.module.ModuleDescriptor.Exports;
  29 import java.lang.module.ModuleDescriptor.Opens;
  30 import java.lang.module.ModuleDescriptor.Provides;
  31 import java.lang.module.ModuleDescriptor.Requires;
  32 import java.lang.module.ModuleDescriptor.Version;
  33 import java.util.List;
  34 import java.util.Set;
  35 
  36 import jdk.internal.access.JavaLangModuleAccess;
  37 import jdk.internal.access.SharedSecrets;
  38 
  39 /**
  40  * This builder is optimized for reconstituting the {@code ModuleDescriptor}s
  41  * for system modules.  The validation should be done at jlink time.
  42  *
  43  * 1. skip name validation
  44  * 2. ignores dependency hashes.
  45  * 3. ModuleDescriptor skips the defensive copy and directly uses the
  46  *    sets/maps created in this Builder.
  47  *
  48  * SystemModules should contain modules for the boot layer.
  49  */
  50 final class Builder {
  51     private static final JavaLangModuleAccess JLMA =
  52         SharedSecrets.getJavaLangModuleAccess();
  53 
  54     // Static cache of the most recently seen Version to cheaply deduplicate
  55     // most Version objects.  JDK modules have the same version.
  56     static Version cachedVersion;
  57 


< prev index next >