--- old/common/autoconf/boot-jdk.m4 2016-08-08 16:28:57.000000000 -0700 +++ new/common/autoconf/boot-jdk.m4 2016-08-08 16:28:56.000000000 -0700 @@ -305,7 +305,7 @@ BOOT_JDK_SOURCETARGET="-source 8 -target 8" AC_SUBST(BOOT_JDK_SOURCETARGET) - ADD_JVM_ARG_IF_OK([-Xpatch:foo=bar], dummy, [$JAVA]) + ADD_JVM_ARG_IF_OK([--patch-module foo=bar], dummy, [$JAVA]) AC_MSG_CHECKING([if Boot JDK supports modules]) if test "x$JVM_ARG_OK" = "xtrue"; then AC_MSG_RESULT([yes]) --- old/common/autoconf/generated-configure.sh 2016-08-08 16:28:59.000000000 -0700 +++ new/common/autoconf/generated-configure.sh 2016-08-08 16:28:58.000000000 -0700 @@ -5095,7 +5095,7 @@ #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1470415803 +DATE_WHEN_GENERATED=1470695558 ############################################################################### # @@ -30596,13 +30596,13 @@ - $ECHO "Check if jvm arg is ok: -Xpatch:foo=bar" >&5 - $ECHO "Command: $JAVA -Xpatch:foo=bar -version" >&5 - OUTPUT=`$JAVA -Xpatch:foo=bar -version 2>&1` + $ECHO "Check if jvm arg is ok: --patch-module foo=bar" >&5 + $ECHO "Command: $JAVA --patch-module foo=bar -version" >&5 + OUTPUT=`$JAVA --patch-module foo=bar -version 2>&1` FOUND_WARN=`$ECHO "$OUTPUT" | $GREP -i warn` FOUND_VERSION=`$ECHO $OUTPUT | $GREP " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - dummy="$dummy -Xpatch:foo=bar" + dummy="$dummy --patch-module foo=bar" JVM_ARG_OK=true else $ECHO "Arg failed:" >&5 --- old/common/autoconf/spec.gmk.in 2016-08-08 16:29:18.000000000 -0700 +++ new/common/autoconf/spec.gmk.in 2016-08-08 16:29:17.000000000 -0700 @@ -585,7 +585,7 @@ jdk.jdeps jdk.javadoc jdk.rmic ifeq ($(BOOT_JDK_MODULAR), true) INTERIM_OVERRIDE_MODULES_ARGS = $(foreach m, $(INTERIM_OVERRIDE_MODULES), \ - -Xpatch:$m=$(BUILDTOOLS_OUTPUTDIR)/override_modules/$m) + --patch-module $m=$(BUILDTOOLS_OUTPUTDIR)/override_modules/$m) INTERIM_LANGTOOLS_ARGS = $(INTERIM_OVERRIDE_MODULES_ARGS) JAVAC_MAIN_CLASS = -m jdk.compiler/com.sun.tools.javac.Main JAVADOC_MAIN_CLASS = -m jdk.javadoc/jdk.javadoc.internal.tool.Main --- old/common/conf/jib-profiles.js 2016-08-08 16:29:20.000000000 -0700 +++ new/common/conf/jib-profiles.js 2016-08-08 16:29:19.000000000 -0700 @@ -417,7 +417,7 @@ jtreg: { server: "javare", revision: "4.2", - build_number: "b02", + build_number: "b03", checksum_file: "MD5_VALUES", file: "jtreg_bin-4.2.zip", environment_name: "JT_HOME" --- old/make/CompileJavaModules.gmk 2016-08-08 16:29:22.000000000 -0700 +++ new/make/CompileJavaModules.gmk 2016-08-08 16:29:21.000000000 -0700 @@ -502,8 +502,8 @@ HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \ ADD_JAVAC_FLAGS := \ $($(MODULE)_ADD_JAVAC_FLAGS) \ - -modulesourcepath $(MODULESOURCEPATH) \ - -modulepath $(MODULEPATH) \ + --module-source-path $(MODULESOURCEPATH) \ + --module-path $(MODULEPATH) \ -system none, \ )) --- old/make/CreateJmods.gmk 2016-08-08 16:29:23.000000000 -0700 +++ new/make/CreateJmods.gmk 2016-08-08 16:29:23.000000000 -0700 @@ -77,7 +77,7 @@ EXCLUDE_PATTERN := $(strip $(subst $(SPACE),|,$(strip $(ALL_UPGRADEABLE_MODULES)))) - JMOD_FLAGS += --modulepath $(JMODS_DIR) \ + JMOD_FLAGS += --module-path $(JMODS_DIR) \ --hash-modules '^(?!$(EXCLUDE_PATTERN))' endif endif @@ -102,7 +102,7 @@ --os-name $(REQUIRED_OS_NAME) \ --os-arch $(OPENJDK_TARGET_CPU_LEGACY) \ --os-version $(REQUIRED_OS_VERSION) \ - --modulepath $(JMODS_DIR) \ + --module-path $(JMODS_DIR) \ --exclude '**{_the.*,*.diz,*.debuginfo,*.dSYM/**,*.pdb,*.map}' \ $(JMOD_FLAGS) $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@) $(MV) $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@) $@ --- old/make/Images.gmk 2016-08-08 16:29:25.000000000 -0700 +++ new/make/Images.gmk 2016-08-08 16:29:25.000000000 -0700 @@ -127,7 +127,7 @@ /jdk.localedata/** \ # -JLINK_TOOL := $(JLINK) --modulepath $(IMAGES_OUTPUTDIR)/jmods \ +JLINK_TOOL := $(JLINK) --module-path $(IMAGES_OUTPUTDIR)/jmods \ --endian $(OPENJDK_BUILD_CPU_ENDIAN) \ --release-info $(BASE_RELEASE_FILE) \ --order-resources=$(call CommaList, $(JLINK_ORDER_RESOURCES)) \ @@ -142,7 +142,7 @@ $(ECHO) Creating jdk jimage $(RM) -r $(JDK_IMAGE_DIR) $(JLINK_TOOL) --output $(JDK_IMAGE_DIR) \ - --addmods $(JDK_MODULES_LIST) $(JLINK_EXTRA_OPTS) + --add-modules $(JDK_MODULES_LIST) $(JLINK_EXTRA_OPTS) $(TOUCH) $@ $(JRE_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \ @@ -150,7 +150,7 @@ $(ECHO) Creating jre jimage $(RM) -r $(JRE_IMAGE_DIR) $(JLINK_TOOL) --output $(JRE_IMAGE_DIR) \ - --addmods $(JRE_MODULES_LIST) + --add-modules $(JRE_MODULES_LIST) $(TOUCH) $@ JRE_COMPACT1_IMAGE_DIR := $(JRE_IMAGE_DIR)-compact1 @@ -161,7 +161,7 @@ $(call DependOnVariable, JRE_COMPACT1_MODULES_LIST) $(BASE_RELEASE_FILE) $(ECHO) Creating jre compact1 jimage $(RM) -r $(JRE_COMPACT1_IMAGE_DIR) - $(JLINK_TOOL) --addmods $(JRE_COMPACT1_MODULES_LIST) \ + $(JLINK_TOOL) --add-modules $(JRE_COMPACT1_MODULES_LIST) \ --output $(JRE_COMPACT1_IMAGE_DIR) $(TOUCH) $@ @@ -169,7 +169,7 @@ $(call DependOnVariable, JRE_COMPACT2_MODULES_LIST) $(BASE_RELEASE_FILE) $(ECHO) Creating jre compact2 jimage $(RM) -r $(JRE_COMPACT2_IMAGE_DIR) - $(JLINK_TOOL) --addmods $(JRE_COMPACT2_MODULES_LIST) \ + $(JLINK_TOOL) --add-modules $(JRE_COMPACT2_MODULES_LIST) \ --output $(JRE_COMPACT2_IMAGE_DIR) $(TOUCH) $@ @@ -177,7 +177,7 @@ $(call DependOnVariable, JRE_COMPACT3_MODULES_LIST) $(BASE_RELEASE_FILE) $(ECHO) Creating jre compact3 jimage $(RM) -r $(JRE_COMPACT3_IMAGE_DIR) - $(JLINK_TOOL) --addmods $(JRE_COMPACT3_MODULES_LIST) \ + $(JLINK_TOOL) --add-modules $(JRE_COMPACT3_MODULES_LIST) \ --output $(JRE_COMPACT3_IMAGE_DIR) $(TOUCH) $@ --- old/make/InterimImage.gmk 2016-08-08 16:29:27.000000000 -0700 +++ new/make/InterimImage.gmk 2016-08-08 16:29:27.000000000 -0700 @@ -39,7 +39,7 @@ JMODS := $(patsubst %, $(IMAGES_OUTPUTDIR)/jmods/%.jmod, $(INTERIM_IMAGE_MODULES)) JLINK_TOOL := $(JLINK) \ - --modulepath $(IMAGES_OUTPUTDIR)/jmods \ + --module-path $(IMAGES_OUTPUTDIR)/jmods \ --endian $(OPENJDK_BUILD_CPU_ENDIAN) $(INTERIM_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \ @@ -48,7 +48,7 @@ $(RM) -r $(INTERIM_IMAGE_DIR) $(JLINK_TOOL) \ --output $(INTERIM_IMAGE_DIR) \ - --addmods $(INTERIM_MODULES_LIST) + --add-modules $(INTERIM_MODULES_LIST) $(TOUCH) $@ TARGETS += $(INTERIM_IMAGE_DIR)/$(JIMAGE_TARGET_FILE) --- old/make/Javadoc.gmk 2016-08-08 16:29:29.000000000 -0700 +++ new/make/Javadoc.gmk 2016-08-08 16:29:28.000000000 -0700 @@ -425,9 +425,9 @@ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:reference) ; \ $(call OptionOnly,-Xdoclint/package:-org.omg.*$(COMMA)jdk.internal.logging.*) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(COREAPI_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(COREAPI_MODULES)) ; \ $(call OptionPair,-encoding,ISO-8859-1) ; \ $(call OptionOnly,-splitIndex) ; \ $(call OptionPair,-overview,$(COREAPI_OVERVIEW)) ; \ @@ -488,9 +488,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:all) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(DOCLETAPI_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(DOCLETAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-breakiterator) ; \ $(call OptionPair,-doctitle,$(DOCLETAPI_DOCTITLE)) ; \ @@ -550,9 +550,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:all) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(OLD_DOCLETAPI_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(OLD_DOCLETAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-breakiterator) ; \ $(call OptionPair,-doctitle,$(OLD_DOCLETAPI_DOCTITLE)) ; \ @@ -605,9 +605,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:all) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(TAGLETAPI_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(TAGLETAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-breakiterator) ; \ $(call OptionPair,-doctitle,$(TAGLETAPI_DOCTITLE)) ; \ @@ -667,9 +667,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(DOMAPI_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(DOMAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-splitIndex) ; \ $(call OptionPair,-doctitle,$(DOMAPI_DOCTITLE)) ; \ @@ -736,9 +736,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(JDI_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(JDI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionPair,-overview,$(JDI_OVERVIEW)) ; \ $(call OptionPair,-doctitle,$(JDI_DOCTITLE)) ; \ @@ -829,9 +829,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(JAAS_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(JAAS_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionPair,-overview,$(JAAS_OVERVIEW)) ; \ $(call OptionPair,-doctitle,$(JAAS_DOCTITLE)) ; \ @@ -888,9 +888,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(JGSS_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(JGSS_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-overview,$(JGSS_OVERVIEW)) ; \ @@ -947,9 +947,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(SMARTCARDIO_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(SMARTCARDIO_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-doctitle,$(SMARTCARDIO_DOCTITLE)) ; \ @@ -1004,9 +1004,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(HTTPSERVER_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(HTTPSERVER_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-doctitle,$(HTTPSERVER_DOCTITLE)) ; \ @@ -1121,9 +1121,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(MGMT_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(MGMT_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-overview,$(MGMT_OVERVIEW)) ; \ @@ -1179,9 +1179,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(ATTACH_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(ATTACH_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-doctitle,$(ATTACH_DOCTITLE)) ; \ @@ -1236,9 +1236,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(JCONSOLE_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(JCONSOLE_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-doctitle,$(JCONSOLE_DOCTITLE)) ; \ @@ -1294,9 +1294,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:all) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(JSHELLAPI_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(JSHELLAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionPair,-overview,$(JSHELLAPI_OVERVIEW)) ; \ $(call OptionPair,-doctitle,$(JSHELLAPI_DOCTITLE)) ; \ @@ -1353,9 +1353,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:all) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(TREEAPI_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(TREEAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionPair,-doctitle,$(TREEAPI_DOCTITLE)) ; \ $(call OptionPair,-windowtitle,$(TREEAPI_WINDOWTITLE) $(DRAFT_WINTITLE)); \ @@ -1412,9 +1412,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:all) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(NASHORNAPI_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(NASHORNAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionPair,-doctitle,$(NASHORNAPI_DOCTITLE)) ; \ $(call OptionPair,-windowtitle,$(NASHORNAPI_WINDOWTITLE) $(DRAFT_WINTITLE)); \ @@ -1471,9 +1471,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:all) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(DYNALINKAPI_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(DYNALINKAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionPair,-doctitle,$(DYNALINKAPI_DOCTITLE)) ; \ $(call OptionPair,-windowtitle,$(DYNALINKAPI_WINDOWTITLE) $(DRAFT_WINTITLE)); \ @@ -1527,9 +1527,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(SCTPAPI_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(SCTPAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-doctitle,$(SCTPAPI_DOCTITLE)) ; \ @@ -1584,9 +1584,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:all) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(JACCESSAPI_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(JACCESSAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-doctitle,$(JACCESSAPI_DOCTITLE)) ; \ @@ -1641,9 +1641,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(JDKNET_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(JDKNET_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-doctitle,$(JDKNET_DOCTITLE)) ; \ @@ -1702,9 +1702,9 @@ @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-system,none) ; \ - $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ - $(call OptionPair,-addmods,$(JLINK_PLUGIN_MODULES)) ; \ + $(call OptionPair,--system,none) ; \ + $(call OptionPair,--module-source-path,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,--add-modules,$(JLINK_PLUGIN_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-doctitle,$(JLINK_PLUGIN_DOCTITLE)) ; \ --- old/make/common/MakeBase.gmk 2016-08-08 16:29:31.000000000 -0700 +++ new/make/common/MakeBase.gmk 2016-08-08 16:29:30.000000000 -0700 @@ -828,7 +828,7 @@ endif ################################################################################ -# Return a string suitable for use after a -classpath or -modulepath option. It +# Return a string suitable for use after a -classpath or --module-path option. It # will be correct and safe to use on all platforms. Arguments are given as space # separate classpath entries. Safe for multiple nested calls. # param 1 : A space separated list of classpath entries --- old/make/common/SetupJavaCompilers.gmk 2016-08-08 16:29:33.000000000 -0700 +++ new/make/common/SetupJavaCompilers.gmk 2016-08-08 16:29:33.000000000 -0700 @@ -88,7 +88,7 @@ $(eval $(call SetupJavaCompiler,GENERATE_USINGJDKBYTECODE, \ JVM := $(JAVA_SMALL), \ JAVAC := $(NEW_JAVAC), \ - FLAGS := -upgrademodulepath $(JDK_OUTPUTDIR)/modules -system none $(DISABLE_WARNINGS), \ + FLAGS := --upgrade-module-path $(JDK_OUTPUTDIR)/modules -system none $(DISABLE_WARNINGS), \ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA))) --- old/jaxp/test/TEST.ROOT 2016-08-08 16:29:35.000000000 -0700 +++ new/jaxp/test/TEST.ROOT 2016-08-08 16:29:35.000000000 -0700 @@ -23,4 +23,7 @@ groups=TEST.groups # Minimum jtreg version -requiredVersion=4.2 b02 +requiredVersion=4.2 b03 + +# Use new module options +useNewOptions=true --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java 2016-08-08 16:29:38.000000000 -0700 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java 2016-08-08 16:29:37.000000000 -0700 @@ -140,7 +140,7 @@ aptargs.add("-cp"); aptargs.add(setClasspath(options.classpath)); // set original classpath + jaxb-api to be visible to annotation processor - aptargs.add("-addmods"); + aptargs.add("--add-modules"); aptargs.add("java.xml.bind"); if(options.targetDir!=null) { --- old/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java 2016-08-08 16:29:40.000000000 -0700 +++ new/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java 2016-08-08 16:29:39.000000000 -0700 @@ -162,7 +162,7 @@ boolean bootCP = useBootClasspath(EndpointReference.class) || useBootClasspath(XmlSeeAlso.class); List args = new ArrayList(6 + (bootCP ? 1 : 0) + (options.nocompile ? 1 : 0) + (options.encoding != null ? 2 : 0)); - args.add("-addmods"); + args.add("--add-modules"); args.add("java.xml.ws"); args.add("-d"); args.add(options.destDir.getAbsolutePath()); --- old/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java 2016-08-08 16:29:42.000000000 -0700 +++ new/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java 2016-08-08 16:29:42.000000000 -0700 @@ -525,7 +525,7 @@ String classpathString = createClasspathString(); boolean bootCP = useBootClasspath(EndpointContext.class) || useBootClasspath(JAXBPermission.class); List args = new ArrayList(); - args.add("-addmods"); + args.add("--add-modules"); args.add("java.xml.ws"); args.add("-d"); args.add(classDir); --- old/jdk/make/GenerateModuleSummary.gmk 2016-08-08 16:29:44.000000000 -0700 +++ new/jdk/make/GenerateModuleSummary.gmk 2016-08-08 16:29:44.000000000 -0700 @@ -42,6 +42,6 @@ $(GENGRAPHS_DIR)/module-summary.html: $(BUILD_JIGSAW_TOOLS) $(GENGRAPHS_DIR)/technology-summary.html $(MKDIR) -p $(@D) - $(TOOL_MODULESUMMARY) -o $@ -mp $(IMAGES_OUTPUTDIR)/jmods + $(TOOL_MODULESUMMARY) -o $@ --module-path $(IMAGES_OUTPUTDIR)/jmods all: $(GENGRAPHS_DIR)/jdk.dot $(GENGRAPHS_DIR)/module-summary.html --- old/jdk/make/ModuleTools.gmk 2016-08-08 16:29:47.000000000 -0700 +++ new/jdk/make/ModuleTools.gmk 2016-08-08 16:29:47.000000000 -0700 @@ -36,12 +36,12 @@ INCLUDES := build/tools/deps \ build/tools/jigsaw, \ BIN := $(TOOLS_CLASSES_DIR), \ - ADD_JAVAC_FLAGS := -XaddExports:jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED )) + ADD_JAVAC_FLAGS := --add-exports 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 \ + --add-exports jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED \ build.tools.jigsaw.ModuleSummary --- old/jdk/make/Tools.gmk 2016-08-08 16:29:51.000000000 -0700 +++ new/jdk/make/Tools.gmk 2016-08-08 16:29:50.000000000 -0700 @@ -38,7 +38,7 @@ ################################################################################ ifeq ($(BOOT_JDK_MODULAR), true) - COMPILEFONTCONFIG_ADD_EXPORTS := -XaddExports:java.desktop/sun.awt=ALL-UNNAMED + COMPILEFONTCONFIG_ADD_EXPORTS := --add-exports java.desktop/sun.awt=ALL-UNNAMED endif TOOL_COMPILEFONTCONFIG = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \ @@ -94,7 +94,7 @@ # Nimbus is used somewhere in the swing build. ifeq ($(BOOT_JDK_MODULAR), true) - COMPILENIMBUS_ADD_MODS := -addmods java.xml.bind + COMPILENIMBUS_ADD_MODS := --add-modules java.xml.bind endif TOOL_GENERATENIMBUS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \ --- old/jdk/make/gendata/GendataBreakIterator.gmk 2016-08-08 16:29:53.000000000 -0700 +++ new/jdk/make/gendata/GendataBreakIterator.gmk 2016-08-08 16:29:52.000000000 -0700 @@ -63,11 +63,11 @@ ifeq ($(BOOT_JDK_MODULAR), true) BREAK_ITERATOR_BOOTCLASSPATH := \ - -Xpatch:java.base=$(BREAK_ITERATOR_CLASSES)/java.base \ - -Xpatch:jdk.localedata=$(BREAK_ITERATOR_CLASSES)/jdk.localedata \ - -XaddExports:java.base/sun.text=ALL-UNNAMED \ - -XaddExports:java.base/sun.text.resources=ALL-UNNAMED \ - -XaddExports:jdk.localedata/sun.text.resources.ext=ALL-UNNAMED \ + --patch-module java.base=$(BREAK_ITERATOR_CLASSES)/java.base \ + --patch-module jdk.localedata=$(BREAK_ITERATOR_CLASSES)/jdk.localedata \ + --add-exports java.base/sun.text=ALL-UNNAMED \ + --add-exports java.base/sun.text.resources=ALL-UNNAMED \ + --add-exports jdk.localedata/sun.text.resources.ext=ALL-UNNAMED \ # else BREAK_ITERATOR_BOOTCLASSPATH := -Xbootclasspath/p:$(call PathList, \ --- old/jdk/make/launcher/Launcher-java.desktop.gmk 2016-08-08 16:29:56.000000000 -0700 +++ new/jdk/make/launcher/Launcher-java.desktop.gmk 2016-08-08 16:29:55.000000000 -0700 @@ -31,7 +31,7 @@ ifndef BUILD_HEADLESS_ONLY $(eval $(call SetupBuildLauncher, appletviewer, \ MAIN_CLASS := sun.applet.Main, \ - JAVA_ARGS := -addmods ALL-DEFAULT, \ + JAVA_ARGS := --add-modules ALL-DEFAULT, \ LIBS_unix := $(X_LIBS), \ )) endif --- old/jdk/make/launcher/Launcher-java.scripting.gmk 2016-08-08 16:29:59.000000000 -0700 +++ new/jdk/make/launcher/Launcher-java.scripting.gmk 2016-08-08 16:29:58.000000000 -0700 @@ -27,5 +27,5 @@ $(eval $(call SetupBuildLauncher, jrunscript, \ MAIN_CLASS := com.sun.tools.script.shell.Main, \ - JAVA_ARGS := -addmods ALL-DEFAULT, \ + JAVA_ARGS := --add-modules ALL-DEFAULT, \ )) --- old/jdk/make/launcher/Launcher-jdk.compiler.gmk 2016-08-08 16:30:02.000000000 -0700 +++ new/jdk/make/launcher/Launcher-jdk.compiler.gmk 2016-08-08 16:30:01.000000000 -0700 @@ -27,7 +27,7 @@ $(eval $(call SetupBuildLauncher, javac, \ MAIN_CLASS := com.sun.tools.javac.Main, \ - JAVA_ARGS := -addmods ALL-DEFAULT, \ + JAVA_ARGS := --add-modules ALL-DEFAULT, \ CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \ -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \ )) --- old/jdk/make/launcher/Launcher-jdk.javadoc.gmk 2016-08-08 16:30:05.000000000 -0700 +++ new/jdk/make/launcher/Launcher-jdk.javadoc.gmk 2016-08-08 16:30:04.000000000 -0700 @@ -27,7 +27,7 @@ $(eval $(call SetupBuildLauncher, javadoc, \ MAIN_CLASS := jdk.javadoc.internal.tool.Main, \ - JAVA_ARGS := -addmods ALL-DEFAULT, \ + JAVA_ARGS := --add-modules ALL-DEFAULT, \ CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \ -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \ )) --- old/jdk/make/launcher/Launcher-jdk.jlink.gmk 2016-08-08 16:30:08.000000000 -0700 +++ new/jdk/make/launcher/Launcher-jdk.jlink.gmk 2016-08-08 16:30:08.000000000 -0700 @@ -32,7 +32,7 @@ $(eval $(call SetupBuildLauncher, jlink,\ MAIN_CLASS := jdk.tools.jlink.internal.Main, \ - JAVA_ARGS := -addmods ALL-DEFAULT, \ + JAVA_ARGS := --add-modules ALL-DEFAULT, \ CFLAGS := -DENABLE_ARG_FILES \ -DEXPAND_CLASSPATH_WILDCARDS \ -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \ --- old/jdk/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk 2016-08-08 16:30:11.000000000 -0700 +++ new/jdk/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk 2016-08-08 16:30:10.000000000 -0700 @@ -27,6 +27,6 @@ $(eval $(call SetupBuildLauncher, jjs, \ MAIN_CLASS := jdk.nashorn.tools.jjs.Main, \ - JAVA_ARGS := -addmods ALL-DEFAULT, \ + JAVA_ARGS := --add-modules ALL-DEFAULT, \ CFLAGS := -DENABLE_ARG_FILES, \ )) --- old/jdk/make/src/classes/build/tools/jigsaw/ModuleSummary.java 2016-08-08 16:30:14.000000000 -0700 +++ new/jdk/make/src/classes/build/tools/jigsaw/ModuleSummary.java 2016-08-08 16:30:13.000000000 -0700 @@ -51,7 +51,7 @@ import static build.tools.jigsaw.ModuleSummary.HtmlDocument.Division.*; public class ModuleSummary { - private static final String USAGE = "Usage: ModuleSummary -mp -o [-root mn]*"; + private static final String USAGE = "Usage: ModuleSummary --module-path -o [--root mn]*"; public static void main(String[] args) throws Exception { int i=0; @@ -61,13 +61,13 @@ while (i < args.length && args[i].startsWith("-")) { String arg = args[i++]; switch (arg) { - case "-mp": + case "--module-path": modpath = Paths.get(args[i++]); break; case "-o": outfile = Paths.get(args[i++]); break; - case "-root": + case "--root": roots.add(args[i++]); default: System.err.println(USAGE); --- old/jdk/src/java.base/share/classes/java/lang/System.java 2016-08-08 16:30:18.000000000 -0700 +++ new/jdk/src/java.base/share/classes/java/lang/System.java 2016-08-08 16:30:17.000000000 -0700 @@ -644,23 +644,20 @@ * getProperties operation, it may choose to permit the * {@link #getProperty(String)} operation. * - * @implNote In addition to the standard system properties, the {@code - * java} launcher may create the Java Virtual Machine with system - * properties that have the following keys: + * @implNote In addition to the standard system properties, the system + * properties may include the following keys: * * * * - * - * + * + * * * * * * *
KeyDescription of Associated Value
{@code jdk.module.path}Application module path
{@code jdk.upgrade.module.path}The application module path
{@code jdk.module.upgrade.path}The upgrade module path
{@code jdk.module.main}The module name of the initial/main module
{@code jdk.module.main.class}The main class name of the initial module
- * These properties may also be set by custom launchers that use the JNI - * invocation API to create the Java Virtual Machine. * * @return the system properties * @exception SecurityException if a security manager exists and its --- old/jdk/src/java.base/share/classes/java/lang/module/ModuleReference.java 2016-08-08 16:30:21.000000000 -0700 +++ new/jdk/src/java.base/share/classes/java/lang/module/ModuleReference.java 2016-08-08 16:30:20.000000000 -0700 @@ -169,7 +169,7 @@ /** - * Returns {@code true} if this module has been patched via -Xpatch. + * Returns {@code true} if this module has been patched via --patch-module. */ boolean isPatched() { return patched; --- old/jdk/src/java.base/share/classes/java/lang/module/ModuleReferences.java 2016-08-08 16:30:24.000000000 -0700 +++ new/jdk/src/java.base/share/classes/java/lang/module/ModuleReferences.java 2016-08-08 16:30:23.000000000 -0700 @@ -68,7 +68,7 @@ /** * Creates a ModuleReference to a module or to patched module when - * creating modules for the boot Layer and -Xpatch is specified. + * creating modules for the boot Layer and --patch-module is specified. */ private static ModuleReference newModule(ModuleDescriptor md, URI uri, --- old/jdk/src/java.base/share/classes/java/lang/module/SystemModuleFinder.java 2016-08-08 16:30:27.000000000 -0700 +++ new/jdk/src/java.base/share/classes/java/lang/module/SystemModuleFinder.java 2016-08-08 16:30:26.000000000 -0700 @@ -178,7 +178,7 @@ ModuleReference mref = new ModuleReference(md, uri, readerSupplier, hash); - // may need a reference to a patched module if -Xpatch specified + // may need a reference to a patched module if --patch-module specified mref = ModulePatcher.interposeIfNeeded(mref); return mref; --- old/jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java 2016-08-08 16:30:30.000000000 -0700 +++ new/jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java 2016-08-08 16:30:29.000000000 -0700 @@ -56,8 +56,8 @@ * The {@link #boot() boot} method is called early in the startup to initialize * the module system. In summary, the boot method creates a Configuration by * resolving a set of module names specified via the launcher (or equivalent) - * -m and -addmods options. The modules are located on a module path that is - * constructed from the upgrade module path, system modules, and application + * -m and --add-modules options. The modules are located on a module path that + * is constructed from the upgrade module path, system modules, and application * module path. The Configuration is instantiated as the boot Layer with each * module in the the configuration defined to one of the built-in class loaders. */ @@ -127,16 +127,16 @@ long t2 = System.nanoTime(); - // -upgrademodulepath option specified to launcher + // --upgrade-module-path option specified to launcher ModuleFinder upgradeModulePath - = createModulePathFinder("jdk.upgrade.module.path"); + = createModulePathFinder("jdk.module.upgrade.path"); if (upgradeModulePath != null) systemModules = ModuleFinder.compose(upgradeModulePath, systemModules); - // -modulepath option specified to the launcher + // --module-path option specified to the launcher ModuleFinder appModulePath = createModulePathFinder("jdk.module.path"); - // The module finder: [-upgrademodulepath] system [-modulepath] + // The module finder: [--upgrade-module-path] system [--module-path] ModuleFinder finder = systemModules; if (appModulePath != null) finder = ModuleFinder.compose(finder, appModulePath); @@ -149,11 +149,11 @@ if (mainModule != null) roots.add(mainModule); - // additional module(s) specified by -addmods + // additional module(s) specified by --add-modules boolean addAllDefaultModules = false; boolean addAllSystemModules = false; boolean addAllApplicationModules = false; - String propValue = System.getProperty("jdk.launcher.addmods"); + String propValue = getAndRemoveProperty("jdk.module.addmods"); if (propValue != null) { for (String mod: propValue.split(",")) { switch (mod) { @@ -172,8 +172,8 @@ } } - // -limitmods - propValue = System.getProperty("jdk.launcher.limitmods"); + // --limit-modules + propValue = getAndRemoveProperty("jdk.module.limitmods"); if (propValue != null) { Set mods = new HashSet<>(); for (String mod: propValue.split(",")) { @@ -216,7 +216,7 @@ } } - // If `-addmods ALL-SYSTEM` is specified then all observable system + // If `--add-modules ALL-SYSTEM` is specified then all observable system // modules will be resolved. if (addAllSystemModules) { ModuleFinder f = finder; // observable modules @@ -228,9 +228,9 @@ .forEach(mn -> roots.add(mn)); } - // If `-addmods ALL-MODULE-PATH` is specified then all observable + // If `--add-modules ALL-MODULE-PATH` is specified then all observable // modules on the application module path will be resolved. - if (appModulePath != null && addAllApplicationModules) { + if (appModulePath != null && addAllApplicationModules) { ModuleFinder f = finder; // observable modules appModulePath.findAll() .stream() @@ -250,7 +250,7 @@ if (baseUri.getScheme().equals("jrt") // toLowerCase not needed here && (upgradeModulePath == null) && (appModulePath == null) - && (System.getProperty("jdk.launcher.patch.0") == null)) { + && (!ModulePatcher.isBootLayerPatched())) { needPostResolutionChecks = false; } @@ -317,7 +317,7 @@ PerfCounters.loadModulesTime.addElapsedTimeFrom(t5); - // -XaddReads and -XaddExports + // --add-reads and --add-exports addExtraReads(bootLayer); addExtraExports(bootLayer); @@ -394,13 +394,13 @@ /** - * Process the -XaddReads options to add any additional read edges that + * Process the --add-reads options to add any additional read edges that * are specified on the command-line. */ private static void addExtraReads(Layer bootLayer) { // decode the command line options - Map> map = decode("jdk.launcher.addreads."); + Map> map = decode("jdk.module.addreads."); for (Map.Entry> e : map.entrySet()) { @@ -431,13 +431,13 @@ /** - * Process the -XaddExports options to add any additional read edges that + * Process the --add-exports options to add any additional read edges that * are specified on the command-line. */ private static void addExtraExports(Layer bootLayer) { // decode the command line options - Map> map = decode("jdk.launcher.addexports."); + Map> map = decode("jdk.module.addexports."); for (Map.Entry> e : map.entrySet()) { @@ -483,13 +483,14 @@ /** - * Decodes the values of -XaddReads or -XaddExports options + * Decodes the values of --add-reads or --add-exports options * * The format of the options is: $KEY=$MODULE(,$MODULE)* */ private static Map> decode(String prefix) { int index = 0; - String value = System.getProperty(prefix + index); + // the system property is removed after decoding + String value = getAndRemoveProperty(prefix + index); if (value == null) return Collections.emptyMap(); @@ -522,12 +523,18 @@ } index++; - value = System.getProperty(prefix + index); + value = getAndRemoveProperty(prefix + index); } return map; } + /** + * Gets and remove the named system property + */ + private static String getAndRemoveProperty(String key) { + return (String)System.getProperties().remove(key); + } /** * Throws a RuntimeException with the given message --- old/jdk/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java 2016-08-08 16:30:33.000000000 -0700 +++ new/jdk/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java 2016-08-08 16:30:32.000000000 -0700 @@ -58,7 +58,7 @@ /** - * Provides support for patching modules in the boot layer with -Xpatch. + * Provides support for patching modules in the boot layer with --patch-module. */ public final class ModulePatcher { @@ -66,28 +66,27 @@ private static final JavaLangModuleAccess JLMA = SharedSecrets.getJavaLangModuleAccess(); - // the prefix of the system properties that encode the value of -Xpatch - private static final String PATCH_PROPERTY_PREFIX = "jdk.launcher.patch."; + // the prefix of the system properties that encode the value of --patch-module + private static final String PATCH_PROPERTY_PREFIX = "jdk.module.patch."; // module name -> sequence of patches (directories or JAR files) private static final Map> PATCH_MAP = decodeProperties(); private ModulePatcher() { } - /** - * Decodes the values of -Xpatch options, returning a Map of module name to - * list of file paths. + * Decodes the values of --patch-module options, returning a Map of module + * name to list of file paths. * * @throws IllegalArgumentException if the the module name is missing or - * -Xpatch is used more than once to patch the same module + * --patch-module is used more than once to patch the same module */ private static Map> decodeProperties() { int index = 0; - String value = System.getProperty(PATCH_PROPERTY_PREFIX + index); + String value = getAndRemoveProperty(PATCH_PROPERTY_PREFIX + index); if (value == null) - return Collections.emptyMap(); // -Xpatch not specified + return Collections.emptyMap(); // --patch-module not specified Map> map = new HashMap<>(); while (value != null) { @@ -115,7 +114,7 @@ } index++; - value = System.getProperty(PATCH_PROPERTY_PREFIX + index); + value = getAndRemoveProperty(PATCH_PROPERTY_PREFIX + index); } return map; @@ -123,6 +122,14 @@ /** + * Returns {@code true} is --patch-module is specified to patch modules + * in the boot layer. + */ + static boolean isBootLayerPatched() { + return !PATCH_MAP.isEmpty(); + } + + /** * Returns a module reference that interposes on the given module if * needed. If there are no patches for the given module then the module * reference is simply returned. Otherwise the patches for the module @@ -537,6 +544,13 @@ } /** + * Gets and remove the named system property + */ + private static String getAndRemoveProperty(String key) { + return (String)System.getProperties().remove(key); + } + + /** * Derives a package name from the name of an entry in a JAR file. */ private static String toPackageName(Path file, JarEntry entry) { --- old/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java 2016-08-08 16:30:36.000000000 -0700 +++ new/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java 2016-08-08 16:30:35.000000000 -0700 @@ -60,8 +60,6 @@ import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; -import java.security.AccessController; -import java.security.PrivilegedAction; import java.text.Normalizer; import java.text.MessageFormat; import java.util.ResourceBundle; @@ -905,7 +903,7 @@ ModuleFinder finder = jdk.internal.module.ModuleBootstrap.finder(); - int colon = optionFlag.indexOf(':'); + int colon = optionFlag.indexOf('='); if (colon == -1) { finder.findAll().stream() .sorted(Comparator.comparing(ModuleReference::descriptor)) --- old/jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties 2016-08-08 16:30:39.000000000 -0700 +++ new/jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties 2016-08-08 16:30:38.000000000 -0700 @@ -27,7 +27,7 @@ java.launcher.opt.header = Usage: {0} [options] class [args...]\n\ \ (to execute a class)\n or {0} [options] -jar jarfile [args...]\n\ \ (to execute a jar file)\n\ -\ or {0} [options] -mp -m [/] [args...]\n\ +\ or {0} [options] -p -m [/] [args...]\n\ \ (to execute the main class in a module)\n\ where options include:\n @@ -41,24 +41,28 @@ # Translators please note do not translate the options themselves java.launcher.opt.footer =\ -cp \n\ \ -classpath \n\ +\ --class-path \n\ \ A {0} separated list of directories, JAR archives,\n\ \ and ZIP archives to search for class files.\n\ -\ -mp \n\ -\ -modulepath ...\n\ +\ -p \n\ +\ --module-path ...\n\ \ A {0} separated list of directories, each directory\n\ \ is a directory of modules.\n\ -\ -upgrademodulepath ...\n\ +\ --upgrade-module-path ...\n\ \ A {0} separated list of directories, each directory\n\ \ is a directory of modules that replace upgradeable\n\ \ modules in the runtime image\n\ -\ -m [/]\n\ +\ -m [/]\n\ +\ --module [/]\n\ \ the initial module to resolve, and the name of the main class\n\ \ to execute if not specified by the module\n\ -\ -addmods [,...]\n\ -\ root modules to resolve in addition to the initial module\n\ -\ -limitmods [,...]\n\ +\ --add-modules [,...]\n\ +\ root modules to resolve in addition to the initial module.\n\ +\ can also be ALL-DEFAULT, ALL-SYSTEM,\n\ +\ ALL-MODULE-PATH.\n\ +\ --limit-modules [,...]\n\ \ limit the universe of observable modules\n\ -\ -listmods[:[,...]]\n\ +\ --list-modules [[,...]]\n\ \ list the observable modules and exit\n\ \ --dry-run create VM but do not execute main method.\n\ \ This --dry-run option may be useful for validating the\n\ @@ -69,7 +73,8 @@ \ enable verbose output\n\ \ -version print product version and exit\n\ \ -showversion print product version and continue\n\ -\ -? -help print this help message\n\ +\ -? -help --help\n\ +\ print this help message\n\ \ -X print help on non-standard options\n\ \ -ea[:...|:]\n\ \ -enableassertions[:...|:]\n\ @@ -91,6 +96,8 @@ \ -splash:\n\ \ show splash screen with specified image\n\ \ @ read options from the specified file\n\ +\To specify an argument for a long option, you can use --= or\n\ +\-- .\n\ See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details. @@ -123,17 +130,21 @@ \ show all property settings and continue\n\ \ -XshowSettings:locale\n\ \ show all locale related settings and continue\n\ -\ -XaddReads:=(,)*\n\ -\ reads other modules,\n\ -\ regardless of module declaration\n\ -\ -XaddExports:/=(,)*\n\ -\ exports to other modules,\n\ -\ regardless of module declaration\n\ -\ -Xpatch:=({0})*\n\ +\ -Xdisable-@files disable further argument file expansion\n\ +\ --add-reads =(,)*\n\ +\ updates to read , regardless\n\ +\ of module declaration. \n\ +\ can be ALL-UNNAMED to read all unnamed\n\ +\ modules.\n\ +\ --add-exports /=(,)*\n\ +\ updates to export to ,\n\ +\ regardless of module declaration.\n\ +\ can be ALL-UNNAMED to export to all\n\ +\ unnamed modules.\n\ +\ --patch-module =({0})*\n\ \ Override or augment a module with classes and resources\n\ -\ in JAR files or directories\n\ -\ -Xdisable-@files disable further argument file expansion\n\n\ -The -X options are non-standard and subject to change without notice.\n +\ in JAR files or directories.\n\n\ +These options are non-standard and subject to change without notice.\n # Translators please note do not translate the options themselves java.launcher.X.macosx.usage=\ --- old/jdk/src/java.base/share/native/libjli/args.c 2016-08-08 16:30:42.000000000 -0700 +++ new/jdk/src/java.base/share/native/libjli/args.c 2016-08-08 16:30:41.000000000 -0700 @@ -102,24 +102,21 @@ // All arguments arrive here must be a launcher argument, // ie. by now, all argfile expansions must have been performed. - if (*arg++ == '-') { + if (*arg == '-') { expectingNoDashArg = JNI_FALSE; - if (JLI_StrCmp(arg, "cp") == 0 || - JLI_StrCmp(arg, "classpath") == 0 || - JLI_StrCmp(arg, "addmods") == 0 || - JLI_StrCmp(arg, "limitmods") == 0 || - JLI_StrCmp(arg, "mp") == 0 || - JLI_StrCmp(arg, "modulepath") == 0 || - JLI_StrCmp(arg, "upgrademodulepath") == 0) { + if (IsWhiteSpaceOption(arg)) { + // expect an argument expectingNoDashArg = JNI_TRUE; - } else if (JLI_StrCmp(arg, "jar") == 0 || - JLI_StrCmp(arg, "m") == 0) { - // This is tricky, we do expect NoDashArg - // But that is considered main class to stop expansion - expectingNoDashArg = JNI_FALSE; - // We can not just update the idx here because if -jar @file - // still need expansion of @file to get the argument for -jar - } else if (JLI_StrCmp(arg, "Xdisable-@files") == 0) { + + if (JLI_StrCmp(arg, "-jar") == 0 || + JLI_StrCmp(arg, "-m") == 0) { + // This is tricky, we do expect NoDashArg + // But that is considered main class to stop expansion + expectingNoDashArg = JNI_FALSE; + // We can not just update the idx here because if -jar @file + // still need expansion of @file to get the argument for -jar + } + } else if (JLI_StrCmp(arg, "-Xdisable-@files") == 0) { stopExpansion = JNI_TRUE; } } else { --- old/jdk/src/java.base/share/native/libjli/java.c 2016-08-08 16:30:45.000000000 -0700 +++ new/jdk/src/java.base/share/native/libjli/java.c 2016-08-08 16:30:44.000000000 -0700 @@ -69,7 +69,7 @@ static jboolean printUsage = JNI_FALSE; /* print and exit*/ static jboolean printXUsage = JNI_FALSE; /* print and exit*/ static jboolean dryRun = JNI_FALSE; /* initialize VM and exit */ -static char *showSettings = NULL; /* print but continue */ +static char *showSettings = NULL; /* print but continue */ static char *listModules = NULL; static const char *_program_name; @@ -99,17 +99,9 @@ * Prototypes for functions internal to launcher. */ static void SetClassPath(const char *s); -static void SetModulePath(const char *s); -static void SetUpgradeModulePath(const char *s); static void SetMainModule(const char *s); -static void SetAddModulesProp(const char *mods); -static void SetLimitModulesProp(const char *mods); -static void SetAddReadsProp(const jint n, const char *s); -static void SetAddExportsProp(const jint n, const char *s); -static void SetPatchProp(const jint n, const char *s); static void SelectVersion(int argc, char **argv, char **main_class); static void SetJvmEnvironment(int argc, char **argv); -static jboolean IsWhiteSpaceOptionArgument(const char* name); static jboolean ParseArguments(int *pargc, char ***pargv, int *pmode, char **pwhat, int *pret, const char *jrepath); @@ -133,6 +125,18 @@ static void DumpState(); static jboolean RemovableOption(char *option); +enum OptionKind { + LAUNCHER_OPTION = 0, + LAUNCHER_OPTION_WITH_ARGUMENT, + LAUNCHER_MAIN_OPTION, + VM_LONG_OPTION, + VM_LONG_OPTION_WITH_ARGUMENT, + VM_OPTION +}; + +static int GetOpt(int *pargc, char ***pargv, char **poption, char **pvalue); +static jboolean IsOptionWithArgument(int argc, char **argv); + /* Maximum supported entries from jvm.cfg. */ #define INIT_MAX_KNOWN_VMS 10 @@ -162,6 +166,19 @@ static void FreeKnownVMs(); static jboolean IsWildCardEnabled(); +/* + * This reports error. VM will not be created and no usage is printed. + */ +#define REPORT_ERROR(AC_ok, AC_failure_message, AC_questionable_arg) \ + do { \ + if (!AC_ok) { \ + JLI_ReportErrorMessage(AC_failure_message, AC_questionable_arg); \ + printUsage = JNI_FALSE; \ + *pret = 1; \ + return JNI_FALSE; \ + } \ + } while (JNI_FALSE) + #define ARG_CHECK(AC_arg_count, AC_failure_message, AC_questionable_arg) \ do { \ if (AC_arg_count < 1) { \ @@ -511,17 +528,73 @@ } /* - * Test if the given option name has a whitespace separated argument. + * Test if the given name is one of the class path options. */ -jboolean -IsWhiteSpaceOptionArgument(const char* name) { +static jboolean +IsClassPathOption(const char* name) { return JLI_StrCmp(name, "-classpath") == 0 || JLI_StrCmp(name, "-cp") == 0 || - JLI_StrCmp(name, "-modulepath") == 0 || - JLI_StrCmp(name, "-mp") == 0 || - JLI_StrCmp(name, "-upgrademodulepath") == 0 || - JLI_StrCmp(name, "-addmods") == 0 || - JLI_StrCmp(name, "-limitmods") == 0; + JLI_StrCmp(name, "--class-path") == 0; +} + +/* + * Test if the given name is a launcher option taking the main entry point. + */ +static jboolean +IsLauncherMainOption(const char* name) { + return JLI_StrCmp(name, "--module") == 0 || + JLI_StrCmp(name, "-m") == 0; +} + +/* + * Test if the given name is a white-space launcher option. + */ +static jboolean +IsLauncherOption(const char* name) { + return IsClassPathOption(name) || + IsLauncherMainOption(name) || + JLI_StrCmp(name, "--list-modules") == 0; +} + +#ifndef OLD_MODULE_OPTIONS +/* + * Old module options for transition + */ +static jboolean +IsOldModuleOption(const char* name) { + return JLI_StrCmp(name, "-modulepath") == 0 || + JLI_StrCmp(name, "-mp") == 0 || + JLI_StrCmp(name, "-upgrademodulepath") == 0 || + JLI_StrCmp(name, "-addmods") == 0 || + JLI_StrCmp(name, "-limitmods") == 0; +} +#endif + +/* + * Test if the given name is a module-system white-space option that + * will be passed to the VM with its corresponding long-form option + * name and "=" delimiter. + */ +static jboolean +IsModuleOption(const char* name) { + return JLI_StrCmp(name, "--module-path") == 0 || + JLI_StrCmp(name, "-p") == 0 || + JLI_StrCmp(name, "--upgrade-module-path") == 0 || + JLI_StrCmp(name, "--add-modules") == 0 || + JLI_StrCmp(name, "--limit-modules") == 0 || + JLI_StrCmp(name, "--add-exports") == 0 || + JLI_StrCmp(name, "--add-reads") == 0 || + JLI_StrCmp(name, "--patch-module") == 0 || + IsOldModuleOption(name); +} + +/* + * Test if the given name has a white space option. + */ +jboolean +IsWhiteSpaceOption(const char* name) { + return IsModuleOption(name) || + IsLauncherOption(name); } /* @@ -559,7 +632,7 @@ continue; } } else { - if (IsWhiteSpaceOptionArgument(arg)) { + if (IsWhiteSpaceOption(arg)) { newArgv[newArgvIdx++] = arg; argi++; if (argi < argc) { @@ -701,7 +774,7 @@ if (i > 0) { char *prev = argv[i - 1]; // skip non-dash arg preceded by class path specifiers - if (*arg != '-' && IsWhiteSpaceOptionArgument(prev)) { + if (*arg != '-' && IsWhiteSpaceOption(prev)) { continue; } @@ -709,6 +782,7 @@ || JLI_StrCmp(arg, "-version") == 0 || JLI_StrCmp(arg, "-fullversion") == 0 || JLI_StrCmp(arg, "-help") == 0 + || JLI_StrCmp(arg, "--help") == 0 || JLI_StrCmp(arg, "-?") == 0 || JLI_StrCmp(arg, "-jar") == 0 || JLI_StrCmp(arg, "-X") == 0) { @@ -882,39 +956,16 @@ } static void -SetModulePath(const char *s) +AddLongFormOption(const char *option, const char *arg) { + static const char format[] = "%s=%s"; char *def; - const char *orig = s; - static const char format[] = "-Djdk.module.path=%s"; - if (s == NULL) - return; - s = JLI_WildcardExpandClasspath(s); - def = JLI_MemAlloc(sizeof(format) - - 2 /* strlen("%s") */ - + JLI_StrLen(s)); - sprintf(def, format, s); - AddOption(def, NULL); - if (s != orig) - JLI_MemFree((char *) s); -} + size_t def_len; -static void -SetUpgradeModulePath(const char *s) -{ - char *def; - const char *orig = s; - static const char format[] = "-Djdk.upgrade.module.path=%s"; - if (s == NULL) - return; - s = JLI_WildcardExpandClasspath(s); - def = JLI_MemAlloc(sizeof(format) - - 2 /* strlen("%s") */ - + JLI_StrLen(s)); - sprintf(def, format, s); + def_len = JLI_StrLen(option) + 1 + JLI_StrLen(arg) + 1; + def = JLI_MemAlloc(def_len); + JLI_Snprintf(def, def_len, format, option, arg); AddOption(def, NULL); - if (s != orig) - JLI_MemFree((char *) s); } static void @@ -939,46 +990,6 @@ AddOption(def, NULL); } -static void -SetAddModulesProp(const char *mods) { - size_t buflen = JLI_StrLen(mods) + 40; - char *prop = (char *)JLI_MemAlloc(buflen); - JLI_Snprintf(prop, buflen, "-Djdk.launcher.addmods=%s", mods); - AddOption(prop, NULL); -} - -static void -SetLimitModulesProp(const char *mods) { - size_t buflen = JLI_StrLen(mods) + 40; - char *prop = (char *)JLI_MemAlloc(buflen); - JLI_Snprintf(prop, buflen, "-Djdk.launcher.limitmods=%s", mods); - AddOption(prop, NULL); -} - -static void -SetAddReadsProp(const jint n, const char *s) { - size_t buflen = JLI_StrLen(s) + 40; - char *prop = (char *)JLI_MemAlloc(buflen); - JLI_Snprintf(prop, buflen, "-Djdk.launcher.addreads.%d=%s", n, s); - AddOption(prop, NULL); -} - -static void -SetAddExportsProp(const jint n, const char *s) { - size_t buflen = JLI_StrLen(s) + 40; - char *prop = (char *)JLI_MemAlloc(buflen); - JLI_Snprintf(prop, buflen, "-Djdk.launcher.addexports.%d=%s", n, s); - AddOption(prop, NULL); -} - -static void -SetPatchProp(const jint n, const char *s) { - size_t buflen = JLI_StrLen(s) + 40; - char *prop = (char *)JLI_MemAlloc(buflen); - JLI_Snprintf(prop, buflen, "-Djdk.launcher.patch.%d=%s", n, s); - AddOption(prop, NULL); -} - /* * The SelectVersion() routine ensures that an appropriate version of * the JRE is running. The specification for the appropriate version @@ -1003,6 +1014,7 @@ char *splash_jar_name = NULL; char *env_in; int res; + jboolean has_arg; /* * If the version has already been selected, set *main_class @@ -1033,9 +1045,11 @@ * This capability is no longer available with JRE versions 1.9 and later. * These command line options are reported as errors. */ + argc--; argv++; while ((arg = *argv) != 0 && *arg == '-') { + has_arg = IsOptionWithArgument(argc, argv); if (JLI_StrCCmp(arg, "-version:") == 0) { JLI_ReportErrorMessage(SPC_ERROR1); } else if (JLI_StrCmp(arg, "-jre-restrict-search") == 0) { @@ -1045,10 +1059,12 @@ } else { if (JLI_StrCmp(arg, "-jar") == 0) jarflag = 1; - if (IsWhiteSpaceOptionArgument(arg) && (argc >= 2)) { - argc--; - argv++; - arg = *argv; + if (IsWhiteSpaceOption(arg)) { + if (has_arg) { + argc--; + argv++; + arg = *argv; + } } /* @@ -1140,6 +1156,108 @@ } /* + * Test if the current argv is an option, i.e. with a leading `-` + * and followed with an argument without a leading `-`. + */ +static jboolean +IsOptionWithArgument(int argc, char** argv) { + char* option; + char* arg; + + if (argc <= 1) + return JNI_FALSE; + + option = *argv; + arg = *(argv+1); + return *option == '-' && *arg != '-'; +} + +/* + * Gets the option, and its argument if the option has an argument. + * It will update *pargc, **pargv to the next option. + */ +static int +GetOpt(int *pargc, char ***pargv, char **poption, char **pvalue) { + int argc = *pargc; + char** argv = *pargv; + char* arg = *argv; + + char* option = arg; + char* value = NULL; + char* equals = NULL; + int kind = LAUNCHER_OPTION; + jboolean has_arg = JNI_FALSE; + + // check if this option may be a white-space option with an argument + has_arg = IsOptionWithArgument(argc, argv); + + argv++; --argc; + if (IsLauncherOption(arg)) { + if (has_arg) { + value = *argv; + argv++; --argc; + } + kind = IsLauncherMainOption(arg) ? LAUNCHER_MAIN_OPTION + : LAUNCHER_OPTION_WITH_ARGUMENT; + } else if (IsModuleOption(arg)) { + kind = VM_LONG_OPTION_WITH_ARGUMENT; + if (has_arg) { + value = *argv; + argv++; --argc; + } + + /* + * Support short form alias + */ + if (JLI_StrCmp(arg, "-p") == 0) { + option = "--module-path"; + } + + } else if (JLI_StrCCmp(arg, "--") == 0 && (equals = JLI_StrChr(arg, '=')) != NULL) { + value = equals+1; + if (JLI_StrCCmp(arg, "--list-modules=") == 0 || + JLI_StrCCmp(arg, "--module=") == 0 || + JLI_StrCCmp(arg, "--class-path=") == 0) { + kind = LAUNCHER_OPTION_WITH_ARGUMENT; + } else { + kind = VM_LONG_OPTION; + } + } + +#ifndef OLD_MODULE_OPTIONS + // for transition to support both old and new syntax + if (JLI_StrCmp(arg, "-modulepath") == 0 || + JLI_StrCmp(arg, "-mp") == 0) { + option = "--module-path"; + } else if (JLI_StrCmp(arg, "-upgrademodulepath") == 0) { + option = "--upgrade-module-path"; + } else if (JLI_StrCmp(arg, "-addmods") == 0) { + option = "--add-modules"; + } else if (JLI_StrCmp(arg, "-limitmods") == 0) { + option = "--limit-modules"; + } else if (JLI_StrCCmp(arg, "-XaddExports:") == 0) { + option = "--add-exports"; + value = arg + 13; + kind = VM_LONG_OPTION_WITH_ARGUMENT; + } else if (JLI_StrCCmp(arg, "-XaddReads:") == 0) { + option = "--add-reads"; + value = arg + 11; + kind = VM_LONG_OPTION_WITH_ARGUMENT; + } else if (JLI_StrCCmp(arg, "-Xpatch:") == 0) { + option = "--patch-module"; + value = arg + 8; + kind = VM_LONG_OPTION_WITH_ARGUMENT; + } +#endif + + *pargc = argc; + *pargv = argv; + *poption = option; + *pvalue = value; + return kind; +} + +/* * Parses command line arguments. Returns JNI_FALSE if launcher * should exit without starting vm, returns JNI_TRUE if vm needs * to be started to process given options. *pret (the launcher @@ -1158,52 +1276,85 @@ *pret = 0; while ((arg = *argv) != 0 && *arg == '-') { - argv++; --argc; - if (JLI_StrCmp(arg, "-classpath") == 0 || JLI_StrCmp(arg, "-cp") == 0) { - ARG_CHECK (argc, ARG_ERROR1, arg); - SetClassPath(*argv); - mode = LM_CLASS; - argv++; --argc; - } else if (JLI_StrCmp(arg, "-modulepath") == 0 || JLI_StrCmp(arg, "-mp") == 0) { - ARG_CHECK (argc, ARG_ERROR4, arg); - SetModulePath(*argv); - argv++; --argc; - } else if (JLI_StrCmp(arg, "-upgrademodulepath") == 0) { - ARG_CHECK (argc, ARG_ERROR4, arg); - SetUpgradeModulePath(*argv); - argv++; --argc; - } else if (JLI_StrCmp(arg, "-jar") == 0) { - ARG_CHECK (argc, ARG_ERROR2, arg); + char *option = NULL; + char *value = NULL; + int kind = GetOpt(&argc, &argv, &option, &value); + jboolean has_arg = value != NULL; + +/* + * Option to set main entry point + */ + if (JLI_StrCmp(arg, "-jar") == 0) { + ARG_CHECK(argc, ARG_ERROR2, arg); mode = LM_JAR; - } else if (JLI_StrCmp(arg, "-m") == 0) { - ARG_CHECK (argc, ARG_ERROR5, arg); - SetMainModule(*argv); + } else if (JLI_StrCmp(arg, "--module") == 0 || + JLI_StrCCmp(arg, "--module=") == 0 || + JLI_StrCmp(arg, "-m") == 0) { + REPORT_ERROR (has_arg, ARG_ERROR5, arg); + SetMainModule(value); mode = LM_MODULE; - } else if (JLI_StrCmp(arg, "-addmods") == 0) { - ARG_CHECK (argc, ARG_ERROR6, arg); - SetAddModulesProp(*argv); - argv++; --argc; - } else if (JLI_StrCmp(arg, "-limitmods") == 0) { - ARG_CHECK (argc, ARG_ERROR6, arg); - SetLimitModulesProp(*argv); - argv++; --argc; - } else if (JLI_StrCmp(arg, "-listmods") == 0 || - JLI_StrCCmp(arg, "-listmods:") == 0) { + if (has_arg) { + *pwhat = value; + break; + } + } else if (JLI_StrCmp(arg, "--class-path") == 0 || + JLI_StrCCmp(arg, "--class-path=") == 0 || + JLI_StrCmp(arg, "-classpath") == 0 || + JLI_StrCmp(arg, "-cp") == 0) { + REPORT_ERROR (has_arg, ARG_ERROR1, arg); + SetClassPath(value); + mode = LM_CLASS; + } else if (JLI_StrCmp(arg, "--list-modules") == 0 || + JLI_StrCCmp(arg, "--list-modules=") == 0) { listModules = arg; + + // set listModules to --list-modules= if argument is specified + if (JLI_StrCmp(arg, "--list-modules") == 0 && has_arg) { + static const char format[] = "%s=%s"; + size_t buflen = JLI_StrLen(option) + 2 + JLI_StrLen(value); + listModules = JLI_MemAlloc(buflen); + JLI_Snprintf(listModules, buflen, format, option, value); + } return JNI_TRUE; - } else if (JLI_StrCCmp(arg, "-XaddReads:") == 0) { - static jint n; - char *value = arg + 11; - SetAddReadsProp(n++, value); - } else if (JLI_StrCCmp(arg, "-XaddExports:") == 0) { - static jint n; - char *value = arg + 13; - SetAddExportsProp(n++, value); - } else if (JLI_StrCCmp(arg, "-Xpatch:") == 0) { - static jint n; - char *value = arg + 8; - SetPatchProp(n++, value); - } else if (JLI_StrCmp(arg, "-help") == 0 || +/* + * Parse white-space options + */ + } else if (has_arg) { + if (kind == VM_LONG_OPTION) { + AddOption(option, NULL); + } else if (kind == VM_LONG_OPTION_WITH_ARGUMENT) { + AddLongFormOption(option, value); + } +/* + * Error missing argument + */ + } else if (!has_arg && IsWhiteSpaceOption(arg)) { + if (JLI_StrCmp(arg, "--module-path") == 0 || + JLI_StrCmp(arg, "-p") == 0 || + JLI_StrCmp(arg, "--upgrade-module-path") == 0) { + REPORT_ERROR (has_arg, ARG_ERROR4, arg); + } else if (JLI_StrCmp(arg, "--add-modules") == 0 || + JLI_StrCmp(arg, "--limit-modules") == 0 || + JLI_StrCmp(arg, "--add-exports") == 0 || + JLI_StrCmp(arg, "--add-reads") == 0 || + JLI_StrCmp(arg, "--patch-module") == 0) { + REPORT_ERROR (has_arg, ARG_ERROR6, arg); + } +#ifndef OLD_MODULE_OPTIONS + else if (JLI_StrCmp(arg, "-modulepath") == 0 || + JLI_StrCmp(arg, "-mp") == 0 || + JLI_StrCmp(arg, "-upgrademodulepath") == 0) { + REPORT_ERROR (has_arg, ARG_ERROR4, arg); + } else if (JLI_StrCmp(arg, "-addmods") == 0 || + JLI_StrCmp(arg, "-limitmods") == 0) { + REPORT_ERROR (has_arg, ARG_ERROR6, arg); + } +#endif +/* + * The following cases will cause the argument parsing to stop + */ + } else if (JLI_StrCmp(arg, "--help") == 0 || + JLI_StrCmp(arg, "-help") == 0 || JLI_StrCmp(arg, "-h") == 0 || JLI_StrCmp(arg, "-?") == 0) { printUsage = JNI_TRUE; @@ -1282,7 +1433,7 @@ } } - if (--argc >= 0) { + if (*pwhat == NULL && --argc >= 0) { *pwhat = *argv++; } @@ -1692,7 +1843,7 @@ ListModules(JNIEnv *env, char *optString) { jmethodID listModulesID; - jstring joptString; + jstring joptString = NULL; jclass cls = GetLauncherHelperClass(env); NULL_CHECK(cls); NULL_CHECK(listModulesID = (*env)->GetStaticMethodID(env, cls, --- old/jdk/src/java.base/share/native/libjli/java.h 2016-08-08 16:30:49.000000000 -0700 +++ new/jdk/src/java.base/share/native/libjli/java.h 2016-08-08 16:30:48.000000000 -0700 @@ -161,6 +161,7 @@ jint ReadKnownVMs(const char *jvmcfg, jboolean speculative); char *CheckJvmType(int *argc, char ***argv, jboolean speculative); void AddOption(char *str, void *info); +jboolean IsWhiteSpaceOption(const char* name); enum ergo_policy { DEFAULT_POLICY = 0, --- old/jdk/src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java 2016-08-08 16:30:53.000000000 -0700 +++ new/jdk/src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java 2016-08-08 16:30:52.000000000 -0700 @@ -91,7 +91,7 @@ tool.xflag = true; } }, - new Option(false, OptionType.MAIN_OPERATION, "--print-module-descriptor", "-p") { + new Option(false, OptionType.MAIN_OPERATION, "--print-module-descriptor", "-d") { void process(Main tool, String opt, String arg) throws BadArgs { if (tool.cflag || tool.iflag || tool.tflag || tool.uflag || tool.xflag) throw new BadArgs("error.multiple.main.operations").showUsage(true); @@ -145,7 +145,7 @@ } } }, - new Option(true, OptionType.CREATE_UPDATE, "--modulepath", "--mp") { + new Option(true, OptionType.CREATE_UPDATE, "--module-path", "-p") { void process(Main jartool, String opt, String arg) { String[] dirs = arg.split(File.pathSeparator); Path[] paths = new Path[dirs.length]; --- old/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties 2016-08-08 16:30:56.000000000 -0700 +++ new/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties 2016-08-08 16:30:55.000000000 -0700 @@ -177,7 +177,7 @@ main.help.opt.main.extract=\ \ -x, --extract Extract named (or all) files from the archive main.help.opt.main.print-module-descriptor=\ -\ -p, --print-module-descriptor Print the module descriptor +\ -d, --print-module-descriptor Print the module descriptor main.help.opt.any=\ \ Operation modifiers valid in any mode:\n\ \n\ @@ -208,8 +208,8 @@ \ matched by the given pattern and that depend upon\n\ \ directly or indirectly on a modular jar being\n\ \ created or a non-modular jar being updated -main.help.opt.create.update.modulepath=\ -\ --modulepath Location of module dependence for generating +main.help.opt.create.update.module-path=\ +\ -p, --module-path Location of module dependence for generating\n\ \ the hash main.help.opt.create.update.index=\ \ Operation modifiers valid only in create, update, and generate-index mode:\n @@ -226,7 +226,7 @@ \ located in the root of the given directories, or the root of the jar archive\n\ \ itself. The following operations are only valid when creating a modular jar,\n\ \ or updating an existing non-modular jar: '--module-version',\n\ -\ '--hash-modules', and '--modulepath'.\n\ +\ '--hash-modules', and '--module-path'.\n\ \n\ \ Mandatory or optional arguments to long options are also mandatory or optional\n\ -\ for any corresponding short options. \ No newline at end of file +\ for any corresponding short options. --- old/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java 2016-08-08 16:30:59.000000000 -0700 +++ new/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java 2016-08-08 16:30:58.000000000 -0700 @@ -61,11 +61,11 @@ new Option(false, (task, option, arg) -> { task.options.fullVersion = true; - }, true, "--fullversion"), + }, true, "--full-version"), new Option(false, (task, option, arg) -> { task.options.help = true; - }, "--help"), + }, "--help", "-h"), new Option(false, (task, option, arg) -> { task.options.verbose = true; --- old/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/resources/jimage.properties 2016-08-08 16:31:02.000000000 -0700 +++ new/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/resources/jimage.properties 2016-08-08 16:31:01.000000000 -0700 @@ -25,7 +25,7 @@ main.usage.summary=\ Usage: {0} jimage...\n\ -use --help for a list of possible options. +use -h or --help for a list of possible options. main.usage=\ Usage: {0} jimage...\n\ @@ -76,11 +76,11 @@ \ used, one pattern per line\n\ -main.opt.fullversion=\ -\ --fullversion Print full version information +main.opt.full-version=\ +\ --full-version Print full version information main.opt.help=\ -\ --help Print usage message +\ -h, --help Print usage message main.opt.verbose=\ \ --verbose Listing prints entry size and offset attributes --- old/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java 2016-08-08 16:31:05.000000000 -0700 +++ new/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java 2016-08-08 16:31:04.000000000 -0700 @@ -84,31 +84,32 @@ private static final Option[] recognizedOptions = { new Option(false, (task, opt, arg) -> { task.options.help = true; - }, "--help"), + }, "--help", "-h"), new Option(true, (task, opt, arg) -> { String[] dirs = arg.split(File.pathSeparator); + int i = 0; Arrays.stream(dirs) .map(Paths::get) .forEach(task.options.modulePath::add); - }, "--modulepath", "--mp"), + }, "--module-path", "-p"), new Option(true, (task, opt, arg) -> { for (String mn : arg.split(",")) { if (mn.isEmpty()) { throw taskHelper.newBadArgs("err.mods.must.be.specified", - "--limitmods"); + "--limit-modules"); } task.options.limitMods.add(mn); } - }, "--limitmods"), + }, "--limit-modules"), new Option(true, (task, opt, arg) -> { for (String mn : arg.split(",")) { if (mn.isEmpty()) { throw taskHelper.newBadArgs("err.mods.must.be.specified", - "--addmods"); + "--add-modules"); } task.options.addMods.add(mn); } - }, "--addmods"), + }, "--add-modules"), new Option(true, (task, opt, arg) -> { Path path = Paths.get(arg); task.options.output = path; @@ -134,10 +135,10 @@ }, true, "--keep-packaged-modules"), new Option(true, (task, opt, arg) -> { task.options.saveoptsfile = arg; - }, "--saveopts"), + }, "--save-opts"), new Option(false, (task, opt, arg) -> { task.options.fullVersion = true; - }, true, "--fullversion"),}; + }, true, "--full-version"),}; private static final String PROGNAME = "jlink"; private final OptionsValues options = new OptionsValues(); @@ -294,7 +295,7 @@ try { options.addMods = checkAddMods(options.addMods); } catch (IllegalArgumentException ex) { - throw taskHelper.newBadArgs("err.mods.must.be.specified", "--addmods") + throw taskHelper.newBadArgs("err.mods.must.be.specified", "--add-modules") .showUsage(true); } // First create the image provider --- old/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java 2016-08-08 16:31:08.000000000 -0700 +++ new/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java 2016-08-08 16:31:07.000000000 -0700 @@ -196,7 +196,7 @@ // This option is handled prior // to have the options parsed. }, - "--plugins-modulepath")); + "--plugin-module-path")); mainOptions.add(new PlugOption(true, (task, opt, arg) -> { Path path = Paths.get(arg); if (!Files.exists(path) || !Files.isDirectory(path)) { --- old/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties 2016-08-08 16:31:11.000000000 -0700 +++ new/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties 2016-08-08 16:31:11.000000000 -0700 @@ -24,30 +24,31 @@ # main.usage.summary=\ -Usage: {0} --modulepath --addmods --output \n\ +Usage: {0} --module-path --add-modules --output \n\ use --help for a list of possible options main.usage=\ -Usage: {0} --modulepath --addmods --output \n\ +Usage: {0} --module-path --add-modules --output \n\ \Possible options include: error.prefix=Error: warn.prefix=Warning: main.opt.help=\ -\ --help Print this help message +\ -h, --help Print this help message main.opt.version=\ \ --version Version information -main.opt.modulepath=\ -\ --modulepath Module path +main.opt.module-path=\ +\ -p \n\ +\ --module-path Module path -main.opt.addmods=\ -\ --addmods [,...] Root modules to resolve +main.opt.add-modules=\ +\ --add-modules [,...] Root modules to resolve -main.opt.limitmods=\ -\ --limitmods [,...] Limit the universe of observable modules +main.opt.limit-modules=\ +\ --limit-modules [,...] Limit the universe of observable modules main.opt.output=\ \ --output Location of output path @@ -58,8 +59,8 @@ main.opt.endian=\ \ --endian Byte order of generated jimage (default:native) -main.opt.saveopts=\ -\ --saveopts Save jlink options in the given file +main.opt.save-opts=\ +\ --save-opts Save jlink options in the given file main.msg.bug=\ An exception has occurred in jlink. \ @@ -83,7 +84,7 @@ err.unknown.byte.order:unknown byte order {0} err.output.must.be.specified:--output must be specified -err.modulepath.must.be.specified:--modulepath must be specified +err.modulepath.must.be.specified:--module-path must be specified err.mods.must.be.specified:no modules specified to {0} err.path.not.found=path not found: {0} err.path.not.valid=invalid path: {0} --- old/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties 2016-08-08 16:31:14.000000000 -0700 +++ new/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties 2016-08-08 16:31:13.000000000 -0700 @@ -115,7 +115,7 @@ Invalid language tag: %s include-locales.localedatanotfound=\ -jdk.localedata module was not specified with --addmods option +jdk.localedata module was not specified with --add-modules option main.status.ok=Functional. @@ -133,8 +133,8 @@ plugin.opt.resources-last-sorter=\ \ --resources-last-sorter The last plugin allowed to sort resources -plugin.opt.plugins-modulepath=\ -\ --plugin-module-path Custom plugins module path +plugin.opt.plugin-module-path=\ +\ --plugin-module-path Custom plugin module path plugin.opt.c=\ \ -c, --compress=2 Enable compression of resources (level 2) --- old/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java 2016-08-08 16:31:17.000000000 -0700 +++ new/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java 2016-08-08 16:31:16.000000000 -0700 @@ -1181,7 +1181,7 @@ } } - private final OptionParser parser = new OptionParser(); + private final OptionParser parser = new OptionParser("hp"); private void handleOptions(String[] args) { parser.formatHelpWith(new JmodHelpFormatter()); @@ -1218,7 +1218,7 @@ .withValuesConvertedBy(new PatternConverter()); OptionSpec help - = parser.accepts("help", getMessage("main.opt.help")) + = parser.acceptsAll(Set.of("h", "help"), getMessage("main.opt.help")) .forHelp(); OptionSpec libs @@ -1232,9 +1232,9 @@ .withRequiredArg() .describedAs(getMessage("main.opt.main-class.arg")); - OptionSpec modulePath // TODO: short version of --mp ?? - = parser.acceptsAll(Arrays.asList("mp", "modulepath"), - getMessage("main.opt.modulepath")) + OptionSpec modulePath + = parser.acceptsAll(Set.of("p", "module-path"), + getMessage("main.opt.module-path")) .withRequiredArg() .withValuesSeparatedBy(File.pathSeparatorChar) .withValuesConvertedBy(DirPathConverter.INSTANCE); --- old/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod.properties 2016-08-08 16:31:20.000000000 -0700 +++ new/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod.properties 2016-08-08 16:31:19.000000000 -0700 @@ -63,7 +63,7 @@ main.opt.os-arch.arg=os-arch main.opt.os-version=Operating system version main.opt.os-version.arg=os-version -main.opt.modulepath=Module path +main.opt.module-path=Module path main.opt.hash-modules=Compute and record hashes to tie a packaged module\ \ with modules matching the given and depending upon it directly\ \ or indirectly. The hashes are recorded in the JMOD file being created, or\ --- old/jdk/test/ProblemList.txt 2016-08-08 16:31:24.000000000 -0700 +++ new/jdk/test/ProblemList.txt 2016-08-08 16:31:23.000000000 -0700 @@ -343,6 +343,9 @@ com/sun/jdi/sde/SourceDebugExtensionTest.java 8158066 windows-all +com/sun/jdi/ClassesByName2Test.java 8160833 generic-all +com/sun/jdi/RedefineCrossEvent.java 8160833 generic-all + ############################################################################ # jdk_time --- old/jdk/test/TEST.ROOT 2016-08-08 16:31:27.000000000 -0700 +++ new/jdk/test/TEST.ROOT 2016-08-08 16:31:26.000000000 -0700 @@ -26,12 +26,12 @@ # Allow querying of various System properties in @requires clauses requires.properties=sun.arch.data.model java.runtime.name -# Tests using jtreg 4.2 b02 features -requiredVersion=4.2 b02 +# Tests using jtreg 4.2 b03 features +requiredVersion=4.2 b03 # Path to libraries in the topmost test directory. This is needed so @library # does not need ../../ notation to reach them external.lib.roots = ../../ -# Use new form of -Xpatch -useNewXpatch=true +# Use new module options +useNewOptions=true --- old/jdk/test/com/sun/corba/5036554/TestCorbaBug.sh 2016-08-08 16:31:30.000000000 -0700 +++ new/jdk/test/com/sun/corba/5036554/TestCorbaBug.sh 2016-08-08 16:31:29.000000000 -0700 @@ -81,9 +81,9 @@ chmod -fR 777 bug -${COMPILEJAVA}${FS}bin${FS}javac -addmods java.corba -d . bug${FS}*.java +${COMPILEJAVA}${FS}bin${FS}javac --add-modules java.corba -d . bug${FS}*.java -${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -addmods java.corba -cp . bug/JavaBug > test.out 2>&1 +${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} --add-modules java.corba -cp . bug/JavaBug > test.out 2>&1 grep "NullPointerException" test.out --- old/jdk/test/com/sun/corba/7130985/CorbaExceptionsCompileTest.java 2016-08-08 16:31:32.000000000 -0700 +++ new/jdk/test/com/sun/corba/7130985/CorbaExceptionsCompileTest.java 2016-08-08 16:31:32.000000000 -0700 @@ -27,8 +27,8 @@ * @summary Four helper classes missing in Sun JDK * @library /lib/testlibrary * @build jdk.testlibrary.* - * @compile -addmods java.corba CorbaExceptionsCompileTest.java - * @run main/othervm -addmods java.corba CorbaExceptionsCompileTest + * @modules java.corba + * @run main CorbaExceptionsCompileTest */ import java.io.*; --- old/jdk/test/com/sun/corba/se/impl/io/HookPutFieldsTest.java 2016-08-08 16:31:35.000000000 -0700 +++ new/jdk/test/com/sun/corba/se/impl/io/HookPutFieldsTest.java 2016-08-08 16:31:34.000000000 -0700 @@ -25,8 +25,8 @@ * @test * @bug 7095856 * @summary OutputStreamHook doesn't handle null values - * @compile -addmods java.corba HookPutFieldsTest.java - * @run main/othervm -addmods java.corba HookPutFieldsTest + * @modules java.corba + * @run main HookPutFieldsTest */ import java.net.InetAddress; --- old/jdk/test/com/sun/corba/se/impl/orb/SetDefaultORBTest.java 2016-08-08 16:31:37.000000000 -0700 +++ new/jdk/test/com/sun/corba/se/impl/orb/SetDefaultORBTest.java 2016-08-08 16:31:36.000000000 -0700 @@ -25,8 +25,8 @@ * @test * @bug 8028215 * @summary SetDefaultORBTest setting ORB impl via properties test - * @compile -addmods java.corba SetDefaultORBTest.java - * @run main/othervm -addmods java.corba SetDefaultORBTest + * @modules java.corba + * @run main SetDefaultORBTest * */ --- old/jdk/test/com/sun/jdi/ImmutableResourceTest.sh 2016-08-08 16:31:39.000000000 -0700 +++ new/jdk/test/com/sun/jdi/ImmutableResourceTest.sh 2016-08-08 16:31:39.000000000 -0700 @@ -99,11 +99,11 @@ set -vx # # Compile test class -${TESTJAVA}/bin/javac -XaddExports:jdk.jdi/com.sun.tools.example.debug.tty=ALL-UNNAMED \ +${TESTJAVA}/bin/javac --add-exports jdk.jdi/com.sun.tools.example.debug.tty=ALL-UNNAMED \ -d "${TESTCLASSES}" ${CP} -g "${TESTSRC}"/"${TARGETCLASS}".java # # Run the test class, again with the classpath we need: -${TESTJAVA}/bin/java -XaddExports:jdk.jdi/com.sun.tools.example.debug.tty=ALL-UNNAMED \ +${TESTJAVA}/bin/java --add-exports jdk.jdi/com.sun.tools.example.debug.tty=ALL-UNNAMED \ ${CP} ${TARGETCLASS} status=$? echo "test status was: $status" --- old/jdk/test/com/sun/jndi/cosnaming/CNNameParser.java 2016-08-08 16:31:42.000000000 -0700 +++ new/jdk/test/com/sun/jndi/cosnaming/CNNameParser.java 2016-08-08 16:31:41.000000000 -0700 @@ -26,6 +26,7 @@ * @summary Tests that JNDI/COS naming parser supports the syntax * defined in the new INS standard. * @modules java.corba/com.sun.jndi.cosnaming + * @run main/othervm CNNameParser */ import javax.naming.*; --- old/jdk/test/com/sun/jndi/cosnaming/IiopUrlIPv6.java 2016-08-08 16:31:44.000000000 -0700 +++ new/jdk/test/com/sun/jndi/cosnaming/IiopUrlIPv6.java 2016-08-08 16:31:43.000000000 -0700 @@ -25,6 +25,7 @@ * @bug 5042453 * @summary Ipv6 address throws Non-numeric port number error * @modules java.corba/com.sun.jndi.cosnaming + * @run main/othervm IiopUrlIPv6 */ import com.sun.jndi.cosnaming.*; --- old/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java 2016-08-08 16:31:46.000000000 -0700 +++ new/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java 2016-08-08 16:31:45.000000000 -0700 @@ -61,7 +61,7 @@ ProcessBuilder pb = ProcessTools. createJavaProcessBuilder( - "-XaddExports:jdk.attach/sun.tools.attach=ALL-UNNAMED", + "--add-exports", "jdk.attach/sun.tools.attach=ALL-UNNAMED", "-XX:+UseConcMarkSweepGC", // this will cause UseParNewGC to be FLAG_SET_ERGO "-XX:+UseCodeAging", "-XX:+UseCerealGC", // Should be ignored. --- old/jdk/test/java/awt/Gtk/GtkVersionTest/GtkVersionTest.java 2016-08-08 16:31:48.000000000 -0700 +++ new/jdk/test/java/awt/Gtk/GtkVersionTest/GtkVersionTest.java 2016-08-08 16:31:47.000000000 -0700 @@ -55,7 +55,7 @@ "/bin/java " + (version == null ? "" : "-Djdk.gtk.version=" + version) + " -Djdk.gtk.verbose=true " + - "-XaddExports:java.desktop/sun.awt=ALL-UNNAMED " + + "--add-exports=java.desktop/sun.awt=ALL-UNNAMED " + "-cp " + System.getProperty("java.class.path", ".") + " GtkVersionTest$LoadGtk"); p.waitFor(); --- old/jdk/test/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh 2016-08-08 16:31:50.000000000 -0700 +++ new/jdk/test/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh 2016-08-08 16:31:49.000000000 -0700 @@ -113,8 +113,8 @@ case "$OS" in Windows* | CYGWIN* ) ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} \ - -XaddExports:java.desktop/sun.awt=ALL-UNNAMED \ - -XaddExports:java.desktop/sun.awt.windows=ALL-UNNAMED ${CP} \ + --add-exports java.desktop/sun.awt=ALL-UNNAMED \ + --add-exports java.desktop/sun.awt.windows=ALL-UNNAMED ${CP} \ *.java status=$? if [ ! $status -eq "0" ]; then @@ -124,8 +124,8 @@ SunOS | Linux ) ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} \ - -XaddExports:java.desktop/sun.awt=ALL-UNNAMED \ - -XaddExports:java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \ + --add-exports java.desktop/sun.awt=ALL-UNNAMED \ + --add-exports java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \ *.java status=$? if [ ! $status -eq "0" ]; then @@ -135,8 +135,8 @@ Darwin) ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} \ - -XaddExports:java.desktop/sun.awt=ALL-UNNAMED \ - -XaddExports:java.desktop/sun.lwawt.macosx=ALL-UNNAMED ${CP} \ + --add-exports java.desktop/sun.awt=ALL-UNNAMED \ + --add-exports java.desktop/sun.lwawt.macosx=ALL-UNNAMED ${CP} \ *.java status=$? if [ ! $status -eq "0" ]; then @@ -154,16 +154,16 @@ case "$OS" in Windows* | CYGWIN* ) ${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.awt.headless=true \ - -XaddExports:java.desktop/sun.awt=ALL-UNNAMED \ - -XaddExports:java.desktop/sun.awt.windows=ALL-UNNAMED ${CP} \ + --add-exports java.desktop/sun.awt=ALL-UNNAMED \ + --add-exports java.desktop/sun.awt.windows=ALL-UNNAMED ${CP} \ TestWrapped sun.awt.windows.WToolkit status=$? if [ ! $status -eq "0" ]; then fail "Test FAILED: toolkit wrapped into HeadlessToolkit is not an instance of sun.awt.windows.WToolkit"; fi ${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.awt.headless=true \ - -XaddExports:java.desktop/sun.awt=ALL-UNNAMED \ - -XaddExports:java.desktop/sun.awt.windows=ALL-UNNAMED ${CP} \ + --add-exports java.desktop/sun.awt=ALL-UNNAMED \ + --add-exports java.desktop/sun.awt.windows=ALL-UNNAMED ${CP} \ -Dawt.toolkit=sun.awt.windows.WToolkit \ TestWrapped sun.awt.windows.WToolkit status=$? @@ -174,8 +174,8 @@ SunOS | Linux ) ${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.awt.headless=true \ - -XaddExports:java.desktop/sun.awt=ALL-UNNAMED \ - -XaddExports:java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \ + --add-exports java.desktop/sun.awt=ALL-UNNAMED \ + --add-exports java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \ -Dawt.toolkit=sun.awt.X11.XToolkit \ TestWrapped sun.awt.X11.XToolkit status=$? @@ -183,8 +183,8 @@ fail "Test FAILED: toolkit wrapped into HeadlessToolkit is not an instance of sun.awt.xawt.XToolkit"; fi AWT_TOOLKIT=XToolkit ${TESTJAVA}/bin/java ${TESTVMOPTS} \ - -XaddExports:java.desktop/sun.awt=ALL-UNNAMED \ - -XaddExports:java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \ + --add-exports java.desktop/sun.awt=ALL-UNNAMED \ + --add-exports java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \ -Djava.awt.headless=true \ TestWrapped sun.awt.X11.XToolkit status=$? @@ -195,16 +195,16 @@ Darwin) ${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.awt.headless=true \ - -XaddExports:java.desktop/sun.awt=ALL-UNNAMED \ - -XaddExports:java.desktop/sun.lwawt.macosx=ALL-UNNAMED ${CP} \ + --add-exports java.desktop/sun.awt=ALL-UNNAMED \ + --add-exports java.desktop/sun.lwawt.macosx=ALL-UNNAMED ${CP} \ TestWrapped sun.lwawt.macosx.LWCToolkit status=$? if [ ! $status -eq "0" ]; then fail "Test FAILED: toolkit wrapped into HeadlessToolkit is not an instance of sun.lwawt.macosx.LWCToolkit"; fi ${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.awt.headless=true \ - -XaddExports:java.desktop/sun.awt=ALL-UNNAMED \ - -XaddExports:java.desktop/sun.lwawt.macosx=ALL-UNNAMED ${CP} \ + --add-exports java.desktop/sun.awt=ALL-UNNAMED \ + --add-exports java.desktop/sun.lwawt.macosx=ALL-UNNAMED ${CP} \ -Dawt.toolkit=sun.lwawt.macosx.LWCToolkit \ TestWrapped sun.lwawt.macosx.LWCToolkit status=$? --- old/jdk/test/java/awt/xembed/server/RunTestXEmbed.java 2016-08-08 16:31:52.000000000 -0700 +++ new/jdk/test/java/awt/xembed/server/RunTestXEmbed.java 2016-08-08 16:31:51.000000000 -0700 @@ -73,10 +73,11 @@ enva[ind++] = "AWT_TOOLKIT=sun.awt.X11.XToolkit"; } } - Process proc = Runtime.getRuntime().exec(java_home + - "/bin/java -XaddExports:java.desktop/sun.awt.X11=ALL-UNNAMED -Dawt.toolkit=sun.awt.X11.XToolkit TesterClient " - + test.getName() + " " + window + buf, - enva); + Process proc = Runtime.getRuntime(). + exec(java_home + + "/bin/java --add-exports java.desktop/sun.awt.X11=ALL-UNNAMED -Dawt.toolkit=sun.awt.X11.XToolkit TesterClient " + + test.getName() + " " + window + buf, + enva); System.err.println("Test for " + test.getName() + " has started."); log.fine("Test for " + test.getName() + " has started."); new InputReader(proc.getInputStream()); --- old/jdk/test/java/awt/xembed/server/TestXEmbedServerJava.java 2016-08-08 16:31:55.000000000 -0700 +++ new/jdk/test/java/awt/xembed/server/TestXEmbedServerJava.java 2016-08-08 16:31:54.000000000 -0700 @@ -84,11 +84,11 @@ } if (hasModules) { System.out.println(java_home + - "/bin/java -XaddExports:java.desktop/sun.awt.X11=ALL-UNNAMED "+ - "-XaddExports:java.desktop/sun.awt=ALL-UNNAMED JavaClient " + window); + "/bin/java --add-exports java.desktop/sun.awt.X11=ALL-UNNAMED "+ + "--add-exports java.desktop/sun.awt=ALL-UNNAMED JavaClient " + window); return Runtime.getRuntime().exec(java_home + - "/bin/java -XaddExports:java.desktop/sun.awt.X11=ALL-UNNAMED "+ - "-XaddExports:java.desktop/sun.awt=ALL-UNNAMED JavaClient " + window); + "/bin/java --add-exports java.desktop/sun.awt.X11=ALL-UNNAMED "+ + "--add-exports java.desktop/sun.awt=ALL-UNNAMED JavaClient " + window); }else{ System.out.println(java_home + "/bin/java JavaClient " + window); return Runtime.getRuntime().exec(java_home + "/bin/java JavaClient " + window); --- old/jdk/test/java/beans/XMLDecoder/8028054/TestConstructorFinder.java 2016-08-08 16:31:57.000000000 -0700 +++ new/jdk/test/java/beans/XMLDecoder/8028054/TestConstructorFinder.java 2016-08-08 16:31:56.000000000 -0700 @@ -39,7 +39,7 @@ * java.corba * java.xml.bind * @compile -XDignore.symbol.file TestConstructorFinder.java - * @run main/othervm -addmods java.activation -addmods java.transaction -addmods java.corba -addmods java.xml.bind TestConstructorFinder + * @run main/othervm --add-modules=java.activation,java.transaction,java.corba,java.xml.bind TestConstructorFinder */ public class TestConstructorFinder { --- old/jdk/test/java/beans/XMLDecoder/8028054/TestMethodFinder.java 2016-08-08 16:32:00.000000000 -0700 +++ new/jdk/test/java/beans/XMLDecoder/8028054/TestMethodFinder.java 2016-08-08 16:31:59.000000000 -0700 @@ -39,7 +39,7 @@ * java.corba * java.xml.bind * @compile -XDignore.symbol.file TestMethodFinder.java - * @run main/othervm -addmods java.activation -addmods java.transaction -addmods java.corba -addmods java.xml.bind TestMethodFinder + * @run main/othervm --add-modules=java.activation,java.transaction,java.corba,java.xml.bind TestMethodFinder */ public class TestMethodFinder { --- old/jdk/test/java/lang/Class/forName/modules/TestDriver.java 2016-08-08 16:32:02.000000000 -0700 +++ new/jdk/test/java/lang/Class/forName/modules/TestDriver.java 2016-08-08 16:32:01.000000000 -0700 @@ -65,7 +65,7 @@ public void setup() throws Exception { assertTrue(CompilerUtils.compile( MOD_SRC_DIR, MOD_DEST_DIR, - "-modulesourcepath", + "--module-source-path", MOD_SRC_DIR.toString())); copyDirectories(MOD_DEST_DIR.resolve("m1"), Paths.get("mods1")); @@ -76,8 +76,8 @@ public void test() throws Exception { String[] options = new String[] { "-cp", TEST_CLASSES, - "-mp", MOD_DEST_DIR.toString(), - "-addmods", String.join(",", modules), + "--module-path", MOD_DEST_DIR.toString(), + "--add-modules", String.join(",", modules), "-m", "m2/p2.test.Main" }; runTest(options); @@ -87,8 +87,8 @@ public void testUnnamedModule() throws Exception { String[] options = new String[] { "-cp", TEST_CLASSES, - "-mp", MOD_DEST_DIR.toString(), - "-addmods", String.join(",", modules), + "--module-path", MOD_DEST_DIR.toString(), + "--add-modules", String.join(",", modules), "TestMain" }; runTest(options); @@ -107,8 +107,8 @@ @Test public void testDeniedClassLoaderAccess() throws Exception { String[] options = new String[] { - "-mp", MOD_DEST_DIR.toString(), - "-addmods", String.join(",", modules), + "--module-path", MOD_DEST_DIR.toString(), + "--add-modules", String.join(",", modules), "-m", "m3/p3.NoGetClassLoaderAccess" }; assertTrue(executeTestJava(options) @@ -124,8 +124,8 @@ String[] options = new String[] { "-Djava.security.manager", "-Djava.security.policy=" + policyFile.toString(), - "-mp", MOD_DEST_DIR.toString(), - "-addmods", String.join(",", modules), + "--module-path", MOD_DEST_DIR.toString(), + "--add-modules", String.join(",", modules), "-m", "m3/p3.NoAccess" }; assertTrue(executeTestJava(options) --- old/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java 2016-08-08 16:32:05.000000000 -0700 +++ new/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java 2016-08-08 16:32:04.000000000 -0700 @@ -63,8 +63,8 @@ * loads all the classes in the BCL, get their declared fields, * and call setAccessible(false) followed by setAccessible(true); * @modules java.base/jdk.internal.module - * @run main/othervm -Djdk.launcher.addmods=ALL-SYSTEM FieldSetAccessibleTest UNSECURE - * @run main/othervm -Djdk.launcher.addmods=ALL-SYSTEM FieldSetAccessibleTest SECURE + * @run main/othervm --add-modules=ALL-SYSTEM FieldSetAccessibleTest UNSECURE + * @run main/othervm --add-modules=ALL-SYSTEM FieldSetAccessibleTest SECURE * * @author danielfuchs */ --- old/jdk/test/java/lang/Class/getResource/ResourcesTest.java 2016-08-08 16:32:07.000000000 -0700 +++ new/jdk/test/java/lang/Class/getResource/ResourcesTest.java 2016-08-08 16:32:06.000000000 -0700 @@ -60,15 +60,15 @@ compiled = CompilerUtils .compile(SRC_DIR, MODS_DIR, - "-modulesourcepath", SRC_DIR.toString()); + "--module-source-path", SRC_DIR.toString()); assertTrue(compiled); - // javac -mp mods -d classes Main.java + // javac --module-path mods -d classes Main.java compiled = CompilerUtils .compile(Paths.get(TEST_SRC, "Main.java"), CLASSES_DIR, - "-mp", MODS_DIR.toString(), - "-addmods", "m1,m2,m3"); + "--module-path", MODS_DIR.toString(), + "--add-modules", "m1,m2,m3"); assertTrue(compiled); } @@ -79,8 +79,8 @@ public void runTest() throws Exception { int exitValue - = executeTestJava("-mp", MODS_DIR.toString(), - "-addmods", "m1,m2,m3", + = executeTestJava("--module-path", MODS_DIR.toString(), + "--add-modules", "m1,m2,m3", "-cp", CLASSES_DIR.toString(), "Main") .outputTo(System.out) --- old/jdk/test/java/lang/ClassLoader/getResource/modules/ResourcesTest.java 2016-08-08 16:32:09.000000000 -0700 +++ new/jdk/test/java/lang/ClassLoader/getResource/modules/ResourcesTest.java 2016-08-08 16:32:08.000000000 -0700 @@ -56,19 +56,19 @@ public void compileAll() throws Exception { boolean compiled; - // javac -modulesource mods -d mods src/** + // javac --module-source-path mods -d mods src/** compiled = CompilerUtils .compile(SRC_DIR, MODS_DIR, - "-modulesourcepath", SRC_DIR.toString()); + "--module-source-path", SRC_DIR.toString()); assertTrue(compiled); - // javac -mp mods -d classes Main.java + // javac --module-path mods -d classes Main.java compiled = CompilerUtils .compile(Paths.get(TEST_SRC, "Main.java"), CLASSES_DIR, - "-mp", MODS_DIR.toString(), - "-addmods", "m1,m2,m3"); + "--module-path", MODS_DIR.toString(), + "--add-modules", "m1,m2,m3"); assertTrue(compiled); } @@ -77,8 +77,8 @@ */ public void runTest() throws Exception { int exitValue - = executeTestJava("-mp", MODS_DIR.toString(), - "-addmods", "m1,m2,m3", + = executeTestJava("--module-path", MODS_DIR.toString(), + "--add-modules", "m1,m2,m3", "-cp", CLASSES_DIR.toString(), "Main") .outputTo(System.out) --- old/jdk/test/java/lang/SecurityManager/modules/CustomSecurityManager.sh 2016-08-08 16:32:11.000000000 -0700 +++ new/jdk/test/java/lang/SecurityManager/modules/CustomSecurityManager.sh 2016-08-08 16:32:11.000000000 -0700 @@ -51,15 +51,15 @@ JAVA="$TESTJAVA/bin/java ${TESTVMOPTS}" mkdir -p mods -$JAVAC -d mods -modulesourcepath ${TESTSRC} `find ${TESTSRC}/m -name "*.java"` +$JAVAC -d mods --module-source-path ${TESTSRC} `find ${TESTSRC}/m -name "*.java"` mkdir -p classes $JAVAC -d classes ${TESTSRC}/Test.java -$JAVA -cp classes -mp mods -addmods m \ +$JAVA -cp classes --module-path mods --add-modules m \ -Djava.security.manager \ -Djava.security.policy=${TESTSRC}/test.policy Test -$JAVA -cp classes -mp mods -addmods m \ +$JAVA -cp classes --module-path mods --add-modules m \ -Djava.security.manager=p.CustomSecurityManager \ -Djava.security.policy=${TESTSRC}/test.policy Test --- old/jdk/test/java/lang/String/concat/WithSecurityManager.java 2016-08-08 16:32:13.000000000 -0700 +++ new/jdk/test/java/lang/String/concat/WithSecurityManager.java 2016-08-08 16:32:13.000000000 -0700 @@ -38,13 +38,13 @@ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT WithSecurityManager * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT WithSecurityManager * - * @run main/othervm -Xverify:all -limitmods java.base WithSecurityManager - * @run main/othervm -Xverify:all -limitmods java.base -Djava.lang.invoke.stringConcat=BC_SB WithSecurityManager - * @run main/othervm -Xverify:all -limitmods java.base -Djava.lang.invoke.stringConcat=BC_SB_SIZED WithSecurityManager - * @run main/othervm -Xverify:all -limitmods java.base -Djava.lang.invoke.stringConcat=MH_SB_SIZED WithSecurityManager - * @run main/othervm -Xverify:all -limitmods java.base -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT WithSecurityManager - * @run main/othervm -Xverify:all -limitmods java.base -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT WithSecurityManager - * @run main/othervm -Xverify:all -limitmods java.base -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT WithSecurityManager + * @run main/othervm -Xverify:all --limit-modules=java.base WithSecurityManager + * @run main/othervm -Xverify:all --limit-modules=java.base -Djava.lang.invoke.stringConcat=BC_SB WithSecurityManager + * @run main/othervm -Xverify:all --limit-modules=java.base -Djava.lang.invoke.stringConcat=BC_SB_SIZED WithSecurityManager + * @run main/othervm -Xverify:all --limit-modules=java.base -Djava.lang.invoke.stringConcat=MH_SB_SIZED WithSecurityManager + * @run main/othervm -Xverify:all --limit-modules=java.base -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT WithSecurityManager + * @run main/othervm -Xverify:all --limit-modules=java.base -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT WithSecurityManager + * @run main/othervm -Xverify:all --limit-modules=java.base -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT WithSecurityManager */ public class WithSecurityManager { public static void main(String[] args) throws Throwable { --- old/jdk/test/java/lang/instrument/MakeJAR2.sh 2016-08-08 16:32:16.000000000 -0700 +++ new/jdk/test/java/lang/instrument/MakeJAR2.sh 2016-08-08 16:32:15.000000000 -0700 @@ -87,7 +87,7 @@ cd .. ${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \ - -XaddExports:java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED ${AGENT}.java asmlib/*.java + --add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED ${AGENT}.java asmlib/*.java ${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -classpath .${PATHSEP}bootpath ${APP}.java echo "Manifest-Version: 1.0" > ${AGENT}.mf --- old/jdk/test/java/lang/invoke/modules/ModuleAccessControlTest.java 2016-08-08 16:32:18.000000000 -0700 +++ new/jdk/test/java/lang/invoke/modules/ModuleAccessControlTest.java 2016-08-08 16:32:17.000000000 -0700 @@ -60,7 +60,7 @@ for (String mn : modules) { Path msrc = SRC_DIR.resolve(mn); assertTrue(CompilerUtils - .compile(msrc, MODS_DIR, "-modulesourcepath", SRC_DIR.toString())); + .compile(msrc, MODS_DIR, "--module-source-path", SRC_DIR.toString())); } } @@ -69,7 +69,7 @@ */ @Test public void runTest() throws Exception { - int exitValue = executeTestJava("-mp", MODS_DIR.toString(), + int exitValue = executeTestJava("--module-path", MODS_DIR.toString(), "-m", "m1/p1.Main") .outputTo(System.out) .errorTo(System.out) --- old/jdk/test/java/lang/reflect/Layer/LayerAndLoadersTest.java 2016-08-08 16:32:20.000000000 -0700 +++ new/jdk/test/java/lang/reflect/Layer/LayerAndLoadersTest.java 2016-08-08 16:32:19.000000000 -0700 @@ -63,9 +63,9 @@ @BeforeTest public void setup() throws Exception { - // javac -d mods -modulesourcepath src src/** + // javac -d mods --module-source-path src src/** assertTrue(CompilerUtils.compile(SRC_DIR, MODS_DIR, - "-modulesourcepath", SRC_DIR.toString())); + "--module-source-path", SRC_DIR.toString())); } --- old/jdk/test/java/lang/reflect/Layer/src/m1/module-info.java 2016-08-08 16:32:22.000000000 -0700 +++ new/jdk/test/java/lang/reflect/Layer/src/m1/module-info.java 2016-08-08 16:32:22.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 --- old/jdk/test/java/lang/reflect/Module/AddExportsTest.java 2016-08-08 16:32:24.000000000 -0700 +++ new/jdk/test/java/lang/reflect/Module/AddExportsTest.java 2016-08-08 16:32:24.000000000 -0700 @@ -23,29 +23,44 @@ /** * @test - * @modules java.desktop - * @run main/othervm -XaddExports:java.desktop/sun.awt=java.base AddExportsTest - * @run main/othervm -XaddExports:java.desktop/sun.awt=ALL-UNNAMED AddExportsTest + * @modules java.base/jdk.internal.misc + * java.desktop + * @run main/othervm --add-exports=java.desktop/sun.awt=java.base AddExportsTest + * @run main/othervm --add-exports=java.desktop/sun.awt=ALL-UNNAMED AddExportsTest * @summary Test Module isExported methods with exports changed by -AddExportsTest */ import java.lang.reflect.Layer; import java.lang.reflect.Module; import java.util.Optional; +import java.util.stream.Stream; + +import jdk.internal.misc.VM; public class AddExportsTest { + /* + * jtreg sets -Dtest.modules system property to the internal APIs + * specified at @modules tag. The test will exclude --add-exports set + * for @modules. + */ + private static final String TEST_MODULES = System.getProperty("test.modules"); public static void main(String[] args) { - String addExports = System.getProperty("jdk.launcher.addexports.0"); - assertTrue(addExports != null, "Expected to be run with -XaddExports"); + Optional oaddExports = Stream.of(VM.getRuntimeArguments()) + .filter(arg -> arg.startsWith("--add-exports=")) + .filter(arg -> !arg.equals("--add-exports=" + TEST_MODULES + "=ALL-UNNAMED")) + .map(arg -> arg.substring("--add-exports=".length(), arg.length())) + .findFirst(); + + assertTrue(oaddExports.isPresent()); Layer bootLayer = Layer.boot(); Module unnamedModule = AddExportsTest.class.getModule(); assertFalse(unnamedModule.isNamed()); - for (String expr : addExports.split(",")) { + for (String expr : oaddExports.get().split(",")) { String[] s = expr.split("="); assertTrue(s.length == 2); --- old/jdk/test/java/lang/reflect/Module/access/AccessTest.java 2016-08-08 16:32:26.000000000 -0700 +++ new/jdk/test/java/lang/reflect/Module/access/AccessTest.java 2016-08-08 16:32:26.000000000 -0700 @@ -72,8 +72,8 @@ */ public void runTest() throws Exception { int exitValue - = executeTestJava("-mp", MODS_DIR.toString(), - "-addmods", "target", + = executeTestJava("--module-path", MODS_DIR.toString(), + "--add-modules", "target", "-m", "test/test.Main") .outputTo(System.out) .errorTo(System.out) --- old/jdk/test/java/lang/reflect/Proxy/ProxyClassAccessTest.java 2016-08-08 16:32:28.000000000 -0700 +++ new/jdk/test/java/lang/reflect/Proxy/ProxyClassAccessTest.java 2016-08-08 16:32:28.000000000 -0700 @@ -64,7 +64,7 @@ public void compileAll() throws Exception { for (String mn : modules) { Path msrc = SRC_DIR.resolve(mn); - assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "-modulesourcepath", SRC_DIR.toString())); + assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "--module-source-path", SRC_DIR.toString())); } } @@ -73,7 +73,7 @@ */ @Test public void runTest() throws Exception { - int exitValue = executeTestJava("-mp", MODS_DIR.toString(), + int exitValue = executeTestJava("--module-path", MODS_DIR.toString(), "-m", "test/jdk.test.ProxyClassAccess") .outputTo(System.out) .errorTo(System.out) --- old/jdk/test/java/lang/reflect/Proxy/ProxyLayerTest.java 2016-08-08 16:32:31.000000000 -0700 +++ new/jdk/test/java/lang/reflect/Proxy/ProxyLayerTest.java 2016-08-08 16:32:30.000000000 -0700 @@ -65,7 +65,7 @@ public void compileAll() throws Exception { for (String mn : modules) { Path msrc = SRC_DIR.resolve(mn); - assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "-modulesourcepath", SRC_DIR.toString())); + assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "--module-source-path", SRC_DIR.toString())); } } --- old/jdk/test/java/lang/reflect/Proxy/ProxyModuleMapping.java 2016-08-08 16:32:33.000000000 -0700 +++ new/jdk/test/java/lang/reflect/Proxy/ProxyModuleMapping.java 2016-08-08 16:32:33.000000000 -0700 @@ -38,7 +38,7 @@ Module unnamed = ld.getUnnamedModule(); new ProxyModuleMapping(unnamed, Runnable.class).test(); - // unnamed module gets access to sun.invoke package (e.g. via -XaddExports) + // unnamed module gets access to sun.invoke package (e.g. via --add-exports) new ProxyModuleMapping(sun.invoke.WrapperInstance.class).test(); Class modulePrivateIntf = Class.forName("sun.net.ProgressListener"); --- old/jdk/test/java/lang/reflect/Proxy/ProxyTest.java 2016-08-08 16:32:36.000000000 -0700 +++ new/jdk/test/java/lang/reflect/Proxy/ProxyTest.java 2016-08-08 16:32:35.000000000 -0700 @@ -61,7 +61,7 @@ public void compileAll() throws Exception { for (String mn : modules) { Path msrc = SRC_DIR.resolve(mn); - assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "-modulesourcepath", SRC_DIR.toString())); + assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "--module-source-path", SRC_DIR.toString())); } } @@ -71,7 +71,7 @@ @Test public void runTest() throws Exception { int exitValue = executeTestJava("-cp", CPATH_DIR.toString(), - "-mp", MODS_DIR.toString(), + "--module-path", MODS_DIR.toString(), "-m", "test/jdk.test.Main") .outputTo(System.out) .errorTo(System.out) --- old/jdk/test/java/net/Authenticator/B4933582.sh 2016-08-08 16:32:38.000000000 -0700 +++ new/jdk/test/java/net/Authenticator/B4933582.sh 2016-08-08 16:32:38.000000000 -0700 @@ -44,7 +44,7 @@ ;; esac -EXTRAOPTS="-XaddExports:java.base/sun.net.www=ALL-UNNAMED -XaddExports:java.base/sun.net.www.protocol.http=ALL-UNNAMED" +EXTRAOPTS="--add-exports java.base/sun.net.www=ALL-UNNAMED --add-exports java.base/sun.net.www.protocol.http=ALL-UNNAMED" export EXTRAOPTS ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRAOPTS} -d . \ --- old/jdk/test/java/net/SocketOption/OptionsTest.java 2016-08-08 16:32:41.000000000 -0700 +++ new/jdk/test/java/net/SocketOption/OptionsTest.java 2016-08-08 16:32:40.000000000 -0700 @@ -26,7 +26,7 @@ * @bug 8036979 8072384 8044773 * @run main/othervm -Xcheck:jni OptionsTest * @run main/othervm -Xcheck:jni -Djava.net.preferIPv4Stack=true OptionsTest - * @run main/othervm -limitmods java.base OptionsTest + * @run main/othervm --limit-modules=java.base OptionsTest */ import java.lang.reflect.Method; --- old/jdk/test/java/net/SocketOption/UnsupportedOptionsTest.java 2016-08-08 16:32:43.000000000 -0700 +++ new/jdk/test/java/net/SocketOption/UnsupportedOptionsTest.java 2016-08-08 16:32:42.000000000 -0700 @@ -33,7 +33,7 @@ * @summary Test checks that UnsupportedOperationException for unsupported * SOCKET_OPTIONS is thrown by both getOption() and setOption() methods. * @run main UnsupportedOptionsTest - * @run main/othervm -limitmods java.base UnsupportedOptionsTest + * @run main/othervm --limit-modules=java.base UnsupportedOptionsTest */ public class UnsupportedOptionsTest { --- old/jdk/test/java/net/httpclient/http2/HpackDriver.java 2016-08-08 16:32:46.000000000 -0700 +++ new/jdk/test/java/net/httpclient/http2/HpackDriver.java 2016-08-08 16:32:45.000000000 -0700 @@ -29,12 +29,12 @@ * @compile/module=java.httpclient sun/net/httpclient/hpack/SpecHelper.java * @compile/module=java.httpclient sun/net/httpclient/hpack/TestHelper.java * @compile/module=java.httpclient sun/net/httpclient/hpack/BuffersTestingKit.java - * @run testng/othervm -XaddReads:java.httpclient=ALL-UNNAMED java.httpclient/sun.net.httpclient.hpack.BinaryPrimitivesTest - * @run testng/othervm -XaddReads:java.httpclient=ALL-UNNAMED java.httpclient/sun.net.httpclient.hpack.CircularBufferTest - * @run testng/othervm -XaddReads:java.httpclient=ALL-UNNAMED java.httpclient/sun.net.httpclient.hpack.DecoderTest - * @run testng/othervm -XaddReads:java.httpclient=ALL-UNNAMED java.httpclient/sun.net.httpclient.hpack.EncoderTest - * @run testng/othervm -XaddReads:java.httpclient=ALL-UNNAMED java.httpclient/sun.net.httpclient.hpack.HeaderTableTest - * @run testng/othervm -XaddReads:java.httpclient=ALL-UNNAMED java.httpclient/sun.net.httpclient.hpack.HuffmanTest - * @run testng/othervm -XaddReads:java.httpclient=ALL-UNNAMED java.httpclient/sun.net.httpclient.hpack.TestHelper + * @run testng/othervm java.httpclient/sun.net.httpclient.hpack.BinaryPrimitivesTest + * @run testng/othervm java.httpclient/sun.net.httpclient.hpack.CircularBufferTest + * @run testng/othervm java.httpclient/sun.net.httpclient.hpack.DecoderTest + * @run testng/othervm java.httpclient/sun.net.httpclient.hpack.EncoderTest + * @run testng/othervm java.httpclient/sun.net.httpclient.hpack.HeaderTableTest + * @run testng/othervm java.httpclient/sun.net.httpclient.hpack.HuffmanTest + * @run testng/othervm java.httpclient/sun.net.httpclient.hpack.TestHelper */ public class HpackDriver { } --- old/jdk/test/java/nio/channels/DatagramChannel/SocketOptionTests.java 2016-08-08 16:32:48.000000000 -0700 +++ new/jdk/test/java/nio/channels/DatagramChannel/SocketOptionTests.java 2016-08-08 16:32:48.000000000 -0700 @@ -25,7 +25,7 @@ * @bug 4640544 8044773 * @summary Unit test for setOption/getOption/options methods * @run main SocketOptionTests - * @run main/othervm -limitmods java.base SocketOptionTests + * @run main/othervm --limit-modules=java.base SocketOptionTests */ import java.nio.*; --- old/jdk/test/java/nio/channels/ServerSocketChannel/SocketOptionTests.java 2016-08-08 16:32:50.000000000 -0700 +++ new/jdk/test/java/nio/channels/ServerSocketChannel/SocketOptionTests.java 2016-08-08 16:32:50.000000000 -0700 @@ -26,7 +26,7 @@ * @summary Unit test for ServerSocketChannel setOption/getOption/options * methods. * @run main SocketOptionTests - * @run main/othervm -limitmods java.base SocketOptionTests + * @run main/othervm --limit-modules=java.base SocketOptionTests */ import java.nio.*; --- old/jdk/test/java/nio/channels/SocketChannel/SocketOptionTests.java 2016-08-08 16:32:52.000000000 -0700 +++ new/jdk/test/java/nio/channels/SocketChannel/SocketOptionTests.java 2016-08-08 16:32:52.000000000 -0700 @@ -26,7 +26,7 @@ * @summary Unit test to check SocketChannel setOption/getOption/options * methods. * @run main SocketOptionTests - * @run main/othervm -limitmods java.base SocketOptionTests + * @run main/othervm --limit-modules=java.base SocketOptionTests */ import java.nio.*; --- old/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh 2016-08-08 16:32:54.000000000 -0700 +++ new/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh 2016-08-08 16:32:54.000000000 -0700 @@ -109,7 +109,7 @@ go() { echo '' - sh -xc "$JAVA ${TESTVMOPTS} -XaddExports:java.base/sun.nio.ch=ALL-UNNAMED $DFLAG \ + sh -xc "$JAVA ${TESTVMOPTS} --add-exports java.base/sun.nio.ch=ALL-UNNAMED $DFLAG \ $1 $2 $3 $4 $5 $6 $7 $8" 2>&1 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi } --- old/jdk/test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh 2016-08-08 16:32:56.000000000 -0700 +++ new/jdk/test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh 2016-08-08 16:32:56.000000000 -0700 @@ -52,9 +52,9 @@ $COMPILEJAVA/bin/jar ${TESTTOOLVMOPTS} cf ext/ext.jar -C $TESTCLASSES ExtLoadedImpl.class -C $TESTCLASSES ExtLoadedImpl_Stub.class -C $TESTCLASSES CheckLoader.class TESTVMOPTS="${TESTVMOPTS} \ - -XaddExports:java.rmi/sun.rmi.registry=ALL-UNNAMED \ - -XaddExports:java.rmi/sun.rmi.server=ALL-UNNAMED \ - -XaddExports:java.rmi/sun.rmi.transport=ALL-UNNAMED \ - -XaddExports:java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" + --add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED \ + --add-exports java.rmi/sun.rmi.server=ALL-UNNAMED \ + --add-exports java.rmi/sun.rmi.transport=ALL-UNNAMED \ + --add-exports java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" $TESTJAVA/bin/java ${TESTVMOPTS} -cp classes -Dtest.src=$TESTSRC -Dtest.classes=$TESTCLASSES -Djava.security.policy=$TESTSRC/security.policy -Djava.ext.dirs=ext ExtLoadedImplTest --- old/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java 2016-08-08 16:32:58.000000000 -0700 +++ new/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java 2016-08-08 16:32:58.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -24,7 +24,6 @@ /* * @test * @bug 4510355 - * @key intermittent * @summary ActivationGroup implementations cannot be downloaded by default; * Creates a custom activation group without setting a security manager * in activation group's descriptor. The custom activation group @@ -140,10 +139,10 @@ CommandEnvironment cmd = new ActivationGroupDesc.CommandEnvironment( null, new String[] { - "-XaddExports:java.rmi/sun.rmi.registry=ALL-UNNAMED", - "-XaddExports:java.rmi/sun.rmi.server=ALL-UNNAMED", - "-XaddExports:java.rmi/sun.rmi.transport=ALL-UNNAMED", - "-XaddExports:java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" }); + "--add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED", + "--add-exports=java.rmi/sun.rmi.server=ALL-UNNAMED", + "--add-exports=java.rmi/sun.rmi.transport=ALL-UNNAMED", + "--add-exports=java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" }); ActivationGroupDesc groupDesc = new ActivationGroupDesc("MyActivationGroupImpl", --- old/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted.java 2016-08-08 16:33:00.000000000 -0700 +++ new/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted.java 2016-08-08 16:33:00.000000000 -0700 @@ -121,11 +121,11 @@ System.err.println("Create activation group, in a new VM"); CommandEnvironment cmd = new ActivationGroupDesc.CommandEnvironment(null, new String[] { - "-XaddExports:java.base/sun.security.provider=ALL-UNNAMED", - "-XaddExports:java.rmi/sun.rmi.registry=ALL-UNNAMED", - "-XaddExports:java.rmi/sun.rmi.server=ALL-UNNAMED", - "-XaddExports:java.rmi/sun.rmi.transport=ALL-UNNAMED", - "-XaddExports:java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" }); + "--add-exports=java.base/sun.security.provider=ALL-UNNAMED", + "--add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED", + "--add-exports=java.rmi/sun.rmi.server=ALL-UNNAMED", + "--add-exports=java.rmi/sun.rmi.transport=ALL-UNNAMED", + "--add-exports=java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" }); ActivationGroupDesc groupDesc = new ActivationGroupDesc(p, cmd); --- old/jdk/test/java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java 2016-08-08 16:33:02.000000000 -0700 +++ new/jdk/test/java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java 2016-08-08 16:33:02.000000000 -0700 @@ -106,7 +106,7 @@ rmid = RMID.createRMID(System.out, System.err, true, true, TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT); rmid.addOptions( - "-XaddExports:java.base/sun.nio.ch=ALL-UNNAMED", + "--add-exports=java.base/sun.nio.ch=ALL-UNNAMED", "-Djava.nio.channels.spi.SelectorProvider=InheritedChannelNotServerSocket$SP"); rmid.start(); --- old/jdk/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java 2016-08-08 16:33:05.000000000 -0700 +++ new/jdk/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java 2016-08-08 16:33:04.000000000 -0700 @@ -93,7 +93,7 @@ rmid = RMID.createRMID(System.out, System.err, true, false, TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT); rmid.addOptions( - "-XaddExports:java.base/sun.nio.ch=ALL-UNNAMED", + "--add-exports=java.base/sun.nio.ch=ALL-UNNAMED", "-Djava.nio.channels.spi.SelectorProvider=RmidViaInheritedChannel$RmidSelectorProvider"); if (System.getProperty("os.name").startsWith("Windows") && System.getProperty("os.version").startsWith("5.")) --- old/jdk/test/java/rmi/module/ModuleTest.java 2016-08-08 16:33:07.000000000 -0700 +++ new/jdk/test/java/rmi/module/ModuleTest.java 2016-08-08 16:33:07.000000000 -0700 @@ -97,8 +97,8 @@ */ @Test public void testAllInModule() throws Exception { - assertEquals(executeTestJava("-mp", pathJoin(MTEST_JAR, CLIENT_JAR, SERVER_JAR), - "-addmods", "mclient,mserver", + assertEquals(executeTestJava("--module-path", pathJoin(MTEST_JAR, CLIENT_JAR, SERVER_JAR), + "--add-modules", "mclient,mserver", "-m", "mtest/" + DUMMY_MAIN) .outputTo(System.out) .errorTo(System.out) @@ -113,7 +113,7 @@ */ @Test public void testAppInModule() throws Exception { - assertEquals(executeTestJava("-mp", MTEST_JAR, + assertEquals(executeTestJava("--module-path", MTEST_JAR, "-cp", pathJoin(CLIENT_JAR, SERVER_JAR), "-m", "mtest/" + DUMMY_MAIN) .outputTo(System.out) @@ -129,8 +129,8 @@ */ @Test public void testAppInUnnamedModule() throws Exception { - assertEquals(executeTestJava("-mp", pathJoin(CLIENT_JAR, SERVER_JAR), - "-addmods", "mclient,mserver", + assertEquals(executeTestJava("--module-path", pathJoin(CLIENT_JAR, SERVER_JAR), + "--add-modules", "mclient,mserver", "-cp", MTEST_JAR, DUMMY_MAIN) .outputTo(System.out) @@ -146,8 +146,8 @@ */ @Test public void testClientInUnamedModule() throws Exception { - assertEquals(executeTestJava("-mp", pathJoin(MTEST_JAR, SERVER_JAR), - "-addmods", "mserver", + assertEquals(executeTestJava("--module-path", pathJoin(MTEST_JAR, SERVER_JAR), + "--add-modules", "mserver", "-cp", CLIENT_JAR, "-m", "mtest/" + DUMMY_MAIN) .outputTo(System.out) --- old/jdk/test/java/rmi/registry/readTest/readTest.sh 2016-08-08 16:33:09.000000000 -0700 +++ new/jdk/test/java/rmi/registry/readTest/readTest.sh 2016-08-08 16:33:09.000000000 -0700 @@ -99,10 +99,10 @@ esac # trailing / after code base is important for rmi codebase property. TESTVMOPTS="${TESTVMOPTS} \ - -XaddExports:java.rmi/sun.rmi.registry=ALL-UNNAMED \ - -XaddExports:java.rmi/sun.rmi.server=ALL-UNNAMED \ - -XaddExports:java.rmi/sun.rmi.transport=ALL-UNNAMED \ - -XaddExports:java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" + --add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED \ + --add-exports java.rmi/sun.rmi.server=ALL-UNNAMED \ + --add-exports java.rmi/sun.rmi.transport=ALL-UNNAMED \ + --add-exports java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp $TEST_CLASSPATH ${ARGS} -Djava.rmi.server.codebase=${FILEURL}$CODEBASE/ readTest > OUT.TXT 2>&1 & TEST_PID=$! #bulk of testcase - let it run for a while --- old/jdk/test/java/rmi/transport/checkFQDN/CheckFQDN.java 2016-08-08 16:33:11.000000000 -0700 +++ new/jdk/test/java/rmi/transport/checkFQDN/CheckFQDN.java 2016-08-08 16:33:11.000000000 -0700 @@ -123,10 +123,10 @@ propOption + property + equal + propertyValue + extraProp + - " -XaddExports:java.rmi/sun.rmi.registry=ALL-UNNAMED" + - " -XaddExports:java.rmi/sun.rmi.server=ALL-UNNAMED" + - " -XaddExports:java.rmi/sun.rmi.transport=ALL-UNNAMED" + - " -XaddExports:java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" + + " --add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED" + + " --add-exports=java.rmi/sun.rmi.server=ALL-UNNAMED" + + " --add-exports=java.rmi/sun.rmi.transport=ALL-UNNAMED" + + " --add-exports=java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" + " -Drmi.registry.port=" + REGISTRY_PORT, ""); --- old/jdk/test/java/rmi/transport/dgcDeadLock/DGCDeadLock.java 2016-08-08 16:33:13.000000000 -0700 +++ new/jdk/test/java/rmi/transport/dgcDeadLock/DGCDeadLock.java 2016-08-08 16:33:13.000000000 -0700 @@ -75,10 +75,10 @@ try { String options = " -Djava.security.policy=" + TestParams.defaultPolicy + - " -XaddExports:java.rmi/sun.rmi.registry=ALL-UNNAMED" + - " -XaddExports:java.rmi/sun.rmi.server=ALL-UNNAMED" + - " -XaddExports:java.rmi/sun.rmi.transport=ALL-UNNAMED" + - " -XaddExports:java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" + + " --add-exports java.rmi/sun.rmi.registry=ALL-UNNAMED" + + " --add-exports java.rmi/sun.rmi.server=ALL-UNNAMED" + + " --add-exports java.rmi/sun.rmi.transport=ALL-UNNAMED" + + " --add-exports java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" + " -Djava.rmi.dgc.leaseValue=500000" + " -Dsun.rmi.dgc.checkInterval=" + (HOLD_TARGET_TIME - 5000) + --- old/jdk/test/java/security/Provider/SecurityProviderModularTest.java 2016-08-08 16:33:15.000000000 -0700 +++ new/jdk/test/java/security/Provider/SecurityProviderModularTest.java 2016-08-08 16:33:15.000000000 -0700 @@ -317,7 +317,7 @@ vmArgs.put("-Duser.language=", "en"); vmArgs.put("-Duser.region=", "US"); if (addModName != null && sModuletype == MODULE_TYPE.AUTO) { - vmArgs.put("-addmods ", addModName); + vmArgs.put("--add-modules=", addModName); } // If mechanism selected to find the provider through // Security.getProvider() then use providerName/ProviderClassName based --- old/jdk/test/java/security/modules/ModularTest.java 2016-08-08 16:33:18.000000000 -0700 +++ new/jdk/test/java/security/modules/ModularTest.java 2016-08-08 16:33:17.000000000 -0700 @@ -137,7 +137,7 @@ final StringJoiner command = new StringJoiner(SPACE, SPACE, SPACE); vmArgs.forEach((key, value) -> command.add(key + value)); if (modulePath != null) { - command.add("-mp").add(modulePath.toFile().getCanonicalPath()); + command.add("--module-path").add(modulePath.toFile().getCanonicalPath()); } if (classPath != null && classPath.length() > 0) { command.add("-cp").add(classPath); --- old/jdk/test/java/security/testlibrary/Proc.java 2016-08-08 16:33:21.000000000 -0700 +++ new/jdk/test/java/security/testlibrary/Proc.java 2016-08-08 16:33:20.000000000 -0700 @@ -25,19 +25,19 @@ import java.io.File; import java.io.IOException; import java.io.InputStreamReader; -import java.net.URL; -import java.net.URLClassLoader; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.security.Permission; import java.util.ArrayList; +import java.util.Arrays; import java.util.Base64; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.stream.Stream; /** * This is a test library that makes writing a Java test that spawns multiple @@ -184,12 +184,9 @@ "java").getPath()); } - int n = 0; - String addexports; - while ((addexports = System.getProperty("jdk.launcher.addexports." + n)) != null) { - prop("jdk.launcher.addexports." + n, addexports); - n++; - } + Stream.of(jdk.internal.misc.VM.getRuntimeArguments()) + .filter(arg -> arg.startsWith("--add-exports=")) + .forEach(cmd::add); Collections.addAll(cmd, splitProperty("test.vm.opts")); Collections.addAll(cmd, splitProperty("test.java.opts")); --- old/jdk/test/java/util/Calendar/GenericTimeZoneNamesTest.sh 2016-08-08 16:33:23.000000000 -0700 +++ new/jdk/test/java/util/Calendar/GenericTimeZoneNamesTest.sh 2016-08-08 16:33:23.000000000 -0700 @@ -31,7 +31,7 @@ # This test is locale data-dependent and assumes that both JRE and CLDR # have the same geneic time zone names in English. -EXTRAOPTS="-XaddExports:java.base/sun.util.locale.provider=ALL-UNNAMED" +EXTRAOPTS="--add-exports java.base/sun.util.locale.provider=ALL-UNNAMED" STATUS=0 echo "Locale providers: default" if ! ${TESTJAVA}/bin/java -esa ${TESTVMOPTS} ${EXTRAOPTS} -cp "${TESTCLASSES}" GenericTimeZoneNamesTest en-US; then --- old/jdk/test/java/util/Formatter/Basic.sh 2016-08-08 16:33:25.000000000 -0700 +++ new/jdk/test/java/util/Formatter/Basic.sh 2016-08-08 16:33:25.000000000 -0700 @@ -23,7 +23,7 @@ # -EXTRAOPTS="-XaddExports:java.base/jdk.internal.math=ALL-UNNAMED" +EXTRAOPTS="--add-exports java.base/jdk.internal.math=ALL-UNNAMED" ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRAOPTS} -cp ${TESTSRC} -d . \ ${TESTSRC}/Basic.java --- old/jdk/test/java/util/Locale/LocaleProviders.sh 2016-08-08 16:33:27.000000000 -0700 +++ new/jdk/test/java/util/Locale/LocaleProviders.sh 2016-08-08 16:33:27.000000000 -0700 @@ -122,8 +122,8 @@ tznp8013086 EOF -EXTRAOPTS="-XaddExports:java.base/sun.util.locale=ALL-UNNAMED \ - -XaddExports:java.base/sun.util.locale.provider=ALL-UNNAMED" +EXTRAOPTS="--add-exports java.base/sun.util.locale=ALL-UNNAMED \ + --add-exports java.base/sun.util.locale.provider=ALL-UNNAMED" ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${SPIDIR}${FS}dest \ ${SPIDIR}${FS}src${FS}tznp.java \ --- old/jdk/test/java/util/PluggableLocale/ExecTest.sh 2016-08-08 16:33:30.000000000 -0700 +++ new/jdk/test/java/util/PluggableLocale/ExecTest.sh 2016-08-08 16:33:29.000000000 -0700 @@ -93,8 +93,8 @@ esac -EXTRA_OPTS="-XaddExports:java.base/sun.util.locale.provider=ALL-UNNAMED \ - -XaddExports:java.base/sun.util.resources=ALL-UNNAMED" +EXTRA_OPTS="--add-exports java.base/sun.util.locale.provider=ALL-UNNAMED \ + --add-exports java.base/sun.util.resources=ALL-UNNAMED" # compile cp ${TESTSRC}${FS}ProviderTest.java . --- old/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh 2016-08-08 16:33:32.000000000 -0700 +++ new/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh 2016-08-08 16:33:31.000000000 -0700 @@ -68,7 +68,7 @@ ${TESTJAVA}/bin/jar xf ${TESTSRC}/awtres.jar echo -${TESTJAVA}/bin/java ${TESTVMOPTS} -Xpatch:java.desktop=${PATCHDIR}/java.desktop \ +${TESTJAVA}/bin/java ${TESTVMOPTS} --patch-module java.desktop=${PATCHDIR}/java.desktop \ -cp ${TESTCLASSES} Bug6299235Test if [ $? -ne 0 ] --- old/jdk/test/java/util/ResourceBundle/modules/appbasic/appbasic.sh 2016-08-08 16:33:34.000000000 -0700 +++ new/jdk/test/java/util/ResourceBundle/modules/appbasic/appbasic.sh 2016-08-08 16:33:33.000000000 -0700 @@ -47,7 +47,7 @@ mkdir -p mods/$B CLASSES="`find $TESTSRC/src/$B -name '*.java'`" if [ "x$CLASSES" != x ]; then - $JAVAC -g -d mods -modulesourcepath $TESTSRC/src -cp mods/test $CLASSES + $JAVAC -g -d mods --module-source-path $TESTSRC/src -cp mods/test $CLASSES fi PROPS="`(cd $TESTSRC/src/$B; find . -name '*.properties')`" if [ "x$PROPS" != x ]; then @@ -61,8 +61,8 @@ done mkdir -p mods/test -$JAVAC -g -d mods -modulesourcepath $TESTSRC/src `find $TESTSRC/src/test -name "*.java"` +$JAVAC -g -d mods --module-source-path $TESTSRC/src `find $TESTSRC/src/test -name "*.java"` -$JAVA -mp mods -m test/jdk.test.Main de fr ja zh-tw en de +$JAVA -p mods -m test/jdk.test.Main de fr ja zh-tw en de exit $? --- old/jdk/test/java/util/ResourceBundle/modules/appbasic2/appbasic2.sh 2016-08-08 16:33:36.000000000 -0700 +++ new/jdk/test/java/util/ResourceBundle/modules/appbasic2/appbasic2.sh 2016-08-08 16:33:35.000000000 -0700 @@ -47,7 +47,7 @@ mkdir -p mods/$B CLASSES="`find $TESTSRC/src/$B -name '*.java'`" if [ "x$CLASSES" != x ]; then - $JAVAC -g -d mods -modulesourcepath $TESTSRC/src -cp mods/test $CLASSES + $JAVAC -g -d mods --module-source-path $TESTSRC/src -cp mods/test $CLASSES fi PROPS="`(cd $TESTSRC/src/$B; find . -name '*.properties')`" if [ "x$PROPS" != x ]; then @@ -61,8 +61,8 @@ done mkdir -p mods/test -$JAVAC -g -d mods -modulesourcepath $TESTSRC/src `find $TESTSRC/src/test -name "*.java"` +$JAVAC -g -d mods --module-source-path $TESTSRC/src `find $TESTSRC/src/test -name "*.java"` -$JAVA -mp mods -m test/jdk.test.Main de fr ja zh-tw en de +$JAVA -p mods -m test/jdk.test.Main de fr ja zh-tw en de exit $? --- old/jdk/test/java/util/ResourceBundle/modules/basic/basic.sh 2016-08-08 16:33:38.000000000 -0700 +++ new/jdk/test/java/util/ResourceBundle/modules/basic/basic.sh 2016-08-08 16:33:37.000000000 -0700 @@ -52,7 +52,7 @@ mkdir -p mods/$B CLASSES="`find $TESTSRC/src/$B -name '*.java'`" if [ "x$CLASSES" != x ]; then - $JAVAC -g -d mods -modulesourcepath $TESTSRC/src $CP $CLASSES + $JAVAC -g -d mods --module-source-path $TESTSRC/src $CP $CLASSES fi PROPS="`(cd $TESTSRC/src/$B; find . -name '*.properties')`" if [ "x$PROPS" != x ]; then @@ -67,7 +67,7 @@ done mkdir -p mods/test -$JAVAC -g -cp mods/mainbundles -d mods -modulesourcepath $TESTSRC/src \ +$JAVAC -g -cp mods/mainbundles -d mods --module-source-path $TESTSRC/src \ `find $TESTSRC/src/test -name "*.java"` # Create a jar to be added to the class path. Expected only properties files are @@ -81,9 +81,9 @@ STATUS=0 echo "jdk.test.Main should load bundles using ResourceBundleProviders." -$JAVA -mp mods -m test/jdk.test.Main de fr ja ja-jp zh-tw en de ja-jp || STATUS=1 +$JAVA -p mods -m test/jdk.test.Main de fr ja ja-jp zh-tw en de ja-jp || STATUS=1 echo "jdk.test.Main should NOT load bundles from the jar file specified by the class-path." -$JAVA -cp extra.jar -mp mods -m test/jdk.test.Main es vi && STATUS=1 +$JAVA -cp extra.jar -p mods -m test/jdk.test.Main es vi && STATUS=1 exit $STATUS --- old/jdk/test/java/util/ResourceBundle/modules/modlocal/modlocal.sh 2016-08-08 16:33:39.000000000 -0700 +++ new/jdk/test/java/util/ResourceBundle/modules/modlocal/modlocal.sh 2016-08-08 16:33:39.000000000 -0700 @@ -57,7 +57,7 @@ done fi -$JAVAC -g -d mods -modulesourcepath $TESTSRC/src \ +$JAVAC -g -d mods --module-source-path $TESTSRC/src \ -cp mods/bundles `find $TESTSRC/src/test -name "*.java"` # Create a jar to be added to the class path. Expected properties files are @@ -69,9 +69,9 @@ STATUS=0 echo 'jdk.test.Main should load bundles local to named module "test".' -$JAVA -mp mods -m test/jdk.test.Main de fr ja zh-tw en de || STATUS=1 +$JAVA -p mods -m test/jdk.test.Main de fr ja zh-tw en de || STATUS=1 echo "jdk.test.Main should NOT load bundles from the jar file specified by the class-path." -$JAVA -cp extra.jar -mp mods -m test/jdk.test.Main vi && STATUS=1 +$JAVA -cp extra.jar -p mods -m test/jdk.test.Main vi && STATUS=1 exit $STATUS --- old/jdk/test/java/util/ResourceBundle/modules/security/TestPermission.java 2016-08-08 16:33:42.000000000 -0700 +++ new/jdk/test/java/util/ResourceBundle/modules/security/TestPermission.java 2016-08-08 16:33:41.000000000 -0700 @@ -59,7 +59,7 @@ public void compileAll() throws Exception { for (String mn : modules) { Path msrc = SRC_DIR.resolve(mn); - assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "-modulesourcepath", SRC_DIR.toString())); + assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "--module-source-path", SRC_DIR.toString())); } } @@ -68,7 +68,7 @@ */ @Test public void runTest() throws Exception { - int exitValue = executeTestJava("-mp", MODS_DIR.toString(), + int exitValue = executeTestJava("--module-path", MODS_DIR.toString(), "-m", "test/jdk.test.Main") .outputTo(System.out) .errorTo(System.out) --- old/jdk/test/java/util/ResourceBundle/modules/simple/simple.sh 2016-08-08 16:33:44.000000000 -0700 +++ new/jdk/test/java/util/ResourceBundle/modules/simple/simple.sh 2016-08-08 16:33:43.000000000 -0700 @@ -50,7 +50,7 @@ mkdir -p mods/$B CLASSES="`find $TESTSRC/src/$B -name '*.java'`" if [ "x$CLASSES" != x ]; then - $JAVAC -g -d mods -modulesourcepath $TESTSRC/src $CLASSES + $JAVAC -g -d mods --module-source-path $TESTSRC/src $CLASSES fi PROPS="`(cd $TESTSRC/src/$B; find . -name '*.properties')`" if [ "x$PROPS" != x ]; then @@ -62,9 +62,9 @@ done fi -$JAVAC -g -d mods -modulesourcepath $TESTSRC/src \ +$JAVAC -g -d mods --module-source-path $TESTSRC/src \ -cp mods/bundles `find $TESTSRC/src/test -name "*.java"` -$JAVA -mp mods -m test/jdk.test.Main de fr ja zh-tw en de +$JAVA -p mods -m test/jdk.test.Main de fr ja zh-tw en de exit $? --- old/jdk/test/java/util/ResourceBundle/modules/visibility/visibility.sh 2016-08-08 16:33:46.000000000 -0700 +++ new/jdk/test/java/util/ResourceBundle/modules/visibility/visibility.sh 2016-08-08 16:33:46.000000000 -0700 @@ -57,7 +57,7 @@ mkdir -p mods/$M CLASSES="`find $TESTSRC/src/$M -name '*.java'`" if [ "x$CLASSES" != x ]; then - $JAVAC -g -d mods -modulesourcepath $TESTSRC/src $CLASSES + $JAVAC -g -d mods --module-source-path $TESTSRC/src $CLASSES fi PROPS="`(cd $TESTSRC/src/$M; find . -name '*.properties')`" if [ "x$PROPS" != x ]; then @@ -96,23 +96,23 @@ # jdk.test.resources.{classes,props}.* are available only to named module "test" # by ResourceBundleProvider. -runJava -mp mods -m test/jdk.test.TestWithNoModuleArg \ +runJava -p mods -m test/jdk.test.TestWithNoModuleArg \ jdk.test.resources.classes.MyResources true -runJava -mp mods -m test/jdk.test.TestWithNoModuleArg \ +runJava -p mods -m test/jdk.test.TestWithNoModuleArg \ jdk.test.resources.props.MyResources true -runJava -mp mods -m embargo/jdk.embargo.TestWithNoModuleArg \ +runJava -p mods -m embargo/jdk.embargo.TestWithNoModuleArg \ jdk.test.resources.classes.MyResources false -runJava -mp mods -m embargo/jdk.embargo.TestWithNoModuleArg \ +runJava -p mods -m embargo/jdk.embargo.TestWithNoModuleArg \ jdk.test.resources.props.MyResources false # Add mods/named.bundles to the class path. -runJava -cp mods/named.bundles -mp mods -m test/jdk.test.TestWithNoModuleArg \ +runJava -cp mods/named.bundles -p mods -m test/jdk.test.TestWithNoModuleArg \ jdk.test.resources.classes.MyResources true -runJava -cp mods/named.bundles -mp mods -m test/jdk.test.TestWithNoModuleArg \ +runJava -cp mods/named.bundles -p mods -m test/jdk.test.TestWithNoModuleArg \ jdk.test.resources.props.MyResources true -runJava -cp mods/named.bundles -mp mods -m embargo/jdk.embargo.TestWithNoModuleArg \ +runJava -cp mods/named.bundles -p mods -m embargo/jdk.embargo.TestWithNoModuleArg \ jdk.test.resources.classes.MyResources false -runJava -cp mods/named.bundles -mp mods -m embargo/jdk.embargo.TestWithNoModuleArg \ +runJava -cp mods/named.bundles -p mods -m embargo/jdk.embargo.TestWithNoModuleArg \ jdk.test.resources.props.MyResources false # Tests using jdk.test.TestWithUnnamedModuleArg and jdk.embargo.TestWithUnnamedModuleArg @@ -120,37 +120,37 @@ # jdk.test.resources.classes is exported to named module "test". # IllegalAccessException is thrown in ResourceBundle.Control.newBundle(). -runJava -mp mods -m test/jdk.test.TestWithUnnamedModuleArg \ +runJava -p mods -m test/jdk.test.TestWithUnnamedModuleArg \ jdk.test.resources.classes.MyResources false # jdk.test.resources.props is exported to named module "test". # loader.getResource() doesn't find jdk.test.resources.props.MyResources. -runJava -mp mods -m test/jdk.test.TestWithUnnamedModuleArg \ +runJava -p mods -m test/jdk.test.TestWithUnnamedModuleArg \ jdk.test.resources.props.MyResources false # IllegalAccessException is thrown in ResourceBundle.Control.newBundle(). -runJava -mp mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \ +runJava -p mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \ jdk.test.resources.classes.MyResources false # jdk.test.resources.props is exported to named module "test". # loader.getResource() doesn't find jdk.test.resources.props.MyResources. -runJava -mp mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \ +runJava -p mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \ jdk.test.resources.props.MyResources false # Add mods/named.bundles to the class path # IllegalAccessException is thrown in ResourceBundle.Control.newBundle(). -runJava -cp mods/named.bundles -mp mods -m test/jdk.test.TestWithUnnamedModuleArg \ +runJava -cp mods/named.bundles -p mods -m test/jdk.test.TestWithUnnamedModuleArg \ jdk.test.resources.classes.MyResources false # loader.getResource() finds jdk.test.resources.exported.props.MyResources. -runJava -cp mods/named.bundles -mp mods -m test/jdk.test.TestWithUnnamedModuleArg \ +runJava -cp mods/named.bundles -p mods -m test/jdk.test.TestWithUnnamedModuleArg \ jdk.test.resources.props.MyResources true # jdk.test.resources.exported.classes.MyResources is treated # as if the class is in an unnamed module. -runJava -cp mods/named.bundles -mp mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \ +runJava -cp mods/named.bundles -p mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \ jdk.test.resources.classes.MyResources true # loader.getResource() finds jdk.test.resources.exported.props.MyResources. -runJava -cp mods/named.bundles -mp mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \ +runJava -cp mods/named.bundles -p mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \ jdk.test.resources.props.MyResources true ################################################# @@ -160,23 +160,23 @@ # neither of which specifies an unnamed module with ResourceBundle.getBundle. # None of jdk.test.resources.exported.** is available to the named modules. -runJava -mp mods -m test/jdk.test.TestWithNoModuleArg \ +runJava -p mods -m test/jdk.test.TestWithNoModuleArg \ jdk.test.resources.exported.classes.MyResources false -runJava -mp mods -m test/jdk.test.TestWithNoModuleArg \ +runJava -p mods -m test/jdk.test.TestWithNoModuleArg \ jdk.test.resources.exported.props.MyResources false -runJava -mp mods -m embargo/jdk.embargo.TestWithNoModuleArg \ +runJava -p mods -m embargo/jdk.embargo.TestWithNoModuleArg \ jdk.test.resources.exported.classes.MyResources false -runJava -mp mods -m embargo/jdk.embargo.TestWithNoModuleArg \ +runJava -p mods -m embargo/jdk.embargo.TestWithNoModuleArg \ jdk.test.resources.exported.props.MyResources false # Add mods/exported.named.bundles to the class path. -runJava -cp mods/exported.named.bundles -mp mods -m test/jdk.test.TestWithNoModuleArg \ +runJava -cp mods/exported.named.bundles -p mods -m test/jdk.test.TestWithNoModuleArg \ jdk.test.resources.exported.classes.MyResources false -runJava -cp mods/exported.named.bundles -mp mods -m test/jdk.test.TestWithNoModuleArg \ +runJava -cp mods/exported.named.bundles -p mods -m test/jdk.test.TestWithNoModuleArg \ jdk.test.resources.exported.props.MyResources false -runJava -cp mods/exported.named.bundles -mp mods -m embargo/jdk.embargo.TestWithNoModuleArg \ +runJava -cp mods/exported.named.bundles -p mods -m embargo/jdk.embargo.TestWithNoModuleArg \ jdk.test.resources.exported.classes.MyResources false -runJava -cp mods/exported.named.bundles -mp mods -m embargo/jdk.embargo.TestWithNoModuleArg \ +runJava -cp mods/exported.named.bundles -p mods -m embargo/jdk.embargo.TestWithNoModuleArg \ jdk.test.resources.exported.props.MyResources false # Tests using jdk.test.TestWithUnnamedModuleArg and jdk.embargo.TestWithUnnamedModuleArg @@ -184,36 +184,36 @@ # loader.loadClass() doesn't find jdk.test.resources.exported.classes.MyResources # and throws a ClassNotFoundException. -runJava -mp mods -m test/jdk.test.TestWithUnnamedModuleArg \ +runJava -p mods -m test/jdk.test.TestWithUnnamedModuleArg \ jdk.test.resources.exported.classes.MyResources false # The properties files in jdk.test.resources.exported.props are not found with loader.getResource(). -runJava -mp mods -m test/jdk.test.TestWithUnnamedModuleArg \ +runJava -p mods -m test/jdk.test.TestWithUnnamedModuleArg \ jdk.test.resources.exported.props.MyResources false # loader.loadClass() doesn't find jdk.test.resources.exported.classes.MyResources # and throws a ClassNotFoundException. -runJava -mp mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \ +runJava -p mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \ jdk.test.resources.exported.classes.MyResources false # The properties files in jdk.test.resources.exported.props are not found # with loader.getResource(). -runJava -mp mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \ +runJava -p mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \ jdk.test.resources.exported.props.MyResources false # Add mods/exported.named.bundles to the class path. # jdk.test.resources.exported.classes.MyResources.getModule().isNamed() returns false. -runJava -cp mods/exported.named.bundles -mp mods -m test/jdk.test.TestWithUnnamedModuleArg \ +runJava -cp mods/exported.named.bundles -p mods -m test/jdk.test.TestWithUnnamedModuleArg \ jdk.test.resources.exported.classes.MyResources true # loader.getResource() finds jdk.test.resources.exported.props.MyResources. -runJava -cp mods/exported.named.bundles -mp mods -m test/jdk.test.TestWithUnnamedModuleArg \ +runJava -cp mods/exported.named.bundles -p mods -m test/jdk.test.TestWithUnnamedModuleArg \ jdk.test.resources.exported.props.MyResources true # jdk.test.resources.exported.classes.MyResources.getModule().isNamed() returns false. -runJava -cp mods/exported.named.bundles -mp mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \ +runJava -cp mods/exported.named.bundles -p mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \ jdk.test.resources.exported.classes.MyResources true # loader.getResource() finds jdk.test.resources.exported.props.MyResources. -runJava -cp mods/exported.named.bundles -mp mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \ +runJava -cp mods/exported.named.bundles -p mods -m embargo/jdk.embargo.TestWithUnnamedModuleArg \ jdk.test.resources.exported.props.MyResources true ####################################### --- old/jdk/test/java/util/ResourceBundle/modules/xmlformat/xmlformat.sh 2016-08-08 16:33:49.000000000 -0700 +++ new/jdk/test/java/util/ResourceBundle/modules/xmlformat/xmlformat.sh 2016-08-08 16:33:48.000000000 -0700 @@ -48,7 +48,7 @@ mkdir -p mods/$B CLASSES="`find $TESTSRC/src/$B -name '*.java'`" if [ "x$CLASSES" != x ]; then - $JAVAC -g -d mods -modulesourcepath $TESTSRC/src $CLASSES + $JAVAC -g -d mods --module-source-path $TESTSRC/src $CLASSES fi PROPS="`(cd $TESTSRC/src/$B; find . -name '*.xml')`" if [ "x$PROPS" != x ]; then @@ -60,9 +60,9 @@ done fi -$JAVAC -g -d mods -modulesourcepath $TESTSRC/src \ +$JAVAC -g -d mods --module-source-path $TESTSRC/src \ -cp mods/bundles `find $TESTSRC/src/test -name "*.java"` -$JAVA -mp mods -m test/jdk.test.Main de fr ja zh-tw en de +$JAVA -p mods -m test/jdk.test.Main de fr ja zh-tw en de exit $? --- old/jdk/test/java/util/ServiceLoader/modules/ServicesTest.java 2016-08-08 16:33:51.000000000 -0700 +++ new/jdk/test/java/util/ServiceLoader/modules/ServicesTest.java 2016-08-08 16:33:50.000000000 -0700 @@ -105,13 +105,13 @@ /** - * Run test with -modulepath. + * Run test with --module-path. * * BananaScriptEngine should be found. */ public void runWithModulePath() throws Exception { int exitValue - = executeTestJava("-mp", MODS_DIR.toString(), + = executeTestJava("--module-path", MODS_DIR.toString(), "-m", "test/test.Main", "BananaScriptEngine") .outputTo(System.out) @@ -123,13 +123,13 @@ /** - * Run test with -modulepath and -classpath. + * Run test with --module-path and -classpath. * * Both BananaScriptEngine and PearScriptEngine should be found */ public void runWithModulePathAndClassPath() throws Exception { int exitValue - = executeTestJava("-mp", MODS_DIR.toString(), + = executeTestJava("--module-path", MODS_DIR.toString(), "-cp", CLASSES_DIR.toString(), "-m", "test/test.Main", "BananaScriptEngine", "PearScriptEngine") --- old/jdk/test/java/util/logging/modules/GetResourceBundleTest.java 2016-08-08 16:33:53.000000000 -0700 +++ new/jdk/test/java/util/logging/modules/GetResourceBundleTest.java 2016-08-08 16:33:52.000000000 -0700 @@ -66,10 +66,10 @@ for (String mn : modules) { Path msrc = MOD_SRC_DIR.resolve(mn); assertTrue(CompilerUtils.compile(msrc, MOD_DEST_DIR, - "-modulesourcepath", MOD_SRC_DIR.toString())); + "--module-source-path", MOD_SRC_DIR.toString())); } assertTrue(CompilerUtils.compile(PKG_SRC_DIR, PKG_DEST_DIR, - "-modulepath", MOD_DEST_DIR.toString(), "-addmods", String.join(",", modules))); + "--module-path", MOD_DEST_DIR.toString(), "--add-modules", String.join(",", modules))); // copy resource files String[] files = { "m1/p1/resource/p.properties", "m2/p2/resource/p.properties" }; @@ -84,8 +84,8 @@ public void runWithoutSecurityManager() throws Exception { int exitValue = executeTestJava( "-cp", PKG_DEST_DIR.toString(), - "-mp", MOD_DEST_DIR.toString(), - "-addmods", String.join(",", modules), + "--module-path", MOD_DEST_DIR.toString(), + "--add-modules", String.join(",", modules), "p3.test.ResourceBundleTest") .outputTo(System.out) .errorTo(System.err) @@ -98,8 +98,8 @@ int exitValue = executeTestJava( "-Djava.security.manager", "-cp", PKG_DEST_DIR.toString(), - "-mp", MOD_DEST_DIR.toString(), - "-addmods", String.join(",", modules), + "--module-path", MOD_DEST_DIR.toString(), + "--add-modules", String.join(",", modules), "p3.test.ResourceBundleTest") .outputTo(System.out) .errorTo(System.err) --- old/jdk/test/javax/crypto/Cipher/CipherStreamClose.java 2016-08-08 16:33:55.000000000 -0700 +++ new/jdk/test/javax/crypto/Cipher/CipherStreamClose.java 2016-08-08 16:33:55.000000000 -0700 @@ -27,8 +27,8 @@ * @summary Make sure Cipher IO streams doesn't call extra doFinal if close() * is called multiple times. Additionally, verify the input and output streams * match with encryption and decryption with non-stream crypto. - * @compile -addmods java.xml.bind CipherStreamClose.java - * @run main/othervm -addmods java.xml.bind CipherStreamClose + * @modules java.xml.bind + * @run main CipherStreamClose */ import java.io.*; --- old/jdk/test/javax/imageio/plugins/external_plugin_tests/TestClassPathPlugin.sh 2016-08-08 16:33:58.000000000 -0700 +++ new/jdk/test/javax/imageio/plugins/external_plugin_tests/TestClassPathPlugin.sh 2016-08-08 16:33:57.000000000 -0700 @@ -86,7 +86,7 @@ # expect to find SimpReader on module path echo "Test modular jar .. " -$JAVA -mp $PLUGINDIR -cp $TESTDIR simptest.TestSIMPPlugin +$JAVA --module-path $PLUGINDIR -cp $TESTDIR simptest.TestSIMPPlugin if [ $? -ne 0 ]; then exception=1 @@ -94,7 +94,7 @@ fi echo "Test modular jar with security manager .." -$JAVA -Djava.security.manager -mp $PLUGINDIR -cp $TESTDIR simptest.TestSIMPPlugin +$JAVA -Djava.security.manager --module-path $PLUGINDIR -cp $TESTDIR simptest.TestSIMPPlugin if [ $? -ne 0 ]; then exception=1 echo "modular jar with security manager test failed: exception thrown!" --- old/jdk/test/javax/imageio/stream/StreamCloserLeak/run_test.sh 2016-08-08 16:34:00.000000000 -0700 +++ new/jdk/test/javax/imageio/stream/StreamCloserLeak/run_test.sh 2016-08-08 16:34:00.000000000 -0700 @@ -199,14 +199,14 @@ fi # Verify that all classloaders are destroyed -${TESTJAVA}/bin/java -XaddExports:java.desktop/sun.awt=ALL-UNNAMED ${TESTVMOPTS} -cp Test.jar test.Main +${TESTJAVA}/bin/java --add-exports java.desktop/sun.awt=ALL-UNNAMED ${TESTVMOPTS} -cp Test.jar test.Main if [ $? -ne 0 ] ; then fail "Test FAILED: some classloaders weren't destroyed." fi # Verify that ImageIO shutdown hook works correcly -${TESTJAVA}/bin/java -XaddExports:java.desktop/sun.awt=ALL-UNNAMED ${TESTVMOPTS} \ +${TESTJAVA}/bin/java --add-exports java.desktop/sun.awt=ALL-UNNAMED ${TESTVMOPTS} \ -cp Test.jar -DforgetSomeStreams=true test.Main if [ $? -ne 0 ] ; then fail "Test FAILED: some classloaders weren't destroyed of shutdown hook failed." --- old/jdk/test/javax/naming/module/basic.sh 2016-08-08 16:34:02.000000000 -0700 +++ new/jdk/test/javax/naming/module/basic.sh 2016-08-08 16:34:02.000000000 -0700 @@ -78,27 +78,27 @@ echo "\nPreparing the 'test' module..." mkdir -p mods/test -$JAVAC -d mods -modulesourcepath $TESTSRC/src `find $TESTSRC/src/test -name "*.java"` +$JAVAC -d mods --module-source-path $TESTSRC/src `find $TESTSRC/src/test -name "*.java"` echo "\nRunning with the 'java.desktop' module..." -$JAVA -Dtest.src=${TESTSRC} -mp mods -m test/test.StoreObject ldap://localhost/dc=ie,dc=oracle,dc=com +$JAVA -Dtest.src=${TESTSRC} -p mods -m test/test.StoreObject ldap://localhost/dc=ie,dc=oracle,dc=com echo "\nRunning with the 'person' module..." -$JAVA -Dtest.src=${TESTSRC} -mp mods -m test/test.StorePerson ldap://localhost/dc=ie,dc=oracle,dc=com +$JAVA -Dtest.src=${TESTSRC} -p mods -m test/test.StorePerson ldap://localhost/dc=ie,dc=oracle,dc=com echo "\nRunning with the 'fruit' module..." -$JAVA -Dtest.src=${TESTSRC} -mp mods -m test/test.StoreFruit ldap://localhost/dc=ie,dc=oracle,dc=com +$JAVA -Dtest.src=${TESTSRC} -p mods -m test/test.StoreFruit ldap://localhost/dc=ie,dc=oracle,dc=com echo "\nRunning with the 'hello' module..." -$JAVA -Dtest.src=${TESTSRC} -mp mods -m test/test.StoreRemote ldap://localhost/dc=ie,dc=oracle,dc=com +$JAVA -Dtest.src=${TESTSRC} -p mods -m test/test.StoreRemote ldap://localhost/dc=ie,dc=oracle,dc=com echo "\nRunning with the 'foo' module..." -$JAVA -Dtest.src=${TESTSRC} -mp mods -m test/test.ConnectWithFoo ldap://localhost/dc=ie,dc=oracle,dc=com +$JAVA -Dtest.src=${TESTSRC} -p mods -m test/test.ConnectWithFoo ldap://localhost/dc=ie,dc=oracle,dc=com echo "\nRunning with the 'authz' module..." -$JAVA -Dtest.src=${TESTSRC} -mp mods -m test/test.ConnectWithAuthzId ldap://localhost/dc=ie,dc=oracle,dc=com +$JAVA -Dtest.src=${TESTSRC} -p mods -m test/test.ConnectWithAuthzId ldap://localhost/dc=ie,dc=oracle,dc=com echo "\nRunning with the 'ldapv4' module..." -$JAVA -Dtest.src=${TESTSRC} -mp mods -m test/test.ReadByUrl ldap://localhost/dc=ie,dc=oracle,dc=com +$JAVA -Dtest.src=${TESTSRC} -p mods -m test/test.ReadByUrl ldap://localhost/dc=ie,dc=oracle,dc=com --- old/jdk/test/javax/rmi/PortableRemoteObject/8146975/RmiIiopReturnValueTest.java 2016-08-08 16:34:05.000000000 -0700 +++ new/jdk/test/javax/rmi/PortableRemoteObject/8146975/RmiIiopReturnValueTest.java 2016-08-08 16:34:04.000000000 -0700 @@ -25,18 +25,19 @@ * @test * @bug 8146975 * @summary test RMI-IIOP with value object return + * @modules java.corba * @library /lib/testlibrary * @build jdk.testlibrary.* - * @compile -addmods java.corba Test.java Test3.java Test4.java + * @compile Test.java Test3.java Test4.java * HelloInterface.java HelloServer.java * HelloClient.java HelloImpl.java _HelloImpl_Tie.java _HelloInterface_Stub.java * RmiIiopReturnValueTest.java - * @run main/othervm -addmods java.corba + * @run main/othervm * -Djava.naming.provider.url=iiop://localhost:5050 * -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory * RmiIiopReturnValueTest -port 5049 * @run main/othervm/secure=java.lang.SecurityManager/policy=jtreg.test.policy - * -addmods java.corba -Djava.naming.provider.url=iiop://localhost:5050 + * -Djava.naming.provider.url=iiop://localhost:5050 * -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory * RmiIiopReturnValueTest -port 5049 */ @@ -102,12 +103,12 @@ static void startRmiIiopServer() throws Exception { System.out.println("\nStarting RmiIiopServer"); - // java -addmods java.corba -cp . + // java --add-modules java.corba -cp . // -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory // -Djava.naming.provider.url=iiop://localhost:5050 HelloServer -port 5049 List commands = new ArrayList<>(); commands.add(RmiIiopReturnValueTest.JAVA); - commands.add("-addmods"); + commands.add("--add-modules"); commands.add("java.corba"); commands.add("-Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory"); commands.add("-Djava.naming.provider.url=iiop://localhost:5050"); --- old/jdk/test/javax/rmi/PortableRemoteObject/ConcurrentHashMapTest.java 2016-08-08 16:34:08.000000000 -0700 +++ new/jdk/test/javax/rmi/PortableRemoteObject/ConcurrentHashMapTest.java 2016-08-08 16:34:07.000000000 -0700 @@ -28,12 +28,12 @@ * @library /lib/testlibrary * @modules java.corba * @build jdk.testlibrary.* - * @compile -addmods java.corba Test.java HelloInterface.java HelloServer.java HelloClient.java + * @compile Test.java HelloInterface.java HelloServer.java HelloClient.java * HelloImpl.java _HelloImpl_Tie.java _HelloInterface_Stub.java ConcurrentHashMapTest.java - * @run main/othervm -addmods java.corba -Djava.naming.provider.url=iiop://localhost:1050 + * @run main/othervm -Djava.naming.provider.url=iiop://localhost:1050 * -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory ConcurrentHashMapTest * @run main/othervm/secure=java.lang.SecurityManager/policy=jtreg.test.policy - * -addmods java.corba -Djava.naming.provider.url=iiop://localhost:1050 + * -Djava.naming.provider.url=iiop://localhost:1050 * -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory ConcurrentHashMapTest * @key intermittent */ @@ -98,12 +98,12 @@ static void startRmiIiopServer() throws Exception { System.out.println("\nStarting RmiServer"); - // java -cp . -addmods java.corba + // java -cp . --add-modules java.corba // -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory // -Djava.naming.provider.url=iiop://localhost:1050 HelloServer List commands = new ArrayList<>(); commands.add(ConcurrentHashMapTest.JAVA); - commands.add("-addmods"); + commands.add("--add-modules"); commands.add("java.corba"); commands.add("-Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory"); commands.add("-Djava.naming.provider.url=iiop://localhost:1050"); --- old/jdk/test/javax/security/auth/login/modules/JaasModularClientTest.java 2016-08-08 16:34:11.000000000 -0700 +++ new/jdk/test/javax/security/auth/login/modules/JaasModularClientTest.java 2016-08-08 16:34:10.000000000 -0700 @@ -291,7 +291,7 @@ vmArgs.put("-Djava.security.auth.login.config=", SRC.resolve( "jaas.conf").toFile().getCanonicalPath()); if (addModName != null && sModuletype == MODULE_TYPE.AUTO) { - vmArgs.put("-addmods ", addModName); + vmArgs.put("--add-modules ", addModName); } return vmArgs; } --- old/jdk/test/javax/security/auth/login/modules/JaasModularDefaultHandlerTest.java 2016-08-08 16:34:13.000000000 -0700 +++ new/jdk/test/javax/security/auth/login/modules/JaasModularDefaultHandlerTest.java 2016-08-08 16:34:12.000000000 -0700 @@ -247,7 +247,7 @@ if (addModName != null && !(cModuleType == MODULE_TYPE.EXPLICIT && sModuletype == MODULE_TYPE.EXPLICIT)) { - vmArgs.put("-addmods ", addModName); + vmArgs.put("--add-modules=", addModName); } return vmArgs; } --- old/jdk/test/javax/smartcardio/CommandAPDUTest.java 2016-08-08 16:34:15.000000000 -0700 +++ new/jdk/test/javax/smartcardio/CommandAPDUTest.java 2016-08-08 16:34:15.000000000 -0700 @@ -26,8 +26,8 @@ * @bug 8049021 * @summary Test different constructors for CommandAPDU and check CLA,INS,NC,NE, * P1,and P2 - * @compile -addmods java.smartcardio CommandAPDUTest.java - * @run testng/othervm -addmods java.smartcardio CommandAPDUTest + * @compile --add-modules=java.smartcardio CommandAPDUTest.java + * @run testng/othervm --add-modules=java.smartcardio CommandAPDUTest */ import java.nio.ByteBuffer; import javax.smartcardio.CommandAPDU; --- old/jdk/test/javax/smartcardio/HistoricalBytes.java 2016-08-08 16:34:18.000000000 -0700 +++ new/jdk/test/javax/smartcardio/HistoricalBytes.java 2016-08-08 16:34:17.000000000 -0700 @@ -26,8 +26,8 @@ * @bug 6445367 * @summary Verify that ATR.getHistoricalBytes() works * @author Andreas Sterbenz - * @compile -addmods java.smartcardio HistoricalBytes.java - * @run main/othervm -addmods java.smartcardio HistoricalBytes + * @compile --add-modules=java.smartcardio HistoricalBytes.java + * @run main/othervm --add-modules=java.smartcardio HistoricalBytes */ import java.util.Arrays; --- old/jdk/test/javax/smartcardio/ResponseAPDUTest.java 2016-08-08 16:34:20.000000000 -0700 +++ new/jdk/test/javax/smartcardio/ResponseAPDUTest.java 2016-08-08 16:34:19.000000000 -0700 @@ -25,8 +25,8 @@ * @test * @bug 8049021 * @summary Construct ResponseAPDU from byte array and check NR< SW, SW1 and SW2 - * @compile -addmods java.smartcardio ResponseAPDUTest.java - * @run testng/othervm -addmods java.smartcardio ResponseAPDUTest + * @compile --add-modules=java.smartcardio ResponseAPDUTest.java + * @run testng/othervm --add-modules=java.smartcardio ResponseAPDUTest */ import javax.smartcardio.ResponseAPDU; import static org.testng.Assert.*; --- old/jdk/test/javax/smartcardio/Serialize.java 2016-08-08 16:34:22.000000000 -0700 +++ new/jdk/test/javax/smartcardio/Serialize.java 2016-08-08 16:34:21.000000000 -0700 @@ -26,8 +26,8 @@ * @bug 6445367 * @summary make sure serialization works * @author Andreas Sterbenz - * @compile -addmods java.smartcardio Serialize.java - * @run main/othervm -addmods java.smartcardio Serialize + * @compile --add-modules=java.smartcardio Serialize.java + * @run main/othervm --add-modules=java.smartcardio Serialize */ import java.io.*; --- old/jdk/test/javax/smartcardio/TerminalFactorySpiTest.java 2016-08-08 16:34:25.000000000 -0700 +++ new/jdk/test/javax/smartcardio/TerminalFactorySpiTest.java 2016-08-08 16:34:24.000000000 -0700 @@ -25,8 +25,8 @@ * @test * @bug 8049021 * @summary Test if we can write new provider for smart card - * @compile -addmods java.smartcardio TerminalFactorySpiTest.java - * @run main/othervm/java.security.policy=policy -addmods java.smartcardio TerminalFactorySpiTest + * @compile --add-modules=java.smartcardio TerminalFactorySpiTest.java + * @run main/othervm/java.security.policy=policy --add-modules=java.smartcardio TerminalFactorySpiTest */ import java.security.Provider; import java.security.Security; --- old/jdk/test/javax/smartcardio/TestCardPermission.java 2016-08-08 16:34:27.000000000 -0700 +++ new/jdk/test/javax/smartcardio/TestCardPermission.java 2016-08-08 16:34:26.000000000 -0700 @@ -26,8 +26,8 @@ * @bug 6293767 * @summary Test for the CardPermission class * @author Andreas Sterbenz - * @compile -addmods java.smartcardio TestCardPermission.java - * @run main/othervm -addmods java.smartcardio TestCardPermission + * @compile --add-modules=java.smartcardio TestCardPermission.java + * @run main/othervm --add-modules=java.smartcardio TestCardPermission */ import javax.smartcardio.*; --- old/jdk/test/javax/smartcardio/TestCommandAPDU.java 2016-08-08 16:34:29.000000000 -0700 +++ new/jdk/test/javax/smartcardio/TestCommandAPDU.java 2016-08-08 16:34:28.000000000 -0700 @@ -27,8 +27,8 @@ * @summary Test for the CommandAPDU class * @author Andreas Sterbenz * @key randomness - * @compile -addmods java.smartcardio TestCommandAPDU.java - * @run main/othervm -addmods java.smartcardio TestCommandAPDU + * @compile --add-modules=java.smartcardio TestCommandAPDU.java + * @run main/othervm --add-modules=java.smartcardio TestCommandAPDU */ import java.util.*; --- old/jdk/test/javax/transaction/testng/Driver.java 2016-08-08 16:34:31.000000000 -0700 +++ new/jdk/test/javax/transaction/testng/Driver.java 2016-08-08 16:34:31.000000000 -0700 @@ -24,14 +24,14 @@ /** * @test * @modules java.sql java.transaction - * @compile -addmods java.transaction + * @compile * test/transaction/InvalidTransactionExceptionTests.java * test/transaction/TransactionRequiredExceptionTests.java * test/transaction/TransactionRolledbackExceptionTests.java * test/transaction/XAExceptionTests.java * util/SerializedTransactionExceptions.java - * @run testng/othervm -addmods java.transaction test.transaction.InvalidTransactionExceptionTests - * @run testng/othervm -addmods java.transaction test.transaction.TransactionRequiredExceptionTests - * @run testng/othervm -addmods java.transaction test.transaction.TransactionRolledbackExceptionTests - * @run testng/othervm -addmods java.transaction util.SerializedTransactionExceptions + * @run testng/othervm test.transaction.InvalidTransactionExceptionTests + * @run testng/othervm test.transaction.TransactionRequiredExceptionTests + * @run testng/othervm test.transaction.TransactionRolledbackExceptionTests + * @run testng/othervm util.SerializedTransactionExceptions */ --- old/jdk/test/javax/xml/bind/JAXBContext/JAXBContextWithAbstractFactory.java 2016-08-08 16:34:34.000000000 -0700 +++ new/jdk/test/javax/xml/bind/JAXBContext/JAXBContextWithAbstractFactory.java 2016-08-08 16:34:33.000000000 -0700 @@ -33,8 +33,8 @@ * @bug 8150173 * @summary Verifies that a factory which inherit its createContext method * from an abstract subclass of JAXBContextFactory can be instantiated. - * @compile -addmods java.xml.bind JAXBContextWithAbstractFactory.java - * @run main/othervm -addmods java.xml.bind JAXBContextWithAbstractFactory + * @modules java.xml.bind + * @run main/othervm JAXBContextWithAbstractFactory */ public class JAXBContextWithAbstractFactory { private static JAXBContext tmp; --- old/jdk/test/javax/xml/bind/JAXBContext/JAXBContextWithLegacyFactory.java 2016-08-08 16:34:36.000000000 -0700 +++ new/jdk/test/javax/xml/bind/JAXBContext/JAXBContextWithLegacyFactory.java 2016-08-08 16:34:35.000000000 -0700 @@ -35,8 +35,8 @@ * @bug 8150173 * @summary Verifies that a JAXBContext can be created with a legacy * factory class that has static createContext methods. - * @compile -addmods java.xml.bind JAXBContextWithLegacyFactory.java - * @run main/othervm -addmods java.xml.bind JAXBContextWithLegacyFactory + * @modules java.xml.bind + * @run main/othervm JAXBContextWithLegacyFactory */ public class JAXBContextWithLegacyFactory { private static JAXBContext tmp; --- old/jdk/test/javax/xml/bind/JAXBContext/JAXBContextWithSubclassedFactory.java 2016-08-08 16:34:38.000000000 -0700 +++ new/jdk/test/javax/xml/bind/JAXBContext/JAXBContextWithSubclassedFactory.java 2016-08-08 16:34:37.000000000 -0700 @@ -36,8 +36,8 @@ * @bug 8150173 * @summary Verifies that a factory which inherit its createContext method * from a concrete subclass of JAXBContextFactory is be instantiated. - * @compile -addmods java.xml.bind JAXBContextWithSubclassedFactory.java - * @run main/othervm -addmods java.xml.bind JAXBContextWithSubclassedFactory + * @modules java.xml.bind + * @run main/othervm JAXBContextWithSubclassedFactory */ public class JAXBContextWithSubclassedFactory { static JAXBContext tmp; --- old/jdk/test/javax/xml/bind/jxc/8073872/SchemagenStackOverflow.java 2016-08-08 16:34:40.000000000 -0700 +++ new/jdk/test/javax/xml/bind/jxc/8073872/SchemagenStackOverflow.java 2016-08-08 16:34:39.000000000 -0700 @@ -26,9 +26,8 @@ * @bug 8073872 * @summary test that stackoverflow is not observable when element * references containing class - * @modules java.xml * @modules java.xml.bind - * @compile Foo.java + * @compile SchemagenStackOverflow.java Foo.java * @run testng/othervm SchemagenStackOverflow */ --- old/jdk/test/javax/xml/bind/marshal/8134111/UnmarshalTest.java 2016-08-08 16:34:41.000000000 -0700 +++ new/jdk/test/javax/xml/bind/marshal/8134111/UnmarshalTest.java 2016-08-08 16:34:41.000000000 -0700 @@ -26,9 +26,10 @@ * @bug 8134111 * @summary test that elements without namespace is ignored by unmarshaller * when elementFormDefault is set to QUALIFIED. - * @compile testTypes/package-info.java testTypes/Root.java - * testTypes/WhenType.java testTypes/ObjectFactory.java * @modules java.xml.bind + * @compile UnmarshalTest.java + * testTypes/package-info.java testTypes/Root.java + * testTypes/WhenType.java testTypes/ObjectFactory.java * @run testng/othervm UnmarshalTest */ --- old/jdk/test/javax/xml/bind/xjc/8032884/XjcOptionalPropertyTest.java 2016-08-08 16:34:43.000000000 -0700 +++ new/jdk/test/javax/xml/bind/xjc/8032884/XjcOptionalPropertyTest.java 2016-08-08 16:34:43.000000000 -0700 @@ -100,7 +100,7 @@ // Compile java classes with javac tool void compileXjcGeneratedClasses() throws Exception { JDKToolLauncher javacLauncher = JDKToolLauncher.createUsingTestJDK("javac"); - javacLauncher.addToolArg("-addmods"); + javacLauncher.addToolArg("--add-modules"); javacLauncher.addToolArg("java.xml.bind"); javacLauncher.addToolArg(xjcResultDir.resolve("Foo.java").toString()); System.out.println("Compiling xjc generated class: " + Arrays.asList(javacLauncher.getCommand())); --- old/jdk/test/javax/xml/bind/xjc/8145039/JaxbMarshallTest.java 2016-08-08 16:34:45.000000000 -0700 +++ new/jdk/test/javax/xml/bind/xjc/8145039/JaxbMarshallTest.java 2016-08-08 16:34:44.000000000 -0700 @@ -127,7 +127,7 @@ // Compile java classes with javac tool void compileXjcGeneratedClasses() throws Exception { JDKToolLauncher javacLauncher = JDKToolLauncher.createUsingTestJDK("javac"); - javacLauncher.addToolArg("-addmods"); + javacLauncher.addToolArg("--add-modules"); javacLauncher.addToolArg("java.xml.bind"); javacLauncher.addToolArg(xjcResultDir.resolve("ObjectFactory.java").toString()); javacLauncher.addToolArg(xjcResultDir.resolve("TypesLongList.java").toString()); --- old/jdk/test/javax/xml/jaxp/common/8035437/run.sh 2016-08-08 16:34:46.000000000 -0700 +++ new/jdk/test/javax/xml/jaxp/common/8035437/run.sh 2016-08-08 16:34:46.000000000 -0700 @@ -34,12 +34,12 @@ -d compile/java.xml -Xmodule:java.xml $TESTSRC/Document.java $TESTSRC/Node.java || exit 1 $COMPILEJAVA/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \ - -d exec/java.xml -Xpatch:java.xml=compile/java.xml -Xmodule:java.xml $TESTSRC/DocumentImpl.java || exit 2 + -d exec/java.xml --patch-module java.xml=compile/java.xml -Xmodule:java.xml $TESTSRC/DocumentImpl.java || exit 2 $COMPILEJAVA/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \ $TESTSRC/AbstractMethodErrorTest.java -d exec || exit 3 -$TESTJAVA/bin/java ${TESTVMOPTS} -Xpatch:java.xml=exec -cp exec AbstractMethodErrorTest || exit 4 +$TESTJAVA/bin/java ${TESTVMOPTS} --patch-module java.xml=exec -cp exec AbstractMethodErrorTest || exit 4 exit 0 --- old/jdk/test/javax/xml/soap/XmlTest.java 2016-08-08 16:34:48.000000000 -0700 +++ new/jdk/test/javax/xml/soap/XmlTest.java 2016-08-08 16:34:47.000000000 -0700 @@ -38,8 +38,8 @@ /* * @test - * @compile -addmods java.xml.ws XmlTest.java - * @run main/othervm -addmods java.xml.ws XmlTest + * @modules java.xml.ws + * @run main XmlTest * @summary tests JAF DataHandler can be instantiated; test serialize and * deserialize SOAP message containing xml attachment */ --- old/jdk/test/javax/xml/soap/spi/SAAJFactoryTest.java 2016-08-08 16:34:49.000000000 -0700 +++ new/jdk/test/javax/xml/soap/spi/SAAJFactoryTest.java 2016-08-08 16:34:49.000000000 -0700 @@ -50,28 +50,28 @@ * scenario14 javax.xml.soap.MessageFactory=saaj.factory.Valid saaj.factory.Valid2 - * * @modules java.xml.ws - * @compile -addmods java.xml.ws saaj/factory/Invalid.java saaj/factory/Valid.java + * @compile saaj/factory/Invalid.java saaj/factory/Valid.java * saaj/factory/Valid2.java saaj/factory/Valid3.java SAAJFactoryTest.java * - * @run main/othervm -addmods java.xml.ws + * @run main/othervm * SAAJFactoryTest com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl - scenario2 - - - * @run main/othervm -addmods java.xml.ws -Djavax.xml.soap.MessageFactory=saaj.factory.Valid + * @run main/othervm -Djavax.xml.soap.MessageFactory=saaj.factory.Valid * SAAJFactoryTest saaj.factory.Valid - scenario5 - - - * @run main/othervm -addmods java.xml.ws -Djavax.xml.soap.MessageFactory=saaj.factory.NonExisting + * @run main/othervm -Djavax.xml.soap.MessageFactory=saaj.factory.NonExisting * SAAJFactoryTest - javax.xml.soap.SOAPException scenario6 - - - * @run main/othervm -addmods java.xml.ws -Djavax.xml.soap.MessageFactory=saaj.factory.Invalid + * @run main/othervm -Djavax.xml.soap.MessageFactory=saaj.factory.Invalid * SAAJFactoryTest - javax.xml.soap.SOAPException scenario7 - - - * @run main/othervm -addmods java.xml.ws + * @run main/othervm * SAAJFactoryTest saaj.factory.Valid - scenario8 - saaj.factory.Valid - * @run main/othervm -addmods java.xml.ws + * @run main/othervm * SAAJFactoryTest saaj.factory.Valid - scenario9 - saaj.factory.Valid - * @run main/othervm -addmods java.xml.ws + * @run main/othervm * SAAJFactoryTest - javax.xml.soap.SOAPException scenario10 - saaj.factory.NonExisting - * @run main/othervm -addmods java.xml.ws + * @run main/othervm * SAAJFactoryTest - javax.xml.soap.SOAPException scenario11 - saaj.factory.Invalid scenario11 - saaj.factory.Invalid - * @run main/othervm -addmods java.xml.ws + * @run main/othervm * SAAJFactoryTest com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl - scenario12 - - - * @run main/othervm -addmods java.xml.ws + * @run main/othervm * SAAJFactoryTest saaj.factory.Valid - scenario15 - saaj.factory.Valid */ public class SAAJFactoryTest { --- old/jdk/test/javax/xml/ws/8043129/MailTest.java 2016-08-08 16:34:51.000000000 -0700 +++ new/jdk/test/javax/xml/ws/8043129/MailTest.java 2016-08-08 16:34:51.000000000 -0700 @@ -28,8 +28,7 @@ * @author mkos * @library javax.mail.jar * @modules java.xml.ws - * @compile -addmods java.xml.ws MailTest.java - * @run main/othervm -addmods java.xml.ws MailTest + * @run main MailTest */ import javax.activation.CommandMap; --- old/jdk/test/javax/xml/ws/clientjar/TestWsImport.java 2016-08-08 16:34:53.000000000 -0700 +++ new/jdk/test/javax/xml/ws/clientjar/TestWsImport.java 2016-08-08 16:34:53.000000000 -0700 @@ -25,8 +25,8 @@ * @test * @bug 8016271 8026405 * @summary wsimport -clientjar does not create portable jar on windows due to hardcoded '\' - * @compile -addmods java.xml.ws TestWsImport.java - * @run main/othervm -addmods java.xml.ws TestWsImport + * @modules java.xml.ws + * @run main TestWsImport */ import javax.xml.namespace.QName; --- old/jdk/test/javax/xml/ws/publish/WSTest.java 2016-08-08 16:34:54.000000000 -0700 +++ new/jdk/test/javax/xml/ws/publish/WSTest.java 2016-08-08 16:34:54.000000000 -0700 @@ -26,8 +26,7 @@ * @bug 8146086 * @summary Publishing two webservices on same port fails with "java.net.BindException: Address already in use" * @modules java.xml.ws - * @compile -addmods java.xml.ws WSTest.java - * @run main/othervm -addmods java.xml.ws WSTest + * @run main/othervm WSTest */ import javax.jws.WebMethod; import javax.jws.WebService; --- old/jdk/test/javax/xml/ws/xsanymixed/Test.java 2016-08-08 16:34:56.000000000 -0700 +++ new/jdk/test/javax/xml/ws/xsanymixed/Test.java 2016-08-08 16:34:56.000000000 -0700 @@ -28,8 +28,7 @@ * no white space changes and no changes to namespace prefixes * @modules java.xml.ws * @run shell compile-wsdl.sh - * @compile -addmods java.xml.ws Test.java - * @run main/othervm -addmods java.xml.ws Test + * @run main/othervm Test */ import com.sun.net.httpserver.HttpServer; --- old/jdk/test/jdk/internal/misc/VM/RuntimeArguments.java 2016-08-08 16:34:58.000000000 -0700 +++ new/jdk/test/jdk/internal/misc/VM/RuntimeArguments.java 2016-08-08 16:34:57.000000000 -0700 @@ -26,6 +26,8 @@ * @summary Basic test of VM::getRuntimeArguments * @library /lib/testlibrary * @modules java.base/jdk.internal.misc + * java.compact3 + * jdk.zipfs * @run testng RuntimeArguments */ @@ -45,21 +47,28 @@ public Object[][] options() { return new Object[][] { { // CLI options - List.of("-XaddExports:java.base/jdk.internal.misc=ALL-UNNAMED", - "-XaddExports:java.base/jdk.internal.perf=ALL-UNNAMED", - "-addmods", "jdk.zipfs"), + List.of("--add-exports", + "java.base/jdk.internal.misc=ALL-UNNAMED", + "--add-exports", + "java.base/jdk.internal.perf=ALL-UNNAMED", + "--add-modules", + "jdk.zipfs"), // expected runtime arguments - List.of("-Djdk.launcher.addexports.0=java.base/jdk.internal.misc=ALL-UNNAMED", - "-Djdk.launcher.addexports.1=java.base/jdk.internal.perf=ALL-UNNAMED", - "-Djdk.launcher.addmods=jdk.zipfs") + List.of("--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", + "--add-exports=java.base/jdk.internal.perf=ALL-UNNAMED", + "--add-modules=jdk.zipfs") }, { // CLI options - List.of("-XaddExports:java.base/jdk.internal.misc=ALL-UNNAMED", - "-addmods", "jdk.zipfs", - "-limitmods", "java.compact3"), + List.of("--add-exports", + "java.base/jdk.internal.misc=ALL-UNNAMED", + "--add-modules", + "jdk.zipfs", + "--limit-modules", + "java.compact3"), // expected runtime arguments - List.of("-Djdk.launcher.addexports.0=java.base/jdk.internal.misc=ALL-UNNAMED", - "-Djdk.launcher.addmods=jdk.zipfs", "-Djdk.launcher.limitmods=java.compact3") + List.of("--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", + "--add-modules=jdk.zipfs", + "--limit-modules=java.compact3"), }, }; }; --- old/jdk/test/jdk/internal/reflect/Reflection/GetCallerClassTest.sh 2016-08-08 16:34:59.000000000 -0700 +++ new/jdk/test/jdk/internal/reflect/Reflection/GetCallerClassTest.sh 2016-08-08 16:34:59.000000000 -0700 @@ -55,7 +55,7 @@ rm -rf ${BCP} mkdir ${BCP} -EXTRAOPTS="-XaddExports:java.base/jdk.internal.reflect=ALL-UNNAMED" +EXTRAOPTS="--add-exports java.base/jdk.internal.reflect=ALL-UNNAMED" # Compile GetCallerClass in bootclasspath ${COMPILEJAVA}/bin/javac ${TESTTOOLVMOPTS} ${EXTRAOPTS} \ --- old/jdk/test/jdk/modules/etc/VerifyModuleDelegation.java 2016-08-08 16:35:01.000000000 -0700 +++ new/jdk/test/jdk/modules/etc/VerifyModuleDelegation.java 2016-08-08 16:35:00.000000000 -0700 @@ -26,7 +26,7 @@ * @summary Verify the defining class loader of each module never delegates * to its child class loader. Also sanity check java.compact2 * requires. - * @run testng/othervm -Djdk.launcher.addmods=ALL-SYSTEM VerifyModuleDelegation + * @run testng/othervm --add-modules=ALL-SYSTEM VerifyModuleDelegation */ import java.lang.module.ModuleDescriptor; @@ -51,11 +51,11 @@ private static final ModuleDescriptor COMPACT2 = new ModuleDescriptor.Builder(JAVA_COMPACT2) - .requires(MANDATED, JAVA_BASE) - .requires(PUBLIC, JAVA_COMPACT1) - .requires(PUBLIC, "java.rmi") - .requires(PUBLIC, "java.sql") - .requires(PUBLIC, "java.xml") + .requires(Set.of(MANDATED), JAVA_BASE) + .requires(Set.of(PUBLIC), JAVA_COMPACT1) + .requires(Set.of(PUBLIC), "java.rmi") + .requires(Set.of(PUBLIC), "java.sql") + .requires(Set.of(PUBLIC), "java.xml") .build(); private static final Set MREFS --- old/jdk/test/jdk/modules/scenarios/automaticmodules/RunWithAutomaticModules.java 2016-08-08 16:35:02.000000000 -0700 +++ new/jdk/test/jdk/modules/scenarios/automaticmodules/RunWithAutomaticModules.java 2016-08-08 16:35:02.000000000 -0700 @@ -100,15 +100,15 @@ compiled = CompilerUtils .compile(SRC_DIR.resolve(testModule), MODS_DIR.resolve(testModule), - "-mp", MODS_DIR.toString()); + "--module-path", MODS_DIR.toString()); assertTrue(compiled); - // launch the test. Need -addmods because nothing explicitly depends on logging + // launch the test. Need --add-mdoules because nothing explicitly depends on logging int exitValue - = executeTestJava("-mp", MODS_DIR.toString(), - "-addmods", "logging", + = executeTestJava("--module-path", MODS_DIR.toString(), + "--add-modules", "logging", "-m", testModule + "/" + mainClass) .outputTo(System.out) .errorTo(System.out) @@ -159,7 +159,7 @@ compiled = CompilerUtils .compile(SRC_DIR.resolve(testModule), MODS_DIR.resolve(testModule), - "-mp", MODS_DIR.toString()); + "--module-path", MODS_DIR.toString()); assertTrue(compiled); @@ -167,7 +167,7 @@ // launch the test int exitValue - = executeTestJava("-mp", MODS_DIR.toString(), + = executeTestJava("--module-path", MODS_DIR.toString(), "-m", testModule + "/" + mainClass) .outputTo(System.out) .errorTo(System.out) --- old/jdk/test/jdk/modules/scenarios/container/ContainerTest.java 2016-08-08 16:35:04.000000000 -0700 +++ new/jdk/test/jdk/modules/scenarios/container/ContainerTest.java 2016-08-08 16:35:03.000000000 -0700 @@ -98,7 +98,7 @@ compiled = CompilerUtils.compile(SRC_DIR.resolve("app1"), dir.resolve("app1"), - "-upgrademodulepath", dir.toString()); + "--upgrade-module-path", dir.toString()); assertTrue(compiled); } @@ -116,7 +116,7 @@ compiled = CompilerUtils.compile(SRC_DIR.resolve("app2"), dir.resolve("app2"), - "-mp", dir.toString()); + "--module-path", dir.toString()); assertTrue(compiled); } @@ -134,7 +134,7 @@ public void testContainer() throws Exception { int exitValue - = executeTestJava("-mp", MLIB_DIR.toString(), + = executeTestJava("--module-path", MLIB_DIR.toString(), "-m", CONTAINER_MODULE) .outputTo(System.out) .errorTo(System.err) --- old/jdk/test/jdk/modules/scenarios/overlappingpackages/OverlappingPackagesTest.java 2016-08-08 16:35:05.000000000 -0700 +++ new/jdk/test/jdk/modules/scenarios/overlappingpackages/OverlappingPackagesTest.java 2016-08-08 16:35:05.000000000 -0700 @@ -74,7 +74,7 @@ */ public void testNoOverlappingPackages() throws Exception { int exitValue - = executeTestJava("-mp", MODS_DIR.toString(), + = executeTestJava("--module-path", MODS_DIR.toString(), "-m", "test/test.Main") .outputTo(System.out) .errorTo(System.err) @@ -85,13 +85,13 @@ /** - * Run the test with "-addmods misc", the misc module has package + * Run the test with "--add-modules misc", the misc module has package * jdk.internal.misc and so should overlap with the base module. */ public void testOverlapWithBaseModule() throws Exception { int exitValue - = executeTestJava("-mp", MODS_DIR.toString(), - "-addmods", "misc", + = executeTestJava("--module-path", MODS_DIR.toString(), + "-add-modules", "misc", "-m", "test/test.Main") .outputTo(System.out) .errorTo(System.err) @@ -101,12 +101,12 @@ } /** - * Run the test with "-addmods m1,m2". Both modules have package p. + * Run the test with "--add-modules m1,m2". Both modules have package p. */ public void testOverlap() throws Exception { int exitValue - = executeTestJava("-mp", MODS_DIR.toString(), - "-addmods", "m1,m2", + = executeTestJava("--module-path", MODS_DIR.toString(), + "--add-modules", "m1,m2", "-m", "test/test.Main") .outputTo(System.out) .errorTo(System.err) --- old/jdk/test/sun/awt/shell/ShellFolderMemoryLeak.java 2016-08-08 16:35:07.000000000 -0700 +++ new/jdk/test/sun/awt/shell/ShellFolderMemoryLeak.java 2016-08-08 16:35:06.000000000 -0700 @@ -93,7 +93,7 @@ String command = javaPath + File.separator + "bin" + File.separator + "java -Xmx256M" + arg1 + " -cp " + classPathDir - + " -XaddExports:java.desktop/sun.awt.shell=ALL-UNNAMED" + + " --add-exports=java.desktop/sun.awt.shell=ALL-UNNAMED" + " ShellFolderMemoryLeak " + arg2; process = Runtime.getRuntime().exec(command); BufferedReader input = null; --- old/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java 2016-08-08 16:35:08.000000000 -0700 +++ new/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java 2016-08-08 16:35:08.000000000 -0700 @@ -150,7 +150,7 @@ ProcessBuilder client = ProcessTools.createJavaProcessBuilder( "-cp", TEST_CLASSPATH, - "-XaddExports:java.management/sun.management=ALL-UNNAMED", + "--add-exports", "java.management/sun.management=ALL-UNNAMED", "TestManager", String.valueOf(serverPrc.getPid()), port.get(), --- old/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java 2016-08-08 16:35:10.000000000 -0700 +++ new/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java 2016-08-08 16:35:10.000000000 -0700 @@ -131,7 +131,7 @@ ProcessBuilder client = ProcessTools.createJavaProcessBuilder( "-cp", TEST_CLASSPATH, - "-XaddExports:java.management/sun.management=ALL-UNNAMED", + "--add-exports", "java.management/sun.management=ALL-UNNAMED", "TestManager", String.valueOf(serverPrc.getPid()), port.get(), --- old/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh 2016-08-08 16:35:12.000000000 -0700 +++ new/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh 2016-08-08 16:35:11.000000000 -0700 @@ -51,8 +51,8 @@ DEBUGOPTIONS="" export DEBUGOPTIONS -EXTRAOPTIONS="-XaddExports:java.management/sun.management=ALL-UNNAMED \ - -XaddExports:java.management/sun.management.jmxremote=ALL-UNNAMED" +EXTRAOPTIONS="--add-exports java.management/sun.management=ALL-UNNAMED \ + --add-exports java.management/sun.management.jmxremote=ALL-UNNAMED" export EXTRAOPTIONS # Call the common generic test --- old/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh 2016-08-08 16:35:13.000000000 -0700 +++ new/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh 2016-08-08 16:35:13.000000000 -0700 @@ -49,8 +49,8 @@ DEBUGOPTIONS="" export DEBUGOPTIONS -EXTRAOPTIONS="-XaddExports:java.management/sun.management=ALL-UNNAMED \ - -XaddExports:java.management/sun.management.jmxremote=ALL-UNNAMED" +EXTRAOPTIONS="--add-exports java.management/sun.management=ALL-UNNAMED \ + --add-exports java.management/sun.management.jmxremote=ALL-UNNAMED" export EXTRAOPTIONS # Call the common generic test --- old/jdk/test/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh 2016-08-08 16:35:15.000000000 -0700 +++ new/jdk/test/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh 2016-08-08 16:35:14.000000000 -0700 @@ -48,8 +48,8 @@ DEBUGOPTIONS="" export DEBUGOPTIONS -EXTRAOPTIONS="-XaddExports:java.management/sun.management=ALL-UNNAMED \ - -XaddExports:java.management/sun.management.jmxremote=ALL-UNNAMED" +EXTRAOPTIONS="--add-exports java.management/sun.management=ALL-UNNAMED \ + --add-exports java.management/sun.management.jmxremote=ALL-UNNAMED" export EXTRAOPTIONS # Call the common generic test --- old/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh 2016-08-08 16:35:16.000000000 -0700 +++ new/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh 2016-08-08 16:35:16.000000000 -0700 @@ -51,7 +51,7 @@ ;; esac -EXTRAOPTS="-XaddExports:java.base/sun.net.www=ALL-UNNAMED" +EXTRAOPTS="--add-exports java.base/sun.net.www=ALL-UNNAMED" ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRAOPTS} -d . \ ${TESTSRC}${FS}OriginServer.java \ --- old/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh 2016-08-08 16:35:18.000000000 -0700 +++ new/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh 2016-08-08 16:35:17.000000000 -0700 @@ -51,7 +51,7 @@ ;; esac -EXTRAOPTS="-XaddExports:java.base/sun.net.www=ALL-UNNAMED" +EXTRAOPTS="--add-exports java.base/sun.net.www=ALL-UNNAMED" ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRAOPTS} \ -d . ${TESTSRC}${FS}OriginServer.java \ ${TESTSRC}${FS}ProxyTunnelServer.java \ --- old/jdk/test/sun/net/www/protocol/jrt/OtherResources.java 2016-08-08 16:35:19.000000000 -0700 +++ new/jdk/test/sun/net/www/protocol/jrt/OtherResources.java 2016-08-08 16:35:19.000000000 -0700 @@ -36,7 +36,7 @@ // check that java.desktop is not in the set of readable modules try { Class.forName("java.awt.Component"); - throw new RuntimeException("Need to run with -limitmods java.base"); + throw new RuntimeException("Need to run with --limit-modules java.base"); } catch (ClassNotFoundException expected) { } // access resource in the java.desktop module --- old/jdk/test/sun/net/www/protocol/jrt/other_resources.sh 2016-08-08 16:35:21.000000000 -0700 +++ new/jdk/test/sun/net/www/protocol/jrt/other_resources.sh 2016-08-08 16:35:20.000000000 -0700 @@ -26,7 +26,7 @@ # @run shell other_resources.sh # @summary Access a jrt:/ resource in an observable module that is not in # the boot layer and hence not known to the built-in class loaders. This -# test is a shell test because the run tag doesn't support -limitmods. +# test is a shell test because the run tag doesn't support --limit-modules. set -e @@ -39,7 +39,7 @@ fi JAVA="$TESTJAVA/bin/java ${TESTVMOPTS}" -$JAVA -limitmods java.base -cp $TESTCLASSES OtherResources +$JAVA --limit-modules java.base -cp $TESTCLASSES OtherResources exit 0 --- old/jdk/test/sun/rmi/rmic/classpath/RMICClassPathTest.java 2016-08-08 16:35:22.000000000 -0700 +++ new/jdk/test/sun/rmi/rmic/classpath/RMICClassPathTest.java 2016-08-08 16:35:22.000000000 -0700 @@ -32,7 +32,7 @@ * not affect VM global state, so othervm is not required. * @modules jdk.rmic/sun.rmi.rmic * jdk.rmic/sun.tools.java - * @run main RMICClassPathTest + * @run main/othervm RMICClassPathTest */ import java.io.File; --- old/jdk/test/sun/rmi/rmic/iiopCompilation/IIOPCompilation.java 2016-08-08 16:35:23.000000000 -0700 +++ new/jdk/test/sun/rmi/rmic/iiopCompilation/IIOPCompilation.java 2016-08-08 16:35:23.000000000 -0700 @@ -30,8 +30,9 @@ * java.rmi/sun.rmi.transport * java.rmi/sun.rmi.transport.tcp * @build TestLibrary - * @summary Compiles a PortableRemoteObject with rmic -iiop and ensures that stub and tie classes are generated. * @run main IIOPCompilation + * + * @summary Compiles a PortableRemoteObject with rmic -iiop and ensures that stub and tie classes are generated. * @author Felix Yang * */ --- old/jdk/test/sun/rmi/runtime/Log/6409194/NoConsoleOutput.java 2016-08-08 16:35:25.000000000 -0700 +++ new/jdk/test/sun/rmi/runtime/Log/6409194/NoConsoleOutput.java 2016-08-08 16:35:25.000000000 -0700 @@ -68,10 +68,10 @@ // (neither on standard output, nor on standard err streams). JavaVM vm = new JavaVM( DoRMIStuff.class.getName(), - "-XaddExports:java.rmi/sun.rmi.registry=ALL-UNNAMED" - + " -XaddExports:java.rmi/sun.rmi.server=ALL-UNNAMED" - + " -XaddExports:java.rmi/sun.rmi.transport=ALL-UNNAMED" - + " -XaddExports:java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" + "--add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED" + + " --add-exports=java.rmi/sun.rmi.server=ALL-UNNAMED" + + " --add-exports=java.rmi/sun.rmi.transport=ALL-UNNAMED" + + " --add-exports=java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" + " -Djava.util.logging.config.file=" + loggingPropertiesFile, "", out, err); vm.execute(); --- old/jdk/test/sun/security/krb5/ccache/EmptyCC.java 2016-08-08 16:35:26.000000000 -0700 +++ new/jdk/test/sun/security/krb5/ccache/EmptyCC.java 2016-08-08 16:35:26.000000000 -0700 @@ -27,7 +27,8 @@ * @bug 8001208 * @summary NPE in sun.security.krb5.Credentials.acquireDefaultCreds() * @library ../../../../java/security/testlibrary/ - * @modules java.security.jgss/sun.security.krb5 + * @modules java.base/jdk.internal.misc + * java.security.jgss/sun.security.krb5 * java.security.jgss/sun.security.krb5.internal.ccache * @compile -XDignore.symbol.file EmptyCC.java * @run main EmptyCC tmpcc --- old/jdk/test/sun/security/krb5/tools/ktcheck.sh 2016-08-08 16:35:28.000000000 -0700 +++ new/jdk/test/sun/security/krb5/tools/ktcheck.sh 2016-08-08 16:35:27.000000000 -0700 @@ -61,8 +61,8 @@ EXTRA_OPTIONS="-Djava.security.krb5.conf=${TESTSRC}${FS}onlythree.conf" KTAB="${TESTJAVA}${FS}bin${FS}ktab -J${EXTRA_OPTIONS} -k $KEYTAB -f" CHECK="${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} ${TESTVMOPTS} ${EXTRA_OPTIONS} \ - -XaddExports:java.security.jgss/sun.security.krb5.internal.ktab=ALL-UNNAMED \ - -XaddExports:java.security.jgss/sun.security.krb5=ALL-UNNAMED \ + --add-exports java.security.jgss/sun.security.krb5.internal.ktab=ALL-UNNAMED \ + --add-exports java.security.jgss/sun.security.krb5=ALL-UNNAMED \ KtabCheck $KEYTAB" echo ${EXTRA_OPTIONS} --- old/jdk/test/sun/security/mscapi/PublicKeyInterop.sh 2016-08-08 16:35:29.000000000 -0700 +++ new/jdk/test/sun/security/mscapi/PublicKeyInterop.sh 2016-08-08 16:35:29.000000000 -0700 @@ -62,9 +62,9 @@ echo echo "Running the test..." - ${TESTJAVA}/bin/javac -XaddExports:java.base/sun.security.util=ALL-UNNAMED \ + ${TESTJAVA}/bin/javac --add-exports java.base/sun.security.util=ALL-UNNAMED \ ${TESTTOOLVMOPTS} ${TESTJAVACOPTS} -d . ${TESTSRC}\\PublicKeyInterop.java - ${TESTJAVA}/bin/java -XaddExports:java.base/sun.security.util=ALL-UNNAMED \ + ${TESTJAVA}/bin/java --add-exports java.base/sun.security.util=ALL-UNNAMED \ ${TESTVMOPTS} PublicKeyInterop rc=$? --- old/jdk/test/sun/security/mscapi/ShortRSAKey1024.sh 2016-08-08 16:35:30.000000000 -0700 +++ new/jdk/test/sun/security/mscapi/ShortRSAKey1024.sh 2016-08-08 16:35:30.000000000 -0700 @@ -88,10 +88,10 @@ echo echo "Running the test..." - ${TESTJAVA}${FS}bin${FS}javac -XaddExports:java.base/sun.security.util=ALL-UNNAMED \ + ${TESTJAVA}${FS}bin${FS}javac --add-exports java.base/sun.security.util=ALL-UNNAMED \ ${TESTTOOLVMOPTS} ${TESTJAVACOPTS} -d . \ ${TESTSRC}${FS}ShortRSAKeyWithinTLS.java - ${TESTJAVA}${FS}bin${FS}java -XaddExports:java.base/sun.security.util=ALL-UNNAMED \ + ${TESTJAVA}${FS}bin${FS}java --add-exports java.base/sun.security.util=ALL-UNNAMED \ ${TESTVMOPTS} ShortRSAKeyWithinTLS 7106773.$BITS $BITS \ TLSv1.2 TLS_DHE_RSA_WITH_AES_128_CBC_SHA --- old/jdk/test/sun/security/provider/PolicyFile/Modules.java 2016-08-08 16:35:32.000000000 -0700 +++ new/jdk/test/sun/security/provider/PolicyFile/Modules.java 2016-08-08 16:35:31.000000000 -0700 @@ -33,14 +33,14 @@ * java.sql * java.xml * java.xml.bind + * java.xml.ws * jdk.attach * jdk.jdi * jdk.net * jdk.security.auth * jdk.security.jgss - * @compile -addmods java.xml.ws,java.smartcardio Modules.java - * @run main/othervm/java.security.policy==modules.policy - * -addmods java.xml.ws,java.smartcardio Modules + * @compile --add-modules=java.xml.ws,java.smartcardio Modules.java + * @run main/othervm/java.security.policy==modules.policy Modules */ import java.security.AccessController; --- old/jdk/test/sun/security/tools/jarsigner/AltProvider.java 2016-08-08 16:35:33.000000000 -0700 +++ new/jdk/test/sun/security/tools/jarsigner/AltProvider.java 2016-08-08 16:35:33.000000000 -0700 @@ -55,7 +55,7 @@ // Compile the provider CompilerUtils.compile( MOD_SRC_DIR, MOD_DEST_DIR, - "-modulesourcepath", + "--module-source-path", MOD_SRC_DIR.toString()); // Create a keystore @@ -102,22 +102,22 @@ 0, "loadProviderByClass: org.test.dummy.DummyProvider"); // name in a module - testBoth("-J-mp -Jmods " + + testBoth("-J--module-path=mods " + "-addprovider Dummy -providerArg full", 0, "loadProviderByName: Dummy"); // -providerClass does not work - testBoth("-J-mp -Jmods " + + testBoth("-J--module-path=mods " + "-providerClass org.test.dummy.DummyProvider -providerArg full", 1, "Provider \"org.test.dummy.DummyProvider\" not found"); // -addprovider with class does not work - testBoth("-J-mp -Jmods " + + testBoth("-J--module-path=mods " + "-addprovider org.test.dummy.DummyProvider -providerArg full", 1, "Provider named \"org.test.dummy.DummyProvider\" not found"); // -addprovider without arg does not work - testBoth("-J-mp -Jmods " + + testBoth("-J--module-path=mods " + "-addprovider Dummy", 1, "DUMMYKS not found"); } --- old/jdk/test/sun/security/tools/jarsigner/ts.sh 2016-08-08 16:35:34.000000000 -0700 +++ new/jdk/test/sun/security/tools/jarsigner/ts.sh 2016-08-08 16:35:34.000000000 -0700 @@ -94,10 +94,10 @@ $KT -alias ca -gencert -ext eku:critical=cs | \ $KT -alias tsbad3 -importcert -EXTRAOPTS="-XaddExports:java.base/sun.security.pkcs=ALL-UNNAMED \ - -XaddExports:java.base/sun.security.timestamp=ALL-UNNAMED \ - -XaddExports:java.base/sun.security.x509=ALL-UNNAMED \ - -XaddExports:java.base/sun.security.util=ALL-UNNAMED" +EXTRAOPTS="--add-exports java.base/sun.security.pkcs=ALL-UNNAMED \ + --add-exports java.base/sun.security.timestamp=ALL-UNNAMED \ + --add-exports java.base/sun.security.x509=ALL-UNNAMED \ + --add-exports java.base/sun.security.util=ALL-UNNAMED" $JAVAC ${EXTRAOPTS} -d . ${TESTSRC}/TimestampCheck.java $JAVA ${TESTVMOPTS} ${EXTRAOPTS} "-Dtest.tool.vm.opts=${TESTTOOLVMOPTS}" TimestampCheck --- old/jdk/test/sun/security/tools/keytool/autotest.sh 2016-08-08 16:35:36.000000000 -0700 +++ new/jdk/test/sun/security/tools/keytool/autotest.sh 2016-08-08 16:35:36.000000000 -0700 @@ -100,9 +100,9 @@ echo "Using NSS lib at $LIBNAME" -EXTRAOPTS="-XaddExports:java.base/sun.security.tools.keytool=ALL-UNNAMED \ - -XaddExports:java.base/sun.security.util=ALL-UNNAMED \ - -XaddExports:java.base/sun.security.x509=ALL-UNNAMED" +EXTRAOPTS="--add-exports java.base/sun.security.tools.keytool=ALL-UNNAMED \ + --add-exports java.base/sun.security.util=ALL-UNNAMED \ + --add-exports java.base/sun.security.x509=ALL-UNNAMED" ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRAOPTS} -d . -XDignore.symbol.file \ ${TESTSRC}${FS}KeyToolTest.java || exit 10 --- old/jdk/test/sun/security/tools/keytool/standard.sh 2016-08-08 16:35:37.000000000 -0700 +++ new/jdk/test/sun/security/tools/keytool/standard.sh 2016-08-08 16:35:37.000000000 -0700 @@ -58,9 +58,9 @@ ;; esac -EXTRAOPTS="-XaddExports:java.base/sun.security.tools.keytool=ALL-UNNAMED \ - -XaddExports:java.base/sun.security.util=ALL-UNNAMED \ - -XaddExports:java.base/sun.security.x509=ALL-UNNAMED" +EXTRAOPTS="--add-exports java.base/sun.security.tools.keytool=ALL-UNNAMED \ + --add-exports java.base/sun.security.util=ALL-UNNAMED \ + --add-exports java.base/sun.security.x509=ALL-UNNAMED" ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRAOPTS} -d . -XDignore.symbol.file ${TESTSRC}${FS}KeyToolTest.java || exit 10 --- old/jdk/test/sun/security/util/Resources/NewNamesFormat.java 2016-08-08 16:35:39.000000000 -0700 +++ new/jdk/test/sun/security/util/Resources/NewNamesFormat.java 2016-08-08 16:35:38.000000000 -0700 @@ -29,6 +29,7 @@ * jdk.jartool/sun.security.tools.jarsigner * jdk.policytool/sun.security.tools.policytool * @summary security/util/Resources.java needs improvement + * @run main/othervm NewNamesFormat */ --- old/jdk/test/sun/security/validator/certreplace.sh 2016-08-08 16:35:41.000000000 -0700 +++ new/jdk/test/sun/security/validator/certreplace.sh 2016-08-08 16:35:40.000000000 -0700 @@ -83,6 +83,6 @@ # 5. Build and run test -EXTRAOPTS="-XaddExports:java.base/sun.security.validator=ALL-UNNAMED" +EXTRAOPTS="--add-exports java.base/sun.security.validator=ALL-UNNAMED" $JAVAC ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRAOPTS} -d . ${TESTSRC}${FS}CertReplace.java $JAVA ${TESTVMOPTS} ${EXTRAOPTS} CertReplace certreplace.jks certreplace.certs --- old/jdk/test/sun/security/validator/samedn.sh 2016-08-08 16:35:44.000000000 -0700 +++ new/jdk/test/sun/security/validator/samedn.sh 2016-08-08 16:35:43.000000000 -0700 @@ -79,7 +79,7 @@ # 5. Build and run test. Make sure the CA certs are ignored for validity check. # Check both, one of them might be dropped out of map in old codes. -EXTRAOPTS="-XaddExports:java.base/sun.security.validator=ALL-UNNAMED" +EXTRAOPTS="--add-exports java.base/sun.security.validator=ALL-UNNAMED" $JAVAC ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRAOPTS} -d . ${TESTSRC}${FS}CertReplace.java $JAVA ${TESTVMOPTS} ${EXTRAOPTS} CertReplace samedn.jks samedn1.certs || exit 1 $JAVA ${TESTVMOPTS} ${EXTRAOPTS} CertReplace samedn.jks samedn2.certs || exit 2 --- old/jdk/test/sun/text/IntHashtable/Bug4170614Test.sh 2016-08-08 16:35:46.000000000 -0700 +++ new/jdk/test/sun/text/IntHashtable/Bug4170614Test.sh 2016-08-08 16:35:46.000000000 -0700 @@ -63,7 +63,7 @@ -Xmodule:java.base \ -d ${TEST_JAVABASE} Bug4170614Test.java -${TESTJAVA}/bin/java ${TESTVMOPTS} -Xpatch:java.base=${TEST_JAVABASE} java.text.Bug4170614Test +${TESTJAVA}/bin/java ${TESTVMOPTS} --patch-module java.base=${TEST_JAVABASE} java.text.Bug4170614Test result=$? --- old/jdk/test/sun/tools/java/CFCTest.java 2016-08-08 16:35:49.000000000 -0700 +++ new/jdk/test/sun/tools/java/CFCTest.java 2016-08-08 16:35:48.000000000 -0700 @@ -24,9 +24,11 @@ /* * @test * @bug 8011805 - * @modules jdk.rmic/sun.tools.java jdk.rmic/sun.rmi.rmic * @summary Update sun.tools.java class file reading/writing support to include * the new constant pool entries (including invokedynamic) + * @modules jdk.rmic/sun.rmi.rmic + * jdk.rmic/sun.tools.java + * @run main CFCTest */ import java.io.DataInputStream; --- old/jdk/test/sun/util/locale/provider/Bug8038436.java 2016-08-08 16:35:51.000000000 -0700 +++ new/jdk/test/sun/util/locale/provider/Bug8038436.java 2016-08-08 16:35:51.000000000 -0700 @@ -28,7 +28,7 @@ * @modules java.base/sun.util.locale.provider * java.base/sun.util.spi * @compile -XDignore.symbol.file Bug8038436.java - * @run main/othervm -limitmods java.base Bug8038436 security + * @run main/othervm --limit-modules java.base Bug8038436 security * @run main/othervm -Djava.locale.providers=COMPAT Bug8038436 availlocs */ @@ -69,7 +69,7 @@ /* * Check only English/ROOT locales are returned if the jdk.localedata - * module is not loaded (implied by "-limitmods java.base"). + * module is not loaded (implied by "--limit-modules java.base"). */ List nonEnglishLocales= (Arrays.stream(Locale.getAvailableLocales()) .filter(l -> (l != Locale.ROOT && !(l.getLanguage() == "en" && (l.getCountry() == "US" || l.getCountry() == "" )))) --- old/jdk/test/tools/jar/modularJar/Basic.java 2016-08-08 16:35:54.000000000 -0700 +++ new/jdk/test/tools/jar/modularJar/Basic.java 2016-08-08 16:35:53.000000000 -0700 @@ -460,7 +460,7 @@ "--no-manifest", "-C", barModInfo.toString(), "module-info.class") // stuff in bar's info .assertSuccess(); - jar("-p", + jar("-d", "--file=" + modularJar.toString()) .assertSuccess() .resultChecker(r -> { @@ -499,14 +499,14 @@ "--file=" + modularJar.toString(), "--main-class=" + FOO.mainClass, "--module-version=" + FOO.version, - "--modulepath=" + mp.toString(), + "--module-path=" + mp.toString(), "--hash-modules=" + "bar", "--no-manifest", "-C", modClasses.toString(), ".") .assertSuccess(); java(mp, BAR.moduleName + "/" + BAR.mainClass, - "-XaddExports:java.base/jdk.internal.module=bar") + "--add-exports", "java.base/jdk.internal.module=bar") .assertSuccess() .resultChecker(r -> { assertModuleData(r, BAR); @@ -535,7 +535,7 @@ "--file=" + fooJar.toString(), "--main-class=" + FOO.mainClass, "--module-version=" + FOO.version, - "--modulepath=" + mp.toString(), + "-p", mp.toString(), // test short-form "--hash-modules=" + "bar", "--no-manifest", "-C", fooClasses.toString(), ".").assertSuccess(); @@ -550,7 +550,7 @@ "-C", barClasses.toString(), ".").assertSuccess(); java(mp, BAR.moduleName + "/" + BAR.mainClass, - "-XaddExports:java.base/jdk.internal.module=bar") + "--add-exports", "java.base/jdk.internal.module=bar") .assertFailure() .resultChecker(r -> { // Expect similar output: "java.lang.module.ResolutionException: Hash @@ -684,7 +684,7 @@ "-C", modClasses.toString(), ".") .assertSuccess(); - for (String option : new String[] {"--print-module-descriptor", "-p" }) { + for (String option : new String[] {"--print-module-descriptor", "-d" }) { jar(option, "--file=" + modularJar.toString()) .assertSuccess() @@ -711,7 +711,7 @@ "-C", modClasses.toString(), ".") .assertSuccess(); - for (String option : new String[] {"--print-module-descriptor", "-p" }) { + for (String option : new String[] {"--print-module-descriptor", "-d" }) { jarWithStdin(modularJar.toFile(), option) .assertSuccess() @@ -815,10 +815,12 @@ } commands.add("-d"); commands.add(dest.toString()); - if (dest.toString().contains("bar")) - commands.add("-XaddExports:java.base/jdk.internal.module=bar"); + if (dest.toString().contains("bar")) { + commands.add("--add-exports"); + commands.add("java.base/jdk.internal.module=bar"); + } if (modulePath != null) { - commands.add("-mp"); + commands.add("--module-path"); commands.add(modulePath.toString()); } Stream.of(sourceFiles).map(Object::toString).forEach(x -> commands.add(x)); @@ -838,7 +840,7 @@ commands.addAll(Arrays.asList(JAVA_OPTIONS.split("\\s+", -1))); } Stream.of(args).forEach(x -> commands.add(x)); - commands.add("-mp"); + commands.add("--module-path"); commands.add(modulePath.toString()); commands.add("-m"); commands.add(entryPoint); --- old/jdk/test/tools/jimage/VerifyJimage.java 2016-08-08 16:35:57.000000000 -0700 +++ new/jdk/test/tools/jimage/VerifyJimage.java 2016-08-08 16:35:56.000000000 -0700 @@ -49,7 +49,7 @@ * @test * @summary Verify jimage * @modules java.base/jdk.internal.jimage - * @run main/othervm -Djdk.launcher.addmods=ALL-SYSTEM VerifyJimage + * @run main/othervm --add-modules=ALL-SYSTEM VerifyJimage */ /** --- old/jdk/test/tools/jlink/CustomPluginTest.java 2016-08-08 16:36:00.000000000 -0700 +++ new/jdk/test/tools/jlink/CustomPluginTest.java 2016-08-08 16:36:00.000000000 -0700 @@ -93,7 +93,8 @@ String name = "customplugin"; Path src = Paths.get(System.getProperty("test.src")).resolve(name); Path classes = helper.getJmodClassesDir().resolve(name); - JImageGenerator.compile(src, classes, "-XaddExports:jdk.jlink/jdk.tools.jlink.internal=customplugin"); + JImageGenerator.compile(src, classes, + "--add-exports", "jdk.jlink/jdk.tools.jlink.internal=customplugin"); return JImageGenerator.getJModTask() .addClassPath(classes) .jmod(helper.getJmodDir().resolve(name + ".jmod")) --- old/jdk/test/tools/jlink/JLinkNegativeTest.java 2016-08-08 16:36:03.000000000 -0700 +++ new/jdk/test/tools/jlink/JLinkNegativeTest.java 2016-08-08 16:36:02.000000000 -0700 @@ -95,7 +95,7 @@ } public void testNotExistInAddMods() { - // cannot find jmod from --addmods + // cannot find jmod from --add-modules JImageGenerator.getJLinkTask() .modulePath(".") .addMods("not_exist") --- old/jdk/test/tools/jlink/JLinkTest.java 2016-08-08 16:36:05.000000000 -0700 +++ new/jdk/test/tools/jlink/JLinkTest.java 2016-08-08 16:36:05.000000000 -0700 @@ -118,7 +118,7 @@ .output(helper.createNewImageDir(moduleName)) .addMods("leaf1") .option("") - .call().assertFailure("Error: no value given for --modulepath"); + .call().assertFailure("Error: no value given for --module-path"); } { @@ -231,7 +231,7 @@ // @file { Path path = Paths.get("embedded.properties"); - Files.write(path, Collections.singletonList("--strip-debug --addmods " + + Files.write(path, Collections.singletonList("--strip-debug --add-modules " + "toto.unknown --compress UNKNOWN\n")); String[] userOptions = {"@", path.toAbsolutePath().toString()}; String moduleName = "configembeddednocompresscomposite2"; --- old/jdk/test/tools/jlink/basic/BasicTest.java 2016-08-08 16:36:07.000000000 -0700 +++ new/jdk/test/tools/jlink/basic/BasicTest.java 2016-08-08 16:36:07.000000000 -0700 @@ -106,8 +106,8 @@ private void runJlink(Path image, String modName, String... options) { List args = new ArrayList<>(); Collections.addAll(args, - "--modulepath", jdkMods + File.pathSeparator + jmods, - "--addmods", modName, + "--module-path", jdkMods + File.pathSeparator + jmods, + "--add-modules", modName, "--output", image.toString()); Collections.addAll(args, options); int rc = jdk.tools.jlink.internal.Main.run(args.toArray(new String[args.size()]), new PrintWriter(System.out)); --- old/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java 2016-08-08 16:36:10.000000000 -0700 +++ new/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java 2016-08-08 16:36:09.000000000 -0700 @@ -73,7 +73,7 @@ for (String mn : modules) { Path msrc = SRC_DIR.resolve(mn); - assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "-modulesourcepath", SRC_DIR.toString())); + assertTrue(CompilerUtils.compile(msrc, MODS_DIR, "--module-source-path", SRC_DIR.toString())); } if (Files.exists(IMAGE)) { @@ -87,8 +87,8 @@ Path jlink = Paths.get(JAVA_HOME, "bin", "jlink"); String mp = JMODS.toString() + File.pathSeparator + MODS_DIR.toString(); assertTrue(executeProcess(jlink.toString(), "--output", outputDir.toString(), - "--addmods", Arrays.stream(modules).collect(Collectors.joining(",")), - "--modulepath", mp) + "--add-modules", Arrays.stream(modules).collect(Collectors.joining(",")), + "--module-path", mp) .outputTo(System.out) .errorTo(System.out) .getExitValue() == 0); --- old/jdk/test/tools/jmod/JmodNegativeTest.java 2016-08-08 16:36:12.000000000 -0700 +++ new/jdk/test/tools/jmod/JmodNegativeTest.java 2016-08-08 16:36:12.000000000 -0700 @@ -314,7 +314,7 @@ jmod("create", "--class-path", cp, "--hash-modules", ".*", - "--modulepath", emptyDir.toString(), + "--module-path", emptyDir.toString(), jmod.toString()) .resultChecker(r -> assertContains(r.output, "No hashes recorded: " + @@ -335,7 +335,7 @@ jmod("create", "--class-path", cp, "--hash-modules", ".*", - "--modulepath", MODS_DIR.toString(), + "--module-path", MODS_DIR.toString(), jmod.toString()) .assertFailure(); } finally { @@ -353,7 +353,7 @@ jmod("create", "--hash-modules", ".*", - "--modulepath", file.toString(), + "--module-path", file.toString(), jmod.toString()) .assertFailure() .resultChecker(r -> @@ -370,7 +370,7 @@ List> tasks = Arrays.asList( () -> jmod("create", "--hash-modules", "anyPattern", - "--modulepath", "doesNotExist", + "--module-path", "doesNotExist", "output.jmod"), () -> jmod("create", "--class-path", "doesNotExist", @@ -418,7 +418,7 @@ List> tasks = Arrays.asList( () -> jmod("create", "--hash-modules", "anyPattern", - "--modulepath","empty" + pathSeparator + "doesNotExist", + "--module-path","empty" + pathSeparator + "doesNotExist", "output.jmod"), () -> jmod("create", "--class-path", "empty" + pathSeparator + "doesNotExist", @@ -467,7 +467,7 @@ "--class-path", "aFile.txt", "output.jmod"), () -> jmod("create", - "--modulepath", "aFile.txt", + "--module-path", "aFile.txt", "output.jmod"), () -> jmod("create", "--cmds", "aFile.txt", --- old/jdk/test/tools/jmod/hashes/HashesTest.java 2016-08-08 16:36:15.000000000 -0700 +++ new/jdk/test/tools/jmod/hashes/HashesTest.java 2016-08-08 16:36:14.000000000 -0700 @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -88,7 +88,7 @@ // build m1 compileModule("m1", modSrc); // no hash is recorded since m1 has outgoing edges - jmod("m1", "--modulepath", jmods.toString(), "--hash-modules", ".*"); + jmod("m1", "--module-path", jmods.toString(), "--hash-modules", ".*"); // compile org.bar and org.foo compileModule("org.bar", modSrc); @@ -109,17 +109,17 @@ } // hash m1 in m2 - jmod("m2", "--modulepath", jmods.toString(), "--hash-modules", "m1"); + jmod("m2", "--module-path", jmods.toString(), "--hash-modules", "m1"); checkHashes(hashes("m2").get(), "m1"); // hash m1 in m2 - jmod("m2", "--modulepath", jmods.toString(), "--hash-modules", ".*"); + jmod("m2", "--module-path", jmods.toString(), "--hash-modules", ".*"); checkHashes(hashes("m2").get(), "m1"); // create m2.jmod with no hash jmod("m2"); // run jmod hash command to hash m1 in m2 and m3 - runJmod(Arrays.asList("hash", "--modulepath", jmods.toString(), + runJmod(Arrays.asList("hash", "--module-path", jmods.toString(), "--hash-modules", ".*")); checkHashes(hashes("m2").get(), "m1"); checkHashes(hashes("m3").get(), "m1"); @@ -127,10 +127,10 @@ jmod("org.bar"); jmod("org.foo"); - jmod("org.bar", "--modulepath", jmods.toString(), "--hash-modules", "org.*"); + jmod("org.bar", "--module-path", jmods.toString(), "--hash-modules", "org.*"); checkHashes(hashes("org.bar").get(), "org.foo"); - jmod("m3", "--modulepath", jmods.toString(), "--hash-modules", ".*"); + jmod("m3", "--module-path", jmods.toString(), "--hash-modules", ".*"); checkHashes(hashes("m3").get(), "org.foo", "org.bar", "m1"); } @@ -185,7 +185,7 @@ private void compileModule(String moduleName, Path src) throws IOException { Path msrc = src.resolve(moduleName); - assertTrue(CompilerUtils.compile(msrc, mods, "-modulesourcepath", src.toString())); + assertTrue(CompilerUtils.compile(msrc, mods, "--module-source-path", src.toString())); } private void jmod(String moduleName, String... options) throws IOException { --- old/jdk/test/tools/launcher/MiscTests.java 2016-08-08 16:36:17.000000000 -0700 +++ new/jdk/test/tools/launcher/MiscTests.java 2016-08-08 16:36:17.000000000 -0700 @@ -70,7 +70,7 @@ final String mainClass = "Foo6856415"; final String exportOpts - = "-XaddExports:jdk.crypto.pkcs11/sun.security.pkcs11=ALL-UNNAMED"; + = "--add-exports=jdk.crypto.pkcs11/sun.security.pkcs11=ALL-UNNAMED"; List scratch = new ArrayList<>(); scratch.add("public class Foo6856415 {"); --- old/jdk/test/tools/launcher/ToolsOpts.java 2016-08-08 16:36:19.000000000 -0700 +++ new/jdk/test/tools/launcher/ToolsOpts.java 2016-08-08 16:36:19.000000000 -0700 @@ -151,7 +151,7 @@ init(); TestResult tr; int jpos = -1; - String xPatch = "-J-Xpatch:jdk.compiler=jdk.compiler"; + String xPatch = "-J--patch-module=jdk.compiler=jdk.compiler"; for (String arg[] : optionPatterns) { jpos = indexOfJoption(arg); //Build a cmd string for output in results reporting. --- old/jdk/test/tools/launcher/modules/addexports/AddExportsTest.java 2016-08-08 16:36:22.000000000 -0700 +++ new/jdk/test/tools/launcher/modules/addexports/AddExportsTest.java 2016-08-08 16:36:21.000000000 -0700 @@ -27,7 +27,7 @@ * @modules jdk.compiler * @build AddExportsTest CompilerUtils jdk.testlibrary.* * @run testng AddExportsTest - * @summary Basic tests for java -XaddExports + * @summary Basic tests for java --add-exports */ import java.nio.file.Path; @@ -71,7 +71,7 @@ boolean compiled = CompilerUtils.compile( SRC_DIR.resolve(TEST1_MODULE), MODS_DIR.resolve(TEST1_MODULE), - "-XaddExports:java.base/jdk.internal.misc=m1"); + "--add-exports", "java.base/jdk.internal.misc=m1"); assertTrue(compiled, "module " + TEST1_MODULE + " did not compile"); // javac -d upgrademods/java.transaction src/java.transaction/** @@ -80,12 +80,12 @@ UPGRADE_MODS_DIRS.resolve("java.transaction")); assertTrue(compiled, "module java.transaction did not compile"); - // javac -upgrademodulepath upgrademods -d mods/m2 src/m2/** + // javac --upgrade-module-path upgrademods -d mods/m2 src/m2/** compiled = CompilerUtils.compile( SRC_DIR.resolve(TEST2_MODULE), MODS_DIR.resolve(TEST2_MODULE), - "-upgrademodulepath", UPGRADE_MODS_DIRS.toString(), - "-XaddExports:java.transaction/javax.transaction.internal=m2"); + "--upgrade-module-path", UPGRADE_MODS_DIRS.toString(), + "--add-exports", "java.transaction/javax.transaction.internal=m2"); assertTrue(compiled, "module " + TEST2_MODULE + " did not compile"); // javac -d mods/m3 src/m3/** @@ -107,7 +107,7 @@ public void testSanity() throws Exception { int exitValue - = executeTestJava("-XaddExports:java.base/jdk.internal.reflect=ALL-UNNAMED", + = executeTestJava("--add-exports", "java.base/jdk.internal.reflect=ALL-UNNAMED", "-version") .outputTo(System.out) .errorTo(System.out) @@ -122,12 +122,12 @@ */ public void testUnnamedModule() throws Exception { - // java -XaddExports:java.base/jdk.internal.misc=ALL-UNNAMED \ + // java --add-exports java.base/jdk.internal.misc=ALL-UNNAMED \ // -cp mods/$TESTMODULE jdk.test.UsesUnsafe String classpath = MODS_DIR.resolve(TEST1_MODULE).toString(); int exitValue - = executeTestJava("-XaddExports:java.base/jdk.internal.misc=ALL-UNNAMED", + = executeTestJava("--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED", "-cp", classpath, TEST1_MAIN_CLASS) .outputTo(System.out) @@ -143,13 +143,13 @@ */ public void testNamedModule() throws Exception { - // java -XaddExports:java.base/jdk.internal.misc=test \ - // -mp mods -m $TESTMODULE/$MAIN_CLASS + // java --add-exports java.base/jdk.internal.misc=test \ + // --module-path mods -m $TESTMODULE/$MAIN_CLASS String mid = TEST1_MODULE + "/" + TEST1_MAIN_CLASS; int exitValue = - executeTestJava("-XaddExports:java.base/jdk.internal.misc=" + TEST1_MODULE, - "-mp", MODS_DIR.toString(), + executeTestJava("--add-exports", "java.base/jdk.internal.misc=" + TEST1_MODULE, + "--module-path", MODS_DIR.toString(), "-m", mid) .outputTo(System.out) .errorTo(System.out) @@ -160,17 +160,17 @@ /** - * Test -XaddExports with upgraded module + * Test --add-exports with upgraded module */ public void testWithUpgradedModule() throws Exception { - // java -XaddExports:java.transaction/javax.transaction.internal=m2 - // -upgrademodulepath upgrademods -mp mods -m ... + // java --add-exports java.transaction/javax.transaction.internal=m2 + // --upgrade-module-path upgrademods --module-path mods -m ... String mid = TEST2_MODULE + "/" + TEST2_MAIN_CLASS; int exitValue = executeTestJava( - "-XaddExports:java.transaction/javax.transaction.internal=m2", - "-upgrademodulepath", UPGRADE_MODS_DIRS.toString(), - "-mp", MODS_DIR.toString(), + "--add-exports", "java.transaction/javax.transaction.internal=m2", + "--upgrade-module-path", UPGRADE_MODS_DIRS.toString(), + "--module-path", MODS_DIR.toString(), "-m", mid) .outputTo(System.out) .errorTo(System.out) @@ -181,17 +181,17 @@ /** - * Test -XaddExports with module that is added to the set of root modules - * with -addmods. + * Test --add-exports with module that is added to the set of root modules + * with --add-modules. */ public void testWithAddMods() throws Exception { - // java -XaddExports:m4/jdk.test4=m3 -mp mods -m ... + // java --add-exports m4/jdk.test4=m3 --module-path mods -m ... String mid = TEST3_MODULE + "/" + TEST3_MAIN_CLASS; int exitValue = executeTestJava( - "-XaddExports:m4/jdk.test4=m3", - "-mp", MODS_DIR.toString(), - "-addmods", TEST4_MODULE, + "--add-exports", "m4/jdk.test4=m3", + "--module-path", MODS_DIR.toString(), + "--add-modules", TEST4_MODULE, "-m", mid) .outputTo(System.out) .errorTo(System.out) @@ -202,13 +202,13 @@ /** - * -XaddExports can only be specified once + * --add-exports can only be specified once */ public void testWithDuplicateOption() throws Exception { int exitValue - = executeTestJava("-XaddExports:java.base/jdk.internal.reflect=ALL-UNNAMED", - "-XaddExports:java.base/jdk.internal.reflect=ALL-UNNAMED", + = executeTestJava("--add-exports", "java.base/jdk.internal.reflect=ALL-UNNAMED", + "--add-exports", "java.base/jdk.internal.reflect=ALL-UNNAMED", "-version") .outputTo(System.out) .errorTo(System.out) @@ -220,14 +220,14 @@ /** - * Exercise -XaddExports with bad values + * Exercise --add-exports with bad values */ @Test(dataProvider = "badvalues") public void testWithBadValue(String value, String ignore) throws Exception { - // -XaddExports:$VALUE -version + // --add-exports $VALUE -version int exitValue = - executeTestJava("-XaddExports:" + value, + executeTestJava("--add-exports", value, "-version") .outputTo(System.out) .errorTo(System.out) --- old/jdk/test/tools/launcher/modules/addmods/AddModsTest.java 2016-08-08 16:36:24.000000000 -0700 +++ new/jdk/test/tools/launcher/modules/addmods/AddModsTest.java 2016-08-08 16:36:23.000000000 -0700 @@ -28,7 +28,7 @@ * jdk.compiler * @build AddModsTest CompilerUtils jdk.testlibrary.* * @run testng AddModsTest - * @summary Basic test for java -addmods + * @summary Basic test for java --add-modules */ import java.nio.file.Path; @@ -78,15 +78,15 @@ /** - * Basic test of -addmods ALL-DEFAULT. Module java.sql should be + * Basic test of --add-modules ALL-DEFAULT. Module java.sql should be * resolved and the types in that module should be visible. */ public void testAddDefaultModules1() throws Exception { - // java -addmods ALL-DEFAULT -mp mods1 -m test ... + // java --add-modules ALL-DEFAULT --module-path mods1 -m test ... int exitValue - = executeTestJava("-mp", MODS1_DIR.toString(), - "-addmods", "ALL-DEFAULT", + = executeTestJava("--module-path", MODS1_DIR.toString(), + "--add-modules", "ALL-DEFAULT", "-m", TEST_MID, "java.sql.Connection") .outputTo(System.out) @@ -97,16 +97,16 @@ } /** - * Basic test of -addmods ALL-DEFAULT. Module java.annotations.common + * Basic test of --add-modules ALL-DEFAULT. Module java.annotations.common * should not resolved and so the types in that module should not be * visible. */ public void testAddDefaultModules2() throws Exception { - // java -addmods ALL-DEFAULT -mp mods1 -m test ... + // java --add-modules ALL-DEFAULT --module-path mods1 -m test ... int exitValue - = executeTestJava("-mp", MODS1_DIR.toString(), - "-addmods", "ALL-DEFAULT", + = executeTestJava("--module-path", MODS1_DIR.toString(), + "--add-modules", "ALL-DEFAULT", "-m", TEST_MID, "javax.annotation.Generated") .outputTo(System.out) @@ -118,15 +118,15 @@ } /** - * Basic test of -addmods ALL-SYSTEM. All system modules should be resolved + * Basic test of --add-modules ALL-SYSTEM. All system modules should be resolved * and thus all types in those modules should be visible. */ public void testAddSystemModules() throws Exception { - // java -addmods ALL-SYSTEM -mp mods1 -m test ... + // java --add-modules ALL-SYSTEM --module-path mods1 -m test ... int exitValue - = executeTestJava("-mp", MODS1_DIR.toString(), - "-addmods", "ALL-SYSTEM", + = executeTestJava("--module-path", MODS1_DIR.toString(), + "--add-modules", "ALL-SYSTEM", "-m", TEST_MID, "java.sql.Connection", "javax.annotation.Generated") @@ -140,16 +140,16 @@ /** * Run test on class path to load a type in a module on the application - * module path, uses {@code -addmods logger}. + * module path, uses {@code --add-modules logger}. */ public void testRunWithAddMods() throws Exception { - // java -mp mods -addmods logger -cp classes test.Main + // java --module-path mods --add-modules logger -cp classes test.Main String classpath = MODS1_DIR.resolve(TEST_MODULE).toString(); String modulepath = MODS2_DIR.toString(); int exitValue - = executeTestJava("-mp", modulepath, - "-addmods", LOGGER_MODULE, + = executeTestJava("--module-path", modulepath, + "--add-modules", LOGGER_MODULE, "-cp", classpath, TEST_MAIN_CLASS, "logger.Logger") @@ -162,16 +162,16 @@ /** * Run application on class path that makes use of module on the - * application module path. Does not use -addmods and so should + * application module path. Does not use --add-modules and so should * fail at run-time. */ public void testRunMissingAddMods() throws Exception { - // java -mp mods -cp classes test.Main + // java --module-path mods -cp classes test.Main String classpath = MODS1_DIR.resolve(TEST_MODULE).toString(); String modulepath = MODS1_DIR.toString(); int exitValue - = executeTestJava("-mp", modulepath, + = executeTestJava("--module-path", modulepath, "-cp", classpath, TEST_MAIN_CLASS, "logger.Logger") @@ -186,16 +186,16 @@ /** * Run test on class path to load a type in a module on the application - * module path, uses {@code -addmods ALL-MODULE-PATH}. + * module path, uses {@code --add-modules ALL-MODULE-PATH}. */ public void testAddAllModulePath() throws Exception { - // java -mp mods -addmods ALL-MODULE-PATH -cp classes test.Main + // java --module-path mods --add-modules ALL-MODULE-PATH -cp classes test.Main String classpath = MODS1_DIR.resolve(TEST_MODULE).toString(); String modulepath = MODS1_DIR.toString(); int exitValue - = executeTestJava("-mp", modulepath, - "-addmods", "ALL-MODULE-PATH", + = executeTestJava("--module-path", modulepath, + "--add-modules", "ALL-MODULE-PATH", "-cp", classpath, TEST_MAIN_CLASS) .outputTo(System.out) @@ -207,13 +207,13 @@ /** - * Test {@code -addmods ALL-MODULE-PATH} without {@code -modulepath}. + * Test {@code --add-modules ALL-MODULE-PATH} without {@code --module-path}. */ public void testAddAllModulePathWithNoModulePath() throws Exception { - // java -addmods ALL-MODULE-PATH -version + // java --add-modules ALL-MODULE-PATH -version int exitValue - = executeTestJava("-addmods", "ALL-MODULE-PATH", + = executeTestJava("--add-modules", "ALL-MODULE-PATH", "-version") .outputTo(System.out) .errorTo(System.out) @@ -224,14 +224,14 @@ /** - * Attempt to run with a bad module name specified to -addmods + * Attempt to run with a bad module name specified to --add-modules */ public void testRunWithBadAddMods() throws Exception { - // java -mp mods -addmods DoesNotExist -m test ... + // java --module-path mods --add-modules DoesNotExist -m test ... int exitValue - = executeTestJava("-mp", MODS1_DIR.toString(), - "-addmods", "DoesNotExist", + = executeTestJava("--module-path", MODS1_DIR.toString(), + "--add-modules", "DoesNotExist", "-m", TEST_MID) .outputTo(System.out) .errorTo(System.out) --- old/jdk/test/tools/launcher/modules/addmods/src/logger/logger/Logger.java 2016-08-08 16:36:26.000000000 -0700 +++ new/jdk/test/tools/launcher/modules/addmods/src/logger/logger/Logger.java 2016-08-08 16:36:25.000000000 -0700 @@ -24,7 +24,7 @@ package logger; /** - * No-op user module for use by the {@code java -addmods} tests. + * No-op user module for use by the {@code java --add-modules} tests. */ public class Logger { } --- old/jdk/test/tools/launcher/modules/addmods/src/test/test/Main.java 2016-08-08 16:36:28.000000000 -0700 +++ new/jdk/test/tools/launcher/modules/addmods/src/test/test/Main.java 2016-08-08 16:36:28.000000000 -0700 @@ -24,7 +24,7 @@ package test; /** - * Invoked by tests for the {@code java -addmods} option to check that types + * Invoked by tests for the {@code java --add-modules} option to check that types * are visible. */ public class Main { --- old/jdk/test/tools/launcher/modules/addreads/AddReadsTest.java 2016-08-08 16:36:31.000000000 -0700 +++ new/jdk/test/tools/launcher/modules/addreads/AddReadsTest.java 2016-08-08 16:36:30.000000000 -0700 @@ -27,7 +27,7 @@ * @modules jdk.compiler * @build AddReadsTest CompilerUtils JarUtils jdk.testlibrary.* * @run testng AddReadsTest - * @summary Basic tests for java -XaddReads + * @summary Basic tests for java --add-reads */ import java.nio.file.Path; @@ -45,7 +45,7 @@ * The tests consists of two modules: m1 and junit. * Code in module m1 calls into code in module junit but the module-info.java * does not have a 'requires'. Instead a read edge is added via the command - * line option -XaddReads. + * line option --add-reads. */ @Test @@ -72,7 +72,7 @@ .compile(SRC_DIR.resolve("m1"), MODS_DIR.resolve("m1"), "-cp", CLASSES_DIR.toString(), - "-XaddReads:m1=ALL-UNNAMED")); + "--add-reads", "m1=ALL-UNNAMED")); // jar cf mods/junit.jar -C classes . JarUtils.createJarFile(MODS_DIR.resolve("junit.jar"), CLASSES_DIR); @@ -91,11 +91,11 @@ */ public void testJUnitOnModulePath() throws Exception { - // java -mp mods -addmods junit -XaddReads:m1=junit -m .. + // java --module-path mods --add-modules junit --add-reads m1=junit -m .. int exitValue - = run("-mp", MODS_DIR.toString(), - "-addmods", "junit", - "-XaddReads:m1=junit", + = run("--module-path", MODS_DIR.toString(), + "--add-modules", "junit", + "--add-reads", "m1=junit", "-m", MAIN) .getExitValue(); @@ -104,17 +104,17 @@ /** - * Exercise -XaddReads:m1=ALL-UNNAMED by running with junit on the + * Exercise --add-reads m1=ALL-UNNAMED by running with junit on the * class path. */ public void testJUnitOnClassPath() throws Exception { - // java -mp mods -cp mods/junit.jar -XaddReads:m1=ALL-UNNAMED -m .. + // java --module-path mods -cp mods/junit.jar --add-reads m1=ALL-UNNAMED -m .. String cp = MODS_DIR.resolve("junit.jar").toString(); int exitValue - = run("-mp", MODS_DIR.toString(), + = run("--module-path", MODS_DIR.toString(), "-cp", cp, - "-XaddReads:m1=ALL-UNNAMED", + "--add-reads", "m1=ALL-UNNAMED", "-m", MAIN) .getExitValue(); @@ -123,14 +123,14 @@ /** - * Run with junit as a module on the module path but without -XaddReads. + * Run with junit as a module on the module path but without --add-reads. */ public void testJUnitOnModulePathMissingAddReads() throws Exception { - // java -mp mods -addmods junit -m .. + // java --module-path mods --add-modules junit --module .. int exitValue - = run("-mp", MODS_DIR.toString(), - "-addmods", "junit", - "-m", MAIN) + = run("--module-path", MODS_DIR.toString(), + "--add-modules", "junit", + "--module", MAIN) .shouldContain("IllegalAccessError") .getExitValue(); @@ -139,13 +139,13 @@ /** - * Run with junit on the class path but without -XaddReads. + * Run with junit on the class path but without --add-reads. */ public void testJUnitOnClassPathMissingAddReads() throws Exception { - // java -mp mods -cp mods/junit.jar -m .. + // java --module-path mods -cp mods/junit.jar -m .. String cp = MODS_DIR.resolve("junit.jar").toString(); int exitValue - = run("-mp", MODS_DIR.toString(), + = run("--module-path", MODS_DIR.toString(), "-cp", cp, "-m", MAIN) .shouldContain("IllegalAccessError") @@ -156,15 +156,15 @@ /** - * Exercise -XaddReads with a more than one source module. + * Exercise --add-reads with a more than one source module. */ public void testJUnitWithMultiValueOption() throws Exception { int exitValue - = run("-mp", MODS_DIR.toString(), - "-addmods", "java.xml,junit", - "-XaddReads:m1=java.xml,junit", - "-m", MAIN) + = run("--module-path", MODS_DIR.toString(), + "--add-modules", "java.xml,junit", + "--add-reads", "m1=java.xml,junit", + "--module", MAIN) .getExitValue(); assertTrue(exitValue == 0); @@ -172,31 +172,31 @@ /** - * Exercise -XaddReads where the target module is specified more than once + * Exercise --add-reads where the target module is specified more than once */ public void testWithTargetSpecifiedManyTimes() throws Exception { int exitValue - = run("-mp", MODS_DIR.toString(), - "-addmods", "java.xml,junit", - "-XaddReads:m1=java.xml", - "-XaddReads:m1=junit", - "-m", MAIN) - .shouldContain("specified more than once") - .getExitValue(); + = run("--module-path", MODS_DIR.toString(), + "--add-modules", "java.xml,junit", + "--add-reads", "m1=java.xml", + "--add-reads", "m1=junit", + "-m", MAIN) + .shouldContain("specified more than once") + .getExitValue(); assertTrue(exitValue != 0); } /** - * Exercise -XaddReads with bad values + * Exercise --add-reads with bad values */ @Test(dataProvider = "badvalues") public void testWithBadValue(String value, String ignore) throws Exception { - // -XaddExports:$VALUE -version - assertTrue(run("-XaddReads:" + value, "-version").getExitValue() != 0); + // --add-exports $VALUE -version + assertTrue(run("--add-reads", value, "-version").getExitValue() != 0); } @DataProvider(name = "badvalues") --- old/jdk/test/tools/launcher/modules/basic/BasicTest.java 2016-08-08 16:36:33.000000000 -0700 +++ new/jdk/test/tools/launcher/modules/basic/BasicTest.java 2016-08-08 16:36:33.000000000 -0700 @@ -37,7 +37,7 @@ import java.nio.file.Path; import java.nio.file.Paths; -import static jdk.testlibrary.ProcessTools.*; +import jdk.testlibrary.ProcessTools; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; @@ -72,6 +72,16 @@ assertTrue(compiled, "test module did not compile"); } + /** + * Execute "java" with the given arguments, returning the exit code. + */ + private int exec(String... args) throws Exception { + return ProcessTools.executeTestJava(args) + .outputTo(System.out) + .errorTo(System.out) + .getExitValue(); + } + /** * The initial module is loaded from an exploded module @@ -81,20 +91,28 @@ String subdir = MODS_DIR.resolve(TEST_MODULE).toString(); String mid = TEST_MODULE + "/" + MAIN_CLASS; - // java -mp mods -m $TESTMODULE/$MAINCLASS - int exitValue - = executeTestJava("-mp", dir, "-m", mid) - .outputTo(System.out) - .errorTo(System.out) - .getExitValue(); + // java --module-path mods -module $TESTMODULE/$MAINCLASS + int exitValue = exec("--module-path", dir, "--module", mid); assertTrue(exitValue == 0); - // java -mp mods/$TESTMODULE -m $TESTMODULE/$MAINCLASS - exitValue - = executeTestJava("-mp", subdir, "-m", mid) - .outputTo(System.out) - .errorTo(System.out) - .getExitValue(); + // java --module-path mods/$TESTMODULE --module $TESTMODULE/$MAINCLASS + exitValue = exec("--module-path", subdir, "--module", mid); + assertTrue(exitValue == 0); + + // java --module-path=mods --module=$TESTMODULE/$MAINCLASS + exitValue = exec("--module-path=" + dir, "--module=" + mid); + assertTrue(exitValue == 0); + + // java --module-path=mods/$TESTMODULE --module=$TESTMODULE/$MAINCLASS + exitValue = exec("--module-path=" + subdir, "--module=" + mid); + assertTrue(exitValue == 0); + + // java -p mods -m $TESTMODULE/$MAINCLASS + exitValue = exec("-p", dir, "-m", mid); + assertTrue(exitValue == 0); + + // java -p mods/$TESTMODULE -m $TESTMODULE/$MAINCLASS + exitValue = exec("-p", subdir, "-m", mid); assertTrue(exitValue == 0); } @@ -119,22 +137,14 @@ .run(args); assertTrue(success); - // java -mp mlib -m $TESTMODULE - int exitValue - = executeTestJava("-mp", dir.toString(), - "-m", TEST_MODULE) - .outputTo(System.out) - .errorTo(System.out) - .getExitValue(); + // java --module-path mlib -module $TESTMODULE + int exitValue = exec("--module-path", dir.toString(), + "--module", TEST_MODULE); assertTrue(exitValue == 0); - // java -mp mlib/m.jar -m $TESTMODULE - exitValue - = executeTestJava("-mp", jar.toString(), - "-m", TEST_MODULE) - .outputTo(System.out) - .errorTo(System.out) - .getExitValue(); + // java --module-path mlib/m.jar -module $TESTMODULE + exitValue = exec("--module-path", jar.toString(), + "--module", TEST_MODULE); assertTrue(exitValue == 0); } @@ -157,14 +167,9 @@ jdk.tools.jmod.JmodTask task = new jdk.tools.jmod.JmodTask(); assertEquals(task.run(args), 0); - // java -mp mods -m $TESTMODULE - int exitValue - = executeTestJava("-mp", dir.toString(), - "-m", TEST_MODULE) - .outputTo(System.out) - .errorTo(System.out) - .getExitValue(); - + // java --module-path mods --module $TESTMODULE + int exitValue = exec("--module-path", dir.toString(), + "--module", TEST_MODULE); assertTrue(exitValue != 0); } @@ -177,14 +182,8 @@ String mp = "DoesNotExist" + File.pathSeparator + MODS_DIR.toString(); String mid = TEST_MODULE + "/" + MAIN_CLASS; - // java -mp mods -m $TESTMODULE/$MAINCLASS - int exitValue - = executeTestJava("-mp", mp, - "-m", mid) - .outputTo(System.out) - .errorTo(System.out) - .getExitValue(); - + // java --module-path mods --module $TESTMODULE/$MAINCLASS + int exitValue = exec("--module-path", mp, "--module", mid); assertTrue(exitValue == 0); } @@ -195,15 +194,8 @@ public void testTryRunWithBadModule() throws Exception { String modulepath = MODS_DIR.toString(); - // java -mp mods -m $TESTMODULE - int exitValue - = executeTestJava("-mp", modulepath, - "-m", "rhubarb") - .outputTo(System.out) - .errorTo(System.out) - .shouldContain("not found") - .getExitValue(); - + // java --module-path mods -m $TESTMODULE + int exitValue = exec("--module-path", modulepath, "-m", "rhubarb"); assertTrue(exitValue != 0); } @@ -216,14 +208,8 @@ String modulepath = MODS_DIR.toString(); String mid = TEST_MODULE + "/p.rhubarb"; - // java -mp mods -m $TESTMODULE/$MAINCLASS - int exitValue - = executeTestJava("-mp", modulepath, - "-m", mid) - .outputTo(System.out) - .errorTo(System.out) - .getExitValue(); - + // java --module-path mods -m $TESTMODULE/$MAINCLASS + int exitValue = exec("--module-path", modulepath, "-m", mid); assertTrue(exitValue != 0); } @@ -248,15 +234,8 @@ .run(args); assertTrue(success); - // java -mp mods -m $TESTMODULE - int exitValue - = executeTestJava("-mp", dir.toString(), - "-m", TEST_MODULE) - .outputTo(System.out) - .errorTo(System.out) - .shouldContain("does not have a MainClass attribute") - .getExitValue(); - + // java --module-path mods -m $TESTMODULE + int exitValue = exec("--module-path", dir.toString(), "-m", TEST_MODULE); assertTrue(exitValue != 0); } @@ -269,14 +248,8 @@ String modulepath = MODS_DIR.toString(); String mid = "java.base/" + MAIN_CLASS; - // java -mp mods -m $TESTMODULE/$MAINCLASS - int exitValue - = executeTestJava("-mp", modulepath, - "-m", mid) - .outputTo(System.out) - .errorTo(System.out) - .getExitValue(); - + // java --module-path mods --module $TESTMODULE/$MAINCLASS + int exitValue = exec("--module-path", modulepath, "--module", mid); assertTrue(exitValue != 0); } --- old/jdk/test/tools/launcher/modules/dryrun/DryRunTest.java 2016-08-08 16:36:35.000000000 -0700 +++ new/jdk/test/tools/launcher/modules/dryrun/DryRunTest.java 2016-08-08 16:36:35.000000000 -0700 @@ -69,11 +69,11 @@ // javac -d mods/$TESTMODULE src/$TESTMODULE/** assertTrue(CompilerUtils.compile(SRC_DIR.resolve(M_MODULE), MODS_DIR, - "-modulesourcepath", SRC_DIR.toString())); + "--module-source-path", SRC_DIR.toString())); assertTrue(CompilerUtils.compile(SRC_DIR.resolve(TEST_MODULE), MODS_DIR, - "-modulesourcepath", SRC_DIR.toString())); + "--module-source-path", SRC_DIR.toString())); Files.createDirectories(LIBS_DIR); @@ -101,7 +101,7 @@ String mid = TEST_MODULE + "/" + MAIN_CLASS; // no resolution failure - int exitValue = exec("--dry-run", "-modulepath", dir, "-m", mid); + int exitValue = exec("--dry-run", "--module-path", dir, "-m", mid); assertTrue(exitValue == 0); } @@ -112,23 +112,23 @@ String dir = MODS_DIR.toString(); String mid = TEST_MODULE + "/" + MAIN_CLINIT_CLASS; - int exitValue = exec("--dry-run", "-modulepath", dir, "-m", mid); + int exitValue = exec("--dry-run", "--module-path", dir, "-m", mid); assertTrue(exitValue == 0); // expect the test to fail if main class is initialized - exitValue = exec("-modulepath", dir, "-m", mid); + exitValue = exec("--module-path", dir, "-m", mid); assertTrue(exitValue != 0); } /** - * Test non-existence module in -addmods + * Test non-existence module in --add-modules */ public void testNonExistAddModules() throws Exception { String dir = MODS_DIR.toString(); String mid = TEST_MODULE + "/" + MAIN_CLASS; - int exitValue = exec("--dry-run", "-modulepath", dir, - "-addmods", "non.existence", + int exitValue = exec("--dry-run", "--module-path", dir, + "--add-modules", "non.existence", "-m", mid); assertTrue(exitValue != 0); } @@ -163,24 +163,24 @@ LIBS_DIR.resolve(TEST_MODULE + ".jar").toString(); String mid = TEST_MODULE + "/" + MAIN_CLASS; - // test main method with and without -addmods mm - int exitValue = exec("-modulepath", LIBS_DIR.toString(), + // test main method with and without --add-modules mm + int exitValue = exec("--module-path", LIBS_DIR.toString(), "-m", mid); assertTrue(exitValue != 0); - exitValue = exec("-modulepath", LIBS_DIR.toString(), - "-addmods", M_MODULE, + exitValue = exec("--module-path", LIBS_DIR.toString(), + "--add-modules", M_MODULE, "-m", mid); assertTrue(exitValue == 0); - // test dry run with and without -addmods m + // test dry run with and without --add-modules m // no resolution failure - exitValue = exec("--dry-run", "-modulepath", LIBS_DIR.toString(), + exitValue = exec("--dry-run", "--module-path", LIBS_DIR.toString(), "-m", mid); assertTrue(exitValue == 0); - exitValue = exec("--dry-run", "-modulepath", LIBS_DIR.toString(), - "-addmods", M_MODULE, + exitValue = exec("--dry-run", "--module-path", LIBS_DIR.toString(), + "--add-modules", M_MODULE, "-m", mid); assertTrue(exitValue == 0); } @@ -193,7 +193,7 @@ String mid = TEST_MODULE + "/" + MAIN_CLASS; // resolution failure - int exitValue = exec("--dry-run", "-modulepath", subdir, "-m", mid); + int exitValue = exec("--dry-run", "--module-path", subdir, "-m", mid); assertTrue(exitValue != 0); } --- old/jdk/test/tools/launcher/modules/limitmods/LimitModsTest.java 2016-08-08 16:36:38.000000000 -0700 +++ new/jdk/test/tools/launcher/modules/limitmods/LimitModsTest.java 2016-08-08 16:36:37.000000000 -0700 @@ -27,7 +27,7 @@ * @modules java.desktop java.compact1 jdk.compiler * @build LimitModsTest CompilerUtils jdk.testlibrary.* * @run testng LimitModsTest - * @summary Basic tests for java -limitmods + * @summary Basic tests for java --limit-modules */ import java.nio.file.Path; @@ -66,13 +66,13 @@ /** - * Basic test of -limitmods to limit which platform modules are observable. + * Basic test of --limit-modules to limit which platform modules are observable. */ public void testLimitingPlatformModules() throws Exception { int exitValue; - // java -limitmods java.base -listmods - exitValue = executeTestJava("-limitmods", "java.base", "-listmods") + // java --limit-modules java.base --list-modules + exitValue = executeTestJava("--limit-modules", "java.base", "--list-modules") .outputTo(System.out) .errorTo(System.out) .shouldContain("java.base") @@ -83,8 +83,8 @@ assertTrue(exitValue == 0); - // java -limitmods java.compact1 -listmods - exitValue = executeTestJava("-limitmods", "java.compact1", "-listmods") + // java --limit-modules java.compact1 --list-modules + exitValue = executeTestJava("--limit-modules", "java.compact1", "--list-modules") .outputTo(System.out) .errorTo(System.out) .shouldContain("java.base") @@ -98,15 +98,15 @@ /** - * Test -limitmods with -addmods + * Test --limit-modules with --add-modules */ public void testWithAddMods() throws Exception { int exitValue; - // java -limitmods java.base -addmods java.logging -listmods - exitValue = executeTestJava("-limitmods", "java.base", - "-addmods", "java.logging", - "-listmods") + // java --limit-modules java.base --add-modules java.logging --list-modules + exitValue = executeTestJava("--limit-modules", "java.base", + "--add-modules", "java.logging", + "--list-modules") .outputTo(System.out) .errorTo(System.out) .shouldContain("java.base") @@ -117,11 +117,11 @@ assertTrue(exitValue == 0); - // java -limitmods java.base -addmods java.sql -listmods + // java --limit-modules java.base --add-modules java.sql --list-modules // This should fail because java.sql has dependences beyond java.base - exitValue = executeTestJava("-limitmods", "java.base", - "-addmods", "java.sql", - "-listmods") + exitValue = executeTestJava("--limit-modules", "java.base", + "--add-modules", "java.sql", + "--list-modules") .outputTo(System.out) .errorTo(System.out) .getExitValue(); @@ -131,14 +131,14 @@ /** - * Run class path application with -limitmods + * Run class path application with --limit-modules */ public void testUnnamedModule() throws Exception { String classpath = MODS_DIR.resolve(TEST_MODULE).toString(); - // java -limitmods java.base -cp mods/$TESTMODULE ... + // java --limit-modules java.base -cp mods/$TESTMODULE ... int exitValue1 - = executeTestJava("-limitmods", "java.base", + = executeTestJava("--limit-modules", "java.base", "-cp", classpath, MAIN_CLASS) .outputTo(System.out) @@ -149,9 +149,9 @@ assertTrue(exitValue1 != 0); - // java -limitmods java.base -cp mods/$TESTMODULE ... + // java --limit-modules java.base -cp mods/$TESTMODULE ... int exitValue2 - = executeTestJava("-limitmods", "java.desktop", + = executeTestJava("--limit-modules", "java.desktop", "-cp", classpath, MAIN_CLASS) .outputTo(System.out) @@ -163,16 +163,16 @@ /** - * Run named module with -limitmods + * Run named module with --limit-modules */ public void testNamedModule() throws Exception { String modulepath = MODS_DIR.toString(); String mid = TEST_MODULE + "/" + MAIN_CLASS; - // java -limitmods java.base -mp mods -m $TESTMODULE/$MAINCLASS - int exitValue = executeTestJava("-limitmods", "java.base", - "-mp", modulepath, + // java --limit-modules java.base --module-path mods -m $TESTMODULE/$MAINCLASS + int exitValue = executeTestJava("--limit-modules", "java.base", + "--module-path", modulepath, "-m", mid) .outputTo(System.out) .errorTo(System.out) @@ -180,9 +180,9 @@ assertTrue(exitValue != 0); - // java -limitmods java.desktop -mp mods -m $TESTMODULE/$MAINCLASS - exitValue = executeTestJava("-limitmods", "java.desktop", - "-mp", modulepath, + // java --limit-modules java.desktop --module-path mods -m $TESTMODULE/$MAINCLASS + exitValue = executeTestJava("--limit-modules", "java.desktop", + "--module-path", modulepath, "-m", mid) .outputTo(System.out) .errorTo(System.out) --- old/jdk/test/tools/launcher/modules/listmods/ListModsTest.java 2016-08-08 16:36:40.000000000 -0700 +++ new/jdk/test/tools/launcher/modules/listmods/ListModsTest.java 2016-08-08 16:36:39.000000000 -0700 @@ -27,7 +27,7 @@ * @modules java.se * @build ListModsTest CompilerUtils jdk.testlibrary.* * @run testng ListModsTest - * @summary Basic test for java -listmods + * @summary Basic test for java --list-modules */ import java.nio.file.Path; @@ -41,7 +41,7 @@ import static org.testng.Assert.*; /** - * Basic tests for java -listmods + * Basic tests for java --list-modules */ public class ListModsTest { @@ -55,13 +55,13 @@ public void setup() throws Exception { boolean compiled; - // javac -d mods/m1 -mp mods src/m1/** + // javac -d mods/m1 --module-path mods src/m1/** compiled = CompilerUtils.compile( SRC_DIR.resolve("m1"), MODS_DIR.resolve("m1")); assertTrue(compiled); - // javac -d upgrademods/java.transaction -mp mods src/java.transaction/** + // javac -d upgrademods/java.transaction --module-path mods src/java.transaction/** compiled = CompilerUtils.compile( SRC_DIR.resolve("java.transaction"), UPGRADEMODS_DIR.resolve("java.transaction")); @@ -73,7 +73,7 @@ @Test public void testListAll() throws Exception { OutputAnalyzer output - = executeTestJava("-listmods") + = executeTestJava("--list-modules") .outputTo(System.out) .errorTo(System.out); output.shouldContain("java.base"); @@ -85,7 +85,7 @@ @Test public void testListOneModule() throws Exception { OutputAnalyzer output - = executeTestJava("-listmods:java.base") + = executeTestJava("--list-modules=java.base") .outputTo(System.out) .errorTo(System.out); output.shouldContain("java.base"); @@ -97,7 +97,7 @@ @Test public void testListTwoModules() throws Exception { OutputAnalyzer output - = executeTestJava("-listmods:java.base,java.xml") + = executeTestJava("--list-modules", "java.base,java.xml") .outputTo(System.out) .errorTo(System.out); output.shouldContain("java.base"); @@ -111,7 +111,7 @@ @Test public void testListUnknownModule() throws Exception { OutputAnalyzer output - = executeTestJava("-listmods:java.rhubarb") + = executeTestJava("--list-modules", "java.rhubarb") .outputTo(System.out) .errorTo(System.out); output.shouldNotContain("java.base"); @@ -123,7 +123,7 @@ @Test public void testListWithModulePath() throws Exception { OutputAnalyzer output - = executeTestJava("-mp", MODS_DIR.toString(), "-listmods") + = executeTestJava("--module-path", MODS_DIR.toString(), "--list-modules") .outputTo(System.out) .errorTo(System.out); output.shouldContain("java.base"); @@ -135,8 +135,8 @@ @Test public void testListWithUpgradeModulePath() throws Exception { OutputAnalyzer output - = executeTestJava("-upgrademodulepath", UPGRADEMODS_DIR.toString(), - "-listmods:java.transaction") + = executeTestJava("--upgrade-module-path", UPGRADEMODS_DIR.toString(), + "--list-modules", "java.transaction") .outputTo(System.out) .errorTo(System.out); output.shouldContain("exports javax.transaction.atomic"); @@ -147,7 +147,7 @@ @Test public void testListWithLimitMods1() throws Exception { OutputAnalyzer output - = executeTestJava("-limitmods", "java.compact1", "-listmods") + = executeTestJava("--limit-modules", "java.compact1", "--list-modules") .outputTo(System.out) .errorTo(System.out); output.shouldContain("java.compact1"); @@ -160,9 +160,9 @@ @Test public void testListWithLimitMods2() throws Exception { OutputAnalyzer output - = executeTestJava("-mp", MODS_DIR.toString(), - "-limitmods", "java.compact1", - "-listmods") + = executeTestJava("--module-path", MODS_DIR.toString(), + "--limit-modules", "java.compact1", + "--list-modules") .outputTo(System.out) .errorTo(System.out); output.shouldContain("java.base"); @@ -172,12 +172,12 @@ /** - * java -version -listmods => should print version and exit + * java -version --list-modules => should print version and exit */ @Test public void testListWithPrintVersion1() throws Exception { OutputAnalyzer output - = executeTestJava("-version", "-listmods") + = executeTestJava("-version", "--list-modules") .outputTo(System.out) .errorTo(System.out); output.shouldNotContain("java.base"); @@ -187,12 +187,12 @@ /** - * java -listmods -version => should list modules and exit + * java --list-modules -version => should list modules and exit */ @Test public void testListWithPrintVersion2() throws Exception { OutputAnalyzer output - = executeTestJava("-listmods", "-version") + = executeTestJava("--list-modules", "-version") .outputTo(System.out) .errorTo(System.out); output.shouldContain("java.base"); --- old/jdk/test/tools/launcher/modules/patch/basic/PatchTest.java 2016-08-08 16:36:42.000000000 -0700 +++ new/jdk/test/tools/launcher/modules/patch/basic/PatchTest.java 2016-08-08 16:36:42.000000000 -0700 @@ -27,7 +27,7 @@ * @modules jdk.compiler * @build PatchTest CompilerUtils JarUtils jdk.testlibrary.* * @run testng PatchTest - * @summary Basic test for -Xpatch + * @summary Basic test for --patch-module */ import java.io.File; @@ -45,13 +45,13 @@ /** - * Compiles and launches a test that uses -Xpatch with two directories of - * classes to override existing and add new classes to modules in the - * boot layer. + * Compiles and launches a test that uses --patch-module with two directories + * of classes to override existing classes and add new classes to modules in + * the boot layer. * - * The classes overridden or added via -Xpatch all define a public no-arg - * constructor and override toString to return "hi". This allows the launched - * test to check that the overridden classes are loaded. + * The classes overridden or added via --patch-module all define a public + * no-arg constructor and override toString to return "hi". This allows the + * launched test to check that the overridden classes are loaded. */ @Test @@ -76,7 +76,7 @@ private static final Path PATCHES_DIR = Paths.get("patches"); - // the classes overridden or added with -Xpatch + // the classes overridden or added with --patch-module private static final String[] CLASSES = { // java.base = boot loader @@ -137,15 +137,15 @@ String arg = Stream.of(CLASSES).collect(Collectors.joining(",")); int exitValue - = executeTestJava("-Xpatch:java.base=" + basePatches, - "-Xpatch:jdk.naming.dns=" + dnsPatches, - "-Xpatch:jdk.compiler=" + compilerPatches, - "-XaddExports:java.base/java.lang2=test", - "-XaddExports:jdk.naming.dns/com.sun.jndi.dns=test", - "-XaddExports:jdk.naming.dns/com.sun.jndi.dns2=test", - "-XaddExports:jdk.compiler/com.sun.tools.javac2=test", - "-addmods", "jdk.naming.dns,jdk.compiler", - "-mp", MODS_DIR.toString(), + = executeTestJava("--patch-module", "java.base=" + basePatches, + "--patch-module", "jdk.naming.dns=" + dnsPatches, + "--patch-module", "jdk.compiler=" + compilerPatches, + "--add-exports", "java.base/java.lang2=test", + "--add-exports", "jdk.naming.dns/com.sun.jndi.dns=test", + "--add-exports", "jdk.naming.dns/com.sun.jndi.dns2=test", + "--add-exports", "jdk.compiler/com.sun.tools.javac2=test", + "--add-modules", "jdk.naming.dns,jdk.compiler", + "--module-path", MODS_DIR.toString(), "-m", "test/jdk.test.Main", arg) .outputTo(System.out) .errorTo(System.out) @@ -156,7 +156,7 @@ /** - * Run test with -Xpatch and exploded patches + * Run test with ---patch-module and exploded patches */ public void testWithExplodedPatches() throws Exception { @@ -175,7 +175,7 @@ /** - * Run test with -Xpatch and patches in JAR files + * Run test with ---patch-module and patches in JAR files */ public void testWithJarPatches() throws Exception { @@ -195,7 +195,7 @@ /** - * Run test with -Xpatch and patches in JAR files and exploded patches + * Run test with ---patch-module and patches in JAR files and exploded patches */ public void testWithJarAndExplodedPatches() throws Exception { --- old/jdk/test/tools/launcher/modules/patch/basic/src/test/jdk/test/Main.java 2016-08-08 16:36:45.000000000 -0700 +++ new/jdk/test/tools/launcher/modules/patch/basic/src/test/jdk/test/Main.java 2016-08-08 16:36:44.000000000 -0700 @@ -22,7 +22,7 @@ */ /** - * Used with -Xpatch to exercise the replacement or addition of classes + * Used with --patch-module to exercise the replacement or addition of classes * in modules that are linked into the runtime image. */ --- old/jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java 2016-08-08 16:36:47.000000000 -0700 +++ new/jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java 2016-08-08 16:36:47.000000000 -0700 @@ -69,7 +69,7 @@ for (String name : modules) { assertTrue(CompilerUtils.compile(src.resolve(name), MODS_DIR, - "-modulesourcepath", src.toString())); + "--module-source-path", src.toString())); } // compile patched source @@ -93,16 +93,16 @@ Path home = Paths.get(JAVA_HOME); runTest(home, - "-mp", MODS_DIR.toString(), + "--module-path", MODS_DIR.toString(), "-m", "m1/p1.Main", "1"); runTest(home, - "-Xpatch:java.base=" + patchedJavaBase.toString(), - "-mp", MODS_DIR.toString(), + "--patch-module", "java.base=" + patchedJavaBase, + "--module-path", MODS_DIR.toString(), "-m", "m1/p1.Main", "1"); runTest(home, - "-Xpatch:m2=" + patchedM2.toString(), - "-mp", MODS_DIR.toString(), + "--patch-module", "m2=" + patchedM2.toString(), + "--module-path", MODS_DIR.toString(), "-m", "m1/p1.Main", "2"); } @@ -117,10 +117,10 @@ runTest(IMAGE, "-m", "m1/p1.Main", "1"); runTest(IMAGE, - "-Xpatch:java.base=" + patchedJavaBase.toString(), + "--patch-module", "java.base=" + patchedJavaBase, "-m", "m1/p1.Main", "1"); runTest(IMAGE, - "-Xpatch:m2=" + patchedM2.toString(), + "--patch-module", "m2=" + patchedM2.toString(), "-m", "m1/p1.Main", "2"); } @@ -138,12 +138,12 @@ // Fail to upgrade m1.jar with mismatched hash runTestWithExitCode(getJava(IMAGE), - "-upgrademodulepath", m1.toString(), + "--upgrade-module-path", m1.toString(), "-m", "m1/p1.Main"); runTestWithExitCode(getJava(IMAGE), - "-Xpatch:java.base=" + PATCH_DIR.resolve(JAVA_BASE).toString(), - "-upgrademodulepath", m1.toString(), + "--patch-module", "java.base=" + PATCH_DIR.resolve(JAVA_BASE), + "--upgrade-module-path", m1.toString(), "-m", "m1/p1.Main", "1"); } @@ -185,14 +185,14 @@ jar("--create", "--file=" + m2.toString(), - "--modulepath", JARS_DIR.toString(), + "--module-path", JARS_DIR.toString(), "--hash-modules", "m1", "-C", MODS_DIR.resolve("m2").toString(), "."); String mpath = JARS_DIR.toString() + File.pathSeparator + JMODS.toString(); - execTool("jlink", "--modulepath", mpath, - "--addmods", "m1", + execTool("jlink", "--module-path", mpath, + "--add-modules", "m1", "--output", IMAGE.toString()); } @@ -216,7 +216,7 @@ } static String getJava(Path image) { - boolean isWindows = System.getProperty("os.name").toLowerCase().startsWith("win"); + boolean isWindows = System.getProperty("os.name").startsWith("Windows"); Path java = image.resolve("bin").resolve(isWindows ? "java.exe" : "java"); if (Files.notExists(java)) throw new RuntimeException(java + " not found"); --- old/jdk/test/tools/launcher/modules/patch/systemmodules/src1/java.base/jdk/internal/modules/SystemModules.java 2016-08-08 16:36:50.000000000 -0700 +++ new/jdk/test/tools/launcher/modules/patch/systemmodules/src1/java.base/jdk/internal/modules/SystemModules.java 2016-08-08 16:36:49.000000000 -0700 @@ -24,7 +24,7 @@ package jdk.internal.module; /* - * Test -Xpatch:java.base=jdk/modules/java.base to override + * Test --patch-module java.base=jdk/modules/java.base to override * java.base with an exploded image */ public final class SystemModules { --- old/jdk/test/tools/launcher/modules/upgrademodulepath/UpgradeModulePathTest.java 2016-08-08 16:36:53.000000000 -0700 +++ new/jdk/test/tools/launcher/modules/upgrademodulepath/UpgradeModulePathTest.java 2016-08-08 16:36:52.000000000 -0700 @@ -27,7 +27,7 @@ * @modules jdk.compiler * @build UpgradeModulePathTest CompilerUtils jdk.testlibrary.* * @run testng UpgradeModulePathTest - * @summary Basic test for java -upgrademodulepath + * @summary Basic test for java --upgrade-module-path */ import java.io.File; @@ -65,19 +65,19 @@ MODS_DIR.resolve("java.enterprise")); assertTrue(compiled); - // javac -d upgrademods/java.transaction -mp mods src/java.transaction/** + // javac -d upgrademods/java.transaction --module-path mods src/java.transaction/** compiled = CompilerUtils.compile( SRC_DIR.resolve("java.transaction"), UPGRADEDMODS_DIR.resolve("java.transaction"), - "-mp", MODS_DIR.toString()); + "--module-path", MODS_DIR.toString()); assertTrue(compiled); - // javac -d mods -upgrademodulepath upgrademods -mp mods src/test/** + // javac -d mods --upgrade-module-path upgrademods --module-path mods src/test/** compiled = CompilerUtils.compile( SRC_DIR.resolve("test"), MODS_DIR.resolve("test"), - "-upgrademodulepath", UPGRADEDMODS_DIR.toString(), - "-mp", MODS_DIR.toString()); + "--upgrade-module-path", UPGRADEDMODS_DIR.toString(), + "--module-path", MODS_DIR.toString()); assertTrue(compiled); } @@ -92,8 +92,8 @@ int exitValue = executeTestJava( - "-upgrademodulepath", UPGRADEDMODS_DIR.toString(), - "-mp", MODS_DIR.toString(), + "--upgrade-module-path", UPGRADEDMODS_DIR.toString(), + "--module-path", MODS_DIR.toString(), "-m", mid) .outputTo(System.out) .errorTo(System.out) @@ -116,8 +116,8 @@ int exitValue = executeTestJava( - "-upgrademodulepath", upgrademodulepath, - "-mp", MODS_DIR.toString(), + "--upgrade-module-path", upgrademodulepath, + "--module-path", MODS_DIR.toString(), "-m", mid) .outputTo(System.out) .errorTo(System.out) --- old/jdk/test/tools/lib/tests/Helper.java 2016-08-08 16:36:56.000000000 -0700 +++ new/jdk/test/tools/lib/tests/Helper.java 2016-08-08 16:36:55.000000000 -0700 @@ -164,7 +164,7 @@ Path srcMod = src.resolve(moduleName); JImageGenerator.generateModuleInfo(srcMod, packages, dependencies); Path destination = classes.resolve(moduleName); - if (!JImageGenerator.compile(srcMod, destination, "-modulepath", modulePath, "-g")) { + if (!JImageGenerator.compile(srcMod, destination, "--module-path", modulePath, "-g")) { throw new AssertionError("Compilation failure"); } return destination; --- old/jdk/test/tools/lib/tests/JImageGenerator.java 2016-08-08 16:36:58.000000000 -0700 +++ new/jdk/test/tools/lib/tests/JImageGenerator.java 2016-08-08 16:36:57.000000000 -0700 @@ -106,10 +106,10 @@ private static final String POST_PROCESS_OPTION = "--post-process-path"; private static final String MAIN_CLASS_OPTION = "--main-class"; private static final String CLASS_PATH_OPTION = "--class-path"; - private static final String MODULE_PATH_OPTION = "--modulepath"; - private static final String ADD_MODS_OPTION = "--addmods"; - private static final String LIMIT_MODS_OPTION = "--limitmods"; - private static final String PLUGINS_MODULE_PATH = "--plugin-module-path"; + private static final String MODULE_PATH_OPTION = "--module-path"; + private static final String ADD_MODULES_OPTION = "--add-modules"; + private static final String LIMIT_MODULES_OPTION = "--limit-modules"; + private static final String PLUGIN_MODULE_PATH = "--plugin-module-path"; private static final String CMDS_OPTION = "--cmds"; private static final String CONFIG_OPTION = "--config"; @@ -534,7 +534,7 @@ options.add(dir.toString()); } if (!pluginModulePath.isEmpty()) { - options.add(PLUGINS_MODULE_PATH); + options.add(PLUGIN_MODULE_PATH); options.add(toPath(pluginModulePath)); } options.addAll(this.options); @@ -632,11 +632,11 @@ options.add(output.toString()); } if (!addMods.isEmpty()) { - options.add(ADD_MODS_OPTION); + options.add(ADD_MODULES_OPTION); options.add(addMods.stream().collect(Collectors.joining(","))); } if (!limitMods.isEmpty()) { - options.add(LIMIT_MODS_OPTION); + options.add(LIMIT_MODULES_OPTION); options.add(limitMods.stream().collect(Collectors.joining(","))); } if (!jars.isEmpty() || !jmods.isEmpty()) { @@ -648,7 +648,7 @@ options.add(modulePath); } if (!pluginModulePath.isEmpty()) { - options.add(PLUGINS_MODULE_PATH); + options.add(PLUGIN_MODULE_PATH); options.add(toPath(pluginModulePath)); } options.addAll(this.options); --- old/jdk/test/tools/pack200/Utils.java 2016-08-08 16:37:01.000000000 -0700 +++ new/jdk/test/tools/pack200/Utils.java 2016-08-08 16:37:00.000000000 -0700 @@ -111,7 +111,7 @@ compiler("-d", XCLASSES.getName(), - "-XaddExports:jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED", + "--add-exports=jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED", "@" + tmpFile.getAbsolutePath()); jar("cvfe", @@ -148,7 +148,7 @@ init(); List cmds = new ArrayList(); cmds.add(getJavaCmd()); - cmds.add("-XaddExports:jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED"); + cmds.add("--add-exports=jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED"); cmds.add("-cp"); cmds.add(VerifierJar.getName()); cmds.add("sun.tools.pack.verify.Main"); --- old/jdk/test/tools/pack200/pack200-verifier/make/build.xml 2016-08-08 16:37:03.000000000 -0700 +++ new/jdk/test/tools/pack200/pack200-verifier/make/build.xml 2016-08-08 16:37:02.000000000 -0700 @@ -27,7 +27,7 @@ destdir="${build}/classes" verbose="no" debug="on"> - + --- old/langtools/make/tools/crules/MutableFieldsAnalyzer.java 2016-08-08 16:37:05.000000000 -0700 +++ new/langtools/make/tools/crules/MutableFieldsAnalyzer.java 2016-08-08 16:37:04.000000000 -0700 @@ -107,6 +107,8 @@ "layerClass", "bootMethod", "defineModulesWithOneLoaderMethod", "configurationMethod"); ignoreFields("com.sun.tools.javac.util.JDK9Wrappers$ServiceLoaderHelper", "loadMethod"); + ignoreFields("com.sun.tools.javac.util.JDK9Wrappers$VMHelper", + "vmClass", "getRuntimeArgumentsMethod"); ignoreFields("com.sun.tools.javac.util.ModuleHelper", "addExportsMethod", "getUnnamedModuleMethod", "getModuleMethod"); } --- old/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTool.java 2016-08-08 16:37:07.000000000 -0700 +++ new/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTool.java 2016-08-08 16:37:07.000000000 -0700 @@ -179,10 +179,10 @@ args.init("javac", options, classes, compilationUnits); // init multi-release jar handling - if (fileManager.isSupportedOption(Option.MULTIRELEASE.text) == 1) { + if (fileManager.isSupportedOption(Option.MULTIRELEASE.primaryName) == 1) { Target target = Target.instance(context); List list = List.of(target.multiReleaseValue()); - fileManager.handleOption(Option.MULTIRELEASE.text, list.iterator()); + fileManager.handleOption(Option.MULTIRELEASE.primaryName, list.iterator()); } return new JavacTaskImpl(context); @@ -212,8 +212,9 @@ public int isSupportedOption(String option) { Set