OpenJDK / jdk9 / jdk9 / jdk
changeset 13901:b2a69d66dc65 jdk-9+111
8142968: Module System implementation
Summary: Initial integration of JEP 200, JEP 260, JEP 261, and JEP 282
Reviewed-by: alanb, mchung, naoto, rriggs, psandoz, plevart, mullan, ascarpino, vinnie, prr, sherman, dfuchs, mhaupt
Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, chris.hegarty@oracle.com, alexandr.scherbatiy@oracle.com, amy.lu@oracle.com, calvin.cheung@oracle.com, daniel.fuchs@oracle.com, erik.joelsson@oracle.com, harold.seigel@oracle.com, jaroslav.bachorik@oracle.com, jean-francois.denise@oracle.com, jan.lahoda@oracle.com, james.laskey@oracle.com, lois.foltan@oracle.com, miroslav.kos@oracle.com, huaming.li@oracle.com, sean.mullan@oracle.com, naoto.sato@oracle.com, masayoshi.okutsu@oracle.com, peter.levart@gmail.com, philip.race@oracle.com, claes.redestad@oracle.com, sergey.bylokhov@oracle.com, alexandre.iline@oracle.com, volker.simonis@gmail.com, staffan.larsen@oracle.com, stuart.marks@oracle.com, semyon.sadetsky@oracle.com, serguei.spitsyn@oracle.com, sundararajan.athijegannathan@oracle.com, valerie.peng@oracle.com, vincent.x.ryan@oracle.com, weijun.wang@oracle.com, yuri.nesterenko@oracle.com, yekaterina.kantserova@oracle.com, alexander.kulyakhtin@oracle.com, felix.yang@oracle.com, andrei.eremeev@oracle.com, frank.yuan@oracle.com, sergei.pikalev@oracle.com, sibabrata.sahoo@oracle.com, tiantian.du@oracle.com, sha.jiang@oracle.com
line wrap: on
line diff
--- a/make/CompileInterimRmic.gmk Tue Mar 15 13:48:26 2016 -0700 +++ b/make/CompileInterimRmic.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -44,8 +44,9 @@ $(eval $(call SetupJavaCompilation,BUILD_INTERIM_RMIC, \ SETUP := GENERATE_OLDBYTECODE, \ SRC := $(JDK_TOPDIR)/src/jdk.rmic/share/classes, \ + EXCLUDE_FILES := module-info.java, \ INCLUDES := $(RMIC_PKGS), \ - BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_rmic_classes, \ + BIN := $(BUILDTOOLS_OUTPUTDIR)/override_modules/jdk.rmic, \ COPY := .properties)) ##########################################################################################
--- a/make/CompileTools.gmk Tue Mar 15 13:48:26 2016 -0700 +++ b/make/CompileTools.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -32,42 +32,12 @@ ################################################################################ -JIMAGE_PKGS := \ - jdk/internal/jimage \ - jdk/internal/jrtfs \ - # - -$(eval $(call SetupJavaCompilation,BUILD_INTERIM_JIMAGE, \ - SETUP := GENERATE_OLDBYTECODE, \ - SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \ - INCLUDES := $(JIMAGE_PKGS), \ - BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes)) - -TARGETS += $(BUILD_INTERIM_JIMAGE) - -# Because of the explicit INCLUDES in the compilation setup above, the service provider -# file will not be copied unless META-INF/services would also be added to the INCLUDES. -# Adding META-INF/services would include all files in that directory when only the one -# is needed, which is why this explicit copy is defined instead. -$(eval $(call SetupCopyFiles,COPY_JIMAGE_SERVICE_PROVIDER, \ - SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \ - DEST := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes, \ - FILES := META-INF/services/java.nio.file.spi.FileSystemProvider)) - -TARGETS += $(COPY_JIMAGE_SERVICE_PROVIDER) - -################################################################################ - $(eval $(call SetupJavaCompilation,BUILD_TOOLS_JDK, \ SETUP := GENERATE_OLDBYTECODE, \ - ADD_JAVAC_FLAGS := -Xbootclasspath/p:$(call PathList, \ - $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes \ - $(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes), \ SRC := $(JDK_TOPDIR)/make/src/classes $(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes, \ - BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \ - COPY := boot.modules ext.modules)) - -$(BUILD_TOOLS_JDK): $(BUILD_INTERIM_JIMAGE) $(COPY_JIMAGE_SERVICE_PROVIDER) + EXCLUDES := build/tools/deps \ + build/tools/jigsaw, \ + BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes)) TARGETS += $(BUILD_TOOLS_JDK)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/GenerateModuleSummary.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -0,0 +1,47 @@ +# +# Copyright (c) 2014, 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 +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# Default target declared first +default: all + +include $(SPEC) +include MakeBase.gmk +include ModuleTools.gmk + +GENGRAPHS_DIR := $(IMAGES_OUTPUTDIR)/gengraphs +TOOLS_MODULE_SRCDIR := $(JDK_TOPDIR)/make/src/classes/build/tools/jigsaw + +$(GENGRAPHS_DIR)/jdk.dot: $(BUILD_JIGSAW_TOOLS) + $(MKDIR) -p $(@D) + $(TOOL_GENGRAPHS) $(GENGRAPHS_DIR) + +$(GENGRAPHS_DIR)/technology-summary.html: $(TOOLS_MODULE_SRCDIR)/technology-summary.html + $(install-file) + +$(GENGRAPHS_DIR)/module-summary.html: $(BUILD_JIGSAW_TOOLS) $(GENGRAPHS_DIR)/technology-summary.html + $(MKDIR) -p $(@D) + $(TOOL_MODULESUMMARY) -o $@ -mp $(IMAGES_OUTPUTDIR)/jmods + +all: $(GENGRAPHS_DIR)/jdk.dot $(GENGRAPHS_DIR)/module-summary.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/ModuleTools.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -0,0 +1,47 @@ +# +# Copyright (c) 2013, 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 +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +include $(SPEC) +include MakeBase.gmk +include JavaCompilation.gmk +include SetupJavaCompilers.gmk + +TOOLS_CLASSES_DIR := $(BUILDTOOLS_OUTPUTDIR)/tools_jigsaw_classes + +$(eval $(call SetupJavaCompilation,BUILD_JIGSAW_TOOLS, \ + SETUP := GENERATE_USINGJDKBYTECODE, \ + SRC := $(JDK_TOPDIR)/make/src/classes, \ + INCLUDES := build/tools/deps \ + build/tools/jigsaw, \ + BIN := $(TOOLS_CLASSES_DIR), \ + ADD_JAVAC_FLAGS := -XaddExports:jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED )) + + +TOOL_GENGRAPHS := $(BUILD_JAVA) -esa -ea -cp $(TOOLS_CLASSES_DIR) \ + build.tools.jigsaw.GenGraphs + +TOOL_MODULESUMMARY := $(BUILD_JAVA) -esa -ea -cp $(TOOLS_CLASSES_DIR) \ + -XaddExports:jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED \ + build.tools.jigsaw.ModuleSummary
--- a/make/Tools.gmk Tue Mar 15 13:48:26 2016 -0700 +++ b/make/Tools.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -41,7 +41,12 @@ TOOL_ADDJSUM = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \ build.tools.addjsum.AddJsum +ifeq ($(BOOT_JDK_MODULAR), true) + COMPILEFONTCONFIG_ADD_EXPORTS := -XaddExports:java.desktop/sun.awt=ALL-UNNAMED +endif + TOOL_COMPILEFONTCONFIG = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \ + $(COMPILEFONTCONFIG_ADD_EXPORTS) \ build.tools.compilefontconfig.CompileFontConfig TOOL_COMPILEPROPERTIES = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \ @@ -106,12 +111,18 @@ TOOL_CLDRCONVERTER = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \ build.tools.cldrconverter.CLDRConverter -TOOL_GENMODULESXML = $(JAVA_SMALL) -Xbootclasspath/p:$(INTERIM_LANGTOOLS_JAR) \ - -cp $(call PathList, $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes $(JDK_OUTPUTDIR)) \ +TOOL_GENMODULESXML = $(JAVA_SMALL) $(INTERIM_LANGTOOLS_BOOTCLASSPATH) \ + -cp $(call PathList, $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes) \ build.tools.module.GenJdepsModulesXml -TOOL_IMAGEBUILDER = $(JAVA_SMALL) -Xbootclasspath/p:$(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes \ - -cp $(call PathList, $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes $(JDK_OUTPUTDIR)) \ - build.tools.module.ImageBuilder +TOOL_GENMODULEINFOSOURCE = $(JAVA_SMALL) $(INTERIM_LANGTOOLS_BOOTCLASSPATH) \ + -cp $(call PathList, $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes) \ + build.tools.module.GenModuleInfoSource + +TOOL_GENCLASSLOADERMAP = $(JAVA_SMALL) $(INTERIM_LANGTOOLS_BOOTCLASSPATH) \ + -cp $(call PathList, $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes) \ + build.tools.module.GenModuleLoaderMap + +########################################################################################## endif # _TOOLS_GMK
--- a/make/copy/Copy-java.base.gmk Tue Mar 15 13:48:26 2016 -0700 +++ b/make/copy/Copy-java.base.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -172,6 +172,11 @@ POLICY_SRC_LIST += $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/conf/security/java.policy endif +# Allow imported modules to modify the java.policy +ifneq ($(IMPORT_MODULES_CONF), ) + POLICY_SRC_LIST += $(wildcard $(IMPORT_MODULES_CONF)/java.base/security/java.policy.extra) +endif + POLICY_SRC_LIST += $(POLICY_SRC) $(POLICY_DST): $(POLICY_SRC_LIST)
--- a/make/data/jdwp/jdwp.spec Tue Mar 15 13:48:26 2016 -0700 +++ b/make/data/jdwp/jdwp.spec Thu Mar 17 19:04:16 2016 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, 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 @@ -569,6 +569,21 @@ (Error VM_DEAD) ) ) + (Command AllModules=22 + "Returns all modules in the target VM." + "<p>Since JDWP version 9." + (Out + ) + (Reply + (Repeat modules "The number of the modules that follow." + (moduleID module "One of the modules.") + ) + ) + (ErrorSet + (Error NOT_IMPLEMENTED) + (Error VM_DEAD) + ) + ) ) (CommandSet ReferenceType=2 @@ -1029,6 +1044,22 @@ (Error VM_DEAD) ) ) + (Command Module=19 + "Returns the module that this reference type belongs to." + "<p>Since JDWP version 9." + (Out + (referenceType refType "The reference type.") + ) + (Reply + (moduleID module "The module this reference type belongs to.") + ) + (ErrorSet + (Error INVALID_CLASS "refType is not the ID of a reference type.") + (Error INVALID_OBJECT "refType is not a known ID.") + (Error NOT_IMPLEMENTED) + (Error VM_DEAD) + ) + ) ) (CommandSet ClassType=3 (Command Superclass=1 @@ -2647,6 +2678,54 @@ ) ) ) +(CommandSet ModuleReference=18 + (Command Name=1 + "Returns the name of this module." + "<p>Since JDWP version 9." + (Out + (moduleID module "This module.") + ) + (Reply + (string name "The module's name.") + ) + (ErrorSet + (Error INVALID_MODULE) + (Error NOT_IMPLEMENTED) + (Error VM_DEAD) + ) + ) + (Command ClassLoader=2 + "Returns the class loader of this module." + "<p>Since JDWP version 9." + (Out + (moduleID module "This module.") + ) + (Reply + (classLoaderObject classLoader "The module's class loader.") + ) + (ErrorSet + (Error INVALID_MODULE) + (Error NOT_IMPLEMENTED) + (Error VM_DEAD) + ) + ) + (Command CanRead=3 + "Returns true if this module can read the source module; false otherwise." + "<p>Since JDWP version 9." + (Out + (moduleID module "This module.") + (moduleID sourceModule "The source module.") + ) + (Reply + (boolean canRead "true if this module can read the source module; false otherwise.") + ) + (ErrorSet + (Error INVALID_MODULE "This module or sourceModule is not the ID of a module.") + (Error NOT_IMPLEMENTED) + (Error VM_DEAD) + ) + ) +) (CommandSet Event=64 (Command Composite=100 "Several events may occur at a given time in the target VM. " @@ -3054,6 +3133,7 @@ (Constant INVALID_SLOT =35 "Invalid slot.") (Constant DUPLICATE =40 "Item already set.") (Constant NOT_FOUND =41 "Desired element not found.") + (Constant INVALID_MODULE =42 "Invalid module.") (Constant INVALID_MONITOR =50 "Invalid monitor.") (Constant NOT_MONITOR_OWNER =51 "This thread doesn't own the monitor.") (Constant INTERRUPT =52 "The call has been interrupted before completion.")
--- a/make/gendata/Gendata-jdk.jdeps.gmk Tue Mar 15 13:48:26 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -# -# Copyright (c) 2014, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -include GendataCommon.gmk - -$(eval $(call IncludeCustomExtension, jdk, gendata/Gendata-jdk.jdeps.gmk)) - -JDEPS_MODULES_XML := $(JDK_OUTPUTDIR)/modules/jdk.jdeps/com/sun/tools/jdeps/resources/jdeps-modules.xml -MODULES_XML += $(TOPDIR)/modules.xml - -# -# Generate modules.xml for jdeps to use -# It augments $(TOPDIR)/modules.xml to include module membership -# -$(JDEPS_MODULES_XML): $(BUILD_TOOLS_JDK) $(MODULES_XML) - $(MKDIR) -p $(@D) - $(RM) $@ - $(TOOL_GENMODULESXML) -o $@ -mp $(JDK_OUTPUTDIR)/modules $(MODULES_XML) - -TARGETS += $(JDEPS_MODULES_XML)
--- a/make/gendata/GendataBreakIterator.gmk Tue Mar 15 13:48:26 2016 -0700 +++ b/make/gendata/GendataBreakIterator.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -33,8 +33,6 @@ # They are used at JDK build phase in order to create $(BIFILES) which # are used on runtime instead. # -TEXT_SRCDIR := $(JDK_TOPDIR)/src/java.base/share/classes \ - $(JDK_TOPDIR)/src/jdk.localedata/share/classes TEXT_PKG := sun/text/resources TEXT_PKG_LD := $(TEXT_PKG)/ext TEXT_SOURCES := $(TEXT_PKG)/BreakIteratorRules.java \ @@ -46,11 +44,35 @@ BREAK_ITERATOR_CLASSES := $(BUILDTOOLS_OUTPUTDIR)/break_iterator_classes # These two files should be moved out to a build tool! -$(eval $(call SetupJavaCompilation,BUILD_BREAKITERATOR, \ +$(eval $(call SetupJavaCompilation,BUILD_BREAKITERATOR_BASE, \ + SETUP := GENERATE_OLDBYTECODE, \ + SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \ + INCLUDE_FILES := \ + $(TEXT_PKG)/BreakIteratorRules.java \ + $(TEXT_PKG)/BreakIteratorInfo.java, \ + BIN := $(BREAK_ITERATOR_CLASSES)/java.base)) + +$(eval $(call SetupJavaCompilation,BUILD_BREAKITERATOR_LD, \ SETUP := GENERATE_OLDBYTECODE, \ - SRC := $(TEXT_SRCDIR), \ - INCLUDE_FILES := $(TEXT_SOURCES), \ - BIN := $(BREAK_ITERATOR_CLASSES))) + SRC := $(JDK_TOPDIR)/src/jdk.localedata/share/classes, \ + INCLUDES := $(TEXT_PKG_LD), \ + INCLUDE_FILES := \ + $(TEXT_PKG_LD)/BreakIteratorRules_th.java \ + $(TEXT_PKG_LD)/BreakIteratorInfo_th.java, \ + BIN := $(BREAK_ITERATOR_CLASSES)/jdk.localedata)) + +ifeq ($(BOOT_JDK_MODULAR), true) + BREAK_ITERATOR_BOOTCLASSPATH := -Xpatch:$(BREAK_ITERATOR_CLASSES) \ + -XaddExports:$(subst $(SPACE),$(COMMA),$(strip \ + java.base/sun.text=ALL-UNNAMED \ + java.base/sun.text.resources=ALL-UNNAMED \ + jdk.localedata/sun.text.resources.ext=ALL-UNNAMED \ + )) +else + BREAK_ITERATOR_BOOTCLASSPATH := -Xbootclasspath/p:$(call PathList, \ + $(BREAK_ITERATOR_CLASSES)/java.base \ + $(BREAK_ITERATOR_CLASSES)/jdk.localedata) +endif # Generate data resource files. # input @@ -67,8 +89,9 @@ $(LD_DATA_PKG_DIR)/LineBreakIteratorData_th $(BIFILES): $(BASE_DATA_PKG_DIR)/_the.bifiles -$(BASE_DATA_PKG_DIR)/_the.bifiles: JAVA_FLAGS += -Xbootclasspath/p:$(BREAK_ITERATOR_CLASSES) -$(BASE_DATA_PKG_DIR)/_the.bifiles: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKITERATOR) +$(BASE_DATA_PKG_DIR)/_the.bifiles: JAVA_FLAGS += $(BREAK_ITERATOR_BOOTCLASSPATH) +$(BASE_DATA_PKG_DIR)/_the.bifiles: $(BUILD_TOOLS) $(UNICODEDATA) \ + $(BUILD_BREAKITERATOR_BASE) $(BUILD_BREAKITERATOR_LD) $(call LogInfo, Generating BreakIteratorData) $(call MakeDir, $(@D)) $(RM) $(BIFILES) @@ -78,8 +101,9 @@ $(TOUCH) $@ $(BIFILES_TH): $(LD_DATA_PKG_DIR)/_the.bifiles_th -$(LD_DATA_PKG_DIR)/_the.bifiles_th: JAVA_FLAGS += -Xbootclasspath/p:$(BREAK_ITERATOR_CLASSES) -$(LD_DATA_PKG_DIR)/_the.bifiles_th: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKITERATOR) +$(LD_DATA_PKG_DIR)/_the.bifiles_th: JAVA_FLAGS += $(BREAK_ITERATOR_BOOTCLASSPATH) +$(LD_DATA_PKG_DIR)/_the.bifiles_th: $(BUILD_TOOLS) $(UNICODEDATA) \ + $(BUILD_BREAKITERATOR_BASE) $(BUILD_BREAKITERATOR_LD) $(call LogInfo, Generating BreakIteratorData_th) $(RM) $(BIFILES_TH) $(TOOL_GENERATEBREAKITERATORDATA) \
--- a/make/gensrc/Gensrc-java.base.gmk Tue Mar 15 13:48:26 2016 -0700 +++ b/make/gensrc/Gensrc-java.base.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -33,6 +33,7 @@ include GensrcCharsetCoder.gmk include GensrcBuffer.gmk include GensrcExceptions.gmk +include GensrcModuleLoaderMap.gmk ################################################################################
--- a/make/gensrc/Gensrc-jdk.dev.gmk Tue Mar 15 13:48:26 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -# -# Copyright (c) 2014, 2015, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -include GensrcCommon.gmk - -################################################################################ - -include GensrcProperties.gmk - -$(eval $(call SetupCompileProperties, COMPILE_PROPERTIES, \ - SRC_DIRS := $(JDK_TOPDIR)/src/jdk.dev/share/classes/jdk/tools/jimage/resources, \ - CLASS := ListResourceBundle, \ -)) - -TARGETS += $(COMPILE_PROPERTIES) - -################################################################################ - -all: $(TARGETS) - -.PHONY: all
--- a/make/gensrc/Gensrc-jdk.jdi.gmk Tue Mar 15 13:48:26 2016 -0700 +++ b/make/gensrc/Gensrc-jdk.jdi.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -61,30 +61,6 @@ ################################################################################ -define process-provider - $(call MakeDir, $(@D)) - $(CAT) $^ | $(SED) -e "s/^#\[$(OPENJDK_TARGET_OS)\]//" > $@ -endef - -# Filter com.sun.jdi.connect.Connector -$(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector: \ - $(JDK_TOPDIR)/src/jdk.jdi/share/classes/META-INF/services/com.sun.jdi.connect.Connector \ - $(HOTSPOT_TOPDIR)/src/jdk.hotspot.agent/share/classes/META-INF/services/com.sun.jdi.connect.Connector - $(process-provider) - -# Copy the same service file into jdk.hotspot.agent so that they are kept the same. -$(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/META-INF/services/com.sun.jdi.connect.Connector: \ - $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector - $(install-file) - -# Some platforms don't have the serviceability agent -ifeq ($(INCLUDE_SA), true) - GENSRC_JDK_JDI += $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector \ - $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/META-INF/services/com.sun.jdi.connect.Connector -endif - -################################################################################ - include GensrcProperties.gmk $(eval $(call SetupCompileProperties, COMPILE_PROPERTIES, \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/gensrc/Gensrc-jdk.jlink.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -0,0 +1,54 @@ +# +# Copyright (c) 2014, 2015, 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 +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +include GensrcCommon.gmk + +################################################################################ + +include GensrcProperties.gmk + +$(eval $(call SetupCompileProperties, JLINK_PROPERTIES, \ + SRC_DIRS := $(JDK_TOPDIR)/src/jdk.jlink/share/classes/jdk/tools/jlink/resources, \ + CLASS := ListResourceBundle, \ +)) + +$(eval $(call SetupCompileProperties, JMOD_PROPERTIES, \ + SRC_DIRS := $(JDK_TOPDIR)/src/jdk.jlink/share/classes/jdk/tools/jmod/resources, \ + CLASS := ListResourceBundle, \ +)) + +$(eval $(call SetupCompileProperties, JIMAGE_PROPERTIES, \ + SRC_DIRS := $(JDK_TOPDIR)/src/jdk.jlink/share/classes/jdk/tools/jimage/resources, \ + CLASS := ListResourceBundle, \ +)) + + +TARGETS += $(JLINK_PROPERTIES) $(JMOD_PROPERTIES) $(JIMAGE_PROPERTIES) + +################################################################################ + +all: $(TARGETS) + +.PHONY: all
--- a/make/gensrc/Gensrc-jdk.jvmstat.gmk Tue Mar 15 13:48:26 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -# -# Copyright (c) 2015, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -include GensrcCommon.gmk - -################################################################################ - -define merge-providers - $(MKDIR) -p $(@D) - $(CAT) $^ > $@ -endef - -PROVIDER_FILE := META-INF/services/sun.jvmstat.monitor.MonitoredHostService - -# Merge the local and remote sevice providers into jdk.jvmstat/META-INF/services -$(SUPPORT_OUTPUTDIR)/gensrc/jdk.jvmstat/$(PROVIDER_FILE): \ - $(JDK_TOPDIR)/src/jdk.jvmstat/share/classes/$(PROVIDER_FILE) \ - $(JDK_TOPDIR)/src/jdk.jvmstat.rmi/share/classes/$(PROVIDER_FILE) - $(merge-providers) - -# Copy the same service file into jdk.jvmstat.rmi so that they are kept the same. -$(SUPPORT_OUTPUTDIR)/gensrc/jdk.jvmstat.rmi/$(PROVIDER_FILE): \ - $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jvmstat/$(PROVIDER_FILE) - $(install-file) - -################################################################################ - -jdk.jvmstat: $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jvmstat/$(PROVIDER_FILE) \ - $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jvmstat.rmi/$(PROVIDER_FILE) - -all: jdk.jvmstat - -.PHONY: all \ No newline at end of file
--- a/make/gensrc/GensrcLocaleData.gmk Tue Mar 15 13:48:26 2016 -0700 +++ b/make/gensrc/GensrcLocaleData.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -143,19 +143,6 @@ GENSRC_BASELOCALEDATA := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/locale/provider/BaseLocaleDataMetaInfo.java GENSRC_LOCALEDATA := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/sun/util/resources/provider/NonBaseLocaleDataMetaInfo.java -################################################################################ - -GENSRC_CRBC_DST := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/CoreResourceBundleControl.java -GENSRC_CRBC_CMD := $(JDK_TOPDIR)/make/scripts/localelist.sh - -JRE_NONEXIST_LOCALES := en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh - -$(GENSRC_CRBC_DST): $(JDK_TOPDIR)/src/java.base/share/classes/sun/util/CoreResourceBundleControl-XLocales.java.template \ - $(GENSRC_CRBC_CMD) - $(MKDIR) -p $(@D) - NAWK="$(NAWK)" SED="$(SED)" $(SH) $(GENSRC_CRBC_CMD) "$(JRE_NONEXIST_LOCALES)" $< $@ - -GENSRC_BASELOCALEDATA += $(GENSRC_CRBC_DST) GENSRC_JAVA_BASE += $(GENSRC_BASELOCALEDATA) GENSRC_JDK_LOCALEDATA += $(GENSRC_LOCALEDATA)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/gensrc/GensrcModuleLoaderMap.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -0,0 +1,164 @@ +# +# Copyright (c) 2015, 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 +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +include Modules.gmk + +BOOT_MODULES := +UPGRADEABLE_MDOULES := +AGGREGATOR_MDOULES := +OTHER_PLATFORM_MODULES := + +# Hook to include the corresponding custom file, if present. +$(eval $(call IncludeCustomExtension, jdk, gensrc/GensrcModuleLoaderMap.gmk)) + +BOOT_MODULES += \ + java.base \ + java.datatransfer \ + java.desktop \ + java.httpclient \ + java.instrument \ + java.logging \ + java.management \ + java.naming \ + java.prefs \ + java.rmi \ + java.security.jgss \ + java.security.sasl \ + java.sql \ + java.xml \ + java.xml.crypto \ + jdk.httpserver \ + jdk.management \ + jdk.sctp \ + jdk.security.auth \ + jdk.security.jgss \ + # + +# to be deprivileged +BOOT_MODULES += \ + java.compiler \ + java.scripting \ + java.sql.rowset \ + java.smartcardio \ + jdk.charsets \ + jdk.naming.rmi \ + # + +UPGRADEABLE_MODULES += \ + java.activation \ + java.annotations.common \ + java.corba \ + java.transaction \ + java.xml.bind \ + java.xml.ws \ + # + +AGGREGATOR_MODULES += \ + java.compact1 \ + java.compact2 \ + java.compact3 \ + java.se \ + java.se.ee \ + # + +OTHER_PLATFORM_MODULES += \ + jdk.accessibility \ + jdk.crypto.ec \ + jdk.crypto.pkcs11 \ + jdk.dynalink \ + jdk.jsobject \ + jdk.xml.dom \ + jdk.localedata \ + jdk.naming.dns \ + jdk.scripting.nashorn \ + jdk.zipfs \ + # + +ifeq ($(OPENJDK_TARGET_OS), macsox) + BOOT_MODULES += jdk.deploy.osx +endif +ifeq ($(OPENJDK_TARGET_OS), windows) + OTHER_PLATFORM_MODULES += jdk.crypto.mscapi +endif +ifeq ($(OPENJDK_TARGET_OS), solaris) + OTHER_PLATFORM_MODULES += jdk.crypto.ucrypto +endif + +# Param 1 - Name of module +define ReadImportMetaData + ifneq ($$(wildcard $(IMPORT_MODULES_MAKE)/$$(strip $1)/build.properties), ) + classloader := + include $(IMPORT_MODULES_MAKE)/$$(strip $1)/build.properties + ifeq ($$(classloader), boot) + BOOT_MODULES += $1 + else ifeq ($$(classloader), ext) + OTHER_PLATFORM_MODULES += $1 + endif + endif +endef + +IMPORTED_MODULES := $(call FindImportedModules) +$(foreach m, $(IMPORTED_MODULES), $(eval $(call ReadImportMetaData, $m))) + + +# Replacing double-comma with a single comma is to workaround the issue +# with some version of make on windows that doesn't substitute spaces +# with one comma properly as with make 4.0 +define SubstComma +$(strip \ + $(subst $(COMMA)$(COMMA),$(COMMA),$(subst $(SPACE),$(COMMA),$(strip $1))) \ +) +endef +BOOT_MODULES_LIST := $(call SubstComma, $(BOOT_MODULES)) +PLATFORM_MODULES_LIST := $(call SubstComma, $(UPGRADEABLE_MODULES) $(AGGREGATOR_MODULES) $(OTHER_PLATFORM_MODULES)) + +VARDEPS_VALUE := $(BOOT_MODULES_LIST) $(PLATFORM_MODULES_LIST) +VARDEPS_FILE := $(call DependOnVariable, VARDEPS_VALUE) + +############################################################################ + +$(SUPPORT_OUTPUTDIR)/gensrc/java.base/jdk/internal/module/ModuleLoaderMap.java: \ + $(JDK_TOPDIR)/src/java.base/share/classes/jdk/internal/module/ModuleLoaderMap.java \ + $(VARDEPS_FILE) $(BUILD_TOOLS_JDK) + $(MKDIR) -p $(@D) + $(RM) $@ $@.tmp + $(TOOL_GENCLASSLOADERMAP) -boot $(BOOT_MODULES_LIST) \ + -platform $(PLATFORM_MODULES_LIST) -o $@.tmp $< + $(MV) $@.tmp $@ + +GENSRC_JAVA_BASE += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/jdk/internal/module/ModuleLoaderMap.java + +$(SUPPORT_OUTPUTDIR)/gensrc/java.base/jdk/internal/vm/cds/resources/ModuleLoaderMap.dat: \ + $(JDK_TOPDIR)/src/java.base/share/classes/jdk/internal/vm/cds/resources/ModuleLoaderMap.dat \ + $(VARDEPS_FILE) $(BUILD_TOOLS_JDK) + $(MKDIR) -p $(@D) + $(RM) $@ $@.tmp + $(TOOL_GENCLASSLOADERMAP) -boot $(BOOT_MODULES_LIST) \ + -platform $(PLATFORM_MODULES_LIST) -o $@.tmp $< + $(MV) $@.tmp $@ + +GENSRC_JAVA_BASE += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/jdk/internal/vm/cds/resources/ModuleLoaderMap.dat + +################################################################################
--- a/make/launcher/Launcher-java.desktop.gmk Tue Mar 15 13:48:26 2016 -0700 +++ b/make/launcher/Launcher-java.desktop.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -31,6 +31,7 @@ ifndef BUILD_HEADLESS_ONLY $(eval $(call SetupBuildLauncher, appletviewer, \ MAIN_CLASS := sun.applet.Main, \ + JAVA_ARGS := -addmods ALL-SYSTEM, \ LIBS_unix := $(X_LIBS), \ )) endif
--- a/make/launcher/Launcher-jdk.dev.gmk Tue Mar 15 13:48:26 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -# -# Copyright (c) 2011, 2015, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -include LauncherCommon.gmk - -$(eval $(call SetupBuildLauncher, jimage,\ - MAIN_CLASS := jdk.tools.jimage.Main, \ -))
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/launcher/Launcher-jdk.jlink.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -0,0 +1,45 @@ +# +# Copyright (c) 2015, 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 +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +include LauncherCommon.gmk + +$(eval $(call SetupBuildLauncher, jimage,\ + MAIN_CLASS := jdk.tools.jimage.Main, \ + CFLAGS := -DENABLE_ARG_FILES, \ +)) + +$(eval $(call SetupBuildLauncher, jlink,\ + MAIN_CLASS := jdk.tools.jlink.internal.Main, \ + CFLAGS := -DENABLE_ARG_FILES \ + -DEXPAND_CLASSPATH_WILDCARDS \ + -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \ +)) + +$(eval $(call SetupBuildLauncher, jmod,\ + MAIN_CLASS := jdk.tools.jmod.Main, \ + CFLAGS := -DENABLE_ARG_FILES \ + -DEXPAND_CLASSPATH_WILDCARDS \ + -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \ +))
--- a/make/launcher/Launcher-jdk.pack200.gmk Tue Mar 15 13:48:26 2016 -0700 +++ b/make/launcher/Launcher-jdk.pack200.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -26,6 +26,7 @@ include LauncherCommon.gmk $(eval $(call SetupBuildLauncher, pack200, \ + MAIN_MODULE := java.base, \ MAIN_CLASS := com.sun.java.util.jar.pack.Driver, \ ))
--- a/make/launcher/Launcher-jdk.rmic.gmk Tue Mar 15 13:48:26 2016 -0700 +++ b/make/launcher/Launcher-jdk.rmic.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -26,6 +26,6 @@ include LauncherCommon.gmk $(eval $(call SetupBuildLauncher, rmic, \ - MAIN_CLASS := sun.rmi.rmic.Main, \ + MAIN_CLASS := jdk.rmi.rmic.Main, \ CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \ ))
--- a/make/launcher/LauncherCommon.gmk Tue Mar 15 13:48:26 2016 -0700 +++ b/make/launcher/LauncherCommon.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -63,6 +63,8 @@ # used as the name of the executable. # # Remaining parameters are named arguments. These include: +# MAIN_MODULE The module of the main class to launch if different from the +# current module # MAIN_CLASS The Java main class to launch # JAVA_ARGS Processed into a -DJAVA_ARGS C flag # CFLAGS Additional CFLAGS @@ -97,9 +99,13 @@ $1_JAVA_ARGS += -ms8m endif + ifeq ($$($1_MAIN_MODULE), ) + $1_MAIN_MODULE := $(MODULE) + endif + ifneq ($$($1_JAVA_ARGS), ) $1_JAVA_ARGS_STR := '{ $$(strip $$(foreach a, \ - $$(addprefix -J, $$($1_JAVA_ARGS)) $$($1_MAIN_CLASS), "$$a"$(COMMA) )) }' + $$(addprefix -J, $$($1_JAVA_ARGS)) -m $$($1_MAIN_MODULE)/$$($1_MAIN_CLASS), "$$a"$(COMMA) )) }' $1_CFLAGS += -DJAVA_ARGS=$$($1_JAVA_ARGS_STR) endif
--- a/make/lib/CoreLibraries.gmk Tue Mar 15 13:48:26 2016 -0700 +++ b/make/lib/CoreLibraries.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -146,6 +146,7 @@ $(LIBJAVA_CFLAGS), \ System.c_CFLAGS := $(VERSION_CFLAGS), \ jdk_util.c_CFLAGS := $(VERSION_CFLAGS), \ + DISABLED_WARNINGS_gcc := unused-result, \ DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \ MAPFILE := $(LIBJAVA_MAPFILE), \ LDFLAGS := $(LDFLAGS_JDKLIB) \
--- a/make/lib/Lib-java.instrument.gmk Tue Mar 15 13:48:26 2016 -0700 +++ b/make/lib/Lib-java.instrument.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -68,14 +68,14 @@ LDFLAGS_macosx := -Wl$(COMMA)-all_load, \ LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \ LIBS := $(JDKLIB_LIBS), \ - LIBS_unix := -ljava $(LIBZ), \ + LIBS_unix := -ljava -ljvm $(LIBZ), \ LIBS_linux := -ljli $(LIBDL), \ LIBS_solaris := -ljli $(LIBDL), \ LIBS_aix := -liconv -ljli_static $(LIBDL), \ LIBS_macosx := -liconv -framework Cocoa -framework Security \ -framework ApplicationServices \ $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a, \ - LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib \ + LIBS_windows := jvm.lib $(WIN_JAVA_LIB) advapi32.lib \ $(SUPPORT_OUTPUTDIR)/native/java.base/jli_static.lib, \ VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ RC_FLAGS := $(RC_FLAGS) \
--- a/make/mapfiles/libjava/mapfile-vers Tue Mar 15 13:48:26 2016 -0700 +++ b/make/mapfiles/libjava/mapfile-vers Thu Mar 17 19:04:16 2016 +0000 @@ -137,7 +137,6 @@ Java_java_lang_ClassLoader_registerNatives; Java_java_lang_Double_longBitsToDouble; Java_java_lang_Double_doubleToRawLongBits; - Java_java_lang_reflect_Proxy_defineClass0; Java_java_lang_Float_intBitsToFloat; Java_java_lang_Float_floatToRawIntBits; Java_java_lang_StackFrameInfo_fillInStackFrames; @@ -165,8 +164,6 @@ Java_java_lang_StrictMath_expm1; Java_java_lang_Object_getClass; Java_java_lang_Object_registerNatives; - Java_java_lang_Package_getSystemPackage0; - Java_java_lang_Package_getSystemPackages0; Java_java_lang_ProcessEnvironment_environ; Java_java_lang_ProcessHandleImpl_destroy0; Java_java_lang_ProcessHandleImpl_getCurrentPid0; @@ -204,11 +201,11 @@ Java_java_lang_reflect_Executable_getTypeAnnotationBytes0; Java_java_lang_reflect_Field_getTypeAnnotationBytes0; Java_java_lang_Runtime_freeMemory; - Java_java_lang_Runtime_maxMemory; + Java_java_lang_Runtime_maxMemory; Java_java_lang_Runtime_gc; Java_java_lang_Runtime_runFinalization0; Java_java_lang_Runtime_totalMemory; - Java_java_lang_Runtime_availableProcessors; + Java_java_lang_Runtime_availableProcessors; Java_java_lang_SecurityManager_classDepth; Java_java_lang_SecurityManager_classLoaderDepth0; Java_java_lang_SecurityManager_currentClassLoader0; @@ -274,6 +271,18 @@ Java_jdk_internal_misc_VM_getgid; Java_jdk_internal_misc_VM_getegid; Java_jdk_internal_misc_VM_initialize; + + Java_java_lang_reflect_Module_defineModule0; + Java_java_lang_reflect_Module_addReads0; + Java_java_lang_reflect_Module_addExports0; + Java_java_lang_reflect_Module_addExportsToAll0; + Java_java_lang_reflect_Module_addExportsToAllUnnamed0; + Java_java_lang_reflect_Module_addPackage0; + + Java_jdk_internal_loader_BootLoader_getSystemPackageLocation; + Java_jdk_internal_loader_BootLoader_getSystemPackageNames; + Java_jdk_internal_loader_BootLoader_setBootLoaderUnnamedModule0; + Java_sun_misc_VMSupport_initAgentProperties; Java_sun_misc_VMSupport_getVMTemporaryDirectory;
--- a/make/mapfiles/libjimage/mapfile-vers Tue Mar 15 13:48:26 2016 -0700 +++ b/make/mapfiles/libjimage/mapfile-vers Thu Mar 17 19:04:16 2016 +0000 @@ -27,23 +27,7 @@ SUNWprivate_1.1 { global: - JNI_OnLoad; - Java_jdk_internal_jimage_ImageNativeSubstrate_openImage; - Java_jdk_internal_jimage_ImageNativeSubstrate_closeImage; - Java_jdk_internal_jimage_ImageNativeSubstrate_getIndexAddress; - Java_jdk_internal_jimage_ImageNativeSubstrate_getDataAddress; - Java_jdk_internal_jimage_ImageNativeSubstrate_read; - Java_jdk_internal_jimage_ImageNativeSubstrate_readCompressed; - Java_jdk_internal_jimage_ImageNativeSubstrate_getStringBytes; - Java_jdk_internal_jimage_ImageNativeSubstrate_getAttributes; - Java_jdk_internal_jimage_ImageNativeSubstrate_findAttributes; - Java_jdk_internal_jimage_ImageNativeSubstrate_attributeOffsets; - Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1Open; - Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1Close; - Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1FindResource; - Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1GetResource; - Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1PackageToModule; - Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1Resources; + Java_jdk_internal_jimage_NativeImageBuffer_getNativeMap; JIMAGE_Open; JIMAGE_Close; JIMAGE_PackageToModule;
--- a/make/rmic/Rmic-java.management.gmk Tue Mar 15 13:48:26 2016 -0700 +++ b/make/rmic/Rmic-java.management.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -40,7 +40,7 @@ $(eval $(call SetupRMICompilation,RMI_GEN, \ CLASSES := $(JMX_RMI_CLASSES), \ CLASSES_DIR := $(CLASSES_DIR)/java.management, \ - STUB_CLASSES_DIR := $(RMIC_GENSRC_DIR), \ + STUB_CLASSES_DIR := $(RMIC_GENSRC_DIR)/java.management, \ RUN_V12 := true, \ KEEP_GENERATED := true, \ )) @@ -50,7 +50,7 @@ $(eval classfiles := $(shell $(FIND) $(RMIC_GENSRC_DIR) -name "*.class")) $(foreach src, $(classfiles), \ $(eval target := $(patsubst $(RMIC_GENSRC_DIR)/%, \ - $(STUB_CLASSES_DIR)/java.management/%, $(src))) \ + $(STUB_CLASSES_DIR)/%, $(src))) \ $(MKDIR) -p $(dir $(target)) ; \ $(MV) $(src) $(target) $(NEWLINE)) $(TOUCH) $@
--- a/make/rmic/RmicCommon.gmk Tue Mar 15 13:48:26 2016 -0700 +++ b/make/rmic/RmicCommon.gmk Thu Mar 17 19:04:16 2016 +0000 @@ -31,10 +31,7 @@ ########################################################################################## -BTRMIC_CP := $(call PathList, \ - $(BUILDTOOLS_OUTPUTDIR)/interim_rmic_classes $(INTERIM_LANGTOOLS_JAR)) -BTRMIC_ARGS := -cp $(BTRMIC_CP) -RMIC := $(JAVA) $(BTRMIC_ARGS) sun.rmi.rmic.Main +RMIC := $(JAVA) $(INTERIM_OVERRIDE_MODULES_ARGS) sun.rmi.rmic.Main CLASSES_DIR := $(JDK_OUTPUTDIR)/modules # NOTE: If the smart javac dependency management is reintroduced, these classes risk
--- a/make/scripts/localelist.sh Tue Mar 15 13:48:26 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2005, 2012, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# -# This script is to generate the supported locale list string and replace the -# #LOCALE_LIST# in <ws>/src/share/classes/sun/util/CoreResourceBundleControl.java. -# -# NAWK & SED is passed in as environment variables. -# -LOCALE_LIST=$1 -INUT_FILE=$2 -OUTPUT_FILE=$3 - -LOCALES=`(for I in $LOCALE_LIST; do echo $I;done) | sort | uniq` -JAVA_LOCALES= - -toJavaLocale() -{ - NewLocale=`echo $1 | $NAWK ' - BEGIN { - # The following values have to be consistent with java.util.Locale. - javalocales["en"] = "ENGLISH"; - javalocales["fr"] = "FRENCH"; - javalocales["de"] = "GERMAN"; - javalocales["it"] = "ITALIAN"; - javalocales["ja"] = "JAPANESE"; - javalocales["ko"] = "KOREAN"; - javalocales["zh"] = "CHINESE"; - javalocales["zh_CN"] = "SIMPLIFIED_CHINESE"; - javalocales["zh_TW"] = "TRADITIONAL_CHINESE"; - javalocales["fr_FR"] = "FRANCE"; - javalocales["de_DE"] = "GERMANY"; - javalocales["it_IT"] = "ITALY"; - javalocales["ja_JP"] = "JAPAN"; - javalocales["ko_KR"] = "KOREA"; - javalocales["en_GB"] = "UK"; - javalocales["en_US"] = "US"; - javalocales["en_CA"] = "CANADA"; - javalocales["fr_CA"] = "CANADA_FRENCH"; - } - { - if ($0 in javalocales) { - print " Locale." javalocales[$0]; - } else { - split($0, a, "_"); - if (a[3] != "") { - print " new Locale(\"" a[1] "\", \"" a[2] "\", \"" a[3] "\")"; - } else if (a[2] != "") { - print " new Locale(\"" a[1] "\", \"" a[2] "\")"; - } else { - print " new Locale(\"" a[1] "\")"; - } - } - }'` - - JAVA_LOCALES=$JAVA_LOCALES$NewLocale -} - -# count the number of locales -counter=0 -for i in $LOCALES -do - counter=`expr $counter + 1` -done - -index=0 -for locale in $LOCALES -do - index=`expr $index + 1`; - if [ $index != $counter ] - then - toJavaLocale $locale - JAVA_LOCALES=$JAVA_LOCALES"," - else - toJavaLocale $locale - fi -done - -# replace the #LOCALE_LIST# in the precompiled CoreResourceBundleControl.java file. - -$SED -e "s@^#warn .*@// -- This file was mechanically generated: Do not edit! -- //@" \ - -e "s/#LOCALE_LIST#/$JAVA_LOCALES/g" $2 > $3
--- a/make/src/classes/build/tools/cldrconverter/ResourceBundleGenerator.java Tue Mar 15 13:48:26 2016 -0700 +++ b/make/src/classes/build/tools/cldrconverter/ResourceBundleGenerator.java Thu Mar 17 19:04:16 2016 +0000 @@ -343,9 +343,7 @@ if (!all && CLDRConverter.isBaseModule ^ isBaseLocale(id)) { continue; } - if (sb.length() > 0) { - sb.append(' '); - } + sb.append(' '); sb.append(id); } }
--- a/make/src/classes/build/tools/generatebreakiteratordata/GenerateBreakIteratorData.java Tue Mar 15 13:48:26 2016 -0700 +++ b/make/src/classes/build/tools/generatebreakiteratordata/GenerateBreakIteratorData.java Thu Mar 17 19:04:16 2016 +0000 @@ -62,25 +62,37 @@ CharacterCategory.makeCategoryMap(unicodeData); /* Generate files */ - generateFiles(); + try { + generateFiles(); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + } + + private static String localizedBundleName(String pkg, String clazz) { + if (language.length() > 0) { + return pkg + ".ext." + clazz + '_' + language; + } else { + return pkg + '.' + clazz; + } } /** * Generate data files whose names are included in * sun.text.resources.BreakIteratorInfo+<localeName> */ - private static void generateFiles() { + private static void generateFiles() throws Exception { String[] classNames; ResourceBundle rules, info; - String pkgName = "sun.text.resources" + (language.length() > 0 ? ".ext" : ""); + info = (ResourceBundle) Class.forName( + localizedBundleName("sun.text.resources", "BreakIteratorInfo")).newInstance(); - info = ResourceBundle.getBundle(pkgName + ".BreakIteratorInfo", - new Locale(language, country, valiant)); classNames = info.getStringArray("BreakIteratorClasses"); - rules = ResourceBundle.getBundle(pkgName + ".BreakIteratorRules", - new Locale(language, country, valiant)); + rules = (ResourceBundle) Class.forName( + localizedBundleName("sun.text.resources", "BreakIteratorRules")).newInstance(); if (info.containsKey("CharacterData")) { generateDataFile(info.getString("CharacterData"),
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/src/classes/build/tools/jdwpgen/ModuleTypeNode.java Thu Mar 17 19:04:16 2016 +0000 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2016, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package build.tools.jdwpgen; + +import java.util.*; +import java.io.*; + +class ModuleTypeNode extends AbstractSimpleTypeNode { + + String docType() { + return "moduleID"; + } + + String javaType() { + return "ModuleReferenceImpl"; + } + + String debugValue(String label) { + return "(" + label + "==null?\"NULL\":\"ref=\"+" + label + ".ref())"; + } + + public void genJavaWrite(PrintWriter writer, int depth, + String writeLabel) { + genJavaDebugWrite(writer, depth, writeLabel, + debugValue(writeLabel)); + indent(writer, depth); + writer.println("ps.writeModuleRef(" + writeLabel + ".ref());"); + } + + String javaRead() { + return "ps.readModule()"; + } +}
--- a/make/src/classes/build/tools/jdwpgen/Parse.java Tue Mar 15 13:48:26 2016 -0700 +++ b/make/src/classes/build/tools/jdwpgen/Parse.java Thu Mar 17 19:04:16 2016 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, 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 @@ -80,6 +80,7 @@ kindMap.put("field", new FieldTypeNode()); kindMap.put("frame", new FrameTypeNode()); kindMap.put("string", new StringTypeNode()); + kindMap.put("moduleID", new ModuleTypeNode()); kindMap.put("value", new ValueTypeNode()); kindMap.put("byte", new ByteTypeNode()); kindMap.put("location", new LocationTypeNode());
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/src/classes/build/tools/jigsaw/GenGraphs.java Thu Mar 17 19:04:16 2016 +0000 @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2014, 2016, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package build.tools.jigsaw; + +import java.io.IOException; +import java.io.PrintStream; +import java.lang.module.Configuration; +import java.lang.module.ModuleDescriptor; +import java.lang.module.ModuleFinder; +import java.lang.module.ModuleReference; +import java.lang.module.ResolvedModule; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; +import java.util.function.Function; +import java.util.stream.Collectors; +import static java.lang.module.ModuleDescriptor.Requires.Modifier.PUBLIC; + +/** + * Generate the DOT file for a module graph for each module in the JDK + * after transitive reduction. + */ +public class GenGraphs { + + public static void main(String[] args) throws Exception { + + if (args.length != 1) { + System.err.println("ERROR: specify the output directory"); + System.exit(1); + } + Path dir = Paths.get(args[0]); + Files.createDirectories(dir); + + ModuleFinder finder = ModuleFinder.ofSystem(); + + Set<ModuleDescriptor> javaSEModules + = new TreeSet<>(finder.findAll().stream() + .map(ModuleReference::descriptor) + .filter(m -> (m.name().startsWith("java.") && + !m.name().equals("java.smartcardio"))) + .collect(Collectors.toSet())); + Set<ModuleDescriptor> jdkModules + = new TreeSet<>(finder.findAll().stream() + .map(ModuleReference::descriptor) + .filter(m -> !javaSEModules.contains(m)) + .collect(Collectors.toSet())); + + GenGraphs genGraphs = new GenGraphs(javaSEModules, jdkModules); + Set<String> mods = new HashSet<>(); + for (ModuleReference mref: finder.findAll()) { + ModuleDescriptor descriptor = mref.descriptor(); + String name = descriptor.name(); + mods.add(name); + Configuration cf = Configuration.empty() + .resolveRequires(finder, + ModuleFinder.empty(), + Set.of(name)); + genGraphs.genDotFile(dir, name, cf); + } + + Configuration cf = Configuration.empty() + .resolveRequires(finder, + ModuleFinder.empty(), + mods); + genGraphs.genDotFile(dir, "jdk", cf); + + } + + private final Set<ModuleDescriptor> javaGroup; + private final Set<ModuleDescriptor> jdkGroup; + + GenGraphs(Set<ModuleDescriptor> javaGroup, Set<ModuleDescriptor> jdkGroup) { + this.javaGroup = Collections.unmodifiableSet(javaGroup); + this.jdkGroup = Collections.unmodifiableSet(jdkGroup); + } + + private static final String ORANGE = "#e76f00"; + private static final String BLUE = "#437291"; + private static final String GRAY = "#dddddd"; + + private static final String REEXPORTS = ""; + private static final String REQUIRES = "style=\"dashed\""; + private static final String REQUIRES_BASE = "color=\"" + GRAY + "\""; + + private static final Map<String,Integer> weights = new HashMap<>(); + + private static void weight(String s, String t, int w) { + weights.put(s + ":" + t, w); + } + + private static int weightOf(String s, String t) { + int w = weights.getOrDefault(s + ":" + t, 1); + if (w != 1) + return w; + if (s.startsWith("java.") && t.startsWith("java.")) + return 10; + return 1; + } + + static { + int h = 1000; + weight("java.se", "java.compact3", h * 10); + weight("jdk.compact3", "java.compact3", h * 10); + weight("java.compact3", "java.compact2", h * 10); + weight("java.compact2", "java.compact1", h * 10); + weight("java.compact1", "java.logging", h * 10); + weight("java.logging", "java.base", h * 10); + } + + private void genDotFile(Path dir, String name, Configuration cf) throws IOException { + try (PrintStream out + = new PrintStream(Files.newOutputStream(dir.resolve(name + ".dot")))) { + + Map<String, ModuleDescriptor> nameToModule = cf.modules().stream() + .map(ResolvedModule::reference) + .map(ModuleReference::descriptor) + .collect(Collectors.toMap(ModuleDescriptor::name, Function.identity())); + + Set<ModuleDescriptor> descriptors = new TreeSet<>(nameToModule.values()); + + out.format("digraph \"%s\" {%n", name); + out.format("size=\"25,25\";"); + out.format("nodesep=.5;%n"); + out.format("ranksep=1.5;%n"); + out.format("pencolor=transparent;%n"); + out.format("node [shape=plaintext, fontname=\"DejaVuSans\", fontsize=36, margin=\".2,.2\"];%n"); + out.format("edge [penwidth=4, color=\"#999999\", arrowhead=open, arrowsize=2];%n"); + + out.format("subgraph %sse {%n", name.equals("jdk") ? "cluster_" : ""); + descriptors.stream() + .filter(javaGroup::contains) + .map(ModuleDescriptor::name) + .forEach(mn -> out.format(" \"%s\" [fontcolor=\"%s\", group=%s];%n", + mn, ORANGE, "java")); + out.format("}%n"); + descriptors.stream() + .filter(jdkGroup::contains) + .map(ModuleDescriptor::name) + .forEach(mn -> out.format(" \"%s\" [fontcolor=\"%s\", group=%s];%n", + mn, BLUE, "jdk")); + + // transitive reduction + Graph<String> graph = gengraph(cf); + descriptors.forEach(md -> { + String mn = md.name(); + Set<String> requiresPublic = md.requires().stream() + .filter(d -> d.modifiers().contains(PUBLIC)) + .map(d -> d.name()) + .collect(Collectors.toSet()); + + graph.adjacentNodes(mn).forEach(dn -> { + String attr = dn.equals("java.base") ? REQUIRES_BASE + : (requiresPublic.contains(dn) ? REEXPORTS : REQUIRES); + int w = weightOf(mn, dn); + if (w > 1) + attr += "weight=" + w; + out.format(" \"%s\" -> \"%s\" [%s];%n", mn, dn, attr); + }); + }); + + out.println("}"); + } + } + + /** + * Returns a Graph of the given Configuration after transitive reduction. + * + * Transitive reduction of requires public edge and requires edge have + * to be applied separately to prevent the requires public edges + * (e.g. U -> V) from being reduced by a path (U -> X -> Y -> V) + * in which V would not be re-exported from U. + */ + private Graph<String> gengraph(Configuration cf) { + Graph.Builder<String> builder = new Graph.Builder<>(); + for (ResolvedModule resolvedModule : cf.modules()) { + String mn = resolvedModule.reference().descriptor().name(); + builder.addNode(mn); + resolvedModule.reads().stream() + .map(ResolvedModule::name) + .forEach(target -> builder.addEdge(mn, target)); + } + Graph<String> rpg = requiresPublicGraph(cf); + return builder.build().reduce(rpg); + } + + /** + * Returns a Graph containing only requires public edges + * with transitive reduction. + */ + private Graph<String> requiresPublicGraph(Configuration cf) { + Graph.Builder<String> builder = new Graph.Builder<>(); + for (ResolvedModule resolvedModule : cf.modules()) { + ModuleDescriptor descriptor = resolvedModule.reference().descriptor(); + String mn = descriptor.name(); + descriptor.requires().stream() + .filter(d -> d.modifiers().contains(PUBLIC)) + .map(d -> d.name()) + .forEach(d -> builder.addEdge(mn, d)); + } + return builder.build().reduce(); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/src/classes/build/tools/jigsaw/Graph.java Thu Mar 17 19:04:16 2016 +0000 @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2014, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package build.tools.jigsaw; + +import java.io.PrintStream; +import java.util.Deque; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.Map; +import java.util.Set; + +public class Graph<T> { + private static boolean traceOn = Boolean.getBoolean("build.tools.module.trace"); + private final Set<T> nodes; + private final Map<T, Set<T>> edges; + private Graph(Set<T> nodes, Map<T, Set<T>> edges) { + this.nodes = nodes; + this.edges = edges; + } + + public Set<T> nodes() { + return nodes; + } + + public Map<T, Set<T>> edges() { + return edges; + } + + public Set<T> adjacentNodes(T u) { + return edges.get(u); + } + + /** + * Returns a new Graph after transitive reduction + */ + public Graph<T> reduce() { + Graph.Builder<T> builder = new Builder<>(); + nodes.stream() + .forEach(u -> { + builder.addNode(u); + edges.get(u).stream() + .filter(v -> !pathExists(u, v, false)) + .forEach(v -> builder.addEdge(u, v)); + }); + return builder.build(); + } + + /** + * Returns a new Graph after transitive reduction. All edges in + * the given g takes precedence over this graph. + * + * @throw IllegalArgumentException g must be a subgraph this graph + */ + public Graph<T> reduce(Graph<T> g) { + boolean subgraph = nodes.containsAll(g.nodes) && g.edges.keySet().stream() + .allMatch(u -> adjacentNodes(u).containsAll(g.adjacentNodes(u))); + if (!subgraph) { + throw new IllegalArgumentException("the given argument is not a subgraph of this graph"); + } + + Graph.Builder<T> builder = new Builder<>(); + nodes.stream() + .forEach(u -> { + builder.addNode(u); + // filter the edge if there exists a path from u to v in the given g + // or there exists another path from u to v in this graph + edges.get(u).stream() + .filter(v -> !g.pathExists(u, v) && !pathExists(u, v, false)) + .forEach(v -> builder.addEdge(u, v)); + }); + + // add the overlapped edges from this graph and the given g + g.edges().keySet().stream() + .forEach(u -> g.adjacentNodes(u).stream() + .filter(v -> isAdjacent(u, v)) + .forEach(v -> builder.addEdge(u, v))); + return builder.build(); + } + + private boolean isAdjacent(T u, T v) { + return edges.containsKey(u) && edges.get(u).contains(v); + } + + private boolean pathExists(T u, T v) { + return pathExists(u, v, true); + } + + /** + * Returns true if there exists a path from u to v in this graph. + * If includeAdjacent is false, it returns true if there exists + * another path from u to v of distance > 1 + */ + private boolean pathExists(T u, T v, boolean includeAdjacent) { + if (!nodes.contains(u) || !nodes.contains(v)) { + return false; + } + if (includeAdjacent && isAdjacent(u, v)) { + return true; + } + Deque<T> stack = new LinkedList<>(); + Set<T> visited = new HashSet<>(); + stack.push(u); + while (!stack.isEmpty()) { + T node = stack.pop(); + if (node.equals(v)) { + if (traceOn) { + System.out.format("Edge %s -> %s removed%n", u, v); + } + return true; + } + if (!visited.contains(node)) { + visited.add(node); + edges.get(node).stream() + .filter(e -> includeAdjacent || !node.equals(u) || !e.equals(v)) + .forEach(e -> stack.push(e)); + } + } + assert !visited.contains(v); + return false; + } + + void printGraph(PrintStream out) { + nodes.stream() + .forEach(u -> adjacentNodes(u).stream() + .forEach(v -> out.format("%s -> %s%n", u, v))); + } + + public static class Builder<T> { + final Set<T> nodes = new HashSet<>(); + final Map<T, Set<T>> edges = new HashMap<>(); + public void addNode(T node) { + if (nodes.contains(node)) { + return; + } + nodes.add(node); + edges.computeIfAbsent(node, _e -> new HashSet<>()); + } + public void addEdge(T u, T v) { + addNode(u); + addNode(v); + edges.get(u).add(v); + } + public Graph<T> build() { + return new Graph<>(nodes, edges); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/src/classes/build/tools/jigsaw/ModuleSummary.java Thu Mar 17 19:04:16 2016 +0000 @@ -0,0 +1,766 @@ +/* + * Copyright (c) 2014, 2016, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package build.tools.jigsaw; + +import java.io.IOException; +import java.io.PrintStream; +import java.lang.module.Configuration; +import java.lang.module.ModuleDescriptor; +import java.lang.module.ModuleFinder; +import java.lang.module.ModuleReference; +import java.lang.module.ResolvedModule; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.Comparator; +import java.util.Date; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import static java.lang.module.ModuleDescriptor.*; +import static build.tools.jigsaw.ModuleSummary.HtmlDocument.Selector.*; +import static build.tools.jigsaw.ModuleSummary.HtmlDocument.Division.*; + +public class ModuleSummary { + private static final String USAGE = "Usage: ModuleSummary -mp <dir> -o <outfile> [-root mn]*"; + + public static void main(String[] args) throws Exception { + int i=0; + Path modpath = null; + Path outfile = null; + Set<String> roots = new HashSet<>(); + while (i < args.length && args[i].startsWith("-")) { + String arg = args[i++]; + switch (arg) { + case "-mp": + modpath = Paths.get(args[i++]); + break; + case "-o": + outfile = Paths.get(args[i++]); + break; + case "-root": + roots.add(args[i++]); + default: + System.err.println(USAGE); + System.exit(-1); + } + } + if (outfile == null || modpath == null) { + System.err.println(USAGE); + System.exit(1); + } + Path dir = outfile.getParent() != null ? outfile.getParent() : Paths.get("."); + Files.createDirectories(dir); + + Map<String, ModuleSummary> modules = new HashMap<>(); + Set<ModuleReference> mrefs = ModuleFinder.ofSystem().findAll(); + for (ModuleReference mref : mrefs) { + String mn = mref.descriptor().name(); + Path jmod = modpath.resolve(mn + ".jmod"); + modules.put(mn, new ModuleSummary(mref, jmod)); + } + + if (roots.isEmpty()) { + roots.addAll(modules.keySet()); + } + genReport(outfile, modules, roots, "JDK Module Summary"); + } + + static void genReport(Path outfile, Map<String, ModuleSummary> modules, Set<String> roots, String title) + throws IOException + { + Configuration cf = resolve(roots); + try (PrintStream out = new PrintStream(Files.newOutputStream(outfile))) { + HtmlDocument doc = new HtmlDocument(title, modules); + Set<ModuleDescriptor> descriptors = cf.modules().stream() + .map(ResolvedModule::reference) + .map(ModuleReference::descriptor) + .collect(Collectors.toSet()); + doc.writeTo(out, descriptors); + } + } + + private final String name; + private final ModuleDescriptor descriptor; + private final JmodInfo jmodInfo; + ModuleSummary(ModuleReference mref, Path jmod) throws IOException { + this.name = mref.descriptor().name(); + this.descriptor = mref.descriptor(); + this.jmodInfo = new JmodInfo(jmod); + } + + String name() { + return name; + } + + long uncompressedSize() { + return jmodInfo.size; + } + + long jmodFileSize() { + return jmodInfo.filesize; // estimated compressed size + } + + ModuleDescriptor descriptor() { + return descriptor; + } + + int numClasses() { + return jmodInfo.classCount; + } + + long classBytes() { + return jmodInfo.classBytes; + } + + int numResources() { + return jmodInfo.resourceCount; + } + + long resourceBytes() { + return jmodInfo.resourceBytes; + } + + int numConfigs() { + return jmodInfo.configCount; + } + long configBytes() { + return jmodInfo.configBytes; + } + int numCommands() { + return jmodInfo.nativeCmds.size(); + } + + long commandBytes() { + return jmodInfo.nativeCmds.values().stream() + .mapToLong(l -> l.longValue()).sum() - jmodInfo.debugInfoCmdBytes; + } + int numCommandsDebug() { + return jmodInfo.debugInfoCmdCount; + } + long commandDebugBytes() { + return jmodInfo.debugInfoCmdBytes; + } + int numNativeLibraries() { + return jmodInfo.nativeLibs.size(); + } + + long nativeLibrariesBytes() { + return jmodInfo.nativeLibs.values().stream() + .mapToLong(l -> l.longValue()).sum() - jmodInfo.debugInfoLibBytes; + } + int numNativeLibrariesDebug() { + return jmodInfo.debugInfoLibCount; + } + + long nativeLibrariesDebugBytes() { + return jmodInfo.debugInfoLibBytes; + } + + Map<String,Long> commands() { + return jmodInfo.nativeCmds; + } + + Map<String,Long> nativeLibs() { + return jmodInfo.nativeLibs; + } + + Map<String,Long> configFiles() { + return jmodInfo.configFiles; + } + + + static class JmodInfo { + final long size; + final long filesize; + final int classCount; + final long classBytes; + final int resourceCount; + final long resourceBytes; + final int configCount; + final long configBytes; + final int debugInfoLibCount; + final long debugInfoLibBytes; + final int debugInfoCmdCount; + final long debugInfoCmdBytes; + final Map<String,Long> configFiles = new HashMap<>(); + final Map<String,Long> nativeCmds = new HashMap<>(); + final Map<String,Long> nativeLibs = new HashMap<>(); + + JmodInfo(Path jmod) throws IOException { + long total = 0; + long cBytes = 0, rBytes = 0, cfBytes = 0, dizLibBytes = 0, dizCmdBytes = 0; + int cCount = 0, rCount = 0, cfCount = 0, dizLibCount = 0, dizCmdCount = 0; + try (ZipFile zf = new ZipFile(jmod.toFile())) { + for (Enumeration<? extends ZipEntry> e = zf.entries(); e.hasMoreElements(); ) { + ZipEntry ze = e.nextElement(); + String fn = ze.getName(); + int pos = fn.indexOf('/'); + String dir = fn.substring(0, pos); + String filename = fn.substring(fn.lastIndexOf('/') + 1); + // name shown in the column + String name = filename; + + long len = ze.getSize(); + total += len; + switch (dir) { + case NATIVE_LIBS: + nativeLibs.put(name, len); + if (filename.endsWith(".diz")) { + dizLibCount++; + dizLibBytes += len; + } + break; + case NATIVE_CMDS: + nativeCmds.put(name, len); + if (filename.endsWith(".diz")) { + dizCmdCount++; + dizCmdBytes += len; + } + break; + case CLASSES: + if (filename.endsWith(".class")) { + cCount++; + cBytes += len; + } else { + rCount++; + rBytes += len; + } + break; + case CONFIG: + configFiles.put(name, len); + cfCount++; + cfBytes += len; + break; + default: + break; + } + } + this.filesize = jmod.toFile().length(); + this.classCount = cCount; + this.classBytes = cBytes; + this.resourceCount = rCount; + this.resourceBytes = rBytes; + this.configCount = cfCount; + this.configBytes = cfBytes; + this.size = total; + this.debugInfoLibCount = dizLibCount; + this.debugInfoLibBytes = dizLibBytes; + this.debugInfoCmdCount = dizCmdCount; + this.debugInfoCmdBytes = dizCmdBytes; + } + } + + static final String NATIVE_LIBS = "native"; + static final String NATIVE_CMDS = "bin"; + static final String CLASSES = "classes"; + static final String CONFIG = "conf"; + + static final String MODULE_ID = "module/id"; + static final String MODULE_MAIN_CLASS = "module/main-class"; + } + + static Configuration resolve(Set<String> roots) { + return Configuration.empty() + .resolveRequires(ModuleFinder.ofSystem(), + ModuleFinder.empty(), + roots); + } + + static class HtmlDocument { + final String title; + final Map<String, ModuleSummary> modules; + boolean requiresPublicNote = false; + boolean aggregatorNote = false; + boolean totalBytesNote = false; + HtmlDocument(String title, Map<String, ModuleSummary> modules) { + this.title = title; + this.modules = modules; + } + + void writeTo(PrintStream out, Set<ModuleDescriptor> selectedModules) { + out.format("<html><head>%n"); + out.format("<title>%s</title>%n", title); + // stylesheet + Arrays.stream(HtmlDocument.STYLES).forEach(out::println); + out.format("</head>%n"); + + // body begins + out.format("<body>%n"); + + // title and date + out.println(DOCTITLE.toString(title)); + out.println(VERSION.toString(String.format("%tc", new Date()))); + + // total modules and sizes + long totalBytes = selectedModules.stream() + .map(ModuleDescriptor::name) + .map(modules::get) + .mapToLong(ModuleSummary::uncompressedSize) + .sum(); + String[] sections = new String[] { + String.format("%s: %d", "Total modules", selectedModules.size()), + String.format("%s: %,d bytes (%s %s)", "Total size", + totalBytes, + System.getProperty("os.name"), + System.getProperty("os.arch")) + }; + out.println(SECTION.toString(sections)); + + // write table and header + out.println(String.format("<table class=\"%s\">", MODULES)); + out.println(header("Module", "Requires", "Exports", + "Services", "Commands/Native Libraries/Configs")); + + // write contents - one row per module + selectedModules.stream() + .sorted(Comparator.comparing(ModuleDescriptor::name)) + .map(m -> modules.get(m.name())) + .map(ModuleTableRow::new) + .forEach(table -> table.writeTo(out)); + + out.format("</table>"); // end table + out.format("</body>"); + out.println("</html>"); + } + + String header(String... columns) { + StringBuilder sb = new StringBuilder(); + sb.append("<tr>"); + Arrays.stream(columns) + .forEach(cn -> sb.append(" <th>").append(cn).append("</th>").append("\n")); + sb.append("</tr>"); + return sb.toString(); + } + + static enum Selector { + MODULES("modules"), + MODULE("module"), + MODULE_DEF("code name def"), + AGGREGATOR("code name def agg"), + REQUIRES("code"), + REQUIRES_PUBLIC("code reexp"), + BR("br"), + CODE("code"), + NUMBER("number"),; + final String name; + Selector(String name) { + this.name = name; + } + @Override + public String toString() { + return name; + } + } + + static enum Division { + DOCTITLE("doctitle"), + VERSION("versions"), + SECTION("section"); + final String name; + + Division(String name) { + this.name = name; + } + + public String toString(String... lines) { + String value = Arrays.stream(lines).collect(Collectors.joining("<br>\n")); + return "<div class=\"" + name + "\">" + value + "</div>"; + } + } + + class ModuleTableRow { + private final ModuleSummary ms; + private final Set<ModuleDescriptor> deps; + private final int maxRows; + private final boolean aggregator; + ModuleTableRow(ModuleSummary ms) { + this.ms = ms; + Configuration cf = resolve(Set.of(ms.name())); + this.deps = cf.modules().stream() + .map(ResolvedModule::reference) + .map(ModuleReference::descriptor) + .collect(Collectors.toSet()); + int count = (ms.numClasses() > 0 ? 1 : 0) + + (ms.numResources() > 0 ? 1 : 0) + + (ms.numConfigs() > 0 ? 1 : 0) + + (ms.numNativeLibraries() > 0 ? 1 : 0) + + (ms.numNativeLibrariesDebug() > 0 ? 1 : 0) + + (ms.numCommands() > 0 ? 1 : 0) + + (ms.numCommandsDebug() > 0 ? 1 : 0); + this.aggregator = ms.numClasses() == 1 && count == 1; // only module-info.class + + // 5 fixed rows (name + 2 transitive count/size + 2 blank rows) + this.maxRows = 5 + count + (aggregator && !aggregatorNote ? 2 : 0); + } + + public void writeTo(PrintStream out) { + out.println(String.format("<tr id=\"%s\" class=\"%s\">", ms.name(), MODULE)); + out.println(moduleColumn()); + out.println(requiresColumn()); + out.println(exportsColumn()); + out.println(servicesColumn()); + out.println(otherSectionColumn()); + out.println("</td>"); + out.println("</tr>"); + } + + public String moduleColumn() { + // module name + StringBuilder sb = new StringBuilder(" "); + sb.append("<td>"); + sb.append(String.format("<table class=\"%s\">", MODULE)).append("\n"); + sb.append(moduleName(ms.name())); + sb.append(blankRow()); + // metadata + sb.append(toTableRow("class", "classes", ms.numClasses(), ms.classBytes())); + sb.append(toTableRow("resource", "resources", ms.numResources(), ms.resourceBytes())); + sb.append(toTableRow("config", "configs", ms.numConfigs(), ms.configBytes())); + sb.append(toTableRow("native library", "native libraries", + ms.numNativeLibraries(), ms.nativeLibrariesBytes())); + sb.append(toTableRow("native library debug", "native libraries debug", + ms.numNativeLibrariesDebug(), ms.nativeLibrariesDebugBytes())); + sb.append(toTableRow("command", "commands", ms.numCommands(), ms.commandBytes())); + sb.append(toTableRow("command debug", "commands debug", + ms.numCommandsDebug(), ms.commandDebugBytes())); + sb.append(blankRow()); + + // transitive dependencies + long reqBytes = deps.stream() + .filter(d -> !d.name().equals(ms.name())) + .mapToLong(d -> modules.get(d.name()).uncompressedSize()) + .sum(); + long reqJmodFileSize = deps.stream() + .mapToLong(d -> modules.get(d.name()).jmodFileSize()) + .sum(); + // size + if (totalBytesNote) { + sb.append(toTableRow("Total bytes", ms.uncompressedSize())); + sb.append(toTableRow("Total bytes of dependencies", reqBytes)); + } else { + // print footnote + sb.append(toTableRow("Total bytes<sup>1</sup>", ms.uncompressedSize())); + sb.append(toTableRow("Total bytes of dependencies<sup>2</sup>", reqBytes)); + } + String files = deps.size() == 1 ? "file" : "files"; + sb.append(toTableRow(String.format("Total jmod bytes (%d %s)", deps.size(), files), reqJmodFileSize)); + + if (aggregator && !aggregatorNote) { + aggregatorNote = true; + sb.append(blankRow()); + sb.append(toTableRow("<i>* aggregator is a module with module-info.class only</i>", BR)); + } + if (!totalBytesNote) { + totalBytesNote = true; + sb.append(blankRow()); + sb.append(toTableRow("<i><sup>1</sup>sum of all files including debug files</i>", BR)); + sb.append(toTableRow("<i><sup>2</sup>sum of direct and indirect dependencies</i>", BR)); + } + sb.append("</table>").append("</td>"); + return sb.toString(); + } + + private String moduleName(String mn) { + if (aggregator) { + StringBuilder sb = new StringBuilder(); + sb.append(String.format("<tr><td colspan=\"2\"><span class=\"%s\">", AGGREGATOR)) + .append(mn) + .append("</span>").append(" "); + if (!aggregatorNote) { + sb.append("(aggregator<sup>*</sup>)"); + } else { + sb.append("(aggregator)"); + } + sb.append("</td></tr>"); + return sb.toString(); + } else { + return toTableRow(mn, MODULE_DEF); + } + } + + public String requiresColumn() { + StringBuilder sb = new StringBuilder(); + sb.append(String.format("<td>")); + boolean footnote = requiresPublicNote; + ms.descriptor().requires().stream() + .sorted(Comparator.comparing(Requires::name)) + .forEach(r -> { + boolean requiresPublic = r.modifiers().contains(Requires.Modifier.PUBLIC); + Selector sel = requiresPublic ? REQUIRES_PUBLIC : REQUIRES; + String req = String.format("<a class=\"%s\" href=\"#%s\">%s</a>", + sel, r.name(), r.name()); + if (!requiresPublicNote && requiresPublic) { + requiresPublicNote = true; + req += "<sup>*</sup>"; + } + sb.append(req).append("\n").append("<br>"); + }); + + if (!ms.name().equals("java.base")) { + int directDeps = ms.descriptor().requires().size(); + int indirectDeps = deps.size()-directDeps-1; + for (int i=directDeps; i< (maxRows-1); i++) { + sb.append("<br>"); + } + sb.append("<br>"); + sb.append("<i>+").append(indirectDeps).append(" transitive dependencies</i>"); + } + if (footnote != requiresPublicNote) { + sb.append("<br><br>").append("<i>* bold denotes requires public</i>"); + } + sb.append("</td>"); + return sb.toString(); + } + + public String exportsColumn() { + StringBuilder sb = new StringBuilder(); + sb.append(String.format(" <td class=\"%s\">", CODE)); + ms.descriptor().exports().stream() + .sorted(Comparator.comparing(Exports::source)) + .filter(e -> !e.isQualified()) + .forEach(e -> sb.append(e.source()).append("<br>").append("\n")); + sb.append("</td>"); + return sb.toString(); + } + + public String servicesColumn() { + StringBuilder sb = new StringBuilder(); + sb.append(String.format(" <td class=\"%s\">", CODE)); + ms.descriptor().uses().stream() + .sorted() + .forEach(s -> sb.append("uses ").append(s).append("<br>").append("\n")); + ms.descriptor().provides().entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .flatMap(e -> e.getValue().providers().stream() + .map(p -> String.format("provides %s<br> with %s", + e.getKey(), p))) + .forEach(p -> sb.append(p).append("<br>").append("\n")); + sb.append("</td>"); + return sb.toString(); + } + + public String otherSectionColumn() { + StringBuilder sb = new StringBuilder(); + sb.append("<td>"); + sb.append(String.format("<table class=\"%s\">", MODULE)).append("\n"); + // commands + if (ms.numCommands() > 0) { + sb.append(toTableRow("bin/", CODE)); + ms.commands().entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .forEach(e -> sb.append(toTableRow(e.getKey(), e.getValue(), CODE))); + sb.append(blankRow()); + } + + // native libraries + if (ms.numNativeLibraries() > 0) { + sb.append(toTableRow("lib/", CODE)); + ms.nativeLibs().entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .forEach(e -> sb.append(toTableRow(e.getKey(), e.getValue(), CODE))); + sb.append(blankRow()); + } + + // config files + if (ms.numConfigs() > 0) { + sb.append(toTableRow("conf/", CODE)); + ms.configFiles().entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .forEach(e -> sb.append(toTableRow(e.getKey(), e.getValue(), CODE))); + } + // totals + sb.append("</table>").append("</td>"); + return sb.toString(); + } + + private String blankRow() { + return toTableRow(" ", BR); + } + + private String toTableRow(String col, Selector selector) { + TableDataBuilder builder = new TableDataBuilder(); + builder.colspan(selector, 2, col); + return builder.build(); + } + + private String toTableRow(String col1, long col2) { + return toTableRow(col1, col2, BR); + } + + private String toTableRow(String col1, long col2, Selector selector) { + TableDataBuilder builder = new TableDataBuilder(); + builder.data(selector, col1); + builder.data(col2); + return builder.build(); + + } + + private String toTableRow(String singular, String plural, int count, long bytes) { + if (count == 0) { + return ""; + } + TableDataBuilder builder = new TableDataBuilder(); + if (count == 1) { + builder.data(count + " " + singular); + } else { + builder.data(count + " " + plural); + } + builder.data(bytes); + return builder.build(); + } + + class TableDataBuilder { + private final StringBuilder sb; + TableDataBuilder() { + this.sb = new StringBuilder("<tr>"); + } + TableDataBuilder data(String s) { + data(BR, s); + return this; + } + TableDataBuilder data(long num) { + data(NUMBER, String.format("%,d", num)); + return this; + } + TableDataBuilder colspan(Selector selector, int columns, String data) { + sb.append("<td colspan=\"").append(columns).append("\">"); + sb.append("<span class=\"").append(selector).append("\">"); + sb.append(data).append("</span></td>"); + return this; + } + + TableDataBuilder data(Selector selector, String data) { + sb.append("<td class=\"").append(selector).append("\">"); + sb.append(data).append("</td>"); + return this; + } + String build() { + sb.append("</tr>"); + return sb.toString(); + } + } + } + + private static final String[] STYLES = new String[]{ + "<link rel=\"stylesheet\" type=\"text/css\" href=\"/.fonts/dejavu.css\"/>", + "<style type=\"text/css\">", + " HTML, BODY, DIV, SPAN, APPLET, OBJECT, IFRAME, H1, H2, H3, H4, H5, H6, P,", + " BLOCKQUOTE, PRE, A, ABBR, ACRONYM, ADDRESS, BIG, CITE, CODE, DEL, DFN, EM,", + " IMG, INS, KBD, Q, S, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, B, U,", + " I, CENTER, DL, DT, DD, OL, UL, LI, FIELDSET, FORM, LABEL, LEGEND, TABLE,", + " CAPTION, TBODY, TFOOT, THEAD, TR, TH, TD, ARTICLE, ASIDE, CANVAS, DETAILS,", + " EMBED, FIGURE, FIGCAPTION, FOOTER, HEADER, HGROUP, MENU, NAV, OUTPUT, RUBY,", + " SECTION, SUMMARY, TIME, MARK, AUDIO, VIDEO {", + " margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit;", + " vertical-align: baseline; }", + " ARTICLE, ASIDE, DETAILS, FIGCAPTION, FIGURE, ", + " FOOTER, HEADER, HGROUP, MENU, NAV, SECTION { display: block; }", + " BLOCKQUOTE, Q { quotes: none; }", + " BLOCKQUOTE:before, BLOCKQUOTE:after, Q:before, Q:after {", + " content: ''; content: none; }", + " TABLE { border-collapse: collapse; border-spacing: 0; }", + " A { text-decoration: none; }", + " A:link { color: #437291; }", + " A:visited { color: #666666; }", + " A.anchor:link, A.anchor:visited { color: black; }", + " A[href]:hover { color: #e76f00; }", + " A IMG { border-width: 0px; }", + " HTML { font-size: 20px; } /* baseline grid */", + " HTML > BODY { font-size: 14px; }", + " BODY {", + " background: white;", + " margin: 40px;", + " margin-bottom: 150%;", + " line-height: 20px;", + " -webkit-text-size-adjust: 100%; /* iOS */", + " color: #222;", + " }", + " BODY { font-family: \"DejaVu Serif\", \"Lucida Bright\", \"Bookman Old Style\",", + " Georgia, serif; }", + " CODE, TT, .jref, DIV.spec .open, TABLE.profiles {", + " font-family: \"DejaVu Sans\", \"Lucida Sans\", Helvetica, sans-serif; }", + " PRE, .code { font-family: \"DejaVu Sans Mono\", \"Bitstream Vera Sans Mono\",", + " Monaco, \"Courier New\", monospace; }", + " H1, H2, H3, H4 { color: green; font-weight: bold; }", + " I { font-style: italic; }", + " TH { font-weight: bold; }", + " P { text-indent: 40px; }", + " P:first-child, UL + P, OL + P, BLOCKQUOTE + P, TABLE + P, P.subsection,", + " P.break, DIV.profiles-table + P { text-indent: 0; }", + " P.break { margin-top: 10px; }", + " P.subsection { margin-top: 20px; }", + " P.subsection SPAN.title { font-weight: bold; padding-right: 20px; }", + " UL, OL { margin: 10px 0; padding-left: 40px; }", + " LI { margin-bottom: 10px; }", + " UL.compact LI { margin-bottom: 0; }", + " PRE { padding: 0; margin: 10px 0 10px 20px; background: #eee; width: 45em; }", + " BLOCKQUOTE { margin: 10px 0; margin-left: 20px; }", + " LI BLOCKQUOTE { margin-left: 0; }", + " UL LI { list-style-type: square; }", + " .todo { color: darkred; text-align: right; }", + " .error { color: red; font-weight: bold; }", + " .warn { color: #ee0000; font-weight: bold; }", + " DIV.doctitle { margin-top: -13px;", + " font-size: 22px; line-height: 40px; font-weight: bold; }", + " DIV.twarn { color: #cc0000; font-weight: bold; margin-bottom: 9px; }", + " DIV.subtitle { margin-top: 2px; font-size: 18px; font-weight: bold; }", + " DIV.authors { margin-top: 10px; margin-bottom: 10px; font-size: 16px; }", + " DIV.author A { font-style: italic; }", + " DIV.version { margin-top: 10px; font-size: 12px; }", + " DIV.version, DIV.legal-notice { font-size: 12px; line-height: 15px; }", + " SPAN.hash { font-size: 9px; }", + " DIV.version SPAN.modified { color: green; font-weight: bold; }", + " DIV.head { margin-bottom: 20px; }", + " DIV.section > DIV.title, DIV.section DIV.number SPAN {", + " font-size: 15px; font-weight: bold; }", + " TABLE { border-collapse: collapse; border: none; }", + " TD.number { text-align: right; }", + " TD, TH { text-align: left; white-space: nowrap; }", + " TD.name, SPAN.name { font-weight: bold; }", + " ", + " TABLE.module { width: 100%; }", + " TABLE.module TD:first-child { padding-right: 10px; }", + " TR.module > TD { padding: 10px 0; border-top: 1px solid black; }", + " TR > TH { padding-bottom: 10px; }", + " TR.br TD { padding-top: 20px; }", + " TABLE.modules { margin-top: 20px; }", + " TABLE.modules > TBODY > TR > TD:nth-child(even) { background: #eee; }", + " TABLE.modules > TBODY > TR > TD, TABLE.modules > TBODY > TR > TH {", + " padding-left: 10px; padding-right: 10px; }", + " .reexp, .def { font-weight: bold; }", + " .agg { font-style: italic; }", + " SUP { height: 0; line-height: 1; position: relative;", + " vertical-align: baseline; bottom: 1ex; font-size: 11px; }", + "</style>", + }; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/src/classes/build/tools/jigsaw/technology-summary.html Thu Mar 17 19:04:16 2016 +0000 @@ -0,0 +1,627 @@ +<html> +<head> +<title>JDK Technology Summary</title> +<style type="text/css"> +table { border: 1px solid black; border-collapse: collapse; } +tr.se-base { background-color: bisque; } +tr.se-misc { background-color: lavender; } +tr.se-ee { background-color: lightgreen; } +tr.se-ext { background-color: pink; } +td { font-family: monospace; padding: 4px; border: 1px solid; } +</style> +</head> + +<h1>JCP Technologies in the Modular JDK</h1> + +<p><em>Last updated 2015-03-06 (Added java.datatransfer. Assumes JNLP is modularized, and StAX joins the Java SE Platform.)</em></p> + +<p><a href="module-summary.html">JDK Module Summary</a> | Technologies in the <a href="https://docs.oracle.com/javase/8/docs/">Java SE Documentation</a></p> + +<table> +<tr><th>Legend</th></tr> +<tr class="se-base"><td><a href="https://jcp.org/en/jsr/platform?listBy=2&listByType=platform">JCP technology in the Java SE Platform only -- in java.base</a></td></tr> +<tr class="se-misc"><td><a href="https://jcp.org/en/jsr/platform?listBy=2&listByType=platform">JCP technology in the Java SE Platform only -- not in java.base</a></td></tr> +<tr class="se-ee"><td><a href="https://jcp.org/en/jsr/platform?listBy=3&listByType=platform">JCP technology in the Java SE Platform and the Java EE Platform</a></a></td></tr> +<tr class="se-ext"><td><a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#endorsed-standards-apis">JCP technology in the Java SE Platform based on non-JCP standards</a></a></td></tr> +<tr><td>JCP technology in neither the Java SE or EE Platforms</td></tr> +</table> + +<p><em>An <strong>upgradeable</strong> module contains JCP technology that is in the Java SE Platform but is not exclusive to the Java SE Platform, i.e., the green and pink technologies. Most upgradeable modules are defined by loaders other than the bootstrap.</em></p> + +<br/> + +<table> +<tr> +<th>Technology</th> +<th>Original JSR</th> +<th><a href="https://jcp.org/en/procedures/jcp2#DEF">Original Target</a></th> +<th>Module</th> +<th><a href="https://jcp.org/en/procedures/jcp2#2.1.2">Evolved By</a></th> +<th>History</th> +<th>Profile/SE</th> +<th>Loader</th> +<th>Upg?</th> +</tr> + +<tr class="se-misc"> +<td>JMX</td> +<td><a href="https://jcp.org/en/jsr/detail?id=3">3</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.management">java.management</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>3</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>Print Service</td> +<td><a href="https://jcp.org/en/jsr/detail?id=6">6</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.desktop">java.desktop</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>SE</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>Preferences</td> +<td><a href="https://jcp.org/en/jsr/detail?id=10">10</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.prefs">java.prefs</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>3</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>Image I/O</td> +<td><a href="https://jcp.org/en/jsr/detail?id=15">15</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.desktop">java.desktop</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>SE</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>SASL</td> +<td><a href="https://jcp.org/en/jsr/detail?id=28">28</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.security.sasl"/>java.security.sasl</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>3</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>Logging</td> +<td><a href="https://jcp.org/en/jsr/detail?id=47">47</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.logging">java.logging</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>1</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-base"> +<td>NIO</td> +<td><a href="https://jcp.org/en/jsr/detail?id=51">51</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.base"/>java.base</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>1</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr> +<td>JNLP</td> +<td><a href="https://jcp.org/en/jsr/detail?id=56">56</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.desktop">java.jnlp</a></td> +<td>Original JSR</td> +<td></td> +<td>N/A</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>Beans Persistence</td> +<td><a href="https://jcp.org/en/jsr/detail?id=57">57</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.desktop">java.desktop</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>SE</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>GSS</td> +<td><a href="https://jcp.org/en/jsr/detail?id=72">72</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.security.jgss">java.security.jgss</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>3</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>XML Digital Signature</td> +<td><a href="https://jcp.org/en/jsr/detail?id=105">105</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.xml.crypto">java.xml.crypto</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>3</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>JDBC Rowset</td> +<td><a href="https://jcp.org/en/jsr/detail?id=114">114</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.sql.rowset">java.sql.rowset</a></td> +<td>Original JSR</td> +<td>Co-evolved with JDBC</td> +<td>3</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>JMX Remote</td> +<td><a href="https://jcp.org/en/jsr/detail?id=160">160</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.management">java.management</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>3</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>Profiling (Agent)</td> +<td><a href="https://jcp.org/en/jsr/detail?id=163">163</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.instrument">java.instrument</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>3</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>Profiling (JMX)</td> +<td><a href="https://jcp.org/en/jsr/detail?id=163">163</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.management">java.management</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>3</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-base"> +<td>Concurrency Utilities</td> +<td><a href="https://jcp.org/en/jsr/detail?id=166">166</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.base"/>java.base</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>1</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-base"> +<td>Annotations</td> +<td><a href="https://jcp.org/en/jsr/detail?id=175">175</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.base"/>java.base</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>1</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>StAX</td> +<td><a href="https://jcp.org/en/jsr/detail?id=173">173</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.xml">java.xml</a></td> +<td>Original JSR</td> +<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a></td> +<td>2</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>Annotations (Language Model)</td> +<td><a href="https://jcp.org/en/jsr/detail?id=175">175</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.compiler"/>java.compiler</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>3</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>Compiler</td> +<td><a href="https://jcp.org/en/jsr/detail?id=199">199</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.compiler">java.compiler</a></td> +<td>Original JSR</td> +<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a></td> +<td>3</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-base"> +<td>Pack200</td> +<td><a href="https://jcp.org/en/jsr/detail?id=200">200</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.base"/>java.base</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>1</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-base"> +<td>NIO.2</td> +<td><a href="https://jcp.org/en/jsr/detail?id=203">203</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.base"/>java.base</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>1</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>JAXP</td> +<td><a href="https://jcp.org/en/jsr/detail?id=206">206</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.xml">java.xml</a></td> +<td>UJSR for Java SE</td> +<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a></td> +<td>2</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>JDBC</td> +<td><a href="https://jcp.org/en/jsr/detail?id=221">221</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.sql">java.sql</a></td> +<td>Original JSR</td> +<td>Co-evolved with JDBC Rowset</td> +<td>2</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>Scripting</td> +<td><a href="https://jcp.org/en/jsr/detail?id=223">223</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.scripting">java.scripting</a></td> +<td>Original JSR</td> +<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a></td> +<td>1</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr> +<td>Smart Card I/O</td> +<td><a href="https://jcp.org/en/jsr/detail?id=268">268</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.smartcardio">java.smartcardio</a></td> +<td>Original JSR</td> +<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a> (unlisted)</td> +<td>N/A</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>Annotation Processing</td> +<td><a href="https://jcp.org/en/jsr/detail?id=269">269</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.compiler">java.compiler</a></td> +<td>Original JSR</td> +<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a></td> +<td>3</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-base"> +<td>InvokeDynamic</td> +<td><a href="https://jcp.org/en/jsr/detail?id=292">292</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.base"/>java.base</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>1</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-base"> +<td>Type Annotations</td> +<td><a href="https://jcp.org/en/jsr/detail?id=308">308</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.base"/>java.base</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>1</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>Type Annotations (Language Model)</td> +<td><a href="https://jcp.org/en/jsr/detail?id=308">308</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.compiler"/>java.compiler</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>3</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-base"> +<td>Date and Time</td> +<td><a href="https://jcp.org/en/jsr/detail?id=310">310</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.base"/>java.base</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>1</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-base"> +<td>Streams</td> +<td><a href="https://jcp.org/en/jsr/detail?id=335">335</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.base"/>java.base</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>1</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-base"> +<td>Collections, Math, I18N, I/O, Net, Reflection</td> +<td>---</td> +<td>---</td> +<td><a href="module-summary.html#java.base"/>java.base</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>1</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-base"> +<td>JCA, JAAS, JSSE</td> +<td>---</td> +<td>---</td> +<td><a href="module-summary.html#java.base"/>java.base</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>1</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>Applet, AWT, Swing, Java 2D, Beans, A11Y, Sound</td> +<td>---</td> +<td>---</td> +<td><a href="module-summary.html#java.desktop"/>java.desktop</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>SE</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>Data Transfer</td> +<td>---</td> +<td>---</td> +<td><a href="module-summary.html#java.datatransfer"/>java.datatransfer</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>SE</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>JNDI</td> +<td>---</td> +<td>---</td> +<td><a href="module-summary.html#java.naming"/>java.naming</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>3</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>RMI</td> +<td>---</td> +<td>---</td> +<td><a href="module-summary.html#java.rmi"/>java.rmi</a></td> +<td>UJSR for Java SE</td> +<td></td> +<td>2</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-misc"> +<td>JAF</td> +<td><a href="https://jcp.org/en/jsr/detail?id=925">925</a></td> +<td>---</td> +<td><a href="module-summary.html#java.activation">java.activation</a></a></td> +<td>Original JSR</td> +<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a> (unlisted)</td> +<td>SE</td> +<td>ext</td> +<td>Yes</td> +</tr> + +<tr class="se-ext"> +<td>RMI-IIOP, IDL</td> +<td>(OMG)</td> +<td>---</td> +<td><a href="module-summary.html#java.corba"/>java.corba</a></td> +<td>UJSR for Java SE</td> +<td>Formerly an <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#endorsed-standards-apis">Endorsed Standard</a></td> +<td>SE</td> +<td>ext</td> +<td>Yes</td> +</tr> + +<tr class="se-ext"> +<td>DOM, SAX</td> +<td>(W3C)</td> +<td>---</td> +<td><a href="module-summary.html#java.xml">java.xml</a></td> +<td>UJSR for Java SE</td> +<td>Formerly an <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#endorsed-standards-apis">Endorsed Standard</a></td> +<td>2</td> +<td>boot</td> +<td>No</td> +</tr> + +<tr class="se-ee"> +<td>SAAJ</td> +<td><a href="https://jcp.org/en/jsr/detail?id=67">67</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.xml.ws">java.xml.ws</a></td> +<td>Original JSR</td> +<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a> (f.k.a. JAXM)</td> +<td>SE</td> +<td>ext</td> +<td>Yes</td> +</tr> + +<tr class="se-ee"> +<td>Web Services Metadata</td> +<td><a href="https://jcp.org/en/jsr/detail?id=181">181</a></td> +<td>Java EE</td> +<td><a href="module-summary.html#java.xml.ws">java.xml.ws</a></td> +<td>Original JSR</td> +<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a> (unlisted)</td> +<td>SE</td> +<td>ext</td> +<td>Yes</td> +</tr> + +<tr class="se-ee"> +<td>JAXB</td> +<td><a href="https://jcp.org/en/jsr/detail?id=222">222</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.xml.bind">java.xml.bind</a></td> +<td>Original JSR</td> +<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a></td> +<td>SE</td> +<td>ext</td> +<td>Yes</td> +</tr> + +<tr class="se-ee"> +<td>JAXWS</td> +<td><a href="https://jcp.org/en/jsr/detail?id=224">224</a></td> +<td>Java SE</td> +<td><a href="module-summary.html#java.xml.ws">java.xml.ws</a></td> +<td>Original JSR</td> +<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a></td> +<td>SE</td> +<td>ext</td> +<td>Yes</td> +</tr> + +<!-- Alex: The Java SE Platform incorporates a cutdown version of the javax.annotation package from the Java EE Platform. --> +<tr class="se-ee"> +<td>Common Annotations</td> +<td><a href="https://jcp.org/en/jsr/detail?id=250">250</a></td> +<td>Java SE,EE</td> +<td><a href="module-summary.html#java.annotations.common">java.annotations.common</a></td> +<td>Original JSR</td> +<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a> (unlisted)</td> +<td>SE</td> +<td>ext</td> +<td>Yes</td> +</tr> + +<!-- Alex: The Java SE Platform incorporates a cutdown version of the javax.transaction package from the Java EE Platform. --> +<tr class="se-ee"> +<td>JTA (non-XA)</td> +<td><a href="https://jcp.org/en/jsr/detail?id=907">907</a></td> +<td>---</td> +<td><a href="module-summary.html#java.transaction">java.transaction</a></td> +<td>Original JSR</td> +<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a> (unlisted)</td> +<td>SE</td> +<td>ext</td> +<td>Yes</td> +</tr> + +<!-- Alex: The Java SE Platform incorporates the same version of the javax.transaction.xa package as the Java EE Platform. --> +<tr class="se-ee"> +<td>JTA (XA)</td> +<td><a href="https://jcp.org/en/jsr/detail?id=907">907</a></td> +<td>---</td> +<td><a href="module-summary.html#java.sql"/>java.sql</a></td> +<td>Original JSR</td> +<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a> (unlisted)</td> +<td>2</td> +<td>boot</td> +<td>No</td> +</tr> + +</table> + +</html>
--- a/make/src/classes/build/tools/module/GenJdepsModulesXml.java Tue Mar 15 13:48:26 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2014, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package build.tools.module; - -import java.io.File; -import java.io.IOException; -import java.io.UncheckedIOException; -import java.nio.file.Files; -import java.nio.file.NoSuchFileException; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.attribute.BasicFileAttributes; -import java.util.HashSet; -import java.util.Set; -import java.util.stream.Collectors; - -/** - * GenJdepsModulesXml augments the input modules.xml file(s) - * to include the module membership from the given path to - * the JDK exploded image. The output file is used by jdeps - * to analyze dependencies and enforce module boundaries. - * - * The input modules.xml file defines the modular structure of - * the JDK as described in JEP 200: The Modular JDK - * (http://openjdk.java.net/jeps/200). - * - * $ java build.tools.module.GenJdepsModulesXml \ - * -o com/sun/tools/jdeps/resources/modules.xml \ - * -mp $OUTPUTDIR/modules \ - * top/modules.xml - */ -public final class GenJdepsModulesXml { - private final static String USAGE = - "Usage: GenJdepsModulesXml -o <output file> -mp build/modules path-to-modules-xml"; - - public static void main(String[] args) throws Exception { - Path outfile = null; - Path modulepath = null; - int i = 0; - while (i < args.length) { - String arg = args[i]; - if (arg.equals("-o")) { - outfile = Paths.get(args[i+1]); - i = i+2; - } else if (arg.equals("-mp")) { - modulepath = Paths.get(args[i+1]); - i = i+2; - if (!Files.isDirectory(modulepath)) { - System.err.println(modulepath + " is not a directory"); - System.exit(1); - } - } else { - break; - } - } - if (outfile == null || modulepath == null || i >= args.length) { - System.err.println(USAGE); - System.exit(-1); - } - - GenJdepsModulesXml gentool = new GenJdepsModulesXml(modulepath); - Set<Module> modules = new HashSet<>(); - for (; i < args.length; i++) { - Path p = Paths.get(args[i]); - modules.addAll(ModulesXmlReader.readModules(p) - .stream() - .map(gentool::buildIncludes) - .collect(Collectors.toSet())); - } - - Files.createDirectories(outfile.getParent()); - ModulesXmlWriter.writeModules(modules, outfile); - } - - final Path modulepath; - public GenJdepsModulesXml(Path modulepath) { - this.modulepath = modulepath; - } - - private static String packageName(Path p) { - return packageName(p.toString().replace(File.separatorChar, '/')); - } - private static String packageName(String name) { - int i = name.lastIndexOf('/'); - return (i > 0) ? name.substring(0, i).replace('/', '.') : ""; - } - - private static boolean includes(String name) { - return name.endsWith(".class"); - } - - public Module buildIncludes(Module module) { - Module.Builder mb = new Module.Builder(module); - Path mclasses = modulepath.resolve(module.name()); - try { - Files.find(mclasses, Integer.MAX_VALUE, (Path p, BasicFileAttributes attr) - -> includes(p.getFileName().toString())) - .map(p -> packageName(mclasses.relativize(p))) - .forEach(mb::include); - } catch (NoSuchFileException e) { - // aggregate module may not have class - } catch (IOException ioe) { - throw new UncheckedIOException(ioe); - } - return mb.build(); - } -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/src/classes/build/tools/module/GenModuleInfoSource.java Thu Mar 17 19:04:16 2016 +0000 @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package build.tools.module; + +import java.io.BufferedWriter; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * A build tool to extend the module-info.java in the source tree + * for platform-specific exports, uses, and provides and write + * to the specified output file. + * + * GenModulesList build tool currently generates the modules.list from + * the module-info.java from the source tree that will be used for + * the make target and dependences. + * + * The build currently invokes gensrc-$MODULE.gmk after modules.list + * is generated. Hence, platform-specific requires is not supported. + */ +public class GenModuleInfoSource { + private final static String USAGE = + "Usage: GenModuleInfoSource [option] -o <output file> <module-info-java>\n" + + "Options are:\n" + + " -exports <package-name>\n" + + " -exports <package-name>/<module-name>\n" + + " -uses <service>\n" + + " -provides <service>/<provider-impl-classname>\n"; + + public static void main(String... args) throws Exception { + Path outfile = null; + Path moduleInfoJava = null; + Map<String, Set<String>> options = new HashMap<>(); + + // validate input arguments + for (int i = 0; i < args.length; i++){ + String option = args[i]; + if (option.startsWith("-")) { + String arg = args[++i]; + if (option.equals("-exports") || + option.equals("-uses") || + option.equals("-provides")) { + options.computeIfAbsent(option, _k -> new HashSet<>()).add(arg); + } else if (option.equals("-o")) { + outfile = Paths.get(arg); + } else { + throw new IllegalArgumentException("invalid option: " + option); + } + } else if (moduleInfoJava != null) { + throw new IllegalArgumentException("more than one module-info.java"); + } else { + moduleInfoJava = Paths.get(option); + if (Files.notExists(moduleInfoJava)) { + throw new IllegalArgumentException(option + " not exist"); + } + } + } + + if (moduleInfoJava == null || outfile == null) { + System.err.println(USAGE); + System.exit(-1); + } + // read module-info.java + Module.Builder builder = ModuleInfoReader.builder(moduleInfoJava); + augment(builder, options); + + // generate new module-info.java + Module module = builder.build(); + Path parent = outfile.getParent(); + if (parent != null) + Files.createDirectories(parent); + + try (BufferedWriter writer = Files.newBufferedWriter(outfile)) { + writer.write(module.toString()); + } + } + + private static void augment(Module.Builder builder, Map<String, Set<String>> options) { + for (String opt : options.keySet()) { + if (opt.equals("-exports")) { + for (String arg : options.get(opt)) { + int index = arg.indexOf('/'); + if (index > 0) { + String pn = arg.substring(0, index); + String mn = arg.substring(index + 1, arg.length()); + builder.exportTo(pn, mn); + } else { + builder.export(arg); + } + } + } else if (opt.equals("-uses")) { + options.get(opt).stream() + .forEach(builder::use); + } else if (opt.equals("-provides")) { + for (String arg : options.get(opt)) { + int index = arg.indexOf('/'); + if (index <= 0) { + throw new IllegalArgumentException("invalid -provide argument: " + arg); + } + String service = arg.substring(0, index); + String impl = arg.substring(index + 1, arg.length()); + builder.provide(service, impl); + } + } + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/src/classes/build/tools/module/GenModuleLoaderMap.java Thu Mar 17 19:04:16 2016 +0000 @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation,