Merge epsilon-gc-branch
authorshade
Mon, 11 Jun 2018 09:29:44 +0200
branchepsilon-gc-branch
changeset 56719 a846e7bbcdfa
parent 56675 483d23cdc9e5 (current diff)
parent 50499 65e65d5905bc (diff)
child 56737 24339b23a56b
Merge
src/hotspot/cpu/aarch64/templateTable_aarch64.cpp
src/hotspot/cpu/ppc/templateTable_ppc_64.cpp
src/hotspot/cpu/s390/templateTable_s390.cpp
src/hotspot/os_cpu/aix_ppc/orderAccess_aix_ppc.inline.hpp
src/hotspot/os_cpu/bsd_x86/orderAccess_bsd_x86.inline.hpp
src/hotspot/os_cpu/bsd_zero/orderAccess_bsd_zero.inline.hpp
src/hotspot/os_cpu/linux_aarch64/orderAccess_linux_aarch64.inline.hpp
src/hotspot/os_cpu/linux_arm/orderAccess_linux_arm.inline.hpp
src/hotspot/os_cpu/linux_ppc/orderAccess_linux_ppc.inline.hpp
src/hotspot/os_cpu/linux_s390/orderAccess_linux_s390.inline.hpp
src/hotspot/os_cpu/linux_sparc/orderAccess_linux_sparc.inline.hpp
src/hotspot/os_cpu/linux_x86/orderAccess_linux_x86.inline.hpp
src/hotspot/os_cpu/linux_zero/orderAccess_linux_zero.inline.hpp
src/hotspot/os_cpu/solaris_sparc/orderAccess_solaris_sparc.inline.hpp
src/hotspot/os_cpu/solaris_x86/orderAccess_solaris_x86.inline.hpp
src/hotspot/os_cpu/windows_x86/orderAccess_windows_x86.inline.hpp
src/hotspot/share/gc/shared/collectedHeap.hpp
src/hotspot/share/precompiled/precompiled.hpp
src/hotspot/share/runtime/arguments.cpp
src/hotspot/share/runtime/arguments.hpp
src/hotspot/share/runtime/globals.hpp
src/hotspot/share/runtime/orderAccess.inline.hpp
src/hotspot/share/services/memoryManager.cpp
src/java.base/aix/native/libjsig/jsig.c
src/java.desktop/macosx/native/libsplashscreen/libpng/zlib.h
src/java.desktop/share/classes/sun/applet/AppletEvent.java
src/java.desktop/share/classes/sun/applet/AppletEventMulticaster.java
src/java.desktop/share/classes/sun/applet/AppletIOException.java
src/java.desktop/share/classes/sun/applet/AppletIllegalArgumentException.java
src/java.desktop/share/classes/sun/applet/AppletImageRef.java
src/java.desktop/share/classes/sun/applet/AppletListener.java
src/java.desktop/share/classes/sun/applet/AppletMessageHandler.java
src/java.desktop/share/classes/sun/applet/AppletObjectInputStream.java
src/java.desktop/share/classes/sun/applet/AppletPanel.java
src/java.desktop/share/classes/sun/applet/AppletProps.java
src/java.desktop/share/classes/sun/applet/AppletResourceLoader.java
src/java.desktop/share/classes/sun/applet/AppletSecurityException.java
src/java.desktop/share/classes/sun/applet/AppletViewer.java
src/java.desktop/share/classes/sun/applet/AppletViewerFactory.java
src/java.desktop/share/classes/sun/applet/AppletViewerPanel.java
src/java.desktop/share/classes/sun/applet/Main.java
src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer.java
src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_de.java
src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_es.java
src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_fr.java
src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_it.java
src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_ja.java
src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_ko.java
src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_pt_BR.java
src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_sv.java
src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_zh_CN.java
src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_zh_TW.java
src/java.desktop/share/classes/sun/print/DialogOnTop.java
src/java.desktop/share/classes/sun/print/DialogOwner.java
src/java.sql.rowset/share/classes/javax/sql/rowset/package.html
src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package.html
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/StringTable.java
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java
src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/MissingRequiredOptionException.java
src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/UnacceptableNumberOfNonOptionsException.java
src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/Objects.java
test/hotspot/jtreg/serviceability/sa/TestUniverse.java
test/jdk/javax/swing/JLayer/8041982/cupanim.gif
test/jdk/javax/swing/JSlider/4987336/cupanim.gif
test/jdk/sun/applet/DeprecatedAppletViewer/DeprecatedAppletViewer.java
test/jdk/sun/applet/TEST.properties
--- a/.hgtags	Wed Jun 06 10:32:59 2018 +0200
+++ b/.hgtags	Mon Jun 11 09:29:44 2018 +0200
@@ -488,3 +488,4 @@
 3595bd343b65f8c37818ebe6a4c343ddeb1a5f88 jdk-11+14
 a11c1cb542bbd1671d25b85efe7d09b983c48525 jdk-11+15
 02934b0d661b82b7fe1052a04998d2091352e08d jdk-11+16
+64e4b1686141e57a681936a8283983341484676e jdk-11+17
--- a/doc/building.html	Wed Jun 06 10:32:59 2018 +0200
+++ b/doc/building.html	Mon Jun 11 09:29:44 2018 +0200
@@ -505,7 +505,7 @@
 <ul>
 <li><code>hotspot</code> - Build all of hotspot (but only hotspot)</li>
 <li><code>hotspot-&lt;variant&gt;</code> - Build just the specified jvm variant</li>
-<li><code>images</code> or <code>product-images</code> - Build the JRE and JDK images</li>
+<li><code>images</code> or <code>product-images</code> - Build the JDK image</li>
 <li><code>docs</code> or <code>docs-image</code> - Build the documentation image</li>
 <li><code>test-image</code> - Build the test image</li>
 <li><code>all</code> or <code>all-images</code> - Build all images (product, docs and test)</li>
@@ -639,7 +639,7 @@
 <p>OpenJDK contains two different ports for the aarch64 platform, one is the original aarch64 port from the <a href="http://openjdk.java.net/projects/aarch64-port">AArch64 Port Project</a> and one is a 64-bit version of the Oracle contributed ARM port. When targeting aarch64, by the default the original aarch64 port is used. To select the Oracle ARM 64 port, use <code>--with-cpu-port=arm64</code>. Also set the corresponding value (<code>aarch64</code> or <code>arm64</code>) to --with-abi-profile, to ensure a consistent build.</p>
 <h3 id="verifying-the-build">Verifying the Build</h3>
 <p>The build will end up in a directory named like <code>build/linux-arm-normal-server-release</code>.</p>
-<p>Inside this build output directory, the <code>images/jdk</code> and <code>images/jre</code> will contain the newly built JDK and JRE, respectively, for your <em>target</em> system.</p>
+<p>Inside this build output directory, the <code>images/jdk</code> will contain the newly built JDK, for your <em>target</em> system.</p>
 <p>Copy these folders to your <em>target</em> system. Then you can run e.g. <code>images/jdk/bin/java -version</code>.</p>
 <h2 id="build-performance">Build Performance</h2>
 <p>Building OpenJDK requires a lot of horsepower. Some of the build tools can be adjusted to utilize more or less of resources such as parallel threads and memory. The <code>configure</code> script analyzes your system and selects reasonable values for such options based on your hardware. If you encounter resource problems, such as out of memory conditions, you can modify the detected values with:</p>
--- a/doc/building.md	Wed Jun 06 10:32:59 2018 +0200
+++ b/doc/building.md	Mon Jun 11 09:29:44 2018 +0200
@@ -747,7 +747,7 @@
 
   * `hotspot` - Build all of hotspot (but only hotspot)
   * `hotspot-<variant>` - Build just the specified jvm variant
-  * `images` or `product-images` - Build the JRE and JDK images
+  * `images` or `product-images` - Build the JDK image
   * `docs` or `docs-image` - Build the documentation image
   * `test-image` - Build the test image
   * `all` or `all-images` - Build all images (product, docs and test)
@@ -1039,8 +1039,8 @@
 The build will end up in a directory named like
 `build/linux-arm-normal-server-release`.
 
-Inside this build output directory, the `images/jdk` and `images/jre` will
-contain the newly built JDK and JRE, respectively, for your *target* system.
+Inside this build output directory, the `images/jdk` will contain the newly
+built JDK, for your *target* system.
 
 Copy these folders to your *target* system. Then you can run e.g.
 `images/jdk/bin/java -version`.
--- a/make/Bundles.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/Bundles.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -146,19 +146,13 @@
 # correct base directories.
 ifeq ($(OPENJDK_TARGET_OS)-$(DEBUG_LEVEL), macosx-release)
   JDK_IMAGE_DIR := $(JDK_MACOSX_BUNDLE_DIR)
-  JRE_IMAGE_DIR := $(JRE_MACOSX_BUNDLE_DIR)
   JDK_IMAGE_HOMEDIR := $(JDK_MACOSX_CONTENTS_DIR)/Home
-  JRE_IMAGE_HOMEDIR := $(JRE_MACOSX_CONTENTS_DIR)/Home
   JDK_BUNDLE_SUBDIR :=
-  JRE_BUNDLE_SUBDIR :=
 else
   JDK_IMAGE_HOMEDIR := $(JDK_IMAGE_DIR)
-  JRE_IMAGE_HOMEDIR := $(JRE_IMAGE_DIR)
   JDK_BUNDLE_SUBDIR := jdk-$(VERSION_NUMBER)
-  JRE_BUNDLE_SUBDIR := jre-$(VERSION_NUMBER)
   ifneq ($(DEBUG_LEVEL), release)
     JDK_BUNDLE_SUBDIR := $(JDK_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
-    JRE_BUNDLE_SUBDIR := $(JRE_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
   endif
 endif
 
@@ -204,26 +198,6 @@
 
   TEST_DEMOS_BUNDLE_FILES := $(filter $(JDK_IMAGE_HOMEDIR)/demo/%, $(ALL_JDK_FILES))
 
-  ALL_JRE_FILES := $(call CacheFind, $(JRE_IMAGE_DIR))
-
-  # Create special filter rules when dealing with unzipped .dSYM directories on
-  # macosx
-  ifeq ($(OPENJDK_TARGET_OS), macosx)
-    ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), false)
-      JRE_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \
-          $(call containing, .dSYM/, $(patsubst $(JRE_IMAGE_DIR)/%, %, $(ALL_JRE_FILES))))
-    endif
-  endif
-
-  JRE_BUNDLE_FILES := $(filter-out \
-      $(JRE_SYMBOLS_EXCLUDE_PATTERN) \
-      $(SYMBOLS_EXCLUDE_PATTERN), \
-      $(ALL_JRE_FILES))
-  JRE_SYMBOLS_BUNDLE_FILES := $(filter \
-      $(JRE_SYMBOLS_EXCLUDE_PATTERN) \
-      $(SYMBOLS_EXCLUDE_PATTERN), \
-      $(ALL_JRE_FILES))
-
   $(eval $(call SetupBundleFile, BUILD_JDK_BUNDLE, \
       BUNDLE_NAME := $(JDK_BUNDLE_NAME), \
       FILES := $(JDK_BUNDLE_FILES), \
@@ -234,15 +208,6 @@
 
   PRODUCT_TARGETS += $(BUILD_JDK_BUNDLE)
 
-  $(eval $(call SetupBundleFile, BUILD_JRE_BUNDLE, \
-      BUNDLE_NAME := $(JRE_BUNDLE_NAME), \
-      FILES := $(JRE_BUNDLE_FILES), \
-      BASE_DIRS := $(JRE_IMAGE_DIR), \
-      SUBDIR := $(JRE_BUNDLE_SUBDIR), \
-  ))
-
-  PRODUCT_TARGETS += $(BUILD_JRE_BUNDLE)
-
   $(eval $(call SetupBundleFile, BUILD_JDK_SYMBOLS_BUNDLE, \
       BUNDLE_NAME := $(JDK_SYMBOLS_BUNDLE_NAME), \
       FILES := $(JDK_SYMBOLS_BUNDLE_FILES), \
@@ -253,16 +218,6 @@
 
   PRODUCT_TARGETS += $(BUILD_JDK_SYMBOLS_BUNDLE)
 
-  $(eval $(call SetupBundleFile, BUILD_JRE_SYMBOLS_BUNDLE, \
-      BUNDLE_NAME := $(JRE_SYMBOLS_BUNDLE_NAME), \
-      FILES := $(JRE_SYMBOLS_BUNDLE_FILES), \
-      BASE_DIRS := $(JRE_IMAGE_DIR), \
-      SUBDIR := $(JRE_BUNDLE_SUBDIR), \
-      UNZIP_DEBUGINFO := true, \
-  ))
-
-  PRODUCT_TARGETS += $(BUILD_JRE_SYMBOLS_BUNDLE)
-
   # The demo bundle is only created to support client tests. Ideally it should
   # be built with the main test bundle, but since the prerequisites match
   # better with the product build, it makes more sense to keep it there for now.
--- a/make/CompileJavaModules.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/CompileJavaModules.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -325,6 +325,10 @@
 
 ################################################################################
 
+jdk.internal.opt_COPY += .properties
+
+################################################################################
+
 jdk.jcmd_COPY += _options
 
 ################################################################################
--- a/make/Help.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/Help.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -40,10 +40,10 @@
 	$(info $(_)                        # image (alias for jdk or exploded-image))
 	$(info $(_) make all               # Create all images: product, test, docs)
 	$(info $(_)                        # (alias for all-images))
-	$(info $(_) make images            # Create complete jdk and jre images)
+	$(info $(_) make images            # Create a complete jdk image)
 	$(info $(_)                        # (alias for product-images))
 	$(info $(_) make <name>-image      # Build just the image for any of: )
-	$(info $(_)                        # jdk, jre, test, docs, symbols)
+	$(info $(_)                        # jdk, test, docs, symbols, legacy-jre)
 	$(info $(_) make <phase>           # Build the specified phase and everything it depends on)
 	$(info $(_)                        # (gensrc, java, copy, libs, launchers, gendata, rmic))
 	$(info $(_) make *-only            # Applies to most targets and disables building the)
--- a/make/Images.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/Images.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -90,7 +90,7 @@
 
 $(JDK_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \
     $(call DependOnVariable, JDK_MODULES_LIST) $(BASE_RELEASE_FILE)
-	$(ECHO) Creating jdk jimage
+	$(ECHO) Creating jdk image
 	$(RM) -r $(JDK_IMAGE_DIR)
 	$(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/images/jdk, \
 	    $(JLINK_TOOL) --add-modules $(JDK_MODULES_LIST) \
@@ -101,7 +101,7 @@
 
 $(JRE_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \
     $(call DependOnVariable, JRE_MODULES_LIST) $(BASE_RELEASE_FILE)
-	$(ECHO) Creating jre jimage
+	$(ECHO) Creating legacy jre image
 	$(RM) -r $(JRE_IMAGE_DIR)
 	$(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/images/jre, \
 	    $(JLINK_TOOL) --add-modules $(JRE_MODULES_LIST) \
--- a/make/Main.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/Main.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -328,14 +328,17 @@
 jdk-image:
 	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk jdk)
 
-jre-image:
+legacy-jre-image:
 	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk jre)
 
 symbols-image:
 	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk symbols)
 
-mac-bundles-jdk:
-	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk)
+mac-jdk-bundle:
+	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk jdk-bundle)
+
+mac-legacy-jre-bundle:
+	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk jre-bundle)
 
 release-file:
 	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ReleaseFile.gmk)
@@ -344,8 +347,8 @@
 	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ExplodedImageOptimize.gmk)
 
 ALL_TARGETS += store-source-revision create-source-revision-tracker bootcycle-images zip-security \
-    zip-source jrtfs-jar jdk-image jre-image \
-    symbols-image mac-bundles-jdk \
+    zip-source jrtfs-jar jdk-image legacy-jre-image \
+    symbols-image mac-jdk-bundle mac-legacy-jre-bundle \
     release-file exploded-image-optimize
 
 ################################################################################
@@ -776,16 +779,17 @@
     generate-link-opt-data: buildtools-jdk
 
     # The generated classlist needs to go into java.base-jmod.
-    java.base-jmod jdk.jlink-jmod jdk-image jre-image: generate-link-opt-data
+    java.base-jmod jdk.jlink-jmod jdk-image legacy-jre-image: generate-link-opt-data
   endif
 
   release-file: create-source-revision-tracker
 
   jdk-image: jmods zip-source demos release-file
-  jre-image: jmods release-file
+  legacy-jre-image: jmods release-file
   symbols-image: $(LIBS_TARGETS) $(LAUNCHER_TARGETS)
 
-  mac-bundles-jdk: jdk-image jre-image
+  mac-jdk-bundle: jdk-image
+  mac-legacy-jre-bundle: legacy-jre-image
 
   # The optimize target can run as soon as the modules dir has been completely
   # populated (java, copy and gendata targets) and the basic libs and launchers
@@ -956,14 +960,14 @@
 # alias for backwards compatibility
 docs-javadoc: docs-jdk-api
 
-mac-bundles: mac-bundles-jdk
+mac-bundles: mac-jdk-bundle
 
 # The $(OUTPUTDIR)/images directory contain the resulting deliverables,
 # and in line with this, our targets for creating these are named *-image[s].
 
-# This target builds the product images, e.g. the JRE and JDK image
+# This target builds the product images, e.g. the JDK image
 # (and possibly other, more specific versions)
-product-images: jdk-image jre-image symbols-image exploded-image
+product-images: jdk-image symbols-image exploded-image
 
 # zip-security is actually a bundle, but for now it needs to be considered
 # an image until this can be cleaned up properly.
@@ -980,7 +984,7 @@
 endif
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  product-images: mac-bundles
+  product-images: mac-jdk-bundle
 endif
 
 # This target builds the documentation image
--- a/make/autoconf/spec.gmk.in	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/autoconf/spec.gmk.in	Mon Jun 11 09:29:44 2018 +0200
@@ -859,17 +859,13 @@
   DEBUG_PART := -$(DEBUG_LEVEL)
 endif
 JDK_BUNDLE_NAME := jdk-$(BASE_NAME)_bin$(DEBUG_PART).tar.gz
-JRE_BUNDLE_NAME := jre-$(BASE_NAME)_bin$(DEBUG_PART).tar.gz
 JDK_SYMBOLS_BUNDLE_NAME := jdk-$(BASE_NAME)_bin$(DEBUG_PART)-symbols.tar.gz
-JRE_SYMBOLS_BUNDLE_NAME := jre-$(BASE_NAME)_bin$(DEBUG_PART)-symbols.tar.gz
 TEST_DEMOS_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-tests-demos$(DEBUG_PART).tar.gz
 TEST_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-tests$(DEBUG_PART).tar.gz
 DOCS_BUNDLE_NAME := jdk-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz
 
 JDK_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JDK_BUNDLE_NAME)
-JRE_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(JRE_BUNDLE_NAME)
 JDK_SYMBOLS_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(JDK_SYMBOLS_BUNDLE_NAME)
-JRE_SYMBOLS_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(JRE_SYMBOLS_BUNDLE_NAME)
 TEST_DEMOS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(TEST_DEMOS_BUNDLE_NAME)
 TEST_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(TEST_BUNDLE_NAME)
 DOCS_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(DOCS_BUNDLE_NAME)
--- a/make/common/JdkNativeCompilation.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/common/JdkNativeCompilation.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -32,6 +32,36 @@
 
 include NativeCompilation.gmk
 
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, common/JdkNativeCompilation.gmk))
+
+FindSrcDirsForLib += \
+  $(call uniq, $(wildcard \
+      $(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/lib$(strip $2) \
+      $(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/native/lib$(strip $2) \
+      $(TOPDIR)/src/$(strip $1)/share/native/lib$(strip $2)))
+
+FindSrcDirsForComponent += \
+  $(call uniq, $(wildcard \
+      $(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/$(strip $2) \
+      $(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/native/$(strip $2) \
+      $(TOPDIR)/src/$(strip $1)/share/native/$(strip $2)))
+
+GetJavaHeaderDir = \
+  $(wildcard $(SUPPORT_OUTPUTDIR)/headers/$(strip $1))
+
+# Process a dir description such as "java.base:headers" into a set of proper absolute paths.
+ProcessDir = \
+  $(if $(findstring :, $1), \
+    $(call FindSrcDirsForComponent, $(firstword $(subst :, , $1)), $(lastword $(subst :, , $1))) \
+  , \
+    $(if $(filter /%, $1), \
+      $1 \
+    , \
+      $(call FindSrcDirsForComponent, $(MODULE), $1) \
+    ) \
+  )
+
 # Setup make rules for creating a native shared library with suitable defaults
 # for the OpenJDK project.
 #
@@ -39,8 +69,16 @@
 # and the targets generated are listed in a variable by that name.
 #
 # Remaining parameters are named arguments. These are all passed on to
-# SetupNativeCompilation, except for 
+# SetupNativeCompilation, except for
 #   EXTRA_RC_FLAGS -- additional RC_FLAGS to append.
+#   EXTRA_HEADER_DIRS -- additional directories to look for headers in
+#   EXTRA_SRC -- additional directories to look for source in
+#   EXCLUDE_SRC_PATTERNS -- exclude source dirs matching these patterns from
+#     appearing in SRC.
+#   HEADERS_FROM_SRC -- if false, does not add source dirs automatically as
+#     header include dirs. (Defaults to true.)
+#   SRC -- this is passed on, but preprocessed to accept source dir designations
+#     such as "java.base:headers".
 SetupJdkLibrary = $(NamedParamsMacroTemplate)
 define SetupJdkLibraryBody
   ifeq ($$($1_OUTPUT_DIR), )
@@ -51,6 +89,20 @@
     $1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/lib$$($1_NAME)
   endif
 
+  ifeq ($$($1_SRC), )
+    $1_SRC := $$(call FindSrcDirsForLib, $$(MODULE), $$($1_NAME))
+  else
+    $1_SRC := $$(foreach dir, $$($1_SRC), $$(call ProcessDir, $$(dir)))
+  endif
+  ifneq ($$($1_EXTRA_SRC), )
+    $1_SRC += $$(foreach dir, $$($1_EXTRA_SRC), $$(call ProcessDir, $$(dir)))
+  endif
+
+  ifneq ($$($1_EXCLUDE_SRC_PATTERNS), )
+    $1_EXCLUDE_SRC := $$(call containing, $$($1_EXCLUDE_SRC_PATTERNS), $$($1_SRC))
+    $1_SRC := $$(filter-out $$($1_EXCLUDE_SRC), $$($1_SRC))
+  endif
+
   ifeq ($$($1_VERSIONINFO_RESOURCE), )
     $1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE)
   else ifeq ($$($1_VERSIONINFO_RESOURCE), DISABLE)
@@ -66,6 +118,25 @@
     $1_RC_FLAGS :=
   endif
 
+  ifneq ($$($1_HEADERS_FROM_SRC), false)
+    $1_SRC_HEADER_FLAGS := $$(foreach dir, $$(wildcard $$($1_SRC) \
+        $$(call GetJavaHeaderDir, $$(MODULE))), -I$$(dir))
+  endif
+  ifneq ($$($1_EXTRA_HEADER_DIRS), )
+    $1_PROCESSED_EXTRA_HEADER_DIRS := $$(foreach dir, $$($1_EXTRA_HEADER_DIRS), \
+        $$(call ProcessDir, $$(dir)))
+    $1_EXTRA_HEADER_FLAGS := $$(addprefix -I, $$($1_PROCESSED_EXTRA_HEADER_DIRS))
+  endif
+
+  ifneq ($$($1_CFLAGS), )
+    $1_CFLAGS += $$($1_SRC_HEADER_FLAGS) $$($1_EXTRA_HEADER_FLAGS)
+  endif
+  ifneq ($$($1_CXXFLAGS), )
+    $1_CXXFLAGS += $$($1_SRC_HEADER_FLAGS) $$($1_EXTRA_HEADER_FLAGS)
+  endif
+  ifeq ($$($1_CFLAGS)$$($1_CXXFLAGS), )
+    $1_CFLAGS += $$($1_SRC_HEADER_FLAGS) $$($1_EXTRA_HEADER_FLAGS)
+  endif
   $1_RC_FLAGS += $$($1_EXTRA_RC_FLAGS)
 
   # Since we reuse the rule name ($1), all our arguments will pass through.
@@ -80,7 +151,7 @@
 # and the targets generated are listed in a variable by that name.
 #
 # Remaining parameters are named arguments. These are all passed on to
-# SetupNativeCompilation, except for 
+# SetupNativeCompilation, except for
 #   EXTRA_RC_FLAGS -- additional RC_FLAGS to append.
 SetupJdkExecutable = $(NamedParamsMacroTemplate)
 define SetupJdkExecutableBody
--- a/make/common/MakeBase.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/common/MakeBase.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -634,7 +634,7 @@
 ################################################################################
 # Filter out duplicate sub strings while preserving order. Keeps the first occurance.
 uniq = \
-    $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
+    $(strip $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1))))
 
 # Returns all whitespace-separated words in $2 where at least one of the
 # whitespace-separated words in $1 is a substring.
--- a/make/conf/jib-profiles.js	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/conf/jib-profiles.js	Mon Jun 11 09:29:44 2018 +0200
@@ -233,7 +233,7 @@
     common.main_profile_names = [
         "linux-x64", "linux-x86", "macosx-x64", "solaris-x64",
         "solaris-sparcv9", "windows-x64", "windows-x86",
-        "linux-aarch64", "linux-arm64", "linux-arm-vfp-hflt",
+        "linux-aarch64", "linux-arm32", "linux-arm64", "linux-arm-vfp-hflt",
         "linux-arm-vfp-hflt-dyn"
     ];
 
@@ -272,7 +272,6 @@
      */
     common.main_profile_artifacts = function (o) {
         var jdk_subdir = (o.jdk_subdir != null ? o.jdk_subdir : "jdk-" + data.version);
-        var jre_subdir = (o.jre_subdir != null ? o.jre_subdir : "jre-" + data.version);
         var pf = o.platform
         return {
             artifacts: {
@@ -285,15 +284,6 @@
                     subdir: jdk_subdir,
                     exploded: "images/jdk"
                 },
-                jre: {
-                    local: "bundles/\\(jre.*bin.tar.gz\\)",
-                    remote: [
-                        "bundles/" + pf + "/jre-" + data.version + "_" + pf + "_bin.tar.gz",
-                        "bundles/" + pf + "/\\1"
-                    ],
-                    subdir: jre_subdir,
-                    exploded: "images/jre"
-                },
                 test: {
                     local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
                     remote: [
@@ -319,15 +309,6 @@
                     subdir: jdk_subdir,
                     exploded: "images/jdk"
                 },
-                jre_symbols: {
-                    local: "bundles/\\(jre.*bin-symbols.tar.gz\\)",
-                    remote: [
-                        "bundles/" + pf + "/jre-" + data.version + "_" + pf + "_bin-symbols.tar.gz",
-                        "bundles/" + pf + "/\\1"
-                    ],
-                    subdir: jre_subdir,
-                    exploded: "images/jre"
-                }
             }
         };
     };
@@ -339,7 +320,6 @@
      */
     common.debug_profile_artifacts = function (o) {
         var jdk_subdir = "jdk-" + data.version + "/fastdebug";
-        var jre_subdir = "jre-" + data.version + "/fastdebug";
         var pf = o.platform
         return {
             artifacts: {
@@ -352,15 +332,6 @@
                     subdir: jdk_subdir,
                     exploded: "images/jdk"
                 },
-                jre: {
-                    local: "bundles/\\(jre.*bin-debug.tar.gz\\)",
-                    remote: [
-                        "bundles/" + pf + "/jre-" + data.version + "_" + pf + "_bin-debug.tar.gz",
-                        "bundles/" + pf + "/\\1"
-                    ],
-                    subdir: jre_subdir,
-                    exploded: "images/jre"
-                },
                 test: {
                     local: "bundles/\\(jdk.*bin-tests-debug.tar.gz\\)",
                     remote: [
@@ -378,15 +349,6 @@
                     subdir: jdk_subdir,
                     exploded: "images/jdk"
                 },
-                jre_symbols: {
-                    local: "bundles/\\(jre.*bin-debug-symbols.tar.gz\\)",
-                    remote: [
-                        "bundles/" + pf + "/jre-" + data.version + "_" + pf + "_bin-debug-symbols.tar.gz",
-                        "bundles/" + pf + "/\\1"
-                    ],
-                    subdir: jre_subdir,
-                    exploded: "images/jre"
-                }
             }
         };
     };
@@ -490,6 +452,17 @@
             ],
         },
 
+        "linux-arm32": {
+            target_os: "linux",
+            target_cpu: "arm",
+            build_cpu: "x64",
+            dependencies: ["devkit", "autoconf", "build_devkit", "cups"],
+            configure_args: [
+                "--openjdk-target=arm-linux-gnueabihf", "--with-freetype=bundled",
+                "--with-abi-profile=arm-vfp-hflt", "--disable-warnings-as-errors"
+            ],
+        },
+
         "linux-arm-vfp-hflt": {
             target_os: "linux",
             target_cpu: "arm",
@@ -608,7 +581,6 @@
         "macosx-x64": {
             platform: "osx-x64",
             jdk_subdir: "jdk-" + data.version +  ".jdk/Contents/Home",
-            jre_subdir: "jre-" + data.version +  ".jre/Contents/Home"
         },
         "solaris-x64": {
             platform: "solaris-x64",
@@ -625,6 +597,9 @@
        "linux-aarch64": {
             platform: "linux-aarch64",
         },
+       "linux-arm32": {
+            platform: "linux-arm32",
+        },
        "linux-arm64": {
             platform: "linux-arm64-vfp-hflt",
         },
@@ -829,7 +804,11 @@
                     : "gcc7.3.0-Fedora27+1.0"),
         linux_arm: (input.profile != null && input.profile.indexOf("hflt") >= 0
                     ? "gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux+1.0"
-                    : "arm-linaro-4.7+1.0")
+                    : (input.profile.indexOf("arm32") >= 0
+                       ? "gcc7.3.0-Fedora27+1.0"
+                       : "arm-linaro-4.7+1.0"
+                       )
+                    )
     };
 
     var devkit_platform = (input.target_cpu == "x86"
--- a/make/data/lsrdata/language-subtag-registry.txt	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/data/lsrdata/language-subtag-registry.txt	Mon Jun 11 09:29:44 2018 +0200
@@ -1,4 +1,4 @@
-File-Date: 2017-08-15
+File-Date: 2018-04-23
 %%
 Type: language
 Subtag: aa
@@ -378,6 +378,7 @@
 Description: Armenian
 Added: 2005-10-16
 Suppress-Script: Armn
+Comments: see also hyw
 %%
 Type: language
 Subtag: hz
@@ -525,6 +526,7 @@
 %%
 Type: language
 Subtag: km
+Description: Khmer
 Description: Central Khmer
 Added: 2005-10-16
 Suppress-Script: Khmr
@@ -957,6 +959,7 @@
 Description: Serbian
 Added: 2005-10-16
 Macrolanguage: sh
+Comments: see cnr for Montenegrin
 %%
 Type: language
 Subtag: ss
@@ -1531,6 +1534,7 @@
 %%
 Type: language
 Subtag: add
+Description: Lidzonka
 Description: Dzodinka
 Added: 2009-07-29
 %%
@@ -2114,7 +2118,7 @@
 %%
 Type: language
 Subtag: aja
-Description: Aja (Sudan)
+Description: Aja (South Sudan)
 Added: 2009-07-29
 %%
 Type: language
@@ -3097,6 +3101,7 @@
 %%
 Type: language
 Subtag: asf
+Description: Auslan
 Description: Australian Sign Language
 Added: 2009-07-29
 %%
@@ -4240,7 +4245,7 @@
 %%
 Type: language
 Subtag: bdh
-Description: Baka (Sudan)
+Description: Baka (South Sudan)
 Added: 2009-07-29
 %%
 Type: language
@@ -4250,6 +4255,7 @@
 %%
 Type: language
 Subtag: bdj
+Description: Bai (South Sudan)
 Description: Bai
 Added: 2009-07-29
 %%
@@ -5293,7 +5299,7 @@
 %%
 Type: language
 Subtag: blm
-Description: Beli (Sudan)
+Description: Beli (South Sudan)
 Added: 2009-07-29
 %%
 Type: language
@@ -8104,6 +8110,13 @@
 Added: 2009-07-29
 %%
 Type: language
+Subtag: cnr
+Description: Montenegrin
+Added: 2018-01-23
+Macrolanguage: sh
+Comments: see sr for Serbian
+%%
+Type: language
 Subtag: cns
 Description: Central Asmat
 Added: 2009-07-29
@@ -8768,6 +8781,11 @@
 Added: 2009-07-29
 %%
 Type: language
+Subtag: cuy
+Description: Cuitlatec
+Added: 2018-03-08
+%%
+Type: language
 Subtag: cvg
 Description: Chug
 Added: 2009-07-29
@@ -11089,7 +11107,7 @@
 %%
 Type: language
 Subtag: fap
-Description: Palor
+Description: Paloor
 Added: 2009-07-29
 %%
 Type: language
@@ -12282,6 +12300,11 @@
 Added: 2009-07-29
 %%
 Type: language
+Subtag: gkd
+Description: Magɨ (Madang Province)
+Added: 2018-03-08
+%%
+Type: language
 Subtag: gke
 Description: Ndai
 Added: 2009-07-29
@@ -12494,6 +12517,11 @@
 Added: 2009-07-29
 %%
 Type: language
+Subtag: gnj
+Description: Ngen
+Added: 2018-03-08
+%%
+Type: language
 Subtag: gnk
 Description: //Gana
 Description: ǁGana
@@ -13224,6 +13252,11 @@
 Added: 2009-07-29
 %%
 Type: language
+Subtag: gyo
+Description: Gyalsumdo
+Added: 2018-03-08
+%%
+Type: language
 Subtag: gyr
 Description: Guarayu
 Added: 2009-07-29
@@ -13584,6 +13617,11 @@
 Added: 2009-07-29
 %%
 Type: language
+Subtag: hkn
+Description: Mel-Khaonh
+Added: 2018-03-08
+%%
+Type: language
 Subtag: hks
 Description: Hong Kong Sign Language
 Description: Heung Kong Sau Yue
@@ -14238,6 +14276,12 @@
 Added: 2009-07-29
 %%
 Type: language
+Subtag: hyw
+Description: Western Armenian
+Added: 2018-03-08
+Comments: see also hy
+%%
+Type: language
 Subtag: hyx
 Description: Armenian (family)
 Added: 2009-07-29
@@ -14860,6 +14904,7 @@
 %%
 Type: language
 Subtag: iri
+Description: Rigwe
 Description: Irigwe
 Added: 2009-07-29
 %%
@@ -20313,7 +20358,7 @@
 %%
 Type: language
 Subtag: lno
-Description: Lango (Sudan)
+Description: Lango (South Sudan)
 Added: 2009-07-29
 %%
 Type: language
@@ -20579,6 +20624,7 @@
 Subtag: lsg
 Description: Lyons Sign Language
 Added: 2009-07-29
+Deprecated: 2018-03-08
 %%
 Type: language
 Subtag: lsh
@@ -20850,6 +20896,11 @@
 Added: 2009-07-29
 %%
 Type: language
+Subtag: lws
+Description: Malawian Sign Language
+Added: 2018-03-08
+%%
+Type: language
 Subtag: lwt
 Description: Lewotobi
 Added: 2009-07-29
@@ -20904,6 +20955,7 @@
 Subtag: maa
 Description: San Jerónimo Tecóatl Mazatec
 Added: 2009-07-29
+Comments: see also pbm
 %%
 Type: language
 Subtag: mab
@@ -23799,11 +23851,13 @@
 Subtag: mwx
 Description: Mediak
 Added: 2009-07-29
+Deprecated: 2018-03-08
 %%
 Type: language
 Subtag: mwy
 Description: Mosiro
 Added: 2009-07-29
+Deprecated: 2018-03-08
 %%
 Type: language
 Subtag: mwz
@@ -24527,6 +24581,8 @@
 Subtag: ncp
 Description: Ndaktup
 Added: 2009-07-29
+Deprecated: 2018-03-08
+Preferred-Value: kdz
 %%
 Type: language
 Subtag: ncq
@@ -25458,6 +25514,11 @@
 Added: 2009-07-29
 %%
 Type: language
+Subtag: nlm
+Description: Mankiyali
+Added: 2018-03-08
+%%
+Type: language
 Subtag: nln
 Description: Durango Nahuatl
 Added: 2009-07-29
@@ -26693,6 +26754,11 @@
 Added: 2009-07-29
 %%
 Type: language
+Subtag: nzd
+Description: Nzadi
+Added: 2018-03-08
+%%
+Type: language
 Subtag: nzi
 Description: Nzima
 Added: 2005-10-16
@@ -27757,6 +27823,12 @@
 Added: 2009-07-29
 %%
 Type: language
+Subtag: pbm
+Description: Puebla Mazatec
+Added: 2018-03-08
+Comments: see also maa
+%%
+Type: language
 Subtag: pbn
 Description: Kpasam
 Added: 2009-07-29
@@ -30902,6 +30974,7 @@
 %%
 Type: language
 Subtag: scp
+Description: Hyolmo
 Description: Helambu Sherpa
 Added: 2009-07-29
 %%
@@ -33049,6 +33122,7 @@
 %%
 Type: language
 Subtag: sxg
+Description: Shuhi
 Description: Shixing
 Added: 2009-07-29
 %%
@@ -33835,6 +33909,11 @@
 Added: 2009-07-29
 %%
 Type: language
+Subtag: tez
+Description: Tetserret
+Added: 2018-03-08
+%%
+Type: language
 Subtag: tfi
 Description: Tofin Gbe
 Added: 2009-07-29
@@ -34399,7 +34478,7 @@
 Type: language
 Subtag: tlh
 Description: Klingon
-Description: tlhIngan-Hol
+Description: tlhIngan Hol
 Added: 2005-10-16
 %%
 Type: language
@@ -42199,6 +42278,7 @@
 %%
 Type: extlang
 Subtag: asf
+Description: Auslan
 Description: Australian Sign Language
 Added: 2009-07-29
 Preferred-Value: asf
@@ -42927,7 +43007,7 @@
 Subtag: lsg
 Description: Lyons Sign Language
 Added: 2009-07-29
-Preferred-Value: lsg
+Deprecated: 2018-03-08
 Prefix: sgn
 %%
 Type: extlang
@@ -42983,6 +43063,13 @@
 Macrolanguage: lv
 %%
 Type: extlang
+Subtag: lws
+Description: Malawian Sign Language
+Added: 2018-03-08
+Preferred-Value: lws
+Prefix: sgn
+%%
+Type: extlang
 Subtag: lzh
 Description: Literary Chinese
 Added: 2009-07-29
@@ -44493,6 +44580,11 @@
 Added: 2006-10-17
 %%
 Type: script
+Subtag: Rohg
+Description: Hanifi Rohingya
+Added: 2017-12-13
+%%
+Type: script
 Subtag: Roro
 Description: Rongorongo
 Added: 2005-10-16
@@ -44563,6 +44655,16 @@
 Added: 2005-10-16
 %%
 Type: script
+Subtag: Sogd
+Description: Sogdian
+Added: 2017-12-13
+%%
+Type: script
+Subtag: Sogo
+Description: Old Sogdian
+Added: 2017-12-13
+%%
+Type: script
 Subtag: Sora
 Description: Sora Sompeng
 Added: 2011-01-07
@@ -46412,15 +46514,26 @@
   not brought into effect until 2009
 %%
 Type: variant
+Subtag: aranes
+Description: Aranese
+Added: 2018-04-22
+Prefix: oc
+Comments: Occitan variant spoken in the Val d'Aran
+%%
+Type: variant
 Subtag: arevela
 Description: Eastern Armenian
 Added: 2006-09-18
+Deprecated: 2018-03-24
+Preferred-Value: hy
 Prefix: hy
 %%
 Type: variant
 Subtag: arevmda
 Description: Western Armenian
 Added: 2006-09-18
+Deprecated: 2018-03-24
+Preferred-Value: hyw
 Prefix: hy
 %%
 Type: variant
@@ -46431,6 +46544,13 @@
 Prefix: tw
 %%
 Type: variant
+Subtag: auvern
+Description: Auvergnat
+Added: 2018-04-22
+Prefix: oc
+Comments: Occitan variant spoken in Auvergne
+%%
+Type: variant
 Subtag: baku1926
 Description: Unified Turkic Latin Alphabet (Historical)
 Added: 2007-04-18
@@ -46510,6 +46630,13 @@
 Comments: Jargon embedded in American English
 %%
 Type: variant
+Subtag: cisaup
+Description: Cisalpine
+Added: 2018-04-22
+Prefix: oc
+Comments: Occitan variant spoken in northwestern Italy
+%%
+Type: variant
 Subtag: colb1945
 Description: Portuguese-Brazilian Orthographic Convention of 1945
   (Convenção Ortográfica Luso-Brasileira de 1945)
@@ -46528,6 +46655,12 @@
 Prefix: en
 %%
 Type: variant
+Subtag: creiss
+Description: Occitan variants of the Croissant area
+Added: 2018-04-22
+Prefix: oc
+%%
+Type: variant
 Subtag: dajnko
 Description: Slovene in Dajnko alphabet
 Added: 2012-06-27
@@ -46556,6 +46689,11 @@
 Added: 2006-12-11
 %%
 Type: variant
+Subtag: fonkirsh
+Description: Kirshenbaum Phonetic Alphabet
+Added: 2018-04-22
+%%
+Type: variant
 Subtag: fonnapa
 Description: North American Phonetic Alphabet
 Description: Americanist Phonetic Notation
@@ -46573,6 +46711,36 @@
 Comments: Indicates that the content is transcribed according to X-SAMPA
 %%
 Type: variant
+Subtag: gascon
+Description: Gascon
+Added: 2018-04-22
+Prefix: oc
+Comments: Occitan variant spoken in Gascony
+%%
+Type: variant
+Subtag: grclass
+Description: Classical Occitan orthography
+Added: 2018-04-22
+Prefix: oc
+Comments: Classical written standard for Occitan developed in 1935 by
+  Alibèrt
+%%
+Type: variant
+Subtag: grital
+Description: Italian-inspired Occitan orthography
+Added: 2018-04-22
+Prefix: oc
+%%
+Type: variant
+Subtag: grmistr
+Description: Mistralian or Mistralian-inspired Occitan orthography
+Added: 2018-04-22
+Prefix: oc
+Comments: Written standard developed by Romanilha in 1853 and used by
+  Mistral and the Félibres, including derived standards such as Escolo
+  dóu Po, Escolo Gaston Febus, and others
+%%
+Type: variant
 Subtag: hepburn
 Description: Hepburn romanization
 Added: 2009-10-01
@@ -46617,6 +46785,13 @@
 Prefix: sa
 %%
 Type: variant
+Subtag: ivanchov
+Description: Bulgarian in 1899 orthography
+Added: 2017-12-13
+Prefix: bg
+Comments: Bulgarian orthography introduced by Todor Ivanchov in 1899
+%%
+Type: variant
 Subtag: jauer
 Description: Jauer dialect of Romansh
 Added: 2010-06-29
@@ -46659,6 +46834,20 @@
 Prefix: sa
 %%
 Type: variant
+Subtag: lemosin
+Description: Limousin
+Added: 2018-04-22
+Prefix: oc
+Comments: Occitan variant spoken in Limousin
+%%
+Type: variant
+Subtag: lengadoc
+Description: Languedocien
+Added: 2018-04-22
+Prefix: oc
+Comments: Occitan variant spoken in Languedoc
+%%
+Type: variant
 Subtag: lipaw
 Description: The Lipovaz dialect of Resian
 Description: The Lipovec dialect of Resian
@@ -46712,6 +46901,13 @@
 Prefix: en-CA
 %%
 Type: variant
+Subtag: nicard
+Description: Niçard
+Added: 2018-04-22
+Prefix: oc
+Comments: Occitan variant spoken in Nice
+%%
+Type: variant
 Subtag: njiva
 Description: The Gniva dialect of Resian
 Description: The Njiva dialect of Resian
@@ -46798,6 +46994,13 @@
 Prefix: el
 %%
 Type: variant
+Subtag: provenc
+Description: Provençal
+Added: 2018-04-22
+Prefix: oc
+Comments: Occitan variant spoken in Provence
+%%
+Type: variant
 Subtag: puter
 Description: Puter idiom of Romansh
 Added: 2010-06-29
@@ -46959,6 +47162,13 @@
   "idioms" of the Romansh language.
 %%
 Type: variant
+Subtag: vivaraup
+Description: Vivaro-Alpine
+Added: 2018-04-22
+Prefix: oc
+Comments: Occitan variant spoken in northeastern Occitania
+%%
+Type: variant
 Subtag: wadegile
 Description: Wade-Giles romanization
 Added: 2008-10-03
--- a/make/devkit/Makefile	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/devkit/Makefile	Mon Jun 11 09:29:44 2018 +0200
@@ -42,6 +42,8 @@
 # line looking like this:
 #
 # make cross_compile_target="aarch64-linux-gnu" BASE_OS=Fedora27
+# or
+# make cross_compile_target="arm-linux-gnueabihf" BASE_OS=Fedora27
 #
 # This is the makefile which iterates over all host and target platforms.
 #
--- a/make/devkit/Tools.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/devkit/Tools.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -44,13 +44,23 @@
 $(info BUILD=$(BUILD))
 
 ARCH := $(word 1,$(subst -, ,$(TARGET)))
+
+ifeq ($(TARGET), arm-linux-gnueabihf)
+  ARCH=armhfp
+endif
+
 $(info ARCH=$(ARCH))
 
 ifeq ($(BASE_OS), OEL6)
   OEL_URL := http://yum.oracle.com/repo/OracleLinux/OL6/4/base/$(ARCH)/
   LINUX_VERSION := OEL6.4
 else ifeq ($(BASE_OS), Fedora27)
-  OEL_URL := https://dl.fedoraproject.org/pub/fedora-secondary/releases/27/Everything/$(ARCH)/os/Packages/
+  ifeq ($(ARCH), aarch64)
+    FEDORA_TYPE=fedora-secondary
+  else
+    FEDORA_TYPE=fedora/linux
+  endif
+  OEL_URL := https://dl.fedoraproject.org/pub/$(FEDORA_TYPE)/releases/27/Everything/$(ARCH)/os/Packages/
   LINUX_VERSION := Fedora 27
 else
   $(error Unknown base OS $(BASE_OS))
@@ -189,6 +199,8 @@
   endif
 else ifeq ($(ARCH),i686)
   RPM_ARCHS := i386 i686 noarch
+else ifeq ($(ARCH), armhfp)
+  RPM_ARCHS := $(ARCH) armv7hl noarch
 else
   RPM_ARCHS := $(ARCH) noarch
 endif
@@ -410,6 +422,10 @@
   $(BUILDDIR)/$(gcc_ver)/Makefile : CONFIG += --enable-__cxa_atexit
 endif
 
+ifeq ($(ARCH), armhfp)
+  $(BUILDDIR)/$(gcc_ver)/Makefile : CONFIG +=  --with-float=hard
+endif
+
 # Want:
 # c,c++
 # shared libs
--- a/make/gensrc/Gensrc-java.desktop.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/gensrc/Gensrc-java.desktop.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -78,13 +78,6 @@
 
 GENSRC_JAVA_DESKTOP += $(COMPILE_PROPERTIES)
 
-# Some resources bundles are already present as java files but still need to be
-# copied to zh_HK locale.
-$(eval $(call SetupCopy-zh_HK,COPY_ZH_HK, \
-    $(TOPDIR)/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_zh_TW.java))
-
-GENSRC_JAVA_DESKTOP += $(COPY_ZH_HK)
-
 ################################################################################
 
 java.desktop: $(GENSRC_JAVA_DESKTOP)
--- a/make/gensrc/Gensrc-jdk.compiler.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/gensrc/Gensrc-jdk.compiler.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2018, 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
@@ -32,6 +32,7 @@
     $(JAVAC_VERSION)))
 
 $(eval $(call SetupParseProperties,PARSE_PROPERTIES, \
-	com/sun/tools/javac/resources/compiler.properties))
+	com/sun/tools/javac/resources/compiler.properties \
+	com/sun/tools/javac/resources/launcher.properties))
 
 all: $(COMPILE_PROPERTIES) $(PARSE_PROPERTIES)
--- a/make/langtools/build.properties	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/langtools/build.properties	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2018, 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
@@ -38,7 +38,8 @@
                jdk.jshell
 
 langtools.resource.includes = \
-        com/sun/tools/javac/resources/compiler.properties
+        com/sun/tools/javac/resources/compiler.properties \
+        com/sun/tools/javac/resources/launcher.properties
 
 # Version info -- override as needed
 jdk.version = 9
--- a/make/lib/Awt2dLibraries.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Awt2dLibraries.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -27,37 +27,38 @@
 
 WIN_AWT_LIB := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt/awt.lib
 
+LIBAWT_DEFAULT_HEADER_DIRS := \
+    libawt/awt/image \
+    libawt/awt/image/cvutils \
+    libawt/java2d \
+    libawt/java2d/loops \
+    libawt/java2d/pipe \
+    #
+
 ################################################################################
 
-BUILD_LIBMLIB_SRC := $(TOPDIR)/src/java.desktop/share/native/libmlib_image \
-    $(TOPDIR)/src/java.desktop/share/native/common/awt/medialib
-BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
-    $(addprefix -I, $(BUILD_LIBMLIB_SRC)) \
-    -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libmlib_image
+# We must not include java.desktop/unix/native/libmlib_image, which is only
+# for usage by solaris-sparc in libmlib_image_v.
+BUILD_LIBMLIB_EXCLUDE_SRC_PATTERNS := unix
 
-BUILD_LIBMLIB_LDLIBS :=
-
-BUILD_LIBMLIB_CFLAGS += -DMLIB_NO_LIBSUNMATH
+BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES -DMLIB_NO_LIBSUNMATH
 
 ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
   BUILD_LIBMLIB_CFLAGS += -DMLIB_OS64BIT
 endif
 
-ifneq ($(OPENJDK_TARGET_OS), windows)
-  BUILD_LIBMLIB_LDLIBS += $(LIBM) $(LIBDL)
-endif
-
 $(eval $(call SetupJdkLibrary, BUILD_LIBMLIB_IMAGE, \
     NAME := mlib_image, \
-    SRC := $(BUILD_LIBMLIB_SRC), \
+    EXTRA_SRC := common/awt/medialib, \
     EXCLUDE_FILES := mlib_c_ImageBlendTable.c, \
+    EXCLUDE_SRC_PATTERNS := $(BUILD_LIBMLIB_EXCLUDE_SRC_PATTERNS), \
     OPTIMIZATION := HIGHEST, \
     CFLAGS := $(CFLAGS_JDKLIB) \
         $(BUILD_LIBMLIB_CFLAGS), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
-    LIBS := $(BUILD_LIBMLIB_LDLIBS) \
-        $(JDKLIB_LIBS), \
+    LIBS := $(JDKLIB_LIBS), \
+    LIBS_unix := $(LIBM) $(LIBDL), \
 ))
 
 $(BUILD_LIBMLIB_IMAGE): $(call FindLib, java.base, java)
@@ -68,14 +69,19 @@
 
 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
 
-  LIBMLIB_IMAGE_V_SRC := $(TOPDIR)/src/java.desktop/share/native/libmlib_image \
-      $(TOPDIR)/src/java.desktop/unix/native/libmlib_image \
-      $(TOPDIR)/src/java.desktop/share/native/common/awt/medialib \
-      $(TOPDIR)/src/java.desktop/unix/native/common/awt/medialib \
-      #
-  LIBMLIB_IMAGE_V_CFLAGS := $(TOPDIR)/src/java.desktop/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il \
-      $(addprefix -I, $(LIBMLIB_IMAGE_V_SRC)) \
-      #
+  # libmlib_image_v is basically built from mlib_image sources, with some additions
+  # and some exclusions.
+  LIBMLIB_IMAGE_V_SRC := \
+     libmlib_image \
+     common/awt/medialib \
+     #
+
+  LIBMLIB_IMAGE_V_CFLAGS := -xarch=sparcvis -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
+      $(TOPDIR)/src/$(MODULE)/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il
+
+  ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
+    LIBMLIB_IMAGE_V_CFLAGS += -DMLIB_OS64BIT
+  endif
 
   BUILD_LIBMLIB_IMAGE_V_EXFILES := \
       awt_ImagingLib.c \
@@ -95,19 +101,16 @@
       mlib_c_ImageLookUp_f.c \
       #
 
-  LIBMLIB_IMAGE_V_CFLAGS += $(filter-out -DMLIB_NO_LIBSUNMATH, $(BUILD_LIBMLIB_CFLAGS))
-
   $(eval $(call SetupJdkLibrary, BUILD_LIBMLIB_IMAGE_V, \
       NAME := mlib_image_v, \
       SRC := $(LIBMLIB_IMAGE_V_SRC), \
       EXCLUDE_FILES := $(BUILD_LIBMLIB_IMAGE_V_EXFILES), \
       OPTIMIZATION := HIGHEST, \
-      CFLAGS := -xarch=sparcvis \
-          $(LIBMLIB_IMAGE_V_CFLAGS) \
-          $(CFLAGS_JDKLIB), \
+      CFLAGS := $(CFLAGS_JDKLIB) \
+          $(LIBMLIB_IMAGE_V_CFLAGS), \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
-      LIBS := -ljava -ljvm $(BUILD_LIBMLIB_LDLIBS), \
+      LIBS := -ljava -ljvm $(LIBM) $(LIBDL), \
   ))
 
   $(BUILD_LIBMLIB_IMAGE_V): $(call FindLib, java.base, java)
@@ -118,18 +121,22 @@
 
 ################################################################################
 
-LIBAWT_DIRS := $(TOPDIR)/src/java.desktop/share/native/libawt \
-    $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt \
-    $(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
-    $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
+LIBAWT_EXTRA_SRC := \
+    common/awt/debug \
+    $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
     #
 
-ifeq ($(OPENJDK_TARGET_OS), aix)
-  LIBAWT_DIRS += $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/libawt
+ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
+  LIBAWT_EXTRA_SRC += $(TOPDIR)/src/$(MODULE)/share/native/common/awt/medialib
 endif
 
 ifeq ($(OPENJDK_TARGET_OS), windows)
-  LIBAWT_DIRS += $(TOPDIR)/src/java.desktop/share/native/common/awt/utility
+  LIBAWT_EXTRA_SRC += \
+      $(TOPDIR)/src/$(MODULE)/share/native/common/awt/utility \
+      $(TOPDIR)/src/$(MODULE)/share/native/common/font \
+      $(TOPDIR)/src/$(MODULE)/share/native/common/java2d/opengl \
+      $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt/systemscale \
+      #
 endif
 
 ifneq ($(filter $(OPENJDK_TARGET_OS), solaris linux macosx aix), )
@@ -140,33 +147,45 @@
   LIBAWT_EXFILES += initIDs.c awt/image/cvutils/img_colors.c
 endif
 
-LIBAWT_CFLAGS += -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
-    $(addprefix -I, $(shell find $(LIBAWT_DIRS) -type d)) \
-    $(LIBJAVA_HEADER_FLAGS) \
-    $(addprefix -I, $(BUILD_LIBMLIB_IMAGE_SRC)) \
+ifeq ($(OPENJDK_TARGET_OS), windows)
+  LIBAWT_EXFILES += \
+      java2d/d3d/D3DShaderGen.c \
+      awt/image/cvutils/img_colors.c \
+      #
+endif
+
+ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-sparcv9)
+  LIBAWT_EXFILES += java2d/loops/MapAccelFunc.c
+else
+  LIBAWT_EXCLUDES += \
+      $(TOPDIR)/src/$(MODULE)/unix/native/libawt/awt/medialib \
+      $(TOPDIR)/src/$(MODULE)/unix/native/libawt/java2d/loops \
+      $(TOPDIR)/src/$(MODULE)/unix/native/common/awt/medialib \
+      #
+endif
+
+LIBAWT_EXTRA_HEADER_DIRS := \
+    $(LIBAWT_DEFAULT_HEADER_DIRS) \
+    $(call GetJavaHeaderDir, java.base) \
+    libawt/awt/medialib \
+    libawt/java2d/d3d \
+    libawt/java2d/opengl \
+    libawt/java2d/windows \
+    libawt/windows \
+    common/awt/medialib \
+    libmlib_image \
+    include \
+    java.base:libjava \
+    java.base:include \
     #
 
 LIBAWT_CFLAGS += -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES $(X_CFLAGS)
 
-ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
-  LIBAWT_CFLAGS += -DMLIB_ADD_SUFF
-  LIBAWT_CFLAGS += -xarch=sparcvis
-
-  LIBAWT_CFLAGS += $(TOPDIR)/src/java.desktop/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il
-  LIBAWT_DIRS += $(TOPDIR)/src/java.desktop/share/native/common/awt/medialib
-  LIBAWT_EXFILES += java2d/loops/MapAccelFunc.c
+ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-sparcv9)
+  LIBAWT_CFLAGS += -xarch=sparcvis -DMLIB_ADD_SUFF \
+      $(TOPDIR)/src/$(MODULE)/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il
 
-  ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
-    LIBAWT_ASFLAGS = -P -xarch=v9a
-  else
-    LIBAWT_ASFLAGS = -P -xarch=v8plusa
-  endif
-else
-  LIBAWT_EXCLUDES += \
-      $(TOPDIR)/src/java.desktop/unix/native/libawt/awt/medialib \
-      $(TOPDIR)/src/java.desktop/unix/native/libawt/java2d/loops \
-      $(TOPDIR)/src/java.desktop/unix/native/common/awt/medialib \
-      #
+  LIBAWT_ASFLAGS = -P -xarch=v9a
 endif
 
 ifneq ($(OPENJDK_TARGET_OS), solaris)
@@ -174,29 +193,13 @@
 endif
 
 ifeq ($(OPENJDK_TARGET_OS), windows)
-  LIBAWT_DIRS += $(TOPDIR)/src/java.desktop/share/native/common/font \
-      $(TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
-      $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt/systemscale \
-  # Why does libawt need java.base headers?
-  LIBAWT_CFLAGS += -I$(TOPDIR)/src/java.desktop/share/native/common/font \
-      -I$(TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
-      -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
-      -I$(TOPDIR)/src/java.desktop/windows/native/include \
-      -I$(TOPDIR)/src/java.desktop/share/native/include \
-      -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
-      #
-  LIBAWT_EXFILES += \
-      java2d/d3d/D3DShaderGen.c \
-      awt/image/cvutils/img_colors.c \
-      #
-
   LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
   ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
     LIBAWT_CFLAGS += -DMLIB_OS64BIT
   endif
 
   LIBAWT_RC_FLAGS ?= -I $(TOPDIR)/src/java.base/windows/native/launcher/icons
-  LIBAWT_VERSIONINFO_RESOURCE := $(TOPDIR)/src/java.desktop/windows/native/libawt/windows/awt.rc
+  LIBAWT_VERSIONINFO_RESOURCE := $(TOPDIR)/src/$(MODULE)/windows/native/libawt/windows/awt.rc
 endif
 
 ifeq ($(OPENJDK_TARGET_OS), linux)
@@ -215,16 +218,17 @@
 
 $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
     NAME := awt, \
-    SRC := $(LIBAWT_DIRS), \
+    EXTRA_SRC := $(LIBAWT_EXTRA_SRC), \
     EXCLUDES := $(LIBAWT_EXCLUDES), \
     EXCLUDE_FILES := $(LIBAWT_EXFILES), \
     OPTIMIZATION := LOW, \
     CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
+    EXTRA_HEADER_DIRS := $(LIBAWT_EXTRA_HEADER_DIRS), \
     DISABLED_WARNINGS_gcc := sign-compare unused-result maybe-uninitialized \
         format-nonliteral parentheses, \
     DISABLED_WARNINGS_clang := logical-op-parentheses extern-initializer, \
     DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \
-    DISABLED_WARNINGS_microsoft := 4297 4244 4267 4996, \
+    DISABLED_WARNINGS_microsoft := 4244 4267 4996, \
     ASFLAGS := $(LIBAWT_ASFLAGS), \
     LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \
     LDFLAGS_macosx := -L$(INSTALL_LIBRARIES_HERE), \
@@ -265,39 +269,26 @@
 
 ################################################################################
 
-ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
+ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx), )
   ifeq ($(ENABLE_HEADLESS_ONLY), false)
 
-    LIBAWT_XAWT_DIRS := \
-        $(wildcard $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/libawt_xawt) \
-        $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt_xawt \
-        $(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
-        $(TOPDIR)/src/java.desktop/share/native/common/awt/utility \
-        $(TOPDIR)/src/java.desktop/share/native/common/font \
-        $(TOPDIR)/src/java.desktop/share/native/common/java2d \
-        $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d \
-        $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
+    LIBAWT_XAWT_EXTRA_SRC := \
+        common/awt \
+        common/java2d \
+        common/font \
         #
 
-    ifneq ($(filter $(OPENJDK_TARGET_OS),linux solaris aix), )
-      LIBAWT_XAWT_DIRS += $(TOPDIR)/src/java.desktop/unix/native/common/awt/systemscale
-    endif
-
     LIBAWT_XAWT_EXCLUDES := medialib
 
-    LIBAWT_XAWT_CFLAGS := $(addprefix -I, $(shell $(FIND) $(LIBAWT_XAWT_DIRS) -type d)) \
-        -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
-        -I$(TOPDIR)/src/java.desktop/share/native/include \
-        -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/include \
-        -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/include \
-        -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d \
-        -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d \
-        -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
-        -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
-        -I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
-        -I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
-        -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/font \
-        $(LIBJAVA_HEADER_FLAGS)
+    LIBAWT_XAWT_EXTRA_HEADER_DIRS := \
+        $(LIBAWT_DEFAULT_HEADER_DIRS) \
+        libawt_xawt/awt \
+        include \
+        common/awt/debug \
+        common/awt/systemscale \
+        common/font \
+        common/java2d/opengl \
+        common/java2d/x11 \
         #
 
     LIBAWT_XAWT_CFLAGS += -DXAWT -DXAWT_HACK \
@@ -334,7 +325,8 @@
 
     $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_XAWT, \
         NAME := awt_xawt, \
-        SRC := $(LIBAWT_XAWT_DIRS), \
+        EXTRA_SRC := $(LIBAWT_XAWT_EXTRA_SRC), \
+        EXTRA_HEADER_DIRS := $(LIBAWT_XAWT_EXTRA_HEADER_DIRS), \
         EXCLUDES := $(LIBAWT_XAWT_EXCLUDES), \
         OPTIMIZATION := LOW, \
         CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
@@ -350,10 +342,6 @@
             $(call SET_SHARED_LIBRARY_ORIGIN) \
             -L$(INSTALL_LIBRARIES_HERE), \
         LIBS :=  $(X_LIBS) $(LIBAWT_XAWT_LIBS), \
-        RC_FLAGS := $(RC_FLAGS) \
-            -D "JDK_FNAME=xawt.dll" \
-            -D "JDK_INTERNAL_NAME=xawt" \
-            -D "JDK_FTYPE=0x2L", \
     ))
 
     $(BUILD_LIBAWT_XAWT): $(call FindLib, java.base, java)
@@ -367,36 +355,34 @@
 
 ################################################################################
 
-LIBLCMS_SRC := $(TOPDIR)/src/java.desktop/share/native/liblcms
-LIBLCMS_CPPFLAGS += -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
-    -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d \
-    -I$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
-    $(LIBJAVA_HEADER_FLAGS) \
-    #
 # The fast floor code loses precision.
 LCMS_CFLAGS=-DCMS_DONT_USE_FAST_FLOOR
 
+LCMS_CFLAGS_JDKLIB := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB))
+
 ifeq ($(USE_EXTERNAL_LCMS), true)
   # If we're using an external library, we'll just need the wrapper part.
   # By including it explicitly, all other files will be excluded.
   BUILD_LIBLCMS_INCLUDE_FILES := LCMS.c
+  # If we're using an external library, we can't include our own SRC path
+  # as includes, instead the system headers should be used.
+  LIBLCMS_HEADERS_FROM_SRC := false
 else
   BUILD_LIBLCMS_INCLUDE_FILES :=
-  # If we're using the bundled library, we'll need to include it in the
-  # include path explicitly. Otherwise the system headers will be used.
-  LIBLCMS_CPPFLAGS += $(addprefix -I, $(LIBLCMS_SRC))
 endif
 
 $(eval $(call SetupJdkLibrary, BUILD_LIBLCMS, \
     NAME := lcms, \
-    SRC := $(LIBLCMS_SRC), \
     INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \
     OPTIMIZATION := HIGHEST, \
-    CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \
-        $(LIBLCMS_CPPFLAGS) \
+    CFLAGS := $(LCMS_CFLAGS_JDKLIB) \
         $(LCMS_CFLAGS), \
     CFLAGS_solaris := -xc99=no_lib, \
     CFLAGS_windows := -DCMS_IS_WINDOWS_, \
+    EXTRA_HEADER_DIRS := \
+        common/awt/debug \
+        libawt/java2d, \
+    HEADERS_FROM_SRC := $(LIBLCMS_HEADERS_FROM_SRC), \
     DISABLED_WARNINGS_gcc := format-nonliteral type-limits misleading-indentation, \
     DISABLED_WARNINGS_clang := tautological-compare, \
     DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
@@ -414,8 +400,6 @@
 
 ################################################################################
 
-LIBJAVAJPEG_SRC += $(TOPDIR)/src/java.desktop/share/native/libjavajpeg
-
 # "DISABLED_WARNINGS_gcc := clobbered" rationale:
 # Suppress gcc warnings like "variable might be clobbered by 'longjmp'
 # or 'vfork'": this warning indicates that some variable is placed to
@@ -429,21 +413,20 @@
   BUILD_LIBJAVAJPEG_INCLUDE_FILES := \
       imageioJPEG.c \
       jpegdecoder.c
-  BUILD_LIBJAVAJPEG_HEADERS :=
+  # If we're using an external library, we can't include our own SRC path
+  # as includes, instead the system headers should be used.
+  LIBJPEG_HEADERS_FROM_SRC := false
 else
   LIBJPEG_LIBS :=
   BUILD_LIBJAVAJPEG_INCLUDE_FILES :=
-  BUILD_LIBJAVAJPEG_HEADERS := $(addprefix -I, $(LIBJAVAJPEG_SRC))
 endif
 
 $(eval $(call SetupJdkLibrary, BUILD_LIBJAVAJPEG, \
     NAME := javajpeg, \
-    SRC := $(LIBJAVAJPEG_SRC), \
     INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \
     OPTIMIZATION := HIGHEST, \
-    CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBJAVAJPEG_HEADERS) \
-        $(LIBJAVA_HEADER_FLAGS) \
-        -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \
+    CFLAGS := $(CFLAGS_JDKLIB), \
+    HEADERS_FROM_SRC := $(LIBJPEG_HEADERS_FROM_SRC), \
     DISABLED_WARNINGS_gcc := clobbered implicit-fallthrough shift-negative-value, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
@@ -460,42 +443,32 @@
 # Mac and Windows only use the native AWT lib, do not build libawt_headless
 ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
 
-  LIBAWT_HEADLESS_DIRS := $(TOPDIR)/src/java.desktop/unix/native/libawt_headless/awt \
-      $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
-      $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d \
-      $(TOPDIR)/src/java.desktop/share/native/common/java2d \
-      $(TOPDIR)/src/java.desktop/share/native/common/font \
+  LIBAWT_HEADLESS_EXTRA_SRC := \
+      common/font \
+      common/java2d \
+      $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
       #
 
   LIBAWT_HEADLESS_EXCLUDES := medialib
-  LIBAWT_HEADLESS_CFLAGS := -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
-      $(addprefix -I, $(LIBAWT_HEADLESS_DIRS)) \
-      -I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
-      -I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
-      -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d \
-      -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d \
-      -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
-      -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
-      -I$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
-      -I$(TOPDIR)/src/java.desktop/share/native/common/font \
-      -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/font \
-      -I$(TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
-      -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
-      $(LIBJAVA_HEADER_FLAGS) \
+
+  LIBAWT_HEADLESS_EXTRA_HEADER_DIRS := \
+      $(LIBAWT_DEFAULT_HEADER_DIRS) \
+      common/awt/debug \
+      common/font \
+      common/java2d/opengl \
       #
 
+  LIBAWT_HEADLESS_CFLAGS := $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) $(X_CFLAGS) \
+      -DHEADLESS=true -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
+
   $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_HEADLESS, \
       NAME := awt_headless, \
-      SRC := $(LIBAWT_HEADLESS_DIRS), \
+      EXTRA_SRC := $(LIBAWT_HEADLESS_EXTRA_SRC), \
       EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
-          -DHEADLESS=true \
-          -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
-          $(CUPS_CFLAGS) \
-          $(FONTCONFIG_CFLAGS) \
-          $(X_CFLAGS) \
           $(LIBAWT_HEADLESS_CFLAGS), \
+      EXTRA_HEADER_DIRS := $(LIBAWT_HEADLESS_EXTRA_HEADER_DIRS), \
       DISABLED_WARNINGS_xlc := 1506-356, \
       DISABLED_WARNINGS_solstudio := E_EMPTY_TRANSLATION_UNIT, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
@@ -519,12 +492,15 @@
 ################################################################################
 
 ifeq ($(FREETYPE_TO_USE), system)
+  # For use by libfontmanager:
   LIBFREETYPE_CFLAGS := $(FREETYPE_CFLAGS)
   LIBFREETYPE_LIBS := $(FREETYPE_LIBS)
 else
-  LIBFREETYPE_SRC := $(TOPDIR)/src/java.desktop/share/native/libfreetype
-  BUILD_LIBFREETYPE_HEADERS := $(addprefix -I, $(LIBFREETYPE_SRC)/include)
-  LIBFREETYPE_CFLAGS := $(BUILD_LIBFREETYPE_HEADERS)
+  BUILD_LIBFREETYPE_HEADER_DIRS := $(TOPDIR)/src/$(MODULE)/share/native/libfreetype/include
+  BUILD_LIBFREETYPE_CFLAGS := -DFT2_BUILD_LIBRARY $(EXPORT_ALL_SYMBOLS)
+
+  # For use by libfontmanager:
+  LIBFREETYPE_CFLAGS := -I$(BUILD_LIBFREETYPE_HEADER_DIRS)
   ifeq ($(OPENJDK_TARGET_OS), windows)
     LIBFREETYPE_LIBS := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfreetype/freetype.lib
   else
@@ -533,14 +509,15 @@
 
   $(eval $(call SetupJdkLibrary, BUILD_LIBFREETYPE, \
       NAME := freetype, \
-      SRC := $(LIBFREETYPE_SRC)/src, \
       OPTIMIZATION := HIGHEST, \
-      CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBFREETYPE_HEADERS) \
-          -DFT2_BUILD_LIBRARY $(EXPORT_ALL_SYMBOLS), \
+      CFLAGS := $(CFLAGS_JDKLIB) \
+          $(BUILD_LIBFREETYPE_CFLAGS), \
+      EXTRA_HEADER_DIRS := $(BUILD_LIBFREETYPE_HEADER_DIRS), \
       DISABLED_WARNINGS_solstudio := \
          E_STATEMENT_NOT_REACHED \
          E_END_OF_LOOP_CODE_NOT_REACHED, \
       DISABLED_WARNINGS_microsoft := 4267 4244 4312, \
+      DISABLED_WARNINGS_gcc := implicit-fallthrough, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
   ))
@@ -550,19 +527,6 @@
 
 ###########################################################################
 
-LIBFONTMANAGER_SRC := $(TOPDIR)/src/java.desktop/share/native/libfontmanager \
-    $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libfontmanager
-LIBFONTMANAGER_CFLAGS := \
-    $(addprefix -I, $(shell $(FIND) \
-      $(LIBFONTMANAGER_SRC) \
-      $(TOPDIR)/src/java.desktop/share/native/libawt \
-      $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt \
-      $(TOPDIR)/src/java.desktop/share/native/common \
-      $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common -type d)) \
-    -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
-    $(LIBJAVA_HEADER_FLAGS) \
-    #
-
 #### Begin harfbuzz configuration
 
 HARFBUZZ_CFLAGS := -DHAVE_OT -DHAVE_FALLBACK -DHAVE_UCDN
@@ -590,6 +554,16 @@
 
 #### End harfbuzz configuration
 
+LIBFONTMANAGER_EXTRA_HEADER_DIRS := \
+    libfontmanager/harfbuzz \
+    libfontmanager/harfbuzz/hb-ucdn \
+    common/awt \
+    common/font \
+    libawt/java2d \
+    libawt/java2d/pipe \
+    libawt/java2d/loops \
+    #
+
 LIBFONTMANAGER_CFLAGS += $(LIBFREETYPE_CFLAGS)
 BUILD_LIBFONTMANAGER_FONTLIB += $(LIBFREETYPE_LIBS)
 
@@ -599,7 +573,6 @@
   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
       X11TextRenderer.c
   LIBFONTMANAGER_OPTIMIZATION := HIGHEST
-  LIBFONTMANAGER_CFLAGS += -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/windows
 else ifeq ($(OPENJDK_TARGET_OS), macosx)
   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
       X11TextRenderer.c \
@@ -610,7 +583,7 @@
       lcdglyph.c
 endif
 
-LIBFONTMANAGER_CFLAGS += $(FONT_HEADERS) $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS
+LIBFONTMANAGER_CFLAGS += $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS
 
 ifeq ($(TOOLCHAIN_TYPE), gcc)
   # Turn off all warnings for sunFont.c. This is needed because the specific warning
@@ -626,7 +599,6 @@
 #   libawt_xawt). See JDK-8196516 for details.
 $(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
     NAME := fontmanager, \
-    SRC := $(LIBFONTMANAGER_SRC), \
     EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
         AccelGlyphCache.c, \
     TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
@@ -634,6 +606,7 @@
     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
     OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
     CFLAGS_windows = -DCC_NOEX, \
+    EXTRA_HEADER_DIRS := $(LIBFONTMANAGER_EXTRA_HEADER_DIRS), \
     WARNINGS_AS_ERRORS_xlc := false, \
     DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast \
         type-limits missing-field-initializers implicit-fallthrough, \
@@ -665,7 +638,7 @@
 $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  $(BUILD_LIBFONTMANAGER): $(call FindLib, java.desktop, awt_lwawt)
+  $(BUILD_LIBFONTMANAGER): $(call FindLib, $(MODULE), awt_lwawt)
 endif
 
 ifeq ($(FREETYPE_TO_USE), bundled)
@@ -677,29 +650,30 @@
 ################################################################################
 
 ifeq ($(OPENJDK_TARGET_OS), windows)
-  LIBJAWT_SRC := $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjawt
-  LIBJAWT_CFLAGS := -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/windows \
-      -I$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
-      -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d \
-      -I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
-      -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d/windows \
-      -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
-      -I$(TOPDIR)/src/java.desktop/windows/native/include \
-      -I$(TOPDIR)/src/java.desktop/share/native/include \
-      $(LIBJAVA_HEADER_FLAGS) \
+
+  LIBJAWT_CFLAGS := -EHsc -DUNICODE -D_UNICODE
+
+  LIBJAWT_EXTRA_HEADER_DIRS := \
+      include \
+      common/awt/debug \
+      libawt/awt/image/cvutils \
+      libawt/java2d \
+      libawt/java2d/windows \
+      libawt/windows \
+      java.base:include \
+      java.base:libjava \
       #
 
   ifeq ($(OPENJDK_TARGET_CPU), x86)
     KERNEL32_LIB := kernel32.lib
   endif
+
   $(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
       NAME := jawt, \
-      SRC := $(LIBJAWT_SRC), \
-      INCLUDE_FILES := $(LIBJAWT_INCLUDE_FILES), \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CXXFLAGS_JDKLIB) \
-          -EHsc -DUNICODE -D_UNICODE \
           $(LIBJAWT_CFLAGS), \
+      EXTRA_HEADER_DIRS := $(LIBJAWT_EXTRA_HEADER_DIRS), \
       LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
       LIBS := $(JDKLIB_LIBS) $(KERNEL32_LIB) advapi32.lib $(WIN_AWT_LIB), \
   ))
@@ -718,17 +692,9 @@
 else # OPENJDK_TARGET_OS not windows
 
   ifeq ($(OPENJDK_TARGET_OS), macosx)
-    LIBJAWT_SRC := $(TOPDIR)/src/java.desktop/macosx/native/libjawt
-  else
-    LIBJAWT_SRC := $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjawt
+    # libjawt on macosx do not use the unix code
+    LIBJAWT_EXCLUDE_SRC_PATTERNS := unix
   endif
-  LIBJAWT_CFLAGS := \
-      -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
-      -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/include \
-      -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/include \
-      -I$(TOPDIR)/src/java.desktop/share/native/include \
-      $(LIBJAVA_HEADER_FLAGS) \
-      #
 
   ifeq ($(OPENJDK_TARGET_OS), macosx)
     JAWT_LIBS := -lawt_lwawt
@@ -741,19 +707,22 @@
       JAWT_LIBS += -lawt_xawt
     else
       JAWT_LIBS += -lawt_headless
-      HEADLESS_CFLAG += -DHEADLESS
+      ifeq ($(OPENJDK_TARGET_OS), linux)
+        JAWT_CFLAGS += -DHEADLESS
+      endif
     endif
   endif
 
   $(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
       NAME := jawt, \
-      SRC := $(LIBJAWT_SRC), \
+      EXCLUDE_SRC_PATTERNS := $(LIBJAWT_EXCLUDE_SRC_PATTERNS), \
       INCLUDE_FILES := $(JAWT_FILES), \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
-          $(LIBJAWT_CFLAGS), \
-      CFLAGS_linux := $(HEADLESS_CFLAG), \
-      CFLAGS_macosx := $(LIBJAWT_CFLAGS_macosx), \
+          $(JAWT_CFLAGS), \
+      EXTRA_HEADER_DIRS := \
+          include \
+          common/awt, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
@@ -781,52 +750,56 @@
 
 ifeq ($(ENABLE_HEADLESS_ONLY), false)
 
-  LIBSPLASHSCREEN_DIRS := \
-      $(TOPDIR)/src/java.desktop/share/native/libjavajpeg \
-      $(TOPDIR)/src/java.desktop/share/native/libsplashscreen \
+  LIBSPLASHSCREEN_EXTRA_SRC := \
+      common/awt/systemscale \
       #
 
-  ifeq ($(USE_EXTERNAL_LIBGIF), true)
-    GIFLIB_LIBS := -lgif
+  ifeq ($(USE_EXTERNAL_LIBGIF), false)
+    LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/giflib
+  else
     LIBSPLASHSCREEN_EXCLUDES := giflib
-  else
-    LIBSPLASHSCREEN_CFLAGS += -I$(TOPDIR)/src/java.desktop/share/native/libsplashscreen/giflib
+    GIFLIB_LIBS := -lgif
   endif
 
-  ifeq ($(USE_EXTERNAL_LIBJPEG), true)
-    LIBJPEG_LIBS := -ljpeg
+  ifeq ($(USE_EXTERNAL_LIBJPEG), false)
+    # While the following ought to work, it will currently pull in the closed
+    # additions to this library, and this was not done previously in the build.
+    # LIBSPLASHSCREEN_EXTRA_SRC += libjavajpeg
+    LIBSPLASHSCREEN_EXTRA_SRC += $(TOPDIR)/src/java.desktop/share/native/libjavajpeg
   else
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/share/native/libjavajpeg
-    LIBJPEG_CFLAGS := -I$(TOPDIR)/src/java.desktop/share/native/libjavajpeg
+    LIBJPEG_LIBS := -ljpeg
   endif
 
   ifeq ($(USE_EXTERNAL_LIBPNG), false)
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/share/native/libsplashscreen/libpng
+    LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/libpng
+
+    ifeq ($(OPENJDK_TARGET_OS), macosx)
+      ifeq ($(USE_EXTERNAL_LIBZ), true)
+        # When building our own libpng and using an external libz, we need to
+        # inject our own libz.h to tweak the exported ZLIB_VERNUM macro. See
+        # $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen/libpng/zlibwrapper/zlib.h
+        # for details. This must be specified with -iquote, not -I to avoid a
+        # circular include.
+        LIBSPLASHSCREEN_CFLAGS += -iquote $(TOPDIR)/src/$(MODULE)/macosx/native/libsplashscreen/libpng/zlibwrapper
+      endif
+    endif
   else
     LIBSPLASHSCREEN_EXCLUDES += libpng
   endif
 
-  ifneq ($(OPENJDK_TARGET_OS), macosx)
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsplashscreen
-  else
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen
+  ifeq ($(USE_EXTERNAL_LIBZ), false)
+    LIBSPLASHSCREEN_EXTRA_SRC += java.base:libzip/zlib
   endif
 
-  ifneq ($(filter $(OPENJDK_TARGET_OS),linux solaris aix), )
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/unix/native/common/awt/systemscale
+  ifeq ($(OPENJDK_TARGET_OS), macosx)
+    # libsplashscreen on macosx do not use the unix code
+    LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS := unix
   endif
 
-  ifeq ($(OPENJDK_TARGET_OS), windows)
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/windows/native/common/awt/systemscale
-  endif
-  LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0 \
-      $(addprefix -I, $(LIBSPLASHSCREEN_DIRS)) \
-      $(LIBJAVA_HEADER_FLAGS) \
-      #
+  LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0
 
   ifeq ($(OPENJDK_TARGET_OS), macosx)
     LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
-    LIBSPLASHSCREEN_CFLAGS += -I$(TOPDIR)/src/java.desktop/macosx/native/libosxapp
 
     BUILD_LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
     BUILD_LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
@@ -844,20 +817,6 @@
 
   LIBSPLASHSCREEN_LIBS :=
 
-  ifeq ($(USE_EXTERNAL_LIBZ), false)
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.base/share/native/libzip/zlib
-  else
-    ifeq ($(OPENJDK_TARGET_OS), macosx)
-      ifeq ($(USE_EXTERNAL_LIBPNG), false)
-        # When building our own libpng and using an external libz, we need to
-        # inject our own libz.h to tweak the exported ZLIB_VERNUM macro. See
-        # $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen/libpng/zlib.h
-        # for details.
-        LIBSPLASHSCREEN_CFLAGS += -iquote $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen/libpng
-      endif
-    endif
-  endif
-
   ifeq ($(OPENJDK_TARGET_OS), macosx)
     LIBSPLASHSCREEN_LIBS += \
         $(LIBM) -lpthread -liconv -losxapp \
@@ -871,14 +830,22 @@
     LIBSPLASHSCREEN_LIBS += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread -ldl
   endif
 
+  LIBSPLASHSCREEN_HEADER_DIRS += \
+      libosxapp \
+      java.base:include \
+      java.base:libjava \
+      #
+
   $(eval $(call SetupJdkLibrary, BUILD_LIBSPLASHSCREEN, \
       NAME := splashscreen, \
-      SRC := $(LIBSPLASHSCREEN_DIRS), \
+      EXTRA_SRC := $(LIBSPLASHSCREEN_EXTRA_SRC), \
+      EXCLUDE_SRC_PATTERNS := $(LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS), \
       EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
       EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
       OPTIMIZATION := LOW, \
-      CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
+      CFLAGS := $(CFLAGS_JDKLIB) $(LIBSPLASHSCREEN_CFLAGS) \
           $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
+      EXTRA_HEADER_DIRS := $(LIBSPLASHSCREEN_HEADER_DIRS), \
       DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result \
           maybe-uninitialized shift-negative-value implicit-fallthrough, \
       DISABLED_WARNINGS_clang := incompatible-pointer-types, \
@@ -897,7 +864,7 @@
   TARGETS += $(BUILD_LIBSPLASHSCREEN)
 
   ifeq ($(OPENJDK_TARGET_OS), macosx)
-    $(BUILD_LIBSPLASHSCREEN): $(call FindLib, java.desktop, osxapp)
+    $(BUILD_LIBSPLASHSCREEN): $(call FindLib, $(MODULE), osxapp)
   endif
 
 endif
@@ -906,49 +873,38 @@
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
 
-  LIBAWT_LWAWT_DIRS := \
-      $(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt \
-      $(TOPDIR)/src/java.desktop/unix/native/common/awt \
-      $(TOPDIR)/src/java.desktop/share/native/common/font \
-      $(TOPDIR)/src/java.desktop/share/native/common/java2d \
+  LIBAWT_LWAWT_EXTRA_SRC := \
+      $(TOPDIR)/src/$(MODULE)/unix/native/common/awt \
+      $(TOPDIR)/src/$(MODULE)/share/native/common/font \
+      $(TOPDIR)/src/$(MODULE)/share/native/common/java2d \
       #
 
-  LIBAWT_LWAWT_CFLAGS := \
-      $(addprefix -I, $(LIBAWT_LWAWT_DIRS)) \
-      -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
-      -I$(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/awt \
-      -I$(TOPDIR)/src/java.desktop/unix/native/libawt_xawt/awt \
-      -I$(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/font \
-      -I$(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl \
-      -I$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
-      -I$(TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
-      -I$(TOPDIR)/src/java.desktop/macosx/native/include \
-      -I$(TOPDIR)/src/java.desktop/share/native/include \
-      -I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
-      -I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
-      -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d \
-      -I$(TOPDIR)/src/java.desktop/unix/native/libawt/java2d \
-      -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
-      -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
-      -I$(TOPDIR)/src/java.desktop/share/native/libmlib_image/ \
-      -I$(TOPDIR)/src/java.desktop/macosx/native/libosxapp \
-      $(LIBJAVA_HEADER_FLAGS) \
+  LIBAWT_LWAWT_EXTRA_HEADER_DIRS := \
+      $(LIBAWT_DEFAULT_HEADER_DIRS) \
+      libawt_lwawt/awt \
+      libawt_lwawt/font \
+      libawt_lwawt/java2d/opengl \
+      include \
+      common/awt/debug \
+      common/java2d/opengl \
+      libosxapp \
       #
 
+  LIBAWT_LWAWT_CFLAGS := $(X_CFLAGS) $(X_LIBS)
+
   LIBAWT_LWAWT_EXFILES := fontpath.c awt_Font.c X11Color.c
-  LIBAWT_LWAWT_EXCLUDES := $(TOPDIR)/src/java.desktop/unix/native/common/awt/medialib
+  LIBAWT_LWAWT_EXCLUDES := $(TOPDIR)/src/$(MODULE)/unix/native/common/awt/medialib
 
   $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_LWAWT, \
       NAME := awt_lwawt, \
-      SRC := $(LIBAWT_LWAWT_DIRS), \
+      EXTRA_SRC := $(LIBAWT_LWAWT_EXTRA_SRC), \
       INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \
       EXCLUDE_FILES := $(LIBAWT_LWAWT_EXFILES), \
       EXCLUDES := $(LIBAWT_LWAWT_EXCLUDES), \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
-          $(X_CFLAGS) \
-          $(X_LIBS) \
           $(LIBAWT_LWAWT_CFLAGS), \
+      EXTRA_HEADER_DIRS := $(LIBAWT_LWAWT_EXTRA_HEADER_DIRS), \
       DISABLED_WARNINGS_clang := incomplete-implementation enum-conversion \
           deprecated-declarations objc-method-access bitwise-op-parentheses \
           incompatible-pointer-types parentheses-equality extra-tokens, \
@@ -975,7 +931,7 @@
 
   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBMLIB_IMAGE)
 
-  $(BUILD_LIBAWT_LWAWT): $(call FindLib, java.desktop, osxapp)
+  $(BUILD_LIBAWT_LWAWT): $(call FindLib, $(MODULE), osxapp)
 
   $(BUILD_LIBAWT_LWAWT): $(call FindLib, java.base, java)
 
@@ -987,15 +943,11 @@
 
   $(eval $(call SetupJdkLibrary, BUILD_LIBOSXUI, \
       NAME := osxui, \
-      SRC := $(TOPDIR)/src/java.desktop/macosx/native/libosxui, \
       OPTIMIZATION := LOW, \
-      CFLAGS := $(CFLAGS_JDKLIB) \
-          -I$(TOPDIR)/src/java.desktop/macosx/native/libosxui \
-          -I$(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/awt \
-          -I$(TOPDIR)/src/java.desktop/macosx/native/libosxapp \
-          -I$(TOPDIR)/src/java.base/share/native/libjava \
-          -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
-          -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop,  \
+      CFLAGS := $(CFLAGS_JDKLIB), \
+      EXTRA_HEADER_DIRS := \
+          libawt_lwawt/awt \
+          libosxapp, \
       DISABLED_WARNINGS_clang := deprecated-declarations, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN) \
@@ -1014,7 +966,7 @@
 
   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT)
 
-  $(BUILD_LIBOSXUI): $(call FindLib, java.desktop, osxapp)
+  $(BUILD_LIBOSXUI): $(call FindLib, $(MODULE), osxapp)
 
   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT)
 
--- a/make/lib/CoreLibraries.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/CoreLibraries.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -104,7 +104,6 @@
 
 $(eval $(call SetupJdkLibrary, BUILD_LIBVERIFY, \
     NAME := verify, \
-    SRC := $(TOPDIR)/src/java.base/share/native/libverify, \
     OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
     CFLAGS := $(CFLAGS_JDKLIB), \
     DISABLED_WARNINGS_gcc := implicit-fallthrough, \
@@ -119,13 +118,7 @@
 
 ##########################################################################################
 
-# Allow a custom makefile to add extra src dirs
-LIBJAVA_SRC_DIRS += $(call FindSrcDirsForLib, java.base, java)
-
-LIBJAVA_CFLAGS := $(addprefix -I, $(LIBJAVA_SRC_DIRS)) \
-    -I$(TOPDIR)/src/java.base/share/native/libfdlibm \
-    -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
-    -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"'
+LIBJAVA_CFLAGS := -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"'
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
   BUILD_LIBJAVA_java_props_md.c_CFLAGS := -x objective-c
@@ -134,12 +127,12 @@
 
 $(eval $(call SetupJdkLibrary, BUILD_LIBJAVA, \
     NAME := java, \
-    SRC := $(LIBJAVA_SRC_DIRS), \
     OPTIMIZATION := HIGH, \
     CFLAGS := $(CFLAGS_JDKLIB) \
         $(LIBJAVA_CFLAGS), \
     System.c_CFLAGS := $(VERSION_CFLAGS), \
     jdk_util.c_CFLAGS := $(VERSION_CFLAGS), \
+    EXTRA_HEADER_DIRS := libfdlibm, \
     WARNINGS_AS_ERRORS_xlc := false, \
     DISABLED_WARNINGS_gcc := unused-result, \
     DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
@@ -180,13 +173,9 @@
 $(eval $(call SetupJdkLibrary, BUILD_LIBZIP, \
     NAME := zip, \
     OPTIMIZATION := LOW, \
-    SRC := $(TOPDIR)/src/java.base/share/native/libzip, \
     EXCLUDES := $(LIBZIP_EXCLUDES), \
     CFLAGS := $(CFLAGS_JDKLIB) \
-        $(LIBZ_CFLAGS) \
-        -I$(TOPDIR)/src/java.base/share/native/libjava \
-        -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
-        -I$(SUPPORT_OUTPUTDIR)/headers/java.base, \
+        $(LIBZ_CFLAGS), \
     CFLAGS_unix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
@@ -200,22 +189,12 @@
 
 ##########################################################################################
 
-JIMAGELIB_CPPFLAGS := \
-    -I$(TOPDIR)/src/java.base/share/native/libjava \
-    -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
-    -I$(TOPDIR)/src/java.base/share/native/libjimage \
-    -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
-    #
-
 $(eval $(call SetupJdkLibrary, BUILD_LIBJIMAGE, \
     NAME := jimage, \
     TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
     OPTIMIZATION := LOW, \
-    SRC := $(TOPDIR)/src/java.base/share/native/libjimage \
-        $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjimage, \
-    EXCLUDES := $(LIBJIMAGE_EXCLUDES), \
-    CFLAGS := $(CFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \
-    CXXFLAGS := $(CXXFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \
+    CFLAGS := $(CFLAGS_JDKLIB), \
+    CXXFLAGS := $(CXXFLAGS_JDKLIB), \
     DISABLED_WARNINGS_gcc := implicit-fallthrough, \
     CFLAGS_unix := -UDEBUG, \
     LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
@@ -231,10 +210,6 @@
 
 ##########################################################################################
 
-LIBJLI_SRC_DIRS := $(call FindSrcDirsForLib, java.base, jli)
-
-LIBJLI_CFLAGS := $(CFLAGS_JDKLIB)
-
 ifeq ($(call check-jvm-variant, zero), true)
   ERGO_FAMILY := zero
 else
@@ -263,7 +238,7 @@
 
 ifeq ($(OPENJDK_TARGET_OS), windows)
   # Staticically link with c runtime on windows.
-  LIBJLI_CFLAGS := $(filter-out -MD, $(LIBJLI_CFLAGS))
+  LIBJLI_CFLAGS_JDKLIB := $(filter-out -MD, $(CFLAGS_JDKLIB))
   LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)
   # Supply the name of the C runtime lib.
   LIBJLI_CFLAGS += -DMSVCR_DLL_NAME='"$(notdir $(MSVCR_DLL))"'
@@ -271,11 +246,10 @@
     LIBJLI_CFLAGS += -DMSVCP_DLL_NAME='"$(notdir $(MSVCP_DLL))"'
   endif
 else
+  LIBJLI_CFLAGS_JDKLIB := $(CFLAGS_JDKLIB)
   LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)/jli
 endif
 
-LIBJLI_CFLAGS += $(addprefix -I, $(LIBJLI_SRC_DIRS))
-
 LIBJLI_CFLAGS += $(LIBZ_CFLAGS)
 
 ifneq ($(USE_EXTERNAL_LIBZ), true)
@@ -293,12 +267,10 @@
 $(eval $(call SetupJdkLibrary, BUILD_LIBJLI, \
     NAME := jli, \
     OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \
-    SRC := $(LIBJLI_SRC_DIRS), \
     EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
     EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
     OPTIMIZATION := HIGH, \
-    CFLAGS := $(LIBJLI_CFLAGS), \
-    DISABLED_WARNINGS_gcc := maybe-uninitialized, \
+    CFLAGS := $(LIBJLI_CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
     DISABLED_WARNINGS_solstudio := \
         E_ASM_DISABLES_OPTIMIZATION \
         E_STATEMENT_NOT_REACHED, \
@@ -316,6 +288,8 @@
 
 TARGETS += $(BUILD_LIBJLI)
 
+LIBJLI_SRC_DIRS := $(call FindSrcDirsForComponent, java.base, libjli)
+
 # On windows, the static library has the same suffix as the import library created by
 # with the shared library, so the static library is given a different name. No harm
 # in doing it for all platform to reduce complexity.
@@ -328,7 +302,8 @@
       EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
       EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
       OPTIMIZATION := HIGH, \
-      CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \
+      CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS_JDKLIB) $(LIBJLI_CFLAGS) \
+          $(addprefix -I, $(LIBJLI_SRC_DIRS)), \
       ARFLAGS := $(ARFLAGS), \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
   ))
@@ -347,7 +322,8 @@
       EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
       EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
       OPTIMIZATION := HIGH, \
-      CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
+      CFLAGS := $(LIBJLI_CFLAGS_JDKLIB) $(LIBJLI_CFLAGS) \
+          $(addprefix -I, $(LIBJLI_SRC_DIRS)), \
       LDFLAGS := -nostdlib $(ARFLAGS), \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
   ))
@@ -371,7 +347,7 @@
       EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
       EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
       OPTIMIZATION := HIGH, \
-      CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \
+      CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
       ARFLAGS := $(ARFLAGS), \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static))
 
--- a/make/lib/Lib-java.base.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-java.base.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -29,9 +29,7 @@
 $(eval $(call IncludeCustomExtension, lib/Lib-java.base.gmk))
 
 # Prepare the find cache.
-LIB_java.base_SRC_DIRS += $(TOPDIR)/src/java.base/*/native
-
-$(eval $(call FillCacheFind, $(wildcard $(LIB_java.base_SRC_DIRS))))
+$(eval $(call FillCacheFind, $(wildcard $(TOPDIR)/src/java.base/*/native)))
 
 ################################################################################
 # Create all the core libraries
@@ -41,14 +39,10 @@
 ################################################################################
 # Create the network library
 
-LIBNET_SRC_DIRS := $(call FindSrcDirsForLib, java.base, net)
-
 $(eval $(call SetupJdkLibrary, BUILD_LIBNET, \
     NAME := net, \
-    SRC := $(LIBNET_SRC_DIRS), \
     OPTIMIZATION := LOW, \
-    CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
-        $(LIBJAVA_HEADER_FLAGS) $(addprefix -I, $(LIBNET_SRC_DIRS)), \
+    CFLAGS := $(CFLAGS_JDKLIB), \
     DISABLED_WARNINGS_gcc := format-nonliteral, \
     DISABLED_WARNINGS_clang := parentheses-equality constant-logical-operand, \
     DISABLED_WARNINGS_microsoft := 4244 4047 4133 4996, \
@@ -72,31 +66,15 @@
 ################################################################################
 # Create the nio library
 
-BUILD_LIBNIO_SRC := \
-    $(TOPDIR)/src/java.base/share/native/libnio \
-    $(TOPDIR)/src/java.base/share/native/libnio/ch \
-    $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio \
-    $(sort $(wildcard \
-      $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/ch \
-      $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/fs \
-      $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/ch \
-      $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/fs)) \
-    #
-
-BUILD_LIBNIO_CFLAGS := \
-    $(addprefix -I, $(BUILD_LIBNIO_SRC)) \
-    -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
-    $(LIBJAVA_HEADER_FLAGS) \
-    $(addprefix -I, $(BUILD_LIBNET_SRC))
-
 $(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \
     NAME := nio, \
-    SRC := $(BUILD_LIBNIO_SRC), \
-    EXCLUDE_FILES := $(BUILD_LIBNIO_EXFILES), \
     OPTIMIZATION := HIGH, \
     WARNINGS_AS_ERRORS_xlc := false, \
-    CFLAGS := $(CFLAGS_JDKLIB) \
-        $(BUILD_LIBNIO_CFLAGS), \
+    CFLAGS := $(CFLAGS_JDKLIB), \
+    EXTRA_HEADER_DIRS := \
+        libnio/ch \
+        libnio/fs \
+        libnet, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LIBS_unix := -ljava -lnet, \
@@ -122,17 +100,10 @@
   # JavaNativeFoundation framework not supported in static builds
   ifneq ($(STATIC_BUILD), true)
 
-    LIBOSXSECURITY_DIRS := $(TOPDIR)/src/java.base/macosx/native/libosxsecurity
-    LIBOSXSECURITY_CFLAGS := -I$(LIBOSXSECURITY_DIRS) \
-        $(LIBJAVA_HEADER_FLAGS) \
-        -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
-
     $(eval $(call SetupJdkLibrary, BUILD_LIBOSXSECURITY, \
         NAME := osxsecurity, \
-        SRC := $(LIBOSXSECURITY_DIRS), \
         OPTIMIZATION := LOW, \
-        CFLAGS := $(CFLAGS_JDKLIB) \
-            $(LIBOSXSECURITY_CFLAGS), \
+        CFLAGS := $(CFLAGS_JDKLIB), \
         DISABLED_WARNINGS_clang := deprecated-declarations, \
         LDFLAGS := $(LDFLAGS_JDKLIB) \
             -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base \
@@ -158,7 +129,6 @@
 ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
   ifeq ($(STATIC_BUILD), false)
 
-    LIBJSIG_SRC_DIR := $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjsig
     LIBJSIG_MAPFILE := $(wildcard $(TOPDIR)/make/mapfiles/libjsig/mapfile-vers-$(OPENJDK_TARGET_OS))
 
     ifeq ($(OPENJDK_TARGET_OS), linux)
@@ -168,7 +138,6 @@
 
     $(eval $(call SetupJdkLibrary, BUILD_LIBJSIG, \
         NAME := jsig, \
-        SRC := $(LIBJSIG_SRC_DIR), \
         CFLAGS := $(CFLAGS_JDKLIB) $(LIBJSIG_CFLAGS), \
         LDFLAGS := $(LDFLAGS_JDKLIB) \
             $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/make/lib/Lib-java.desktop.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-java.desktop.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -29,9 +29,7 @@
 $(eval $(call IncludeCustomExtension, lib/Lib-java.desktop.gmk))
 
 # Prepare the find cache.
-LIB_java.desktop_SRC_DIRS += $(TOPDIR)/src/java.desktop/*/native
-
-$(eval $(call FillCacheFind, $(wildcard $(LIB_java.desktop_SRC_DIRS))))
+$(eval $(call FillCacheFind, $(wildcard $(TOPDIR)/src/java.desktop/*/native)))
 
 ################################################################################
 # Create the AWT/2D libraries
@@ -43,16 +41,8 @@
 
 ifneq ($(OPENJDK_TARGET_OS), aix)
 
-  LIBJSOUND_SRC_DIRS := $(wildcard \
-      $(TOPDIR)/src/java.desktop/share/native/libjsound \
-      $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/libjsound \
-      )
-
   LIBJSOUND_CFLAGS := \
-      -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
       $(ALSA_CFLAGS) \
-      $(LIBJAVA_HEADER_FLAGS) \
-      $(foreach dir, $(LIBJSOUND_SRC_DIRS), -I$(dir)) \
       -DX_PLATFORM=X_$(OPENJDK_TARGET_OS_UPPERCASE) \
       -DUSE_PORTS=TRUE \
       -DUSE_DAUDIO=TRUE \
@@ -71,7 +61,6 @@
 
   $(eval $(call SetupJdkLibrary, BUILD_LIBJSOUND, \
       NAME := jsound, \
-      SRC := $(LIBJSOUND_SRC_DIRS), \
       TOOLCHAIN := $(LIBJSOUND_TOOLCHAIN), \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
@@ -97,15 +86,11 @@
 # Create the macosx specific osxapp and osx libraries
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  LIBOSXAPP_SRC := $(TOPDIR)/src/java.desktop/macosx/native/libosxapp
 
   $(eval $(call SetupJdkLibrary, BUILD_LIBOSXAPP, \
       NAME := osxapp, \
-      SRC := $(LIBOSXAPP_SRC), \
       OPTIMIZATION := LOW, \
-      CFLAGS := $(CFLAGS_JDKLIB) \
-          $(addprefix -I, $(LIBOSXAPP_SRC)) \
-          -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \
+      CFLAGS := $(CFLAGS_JDKLIB), \
       DISABLED_WARNINGS_clang := objc-method-access objc-root-class \
           deprecated-declarations, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
@@ -129,19 +114,11 @@
 
   ##############################################################################
 
-  LIBOSX_DIRS := $(TOPDIR)/src/java.desktop/macosx/native/libosx
-  LIBOSX_CFLAGS := -I$(LIBOSX_DIRS) \
-      -I$(TOPDIR)/src/java.desktop/macosx/native/libosxapp \
-      $(LIBJAVA_HEADER_FLAGS) \
-      -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
-      #
-
   $(eval $(call SetupJdkLibrary, BUILD_LIBOSX, \
       NAME := osx, \
-      SRC := $(LIBOSX_DIRS), \
       OPTIMIZATION := LOW, \
-      CFLAGS := $(CFLAGS_JDKLIB) \
-          $(LIBOSX_CFLAGS), \
+      CFLAGS := $(CFLAGS_JDKLIB), \
+      EXTRA_HEADER_DIRS := libosxapp, \
       DISABLED_WARNINGS_clang := deprecated-declarations, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.desktop \
--- a/make/lib/Lib-java.instrument.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-java.instrument.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -30,32 +30,24 @@
 
 ################################################################################
 
-LIBINSTRUMENT_SRC := $(TOPDIR)/src/java.instrument/share/native/libinstrument \
-    $(TOPDIR)/src/java.instrument/$(OPENJDK_TARGET_OS_TYPE)/native/libinstrument \
-    #
-LIBINSTRUMENT_CFLAGS := $(CFLAGS_JDKLIB) \
-    $(addprefix -I, $(LIBINSTRUMENT_SRC)) \
-    -I$(SUPPORT_OUTPUTDIR)/headers/java.instrument \
-    -I$(TOPDIR)/src/java.base/share/native/libjli \
-    -I$(TOPDIR)/src/java.base/share/native/libjava \
-    #
-
 ifeq ($(OPENJDK_TARGET_OS), windows)
   # Statically link the C runtime so that there are not dependencies on modules
   # not on the search patch when invoked from the Windows system directory
   # (or elsewhere).
-  LIBINSTRUMENT_CFLAGS := $(filter-out -MD, $(LIBINSTRUMENT_CFLAGS))
+  LIBINSTRUMENT_CFLAGS_JDKLIB := $(filter-out -MD, $(CFLAGS_JDKLIB))
   # equivalent of strcasecmp is stricmp on Windows
-  LIBINSTRUMENT_CFLAGS += -Dstrcasecmp=stricmp
+  LIBINSTRUMENT_CFLAGS := -Dstrcasecmp=stricmp
+else
+  LIBINSTRUMENT_CFLAGS_JDKLIB := $(CFLAGS_JDKLIB)
 endif
 
 $(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \
     NAME := instrument, \
-    SRC := $(LIBINSTRUMENT_SRC), \
     OPTIMIZATION := LOW, \
-    CFLAGS := $(LIBINSTRUMENT_CFLAGS), \
+    CFLAGS := $(LIBINSTRUMENT_CFLAGS_JDKLIB) $(LIBINSTRUMENT_CFLAGS), \
     CFLAGS_debug := -DJPLIS_LOGGING, \
     CFLAGS_release := -DNO_JPLIS_LOGGING, \
+    EXTRA_HEADER_DIRS := java.base:libjli, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN) \
         $(LIBINSTRUMENT_LDFLAGS), \
--- a/make/lib/Lib-java.management.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-java.management.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -30,13 +30,6 @@
 
 ################################################################################
 
-LIBMANAGEMENT_SRC += $(TOPDIR)/src/java.management/share/native/libmanagement
-LIBMANAGEMENT_CFLAGS := -I$(TOPDIR)/src/hotspot/share/include \
-    $(addprefix -I,$(LIBMANAGEMENT_SRC)) \
-    -I$(SUPPORT_OUTPUTDIR)/headers/java.management \
-    $(LIBJAVA_HEADER_FLAGS) \
-    #
-
 LIBMANAGEMENT_OPTIMIZATION := HIGH
 ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
   ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true)
@@ -46,9 +39,8 @@
 
 $(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT, \
     NAME := management, \
-    SRC := $(LIBMANAGEMENT_SRC), \
     OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \
-    CFLAGS := $(CFLAGS_JDKLIB) $(LIBMANAGEMENT_CFLAGS), \
+    CFLAGS := $(CFLAGS_JDKLIB), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LIBS := $(JDKLIB_LIBS), \
--- a/make/lib/Lib-java.prefs.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-java.prefs.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -27,18 +27,16 @@
 
 ################################################################################
 
+# libprefs on macosx do not use the unix code
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  LIBPREF_SRC_DIRS := $(TOPDIR)/src/java.prefs/macosx/native/libprefs
-else
-  LIBPREF_SRC_DIRS := $(TOPDIR)/src/java.prefs/$(OPENJDK_TARGET_OS_TYPE)/native/libprefs
+  LIBPREFS_EXCLUDE_SRC_PATTERNS := unix
 endif
 
 $(eval $(call SetupJdkLibrary, BUILD_LIBPREFS, \
     NAME := prefs, \
-    SRC := $(LIBPREF_SRC_DIRS), \
+    EXCLUDE_SRC_PATTERNS := $(LIBPREFS_EXCLUDE_SRC_PATTERNS), \
     OPTIMIZATION := HIGH, \
-    CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBPREF_SRC_DIRS)) \
-        $(LIBJAVA_HEADER_FLAGS), \
+    CFLAGS := $(CFLAGS_JDKLIB), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LIBS_unix := -ljvm, \
--- a/make/lib/Lib-java.rmi.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-java.rmi.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -29,9 +29,8 @@
 
 $(eval $(call SetupJdkLibrary, BUILD_LIBRMI, \
     NAME := rmi, \
-    SRC := $(TOPDIR)/src/java.rmi/share/native/librmi, \
     OPTIMIZATION := LOW, \
-    CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/java.rmi, \
+    CFLAGS := $(CFLAGS_JDKLIB), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LIBS_unix := -ljvm, \
--- a/make/lib/Lib-java.security.jgss.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-java.security.jgss.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -27,16 +27,10 @@
 
 ################################################################################
 
-LIBJ2GSS_SRC := $(TOPDIR)/src/java.security.jgss/share/native/libj2gss \
-  #
-
 $(eval $(call SetupJdkLibrary, BUILD_LIBJ2GSS, \
     NAME := j2gss, \
-    SRC := $(LIBJ2GSS_SRC), \
     OPTIMIZATION := LOW, \
-    CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBJ2GSS_SRC)) \
-        $(LIBJAVA_HEADER_FLAGS) \
-        -I$(SUPPORT_OUTPUTDIR)/headers/java.security.jgss, \
+    CFLAGS := $(CFLAGS_JDKLIB), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LIBS := $(LIBDL), \
@@ -49,15 +43,10 @@
 ifneq ($(BUILD_CRYPTO), false)
 
   ifeq ($(OPENJDK_TARGET_OS), windows)
-    BUILD_LIBW2K_LSA_AUTH_SRC := $(call FindSrcDirsForLib, $(MODULE), w2k_lsa_auth)
-
     $(eval $(call SetupJdkLibrary, BUILD_LIBW2K_LSA_AUTH, \
         NAME := w2k_lsa_auth, \
-        SRC := $(BUILD_LIBW2K_LSA_AUTH_SRC), \
         OPTIMIZATION := LOW, \
-        CFLAGS := $(CFLAGS_JDKLIB) \
-            $(addprefix -I, $(BUILD_LIBW2K_LSA_AUTH_SRC)) \
-            -I$(SUPPORT_OUTPUTDIR)/headers/java.security.jgss, \
+        CFLAGS := $(CFLAGS_JDKLIB), \
         LDFLAGS := $(LDFLAGS_JDKLIB) \
             $(call SET_SHARED_LIBRARY_ORIGIN), \
         LIBS := advapi32.lib Secur32.lib netapi32.lib kernel32.lib user32.lib \
@@ -69,17 +58,12 @@
   endif
 
   ifeq ($(OPENJDK_TARGET_OS), macosx)
-    BUILD_LIBOSXKRB5_SRC := $(call FindSrcDirsForLib, $(MODULE), osxkrb5)
-
     # libosxkrb5 needs to call deprecated krb5 APIs so that java
     # can use the native credentials cache.
     $(eval $(call SetupJdkLibrary, BUILD_LIBOSXKRB5, \
         NAME := osxkrb5, \
-        SRC := $(BUILD_LIBOSXKRB5_SRC), \
         OPTIMIZATION := LOW, \
-        CFLAGS := $(CFLAGS_JDKLIB) \
-            $(addprefix -I, $(BUILD_LIBOSXKRB5_SRC)) \
-            -I$(SUPPORT_OUTPUTDIR)/headers/java.security.jgss, \
+        CFLAGS := $(CFLAGS_JDKLIB), \
         DISABLED_WARNINGS_clang := deprecated-declarations, \
         LDFLAGS := $(LDFLAGS_JDKLIB) \
             $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/make/lib/Lib-java.smartcardio.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-java.smartcardio.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -27,18 +27,12 @@
 
 ################################################################################
 
-LIBJ2PCSC_SRC := $(TOPDIR)/src/java.smartcardio/share/native/libj2pcsc \
-    $(TOPDIR)/src/java.smartcardio/$(OPENJDK_TARGET_OS_TYPE)/native/libj2pcsc
-LIBJ2PCSC_CPPFLAGS := $(addprefix -I,$(LIBJ2PCSC_SRC)) \
-    -I$(TOPDIR)/src/java.smartcardio/$(OPENJDK_TARGET_OS_TYPE)/native/libj2pcsc/MUSCLE \
-    -I$(SUPPORT_OUTPUTDIR)/headers/java.smartcardio
-
 $(eval $(call SetupJdkLibrary, BUILD_LIBJ2PCSC, \
     NAME := j2pcsc, \
-    SRC := $(LIBJ2PCSC_SRC), \
+    CFLAGS := $(CFLAGS_JDKLIB), \
     CFLAGS_unix := -D__sun_jdk, \
+    EXTRA_HEADER_DIRS := libj2pcsc/MUSCLE, \
     OPTIMIZATION := LOW, \
-    CFLAGS := $(CFLAGS_JDKLIB) $(LIBJ2PCSC_CPPFLAGS), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LIBS_unix := $(LIBDL), \
--- a/make/lib/Lib-jdk.accessibility.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-jdk.accessibility.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -30,12 +30,6 @@
 ifeq ($(OPENJDK_TARGET_OS), windows)
 
   ROOT_SRCDIR := $(TOPDIR)/src/jdk.accessibility/windows/native
-  JAVA_AB_SRCDIR := $(ROOT_SRCDIR)/libjavaaccessbridge $(ROOT_SRCDIR)/common
-  WIN_AB_SRCDIR := $(ROOT_SRCDIR)/libwindowsaccessbridge $(ROOT_SRCDIR)/common
-  SYSINFO_SRCDIR := $(ROOT_SRCDIR)/libjabsysinfo
-  ACCESSBRIDGE_CFLAGS := -I$(SUPPORT_OUTPUTDIR)/headers/jdk.accessibility \
-      -I$(TOPDIR)/src/java.desktop/windows/native/include \
-      -I$(TOPDIR)/src/java.desktop/share/native/include
 
   define SetupJavaDLL
     # Parameter 1 Suffix
@@ -43,13 +37,16 @@
 
     $(call SetupJdkLibrary, BUILD_JAVAACCESSBRIDGE$1, \
         NAME := javaaccessbridge$1, \
-        SRC := $(JAVA_AB_SRCDIR), \
+        SRC := libjavaaccessbridge, \
+        EXTRA_SRC := common, \
         OPTIMIZATION := LOW, \
         DISABLED_WARNINGS_microsoft := 4311 4302 4312, \
-        CFLAGS := $(CFLAGS_JDKLIB) $(ACCESSBRIDGE_CFLAGS) \
-            $(addprefix -I,$(JAVA_AB_SRCDIR)) \
-            -I$(ROOT_SRCDIR)/include/bridge \
+        CFLAGS := $(CFLAGS_JDKLIB) \
             -DACCESSBRIDGE_ARCH_$2, \
+        EXTRA_HEADER_DIRS := \
+            include/bridge \
+            java.base:include \
+            java.desktop:include, \
         LDFLAGS := $(LDFLAGS_JDKLIB), \
         LIBS := kernel32.lib user32.lib gdi32.lib \
             winspool.lib comdlg32.lib advapi32.lib shell32.lib \
@@ -68,13 +65,15 @@
     # Parameter 2 ACCESSBRIDGE_ARCH_ suffix
     $(call SetupJdkLibrary, BUILD_WINDOWSACCESSBRIDGE$1, \
         NAME := windowsaccessbridge$1, \
-        SRC := $(WIN_AB_SRCDIR), \
+        SRC := libwindowsaccessbridge, \
+        EXTRA_SRC := common, \
         OPTIMIZATION := LOW, \
         DISABLED_WARNINGS_microsoft := 4311 4302 4312, \
-        CFLAGS := $(filter-out -MD, $(CFLAGS_JDKLIB)) -MT $(ACCESSBRIDGE_CFLAGS) \
-            $(addprefix -I,$(WIN_AB_SRCDIR)) \
-            -I$(ROOT_SRCDIR)/include/bridge \
+        CFLAGS := $(filter-out -MD, $(CFLAGS_JDKLIB)) -MT \
             -DACCESSBRIDGE_ARCH_$2, \
+        EXTRA_HEADER_DIRS := \
+            include/bridge \
+            java.base:include, \
         LDFLAGS := $(LDFLAGS_JDKLIB) \
             -def:$(ROOT_SRCDIR)/libwindowsaccessbridge/WinAccessBridge.DEF, \
         LIBS := kernel32.lib user32.lib gdi32.lib \
@@ -91,9 +90,8 @@
 
     $(call SetupJdkLibrary, BUILD_ACCESSBRIDGESYSINFO, \
         NAME := jabsysinfo, \
-        SRC := $(SYSINFO_SRCDIR), \
         OPTIMIZATION := LOW, \
-        CFLAGS := $(CFLAGS_JDKLIB) $(ACCESSBRIDGE_CFLAGS), \
+        CFLAGS := $(CFLAGS_JDKLIB), \
         LDFLAGS := $(LDFLAGS_JDKLIB), \
         VERSIONINFO_RESOURCE := $(ROOT_SRCDIR)/common/AccessBridgeStatusWindow.rc, \
     )
--- a/make/lib/Lib-jdk.attach.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-jdk.attach.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -36,11 +36,8 @@
 
 $(eval $(call SetupJdkLibrary, BUILD_LIBATTACH, \
     NAME := attach, \
-    SRC := $(call FindSrcDirsForLib, jdk.attach, attach), \
     OPTIMIZATION := LOW, \
-    CFLAGS := $(CFLAGS_JDKLIB) \
-        -I$(SUPPORT_OUTPUTDIR)/headers/jdk.attach \
-        $(LIBJAVA_HEADER_FLAGS) $(LIBATTACH_CFLAGS), \
+    CFLAGS := $(CFLAGS_JDKLIB) $(LIBATTACH_CFLAGS), \
     CFLAGS_windows := /Gy, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/make/lib/Lib-jdk.crypto.cryptoki.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-jdk.crypto.cryptoki.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -27,16 +27,10 @@
 
 ################################################################################
 
-LIBJ2PKCS11_SRC := $(TOPDIR)/src/jdk.crypto.cryptoki/share/native/libj2pkcs11 \
-    $(TOPDIR)/src/jdk.crypto.cryptoki/$(OPENJDK_TARGET_OS_TYPE)/native/libj2pkcs11
-
 $(eval $(call SetupJdkLibrary, BUILD_LIBJ2PKCS11, \
     NAME := j2pkcs11, \
-    SRC := $(LIBJ2PKCS11_SRC), \
     OPTIMIZATION := LOW, \
-    CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBJ2PKCS11_SRC)) \
-        $(LIBJAVA_HEADER_FLAGS) \
-        -I$(SUPPORT_OUTPUTDIR)/headers/jdk.crypto.cryptoki, \
+    CFLAGS := $(CFLAGS_JDKLIB), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LIBS_unix := $(LIBDL), \
--- a/make/lib/Lib-jdk.crypto.ec.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-jdk.crypto.ec.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -28,31 +28,23 @@
 ################################################################################
 
 ifeq ($(ENABLE_INTREE_EC), true)
-
-  LIBSUNEC_SRC := $(TOPDIR)/src/jdk.crypto.ec/share/native/libsunec
-  BUILD_LIBSUNEC_FLAGS := $(addprefix -I, $(SUNEC_SRC))
-
-  #
   # On sol-sparc...all libraries are compiled with -xregs=no%appl
-  # (set in CFLAGS_REQUIRED_sparc)
-  #
-  # except!!! libsunec.so
-  #
-  ECC_JNI_SOLSPARC_FILTER :=
+  # (set in CFLAGS_REQUIRED_sparc) except libsunec.so
   ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
-    ECC_JNI_SOLSPARC_FILTER := -xregs=no%appl
+    BUILD_LIBSUNEC_CFLAGS_JDKLIB := $(filter-out -xregs=no%appl, $(CFLAGS_JDKLIB))
+    BUILD_LIBSUNEC_CXXFLAGS_JDKLIB := $(filter-out -xregs=no%appl, $(CXXFLAGS_JDKLIB))
+  else
+    BUILD_LIBSUNEC_CFLAGS_JDKLIB := $(CFLAGS_JDKLIB)
+    BUILD_LIBSUNEC_CXXFLAGS_JDKLIB := $(CXXFLAGS_JDKLIB)
   endif
 
   $(eval $(call SetupJdkLibrary, BUILD_LIBSUNEC, \
       NAME := sunec, \
-      SRC := $(LIBSUNEC_SRC), \
       TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
       OPTIMIZATION := LOW, \
-      CFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CFLAGS_JDKLIB)) \
-          $(BUILD_LIBSUNEC_FLAGS) \
+      CFLAGS := $(BUILD_LIBSUNEC_CFLAGS_JDKLIB) \
           -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B, \
-      CXXFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CXXFLAGS_JDKLIB)) \
-          $(BUILD_LIBSUNEC_FLAGS), \
+      CXXFLAGS := $(BUILD_LIBSUNEC_CXXFLAGS_JDKLIB), \
       DISABLED_WARNINGS_gcc := sign-compare implicit-fallthrough, \
       DISABLED_WARNINGS_microsoft := 4101 4244 4146 4018, \
       LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
--- a/make/lib/Lib-jdk.crypto.mscapi.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-jdk.crypto.mscapi.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -29,14 +29,10 @@
 
 ifeq ($(OPENJDK_TARGET_OS), windows)
 
-  LIBSUNMSCAPI_SRC := $(TOPDIR)/src/jdk.crypto.mscapi/$(OPENJDK_TARGET_OS_TYPE)/native/libsunmscapi
-
   $(eval $(call SetupJdkLibrary, BUILD_LIBSUNMSCAPI, \
       NAME := sunmscapi, \
-      SRC := $(LIBSUNMSCAPI_SRC), \
       OPTIMIZATION := LOW, \
-      CFLAGS := $(CFLAGS_JDKLIB) \
-          -I$(LIBSUNMSCAPI_SRC), \
+      CFLAGS := $(CFLAGS_JDKLIB), \
       LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LIBS := crypt32.lib advapi32.lib, \
--- a/make/lib/Lib-jdk.crypto.ucrypto.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-jdk.crypto.ucrypto.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -29,14 +29,10 @@
 
 ifeq ($(OPENJDK_TARGET_OS), solaris)
 
-  LIBJ2UCRYPTO_SRC := $(TOPDIR)/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto
-
   $(eval $(call SetupJdkLibrary, BUILD_LIBJ2UCRYPTO, \
       NAME := j2ucrypto, \
-      SRC := $(LIBJ2UCRYPTO_SRC), \
       OPTIMIZATION := LOW, \
-      CFLAGS := $(CFLAGS_JDKLIB) \
-          $(addprefix -I, $(LIBJ2UCRYPTO_SRC)), \
+      CFLAGS := $(CFLAGS_JDKLIB), \
       LDFLAGS := $(LDFLAGS_JDKLIB), \
       LIBS := $(LIBDL), \
   ))
--- a/make/lib/Lib-jdk.hotspot.agent.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-jdk.hotspot.agent.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -29,19 +29,6 @@
 
 ################################################################################
 
-SA_TOPDIR := $(TOPDIR)/src/jdk.hotspot.agent
-
-SA_SRC += \
-    $(SA_TOPDIR)/share/native/libsaproc \
-    $(SA_TOPDIR)/$(OPENJDK_TARGET_OS)/native/libsaproc \
-    #
-
-SA_INCLUDES := \
-    $(addprefix -I, $(SA_SRC)) \
-    -I$(SUPPORT_OUTPUTDIR)/headers/jdk.hotspot.agent \
-    -I$(TOPDIR)/src/hotspot/os/$(OPENJDK_TARGET_OS) \
-    #
-
 ifeq ($(OPENJDK_TARGET_OS), linux)
   SA_CFLAGS := -D_FILE_OFFSET_BITS=64
 
@@ -68,9 +55,8 @@
     DISABLED_WARNINGS_microsoft := 4267, \
     DISABLED_WARNINGS_gcc := sign-compare, \
     DISABLED_WARNINGS_CXX_solstudio := truncwarn unknownpragma, \
-    SRC := $(SA_SRC), \
-    CFLAGS := $(CFLAGS_JDKLIB) $(SA_INCLUDES) $(SA_CFLAGS) $(SA_CUSTOM_CFLAGS), \
-    CXXFLAGS := $(CXXFLAGS_JDKLIB) $(SA_INCLUDES) $(SA_CFLAGS) $(SA_CXXFLAGS), \
+    CFLAGS := $(CFLAGS_JDKLIB) $(SA_CFLAGS), \
+    CXXFLAGS := $(CXXFLAGS_JDKLIB) $(SA_CFLAGS) $(SA_CXXFLAGS), \
     LDFLAGS := $(LDFLAGS_JDKLIB) $(SA_LDFLAGS), \
     LIBS_linux := -lthread_db $(LIBDL), \
     LIBS_solaris := -ldl -ldemangle -lthread -lproc, \
--- a/make/lib/Lib-jdk.internal.le.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-jdk.internal.le.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -29,19 +29,10 @@
 
 ifeq ($(OPENJDK_TARGET_OS), windows)
 
-  LIBLE_SRC := $(TOPDIR)/src/jdk.internal.le/$(OPENJDK_TARGET_OS_TYPE)/native/lible \
-      #
-  LIBLE_CPPFLAGS := \
-      $(addprefix -I, $(LIBLE_SRC)) \
-      -I$(SUPPORT_OUTPUTDIR)/headers/jdk.internal.le \
-      #
-
   $(eval $(call SetupJdkLibrary, BUILD_LIBLE, \
       NAME := le, \
-      SRC := $(LIBLE_SRC), \
       OPTIMIZATION := LOW, \
-      CFLAGS := $(CFLAGS_JDKLIB) $(LIBJAVA_HEADER_FLAGS)\
-          $(LIBLE_CPPFLAGS), \
+      CFLAGS := $(CFLAGS_JDKLIB), \
       LDFLAGS := $(LDFLAGS_JDKLIB), \
       LIBS := $(JDKLIB_LIBS) user32.lib, \
   ))
--- a/make/lib/Lib-jdk.jdi.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-jdk.jdi.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -29,22 +29,13 @@
 
 ifeq ($(OPENJDK_TARGET_OS), windows)
 
-  LIBDT_SHMEM_SRC := $(TOPDIR)/src/jdk.jdi/share/native/libdt_shmem \
-      $(TOPDIR)/src/jdk.jdi/$(OPENJDK_TARGET_OS_TYPE)/native/libdt_shmem \
-      #
-  LIBDT_SHMEM_CPPFLAGS := -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \
-      $(addprefix -I, $(LIBDT_SHMEM_SRC)) \
-      -I$(TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp/export \
-      -I$(TOPDIR)/src/jdk.jdwp.agent/share/native/include \
-      -I$(SUPPORT_OUTPUTDIR)/headers/jdk.jdi \
-      #
-
   $(eval $(call SetupJdkLibrary, BUILD_LIBDT_SHMEM, \
       NAME := dt_shmem, \
-      SRC := $(LIBDT_SHMEM_SRC), \
       OPTIMIZATION := LOW, \
-      CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \
-          $(LIBDT_SHMEM_CPPFLAGS), \
+      CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP, \
+      EXTRA_HEADER_DIRS := \
+          jdk.jdwp.agent:include \
+          jdk.jdwp.agent:libjdwp/export, \
       LDFLAGS := $(LDFLAGS_JDKLIB), \
       LIBS := $(JDKLIB_LIBS), \
   ))
--- a/make/lib/Lib-jdk.jdwp.agent.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-jdk.jdwp.agent.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -27,21 +27,14 @@
 
 ################################################################################
 
-LIBDT_SOCKET_SRC := $(TOPDIR)/src/jdk.jdwp.agent/share/native/libdt_socket \
-    $(TOPDIR)/src/jdk.jdwp.agent/$(OPENJDK_TARGET_OS_TYPE)/native/libdt_socket
-LIBDT_SOCKET_CPPFLAGS := \
-    $(addprefix -I, $(LIBDT_SOCKET_SRC)) \
-    -I$(TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp/export \
-    -I$(TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp \
-    -I$(TOPDIR)/src/jdk.jdwp.agent/share/native/include \
-    #
-
 $(eval $(call SetupJdkLibrary, BUILD_LIBDT_SOCKET, \
     NAME := dt_socket, \
-    SRC := $(LIBDT_SOCKET_SRC), \
     OPTIMIZATION := LOW, \
     CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \
         $(LIBDT_SOCKET_CPPFLAGS), \
+    EXTRA_HEADER_DIRS := \
+        include \
+        libjdwp/export, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LIBS_linux := -lpthread, \
@@ -56,21 +49,14 @@
 
 ################################################################################
 
-LIBJDWP_SRC := $(TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp \
-    $(TOPDIR)/src/jdk.jdwp.agent/$(OPENJDK_TARGET_OS_TYPE)/native/libjdwp
-LIBJDWP_CPPFLAGS := \
-    -I$(TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp/export \
-    -I$(TOPDIR)/src/jdk.jdwp.agent/share/native/include \
-    $(addprefix -I, $(LIBJDWP_SRC))
-
 # JDWP_LOGGING causes log messages to be compiled into the library.
 $(eval $(call SetupJdkLibrary, BUILD_LIBJDWP, \
     NAME := jdwp, \
-    SRC := $(LIBJDWP_SRC), \
     OPTIMIZATION := LOW, \
-    CFLAGS := $(CFLAGS_JDKLIB) -DJDWP_LOGGING \
-        $(LIBJDWP_CPPFLAGS) \
-        -I$(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent, \
+    CFLAGS := $(CFLAGS_JDKLIB) -DJDWP_LOGGING, \
+    EXTRA_HEADER_DIRS := \
+      include \
+      libjdwp/export, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LIBS := $(JDKLIB_LIBS), \
--- a/make/lib/Lib-jdk.management.agent.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-jdk.management.agent.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -27,17 +27,10 @@
 
 ################################################################################
 
-LIBMANAGEMENT_AGENT_SRC += $(TOPDIR)/src/jdk.management.agent/$(OPENJDK_TARGET_OS_TYPE)/native/libmanagement_agent
-LIBMANAGEMENT_AGENT_CFLAGS := $(addprefix -I,$(LIBMANAGEMENT_AGENT_SRC)) \
-    -I$(SUPPORT_OUTPUTDIR)/headers/jdk.management.agent \
-    $(LIBJAVA_HEADER_FLAGS) \
-    #
-
 $(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT_AGENT, \
     NAME := management_agent, \
-    SRC := $(LIBMANAGEMENT_AGENT_SRC), \
     OPTIMIZATION := LOW, \
-    CFLAGS := $(CFLAGS_JDKLIB) $(LIBMANAGEMENT_AGENT_CFLAGS), \
+    CFLAGS := $(CFLAGS_JDKLIB), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LIBS := $(JDKLIB_LIBS), \
--- a/make/lib/Lib-jdk.management.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-jdk.management.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -30,15 +30,6 @@
 
 ################################################################################
 
-LIBMANAGEMENT_EXT_SRC += $(TOPDIR)/src/jdk.management/share/native/libmanagement_ext \
-    $(TOPDIR)/src/jdk.management/$(OPENJDK_TARGET_OS_TYPE)/native/libmanagement_ext       \
-    $(TOPDIR)/src/jdk.management/$(OPENJDK_TARGET_OS)/native/libmanagement_ext
-LIBMANAGEMENT_EXT_CFLAGS := -I$(TOPDIR)/src/java.management/share/native/include \
-    $(addprefix -I,$(LIBMANAGEMENT_EXT_SRC)) \
-    -I$(SUPPORT_OUTPUTDIR)/headers/jdk.management \
-    $(LIBJAVA_HEADER_FLAGS) \
-    #
-
 ifeq ($(OPENJDK_TARGET_OS), windows)
   # In (at least) VS2013 and later, -DPSAPI_VERSION=1 is needed to generate
   # a binary that is compatible with windows versions older than 7/2008R2.
@@ -55,8 +46,6 @@
 
 $(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT_EXT, \
     NAME := management_ext, \
-    SRC := $(LIBMANAGEMENT_EXT_SRC), \
-    LANG := C, \
     OPTIMIZATION := $(LIBMANAGEMENT_EXT_OPTIMIZATION), \
     CFLAGS := $(CFLAGS_JDKLIB) $(LIBMANAGEMENT_EXT_CFLAGS), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
--- a/make/lib/Lib-jdk.net.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-jdk.net.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -31,9 +31,8 @@
 
   $(eval $(call SetupJdkLibrary, BUILD_LIBEXTNET, \
       NAME := extnet, \
-      SRC := $(TOPDIR)/src/jdk.net/$(OPENJDK_TARGET_OS)/native/libextnet, \
       OPTIMIZATION := LOW, \
-      CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/jdk.net, \
+      CFLAGS := $(CFLAGS_JDKLIB), \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LIBS := -ljava, \
--- a/make/lib/Lib-jdk.pack.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-jdk.pack.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -29,16 +29,13 @@
 
 $(eval $(call SetupJdkLibrary, BUILD_LIBUNPACK, \
     NAME := unpack, \
-    SRC := $(TOPDIR)/src/jdk.pack/share/native/libunpack \
-        $(TOPDIR)/src/jdk.pack/share/native/common-unpack, \
+    EXTRA_SRC := common-unpack, \
     TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
     OPTIMIZATION := LOW, \
     CFLAGS := $(CXXFLAGS_JDKLIB) \
-        -DNO_ZLIB -DUNPACK_JNI -DFULL \
-        -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
-        -I$(TOPDIR)/src/jdk.pack/share/native/common-unpack \
-        $(LIBJAVA_HEADER_FLAGS), \
+        -DNO_ZLIB -DUNPACK_JNI -DFULL, \
     CFLAGS_release := -DPRODUCT, \
+    EXTRA_HEADER_DIRS := $(call GetJavaHeaderDir, java.base), \
     DISABLED_WARNINGS_gcc := implicit-fallthrough, \
     LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/make/lib/Lib-jdk.sctp.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-jdk.sctp.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -29,18 +29,15 @@
 
 ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
 
-  ifeq (, $(filter $(OPENJDK_TARGET_OS), macosx aix))
+  ifeq ($(filter $(OPENJDK_TARGET_OS), macosx aix), )
     $(eval $(call SetupJdkLibrary, BUILD_LIBSCTP, \
         NAME := sctp, \
-        SRC := $(TOPDIR)/src/jdk.sctp/$(OPENJDK_TARGET_OS_TYPE)/native/libsctp, \
         OPTIMIZATION := LOW, \
-        CFLAGS := $(CFLAGS_JDKLIB) \
-            -I $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/ch \
-            -I $(TOPDIR)/src/java.base/share/native/libnio/ch \
-            $(addprefix -I, $(call FindSrcDirsForLib, java.base, net)) \
-            $(LIBJAVA_HEADER_FLAGS) \
-            -I$(SUPPORT_OUTPUTDIR)/headers/jdk.sctp \
-            -I$(SUPPORT_OUTPUTDIR)/headers/java.base, \
+        CFLAGS := $(CFLAGS_JDKLIB), \
+        EXTRA_HEADER_DIRS := \
+            $(call GetJavaHeaderDir, java.base) \
+            java.base:libnet \
+            java.base:libnio/ch, \
         LDFLAGS := $(LDFLAGS_JDKLIB) \
             $(call SET_SHARED_LIBRARY_ORIGIN), \
         LIBS_unix := -lnio -lnet -ljava -ljvm, \
--- a/make/lib/Lib-jdk.security.auth.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/Lib-jdk.security.auth.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -29,9 +29,8 @@
 
 $(eval $(call SetupJdkLibrary, BUILD_LIBJAAS, \
     NAME := jaas, \
-    SRC := $(call FindSrcDirsForLib, jdk.security.auth, jaas), \
     OPTIMIZATION := LOW, \
-    CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/jdk.security.auth, \
+    CFLAGS := $(CFLAGS_JDKLIB), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LIBS_windows := netapi32.lib user32.lib mpr.lib advapi32.lib $(JDKLIB_LIBS), \
--- a/make/lib/LibCommon.gmk	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/lib/LibCommon.gmk	Mon Jun 11 09:29:44 2018 +0200
@@ -25,9 +25,6 @@
 
 include JdkNativeCompilation.gmk
 
-# Hook to include the corresponding custom file, if present.
-$(eval $(call IncludeCustomExtension, lib/LibCommon.gmk))
-
 ################################################################################
 
 GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/version.rc
@@ -67,16 +64,6 @@
 endif
 
 ################################################################################
-# Find the default set of src dirs for a native library.
-# Param 1 - module name
-# Param 2 - library name
-FindSrcDirsForLib += \
-  $(call uniq, $(wildcard \
-      $(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/lib$(strip $2) \
-      $(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/native/lib$(strip $2) \
-      $(TOPDIR)/src/$(strip $1)/share/native/lib$(strip $2)))
-
-################################################################################
 # Find a library
 # Param 1 - module name
 # Param 2 - library name
@@ -94,10 +81,6 @@
     $(addprefix $(SUPPORT_OUTPUTDIR)/native/, \
         $(strip $1)$(strip $3)/$(LIBRARY_PREFIX)$(strip $2)$(STATIC_LIBRARY_SUFFIX))
 
-################################################################################
-# Define the header include flags needed to compile against it.
-LIBJAVA_HEADER_FLAGS := $(addprefix -I, $(call FindSrcDirsForLib, java.base, java))
-
 # Put the libraries here.
 INSTALL_LIBRARIES_HERE := $(call FindLibDirForModule, $(MODULE))
 
--- a/make/scripts/compare.sh	Wed Jun 06 10:32:59 2018 +0200
+++ b/make/scripts/compare.sh	Mon Jun 11 09:29:44 2018 +0200
@@ -1300,35 +1300,10 @@
         THIS_JDK="$THIS/install/jdk"
         OTHER_JDK="$OTHER/install/jdk"
         echo "Selecting install images for JDK compare"
-        if [ -d "$THIS/install/jre" ] && [ -d "$OTHER/install/jre" ]; then
-            THIS_JRE="$THIS/install/jre"
-            OTHER_JRE="$OTHER/install/jre"
-            echo "Also selecting install images for JRE compare"
-        else
-            echo "No install JRE image found"
-        fi
-    elif [ -d "$THIS/images/jdk" ] && [ -d "$OTHER/deploy/images/jdk" ]; then
-        THIS_JDK="$THIS/images/jdk"
-        OTHER_JDK="$OTHER/deploy/images/jdk"
-        echo "Selecting deploy images for JDK compare"
-        if [ -d "$THIS/images/jre" ] && [ -d "$OTHER/deploy/images/jre" ]; then
-            THIS_JRE="$THIS/images/jre"
-            OTHER_JRE="$OTHER/deploy/images/jre"
-            echo "Selecting deploy images for JRE compare"
-        else
-            echo "No deploy JRE image found"
-        fi
     elif [ -d "$THIS/images/jdk" ] && [ -d "$OTHER/images/jdk" ]; then
         THIS_JDK="$THIS/images/jdk"
         OTHER_JDK="$OTHER/images/jdk"
         echo "Selecting normal images for JDK compare"
-        if [ -d "$THIS/images/jre" ] && [ -d "$OTHER/images/jre" ]; then
-            THIS_JRE="$THIS/images/jre"
-            OTHER_JRE="$OTHER/images/jre"
-            echo "Selecting normal images for JRE compare"
-        else
-            echo "No normal JRE image found"
-        fi
     elif [ -d "$(ls -d $THIS/licensee-src/build/*/images/jdk 2> /dev/null)" ] \
         && [ -d "$(ls -d $OTHER/licensee-src/build/*/images/jdk 2> /dev/null)" ]
     then
@@ -1341,9 +1316,7 @@
         THIS="$(ls -d $THIS/licensee-src/build/*)"
         OTHER="$(ls -d $OTHER/licensee-src/build/*)"
         THIS_JDK="$THIS/images/jdk"
-        THIS_JRE="$THIS/images/jre"
         OTHER_JDK="$OTHER/images/jdk"
-        OTHER_JRE="$OTHER/images/jre"
         # Rewrite the path to tools that are used from the build
         JIMAGE="$(echo "$JIMAGE" | $SED "s|$OLD_THIS|$THIS|g")"
         JAVAP="$(echo "$JAVAP" | $SED "s|$OLD_THIS|$THIS|g")"
@@ -1358,17 +1331,13 @@
 	     && [ -d "$OTHER/images/jdk-bundle" -o -d "$OTHER/deploy/images/jdk-bundle" ]; then
 	if [ -d "$THIS/deploy/images/jdk-bundle" ]; then
             THIS_JDK_BUNDLE="$THIS/deploy/images/jdk-bundle"
-            THIS_JRE_BUNDLE="$THIS/deploy/images/jre-bundle"
 	else
             THIS_JDK_BUNDLE="$THIS/images/jdk-bundle"
-            THIS_JRE_BUNDLE="$THIS/images/jre-bundle"
 	fi
 	if [ -d "$OTHER/deploy/images/jdk-bundle" ]; then
             OTHER_JDK_BUNDLE="$OTHER/deploy/images/jdk-bundle"
-            OTHER_JRE_BUNDLE="$OTHER/deploy/images/jre-bundle"
 	else
             OTHER_JDK_BUNDLE="$OTHER/images/jdk-bundle"
-            OTHER_JRE_BUNDLE="$OTHER/images/jre-bundle"
 	fi
         echo "Also comparing jdk macosx bundles"
         echo "  $THIS_JDK_BUNDLE"
@@ -1457,22 +1426,12 @@
         echo -n "JDK "
         compare_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
     fi
-    if [ -n "$THIS_JRE" ] && [ -n "$OTHER_JRE" ]; then
-        echo -n "JRE "
-        compare_dirs $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre
-        echo -n "JRE "
-        compare_files $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre
-    fi
     if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then
         echo -n "JDK Bundle "
         compare_dirs $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
-        echo -n "JRE Bundle "
-        compare_dirs $THIS_JRE_BUNDLE $OTHER_JRE_BUNDLE $COMPARE_ROOT/jre-bundle
 
         echo -n "JDK Bundle "
         compare_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
-        echo -n "JRE Bundle "
-        compare_files $THIS_JRE_BUNDLE $OTHER_JRE_BUNDLE $COMPARE_ROOT/jre-bundle
     fi
     if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then
         echo -n "Docs "
@@ -1538,15 +1497,9 @@
         echo -n "JDK "
         compare_general_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
     fi
-    if [ -n "$THIS_JRE" ] && [ -n "$OTHER_JRE" ]; then
-        echo -n "JRE "
-        compare_general_files $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre
-    fi
     if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then
         echo -n "JDK Bundle "
         compare_general_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
-        echo -n "JRE Bundle "
-        compare_general_files $THIS_JRE_BUNDLE $OTHER_JRE_BUNDLE $COMPARE_ROOT/jre-bundle
     fi
     if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then
         echo -n "Docs "
@@ -1615,10 +1568,6 @@
         echo -n "JDK "
         compare_permissions $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
     fi
-    if [ -n "$THIS_JRE" ] && [ -n "$OTHER_JRE" ]; then
-        echo -n "JRE "
-        compare_permissions $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre
-    fi
     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
         compare_permissions $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
     fi
@@ -1637,15 +1586,9 @@
         echo -n "JDK "
         compare_file_types $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
     fi
-    if [ -n "$THIS_JRE" ] && [ -n "$OTHER_JRE" ]; then
-        echo -n "JRE "
-        compare_file_types $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre
-    fi
     if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then
         echo -n "JDK Bundle "
         compare_file_types $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
-        echo -n "JRE Bundle "
-        compare_file_types $THIS_JRE_BUNDLE $OTHER_JRE_BUNDLE $COMPARE_ROOT/jre-bundle
     fi
     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
         compare_file_types $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
--- a/src/hotspot/cpu/aarch64/aarch64.ad	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/aarch64/aarch64.ad	Mon Jun 11 09:29:44 2018 +0200
@@ -3792,69 +3792,7 @@
   return false;
 }
 
-// Transform:
-// (AddP base (AddP base address (LShiftL index con)) offset)
-// into:
-// (AddP base (AddP base offset) (LShiftL index con))
-// to take full advantage of ARM's addressing modes
 void Compile::reshape_address(AddPNode* addp) {
-  Node *addr = addp->in(AddPNode::Address);
-  if (addr->is_AddP() && addr->in(AddPNode::Base) == addp->in(AddPNode::Base)) {
-    const AddPNode *addp2 = addr->as_AddP();
-    if ((addp2->in(AddPNode::Offset)->Opcode() == Op_LShiftL &&
-         addp2->in(AddPNode::Offset)->in(2)->is_Con() &&
-         size_fits_all_mem_uses(addp, addp2->in(AddPNode::Offset)->in(2)->get_int())) ||
-        addp2->in(AddPNode::Offset)->Opcode() == Op_ConvI2L) {
-
-      // Any use that can't embed the address computation?
-      for (DUIterator_Fast imax, i = addp->fast_outs(imax); i < imax; i++) {
-        Node* u = addp->fast_out(i);
-        if (!u->is_Mem()) {
-          return;
-        }
-        if (u->is_LoadVector() || u->is_StoreVector() || u->Opcode() == Op_StoreCM) {
-          return;
-        }
-        if (addp2->in(AddPNode::Offset)->Opcode() != Op_ConvI2L) {
-          int scale = 1 << addp2->in(AddPNode::Offset)->in(2)->get_int();
-          if (VM_Version::expensive_load(u->as_Mem()->memory_size(), scale)) {
-            return;
-          }
-        }
-      }
-
-      Node* off = addp->in(AddPNode::Offset);
-      Node* addr2 = addp2->in(AddPNode::Address);
-      Node* base = addp->in(AddPNode::Base);
-
-      Node* new_addr = NULL;
-      // Check whether the graph already has the new AddP we need
-      // before we create one (no GVN available here).
-      for (DUIterator_Fast imax, i = addr2->fast_outs(imax); i < imax; i++) {
-        Node* u = addr2->fast_out(i);
-        if (u->is_AddP() &&
-            u->in(AddPNode::Base) == base &&
-            u->in(AddPNode::Address) == addr2 &&
-            u->in(AddPNode::Offset) == off) {
-          new_addr = u;
-          break;
-        }
-      }
-
-      if (new_addr == NULL) {
-        new_addr = new AddPNode(base, addr2, off);
-      }
-      Node* new_off = addp2->in(AddPNode::Offset);
-      addp->set_req(AddPNode::Address, new_addr);
-      if (addr->outcnt() == 0) {
-        addr->disconnect_inputs(NULL, this);
-      }
-      addp->set_req(AddPNode::Offset, new_off);
-      if (off->outcnt() == 0) {
-        off->disconnect_inputs(NULL, this);
-      }
-    }
-  }
 }
 
 // helper for encoding java_to_runtime calls on sim
--- a/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -56,6 +56,15 @@
     }
     break;
   }
+  case T_BOOLEAN: __ load_unsigned_byte (dst, src); break;
+  case T_BYTE:    __ load_signed_byte   (dst, src); break;
+  case T_CHAR:    __ load_unsigned_short(dst, src); break;
+  case T_SHORT:   __ load_signed_short  (dst, src); break;
+  case T_INT:     __ ldrw               (dst, src); break;
+  case T_LONG:    __ ldr                (dst, src); break;
+  case T_ADDRESS: __ ldr                (dst, src); break;
+  case T_FLOAT:   __ ldrs               (v0, src);  break;
+  case T_DOUBLE:  __ ldrd               (v0, src);  break;
   default: Unimplemented();
   }
 }
@@ -84,6 +93,18 @@
     }
     break;
   }
+  case T_BOOLEAN:
+    __ andw(val, val, 0x1);  // boolean is true if LSB is 1
+    __ strb(val, dst);
+    break;
+  case T_BYTE:    __ strb(val, dst); break;
+  case T_CHAR:    __ strh(val, dst); break;
+  case T_SHORT:   __ strh(val, dst); break;
+  case T_INT:     __ strw(val, dst); break;
+  case T_LONG:    __ str (val, dst); break;
+  case T_ADDRESS: __ str (val, dst); break;
+  case T_FLOAT:   __ strs(v0,  dst); break;
+  case T_DOUBLE:  __ strd(v0,  dst); break;
   default: Unimplemented();
   }
 }
--- a/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -268,9 +268,6 @@
 void InterpreterMacroAssembler::load_resolved_reference_at_index(
                                            Register result, Register index, Register tmp) {
   assert_different_registers(result, index);
-  // convert from field index to resolved_references() index and from
-  // word index to byte offset. Since this is a java object, it can be compressed
-  lslw(index, index, LogBytesPerHeapOop);
 
   get_constant_pool(result);
   // load pointer for resolved_references[] objArray
@@ -278,8 +275,8 @@
   ldr(result, Address(result, ConstantPoolCache::resolved_references_offset_in_bytes()));
   resolve_oop_handle(result, tmp);
   // Add in the index
-  add(result, result, index);
-  load_heap_oop(result, Address(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
+  add(index, index, arrayOopDesc::base_offset_in_bytes(T_OBJECT) >> LogBytesPerHeapOop);
+  load_heap_oop(result, Address(result, index, Address::uxtw(LogBytesPerHeapOop)));
 }
 
 void InterpreterMacroAssembler::load_resolved_klass_at_offset(
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -37,6 +37,7 @@
 #include "compiler/disassembler.hpp"
 #include "memory/resourceArea.hpp"
 #include "nativeInst_aarch64.hpp"
+#include "oops/accessDecorators.hpp"
 #include "oops/compressedOops.inline.hpp"
 #include "oops/klass.inline.hpp"
 #include "oops/oop.hpp"
@@ -2127,7 +2128,7 @@
 
   bind(not_weak);
   // Resolve (untagged) jobject.
-  bs->load_at(this, IN_ROOT | IN_CONCURRENT_ROOT, T_OBJECT,
+  bs->load_at(this, IN_CONCURRENT_ROOT, T_OBJECT,
                     value, Address(value, 0), tmp, thread);
   verify_oop(value);
   bind(done);
@@ -3664,7 +3665,7 @@
 void MacroAssembler::resolve_oop_handle(Register result, Register tmp) {
   // OopHandle::resolve is an indirection.
   BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
-  bs->load_at(this, IN_ROOT | IN_CONCURRENT_ROOT, T_OBJECT,
+  bs->load_at(this, IN_CONCURRENT_ROOT, T_OBJECT,
                     result, Address(result, 0), tmp, rthread);
 }
 
@@ -3983,6 +3984,7 @@
                                     Register dst, Address src,
                                     Register tmp1, Register thread_tmp) {
   BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
+  decorators = AccessInternal::decorator_fixup(decorators);
   bool as_raw = (decorators & AS_RAW) != 0;
   if (as_raw) {
     bs->BarrierSetAssembler::load_at(this, decorators, type, dst, src, tmp1, thread_tmp);
@@ -3995,6 +3997,7 @@
                                      Address dst, Register src,
                                      Register tmp1, Register thread_tmp) {
   BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
+  decorators = AccessInternal::decorator_fixup(decorators);
   bool as_raw = (decorators & AS_RAW) != 0;
   if (as_raw) {
     bs->BarrierSetAssembler::store_at(this, decorators, type, dst, src, tmp1, thread_tmp);
--- a/src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -141,7 +141,7 @@
   __ verify_oop(method_temp);
   __ load_heap_oop(method_temp, Address(method_temp, NONZERO(java_lang_invoke_MemberName::method_offset_in_bytes())), temp2);
   __ verify_oop(method_temp);
-  __ ldr(method_temp, Address(method_temp, NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset_in_bytes())));
+  __ access_load_at(T_ADDRESS, IN_HEAP, method_temp, Address(method_temp, NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset_in_bytes())), noreg, noreg);
 
   if (VerifyMethodHandles && !for_compiler_entry) {
     // make sure recv is already on stack
@@ -340,7 +340,7 @@
         verify_ref_kind(_masm, JVM_REF_invokeSpecial, member_reg, temp3);
       }
       __ load_heap_oop(rmethod, member_vmtarget);
-      __ ldr(rmethod, vmtarget_method);
+      __ access_load_at(T_ADDRESS, IN_HEAP, rmethod, vmtarget_method, noreg, noreg);
       break;
 
     case vmIntrinsics::_linkToStatic:
@@ -348,7 +348,7 @@
         verify_ref_kind(_masm, JVM_REF_invokeStatic, member_reg, temp3);
       }
       __ load_heap_oop(rmethod, member_vmtarget);
-      __ ldr(rmethod, vmtarget_method);
+      __ access_load_at(T_ADDRESS, IN_HEAP, rmethod, vmtarget_method, noreg, noreg);
       break;
 
     case vmIntrinsics::_linkToVirtual:
@@ -362,7 +362,7 @@
 
       // pick out the vtable index from the MemberName, and then we can discard it:
       Register temp2_index = temp2;
-      __ ldr(temp2_index, member_vmindex);
+      __ access_load_at(T_ADDRESS, IN_HEAP, temp2_index, member_vmindex, noreg, noreg);
 
       if (VerifyMethodHandles) {
         Label L_index_ok;
@@ -394,7 +394,7 @@
       __ verify_klass_ptr(temp3_intf);
 
       Register rindex = rmethod;
-      __ ldr(rindex, member_vmindex);
+      __ access_load_at(T_ADDRESS, IN_HEAP, rindex, member_vmindex, noreg, noreg);
       if (VerifyMethodHandles) {
         Label L;
         __ cmpw(rindex, 0U);
--- a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -760,8 +760,8 @@
   // r0: array
   // r1: index
   index_check(r0, r1); // leaves index in r1, kills rscratch1
-  __ lea(r1, Address(r0, r1, Address::uxtw(2)));
-  __ ldrw(r0, Address(r1, arrayOopDesc::base_offset_in_bytes(T_INT)));
+  __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_INT) >> 2);
+  __ access_load_at(T_INT, IN_HEAP | IN_HEAP_ARRAY, r0, Address(r0, r1, Address::uxtw(2)), noreg, noreg);
 }
 
 void TemplateTable::laload()
@@ -772,8 +772,8 @@
   // r0: array
   // r1: index
   index_check(r0, r1); // leaves index in r1, kills rscratch1
-  __ lea(r1, Address(r0, r1, Address::uxtw(3)));
-  __ ldr(r0, Address(r1,  arrayOopDesc::base_offset_in_bytes(T_LONG)));
+  __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_LONG) >> 3);
+  __ access_load_at(T_LONG, IN_HEAP | IN_HEAP_ARRAY, r0, Address(r0, r1, Address::uxtw(3)), noreg, noreg);
 }
 
 void TemplateTable::faload()
@@ -784,8 +784,8 @@
   // r0: array
   // r1: index
   index_check(r0, r1); // leaves index in r1, kills rscratch1
-  __ lea(r1,  Address(r0, r1, Address::uxtw(2)));
-  __ ldrs(v0, Address(r1,  arrayOopDesc::base_offset_in_bytes(T_FLOAT)));
+  __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_FLOAT) >> 2);
+  __ access_load_at(T_FLOAT, IN_HEAP | IN_HEAP_ARRAY, r0, Address(r0, r1, Address::uxtw(2)), noreg, noreg);
 }
 
 void TemplateTable::daload()
@@ -796,8 +796,8 @@
   // r0: array
   // r1: index
   index_check(r0, r1); // leaves index in r1, kills rscratch1
-  __ lea(r1,  Address(r0, r1, Address::uxtw(3)));
-  __ ldrd(v0, Address(r1,  arrayOopDesc::base_offset_in_bytes(T_DOUBLE)));
+  __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_DOUBLE) >> 3);
+  __ access_load_at(T_DOUBLE, IN_HEAP | IN_HEAP_ARRAY, r0, Address(r0, r1, Address::uxtw(3)), noreg, noreg);
 }
 
 void TemplateTable::aaload()
@@ -808,12 +808,11 @@
   // r0: array
   // r1: index
   index_check(r0, r1); // leaves index in r1, kills rscratch1
-  int s = (UseCompressedOops ? 2 : 3);
-  __ lea(r1, Address(r0, r1, Address::uxtw(s)));
+  __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_OBJECT) >> LogBytesPerHeapOop);
   do_oop_load(_masm,
-              Address(r1, arrayOopDesc::base_offset_in_bytes(T_OBJECT)),
+              Address(r0, r1, Address::uxtw(LogBytesPerHeapOop)),
               r0,
-              IN_HEAP | IN_HEAP_ARRAY);
+              IN_HEAP_ARRAY);
 }
 
 void TemplateTable::baload()
@@ -824,8 +823,8 @@
   // r0: array
   // r1: index
   index_check(r0, r1); // leaves index in r1, kills rscratch1
-  __ lea(r1,  Address(r0, r1, Address::uxtw(0)));
-  __ load_signed_byte(r0, Address(r1,  arrayOopDesc::base_offset_in_bytes(T_BYTE)));
+  __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_BYTE) >> 0);
+  __ access_load_at(T_BYTE, IN_HEAP | IN_HEAP_ARRAY, r0, Address(r0, r1, Address::uxtw(0)), noreg, noreg);
 }
 
 void TemplateTable::caload()
@@ -836,8 +835,8 @@
   // r0: array
   // r1: index
   index_check(r0, r1); // leaves index in r1, kills rscratch1
-  __ lea(r1,  Address(r0, r1, Address::uxtw(1)));
-  __ load_unsigned_short(r0, Address(r1,  arrayOopDesc::base_offset_in_bytes(T_CHAR)));
+  __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_CHAR) >> 1);
+  __ access_load_at(T_CHAR, IN_HEAP | IN_HEAP_ARRAY, r0, Address(r0, r1, Address::uxtw(1)), noreg, noreg);
 }
 
 // iload followed by caload frequent pair
@@ -853,8 +852,8 @@
   // r0: array
   // r1: index
   index_check(r0, r1); // leaves index in r1, kills rscratch1
-  __ lea(r1,  Address(r0, r1, Address::uxtw(1)));
-  __ load_unsigned_short(r0, Address(r1,  arrayOopDesc::base_offset_in_bytes(T_CHAR)));
+  __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_CHAR) >> 1);
+  __ access_load_at(T_CHAR, IN_HEAP | IN_HEAP_ARRAY, r0, Address(r0, r1, Address::uxtw(1)), noreg, noreg);
 }
 
 void TemplateTable::saload()
@@ -865,8 +864,8 @@
   // r0: array
   // r1: index
   index_check(r0, r1); // leaves index in r1, kills rscratch1
-  __ lea(r1,  Address(r0, r1, Address::uxtw(1)));
-  __ load_signed_short(r0, Address(r1,  arrayOopDesc::base_offset_in_bytes(T_SHORT)));
+  __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_SHORT) >> 1);
+  __ access_load_at(T_SHORT, IN_HEAP | IN_HEAP_ARRAY, r0, Address(r0, r1, Address::uxtw(1)), noreg, noreg);
 }
 
 void TemplateTable::iload(int n)
@@ -1059,9 +1058,8 @@
   // r1: index
   // r3: array
   index_check(r3, r1); // prefer index in r1
-  __ lea(rscratch1, Address(r3, r1, Address::uxtw(2)));
-  __ strw(r0, Address(rscratch1,
-                      arrayOopDesc::base_offset_in_bytes(T_INT)));
+  __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_INT) >> 2);
+  __ access_store_at(T_INT, IN_HEAP | IN_HEAP_ARRAY, Address(r3, r1, Address::uxtw(2)), r0, noreg, noreg);
 }
 
 void TemplateTable::lastore() {
@@ -1072,9 +1070,8 @@
   // r1: index
   // r3: array
   index_check(r3, r1); // prefer index in r1
-  __ lea(rscratch1, Address(r3, r1, Address::uxtw(3)));
-  __ str(r0, Address(rscratch1,
-                      arrayOopDesc::base_offset_in_bytes(T_LONG)));
+  __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_LONG) >> 3);
+  __ access_store_at(T_LONG, IN_HEAP | IN_HEAP_ARRAY, Address(r3, r1, Address::uxtw(3)), r0, noreg, noreg);
 }
 
 void TemplateTable::fastore() {
@@ -1085,9 +1082,8 @@
   // r1:  index
   // r3:  array
   index_check(r3, r1); // prefer index in r1
-  __ lea(rscratch1, Address(r3, r1, Address::uxtw(2)));
-  __ strs(v0, Address(rscratch1,
-                      arrayOopDesc::base_offset_in_bytes(T_FLOAT)));
+  __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_FLOAT) >> 2);
+  __ access_store_at(T_FLOAT, IN_HEAP | IN_HEAP_ARRAY, Address(r3, r1, Address::uxtw(2)), noreg /* ftos */, noreg, noreg);
 }
 
 void TemplateTable::dastore() {
@@ -1098,9 +1094,8 @@
   // r1:  index
   // r3:  array
   index_check(r3, r1); // prefer index in r1
-  __ lea(rscratch1, Address(r3, r1, Address::uxtw(3)));
-  __ strd(v0, Address(rscratch1,
-                      arrayOopDesc::base_offset_in_bytes(T_DOUBLE)));
+  __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_DOUBLE) >> 3);
+  __ access_store_at(T_DOUBLE, IN_HEAP | IN_HEAP_ARRAY, Address(r3, r1, Address::uxtw(3)), noreg /* dtos */, noreg, noreg);
 }
 
 void TemplateTable::aastore() {
@@ -1111,10 +1106,10 @@
   __ ldr(r2, at_tos_p1()); // index
   __ ldr(r3, at_tos_p2()); // array
 
-  Address element_address(r4, arrayOopDesc::base_offset_in_bytes(T_OBJECT));
+  Address element_address(r3, r4, Address::uxtw(LogBytesPerHeapOop));
 
   index_check(r3, r2);     // kills r1
-  __ lea(r4, Address(r3, r2, Address::uxtw(UseCompressedOops? 2 : 3)));
+  __ add(r4, r2, arrayOopDesc::base_offset_in_bytes(T_OBJECT) >> LogBytesPerHeapOop);
 
   // do array store check - check for NULL value first
   __ cbz(r0, is_null);
@@ -1141,7 +1136,7 @@
   // Get the value we will store
   __ ldr(r0, at_tos());
   // Now store using the appropriate barrier
-  do_oop_store(_masm, element_address, r0, IN_HEAP | IN_HEAP_ARRAY);
+  do_oop_store(_masm, element_address, r0, IN_HEAP_ARRAY);
   __ b(done);
 
   // Have a NULL in r0, r3=array, r2=index.  Store NULL at ary[idx]
@@ -1149,7 +1144,7 @@
   __ profile_null_seen(r2);
 
   // Store a NULL
-  do_oop_store(_masm, element_address, noreg, IN_HEAP | IN_HEAP_ARRAY);
+  do_oop_store(_masm, element_address, noreg, IN_HEAP_ARRAY);
 
   // Pop stack arguments
   __ bind(done);
@@ -1176,9 +1171,8 @@
   __ andw(r0, r0, 1);  // if it is a T_BOOLEAN array, mask the stored value to 0/1
   __ bind(L_skip);
 
-  __ lea(rscratch1, Address(r3, r1, Address::uxtw(0)));
-  __ strb(r0, Address(rscratch1,
-                      arrayOopDesc::base_offset_in_bytes(T_BYTE)));
+  __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_BYTE) >> 0);
+  __ access_store_at(T_BYTE, IN_HEAP | IN_HEAP_ARRAY, Address(r3, r1, Address::uxtw(0)), r0, noreg, noreg);
 }
 
 void TemplateTable::castore()
@@ -1190,9 +1184,8 @@
   // r1: index
   // r3: array
   index_check(r3, r1); // prefer index in r1
-  __ lea(rscratch1, Address(r3, r1, Address::uxtw(1)));
-  __ strh(r0, Address(rscratch1,
-                      arrayOopDesc::base_offset_in_bytes(T_CHAR)));
+  __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_CHAR) >> 1);
+  __ access_store_at(T_CHAR, IN_HEAP | IN_HEAP_ARRAY, Address(r3, r1, Address::uxtw(1)), r0, noreg, noreg);
 }
 
 void TemplateTable::sastore()
@@ -2513,7 +2506,7 @@
   if (is_static) rc = may_not_rewrite;
 
   // btos
-  __ load_signed_byte(r0, field);
+  __ access_load_at(T_BYTE, IN_HEAP, r0, field, noreg, noreg);
   __ push(btos);
   // Rewrite bytecode to be faster
   if (rc == may_rewrite) {
@@ -2526,7 +2519,7 @@
   __ br(Assembler::NE, notBool);
 
   // ztos (same code as btos)
-  __ ldrsb(r0, field);
+  __ access_load_at(T_BOOLEAN, IN_HEAP, r0, field, noreg, noreg);
   __ push(ztos);
   // Rewrite bytecode to be faster
   if (rc == may_rewrite) {
@@ -2550,7 +2543,7 @@
   __ cmp(flags, itos);
   __ br(Assembler::NE, notInt);
   // itos
-  __ ldrw(r0, field);
+  __ access_load_at(T_INT, IN_HEAP, r0, field, noreg, noreg);
   __ push(itos);
   // Rewrite bytecode to be faster
   if (rc == may_rewrite) {
@@ -2562,7 +2555,7 @@
   __ cmp(flags, ctos);
   __ br(Assembler::NE, notChar);
   // ctos
-  __ load_unsigned_short(r0, field);
+  __ access_load_at(T_CHAR, IN_HEAP, r0, field, noreg, noreg);
   __ push(ctos);
   // Rewrite bytecode to be faster
   if (rc == may_rewrite) {
@@ -2574,7 +2567,7 @@
   __ cmp(flags, stos);
   __ br(Assembler::NE, notShort);
   // stos
-  __ load_signed_short(r0, field);
+  __ access_load_at(T_SHORT, IN_HEAP, r0, field, noreg, noreg);
   __ push(stos);
   // Rewrite bytecode to be faster
   if (rc == may_rewrite) {
@@ -2586,7 +2579,7 @@
   __ cmp(flags, ltos);
   __ br(Assembler::NE, notLong);
   // ltos
-  __ ldr(r0, field);
+  __ access_load_at(T_LONG, IN_HEAP, r0, field, noreg, noreg);
   __ push(ltos);
   // Rewrite bytecode to be faster
   if (rc == may_rewrite) {
@@ -2598,7 +2591,7 @@
   __ cmp(flags, ftos);
   __ br(Assembler::NE, notFloat);
   // ftos
-  __ ldrs(v0, field);
+  __ access_load_at(T_FLOAT, IN_HEAP, noreg /* ftos */, field, noreg, noreg);
   __ push(ftos);
   // Rewrite bytecode to be faster
   if (rc == may_rewrite) {
@@ -2612,7 +2605,7 @@
   __ br(Assembler::NE, notDouble);
 #endif
   // dtos
-  __ ldrd(v0, field);
+  __ access_load_at(T_DOUBLE, IN_HEAP, noreg /* ftos */, field, noreg, noreg);
   __ push(dtos);
   // Rewrite bytecode to be faster
   if (rc == may_rewrite) {
@@ -2750,7 +2743,7 @@
   {
     __ pop(btos);
     if (!is_static) pop_and_check_object(obj);
-    __ strb(r0, field);
+    __ access_store_at(T_BYTE, IN_HEAP, field, r0, noreg, noreg);
     if (rc == may_rewrite) {
       patch_bytecode(Bytecodes::_fast_bputfield, bc, r1, true, byte_no);
     }
@@ -2765,8 +2758,7 @@
   {
     __ pop(ztos);
     if (!is_static) pop_and_check_object(obj);
-    __ andw(r0, r0, 0x1);
-    __ strb(r0, field);
+    __ access_store_at(T_BOOLEAN, IN_HEAP, field, r0, noreg, noreg);
     if (rc == may_rewrite) {
       patch_bytecode(Bytecodes::_fast_zputfield, bc, r1, true, byte_no);
     }
@@ -2797,7 +2789,7 @@
   {
     __ pop(itos);
     if (!is_static) pop_and_check_object(obj);
-    __ strw(r0, field);
+    __ access_store_at(T_INT, IN_HEAP, field, r0, noreg, noreg);
     if (rc == may_rewrite) {
       patch_bytecode(Bytecodes::_fast_iputfield, bc, r1, true, byte_no);
     }
@@ -2812,7 +2804,7 @@
   {
     __ pop(ctos);
     if (!is_static) pop_and_check_object(obj);
-    __ strh(r0, field);
+    __ access_store_at(T_CHAR, IN_HEAP, field, r0, noreg, noreg);
     if (rc == may_rewrite) {
       patch_bytecode(Bytecodes::_fast_cputfield, bc, r1, true, byte_no);
     }
@@ -2827,7 +2819,7 @@
   {
     __ pop(stos);
     if (!is_static) pop_and_check_object(obj);
-    __ strh(r0, field);
+    __ access_store_at(T_SHORT, IN_HEAP, field, r0, noreg, noreg);
     if (rc == may_rewrite) {
       patch_bytecode(Bytecodes::_fast_sputfield, bc, r1, true, byte_no);
     }
@@ -2842,7 +2834,7 @@
   {
     __ pop(ltos);
     if (!is_static) pop_and_check_object(obj);
-    __ str(r0, field);
+    __ access_store_at(T_LONG, IN_HEAP, field, r0, noreg, noreg);
     if (rc == may_rewrite) {
       patch_bytecode(Bytecodes::_fast_lputfield, bc, r1, true, byte_no);
     }
@@ -2857,7 +2849,7 @@
   {
     __ pop(ftos);
     if (!is_static) pop_and_check_object(obj);
-    __ strs(v0, field);
+    __ access_store_at(T_FLOAT, IN_HEAP, field, noreg /* ftos */, noreg, noreg);
     if (rc == may_rewrite) {
       patch_bytecode(Bytecodes::_fast_fputfield, bc, r1, true, byte_no);
     }
@@ -2874,7 +2866,7 @@
   {
     __ pop(dtos);
     if (!is_static) pop_and_check_object(obj);
-    __ strd(v0, field);
+    __ access_store_at(T_DOUBLE, IN_HEAP, field, noreg /* dtos */, noreg, noreg);
     if (rc == may_rewrite) {
       patch_bytecode(Bytecodes::_fast_dputfield, bc, r1, true, byte_no);
     }
@@ -3005,27 +2997,28 @@
     do_oop_store(_masm, field, r0, IN_HEAP);
     break;
   case Bytecodes::_fast_lputfield:
-    __ str(r0, field);
+    __ access_store_at(T_LONG, IN_HEAP, field, r0, noreg, noreg);
     break;
   case Bytecodes::_fast_iputfield:
-    __ strw(r0, field);
+    __ access_store_at(T_INT, IN_HEAP, field, r0, noreg, noreg);
     break;
   case Bytecodes::_fast_zputfield:
-    __ andw(r0, r0, 0x1);  // boolean is true if LSB is 1
-    // fall through to bputfield
+    __ access_store_at(T_BOOLEAN, IN_HEAP, field, r0, noreg, noreg);
+    break;
   case Bytecodes::_fast_bputfield:
-    __ strb(r0, field);
+    __ access_store_at(T_BYTE, IN_HEAP, field, r0, noreg, noreg);
     break;
   case Bytecodes::_fast_sputfield:
-    // fall through
+    __ access_store_at(T_SHORT, IN_HEAP, field, r0, noreg, noreg);
+    break;
   case Bytecodes::_fast_cputfield:
-    __ strh(r0, field);
+    __ access_store_at(T_CHAR, IN_HEAP, field, r0, noreg, noreg);
     break;
   case Bytecodes::_fast_fputfield:
-    __ strs(v0, field);
+    __ access_store_at(T_FLOAT, IN_HEAP, field, noreg /* ftos */, noreg, noreg);
     break;
   case Bytecodes::_fast_dputfield:
-    __ strd(v0, field);
+    __ access_store_at(T_DOUBLE, IN_HEAP, field, noreg /* dtos */, noreg, noreg);
     break;
   default:
     ShouldNotReachHere();
@@ -3098,25 +3091,25 @@
     __ verify_oop(r0);
     break;
   case Bytecodes::_fast_lgetfield:
-    __ ldr(r0, field);
+    __ access_load_at(T_LONG, IN_HEAP, r0, field, noreg, noreg);
     break;
   case Bytecodes::_fast_igetfield:
-    __ ldrw(r0, field);
+    __ access_load_at(T_INT, IN_HEAP, r0, field, noreg, noreg);
     break;
   case Bytecodes::_fast_bgetfield:
-    __ load_signed_byte(r0, field);
+    __ access_load_at(T_BYTE, IN_HEAP, r0, field, noreg, noreg);
     break;
   case Bytecodes::_fast_sgetfield:
-    __ load_signed_short(r0, field);
+    __ access_load_at(T_SHORT, IN_HEAP, r0, field, noreg, noreg);
     break;
   case Bytecodes::_fast_cgetfield:
-    __ load_unsigned_short(r0, field);
+    __ access_load_at(T_CHAR, IN_HEAP, r0, field, noreg, noreg);
     break;
   case Bytecodes::_fast_fgetfield:
-    __ ldrs(v0, field);
+    __ access_load_at(T_FLOAT, IN_HEAP, noreg /* ftos */, field, noreg, noreg);
     break;
   case Bytecodes::_fast_dgetfield:
-    __ ldrd(v0, field);
+    __ access_load_at(T_DOUBLE, IN_HEAP, noreg /* dtos */, field, noreg, noreg);
     break;
   default:
     ShouldNotReachHere();
@@ -3161,14 +3154,14 @@
   __ null_check(r0);
   switch (state) {
   case itos:
-    __ ldrw(r0, Address(r0, r1, Address::lsl(0)));
+    __ access_load_at(T_INT, IN_HEAP, r0, Address(r0, r1, Address::lsl(0)), noreg, noreg);
     break;
   case atos:
     do_oop_load(_masm, Address(r0, r1, Address::lsl(0)), r0, IN_HEAP);
     __ verify_oop(r0);
     break;
   case ftos:
-    __ ldrs(v0, Address(r0, r1, Address::lsl(0)));
+    __ access_load_at(T_FLOAT, IN_HEAP, noreg /* ftos */, Address(r0, r1, Address::lsl(0)), noreg, noreg);
     break;
   default:
     ShouldNotReachHere();
--- a/src/hotspot/cpu/arm/macroAssembler_arm.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/arm/macroAssembler_arm.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -36,6 +36,7 @@
 #include "gc/shared/collectedHeap.inline.hpp"
 #include "interpreter/interpreter.hpp"
 #include "memory/resourceArea.hpp"
+#include "oops/accessDecorators.hpp"
 #include "oops/klass.inline.hpp"
 #include "prims/methodHandles.hpp"
 #include "runtime/biasedLocking.hpp"
@@ -1366,9 +1367,12 @@
   // Bump total bytes allocated by this thread
   Label done;
 
-  ldr(tmp, Address(Rthread, in_bytes(JavaThread::allocated_bytes_offset())));
+  // Borrow the Rthread for alloc counter
+  Register Ralloc = Rthread;
+  add(Ralloc, Ralloc, in_bytes(JavaThread::allocated_bytes_offset()));
+  ldr(tmp, Address(Ralloc));
   adds(tmp, tmp, size_in_bytes);
-  str(tmp, Address(Rthread, in_bytes(JavaThread::allocated_bytes_offset())), cc);
+  str(tmp, Address(Ralloc), cc);
   b(done, cc);
 
   // Increment the high word and store single-copy atomically (that is an unlikely scenario on typical embedded systems as it means >4GB has been allocated)
@@ -1386,14 +1390,17 @@
   }
   push(RegisterSet(low, high));
 
-  ldrd(low, Address(Rthread, in_bytes(JavaThread::allocated_bytes_offset())));
+  ldrd(low, Address(Ralloc));
   adds(low, low, size_in_bytes);
   adc(high, high, 0);
-  strd(low, Address(Rthread, in_bytes(JavaThread::allocated_bytes_offset())));
+  strd(low, Address(Ralloc));
 
   pop(RegisterSet(low, high));
 
   bind(done);
+
+  // Unborrow the Rthread
+  sub(Rthread, Ralloc, in_bytes(JavaThread::allocated_bytes_offset()));
 #endif // AARCH64
 }
 
@@ -2133,7 +2140,7 @@
   b(done);
   bind(not_weak);
   // Resolve (untagged) jobject.
-  access_load_at(T_OBJECT, IN_ROOT | IN_CONCURRENT_ROOT,
+  access_load_at(T_OBJECT, IN_CONCURRENT_ROOT,
                  Address(value, 0), value, tmp1, tmp2, noreg);
   verify_oop(value);
   bind(done);
@@ -2700,6 +2707,7 @@
 void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
                                     Address src, Register dst, Register tmp1, Register tmp2, Register tmp3) {
   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+  decorators = AccessInternal::decorator_fixup(decorators);
   bool as_raw = (decorators & AS_RAW) != 0;
   if (as_raw) {
     bs->BarrierSetAssembler::load_at(this, decorators, type, dst, src, tmp1, tmp2, tmp3);
@@ -2711,6 +2719,7 @@
 void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
                                      Address obj, Register new_val, Register tmp1, Register tmp2, Register tmp3, bool is_null) {
   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+  decorators = AccessInternal::decorator_fixup(decorators);
   bool as_raw = (decorators & AS_RAW) != 0;
   if (as_raw) {
     bs->BarrierSetAssembler::store_at(this, decorators, type, obj, new_val, tmp1, tmp2, tmp3, is_null);
--- a/src/hotspot/cpu/arm/relocInfo_arm.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/arm/relocInfo_arm.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, 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
@@ -29,7 +29,7 @@
 #include "nativeInst_arm.hpp"
 #include "oops/compressedOops.inline.hpp"
 #include "oops/oop.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/safepoint.hpp"
 
 void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
--- a/src/hotspot/cpu/ppc/assembler_ppc.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/ppc/assembler_ppc.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -486,7 +486,7 @@
   // Case 2: Can use addis.
   if (xd == 0) {
     short xc = rem & 0xFFFF; // 2nd 16-bit chunk.
-    rem = (rem >> 16) + ((unsigned short)xd >> 15);
+    rem = (rem >> 16) + ((unsigned short)xc >> 15);
     if (rem == 0) {
       addis(d, s, xc);
       return 0;
--- a/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -214,11 +214,9 @@
   assert(sizeof(*ct->card_table()->byte_map_base()) == sizeof(jbyte), "adjust this code");
 
   // Does store cross heap regions?
-  if (G1RSBarrierRegionFilter) {
-    __ xorr(tmp1, store_addr, new_val);
-    __ srdi_(tmp1, tmp1, HeapRegion::LogOfHRGrainBytes);
-    __ beq(CCR0, filtered);
-  }
+  __ xorr(tmp1, store_addr, new_val);
+  __ srdi_(tmp1, tmp1, HeapRegion::LogOfHRGrainBytes);
+  __ beq(CCR0, filtered);
 
   // Crosses regions, storing NULL?
   if (not_null) {
--- a/src/hotspot/cpu/ppc/macroAssembler_ppc.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -32,6 +32,7 @@
 #include "code/codeCache.hpp"
 #include "gc/shared/barrierSet.hpp"
 #include "gc/shared/barrierSetAssembler.hpp"
+#include "oops/accessDecorators.hpp"
 #include "runtime/safepointMechanism.hpp"
 
 inline bool MacroAssembler::is_ld_largeoffset(address a) {
@@ -332,6 +333,7 @@
                          ON_UNKNOWN_OOP_REF)) == 0, "unsupported decorator");
   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
   bool as_raw = (decorators & AS_RAW) != 0;
+  decorators = AccessInternal::decorator_fixup(decorators);
   if (as_raw) {
     bs->BarrierSetAssembler::store_at(this, decorators, type,
                                       base, ind_or_offs, val,
@@ -349,6 +351,7 @@
   assert((decorators & ~(AS_RAW | IN_HEAP | IN_HEAP_ARRAY | IN_ROOT | OOP_NOT_NULL |
                          ON_PHANTOM_OOP_REF | ON_WEAK_OOP_REF)) == 0, "unsupported decorator");
   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+  decorators = AccessInternal::decorator_fixup(decorators);
   bool as_raw = (decorators & AS_RAW) != 0;
   if (as_raw) {
     bs->BarrierSetAssembler::load_at(this, decorators, type,
--- a/src/hotspot/cpu/ppc/nativeInst_ppc.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/ppc/nativeInst_ppc.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -30,7 +30,7 @@
 #include "oops/compressedOops.inline.hpp"
 #include "oops/oop.hpp"
 #include "runtime/handles.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "utilities/ostream.hpp"
--- a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -688,7 +688,7 @@
                  Rtemp2     = R31;
   __ index_check(Rarray, R17_tos /* index */, UseCompressedOops ? 2 : LogBytesPerWord, Rtemp, Rload_addr);
   do_oop_load(_masm, Rload_addr, arrayOopDesc::base_offset_in_bytes(T_OBJECT), R17_tos, Rtemp, Rtemp2,
-              IN_HEAP | IN_HEAP_ARRAY);
+              IN_HEAP_ARRAY);
   __ verify_oop(R17_tos);
   //__ dcbt(R17_tos); // prefetch
 }
@@ -1015,14 +1015,14 @@
 
   __ bind(Lis_null);
   do_oop_store(_masm, Rstore_addr, arrayOopDesc::base_offset_in_bytes(T_OBJECT), noreg /* 0 */,
-               Rscratch, Rscratch2, Rscratch3, IN_HEAP | IN_HEAP_ARRAY);
+               Rscratch, Rscratch2, Rscratch3, IN_HEAP_ARRAY);
   __ profile_null_seen(Rscratch, Rscratch2);
   __ b(Ldone);
 
   // Store is OK.
   __ bind(Lstore_ok);
   do_oop_store(_masm, Rstore_addr, arrayOopDesc::base_offset_in_bytes(T_OBJECT), R17_tos /* value */,
-               Rscratch, Rscratch2, Rscratch3, IN_HEAP | IN_HEAP_ARRAY | OOP_NOT_NULL);
+               Rscratch, Rscratch2, Rscratch3, IN_HEAP_ARRAY | OOP_NOT_NULL);
 
   __ bind(Ldone);
   // Adjust sp (pops array, index and value).
--- a/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -273,16 +273,14 @@
 
   // Does store cross heap regions?
   // It does if the two addresses specify different grain addresses.
-  if (G1RSBarrierRegionFilter) {
-    if (VM_Version::has_DistinctOpnds()) {
-      __ z_xgrk(Rtmp1, Rstore_addr, Rnew_val);
-    } else {
-      __ z_lgr(Rtmp1, Rstore_addr);
-      __ z_xgr(Rtmp1, Rnew_val);
-    }
-    __ z_srag(Rtmp1, Rtmp1, HeapRegion::LogOfHRGrainBytes);
-    __ z_bre(filtered);
+  if (VM_Version::has_DistinctOpnds()) {
+    __ z_xgrk(Rtmp1, Rstore_addr, Rnew_val);
+  } else {
+    __ z_lgr(Rtmp1, Rstore_addr);
+    __ z_xgr(Rtmp1, Rnew_val);
   }
+  __ z_srag(Rtmp1, Rtmp1, HeapRegion::LogOfHRGrainBytes);
+  __ z_bre(filtered);
 
   // Crosses regions, storing NULL?
   if (not_null) {
--- a/src/hotspot/cpu/s390/macroAssembler_s390.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/s390/macroAssembler_s390.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -34,6 +34,7 @@
 #include "gc/shared/cardTableBarrierSet.hpp"
 #include "memory/resourceArea.hpp"
 #include "memory/universe.hpp"
+#include "oops/accessDecorators.hpp"
 #include "oops/compressedOops.inline.hpp"
 #include "oops/klass.inline.hpp"
 #include "opto/compile.hpp"
@@ -4053,6 +4054,7 @@
   assert((decorators & ~(AS_RAW | IN_HEAP | IN_HEAP_ARRAY | IN_ROOT | OOP_NOT_NULL |
                          ON_UNKNOWN_OOP_REF)) == 0, "unsupported decorator");
   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+  decorators = AccessInternal::decorator_fixup(decorators);
   bool as_raw = (decorators & AS_RAW) != 0;
   if (as_raw) {
     bs->BarrierSetAssembler::store_at(this, decorators, type,
@@ -4071,6 +4073,7 @@
   assert((decorators & ~(AS_RAW | IN_HEAP | IN_HEAP_ARRAY | IN_ROOT | OOP_NOT_NULL |
                          ON_PHANTOM_OOP_REF | ON_WEAK_OOP_REF)) == 0, "unsupported decorator");
   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+  decorators = AccessInternal::decorator_fixup(decorators);
   bool as_raw = (decorators & AS_RAW) != 0;
   if (as_raw) {
     bs->BarrierSetAssembler::load_at(this, decorators, type,
--- a/src/hotspot/cpu/s390/templateTable_s390.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/s390/templateTable_s390.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -853,7 +853,7 @@
   index_check(Z_tmp_1, index, shift);
   // Now load array element.
   do_oop_load(_masm, Address(Z_tmp_1, index, arrayOopDesc::base_offset_in_bytes(T_OBJECT)), Z_tos,
-              Z_tmp_2, Z_tmp_3, IN_HEAP | IN_HEAP_ARRAY);
+              Z_tmp_2, Z_tmp_3, IN_HEAP_ARRAY);
   __ verify_oop(Z_tos);
 }
 
@@ -1197,7 +1197,7 @@
 
   // Store a NULL.
   do_oop_store(_masm, Address(Rstore_addr, (intptr_t)0), noreg,
-               tmp3, tmp2, tmp1, IN_HEAP | IN_HEAP_ARRAY);
+               tmp3, tmp2, tmp1, IN_HEAP_ARRAY);
   __ z_bru(done);
 
   // Come here on success.
@@ -1205,7 +1205,7 @@
 
   // Now store using the appropriate barrier.
   do_oop_store(_masm, Address(Rstore_addr, (intptr_t)0), Rvalue,
-               tmp3, tmp2, tmp1, IN_HEAP | IN_HEAP_ARRAY | OOP_NOT_NULL);
+               tmp3, tmp2, tmp1, IN_HEAP_ARRAY | OOP_NOT_NULL);
 
   // Pop stack arguments.
   __ bind(done);
--- a/src/hotspot/cpu/sparc/gc/g1/g1BarrierSetAssembler_sparc.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/sparc/gc/g1/g1BarrierSetAssembler_sparc.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -369,12 +369,10 @@
 
   G1BarrierSet* bs = barrier_set_cast<G1BarrierSet>(BarrierSet::barrier_set());
 
-  if (G1RSBarrierRegionFilter) {
-    __ xor3(store_addr, new_val, tmp);
-    __ srlx(tmp, HeapRegion::LogOfHRGrainBytes, tmp);
+  __ xor3(store_addr, new_val, tmp);
+  __ srlx(tmp, HeapRegion::LogOfHRGrainBytes, tmp);
 
-    __ cmp_and_brx_short(tmp, G0, Assembler::equal, Assembler::pt, filtered);
-  }
+  __ cmp_and_brx_short(tmp, G0, Assembler::equal, Assembler::pt, filtered);
 
   // If the "store_addr" register is an "in" or "local" register, move it to
   // a scratch reg so we can pass it as an argument.
--- a/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -32,6 +32,7 @@
 #include "interpreter/interpreter.hpp"
 #include "memory/resourceArea.hpp"
 #include "memory/universe.hpp"
+#include "oops/accessDecorators.hpp"
 #include "oops/klass.inline.hpp"
 #include "prims/methodHandles.hpp"
 #include "runtime/biasedLocking.hpp"
@@ -181,7 +182,7 @@
   br (Assembler::always, true, Assembler::pt, done);
   delayed()->nop();
   bind(not_weak);
-  access_load_at(T_OBJECT, IN_ROOT | IN_CONCURRENT_ROOT,
+  access_load_at(T_OBJECT, IN_CONCURRENT_ROOT,
                  Address(value, 0), value, tmp);
   verify_oop(value);
   bind(done);
@@ -3401,7 +3402,7 @@
 // ((OopHandle)result).resolve();
 void MacroAssembler::resolve_oop_handle(Register result, Register tmp) {
   // OopHandle::resolve is an indirection.
-  access_load_at(T_OBJECT, IN_ROOT | IN_CONCURRENT_ROOT,
+  access_load_at(T_OBJECT, IN_CONCURRENT_ROOT,
                  Address(result, 0), result, tmp);
 }
 
@@ -3446,6 +3447,7 @@
 void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
                                      Register src, Address dst, Register tmp) {
   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+  decorators = AccessInternal::decorator_fixup(decorators);
   bool as_raw = (decorators & AS_RAW) != 0;
   if (as_raw) {
     bs->BarrierSetAssembler::store_at(this, decorators, type, src, dst, tmp);
@@ -3457,6 +3459,7 @@
 void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
                                     Address src, Register dst, Register tmp) {
   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+  decorators = AccessInternal::decorator_fixup(decorators);
   bool as_raw = (decorators & AS_RAW) != 0;
   if (as_raw) {
     bs->BarrierSetAssembler::load_at(this, decorators, type, src, dst, tmp);
--- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -33,7 +33,7 @@
 #include "interpreter/interpreter.hpp"
 #include "memory/resourceArea.hpp"
 #include "memory/universe.hpp"
-#include "oops/access.hpp"
+#include "oops/accessDecorators.hpp"
 #include "oops/klass.inline.hpp"
 #include "prims/methodHandles.hpp"
 #include "runtime/biasedLocking.hpp"
@@ -5259,7 +5259,7 @@
   jmp(done);
   bind(not_weak);
   // Resolve (untagged) jobject.
-  access_load_at(T_OBJECT, IN_ROOT | IN_CONCURRENT_ROOT,
+  access_load_at(T_OBJECT, IN_CONCURRENT_ROOT,
                  value, Address(value, 0), tmp, thread);
   verify_oop(value);
   bind(done);
@@ -6281,7 +6281,7 @@
   // Only 64 bit platforms support GCs that require a tmp register
   // Only IN_HEAP loads require a thread_tmp register
   // OopHandle::resolve is an indirection like jobject.
-  access_load_at(T_OBJECT, IN_ROOT | IN_CONCURRENT_ROOT,
+  access_load_at(T_OBJECT, IN_CONCURRENT_ROOT,
                  result, Address(result, 0), tmp, /*tmp_thread*/noreg);
 }
 
@@ -6323,6 +6323,7 @@
 void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators, Register dst, Address src,
                                     Register tmp1, Register thread_tmp) {
   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+  decorators = AccessInternal::decorator_fixup(decorators);
   bool as_raw = (decorators & AS_RAW) != 0;
   if (as_raw) {
     bs->BarrierSetAssembler::load_at(this, decorators, type, dst, src, tmp1, thread_tmp);
@@ -6334,6 +6335,7 @@
 void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators, Address dst, Register src,
                                      Register tmp1, Register tmp2) {
   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+  decorators = AccessInternal::decorator_fixup(decorators);
   bool as_raw = (decorators & AS_RAW) != 0;
   if (as_raw) {
     bs->BarrierSetAssembler::store_at(this, decorators, type, dst, src, tmp1, tmp2);
--- a/src/hotspot/cpu/x86/x86_64.ad	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/x86/x86_64.ad	Mon Jun 11 09:29:44 2018 +0200
@@ -11607,16 +11607,6 @@
   ins_pipe(ialu_cr_reg_imm);
 %}
 
-instruct compUB_mem_imm(rFlagsReg cr, memory mem, immU8 imm)
-%{
-  match(Set cr (CmpI (LoadUB mem) imm));
-
-  ins_cost(125);
-  format %{ "cmpb    $mem, $imm" %}
-  ins_encode %{ __ cmpb($mem$$Address, $imm$$constant); %}
-  ins_pipe(ialu_cr_reg_mem);
-%}
-
 instruct compB_mem_imm(rFlagsReg cr, memory mem, immI8 imm)
 %{
   match(Set cr (CmpI (LoadB mem) imm));
@@ -11627,16 +11617,6 @@
   ins_pipe(ialu_cr_reg_mem);
 %}
 
-instruct testUB_mem_imm(rFlagsReg cr, memory mem, immU8 imm, immI0 zero)
-%{
-  match(Set cr (CmpI (AndI (LoadUB mem) imm) zero));
-
-  ins_cost(125);
-  format %{ "testb   $mem, $imm" %}
-  ins_encode %{ __ testb($mem$$Address, $imm$$constant); %}
-  ins_pipe(ialu_cr_reg_mem);
-%}
-
 instruct testB_mem_imm(rFlagsReg cr, memory mem, immI8 imm, immI0 zero)
 %{
   match(Set cr (CmpI (AndI (LoadB mem) imm) zero));
--- a/src/hotspot/cpu/zero/cppInterpreter_zero.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/cpu/zero/cppInterpreter_zero.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -43,7 +43,7 @@
 #include "runtime/frame.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/jniHandles.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "runtime/synchronizer.hpp"
--- a/src/hotspot/os/aix/os_aix.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/os/aix/os_aix.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -59,7 +59,7 @@
 #include "runtime/javaCalls.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/objectMonitor.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/os.hpp"
 #include "runtime/osThread.hpp"
 #include "runtime/perfMemory.hpp"
--- a/src/hotspot/os/bsd/os_bsd.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/os/bsd/os_bsd.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -49,7 +49,7 @@
 #include "runtime/javaCalls.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/objectMonitor.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/osThread.hpp"
 #include "runtime/perfMemory.hpp"
 #include "runtime/semaphore.hpp"
--- a/src/hotspot/os/linux/os_linux.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/os/linux/os_linux.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -51,7 +51,7 @@
 #include "runtime/javaCalls.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/objectMonitor.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/osThread.hpp"
 #include "runtime/perfMemory.hpp"
 #include "runtime/sharedRuntime.hpp"
--- a/src/hotspot/os/solaris/os_solaris.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/os/solaris/os_solaris.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -49,7 +49,7 @@
 #include "runtime/javaCalls.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/objectMonitor.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/osThread.hpp"
 #include "runtime/perfMemory.hpp"
 #include "runtime/sharedRuntime.hpp"
--- a/src/hotspot/os/windows/os_windows.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/os/windows/os_windows.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -52,7 +52,7 @@
 #include "runtime/javaCalls.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/objectMonitor.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/osThread.hpp"
 #include "runtime/perfMemory.hpp"
 #include "runtime/sharedRuntime.hpp"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os_cpu/aix_ppc/orderAccess_aix_ppc.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014 SAP SE. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef OS_CPU_AIX_OJDKPPC_VM_ORDERACCESS_AIX_PPC_HPP
+#define OS_CPU_AIX_OJDKPPC_VM_ORDERACCESS_AIX_PPC_HPP
+
+// Included in orderAccess.hpp header file.
+
+// Compiler version last used for testing: xlc 12
+// Please update this information when this file changes
+
+// Implementation of class OrderAccess.
+
+//
+// Machine barrier instructions:
+//
+// - sync            Two-way memory barrier, aka fence.
+// - lwsync          orders  Store|Store,
+//                            Load|Store,
+//                            Load|Load,
+//                   but not Store|Load
+// - eieio           orders  Store|Store
+// - isync           Invalidates speculatively executed instructions,
+//                   but isync may complete before storage accesses
+//                   associated with instructions preceding isync have
+//                   been performed.
+//
+// Semantic barrier instructions:
+// (as defined in orderAccess.hpp)
+//
+// - release         orders Store|Store,       (maps to lwsync)
+//                           Load|Store
+// - acquire         orders  Load|Store,       (maps to lwsync)
+//                           Load|Load
+// - fence           orders Store|Store,       (maps to sync)
+//                           Load|Store,
+//                           Load|Load,
+//                          Store|Load
+//
+
+#define inlasm_sync()     __asm__ __volatile__ ("sync"   : : : "memory");
+#define inlasm_lwsync()   __asm__ __volatile__ ("lwsync" : : : "memory");
+#define inlasm_eieio()    __asm__ __volatile__ ("eieio"  : : : "memory");
+#define inlasm_isync()    __asm__ __volatile__ ("isync"  : : : "memory");
+// Use twi-isync for load_acquire (faster than lwsync).
+// ATTENTION: seems like xlC 10.1 has problems with this inline assembler macro (VerifyMethodHandles found "bad vminfo in AMH.conv"):
+// #define inlasm_acquire_reg(X) __asm__ __volatile__ ("twi 0,%0,0\n isync\n" : : "r" (X) : "memory");
+#define inlasm_acquire_reg(X) inlasm_lwsync();
+
+inline void OrderAccess::loadload()   { inlasm_lwsync(); }
+inline void OrderAccess::storestore() { inlasm_lwsync(); }
+inline void OrderAccess::loadstore()  { inlasm_lwsync(); }
+inline void OrderAccess::storeload()  { inlasm_sync();   }
+
+inline void OrderAccess::acquire()    { inlasm_lwsync(); }
+inline void OrderAccess::release()    { inlasm_lwsync(); }
+inline void OrderAccess::fence()      { inlasm_sync();   }
+
+template<size_t byte_size>
+struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
+{
+  template <typename T>
+  T operator()(const volatile T* p) const { register T t = Atomic::load(p); inlasm_acquire_reg(t); return t; }
+};
+
+#undef inlasm_sync
+#undef inlasm_lwsync
+#undef inlasm_eieio
+#undef inlasm_isync
+
+#endif // OS_CPU_AIX_OJDKPPC_VM_ORDERACCESS_AIX_PPC_HPP
--- a/src/hotspot/os_cpu/aix_ppc/orderAccess_aix_ppc.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2014 SAP SE. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef OS_CPU_AIX_OJDKPPC_VM_ORDERACCESS_AIX_PPC_INLINE_HPP
-#define OS_CPU_AIX_OJDKPPC_VM_ORDERACCESS_AIX_PPC_INLINE_HPP
-
-#include "runtime/orderAccess.hpp"
-
-// Compiler version last used for testing: xlc 12
-// Please update this information when this file changes
-
-// Implementation of class OrderAccess.
-
-//
-// Machine barrier instructions:
-//
-// - sync            Two-way memory barrier, aka fence.
-// - lwsync          orders  Store|Store,
-//                            Load|Store,
-//                            Load|Load,
-//                   but not Store|Load
-// - eieio           orders  Store|Store
-// - isync           Invalidates speculatively executed instructions,
-//                   but isync may complete before storage accesses
-//                   associated with instructions preceding isync have
-//                   been performed.
-//
-// Semantic barrier instructions:
-// (as defined in orderAccess.hpp)
-//
-// - release         orders Store|Store,       (maps to lwsync)
-//                           Load|Store
-// - acquire         orders  Load|Store,       (maps to lwsync)
-//                           Load|Load
-// - fence           orders Store|Store,       (maps to sync)
-//                           Load|Store,
-//                           Load|Load,
-//                          Store|Load
-//
-
-#define inlasm_sync()     __asm__ __volatile__ ("sync"   : : : "memory");
-#define inlasm_lwsync()   __asm__ __volatile__ ("lwsync" : : : "memory");
-#define inlasm_eieio()    __asm__ __volatile__ ("eieio"  : : : "memory");
-#define inlasm_isync()    __asm__ __volatile__ ("isync"  : : : "memory");
-// Use twi-isync for load_acquire (faster than lwsync).
-// ATTENTION: seems like xlC 10.1 has problems with this inline assembler macro (VerifyMethodHandles found "bad vminfo in AMH.conv"):
-// #define inlasm_acquire_reg(X) __asm__ __volatile__ ("twi 0,%0,0\n isync\n" : : "r" (X) : "memory");
-#define inlasm_acquire_reg(X) inlasm_lwsync();
-
-inline void OrderAccess::loadload()   { inlasm_lwsync(); }
-inline void OrderAccess::storestore() { inlasm_lwsync(); }
-inline void OrderAccess::loadstore()  { inlasm_lwsync(); }
-inline void OrderAccess::storeload()  { inlasm_sync();   }
-
-inline void OrderAccess::acquire()    { inlasm_lwsync(); }
-inline void OrderAccess::release()    { inlasm_lwsync(); }
-inline void OrderAccess::fence()      { inlasm_sync();   }
-
-template<size_t byte_size>
-struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
-{
-  template <typename T>
-  T operator()(const volatile T* p) const { register T t = Atomic::load(p); inlasm_acquire_reg(t); return t; }
-};
-
-#undef inlasm_sync
-#undef inlasm_lwsync
-#undef inlasm_eieio
-#undef inlasm_isync
-
-#endif // OS_CPU_AIX_OJDKPPC_VM_ORDERACCESS_AIX_PPC_INLINE_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os_cpu/bsd_x86/orderAccess_bsd_x86.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef OS_CPU_BSD_X86_VM_ORDERACCESS_BSD_X86_HPP
+#define OS_CPU_BSD_X86_VM_ORDERACCESS_BSD_X86_HPP
+
+// Included in orderAccess.hpp header file.
+
+// Compiler version last used for testing: clang 5.1
+// Please update this information when this file changes
+
+// A compiler barrier, forcing the C++ compiler to invalidate all memory assumptions
+static inline void compiler_barrier() {
+  __asm__ volatile ("" : : : "memory");
+}
+
+// x86 is TSO and hence only needs a fence for storeload
+// However, a compiler barrier is still needed to prevent reordering
+// between volatile and non-volatile memory accesses.
+
+// Implementation of class OrderAccess.
+
+inline void OrderAccess::loadload()   { compiler_barrier(); }
+inline void OrderAccess::storestore() { compiler_barrier(); }
+inline void OrderAccess::loadstore()  { compiler_barrier(); }
+inline void OrderAccess::storeload()  { fence();            }
+
+inline void OrderAccess::acquire()    { compiler_barrier(); }
+inline void OrderAccess::release()    { compiler_barrier(); }
+
+inline void OrderAccess::fence() {
+  // always use locked addl since mfence is sometimes expensive
+#ifdef AMD64
+  __asm__ volatile ("lock; addl $0,0(%%rsp)" : : : "cc", "memory");
+#else
+  __asm__ volatile ("lock; addl $0,0(%%esp)" : : : "cc", "memory");
+#endif
+  compiler_barrier();
+}
+
+template<>
+struct OrderAccess::PlatformOrderedStore<1, RELEASE_X_FENCE>
+{
+  template <typename T>
+  void operator()(T v, volatile T* p) const {
+    __asm__ volatile (  "xchgb (%2),%0"
+                      : "=q" (v)
+                      : "0" (v), "r" (p)
+                      : "memory");
+  }
+};
+
+template<>
+struct OrderAccess::PlatformOrderedStore<2, RELEASE_X_FENCE>
+{
+  template <typename T>
+  void operator()(T v, volatile T* p) const {
+    __asm__ volatile (  "xchgw (%2),%0"
+                      : "=r" (v)
+                      : "0" (v), "r" (p)
+                      : "memory");
+  }
+};
+
+template<>
+struct OrderAccess::PlatformOrderedStore<4, RELEASE_X_FENCE>
+{
+  template <typename T>
+  void operator()(T v, volatile T* p) const {
+    __asm__ volatile (  "xchgl (%2),%0"
+                      : "=r" (v)
+                      : "0" (v), "r" (p)
+                      : "memory");
+  }
+};
+
+#ifdef AMD64
+template<>
+struct OrderAccess::PlatformOrderedStore<8, RELEASE_X_FENCE>
+{
+  template <typename T>
+  void operator()(T v, volatile T* p) const {
+    __asm__ volatile (  "xchgq (%2), %0"
+                      : "=r" (v)
+                      : "0" (v), "r" (p)
+                      : "memory");
+  }
+};
+#endif // AMD64
+
+#endif // OS_CPU_BSD_X86_VM_ORDERACCESS_BSD_X86_HPP
--- a/src/hotspot/os_cpu/bsd_x86/orderAccess_bsd_x86.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef OS_CPU_BSD_X86_VM_ORDERACCESS_BSD_X86_INLINE_HPP
-#define OS_CPU_BSD_X86_VM_ORDERACCESS_BSD_X86_INLINE_HPP
-
-#include "runtime/atomic.hpp"
-#include "runtime/orderAccess.hpp"
-#include "runtime/os.hpp"
-
-// Compiler version last used for testing: clang 5.1
-// Please update this information when this file changes
-
-// A compiler barrier, forcing the C++ compiler to invalidate all memory assumptions
-static inline void compiler_barrier() {
-  __asm__ volatile ("" : : : "memory");
-}
-
-// x86 is TSO and hence only needs a fence for storeload
-// However, a compiler barrier is still needed to prevent reordering
-// between volatile and non-volatile memory accesses.
-
-// Implementation of class OrderAccess.
-
-inline void OrderAccess::loadload()   { compiler_barrier(); }
-inline void OrderAccess::storestore() { compiler_barrier(); }
-inline void OrderAccess::loadstore()  { compiler_barrier(); }
-inline void OrderAccess::storeload()  { fence();            }
-
-inline void OrderAccess::acquire()    { compiler_barrier(); }
-inline void OrderAccess::release()    { compiler_barrier(); }
-
-inline void OrderAccess::fence() {
-  if (os::is_MP()) {
-    // always use locked addl since mfence is sometimes expensive
-#ifdef AMD64
-    __asm__ volatile ("lock; addl $0,0(%%rsp)" : : : "cc", "memory");
-#else
-    __asm__ volatile ("lock; addl $0,0(%%esp)" : : : "cc", "memory");
-#endif
-  }
-  compiler_barrier();
-}
-
-template<>
-struct OrderAccess::PlatformOrderedStore<1, RELEASE_X_FENCE>
-{
-  template <typename T>
-  void operator()(T v, volatile T* p) const {
-    __asm__ volatile (  "xchgb (%2),%0"
-                      : "=q" (v)
-                      : "0" (v), "r" (p)
-                      : "memory");
-  }
-};
-
-template<>
-struct OrderAccess::PlatformOrderedStore<2, RELEASE_X_FENCE>
-{
-  template <typename T>
-  void operator()(T v, volatile T* p) const {
-    __asm__ volatile (  "xchgw (%2),%0"
-                      : "=r" (v)
-                      : "0" (v), "r" (p)
-                      : "memory");
-  }
-};
-
-template<>
-struct OrderAccess::PlatformOrderedStore<4, RELEASE_X_FENCE>
-{
-  template <typename T>
-  void operator()(T v, volatile T* p) const {
-    __asm__ volatile (  "xchgl (%2),%0"
-                      : "=r" (v)
-                      : "0" (v), "r" (p)
-                      : "memory");
-  }
-};
-
-#ifdef AMD64
-template<>
-struct OrderAccess::PlatformOrderedStore<8, RELEASE_X_FENCE>
-{
-  template <typename T>
-  void operator()(T v, volatile T* p) const {
-    __asm__ volatile (  "xchgq (%2), %0"
-                      : "=r" (v)
-                      : "0" (v), "r" (p)
-                      : "memory");
-  }
-};
-#endif // AMD64
-
-#endif // OS_CPU_BSD_X86_VM_ORDERACCESS_BSD_X86_INLINE_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os_cpu/bsd_zero/orderAccess_bsd_zero.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2007, 2008, 2009 Red Hat, Inc.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef OS_CPU_BSD_ZERO_VM_ORDERACCESS_BSD_ZERO_HPP
+#define OS_CPU_BSD_ZERO_VM_ORDERACCESS_BSD_ZERO_HPP
+
+// Included in orderAccess.hpp header file.
+
+#ifdef ARM
+
+/*
+ * ARM Kernel helper for memory barrier.
+ * Using __asm __volatile ("":::"memory") does not work reliable on ARM
+ * and gcc __sync_synchronize(); implementation does not use the kernel
+ * helper for all gcc versions so it is unreliable to use as well.
+ */
+typedef void (__kernel_dmb_t) (void);
+#define __kernel_dmb (*(__kernel_dmb_t *) 0xffff0fa0)
+
+#define FULL_MEM_BARRIER __kernel_dmb()
+#define LIGHT_MEM_BARRIER __kernel_dmb()
+
+#else // ARM
+
+#define FULL_MEM_BARRIER __sync_synchronize()
+
+#ifdef PPC
+
+#ifdef __NO_LWSYNC__
+#define LIGHT_MEM_BARRIER __asm __volatile ("sync":::"memory")
+#else
+#define LIGHT_MEM_BARRIER __asm __volatile ("lwsync":::"memory")
+#endif
+
+#else // PPC
+
+#define LIGHT_MEM_BARRIER __asm __volatile ("":::"memory")
+
+#endif // PPC
+
+#endif // ARM
+
+// Note: What is meant by LIGHT_MEM_BARRIER is a barrier which is sufficient
+// to provide TSO semantics, i.e. StoreStore | LoadLoad | LoadStore.
+
+inline void OrderAccess::loadload()   { LIGHT_MEM_BARRIER; }
+inline void OrderAccess::storestore() { LIGHT_MEM_BARRIER; }
+inline void OrderAccess::loadstore()  { LIGHT_MEM_BARRIER; }
+inline void OrderAccess::storeload()  { FULL_MEM_BARRIER;  }
+
+inline void OrderAccess::acquire()    { LIGHT_MEM_BARRIER; }
+inline void OrderAccess::release()    { LIGHT_MEM_BARRIER; }
+inline void OrderAccess::fence()      { FULL_MEM_BARRIER;  }
+
+#endif // OS_CPU_BSD_ZERO_VM_ORDERACCESS_BSD_ZERO_HPP
--- a/src/hotspot/os_cpu/bsd_zero/orderAccess_bsd_zero.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2007, 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef OS_CPU_BSD_ZERO_VM_ORDERACCESS_BSD_ZERO_INLINE_HPP
-#define OS_CPU_BSD_ZERO_VM_ORDERACCESS_BSD_ZERO_INLINE_HPP
-
-#include "runtime/orderAccess.hpp"
-
-#ifdef ARM
-
-/*
- * ARM Kernel helper for memory barrier.
- * Using __asm __volatile ("":::"memory") does not work reliable on ARM
- * and gcc __sync_synchronize(); implementation does not use the kernel
- * helper for all gcc versions so it is unreliable to use as well.
- */
-typedef void (__kernel_dmb_t) (void);
-#define __kernel_dmb (*(__kernel_dmb_t *) 0xffff0fa0)
-
-#define FULL_MEM_BARRIER __kernel_dmb()
-#define LIGHT_MEM_BARRIER __kernel_dmb()
-
-#else // ARM
-
-#define FULL_MEM_BARRIER __sync_synchronize()
-
-#ifdef PPC
-
-#ifdef __NO_LWSYNC__
-#define LIGHT_MEM_BARRIER __asm __volatile ("sync":::"memory")
-#else
-#define LIGHT_MEM_BARRIER __asm __volatile ("lwsync":::"memory")
-#endif
-
-#else // PPC
-
-#define LIGHT_MEM_BARRIER __asm __volatile ("":::"memory")
-
-#endif // PPC
-
-#endif // ARM
-
-// Note: What is meant by LIGHT_MEM_BARRIER is a barrier which is sufficient
-// to provide TSO semantics, i.e. StoreStore | LoadLoad | LoadStore.
-
-inline void OrderAccess::loadload()   { LIGHT_MEM_BARRIER; }
-inline void OrderAccess::storestore() { LIGHT_MEM_BARRIER; }
-inline void OrderAccess::loadstore()  { LIGHT_MEM_BARRIER; }
-inline void OrderAccess::storeload()  { FULL_MEM_BARRIER;  }
-
-inline void OrderAccess::acquire()    { LIGHT_MEM_BARRIER; }
-inline void OrderAccess::release()    { LIGHT_MEM_BARRIER; }
-inline void OrderAccess::fence()      { FULL_MEM_BARRIER;  }
-
-#endif // OS_CPU_BSD_ZERO_VM_ORDERACCESS_BSD_ZERO_INLINE_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os_cpu/linux_aarch64/orderAccess_linux_aarch64.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, Red Hat Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef OS_CPU_LINUX_AARCH64_VM_ORDERACCESS_LINUX_AARCH64_HPP
+#define OS_CPU_LINUX_AARCH64_VM_ORDERACCESS_LINUX_AARCH64_HPP
+
+// Included in orderAccess.hpp header file.
+
+#include "vm_version_aarch64.hpp"
+
+// Implementation of class OrderAccess.
+
+inline void OrderAccess::loadload()   { acquire(); }
+inline void OrderAccess::storestore() { release(); }
+inline void OrderAccess::loadstore()  { acquire(); }
+inline void OrderAccess::storeload()  { fence(); }
+
+inline void OrderAccess::acquire() {
+  READ_MEM_BARRIER;
+}
+
+inline void OrderAccess::release() {
+  WRITE_MEM_BARRIER;
+}
+
+inline void OrderAccess::fence() {
+  FULL_MEM_BARRIER;
+}
+
+template<size_t byte_size>
+struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
+{
+  template <typename T>
+  T operator()(const volatile T* p) const { T data; __atomic_load(p, &data, __ATOMIC_ACQUIRE); return data; }
+};
+
+template<size_t byte_size>
+struct OrderAccess::PlatformOrderedStore<byte_size, RELEASE_X>
+{
+  template <typename T>
+  void operator()(T v, volatile T* p) const { __atomic_store(p, &v, __ATOMIC_RELEASE); }
+};
+
+template<size_t byte_size>
+struct OrderAccess::PlatformOrderedStore<byte_size, RELEASE_X_FENCE>
+{
+  template <typename T>
+  void operator()(T v, volatile T* p) const { release_store(p, v); fence(); }
+};
+
+#endif // OS_CPU_LINUX_AARCH64_VM_ORDERACCESS_LINUX_AARCH64_HPP
--- a/src/hotspot/os_cpu/linux_aarch64/orderAccess_linux_aarch64.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2014, Red Hat Inc. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef OS_CPU_LINUX_AARCH64_VM_ORDERACCESS_LINUX_AARCH64_INLINE_HPP
-#define OS_CPU_LINUX_AARCH64_VM_ORDERACCESS_LINUX_AARCH64_INLINE_HPP
-
-#include "runtime/atomic.hpp"
-#include "runtime/orderAccess.hpp"
-#include "runtime/os.hpp"
-#include "vm_version_aarch64.hpp"
-
-// Implementation of class OrderAccess.
-
-inline void OrderAccess::loadload()   { acquire(); }
-inline void OrderAccess::storestore() { release(); }
-inline void OrderAccess::loadstore()  { acquire(); }
-inline void OrderAccess::storeload()  { fence(); }
-
-inline void OrderAccess::acquire() {
-  READ_MEM_BARRIER;
-}
-
-inline void OrderAccess::release() {
-  WRITE_MEM_BARRIER;
-}
-
-inline void OrderAccess::fence() {
-  FULL_MEM_BARRIER;
-}
-
-template<size_t byte_size>
-struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
-{
-  template <typename T>
-  T operator()(const volatile T* p) const { T data; __atomic_load(p, &data, __ATOMIC_ACQUIRE); return data; }
-};
-
-template<size_t byte_size>
-struct OrderAccess::PlatformOrderedStore<byte_size, RELEASE_X>
-{
-  template <typename T>
-  void operator()(T v, volatile T* p) const { __atomic_store(p, &v, __ATOMIC_RELEASE); }
-};
-
-template<size_t byte_size>
-struct OrderAccess::PlatformOrderedStore<byte_size, RELEASE_X_FENCE>
-{
-  template <typename T>
-  void operator()(T v, volatile T* p) const { release_store(p, v); fence(); }
-};
-
-#endif // OS_CPU_LINUX_AARCH64_VM_ORDERACCESS_LINUX_AARCH64_INLINE_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os_cpu/linux_arm/orderAccess_linux_arm.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,248 @@
+/*
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef OS_CPU_LINUX_ARM_VM_ORDERACCESS_LINUX_ARM_HPP
+#define OS_CPU_LINUX_ARM_VM_ORDERACCESS_LINUX_ARM_HPP
+
+// Included in orderAccess.hpp header file.
+
+#include "runtime/os.hpp"
+#include "vm_version_arm.hpp"
+
+// Implementation of class OrderAccess.
+// - we define the high level barriers below and use the general
+//   implementation in orderAccess.hpp, with customizations
+//   on AARCH64 via the specialized_* template functions
+
+// Memory Ordering on ARM is weak.
+//
+// Implement all 4 memory ordering barriers by DMB, since it is a
+// lighter version of DSB.
+// dmb_sy implies full system shareability domain. RD/WR access type.
+// dmb_st implies full system shareability domain. WR only access type.
+//
+// NOP on < ARMv6 (MP not supported)
+//
+// Non mcr instructions can be used if we build for armv7 or higher arch
+//    __asm__ __volatile__ ("dmb" : : : "memory");
+//    __asm__ __volatile__ ("dsb" : : : "memory");
+//
+// inline void _OrderAccess_dsb() {
+//    volatile intptr_t dummy = 0;
+//    if (os::is_MP()) {
+//      __asm__ volatile (
+//        "mcr p15, 0, %0, c7, c10, 4"
+//        : : "r" (dummy) : "memory");
+//    }
+// }
+
+inline static void dmb_sy() {
+   if (!os::is_MP()) {
+     return;
+   }
+#ifdef AARCH64
+   __asm__ __volatile__ ("dmb sy" : : : "memory");
+#else
+   if (VM_Version::arm_arch() >= 7) {
+#ifdef __thumb__
+     __asm__ volatile (
+     "dmb sy": : : "memory");
+#else
+     __asm__ volatile (
+     ".word 0xF57FF050 | 0xf" : : : "memory");
+#endif
+   } else {
+     intptr_t zero = 0;
+     __asm__ volatile (
+       "mcr p15, 0, %0, c7, c10, 5"
+       : : "r" (zero) : "memory");
+   }
+#endif
+}
+
+inline static void dmb_st() {
+   if (!os::is_MP()) {
+     return;
+   }
+#ifdef AARCH64
+   __asm__ __volatile__ ("dmb st" : : : "memory");
+#else
+   if (VM_Version::arm_arch() >= 7) {
+#ifdef __thumb__
+     __asm__ volatile (
+     "dmb st": : : "memory");
+#else
+     __asm__ volatile (
+     ".word 0xF57FF050 | 0xe" : : : "memory");
+#endif
+   } else {
+     intptr_t zero = 0;
+     __asm__ volatile (
+       "mcr p15, 0, %0, c7, c10, 5"
+       : : "r" (zero) : "memory");
+   }
+#endif
+}
+
+// Load-Load/Store barrier
+inline static void dmb_ld() {
+#ifdef AARCH64
+   if (!os::is_MP()) {
+     return;
+   }
+   __asm__ __volatile__ ("dmb ld" : : : "memory");
+#else
+   dmb_sy();
+#endif
+}
+
+
+inline void OrderAccess::loadload()   { dmb_ld(); }
+inline void OrderAccess::loadstore()  { dmb_ld(); }
+inline void OrderAccess::acquire()    { dmb_ld(); }
+inline void OrderAccess::storestore() { dmb_st(); }
+inline void OrderAccess::storeload()  { dmb_sy(); }
+inline void OrderAccess::release()    { dmb_sy(); }
+inline void OrderAccess::fence()      { dmb_sy(); }
+
+// specializations for Aarch64
+// TODO-AARCH64: evaluate effectiveness of ldar*/stlr* implementations compared to 32-bit ARM approach
+
+#ifdef AARCH64
+
+template<>
+struct OrderAccess::PlatformOrderedLoad<1, X_ACQUIRE>
+{
+  template <typename T>
+  T operator()(const volatile T* p) const {
+    volatile T result;
+    __asm__ volatile(
+      "ldarb %w[res], [%[ptr]]"
+      : [res] "=&r" (result)
+      : [ptr] "r" (p)
+      : "memory");
+    return result;
+  }
+};
+
+template<>
+struct OrderAccess::PlatformOrderedLoad<2, X_ACQUIRE>
+{
+  template <typename T>
+  T operator()(const volatile T* p) const {
+    volatile T result;
+    __asm__ volatile(
+      "ldarh %w[res], [%[ptr]]"
+      : [res] "=&r" (result)
+      : [ptr] "r" (p)
+      : "memory");
+    return result;
+  }
+};
+
+template<>
+struct OrderAccess::PlatformOrderedLoad<4, X_ACQUIRE>
+{
+  template <typename T>
+  T operator()(const volatile T* p) const {
+    volatile T result;
+    __asm__ volatile(
+      "ldar %w[res], [%[ptr]]"
+      : [res] "=&r" (result)
+      : [ptr] "r" (p)
+      : "memory");
+    return result;
+  }
+};
+
+template<>
+struct OrderAccess::PlatformOrderedLoad<8, X_ACQUIRE>
+{
+  template <typename T>
+  T operator()(const volatile T* p) const {
+    volatile T result;
+    __asm__ volatile(
+      "ldar %[res], [%[ptr]]"
+      : [res] "=&r" (result)
+      : [ptr] "r" (p)
+      : "memory");
+    return result;
+  }
+};
+
+template<>
+struct OrderAccess::PlatformOrderedStore<1, RELEASE_X_FENCE>
+{
+  template <typename T>
+  void operator()(T v, volatile T* p) const {
+    __asm__ volatile(
+      "stlrb %w[val], [%[ptr]]"
+      :
+      : [ptr] "r" (p), [val] "r" (v)
+      : "memory");
+  }
+};
+
+template<>
+struct OrderAccess::PlatformOrderedStore<2, RELEASE_X_FENCE>
+{
+  template <typename T>
+  void operator()(T v, volatile T* p) const {
+    __asm__ volatile(
+      "stlrh %w[val], [%[ptr]]"
+      :
+      : [ptr] "r" (p), [val] "r" (v)
+      : "memory");
+  }
+};
+
+template<>
+struct OrderAccess::PlatformOrderedStore<4, RELEASE_X_FENCE>
+{
+  template <typename T>
+  void operator()(T v, volatile T* p) const {
+    __asm__ volatile(
+      "stlr %w[val], [%[ptr]]"
+      :
+      : [ptr] "r" (p), [val] "r" (v)
+      : "memory");
+  }
+};
+
+template<>
+struct OrderAccess::PlatformOrderedStore<8, RELEASE_X_FENCE>
+{
+  template <typename T>
+  void operator()(T v, volatile T* p) const {
+    __asm__ volatile(
+      "stlr %[val], [%[ptr]]"
+      :
+      : [ptr] "r" (p), [val] "r" (v)
+      : "memory");
+  }
+};
+
+#endif // AARCH64
+
+#endif // OS_CPU_LINUX_ARM_VM_ORDERACCESS_LINUX_ARM_HPP
--- a/src/hotspot/os_cpu/linux_arm/orderAccess_linux_arm.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,247 +0,0 @@
-/*
- * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef OS_CPU_LINUX_ARM_VM_ORDERACCESS_LINUX_ARM_INLINE_HPP
-#define OS_CPU_LINUX_ARM_VM_ORDERACCESS_LINUX_ARM_INLINE_HPP
-
-#include "runtime/orderAccess.hpp"
-#include "runtime/os.hpp"
-#include "vm_version_arm.hpp"
-
-// Implementation of class OrderAccess.
-// - we define the high level barriers below and use the general
-//   implementation in orderAccess.inline.hpp, with customizations
-//   on AARCH64 via the specialized_* template functions
-
-// Memory Ordering on ARM is weak.
-//
-// Implement all 4 memory ordering barriers by DMB, since it is a
-// lighter version of DSB.
-// dmb_sy implies full system shareability domain. RD/WR access type.
-// dmb_st implies full system shareability domain. WR only access type.
-//
-// NOP on < ARMv6 (MP not supported)
-//
-// Non mcr instructions can be used if we build for armv7 or higher arch
-//    __asm__ __volatile__ ("dmb" : : : "memory");
-//    __asm__ __volatile__ ("dsb" : : : "memory");
-//
-// inline void _OrderAccess_dsb() {
-//    volatile intptr_t dummy = 0;
-//    if (os::is_MP()) {
-//      __asm__ volatile (
-//        "mcr p15, 0, %0, c7, c10, 4"
-//        : : "r" (dummy) : "memory");
-//   }
-// }
-
-inline static void dmb_sy() {
-   if (!os::is_MP()) {
-     return;
-   }
-#ifdef AARCH64
-   __asm__ __volatile__ ("dmb sy" : : : "memory");
-#else
-   if (VM_Version::arm_arch() >= 7) {
-#ifdef __thumb__
-     __asm__ volatile (
-     "dmb sy": : : "memory");
-#else
-     __asm__ volatile (
-     ".word 0xF57FF050 | 0xf" : : : "memory");
-#endif
-   } else {
-     intptr_t zero = 0;
-     __asm__ volatile (
-       "mcr p15, 0, %0, c7, c10, 5"
-       : : "r" (zero) : "memory");
-   }
-#endif
-}
-
-inline static void dmb_st() {
-   if (!os::is_MP()) {
-     return;
-   }
-#ifdef AARCH64
-   __asm__ __volatile__ ("dmb st" : : : "memory");
-#else
-   if (VM_Version::arm_arch() >= 7) {
-#ifdef __thumb__
-     __asm__ volatile (
-     "dmb st": : : "memory");
-#else
-     __asm__ volatile (
-     ".word 0xF57FF050 | 0xe" : : : "memory");
-#endif
-   } else {
-     intptr_t zero = 0;
-     __asm__ volatile (
-       "mcr p15, 0, %0, c7, c10, 5"
-       : : "r" (zero) : "memory");
-   }
-#endif
-}
-
-// Load-Load/Store barrier
-inline static void dmb_ld() {
-#ifdef AARCH64
-   if (!os::is_MP()) {
-     return;
-   }
-   __asm__ __volatile__ ("dmb ld" : : : "memory");
-#else
-   dmb_sy();
-#endif
-}
-
-
-inline void OrderAccess::loadload()   { dmb_ld(); }
-inline void OrderAccess::loadstore()  { dmb_ld(); }
-inline void OrderAccess::acquire()    { dmb_ld(); }
-inline void OrderAccess::storestore() { dmb_st(); }
-inline void OrderAccess::storeload()  { dmb_sy(); }
-inline void OrderAccess::release()    { dmb_sy(); }
-inline void OrderAccess::fence()      { dmb_sy(); }
-
-// specializations for Aarch64
-// TODO-AARCH64: evaluate effectiveness of ldar*/stlr* implementations compared to 32-bit ARM approach
-
-#ifdef AARCH64
-
-template<>
-struct OrderAccess::PlatformOrderedLoad<1, X_ACQUIRE>
-{
-  template <typename T>
-  T operator()(const volatile T* p) const {
-    volatile T result;
-    __asm__ volatile(
-      "ldarb %w[res], [%[ptr]]"
-      : [res] "=&r" (result)
-      : [ptr] "r" (p)
-      : "memory");
-    return result;
-  }
-};
-
-template<>
-struct OrderAccess::PlatformOrderedLoad<2, X_ACQUIRE>
-{
-  template <typename T>
-  T operator()(const volatile T* p) const {
-    volatile T result;
-    __asm__ volatile(
-      "ldarh %w[res], [%[ptr]]"
-      : [res] "=&r" (result)
-      : [ptr] "r" (p)
-      : "memory");
-    return result;
-  }
-};
-
-template<>
-struct OrderAccess::PlatformOrderedLoad<4, X_ACQUIRE>
-{
-  template <typename T>
-  T operator()(const volatile T* p) const {
-    volatile T result;
-    __asm__ volatile(
-      "ldar %w[res], [%[ptr]]"
-      : [res] "=&r" (result)
-      : [ptr] "r" (p)
-      : "memory");
-    return result;
-  }
-};
-
-template<>
-struct OrderAccess::PlatformOrderedLoad<8, X_ACQUIRE>
-{
-  template <typename T>
-  T operator()(const volatile T* p) const {
-    volatile T result;
-    __asm__ volatile(
-      "ldar %[res], [%[ptr]]"
-      : [res] "=&r" (result)
-      : [ptr] "r" (p)
-      : "memory");
-    return result;
-  }
-};
-
-template<>
-struct OrderAccess::PlatformOrderedStore<1, RELEASE_X_FENCE>
-{
-  template <typename T>
-  void operator()(T v, volatile T* p) const {
-    __asm__ volatile(
-      "stlrb %w[val], [%[ptr]]"
-      :
-      : [ptr] "r" (p), [val] "r" (v)
-      : "memory");
-  }
-};
-
-template<>
-struct OrderAccess::PlatformOrderedStore<2, RELEASE_X_FENCE>
-{
-  template <typename T>
-  void operator()(T v, volatile T* p) const {
-    __asm__ volatile(
-      "stlrh %w[val], [%[ptr]]"
-      :
-      : [ptr] "r" (p), [val] "r" (v)
-      : "memory");
-  }
-};
-
-template<>
-struct OrderAccess::PlatformOrderedStore<4, RELEASE_X_FENCE>
-{
-  template <typename T>
-  void operator()(T v, volatile T* p) const {
-    __asm__ volatile(
-      "stlr %w[val], [%[ptr]]"
-      :
-      : [ptr] "r" (p), [val] "r" (v)
-      : "memory");
-  }
-};
-
-template<>
-struct OrderAccess::PlatformOrderedStore<8, RELEASE_X_FENCE>
-{
-  template <typename T>
-  void operator()(T v, volatile T* p) const {
-    __asm__ volatile(
-      "stlr %[val], [%[ptr]]"
-      :
-      : [ptr] "r" (p), [val] "r" (v)
-      : "memory");
-  }
-};
-
-#endif // AARCH64
-
-#endif // OS_CPU_LINUX_ARM_VM_ORDERACCESS_LINUX_ARM_INLINE_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os_cpu/linux_ppc/orderAccess_linux_ppc.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014 SAP SE. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef OS_CPU_LINUX_PPC_VM_ORDERACCESS_LINUX_PPC_HPP
+#define OS_CPU_LINUX_PPC_VM_ORDERACCESS_LINUX_PPC_HPP
+
+// Included in orderAccess.hpp header file.
+
+#ifndef PPC64
+#error "OrderAccess currently only implemented for PPC64"
+#endif
+
+// Compiler version last used for testing: gcc 4.1.2
+// Please update this information when this file changes
+
+// Implementation of class OrderAccess.
+
+//
+// Machine barrier instructions:
+//
+// - sync            Two-way memory barrier, aka fence.
+// - lwsync          orders  Store|Store,
+//                            Load|Store,
+//                            Load|Load,
+//                   but not Store|Load
+// - eieio           orders  Store|Store
+// - isync           Invalidates speculatively executed instructions,
+//                   but isync may complete before storage accesses
+//                   associated with instructions preceding isync have
+//                   been performed.
+//
+// Semantic barrier instructions:
+// (as defined in orderAccess.hpp)
+//
+// - release         orders Store|Store,       (maps to lwsync)
+//                           Load|Store
+// - acquire         orders  Load|Store,       (maps to lwsync)
+//                           Load|Load
+// - fence           orders Store|Store,       (maps to sync)
+//                           Load|Store,
+//                           Load|Load,
+//                          Store|Load
+//
+
+#define inlasm_sync()     __asm__ __volatile__ ("sync"   : : : "memory");
+#define inlasm_lwsync()   __asm__ __volatile__ ("lwsync" : : : "memory");
+#define inlasm_eieio()    __asm__ __volatile__ ("eieio"  : : : "memory");
+#define inlasm_isync()    __asm__ __volatile__ ("isync"  : : : "memory");
+// Use twi-isync for load_acquire (faster than lwsync).
+#define inlasm_acquire_reg(X) __asm__ __volatile__ ("twi 0,%0,0\n isync\n" : : "r" (X) : "memory");
+
+inline void   OrderAccess::loadload()   { inlasm_lwsync(); }
+inline void   OrderAccess::storestore() { inlasm_lwsync(); }
+inline void   OrderAccess::loadstore()  { inlasm_lwsync(); }
+inline void   OrderAccess::storeload()  { inlasm_sync();   }
+
+inline void   OrderAccess::acquire()    { inlasm_lwsync(); }
+inline void   OrderAccess::release()    { inlasm_lwsync(); }
+inline void   OrderAccess::fence()      { inlasm_sync();   }
+
+
+template<size_t byte_size>
+struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
+{
+  template <typename T>
+  T operator()(const volatile T* p) const { register T t = Atomic::load(p); inlasm_acquire_reg(t); return t; }
+};
+
+#undef inlasm_sync
+#undef inlasm_lwsync
+#undef inlasm_eieio
+#undef inlasm_isync
+#undef inlasm_acquire_reg
+
+#endif // OS_CPU_LINUX_PPC_VM_ORDERACCESS_LINUX_PPC_HPP
--- a/src/hotspot/os_cpu/linux_ppc/orderAccess_linux_ppc.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2014 SAP SE. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef OS_CPU_LINUX_PPC_VM_ORDERACCESS_LINUX_PPC_INLINE_HPP
-#define OS_CPU_LINUX_PPC_VM_ORDERACCESS_LINUX_PPC_INLINE_HPP
-
-#include "runtime/orderAccess.hpp"
-
-#ifndef PPC64
-#error "OrderAccess currently only implemented for PPC64"
-#endif
-
-// Compiler version last used for testing: gcc 4.1.2
-// Please update this information when this file changes
-
-// Implementation of class OrderAccess.
-
-//
-// Machine barrier instructions:
-//
-// - sync            Two-way memory barrier, aka fence.
-// - lwsync          orders  Store|Store,
-//                            Load|Store,
-//                            Load|Load,
-//                   but not Store|Load
-// - eieio           orders  Store|Store
-// - isync           Invalidates speculatively executed instructions,
-//                   but isync may complete before storage accesses
-//                   associated with instructions preceding isync have
-//                   been performed.
-//
-// Semantic barrier instructions:
-// (as defined in orderAccess.hpp)
-//
-// - release         orders Store|Store,       (maps to lwsync)
-//                           Load|Store
-// - acquire         orders  Load|Store,       (maps to lwsync)
-//                           Load|Load
-// - fence           orders Store|Store,       (maps to sync)
-//                           Load|Store,
-//                           Load|Load,
-//                          Store|Load
-//
-
-#define inlasm_sync()     __asm__ __volatile__ ("sync"   : : : "memory");
-#define inlasm_lwsync()   __asm__ __volatile__ ("lwsync" : : : "memory");
-#define inlasm_eieio()    __asm__ __volatile__ ("eieio"  : : : "memory");
-#define inlasm_isync()    __asm__ __volatile__ ("isync"  : : : "memory");
-// Use twi-isync for load_acquire (faster than lwsync).
-#define inlasm_acquire_reg(X) __asm__ __volatile__ ("twi 0,%0,0\n isync\n" : : "r" (X) : "memory");
-
-inline void   OrderAccess::loadload()   { inlasm_lwsync(); }
-inline void   OrderAccess::storestore() { inlasm_lwsync(); }
-inline void   OrderAccess::loadstore()  { inlasm_lwsync(); }
-inline void   OrderAccess::storeload()  { inlasm_sync();   }
-
-inline void   OrderAccess::acquire()    { inlasm_lwsync(); }
-inline void   OrderAccess::release()    { inlasm_lwsync(); }
-inline void   OrderAccess::fence()      { inlasm_sync();   }
-
-
-template<size_t byte_size>
-struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
-{
-  template <typename T>
-  T operator()(const volatile T* p) const { register T t = Atomic::load(p); inlasm_acquire_reg(t); return t; }
-};
-
-#undef inlasm_sync
-#undef inlasm_lwsync
-#undef inlasm_eieio
-#undef inlasm_isync
-#undef inlasm_acquire_reg
-
-#endif // OS_CPU_LINUX_PPC_VM_ORDERACCESS_LINUX_PPC_INLINE_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os_cpu/linux_s390/orderAccess_linux_s390.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016 SAP SE. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef OS_CPU_LINUX_S390_VM_ORDERACCESS_LINUX_S390_HPP
+#define OS_CPU_LINUX_S390_VM_ORDERACCESS_LINUX_S390_HPP
+
+// Included in orderAccess.hpp header file.
+
+#include "vm_version_s390.hpp"
+
+// Implementation of class OrderAccess.
+
+//
+// machine barrier instructions:
+//
+//   - z_sync            two-way memory barrier, aka fence
+//
+// semantic barrier instructions:
+// (as defined in orderAccess.hpp)
+//
+//   - z_release         orders Store|Store,    (maps to compiler barrier)
+//                               Load|Store
+//   - z_acquire         orders  Load|Store,    (maps to compiler barrier)
+//                               Load|Load
+//   - z_fence           orders Store|Store,    (maps to z_sync)
+//                               Load|Store,
+//                               Load|Load,
+//                              Store|Load
+//
+
+
+// Only load-after-store-order is not guaranteed on z/Architecture, i.e. only 'fence'
+// is needed.
+
+// A compiler barrier, forcing the C++ compiler to invalidate all memory assumptions.
+#define inlasm_compiler_barrier() __asm__ volatile ("" : : : "memory");
+// "bcr 15, 0" is used as two way memory barrier.
+#define inlasm_zarch_sync() __asm__ __volatile__ ("bcr 15, 0" : : : "memory");
+
+// Release and acquire are empty on z/Architecture, but potential
+// optimizations of gcc must be forbidden by OrderAccess::release and
+// OrderAccess::acquire.
+#define inlasm_zarch_release() inlasm_compiler_barrier()
+#define inlasm_zarch_acquire() inlasm_compiler_barrier()
+#define inlasm_zarch_fence()   inlasm_zarch_sync()
+
+inline void OrderAccess::loadload()   { inlasm_compiler_barrier(); }
+inline void OrderAccess::storestore() { inlasm_compiler_barrier(); }
+inline void OrderAccess::loadstore()  { inlasm_compiler_barrier(); }
+inline void OrderAccess::storeload()  { inlasm_zarch_sync(); }
+
+inline void OrderAccess::acquire()    { inlasm_zarch_acquire(); }
+inline void OrderAccess::release()    { inlasm_zarch_release(); }
+inline void OrderAccess::fence()      { inlasm_zarch_sync(); }
+
+template<size_t byte_size>
+struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
+{
+  template <typename T>
+  T operator()(const volatile T* p) const { register T t = *p; inlasm_zarch_acquire(); return t; }
+};
+
+#undef inlasm_compiler_barrier
+#undef inlasm_zarch_sync
+#undef inlasm_zarch_release
+#undef inlasm_zarch_acquire
+#undef inlasm_zarch_fence
+
+#endif // OS_CPU_LINUX_S390_VM_ORDERACCESS_LINUX_S390_HPP
--- a/src/hotspot/os_cpu/linux_s390/orderAccess_linux_s390.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2016 SAP SE. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef OS_CPU_LINUX_S390_VM_ORDERACCESS_LINUX_S390_INLINE_HPP
-#define OS_CPU_LINUX_S390_VM_ORDERACCESS_LINUX_S390_INLINE_HPP
-
-#include "runtime/orderAccess.hpp"
-#include "vm_version_s390.hpp"
-
-// Implementation of class OrderAccess.
-
-//
-// machine barrier instructions:
-//
-//   - z_sync            two-way memory barrier, aka fence
-//
-// semantic barrier instructions:
-// (as defined in orderAccess.hpp)
-//
-//   - z_release         orders Store|Store,    (maps to compiler barrier)
-//                               Load|Store
-//   - z_acquire         orders  Load|Store,    (maps to compiler barrier)
-//                               Load|Load
-//   - z_fence           orders Store|Store,    (maps to z_sync)
-//                               Load|Store,
-//                               Load|Load,
-//                              Store|Load
-//
-
-
-// Only load-after-store-order is not guaranteed on z/Architecture, i.e. only 'fence'
-// is needed.
-
-// A compiler barrier, forcing the C++ compiler to invalidate all memory assumptions.
-#define inlasm_compiler_barrier() __asm__ volatile ("" : : : "memory");
-// "bcr 15, 0" is used as two way memory barrier.
-#define inlasm_zarch_sync() __asm__ __volatile__ ("bcr 15, 0" : : : "memory");
-
-// Release and acquire are empty on z/Architecture, but potential
-// optimizations of gcc must be forbidden by OrderAccess::release and
-// OrderAccess::acquire.
-#define inlasm_zarch_release() inlasm_compiler_barrier()
-#define inlasm_zarch_acquire() inlasm_compiler_barrier()
-#define inlasm_zarch_fence()   inlasm_zarch_sync()
-
-inline void OrderAccess::loadload()   { inlasm_compiler_barrier(); }
-inline void OrderAccess::storestore() { inlasm_compiler_barrier(); }
-inline void OrderAccess::loadstore()  { inlasm_compiler_barrier(); }
-inline void OrderAccess::storeload()  { inlasm_zarch_sync(); }
-
-inline void OrderAccess::acquire()    { inlasm_zarch_acquire(); }
-inline void OrderAccess::release()    { inlasm_zarch_release(); }
-inline void OrderAccess::fence()      { inlasm_zarch_sync(); }
-
-template<size_t byte_size>
-struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
-{
-  template <typename T>
-  T operator()(const volatile T* p) const { register T t = *p; inlasm_zarch_acquire(); return t; }
-};
-
-#undef inlasm_compiler_barrier
-#undef inlasm_zarch_sync
-#undef inlasm_zarch_release
-#undef inlasm_zarch_acquire
-#undef inlasm_zarch_fence
-
-#endif // OS_CPU_LINUX_S390_VM_ORDERACCESS_LINUX_S390_INLINE_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os_cpu/linux_sparc/orderAccess_linux_sparc.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_HPP
+#define OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_HPP
+
+// Included in orderAccess.hpp header file.
+
+// Implementation of class OrderAccess.
+
+// A compiler barrier, forcing the C++ compiler to invalidate all memory assumptions
+static inline void compiler_barrier() {
+  __asm__ volatile ("" : : : "memory");
+}
+
+// Assume TSO.
+
+inline void OrderAccess::loadload()   { compiler_barrier(); }
+inline void OrderAccess::storestore() { compiler_barrier(); }
+inline void OrderAccess::loadstore()  { compiler_barrier(); }
+inline void OrderAccess::storeload()  { fence();            }
+
+inline void OrderAccess::acquire()    { compiler_barrier(); }
+inline void OrderAccess::release()    { compiler_barrier(); }
+
+inline void OrderAccess::fence() {
+  __asm__ volatile ("membar  #StoreLoad" : : : "memory");
+}
+
+#endif // OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_HPP
--- a/src/hotspot/os_cpu/linux_sparc/orderAccess_linux_sparc.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_INLINE_HPP
-#define OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_INLINE_HPP
-
-#include "runtime/orderAccess.hpp"
-
-// Implementation of class OrderAccess.
-
-// A compiler barrier, forcing the C++ compiler to invalidate all memory assumptions
-static inline void compiler_barrier() {
-  __asm__ volatile ("" : : : "memory");
-}
-
-// Assume TSO.
-
-inline void OrderAccess::loadload()   { compiler_barrier(); }
-inline void OrderAccess::storestore() { compiler_barrier(); }
-inline void OrderAccess::loadstore()  { compiler_barrier(); }
-inline void OrderAccess::storeload()  { fence();            }
-
-inline void OrderAccess::acquire()    { compiler_barrier(); }
-inline void OrderAccess::release()    { compiler_barrier(); }
-
-inline void OrderAccess::fence() {
-  __asm__ volatile ("membar  #StoreLoad" : : : "memory");
-}
-
-#endif // OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_INLINE_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os_cpu/linux_x86/orderAccess_linux_x86.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_HPP
+#define OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_HPP
+
+// Included in orderAccess.hpp header file.
+
+// Compiler version last used for testing: gcc 4.8.2
+// Please update this information when this file changes
+
+// Implementation of class OrderAccess.
+
+// A compiler barrier, forcing the C++ compiler to invalidate all memory assumptions
+static inline void compiler_barrier() {
+  __asm__ volatile ("" : : : "memory");
+}
+
+inline void OrderAccess::loadload()   { compiler_barrier(); }
+inline void OrderAccess::storestore() { compiler_barrier(); }
+inline void OrderAccess::loadstore()  { compiler_barrier(); }
+inline void OrderAccess::storeload()  { fence();            }
+
+inline void OrderAccess::acquire()    { compiler_barrier(); }
+inline void OrderAccess::release()    { compiler_barrier(); }
+
+inline void OrderAccess::fence() {
+   // always use locked addl since mfence is sometimes expensive
+#ifdef AMD64
+  __asm__ volatile ("lock; addl $0,0(%%rsp)" : : : "cc", "memory");
+#else
+  __asm__ volatile ("lock; addl $0,0(%%esp)" : : : "cc", "memory");
+#endif
+  compiler_barrier();
+}
+
+template<>
+struct OrderAccess::PlatformOrderedStore<1, RELEASE_X_FENCE>
+{
+  template <typename T>
+  void operator()(T v, volatile T* p) const {
+    __asm__ volatile (  "xchgb (%2),%0"
+                      : "=q" (v)
+                      : "0" (v), "r" (p)
+                      : "memory");
+  }
+};
+
+template<>
+struct OrderAccess::PlatformOrderedStore<2, RELEASE_X_FENCE>
+{
+  template <typename T>
+  void operator()(T v, volatile T* p) const {
+    __asm__ volatile (  "xchgw (%2),%0"
+                      : "=r" (v)
+                      : "0" (v), "r" (p)
+                      : "memory");
+  }
+};
+
+template<>
+struct OrderAccess::PlatformOrderedStore<4, RELEASE_X_FENCE>
+{
+  template <typename T>
+  void operator()(T v, volatile T* p) const {
+    __asm__ volatile (  "xchgl (%2),%0"
+                      : "=r" (v)
+                      : "0" (v), "r" (p)
+                      : "memory");
+  }
+};
+
+#ifdef AMD64
+template<>
+struct OrderAccess::PlatformOrderedStore<8, RELEASE_X_FENCE>
+{
+  template <typename T>
+  void operator()(T v, volatile T* p) const {
+    __asm__ volatile (  "xchgq (%2), %0"
+                      : "=r" (v)
+                      : "0" (v), "r" (p)
+                      : "memory");
+  }
+};
+#endif // AMD64
+
+#endif // OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_HPP
--- a/src/hotspot/os_cpu/linux_x86/orderAccess_linux_x86.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_INLINE_HPP
-#define OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_INLINE_HPP
-
-#include "runtime/atomic.hpp"
-#include "runtime/orderAccess.hpp"
-#include "runtime/os.hpp"
-
-// Compiler version last used for testing: gcc 4.8.2
-// Please update this information when this file changes
-
-// Implementation of class OrderAccess.
-
-// A compiler barrier, forcing the C++ compiler to invalidate all memory assumptions
-static inline void compiler_barrier() {
-  __asm__ volatile ("" : : : "memory");
-}
-
-inline void OrderAccess::loadload()   { compiler_barrier(); }
-inline void OrderAccess::storestore() { compiler_barrier(); }
-inline void OrderAccess::loadstore()  { compiler_barrier(); }
-inline void OrderAccess::storeload()  { fence();            }
-
-inline void OrderAccess::acquire()    { compiler_barrier(); }
-inline void OrderAccess::release()    { compiler_barrier(); }
-
-inline void OrderAccess::fence() {
-  if (os::is_MP()) {
-    // always use locked addl since mfence is sometimes expensive
-#ifdef AMD64
-    __asm__ volatile ("lock; addl $0,0(%%rsp)" : : : "cc", "memory");
-#else
-    __asm__ volatile ("lock; addl $0,0(%%esp)" : : : "cc", "memory");
-#endif
-  }
-  compiler_barrier();
-}
-
-template<>
-struct OrderAccess::PlatformOrderedStore<1, RELEASE_X_FENCE>
-{
-  template <typename T>
-  void operator()(T v, volatile T* p) const {
-    __asm__ volatile (  "xchgb (%2),%0"
-                      : "=q" (v)
-                      : "0" (v), "r" (p)
-                      : "memory");
-  }
-};
-
-template<>
-struct OrderAccess::PlatformOrderedStore<2, RELEASE_X_FENCE>
-{
-  template <typename T>
-  void operator()(T v, volatile T* p) const {
-    __asm__ volatile (  "xchgw (%2),%0"
-                      : "=r" (v)
-                      : "0" (v), "r" (p)
-                      : "memory");
-  }
-};
-
-template<>
-struct OrderAccess::PlatformOrderedStore<4, RELEASE_X_FENCE>
-{
-  template <typename T>
-  void operator()(T v, volatile T* p) const {
-    __asm__ volatile (  "xchgl (%2),%0"
-                      : "=r" (v)
-                      : "0" (v), "r" (p)
-                      : "memory");
-  }
-};
-
-#ifdef AMD64
-template<>
-struct OrderAccess::PlatformOrderedStore<8, RELEASE_X_FENCE>
-{
-  template <typename T>
-  void operator()(T v, volatile T* p) const {
-    __asm__ volatile (  "xchgq (%2), %0"
-                      : "=r" (v)
-                      : "0" (v), "r" (p)
-                      : "memory");
-  }
-};
-#endif // AMD64
-
-#endif // OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_INLINE_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os_cpu/linux_zero/orderAccess_linux_zero.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2007, 2008, 2009 Red Hat, Inc.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_HPP
+#define OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_HPP
+
+// Included in orderAccess.hpp header file.
+
+#ifdef ARM
+
+/*
+ * ARM Kernel helper for memory barrier.
+ * Using __asm __volatile ("":::"memory") does not work reliable on ARM
+ * and gcc __sync_synchronize(); implementation does not use the kernel
+ * helper for all gcc versions so it is unreliable to use as well.
+ */
+typedef void (__kernel_dmb_t) (void);
+#define __kernel_dmb (*(__kernel_dmb_t *) 0xffff0fa0)
+
+#define FULL_MEM_BARRIER __kernel_dmb()
+#define LIGHT_MEM_BARRIER __kernel_dmb()
+
+#else // ARM
+
+#define FULL_MEM_BARRIER __sync_synchronize()
+
+#ifdef PPC
+
+#ifdef __NO_LWSYNC__
+#define LIGHT_MEM_BARRIER __asm __volatile ("sync":::"memory")
+#else
+#define LIGHT_MEM_BARRIER __asm __volatile ("lwsync":::"memory")
+#endif
+
+#else // PPC
+
+#ifdef ALPHA
+
+#define LIGHT_MEM_BARRIER __sync_synchronize()
+
+#else // ALPHA
+
+#define LIGHT_MEM_BARRIER __asm __volatile ("":::"memory")
+
+#endif // ALPHA
+
+#endif // PPC
+
+#endif // ARM
+
+// Note: What is meant by LIGHT_MEM_BARRIER is a barrier which is sufficient
+// to provide TSO semantics, i.e. StoreStore | LoadLoad | LoadStore.
+
+inline void OrderAccess::loadload()   { LIGHT_MEM_BARRIER; }
+inline void OrderAccess::storestore() { LIGHT_MEM_BARRIER; }
+inline void OrderAccess::loadstore()  { LIGHT_MEM_BARRIER; }
+inline void OrderAccess::storeload()  { FULL_MEM_BARRIER;  }
+
+inline void OrderAccess::acquire()    { LIGHT_MEM_BARRIER; }
+inline void OrderAccess::release()    { LIGHT_MEM_BARRIER; }
+
+inline void OrderAccess::fence()      { FULL_MEM_BARRIER;  }
+
+#endif // OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_HPP
--- a/src/hotspot/os_cpu/linux_zero/orderAccess_linux_zero.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2007, 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_INLINE_HPP
-#define OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_INLINE_HPP
-
-#include "runtime/orderAccess.hpp"
-
-#ifdef ARM
-
-/*
- * ARM Kernel helper for memory barrier.
- * Using __asm __volatile ("":::"memory") does not work reliable on ARM
- * and gcc __sync_synchronize(); implementation does not use the kernel
- * helper for all gcc versions so it is unreliable to use as well.
- */
-typedef void (__kernel_dmb_t) (void);
-#define __kernel_dmb (*(__kernel_dmb_t *) 0xffff0fa0)
-
-#define FULL_MEM_BARRIER __kernel_dmb()
-#define LIGHT_MEM_BARRIER __kernel_dmb()
-
-#else // ARM
-
-#define FULL_MEM_BARRIER __sync_synchronize()
-
-#ifdef PPC
-
-#ifdef __NO_LWSYNC__
-#define LIGHT_MEM_BARRIER __asm __volatile ("sync":::"memory")
-#else
-#define LIGHT_MEM_BARRIER __asm __volatile ("lwsync":::"memory")
-#endif
-
-#else // PPC
-
-#ifdef ALPHA
-
-#define LIGHT_MEM_BARRIER __sync_synchronize()
-
-#else // ALPHA
-
-#define LIGHT_MEM_BARRIER __asm __volatile ("":::"memory")
-
-#endif // ALPHA
-
-#endif // PPC
-
-#endif // ARM
-
-// Note: What is meant by LIGHT_MEM_BARRIER is a barrier which is sufficient
-// to provide TSO semantics, i.e. StoreStore | LoadLoad | LoadStore.
-
-inline void OrderAccess::loadload()   { LIGHT_MEM_BARRIER; }
-inline void OrderAccess::storestore() { LIGHT_MEM_BARRIER; }
-inline void OrderAccess::loadstore()  { LIGHT_MEM_BARRIER; }
-inline void OrderAccess::storeload()  { FULL_MEM_BARRIER;  }
-
-inline void OrderAccess::acquire()    { LIGHT_MEM_BARRIER; }
-inline void OrderAccess::release()    { LIGHT_MEM_BARRIER; }
-
-inline void OrderAccess::fence()      { FULL_MEM_BARRIER;  }
-
-#endif // OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_INLINE_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os_cpu/solaris_sparc/orderAccess_solaris_sparc.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_HPP
+#define OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_HPP
+
+// Included in orderAccess.hpp header file.
+
+// Compiler version last used for testing: solaris studio 12u3
+// Please update this information when this file changes
+
+// Implementation of class OrderAccess.
+
+// Assume TSO.
+
+// A compiler barrier, forcing the C++ compiler to invalidate all memory assumptions
+inline void compiler_barrier() {
+  __asm__ volatile ("" : : : "memory");
+}
+
+inline void OrderAccess::loadload()   { compiler_barrier(); }
+inline void OrderAccess::storestore() { compiler_barrier(); }
+inline void OrderAccess::loadstore()  { compiler_barrier(); }
+inline void OrderAccess::storeload()  { fence();            }
+
+inline void OrderAccess::acquire()    { compiler_barrier(); }
+inline void OrderAccess::release()    { compiler_barrier(); }
+
+inline void OrderAccess::fence() {
+  __asm__ volatile ("membar  #StoreLoad" : : : "memory");
+}
+
+#endif // OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_HPP
--- a/src/hotspot/os_cpu/solaris_sparc/orderAccess_solaris_sparc.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_INLINE_HPP
-#define OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_INLINE_HPP
-
-#include "runtime/atomic.hpp"
-#include "runtime/orderAccess.hpp"
-
-// Compiler version last used for testing: solaris studio 12u3
-// Please update this information when this file changes
-
-// Implementation of class OrderAccess.
-
-// Assume TSO.
-
-// A compiler barrier, forcing the C++ compiler to invalidate all memory assumptions
-inline void compiler_barrier() {
-  __asm__ volatile ("" : : : "memory");
-}
-
-inline void OrderAccess::loadload()   { compiler_barrier(); }
-inline void OrderAccess::storestore() { compiler_barrier(); }
-inline void OrderAccess::loadstore()  { compiler_barrier(); }
-inline void OrderAccess::storeload()  { fence();            }
-
-inline void OrderAccess::acquire()    { compiler_barrier(); }
-inline void OrderAccess::release()    { compiler_barrier(); }
-
-inline void OrderAccess::fence() {
-  __asm__ volatile ("membar  #StoreLoad" : : : "memory");
-}
-
-#endif // OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_INLINE_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os_cpu/solaris_x86/orderAccess_solaris_x86.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_HPP
+#define OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_HPP
+
+// Included in orderAccess.hpp header file.
+
+// Compiler version last used for testing: solaris studio 12u3
+// Please update this information when this file changes
+
+// Implementation of class OrderAccess.
+
+// A compiler barrier, forcing the C++ compiler to invalidate all memory assumptions
+inline void compiler_barrier() {
+  __asm__ volatile ("" : : : "memory");
+}
+
+inline void OrderAccess::loadload()   { compiler_barrier(); }
+inline void OrderAccess::storestore() { compiler_barrier(); }
+inline void OrderAccess::loadstore()  { compiler_barrier(); }
+inline void OrderAccess::storeload()  { fence();            }
+
+inline void OrderAccess::acquire()    { compiler_barrier(); }
+inline void OrderAccess::release()    { compiler_barrier(); }
+
+inline void OrderAccess::fence() {
+#ifdef AMD64
+  __asm__ volatile ("lock; addl $0,0(%%rsp)" : : : "cc", "memory");
+#else
+  __asm__ volatile ("lock; addl $0,0(%%esp)" : : : "cc", "memory");
+#endif
+  compiler_barrier();
+}
+
+#endif // OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_HPP
--- a/src/hotspot/os_cpu/solaris_x86/orderAccess_solaris_x86.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_INLINE_HPP
-#define OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_INLINE_HPP
-
-#include "runtime/atomic.hpp"
-#include "runtime/orderAccess.hpp"
-#include "runtime/os.hpp"
-
-// Compiler version last used for testing: solaris studio 12u3
-// Please update this information when this file changes
-
-// Implementation of class OrderAccess.
-
-// A compiler barrier, forcing the C++ compiler to invalidate all memory assumptions
-inline void compiler_barrier() {
-  __asm__ volatile ("" : : : "memory");
-}
-
-inline void OrderAccess::loadload()   { compiler_barrier(); }
-inline void OrderAccess::storestore() { compiler_barrier(); }
-inline void OrderAccess::loadstore()  { compiler_barrier(); }
-inline void OrderAccess::storeload()  { fence();            }
-
-inline void OrderAccess::acquire()    { compiler_barrier(); }
-inline void OrderAccess::release()    { compiler_barrier(); }
-
-inline void OrderAccess::fence() {
-  if (os::is_MP()) {
-#ifdef AMD64
-    __asm__ volatile ("lock; addl $0,0(%%rsp)" : : : "cc", "memory");
-#else
-    __asm__ volatile ("lock; addl $0,0(%%esp)" : : : "cc", "memory");
-#endif
-  }
-  compiler_barrier();
-}
-
-#endif // OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_INLINE_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os_cpu/windows_x86/orderAccess_windows_x86.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_HPP
+#define OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_HPP
+
+// Included in orderAccess.hpp header file.
+
+#include <intrin.h>
+
+// Compiler version last used for testing: Microsoft Visual Studio 2010
+// Please update this information when this file changes
+
+// Implementation of class OrderAccess.
+
+// A compiler barrier, forcing the C++ compiler to invalidate all memory assumptions
+inline void compiler_barrier() {
+  _ReadWriteBarrier();
+}
+
+// Note that in MSVC, volatile memory accesses are explicitly
+// guaranteed to have acquire release semantics (w.r.t. compiler
+// reordering) and therefore does not even need a compiler barrier
+// for normal acquire release accesses. And all generalized
+// bound calls like release_store go through OrderAccess::load
+// and OrderAccess::store which do volatile memory accesses.
+template<> inline void ScopedFence<X_ACQUIRE>::postfix()       { }
+template<> inline void ScopedFence<RELEASE_X>::prefix()        { }
+template<> inline void ScopedFence<RELEASE_X_FENCE>::prefix()  { }
+template<> inline void ScopedFence<RELEASE_X_FENCE>::postfix() { OrderAccess::fence(); }
+
+inline void OrderAccess::loadload()   { compiler_barrier(); }
+inline void OrderAccess::storestore() { compiler_barrier(); }
+inline void OrderAccess::loadstore()  { compiler_barrier(); }
+inline void OrderAccess::storeload()  { fence(); }
+
+inline void OrderAccess::acquire()    { compiler_barrier(); }
+inline void OrderAccess::release()    { compiler_barrier(); }
+
+inline void OrderAccess::fence() {
+#ifdef AMD64
+  StubRoutines_fence();
+#else
+  __asm {
+    lock add dword ptr [esp], 0;
+  }
+#endif // AMD64
+  compiler_barrier();
+}
+
+#ifndef AMD64
+template<>
+struct OrderAccess::PlatformOrderedStore<1, RELEASE_X_FENCE>
+{
+  template <typename T>
+  void operator()(T v, volatile T* p) const {
+    __asm {
+      mov edx, p;
+      mov al, v;
+      xchg al, byte ptr [edx];
+    }
+  }
+};
+
+template<>
+struct OrderAccess::PlatformOrderedStore<2, RELEASE_X_FENCE>
+{
+  template <typename T>
+  void operator()(T v, volatile T* p) const {
+    __asm {
+      mov edx, p;
+      mov ax, v;
+      xchg ax, word ptr [edx];
+    }
+  }
+};
+
+template<>
+struct OrderAccess::PlatformOrderedStore<4, RELEASE_X_FENCE>
+{
+  template <typename T>
+  void operator()(T v, volatile T* p) const {
+    __asm {
+      mov edx, p;
+      mov eax, v;
+      xchg eax, dword ptr [edx];
+    }
+  }
+};
+#endif // AMD64
+
+#endif // OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_HPP
--- a/src/hotspot/os_cpu/windows_x86/orderAccess_windows_x86.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP
-#define OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP
-
-#include <intrin.h>
-#include "runtime/atomic.hpp"
-#include "runtime/orderAccess.hpp"
-#include "runtime/os.hpp"
-
-// Compiler version last used for testing: Microsoft Visual Studio 2010
-// Please update this information when this file changes
-
-// Implementation of class OrderAccess.
-
-// A compiler barrier, forcing the C++ compiler to invalidate all memory assumptions
-inline void compiler_barrier() {
-  _ReadWriteBarrier();
-}
-
-// Note that in MSVC, volatile memory accesses are explicitly
-// guaranteed to have acquire release semantics (w.r.t. compiler
-// reordering) and therefore does not even need a compiler barrier
-// for normal acquire release accesses. And all generalized
-// bound calls like release_store go through OrderAccess::load
-// and OrderAccess::store which do volatile memory accesses.
-template<> inline void ScopedFence<X_ACQUIRE>::postfix()       { }
-template<> inline void ScopedFence<RELEASE_X>::prefix()        { }
-template<> inline void ScopedFence<RELEASE_X_FENCE>::prefix()  { }
-template<> inline void ScopedFence<RELEASE_X_FENCE>::postfix() { OrderAccess::fence(); }
-
-inline void OrderAccess::loadload()   { compiler_barrier(); }
-inline void OrderAccess::storestore() { compiler_barrier(); }
-inline void OrderAccess::loadstore()  { compiler_barrier(); }
-inline void OrderAccess::storeload()  { fence(); }
-
-inline void OrderAccess::acquire()    { compiler_barrier(); }
-inline void OrderAccess::release()    { compiler_barrier(); }
-
-inline void OrderAccess::fence() {
-#ifdef AMD64
-  StubRoutines_fence();
-#else
-  if (os::is_MP()) {
-    __asm {
-      lock add dword ptr [esp], 0;
-    }
-  }
-#endif // AMD64
-  compiler_barrier();
-}
-
-#ifndef AMD64
-template<>
-struct OrderAccess::PlatformOrderedStore<1, RELEASE_X_FENCE>
-{
-  template <typename T>
-  void operator()(T v, volatile T* p) const {
-    __asm {
-      mov edx, p;
-      mov al, v;
-      xchg al, byte ptr [edx];
-    }
-  }
-};
-
-template<>
-struct OrderAccess::PlatformOrderedStore<2, RELEASE_X_FENCE>
-{
-  template <typename T>
-  void operator()(T v, volatile T* p) const {
-    __asm {
-      mov edx, p;
-      mov ax, v;
-      xchg ax, word ptr [edx];
-    }
-  }
-};
-
-template<>
-struct OrderAccess::PlatformOrderedStore<4, RELEASE_X_FENCE>
-{
-  template <typename T>
-  void operator()(T v, volatile T* p) const {
-    __asm {
-      mov edx, p;
-      mov eax, v;
-      xchg eax, dword ptr [edx];
-    }
-  }
-};
-#endif // AMD64
-
-#endif // OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP
--- a/src/hotspot/share/classfile/classLoader.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/classfile/classLoader.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -26,7 +26,7 @@
 #define SHARE_VM_CLASSFILE_CLASSLOADER_INLINE_HPP
 
 #include "classfile/classLoader.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 
 // Next entry in class path
 inline ClassPathEntry* ClassPathEntry::next() const { return OrderAccess::load_acquire(&_next); }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,456 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 SAP SE. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+
+#include "classfile/classLoaderData.inline.hpp"
+#include "classfile/classLoaderHierarchyDCmd.hpp"
+#include "memory/allocation.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/safepoint.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/ostream.hpp"
+
+
+ClassLoaderHierarchyDCmd::ClassLoaderHierarchyDCmd(outputStream* output, bool heap)
+  : DCmdWithParser(output, heap)
+  , _show_classes("show-classes", "Print loaded classes.", "BOOLEAN", false, "false")
+  , _verbose("verbose", "Print detailed information.", "BOOLEAN", false, "false") {
+  _dcmdparser.add_dcmd_option(&_show_classes);
+  _dcmdparser.add_dcmd_option(&_verbose);
+}
+
+
+int ClassLoaderHierarchyDCmd::num_arguments() {
+  ResourceMark rm;
+  ClassLoaderHierarchyDCmd* dcmd = new ClassLoaderHierarchyDCmd(NULL, false);
+  if (dcmd != NULL) {
+    DCmdMark mark(dcmd);
+    return dcmd->_dcmdparser.num_arguments();
+  } else {
+    return 0;
+  }
+}
+
+// Helper class for drawing the branches to the left of a node.
+class BranchTracker : public StackObj {
+  //       "<x>"
+  //       " |---<y>"
+  //       " |    |
+  //       " |   <z>"
+  //       " |    |---<z1>
+  //       " |    |---<z2>
+  //       ^^^^^^^ ^^^
+  //        A       B
+
+  // Some terms for the graphics:
+  // - branch: vertical connection between a node's ancestor to a later sibling.
+  // - branchwork: (A) the string to print as a prefix at the start of each line, contains all branches.
+  // - twig (B): Length of the dashed line connecting a node to its branch.
+  // - branch spacing: how many spaces between branches are printed.
+
+public:
+
+  enum { max_depth = 64, twig_len = 2, branch_spacing = 5 };
+
+private:
+
+  char _branches[max_depth];
+  int _pos;
+
+public:
+  BranchTracker()
+    : _pos(0) {}
+
+  void push(bool has_branch) {
+    if (_pos < max_depth) {
+      _branches[_pos] = has_branch ? '|' : ' ';
+    }
+    _pos ++; // beyond max depth, omit branch drawing but do count on.
+  }
+
+  void pop() {
+    assert(_pos > 0, "must be");
+    _pos --;
+  }
+
+  void print(outputStream* st) {
+    for (int i = 0; i < _pos; i ++) {
+      st->print("%c%.*s", _branches[i], branch_spacing, "          ");
+    }
+  }
+
+  class Mark {
+    BranchTracker& _tr;
+  public:
+    Mark(BranchTracker& tr, bool has_branch_here)
+      : _tr(tr)  { _tr.push(has_branch_here); }
+    ~Mark() { _tr.pop(); }
+  };
+
+}; // end: BranchTracker
+
+struct LoadedClassInfo : public ResourceObj {
+public:
+  LoadedClassInfo* _next;
+  Klass* const _klass;
+  const ClassLoaderData* const _cld;
+
+  LoadedClassInfo(Klass* klass, const ClassLoaderData* cld)
+    : _klass(klass), _cld(cld) {}
+
+};
+
+class LoaderTreeNode : public ResourceObj {
+
+  // We walk the CLDG and, for each CLD which is non-anonymous, add
+  // a tree node. To add a node we need its parent node; if it itself
+  // does not exist yet, we add a preliminary node for it. This preliminary
+  // node just contains its loader oop; later, when encountering its CLD in
+  // our CLDG walk, we complete the missing information in this node.
+
+  const oop _loader_oop;
+  const ClassLoaderData* _cld;
+
+  LoaderTreeNode* _child;
+  LoaderTreeNode* _next;
+
+  LoadedClassInfo* _classes;
+  int _num_classes;
+
+  LoadedClassInfo* _anon_classes;
+  int _num_anon_classes;
+
+  void print_with_childs(outputStream* st, BranchTracker& branchtracker,
+      bool print_classes, bool verbose) const {
+
+    ResourceMark rm;
+
+    if (_cld == NULL) {
+      // Not sure how this could happen: we added a preliminary node for a parent but then never encountered
+      // its CLD?
+      return;
+    }
+
+    // Retrieve information.
+    const Klass* const loader_klass = _cld->class_loader_klass();
+    const Symbol* const loader_name = _cld->class_loader_name();
+
+    branchtracker.print(st);
+
+    // e.g. "+--- jdk.internal.reflect.DelegatingClassLoader"
+    st->print("+%.*s", BranchTracker::twig_len, "----------");
+    if (_cld->is_the_null_class_loader_data()) {
+      st->print(" <bootstrap>");
+    } else {
+      if (loader_name != NULL) {
+        st->print(" \"%s\",", loader_name->as_C_string());
+      }
+      st->print(" %s", loader_klass != NULL ? loader_klass->external_name() : "??");
+      st->print(" {" PTR_FORMAT "}", p2i(_loader_oop));
+    }
+    st->cr();
+
+    // Output following this node (node details and child nodes) - up to the next sibling node
+    // needs to be prefixed with "|" if there is a follow up sibling.
+    const bool have_sibling = _next != NULL;
+    BranchTracker::Mark trm(branchtracker, have_sibling);
+
+    {
+      // optional node details following this node needs to be prefixed with "|"
+      // if there are follow up child nodes.
+      const bool have_child = _child != NULL;
+      BranchTracker::Mark trm(branchtracker, have_child);
+
+      // Empty line
+      branchtracker.print(st);
+      st->cr();
+
+      const int indentation = 18;
+
+      if (verbose) {
+        branchtracker.print(st);
+        st->print_cr("%*s " PTR_FORMAT, indentation, "Loader Data:", p2i(_cld));
+        branchtracker.print(st);
+        st->print_cr("%*s " PTR_FORMAT, indentation, "Loader Klass:", p2i(loader_klass));
+
+        // Empty line
+        branchtracker.print(st);
+        st->cr();
+      }
+
+      if (print_classes) {
+
+        if (_classes != NULL) {
+          for (LoadedClassInfo* lci = _classes; lci; lci = lci->_next) {
+            branchtracker.print(st);
+            if (lci == _classes) { // first iteration
+              st->print("%*s ", indentation, "Classes:");
+            } else {
+              st->print("%*s ", indentation, "");
+            }
+            st->print("%s", lci->_klass->external_name());
+            st->cr();
+            // Non-anonymous classes should live in the primary CLD of its loader
+            assert(lci->_cld == _cld, "must be");
+          }
+          branchtracker.print(st);
+          st->print("%*s ", indentation, "");
+          st->print_cr("(%u class%s)", _num_classes, (_num_classes == 1) ? "" : "es");
+
+          // Empty line
+          branchtracker.print(st);
+          st->cr();
+        }
+
+        if (_anon_classes != NULL) {
+          for (LoadedClassInfo* lci = _anon_classes; lci; lci = lci->_next) {
+            branchtracker.print(st);
+            if (lci == _anon_classes) { // first iteration
+              st->print("%*s ", indentation, "Anonymous Classes:");
+            } else {
+              st->print("%*s ", indentation, "");
+            }
+            st->print("%s", lci->_klass->external_name());
+            // For anonymous classes, also print CLD if verbose. Should be a different one than the primary CLD.
+            assert(lci->_cld != _cld, "must be");
+            if (verbose) {
+              st->print("  (CLD: " PTR_FORMAT ")", p2i(lci->_cld));
+            }
+            st->cr();
+          }
+          branchtracker.print(st);
+          st->print("%*s ", indentation, "");
+          st->print_cr("(%u anonymous class%s)", _num_anon_classes, (_num_anon_classes == 1) ? "" : "es");
+
+          // Empty line
+          branchtracker.print(st);
+          st->cr();
+        }
+
+      } // end: print_classes
+
+    } // Pop branchtracker mark
+
+    // Print children, recursively
+    LoaderTreeNode* c = _child;
+    while (c != NULL) {
+      c->print_with_childs(st, branchtracker, print_classes, verbose);
+      c = c->_next;
+    }
+
+  }
+
+public:
+
+  LoaderTreeNode(const oop loader_oop)
+    : _loader_oop(loader_oop), _cld(NULL)
+    , _child(NULL), _next(NULL)
+    , _classes(NULL), _anon_classes(NULL)
+    , _num_classes(0), _num_anon_classes(0) {}
+
+  void set_cld(const ClassLoaderData* cld) {
+    _cld = cld;
+  }
+
+  void add_child(LoaderTreeNode* info) {
+    info->_next = _child;
+    _child = info;
+  }
+
+  void add_sibling(LoaderTreeNode* info) {
+    assert(info->_next == NULL, "must be");
+    info->_next = _next;
+    _next = info;
+  }
+
+  void add_classes(LoadedClassInfo* first_class, int num_classes, bool anonymous) {
+    LoadedClassInfo** p_list_to_add_to = anonymous ? &_anon_classes : &_classes;
+    // Search tail.
+    while ((*p_list_to_add_to) != NULL) {
+      p_list_to_add_to = &(*p_list_to_add_to)->_next;
+    }
+    *p_list_to_add_to = first_class;
+    if (anonymous) {
+      _num_anon_classes += num_classes;
+    } else {
+      _num_classes += num_classes;
+    }
+  }
+
+  const ClassLoaderData* cld() const {
+    return _cld;
+  }
+
+  const oop loader_oop() const {
+    return _loader_oop;
+  }
+
+  LoaderTreeNode* find(const oop loader_oop) {
+    LoaderTreeNode* result = NULL;
+    if (_loader_oop == loader_oop) {
+      result = this;
+    } else {
+      LoaderTreeNode* c = _child;
+      while (c != NULL && result == NULL) {
+        result = c->find(loader_oop);
+        c = c->_next;
+      }
+    }
+    return result;
+  }
+
+  void print_with_childs(outputStream* st, bool print_classes, bool print_add_info) const {
+    BranchTracker bwt;
+    print_with_childs(st, bwt, print_classes, print_add_info);
+  }
+
+};
+
+class LoadedClassCollectClosure : public KlassClosure {
+public:
+  LoadedClassInfo* _list;
+  const ClassLoaderData* _cld;
+  int _num_classes;
+  LoadedClassCollectClosure(const ClassLoaderData* cld)
+    : _list(NULL), _cld(cld), _num_classes(0) {}
+  void do_klass(Klass* k) {
+    LoadedClassInfo* lki = new LoadedClassInfo(k, _cld);
+    lki->_next = _list;
+    _list = lki;
+    _num_classes ++;
+  }
+};
+
+class LoaderInfoScanClosure : public CLDClosure {
+
+  const bool _print_classes;
+  const bool _verbose;
+  LoaderTreeNode* _root;
+
+  static void fill_in_classes(LoaderTreeNode* info, const ClassLoaderData* cld) {
+    assert(info != NULL && cld != NULL, "must be");
+    LoadedClassCollectClosure lccc(cld);
+    const_cast<ClassLoaderData*>(cld)->classes_do(&lccc);
+    if (lccc._num_classes > 0) {
+      info->add_classes(lccc._list, lccc._num_classes, cld->is_anonymous());
+    }
+  }
+
+  LoaderTreeNode* find_node_or_add_empty_node(oop loader_oop) {
+
+    assert(_root != NULL, "root node must exist");
+
+    if (loader_oop == NULL) {
+      return _root;
+    }
+
+    // Check if a node for this oop already exists.
+    LoaderTreeNode* info = _root->find(loader_oop);
+
+    if (info == NULL) {
+      // It does not. Create a node.
+      info = new LoaderTreeNode(loader_oop);
+
+      // Add it to tree.
+      LoaderTreeNode* parent_info = NULL;
+
+      // Recursively add parent nodes if needed.
+      const oop parent_oop = java_lang_ClassLoader::parent(loader_oop);
+      if (parent_oop == NULL) {
+        parent_info = _root;
+      } else {
+        parent_info = find_node_or_add_empty_node(parent_oop);
+      }
+      assert(parent_info != NULL, "must be");
+
+      parent_info->add_child(info);
+    }
+    return info;
+  }
+
+
+public:
+  LoaderInfoScanClosure(bool print_classes, bool verbose)
+    : _print_classes(print_classes), _verbose(verbose), _root(NULL) {
+    _root = new LoaderTreeNode(NULL);
+  }
+
+  void print_results(outputStream* st) const {
+    _root->print_with_childs(st, _print_classes, _verbose);
+  }
+
+  void do_cld (ClassLoaderData* cld) {
+
+    // We do not display unloading loaders, for now.
+    if (cld->is_unloading()) {
+      return;
+    }
+
+    const oop loader_oop = cld->class_loader();
+
+    LoaderTreeNode* info = find_node_or_add_empty_node(loader_oop);
+    assert(info != NULL, "must be");
+
+    // Update CLD in node, but only if this is the primary CLD for this loader.
+    if (cld->is_anonymous() == false) {
+      assert(info->cld() == NULL, "there should be only one primary CLD per loader");
+      info->set_cld(cld);
+    }
+
+    // Add classes.
+    fill_in_classes(info, cld);
+  }
+
+};
+
+
+class ClassLoaderHierarchyVMOperation : public VM_Operation {
+  outputStream* const _out;
+  const bool _show_classes;
+  const bool _verbose;
+public:
+  ClassLoaderHierarchyVMOperation(outputStream* out, bool show_classes, bool verbose) :
+    _out(out), _show_classes(show_classes), _verbose(verbose)
+  {}
+
+  VMOp_Type type() const {
+    return VMOp_ClassLoaderHierarchyOperation;
+  }
+
+  void doit() {
+    assert(SafepointSynchronize::is_at_safepoint(), "must be a safepoint");
+    ResourceMark rm;
+    LoaderInfoScanClosure cl (_show_classes, _verbose);
+    ClassLoaderDataGraph::cld_do(&cl);
+    cl.print_results(_out);
+  }
+};
+
+// This command needs to be executed at a safepoint.
+void ClassLoaderHierarchyDCmd::execute(DCmdSource source, TRAPS) {
+  ClassLoaderHierarchyVMOperation op(output(), _show_classes.value(), _verbose.value());
+  VMThread::execute(&op);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/classfile/classLoaderHierarchyDCmd.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018 SAP SE. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef HOTSPOT_SHARE_CLASSFILE_CLASSLOADERHIERARCHYDCMD_HPP_
+#define HOTSPOT_SHARE_CLASSFILE_CLASSLOADERHIERARCHYDCMD_HPP_
+
+#include "services/diagnosticCommand.hpp"
+
+class ClassLoaderHierarchyDCmd: public DCmdWithParser {
+  DCmdArgument<bool> _show_classes;
+  DCmdArgument<bool> _verbose;
+public:
+
+  ClassLoaderHierarchyDCmd(outputStream* output, bool heap);
+
+  static const char* name() {
+    return "VM.classloaders";
+  }
+
+  static const char* description() {
+    return "Prints classloader hierarchy.";
+  }
+  static const char* impact() {
+      return "Medium: Depends on number of class loaders and classes loaded.";
+  }
+  static const JavaPermission permission() {
+    JavaPermission p = {"java.lang.management.ManagementPermission",
+                        "monitor", NULL};
+    return p;
+  }
+  static int num_arguments();
+  virtual void execute(DCmdSource source, TRAPS);
+
+};
+
+#endif /* HOTSPOT_SHARE_CLASSFILE_CLASSLOADERHIERARCHYDCMD_HPP_ */
--- a/src/hotspot/share/classfile/dictionary.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/classfile/dictionary.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -35,7 +35,7 @@
 #include "memory/resourceArea.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/atomic.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/safepointVerifiers.hpp"
 #include "utilities/hashtable.inline.hpp"
 
--- a/src/hotspot/share/classfile/dictionary.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/classfile/dictionary.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -26,7 +26,7 @@
 #define SHARE_VM_CLASSFILE_DICTIONARY_INLINE_HPP
 
 #include "classfile/dictionary.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 
 inline ProtectionDomainEntry* DictionaryEntry::pd_set_acquire() const {
   return OrderAccess::load_acquire(&_pd_set);
--- a/src/hotspot/share/classfile/stringTable.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/classfile/stringTable.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -29,7 +29,10 @@
 #include "classfile/stringTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "gc/shared/collectedHeap.hpp"
+#include "gc/shared/oopStorage.inline.hpp"
+#include "gc/shared/oopStorageParState.inline.hpp"
 #include "logging/log.hpp"
+#include "logging/logStream.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/filemap.hpp"
 #include "memory/metaspaceShared.hpp"
@@ -38,171 +41,196 @@
 #include "oops/access.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/typeArrayOop.inline.hpp"
+#include "oops/weakHandle.inline.hpp"
 #include "runtime/atomic.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/safepointVerifiers.hpp"
+#include "runtime/timerTrace.hpp"
+#include "runtime/interfaceSupport.inline.hpp"
 #include "services/diagnosticCommand.hpp"
-#include "utilities/hashtable.inline.hpp"
+#include "utilities/concurrentHashTable.inline.hpp"
+#include "utilities/concurrentHashTableTasks.inline.hpp"
 #include "utilities/macros.hpp"
 
-// the number of buckets a thread claims
-const int ClaimChunkSize = 32;
-
-#ifdef ASSERT
-class StableMemoryChecker : public StackObj {
-  enum { _bufsize = wordSize*4 };
-
-  address _region;
-  jint    _size;
-  u1      _save_buf[_bufsize];
-
-  int sample(u1* save_buf) {
-    if (_size <= _bufsize) {
-      memcpy(save_buf, _region, _size);
-      return _size;
-    } else {
-      // copy head and tail
-      memcpy(&save_buf[0],          _region,                      _bufsize/2);
-      memcpy(&save_buf[_bufsize/2], _region + _size - _bufsize/2, _bufsize/2);
-      return (_bufsize/2)*2;
-    }
-  }
-
- public:
-  StableMemoryChecker(const void* region, jint size) {
-    _region = (address) region;
-    _size   = size;
-    sample(_save_buf);
-  }
-
-  bool verify() {
-    u1 check_buf[sizeof(_save_buf)];
-    int check_size = sample(check_buf);
-    return (0 == memcmp(_save_buf, check_buf, check_size));
-  }
-
-  void set_region(const void* region) { _region = (address) region; }
-};
-#endif
-
+// We prefer short chains of avg 2
+#define PREF_AVG_LIST_LEN   2
+// 2^24 is max size
+#define END_SIZE           24
+// If a chain gets to 32 something might be wrong
+#define REHASH_LEN         32
+// If we have as many dead items as 50% of the number of bucket
+#define CLEAN_DEAD_HIGH_WATER_MARK 0.5
 
 // --------------------------------------------------------------------------
 StringTable* StringTable::_the_table = NULL;
 bool StringTable::_shared_string_mapped = false;
-bool StringTable::_needs_rehashing = false;
-
-volatile int StringTable::_parallel_claimed_idx = 0;
-
 CompactHashtable<oop, char> StringTable::_shared_table;
+bool StringTable::_alt_hash = false;
 
-// Pick hashing algorithm
-unsigned int StringTable::hash_string(const jchar* s, int len) {
-  return use_alternate_hashcode() ? alt_hash_string(s, len) :
-                                    java_lang_String::hash_code(s, len);
-}
-
-unsigned int StringTable::alt_hash_string(const jchar* s, int len) {
-  return AltHashing::murmur3_32(seed(), s, len);
-}
+static juint murmur_seed = 0;
 
-unsigned int StringTable::hash_string(oop string) {
-  EXCEPTION_MARK;
-  if (string == NULL) {
-    return hash_string((jchar*)NULL, 0);
-  }
-  ResourceMark rm(THREAD);
-  // All String oops are hashed as unicode
-  int length;
-  jchar* chars = java_lang_String::as_unicode_string(string, length, THREAD);
-  if (chars != NULL) {
-    return hash_string(chars, length);
-  } else {
-    vm_exit_out_of_memory(length, OOM_MALLOC_ERROR, "unable to create Unicode string for verification");
-    return 0;
-  }
-}
-
-oop StringTable::string_object(HashtableEntry<oop, mtSymbol>* entry) {
-  return RootAccess<ON_PHANTOM_OOP_REF>::oop_load(entry->literal_addr());
-}
-
-oop StringTable::string_object_no_keepalive(HashtableEntry<oop, mtSymbol>* entry) {
-  // The AS_NO_KEEPALIVE peeks at the oop without keeping it alive.
-  // This is *very dangerous* in general but is okay in this specific
-  // case. The subsequent oop_load keeps the oop alive if it it matched
-  // the jchar* string.
-  return RootAccess<ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE>::oop_load(entry->literal_addr());
-}
-
-void StringTable::set_string_object(HashtableEntry<oop, mtSymbol>* entry, oop string) {
-  RootAccess<ON_PHANTOM_OOP_REF>::oop_store(entry->literal_addr(), string);
-}
-
-oop StringTable::lookup_shared(jchar* name, int len, unsigned int hash) {
-  assert(hash == java_lang_String::hash_code(name, len),
-         "hash must be computed using java_lang_String::hash_code");
-  return _shared_table.lookup((const char*)name, hash, len);
+uintx hash_string(const jchar* s, int len, bool useAlt) {
+  return  useAlt ?
+    AltHashing::murmur3_32(murmur_seed, s, len) :
+    java_lang_String::hash_code(s, len);
 }
 
-oop StringTable::lookup_in_main_table(int index, jchar* name,
-                                      int len, unsigned int hash) {
-  int count = 0;
-  for (HashtableEntry<oop, mtSymbol>* l = bucket(index); l != NULL; l = l->next()) {
-    count++;
-    if (l->hash() == hash) {
-      if (java_lang_String::equals(string_object_no_keepalive(l), name, len)) {
-        // We must perform a new load with string_object() that keeps the string
-        // alive as we must expose the oop as strongly reachable when exiting
-        // this context, in case the oop gets published.
-        return string_object(l);
-      }
+class StringTableConfig : public StringTableHash::BaseConfig {
+ private:
+ public:
+  static uintx get_hash(WeakHandle<vm_string_table_data> const& value,
+                        bool* is_dead) {
+    EXCEPTION_MARK;
+    oop val_oop = value.peek();
+    if (val_oop == NULL) {
+      *is_dead = true;
+      return 0;
+    }
+    *is_dead = false;
+    ResourceMark rm(THREAD);
+    // All String oops are hashed as unicode
+    int length;
+    jchar* chars = java_lang_String::as_unicode_string(val_oop, length, THREAD);
+    if (chars != NULL) {
+      return hash_string(chars, length, StringTable::_alt_hash);
     }
+    vm_exit_out_of_memory(length, OOM_MALLOC_ERROR, "get hash from oop");
+    return 0;
   }
-  // If the bucket size is too deep check if this hash code is insufficient.
-  if (count >= rehash_count && !needs_rehashing()) {
-    _needs_rehashing = check_rehash_table(count);
+  // We use default allocation/deallocation but counted
+  static void* allocate_node(size_t size,
+                             WeakHandle<vm_string_table_data> const& value) {
+    StringTable::item_added();
+    return StringTableHash::BaseConfig::allocate_node(size, value);
+  }
+  static void free_node(void* memory,
+                        WeakHandle<vm_string_table_data> const& value) {
+    value.release();
+    StringTableHash::BaseConfig::free_node(memory, value);
+    StringTable::item_removed();
+  }
+};
+
+class StringTableLookupJchar : StackObj {
+ private:
+  Thread* _thread;
+  uintx _hash;
+  int _len;
+  const jchar* _str;
+  Handle _found;
+
+ public:
+  StringTableLookupJchar(Thread* thread, uintx hash, const jchar* key, int len)
+    : _thread(thread), _hash(hash), _str(key), _len(len) {
+  }
+  uintx get_hash() const {
+    return _hash;
   }
-  return NULL;
+  bool equals(WeakHandle<vm_string_table_data>* value, bool* is_dead) {
+    oop val_oop = value->peek();
+    if (val_oop == NULL) {
+      // dead oop, mark this hash dead for cleaning
+      *is_dead = true;
+      return false;
+    }
+    bool equals = java_lang_String::equals(val_oop, (jchar*)_str, _len);
+    if (!equals) {
+      return false;
+    }
+    // Need to resolve weak handle and Handleize through possible safepoint.
+     _found = Handle(_thread, value->resolve());
+    return true;
+  }
+};
+
+class StringTableLookupOop : public StackObj {
+ private:
+  Thread* _thread;
+  uintx _hash;
+  Handle _find;
+  Handle _found;  // Might be a different oop with the same value that's already
+                  // in the table, which is the point.
+ public:
+  StringTableLookupOop(Thread* thread, uintx hash, Handle handle)
+    : _thread(thread), _hash(hash), _find(handle) { }
+
+  uintx get_hash() const {
+    return _hash;
+  }
+
+  bool equals(WeakHandle<vm_string_table_data>* value, bool* is_dead) {
+    oop val_oop = value->peek();
+    if (val_oop == NULL) {
+      // dead oop, mark this hash dead for cleaning
+      *is_dead = true;
+      return false;
+    }
+    bool equals = java_lang_String::equals(_find(), val_oop);
+    if (!equals) {
+      return false;
+    }
+    // Need to resolve weak handle and Handleize through possible safepoint.
+    _found = Handle(_thread, value->resolve());
+    return true;
+  }
+};
+
+static size_t ceil_pow_2(uintx val) {
+  size_t ret;
+  for (ret = 1; ((size_t)1 << ret) < val; ++ret);
+  return ret;
 }
 
-
-oop StringTable::basic_add(int index_arg, Handle string, jchar* name,
-                           int len, unsigned int hashValue_arg, TRAPS) {
-
-  assert(java_lang_String::equals(string(), name, len),
-         "string must be properly initialized");
-  // Cannot hit a safepoint in this function because the "this" pointer can move.
-  NoSafepointVerifier nsv;
+StringTable::StringTable() : _local_table(NULL), _current_size(0), _has_work(0),
+  _needs_rehashing(false), _weak_handles(NULL), _items(0), _uncleaned_items(0) {
+  _weak_handles = new OopStorage("StringTable weak",
+                                 StringTableWeakAlloc_lock,
+                                 StringTableWeakActive_lock);
+  size_t start_size_log_2 = ceil_pow_2(StringTableSize);
+  _current_size = ((size_t)1) << start_size_log_2;
+  log_trace(stringtable)("Start size: " SIZE_FORMAT " (" SIZE_FORMAT ")",
+                         _current_size, start_size_log_2);
+  _local_table = new StringTableHash(start_size_log_2, END_SIZE, REHASH_LEN);
+}
 
-  // Check if the symbol table has been rehashed, if so, need to recalculate
-  // the hash value and index before second lookup.
-  unsigned int hashValue;
-  int index;
-  if (use_alternate_hashcode()) {
-    hashValue = alt_hash_string(name, len);
-    index = hash_to_index(hashValue);
-  } else {
-    hashValue = hashValue_arg;
-    index = index_arg;
-  }
+size_t StringTable::item_added() {
+  return Atomic::add((size_t)1, &(the_table()->_items));
+}
 
-  // Since look-up was done lock-free, we need to check if another
-  // thread beat us in the race to insert the symbol.
-
-  // No need to lookup the shared table from here since the caller (intern()) already did
-  oop test = lookup_in_main_table(index, name, len, hashValue); // calls lookup(u1*, int)
-  if (test != NULL) {
-    // Entry already added
-    return test;
-  }
-
-  HashtableEntry<oop, mtSymbol>* entry = new_entry(hashValue, string());
-  add_entry(index, entry);
-  return string();
+size_t StringTable::items_to_clean(size_t ncl) {
+  size_t total = Atomic::add((size_t)ncl, &(the_table()->_uncleaned_items));
+  log_trace(stringtable)(
+     "Uncleaned items:" SIZE_FORMAT " added: " SIZE_FORMAT " total:" SIZE_FORMAT,
+     the_table()->_uncleaned_items, ncl, total);
+  return total;
 }
 
+void StringTable::item_removed() {
+  Atomic::add((size_t)-1, &(the_table()->_items));
+  Atomic::add((size_t)-1, &(the_table()->_uncleaned_items));
+}
 
+double StringTable::get_load_factor() {
+  return (_items*1.0)/_current_size;
+}
+
+double StringTable::get_dead_factor() {
+  return (_uncleaned_items*1.0)/_current_size;
+}
+
+size_t StringTable::table_size(Thread* thread) {
+  return ((size_t)(1)) << _local_table->get_size_log2(thread != NULL ? thread
+                                                      : Thread::current());
+}
+
+void StringTable::trigger_concurrent_work() {
+  MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
+  the_table()->_has_work = true;
+  Service_lock->notify_all();
+}
+
+// Probing
 oop StringTable::lookup(Symbol* symbol) {
   ResourceMark rm;
   int length;
@@ -211,71 +239,45 @@
 }
 
 oop StringTable::lookup(jchar* name, int len) {
-  // shared table always uses java_lang_String::hash_code
   unsigned int hash = java_lang_String::hash_code(name, len);
-  oop string = lookup_shared(name, len, hash);
+  oop string = StringTable::the_table()->lookup_shared(name, len, hash);
   if (string != NULL) {
     return string;
   }
-  if (use_alternate_hashcode()) {
-    hash = alt_hash_string(name, len);
+  if (StringTable::_alt_hash) {
+    hash = hash_string(name, len, true);
   }
-  int index = the_table()->hash_to_index(hash);
-  string = the_table()->lookup_in_main_table(index, name, len, hash);
-
-  return string;
+  return StringTable::the_table()->do_lookup(name, len, hash);
 }
 
-oop StringTable::intern(Handle string_or_null, jchar* name,
-                        int len, TRAPS) {
-  // shared table always uses java_lang_String::hash_code
-  unsigned int hashValue = java_lang_String::hash_code(name, len);
-  oop found_string = lookup_shared(name, len, hashValue);
-  if (found_string != NULL) {
-    return found_string;
-  }
-  if (use_alternate_hashcode()) {
-    hashValue = alt_hash_string(name, len);
+class StringTableGet : public StackObj {
+  Thread* _thread;
+  Handle  _return;
+ public:
+  StringTableGet(Thread* thread) : _thread(thread) {}
+  void operator()(WeakHandle<vm_string_table_data>* val) {
+    oop result = val->resolve();
+    assert(result != NULL, "Result should be reachable");
+    _return = Handle(_thread, result);
   }
-  int index = the_table()->hash_to_index(hashValue);
-  found_string = the_table()->lookup_in_main_table(index, name, len, hashValue);
-
-  // Found
-  if (found_string != NULL) {
-    return found_string;
+  oop get_res_oop() {
+    return _return();
   }
-
-  debug_only(StableMemoryChecker smc(name, len * sizeof(name[0])));
-  assert(!Universe::heap()->is_in_reserved(name),
-         "proposed name of symbol must be stable");
+};
 
-  HandleMark hm(THREAD);  // cleanup strings created
-  Handle string;
-  // try to reuse the string if possible
-  if (!string_or_null.is_null()) {
-    string = string_or_null;
-  } else {
-    string = java_lang_String::create_from_unicode(name, len, CHECK_NULL);
+oop StringTable::do_lookup(jchar* name, int len, uintx hash) {
+  Thread* thread = Thread::current();
+  StringTableLookupJchar lookup(thread, hash, name, len);
+  StringTableGet stg(thread);
+  bool rehash_warning;
+  _local_table->get(thread, lookup, stg, &rehash_warning);
+  if (rehash_warning) {
+    _needs_rehashing = true;
   }
-
-  // Deduplicate the string before it is interned. Note that we should never
-  // deduplicate a string after it has been interned. Doing so will counteract
-  // compiler optimizations done on e.g. interned string literals.
-  Universe::heap()->deduplicate_string(string());
-
-  // Grab the StringTable_lock before getting the_table() because it could
-  // change at safepoint.
-  oop added_or_found;
-  {
-    MutexLocker ml(StringTable_lock, THREAD);
-    // Otherwise, add to symbol to table
-    added_or_found = the_table()->basic_add(index, string, name, len,
-                                  hashValue, CHECK_NULL);
-  }
-
-  return added_or_found;
+  return stg.get_res_oop();
 }
 
+// Interning
 oop StringTable::intern(Symbol* symbol, TRAPS) {
   if (symbol == NULL) return NULL;
   ResourceMark rm(THREAD);
@@ -286,19 +288,17 @@
   return result;
 }
 
-
-oop StringTable::intern(oop string, TRAPS)
-{
+oop StringTable::intern(oop string, TRAPS) {
   if (string == NULL) return NULL;
   ResourceMark rm(THREAD);
   int length;
   Handle h_string (THREAD, string);
-  jchar* chars = java_lang_String::as_unicode_string(string, length, CHECK_NULL);
+  jchar* chars = java_lang_String::as_unicode_string(string, length,
+                                                     CHECK_NULL);
   oop result = intern(h_string, chars, length, CHECK_NULL);
   return result;
 }
 
-
 oop StringTable::intern(const char* utf8_string, TRAPS) {
   if (utf8_string == NULL) return NULL;
   ResourceMark rm(THREAD);
@@ -310,340 +310,449 @@
   return result;
 }
 
-void StringTable::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int* processed, int* removed) {
-  BucketUnlinkContext context;
-  buckets_unlink_or_oops_do(is_alive, f, 0, the_table()->table_size(), &context);
-  _the_table->bulk_free_entries(&context);
-  *processed = context._num_processed;
-  *removed = context._num_removed;
-}
-
-void StringTable::possibly_parallel_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int* processed, int* removed) {
-  // Readers of the table are unlocked, so we should only be removing
-  // entries at a safepoint.
-  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
-  const int limit = the_table()->table_size();
-
-  BucketUnlinkContext context;
-  for (;;) {
-    // Grab next set of buckets to scan
-    int start_idx = Atomic::add(ClaimChunkSize, &_parallel_claimed_idx) - ClaimChunkSize;
-    if (start_idx >= limit) {
-      // End of table
-      break;
-    }
-
-    int end_idx = MIN2(limit, start_idx + ClaimChunkSize);
-    buckets_unlink_or_oops_do(is_alive, f, start_idx, end_idx, &context);
+oop StringTable::intern(Handle string_or_null_h, jchar* name, int len, TRAPS) {
+  // shared table always uses java_lang_String::hash_code
+  unsigned int hash = java_lang_String::hash_code(name, len);
+  oop found_string = StringTable::the_table()->lookup_shared(name, len, hash);
+  if (found_string != NULL) {
+    return found_string;
   }
-  _the_table->bulk_free_entries(&context);
-  *processed = context._num_processed;
-  *removed = context._num_removed;
+  if (StringTable::_alt_hash) {
+    hash = hash_string(name, len, true);
+  }
+  return StringTable::the_table()->do_intern(string_or_null_h, name, len,
+                                             hash, CHECK_NULL);
 }
 
-void StringTable::buckets_oops_do(OopClosure* f, int start_idx, int end_idx) {
-  const int limit = the_table()->table_size();
+class StringTableCreateEntry : public StackObj {
+ private:
+   Thread* _thread;
+   Handle  _return;
+   Handle  _store;
+ public:
+  StringTableCreateEntry(Thread* thread, Handle store)
+    : _thread(thread), _store(store) {}
 
-  assert(0 <= start_idx && start_idx <= limit,
-         "start_idx (%d) is out of bounds", start_idx);
-  assert(0 <= end_idx && end_idx <= limit,
-         "end_idx (%d) is out of bounds", end_idx);
-  assert(start_idx <= end_idx,
-         "Index ordering: start_idx=%d, end_idx=%d",
-         start_idx, end_idx);
+  WeakHandle<vm_string_table_data> operator()() { // No dups found
+    WeakHandle<vm_string_table_data> wh =
+      WeakHandle<vm_string_table_data>::create(_store);
+    return wh;
+  }
+  void operator()(bool inserted, WeakHandle<vm_string_table_data>* val) {
+    oop result = val->resolve();
+    assert(result != NULL, "Result should be reachable");
+    _return = Handle(_thread, result);
+  }
+  oop get_return() const {
+    return _return();
+  }
+};
 
-  for (int i = start_idx; i < end_idx; i += 1) {
-    HashtableEntry<oop, mtSymbol>* entry = the_table()->bucket(i);
-    while (entry != NULL) {
-      assert(!entry->is_shared(), "CDS not used for the StringTable");
+oop StringTable::do_intern(Handle string_or_null_h, jchar* name,
+                           int len, uintx hash, TRAPS) {
+  HandleMark hm(THREAD);  // cleanup strings created
+  Handle string_h;
+
+  if (!string_or_null_h.is_null()) {
+    string_h = string_or_null_h;
+  } else {
+    string_h = java_lang_String::create_from_unicode(name, len, CHECK_NULL);
+  }
 
-      f->do_oop((oop*)entry->literal_addr());
+  // Deduplicate the string before it is interned. Note that we should never
+  // deduplicate a string after it has been interned. Doing so will counteract
+  // compiler optimizations done on e.g. interned string literals.
+  Universe::heap()->deduplicate_string(string_h());
 
-      entry = entry->next();
-    }
+  assert(java_lang_String::equals(string_h(), name, len),
+         "string must be properly initialized");
+  assert(len == java_lang_String::length(string_h()), "Must be same length");
+  StringTableLookupOop lookup(THREAD, hash, string_h);
+  StringTableCreateEntry stc(THREAD, string_h);
+
+  bool rehash_warning;
+  _local_table->get_insert_lazy(THREAD, lookup, stc, stc, &rehash_warning);
+  if (rehash_warning) {
+    _needs_rehashing = true;
   }
+  return stc.get_return();
 }
 
-void StringTable::buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, BucketUnlinkContext* context) {
-  const int limit = the_table()->table_size();
-
-  assert(0 <= start_idx && start_idx <= limit,
-         "start_idx (%d) is out of bounds", start_idx);
-  assert(0 <= end_idx && end_idx <= limit,
-         "end_idx (%d) is out of bounds", end_idx);
-  assert(start_idx <= end_idx,
-         "Index ordering: start_idx=%d, end_idx=%d",
-         start_idx, end_idx);
+// GC support
+class StringTableIsAliveCounter : public BoolObjectClosure {
+  BoolObjectClosure* _real_boc;
+ public:
+  size_t _count;
+  size_t _count_total;
+  StringTableIsAliveCounter(BoolObjectClosure* boc) : _real_boc(boc), _count(0),
+                                                      _count_total(0) {}
+  bool do_object_b(oop obj) {
+    bool ret = _real_boc->do_object_b(obj);
+    if (!ret) {
+      ++_count;
+    }
+    ++_count_total;
+    return ret;
+  }
+};
 
-  for (int i = start_idx; i < end_idx; ++i) {
-    HashtableEntry<oop, mtSymbol>** p = the_table()->bucket_addr(i);
-    HashtableEntry<oop, mtSymbol>* entry = the_table()->bucket(i);
-    while (entry != NULL) {
-      assert(!entry->is_shared(), "CDS not used for the StringTable");
+void StringTable::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f,
+                                    int* processed, int* removed) {
+  DoNothingClosure dnc;
+  assert(is_alive != NULL, "No closure");
+  StringTableIsAliveCounter stiac(is_alive);
+  OopClosure* tmp = f != NULL ? f : &dnc;
 
-      if (is_alive->do_object_b(string_object_no_keepalive(entry))) {
-        if (f != NULL) {
-          f->do_oop(entry->literal_addr());
-        }
-        p = entry->next_addr();
-      } else {
-        *p = entry->next();
-        context->free_entry(entry);
-      }
-      context->_num_processed++;
-      entry = *p;
-    }
+  StringTable::the_table()->_weak_handles->weak_oops_do(&stiac, tmp);
+
+  StringTable::the_table()->items_to_clean(stiac._count);
+  StringTable::the_table()->check_concurrent_work();
+  if (processed != NULL) {
+    *processed = (int) stiac._count_total;
+  }
+  if (removed != NULL) {
+    *removed = (int) stiac._count;
   }
 }
 
 void StringTable::oops_do(OopClosure* f) {
-  buckets_oops_do(f, 0, the_table()->table_size());
+  assert(f != NULL, "No closure");
+  StringTable::the_table()->_weak_handles->oops_do(f);
+}
+
+void StringTable::possibly_parallel_unlink(
+   OopStorage::ParState<false, false>* _par_state_string, BoolObjectClosure* cl,
+   int* processed, int* removed)
+{
+  DoNothingClosure dnc;
+  assert(cl != NULL, "No closure");
+  StringTableIsAliveCounter stiac(cl);
+
+  _par_state_string->weak_oops_do(&stiac, &dnc);
+
+  StringTable::the_table()->items_to_clean(stiac._count);
+  StringTable::the_table()->check_concurrent_work();
+  *processed = (int) stiac._count_total;
+  *removed = (int) stiac._count;
+}
+
+void StringTable::possibly_parallel_oops_do(
+   OopStorage::ParState<false /* concurrent */, false /* const */>*
+   _par_state_string, OopClosure* f)
+{
+  assert(f != NULL, "No closure");
+  _par_state_string->oops_do(f);
+}
+
+// Concurrent work
+void StringTable::grow(JavaThread* jt) {
+  StringTableHash::GrowTask gt(_local_table);
+  if (!gt.prepare(jt)) {
+    return;
+  }
+  log_trace(stringtable)("Started to grow");
+  {
+    TraceTime timer("Grow", TRACETIME_LOG(Debug, stringtable, perf));
+    while (gt.doTask(jt)) {
+      gt.pause(jt);
+      {
+        ThreadBlockInVM tbivm(jt);
+      }
+      gt.cont(jt);
+    }
+  }
+  gt.done(jt);
+  _current_size = table_size(jt);
+  log_debug(stringtable)("Grown to size:" SIZE_FORMAT, _current_size);
 }
 
-void StringTable::possibly_parallel_oops_do(OopClosure* f) {
-  const int limit = the_table()->table_size();
+struct StringTableDoDelete : StackObj {
+  long _count;
+  StringTableDoDelete() : _count(0) {}
+  void operator()(WeakHandle<vm_string_table_data>* val) {
+    ++_count;
+  }
+};
+
+struct StringTableDeleteCheck : StackObj {
+  long _count;
+  long _item;
+  StringTableDeleteCheck() : _count(0), _item(0) {}
+  bool operator()(WeakHandle<vm_string_table_data>* val) {
+    ++_item;
+    oop tmp = val->peek();
+    if (tmp == NULL) {
+      ++_count;
+      return true;
+    } else {
+      return false;
+    }
+  }
+};
 
-  for (;;) {
-    // Grab next set of buckets to scan
-    int start_idx = Atomic::add(ClaimChunkSize, &_parallel_claimed_idx) - ClaimChunkSize;
-    if (start_idx >= limit) {
-      // End of table
-      break;
+void StringTable::clean_dead_entries(JavaThread* jt) {
+  StringTableHash::BulkDeleteTask bdt(_local_table);
+  if (!bdt.prepare(jt)) {
+    return;
+  }
+
+  StringTableDeleteCheck stdc;
+  StringTableDoDelete stdd;
+  bool interrupted = false;
+  {
+    TraceTime timer("Clean", TRACETIME_LOG(Debug, stringtable, perf));
+    while(bdt.doTask(jt, stdc, stdd)) {
+      bdt.pause(jt);
+      {
+        ThreadBlockInVM tbivm(jt);
+      }
+      if (!bdt.cont(jt)) {
+        interrupted = true;
+        break;
+      }
     }
-
-    int end_idx = MIN2(limit, start_idx + ClaimChunkSize);
-    buckets_oops_do(f, start_idx, end_idx);
   }
+  if (interrupted) {
+    _has_work = true;
+  } else {
+    bdt.done(jt);
+  }
+  log_debug(stringtable)("Cleaned %ld of %ld", stdc._count, stdc._item);
 }
 
-// This verification is part of Universe::verify() and needs to be quick.
-// See StringTable::verify_and_compare() below for exhaustive verification.
-void StringTable::verify() {
-  for (int i = 0; i < the_table()->table_size(); ++i) {
-    HashtableEntry<oop, mtSymbol>* p = the_table()->bucket(i);
-    for ( ; p != NULL; p = p->next()) {
-      oop s = string_object_no_keepalive(p);
-      guarantee(s != NULL, "interned string is NULL");
-      unsigned int h = hash_string(s);
-      guarantee(p->hash() == h, "broken hash in string table entry");
-      guarantee(the_table()->hash_to_index(h) == i,
-                "wrong index in string table");
-    }
+void StringTable::check_concurrent_work() {
+  if (_has_work) {
+    return;
+  }
+  double load_factor = StringTable::get_load_factor();
+  double dead_factor = StringTable::get_dead_factor();
+  // We should clean/resize if we have more dead than alive,
+  // more items than preferred load factor or
+  // more dead items than water mark.
+  if ((dead_factor > load_factor) ||
+      (load_factor > PREF_AVG_LIST_LEN) ||
+      (dead_factor > CLEAN_DEAD_HIGH_WATER_MARK)) {
+    log_debug(stringtable)("Concurrent work triggered, live factor:%g dead factor:%g",
+                           load_factor, dead_factor);
+    trigger_concurrent_work();
   }
 }
 
-void StringTable::dump(outputStream* st, bool verbose) {
-  if (!verbose) {
-    the_table()->print_table_statistics(st, "StringTable", string_object_no_keepalive);
+void StringTable::concurrent_work(JavaThread* jt) {
+  _has_work = false;
+  double load_factor = get_load_factor();
+  log_debug(stringtable, perf)("Concurrent work, live factor: %g", load_factor);
+  // We prefer growing, since that also removes dead items
+  if (load_factor > PREF_AVG_LIST_LEN && !_local_table->is_max_size_reached()) {
+    grow(jt);
   } else {
-    Thread* THREAD = Thread::current();
-    st->print_cr("VERSION: 1.1");
-    for (int i = 0; i < the_table()->table_size(); ++i) {
-      HashtableEntry<oop, mtSymbol>* p = the_table()->bucket(i);
-      for ( ; p != NULL; p = p->next()) {
-        oop s = string_object_no_keepalive(p);
-        typeArrayOop value     = java_lang_String::value_no_keepalive(s);
-        int          length    = java_lang_String::length(s);
-        bool         is_latin1 = java_lang_String::is_latin1(s);
-
-        if (length <= 0) {
-          st->print("%d: ", length);
-        } else {
-          ResourceMark rm(THREAD);
-          int utf8_length = length;
-          char* utf8_string;
-
-          if (!is_latin1) {
-            jchar* chars = value->char_at_addr(0);
-            utf8_string = UNICODE::as_utf8(chars, utf8_length);
-          } else {
-            jbyte* bytes = value->byte_at_addr(0);
-            utf8_string = UNICODE::as_utf8(bytes, utf8_length);
-          }
-
-          st->print("%d: ", utf8_length);
-          HashtableTextDump::put_utf8(st, utf8_string, utf8_length);
-        }
-        st->cr();
-      }
-    }
+    clean_dead_entries(jt);
   }
 }
 
-StringTable::VerifyRetTypes StringTable::compare_entries(
-                                      int bkt1, int e_cnt1,
-                                      HashtableEntry<oop, mtSymbol>* e_ptr1,
-                                      int bkt2, int e_cnt2,
-                                      HashtableEntry<oop, mtSymbol>* e_ptr2) {
-  // These entries are sanity checked by verify_and_compare_entries()
-  // before this function is called.
-  oop str1 = string_object_no_keepalive(e_ptr1);
-  oop str2 = string_object_no_keepalive(e_ptr2);
+void StringTable::do_concurrent_work(JavaThread* jt) {
+  StringTable::the_table()->concurrent_work(jt);
+}
 
-  if (str1 == str2) {
-    tty->print_cr("ERROR: identical oop values (0x" PTR_FORMAT ") "
-                  "in entry @ bucket[%d][%d] and entry @ bucket[%d][%d]",
-                  p2i(str1), bkt1, e_cnt1, bkt2, e_cnt2);
-    return _verify_fail_continue;
+// Rehash
+bool StringTable::do_rehash() {
+  if (!_local_table->is_safepoint_safe()) {
+    return false;
   }
 
-  if (java_lang_String::equals(str1, str2)) {
-    tty->print_cr("ERROR: identical String values in entry @ "
-                  "bucket[%d][%d] and entry @ bucket[%d][%d]",
-                  bkt1, e_cnt1, bkt2, e_cnt2);
-    return _verify_fail_continue;
+  // We use max size
+  StringTableHash* new_table = new StringTableHash(END_SIZE, END_SIZE, REHASH_LEN);
+  // Use alt hash from now on
+  _alt_hash = true;
+  if (!_local_table->try_move_nodes_to(Thread::current(), new_table)) {
+    _alt_hash = false;
+    delete new_table;
+    return false;
   }
 
-  return _verify_pass;
+  // free old table
+  delete _local_table;
+  _local_table = new_table;
+
+  return true;
 }
 
-StringTable::VerifyRetTypes StringTable::verify_entry(int bkt, int e_cnt,
-                                                      HashtableEntry<oop, mtSymbol>* e_ptr,
-                                                      StringTable::VerifyMesgModes mesg_mode) {
-
-  VerifyRetTypes ret = _verify_pass;  // be optimistic
+void StringTable::try_rehash_table() {
+  static bool rehashed = false;
+  log_debug(stringtable)("Table imbalanced, rehashing called.");
 
-  oop str = string_object_no_keepalive(e_ptr);
-  if (str == NULL) {
-    if (mesg_mode == _verify_with_mesgs) {
-      tty->print_cr("ERROR: NULL oop value in entry @ bucket[%d][%d]", bkt,
-                    e_cnt);
-    }
-    // NULL oop means no more verifications are possible
-    return _verify_fail_done;
+  // Grow instead of rehash.
+  if (get_load_factor() > PREF_AVG_LIST_LEN &&
+      !_local_table->is_max_size_reached()) {
+    log_debug(stringtable)("Choosing growing over rehashing.");
+    trigger_concurrent_work();
+    _needs_rehashing = false;
+    return;
+  }
+  // Already rehashed.
+  if (rehashed) {
+    log_warning(stringtable)("Rehashing already done, still long lists.");
+    trigger_concurrent_work();
+    _needs_rehashing = false;
+    return;
   }
 
-  if (str->klass() != SystemDictionary::String_klass()) {
-    if (mesg_mode == _verify_with_mesgs) {
-      tty->print_cr("ERROR: oop is not a String in entry @ bucket[%d][%d]",
-                    bkt, e_cnt);
+  murmur_seed = AltHashing::compute_seed();
+  {
+    if (do_rehash()) {
+      rehashed = true;
+    } else {
+      log_info(stringtable)("Resizes in progress rehashing skipped.");
     }
-    // not a String means no more verifications are possible
-    return _verify_fail_done;
   }
+  _needs_rehashing = false;
+}
+
+void StringTable::rehash_table() {
+  StringTable::the_table()->try_rehash_table();
+}
 
-  unsigned int h = hash_string(str);
-  if (e_ptr->hash() != h) {
-    if (mesg_mode == _verify_with_mesgs) {
-      tty->print_cr("ERROR: broken hash value in entry @ bucket[%d][%d], "
-                    "bkt_hash=%d, str_hash=%d", bkt, e_cnt, e_ptr->hash(), h);
-    }
-    ret = _verify_fail_continue;
+// Statistics
+static int literal_size(oop obj) {
+  // NOTE: this would over-count if (pre-JDK8)
+  // java_lang_Class::has_offset_field() is true and the String.value array is
+  // shared by several Strings. However, starting from JDK8, the String.value
+  // array is not shared anymore.
+  if (obj == NULL) {
+    return 0;
+  } else if (obj->klass() == SystemDictionary::String_klass()) {
+    return (obj->size() + java_lang_String::value(obj)->size()) * HeapWordSize;
+  } else {
+    return obj->size();
   }
+}
 
-  if (the_table()->hash_to_index(h) != bkt) {
-    if (mesg_mode == _verify_with_mesgs) {
-      tty->print_cr("ERROR: wrong index value for entry @ bucket[%d][%d], "
-                    "str_hash=%d, hash_to_index=%d", bkt, e_cnt, h,
-                    the_table()->hash_to_index(h));
+struct SizeFunc : StackObj {
+  size_t operator()(WeakHandle<vm_string_table_data>* val) {
+    oop s = val->peek();
+    if (s == NULL) {
+      // Dead
+      return 0;
     }
-    ret = _verify_fail_continue;
-  }
+    return literal_size(s);
+  };
+};
 
-  return ret;
+void StringTable::print_table_statistics(outputStream* st,
+                                         const char* table_name) {
+  SizeFunc sz;
+  _local_table->statistics_to(Thread::current(), sz, st, table_name);
 }
 
-// See StringTable::verify() above for the quick verification that is
-// part of Universe::verify(). This verification is exhaustive and
-// reports on every issue that is found. StringTable::verify() only
-// reports on the first issue that is found.
-//
-// StringTable::verify_entry() checks:
-// - oop value != NULL (same as verify())
-// - oop value is a String
-// - hash(String) == hash in entry (same as verify())
-// - index for hash == index of entry (same as verify())
-//
-// StringTable::compare_entries() checks:
-// - oops are unique across all entries
-// - String values are unique across all entries
-//
-int StringTable::verify_and_compare_entries() {
-  assert(StringTable_lock->is_locked(), "sanity check");
+// Verification
+class VerifyStrings : StackObj {
+ public:
+  bool operator()(WeakHandle<vm_string_table_data>* val) {
+    oop s = val->peek();
+    if (s != NULL) {
+      assert(java_lang_String::length(s) >= 0, "Length on string must work.");
+    }
+    return true;
+  };
+};
+
+// This verification is part of Universe::verify() and needs to be quick.
+void StringTable::verify() {
+  Thread* thr = Thread::current();
+  VerifyStrings vs;
+  if (!the_table()->_local_table->try_scan(thr, vs)) {
+    log_info(stringtable)("verify unavailable at this moment");
+  }
+}
+
+// Verification and comp
+class VerifyCompStrings : StackObj {
+  GrowableArray<oop>* _oops;
+ public:
+  size_t _errors;
+  VerifyCompStrings(GrowableArray<oop>* oops) : _oops(oops), _errors(0) {}
+  bool operator()(WeakHandle<vm_string_table_data>* val) {
+    oop s = val->resolve();
+    if (s == NULL) {
+      return true;
+    }
+    int len = _oops->length();
+    for (int i = 0; i < len; i++) {
+      bool eq = java_lang_String::equals(s, _oops->at(i));
+      assert(!eq, "Duplicate strings");
+      if (eq) {
+        _errors++;
+      }
+    }
+    _oops->push(s);
+    return true;
+  };
+};
+
+size_t StringTable::verify_and_compare_entries() {
+  Thread* thr = Thread::current();
+  GrowableArray<oop>* oops =
+    new (ResourceObj::C_HEAP, mtInternal)
+      GrowableArray<oop>((int)the_table()->_current_size, true);
 
-  int  fail_cnt = 0;
+  VerifyCompStrings vcs(oops);
+  if (!the_table()->_local_table->try_scan(thr, vcs)) {
+    log_info(stringtable)("verify unavailable at this moment");
+  }
+  delete oops;
+  return vcs._errors;
+}
+
+// Dumping
+class PrintString : StackObj {
+  Thread* _thr;
+  outputStream* _st;
+ public:
+  PrintString(Thread* thr, outputStream* st) : _thr(thr), _st(st) {}
+  bool operator()(WeakHandle<vm_string_table_data>* val) {
+    oop s = val->peek();
+    if (s == NULL) {
+      return true;
+    }
+    typeArrayOop value     = java_lang_String::value_no_keepalive(s);
+    int          length    = java_lang_String::length(s);
+    bool         is_latin1 = java_lang_String::is_latin1(s);
 
-  // first, verify all the entries individually:
-  for (int bkt = 0; bkt < the_table()->table_size(); bkt++) {
-    HashtableEntry<oop, mtSymbol>* e_ptr = the_table()->bucket(bkt);
-    for (int e_cnt = 0; e_ptr != NULL; e_ptr = e_ptr->next(), e_cnt++) {
-      VerifyRetTypes ret = verify_entry(bkt, e_cnt, e_ptr, _verify_with_mesgs);
-      if (ret != _verify_pass) {
-        fail_cnt++;
+    if (length <= 0) {
+      _st->print("%d: ", length);
+    } else {
+      ResourceMark rm(_thr);
+      int utf8_length = length;
+      char* utf8_string;
+
+      if (!is_latin1) {
+        jchar* chars = value->char_at_addr(0);
+        utf8_string = UNICODE::as_utf8(chars, utf8_length);
+      } else {
+        jbyte* bytes = value->byte_at_addr(0);
+        utf8_string = UNICODE::as_utf8(bytes, utf8_length);
       }
+
+      _st->print("%d: ", utf8_length);
+      HashtableTextDump::put_utf8(_st, utf8_string, utf8_length);
+    }
+    _st->cr();
+    return true;
+  };
+};
+
+void StringTable::dump(outputStream* st, bool verbose) {
+  if (!verbose) {
+    the_table()->print_table_statistics(st, "StringTable");
+  } else {
+    Thread* thr = Thread::current();
+    ResourceMark rm(thr);
+    st->print_cr("VERSION: 1.1");
+    PrintString ps(thr, st);
+    if (!the_table()->_local_table->try_scan(thr, ps)) {
+      st->print_cr("dump unavailable at this moment");
     }
   }
-
-  // Optimization: if the above check did not find any failures, then
-  // the comparison loop below does not need to call verify_entry()
-  // before calling compare_entries(). If there were failures, then we
-  // have to call verify_entry() to see if the entry can be passed to
-  // compare_entries() safely. When we call verify_entry() in the loop
-  // below, we do so quietly to void duplicate messages and we don't
-  // increment fail_cnt because the failures have already been counted.
-  bool need_entry_verify = (fail_cnt != 0);
-
-  // second, verify all entries relative to each other:
-  for (int bkt1 = 0; bkt1 < the_table()->table_size(); bkt1++) {
-    HashtableEntry<oop, mtSymbol>* e_ptr1 = the_table()->bucket(bkt1);
-    for (int e_cnt1 = 0; e_ptr1 != NULL; e_ptr1 = e_ptr1->next(), e_cnt1++) {
-      if (need_entry_verify) {
-        VerifyRetTypes ret = verify_entry(bkt1, e_cnt1, e_ptr1,
-                                          _verify_quietly);
-        if (ret == _verify_fail_done) {
-          // cannot use the current entry to compare against other entries
-          continue;
-        }
-      }
-
-      for (int bkt2 = bkt1; bkt2 < the_table()->table_size(); bkt2++) {
-        HashtableEntry<oop, mtSymbol>* e_ptr2 = the_table()->bucket(bkt2);
-        int e_cnt2;
-        for (e_cnt2 = 0; e_ptr2 != NULL; e_ptr2 = e_ptr2->next(), e_cnt2++) {
-          if (bkt1 == bkt2 && e_cnt2 <= e_cnt1) {
-            // skip the entries up to and including the one that
-            // we're comparing against
-            continue;
-          }
-
-          if (need_entry_verify) {
-            VerifyRetTypes ret = verify_entry(bkt2, e_cnt2, e_ptr2,
-                                              _verify_quietly);
-            if (ret == _verify_fail_done) {
-              // cannot compare against this entry
-              continue;
-            }
-          }
-
-          // compare two entries, report and count any failures:
-          if (compare_entries(bkt1, e_cnt1, e_ptr1, bkt2, e_cnt2, e_ptr2)
-              != _verify_pass) {
-            fail_cnt++;
-          }
-        }
-      }
-    }
-  }
-  return fail_cnt;
-}
-
-// Create a new table and using alternate hash code, populate the new table
-// with the existing strings.   Set flag to use the alternate hash code afterwards.
-void StringTable::rehash_table() {
-  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
-  // This should never happen with -Xshare:dump but it might in testing mode.
-  if (DumpSharedSpaces) return;
-  StringTable* new_table = new StringTable();
-
-  // Rehash the table
-  the_table()->move_to(new_table);
-
-  // Delete the table and buckets (entries are reused in new table).
-  delete _the_table;
-  // Don't check if we need rehashing until the table gets unbalanced again.
-  // Then rehash with a new global seed.
-  _needs_rehashing = false;
-  _the_table = new_table;
 }
 
 // Utility for dumping strings
@@ -671,14 +780,21 @@
   }
 }
 
+// Sharing
 #if INCLUDE_CDS_JAVA_HEAP
-// Sharing
+oop StringTable::lookup_shared(jchar* name, int len, unsigned int hash) {
+  assert(hash == java_lang_String::hash_code(name, len),
+         "hash must be computed using java_lang_String::hash_code");
+  return _shared_table.lookup((const char*)name, hash, len);
+}
+
 oop StringTable::create_archived_string(oop s, Thread* THREAD) {
   assert(DumpSharedSpaces, "this function is only used with -Xshare:dump");
 
   oop new_s = NULL;
   typeArrayOop v = java_lang_String::value_no_keepalive(s);
-  typeArrayOop new_v = (typeArrayOop)MetaspaceShared::archive_heap_object(v, THREAD);
+  typeArrayOop new_v =
+    (typeArrayOop)MetaspaceShared::archive_heap_object(v, THREAD);
   if (new_v == NULL) {
     return NULL;
   }
@@ -692,51 +808,51 @@
   return new_s;
 }
 
-bool StringTable::copy_shared_string(GrowableArray<MemRegion> *string_space,
-                                     CompactStringTableWriter* writer) {
+struct CopyToArchive : StackObj {
+  CompactStringTableWriter* _writer;
+  CopyToArchive(CompactStringTableWriter* writer) : _writer(writer) {}
+  bool operator()(WeakHandle<vm_string_table_data>* val) {
+    oop s = val->peek();
+    if (s == NULL) {
+      return true;
+    }
+    unsigned int hash = java_lang_String::hash_code(s);
+    if (hash == 0) {
+      return true;
+    }
+
+    java_lang_String::set_hash(s, hash);
+    oop new_s = StringTable::create_archived_string(s, Thread::current());
+    if (new_s == NULL) {
+      return true;
+    }
+
+    val->replace(new_s);
+    // add to the compact table
+    _writer->add(hash, new_s);
+    return true;
+  }
+};
+
+void StringTable::copy_shared_string_table(CompactStringTableWriter* writer) {
   assert(MetaspaceShared::is_heap_object_archiving_allowed(), "must be");
 
-  Thread* THREAD = Thread::current();
-  for (int i = 0; i < the_table()->table_size(); ++i) {
-    HashtableEntry<oop, mtSymbol>* bucket = the_table()->bucket(i);
-    for ( ; bucket != NULL; bucket = bucket->next()) {
-      oop s = string_object_no_keepalive(bucket);
-      unsigned int hash = java_lang_String::hash_code(s);
-      if (hash == 0) {
-        continue;
-      }
-
-      java_lang_String::set_hash(s, hash);
-      oop new_s = create_archived_string(s, THREAD);
-      if (new_s == NULL) {
-        continue;
-      }
-
-      // set the archived string in bucket
-      set_string_object(bucket, new_s);
-
-      // add to the compact table
-      writer->add(hash, new_s);
-    }
-  }
-
-  return true;
+  CopyToArchive copy(writer);
+  StringTable::the_table()->_local_table->do_scan(Thread::current(), copy);
 }
 
-void StringTable::write_to_archive(GrowableArray<MemRegion> *string_space) {
+void StringTable::write_to_archive() {
   assert(MetaspaceShared::is_heap_object_archiving_allowed(), "must be");
 
   _shared_table.reset();
-  int num_buckets = the_table()->number_of_entries() /
-                         SharedSymbolTableBucketSize;
+  int num_buckets = the_table()->_items / SharedSymbolTableBucketSize;
   // calculation of num_buckets can result in zero buckets, we need at least one
   CompactStringTableWriter writer(num_buckets > 1 ? num_buckets : 1,
                                   &MetaspaceShared::stats()->string);
 
   // Copy the interned strings into the "string space" within the java heap
-  if (copy_shared_string(string_space, &writer)) {
-    writer.dump(&_shared_table);
-  }
+  copy_shared_string_table(&writer);
+  writer.dump(&_shared_table);
 }
 
 void StringTable::serialize(SerializeClosure* soc) {
@@ -744,7 +860,8 @@
   _shared_table.serialize(soc);
 
   if (soc->writing()) {
-    _shared_table.reset(); // Sanity. Make sure we don't use the shared table at dump time
+    // Sanity. Make sure we don't use the shared table at dump time
+    _shared_table.reset();
   } else if (!_shared_string_mapped) {
     _shared_table.reset();
   }
--- a/src/hotspot/share/classfile/stringTable.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/classfile/stringTable.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -25,109 +25,111 @@
 #ifndef SHARE_VM_CLASSFILE_STRINGTABLE_HPP
 #define SHARE_VM_CLASSFILE_STRINGTABLE_HPP
 
-#include "utilities/hashtable.hpp"
+#include "gc/shared/oopStorage.hpp"
+#include "gc/shared/oopStorageParState.hpp"
+#include "memory/allocation.hpp"
+#include "memory/padded.hpp"
+#include "oops/oop.hpp"
+#include "oops/weakHandle.hpp"
+#include "utilities/concurrentHashTable.hpp"
 
 template <class T, class N> class CompactHashtable;
 class CompactStringTableWriter;
-class FileMapInfo;
 class SerializeClosure;
 
-class StringTable : public RehashableHashtable<oop, mtSymbol> {
+class StringTable;
+class StringTableConfig;
+typedef ConcurrentHashTable<WeakHandle<vm_string_table_data>,
+                            StringTableConfig, mtSymbol> StringTableHash;
+
+class StringTableCreateEntry;
+
+class StringTable : public CHeapObj<mtSymbol>{
   friend class VMStructs;
   friend class Symbol;
+  friend class StringTableConfig;
+  friend class StringTableCreateEntry;
 
 private:
+  void grow(JavaThread* jt);
+  void clean_dead_entries(JavaThread* jt);
+
   // The string table
   static StringTable* _the_table;
-
   // Shared string table
   static CompactHashtable<oop, char> _shared_table;
   static bool _shared_string_mapped;
+  static bool _alt_hash;
+private:
 
-  // Set if one bucket is out of balance due to hash algorithm deficiency
-  static bool _needs_rehashing;
-
-  // Claimed high water mark for parallel chunked scanning
-  static volatile int _parallel_claimed_idx;
+   // Set if one bucket is out of balance due to hash algorithm deficiency
+  StringTableHash* _local_table;
+  size_t _current_size;
+  volatile bool _has_work;
+  volatile bool _needs_rehashing;
 
-  static oop intern(Handle string_or_null, jchar* chars, int length, TRAPS);
-  oop basic_add(int index, Handle string_or_null, jchar* name, int len,
-                unsigned int hashValue, TRAPS);
+  OopStorage* _weak_handles;
 
-  oop lookup_in_main_table(int index, jchar* chars, int length, unsigned int hashValue);
-  static oop lookup_shared(jchar* name, int len, unsigned int hash);
+  volatile size_t _items;
+  DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile size_t));
+  volatile size_t _uncleaned_items;
+  DEFINE_PAD_MINUS_SIZE(2, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile size_t));
 
-  // Apply the give oop closure to the entries to the buckets
-  // in the range [start_idx, end_idx).
-  static void buckets_oops_do(OopClosure* f, int start_idx, int end_idx);
+  double get_load_factor();
+  double get_dead_factor();
 
-  typedef StringTable::BucketUnlinkContext BucketUnlinkContext;
-  // Unlink or apply the give oop closure to the entries to the buckets
-  // in the range [start_idx, end_idx). Unlinked bucket entries are collected in the given
-  // context to be freed later.
-  // This allows multiple threads to work on the table at once.
-  static void buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, BucketUnlinkContext* context);
+  void check_concurrent_work();
+  void trigger_concurrent_work();
 
-  // Hashing algorithm, used as the hash value used by the
-  //     StringTable for bucket selection and comparison (stored in the
-  //     HashtableEntry structures).  This is used in the String.intern() method.
-  static unsigned int hash_string(const jchar* s, int len);
-  static unsigned int hash_string(oop string);
-  static unsigned int alt_hash_string(const jchar* s, int len);
+  static uintx item_added();
+  static void item_removed();
+  static size_t items_to_clean(size_t ncl);
+
+  StringTable();
 
-  // Accessors for the string roots in the hashtable entries.
-  // Use string_object_no_keepalive() only when the value is not returned
-  // outside of a scope where a thread transition is possible.
-  static oop string_object(HashtableEntry<oop, mtSymbol>* entry);
-  static oop string_object_no_keepalive(HashtableEntry<oop, mtSymbol>* entry);
-  static void set_string_object(HashtableEntry<oop, mtSymbol>* entry, oop string);
+  static oop intern(Handle string_or_null_h, jchar* name, int len, TRAPS);
+  oop do_intern(Handle string_or_null, jchar* name, int len, uintx hash, TRAPS);
+  oop do_lookup(jchar* name, int len, uintx hash);
 
-  StringTable() : RehashableHashtable<oop, mtSymbol>((int)StringTableSize,
-                              sizeof (HashtableEntry<oop, mtSymbol>)) {}
+  void concurrent_work(JavaThread* jt);
+  void print_table_statistics(outputStream* st, const char* table_name);
 
-  StringTable(HashtableBucket<mtSymbol>* t, int number_of_entries)
-    : RehashableHashtable<oop, mtSymbol>((int)StringTableSize, sizeof (HashtableEntry<oop, mtSymbol>), t,
-                     number_of_entries) {}
-public:
+  void try_rehash_table();
+  bool do_rehash();
+
+ public:
   // The string table
   static StringTable* the_table() { return _the_table; }
+  size_t table_size(Thread* thread = NULL);
 
-  // Size of one bucket in the string table.  Used when checking for rollover.
-  static uint bucket_size() { return sizeof(HashtableBucket<mtSymbol>); }
+  static OopStorage* weak_storage() { return the_table()->_weak_handles; }
 
   static void create_table() {
     assert(_the_table == NULL, "One string table allowed.");
     _the_table = new StringTable();
   }
 
+  static void do_concurrent_work(JavaThread* jt);
+  static bool has_work() { return the_table()->_has_work; }
+
   // GC support
   //   Delete pointers to otherwise-unreachable objects.
-  static void unlink_or_oops_do(BoolObjectClosure* cl, OopClosure* f) {
-    int processed = 0;
-    int removed = 0;
-    unlink_or_oops_do(cl, f, &processed, &removed);
+  static void unlink(BoolObjectClosure* cl) {
+    unlink_or_oops_do(cl);
   }
-  static void unlink(BoolObjectClosure* cl) {
-    int processed = 0;
-    int removed = 0;
-    unlink_or_oops_do(cl, NULL, &processed, &removed);
-  }
-  static void unlink_or_oops_do(BoolObjectClosure* cl, OopClosure* f, int* processed, int* removed);
-  static void unlink(BoolObjectClosure* cl, int* processed, int* removed) {
-    unlink_or_oops_do(cl, NULL, processed, removed);
-  }
+  static void unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f = NULL,
+                                int* processed = NULL, int* removed = NULL);
+
   // Serially invoke "f->do_oop" on the locations of all oops in the table.
   static void oops_do(OopClosure* f);
 
   // Possibly parallel versions of the above
-  static void possibly_parallel_unlink_or_oops_do(BoolObjectClosure* cl, OopClosure* f, int* processed, int* removed);
-  static void possibly_parallel_unlink(BoolObjectClosure* cl, int* processed, int* removed) {
-    possibly_parallel_unlink_or_oops_do(cl, NULL, processed, removed);
-  }
-  static void possibly_parallel_oops_do(OopClosure* f);
-
-  // Internal test.
-  static void test_alt_hash() PRODUCT_RETURN;
+  static void possibly_parallel_unlink(
+     OopStorage::ParState<false /* concurrent */, false /* const*/>* par_state_string,
+     BoolObjectClosure* cl, int* processed, int* removed);
+  static void possibly_parallel_oops_do(
+     OopStorage::ParState<false /* concurrent */, false /* const*/>* par_state_string,
+     OopClosure* f);
 
   // Probing
   static oop lookup(Symbol* symbol);
@@ -138,46 +140,28 @@
   static oop intern(oop string, TRAPS);
   static oop intern(const char *utf8_string, TRAPS);
 
-  // Debugging
-  static void verify();
-  static void dump(outputStream* st, bool verbose=false);
-
-  enum VerifyMesgModes {
-    _verify_quietly    = 0,
-    _verify_with_mesgs = 1
-  };
-
-  enum VerifyRetTypes {
-    _verify_pass          = 0,
-    _verify_fail_continue = 1,
-    _verify_fail_done     = 2
-  };
-
-  static VerifyRetTypes compare_entries(int bkt1, int e_cnt1,
-                                        HashtableEntry<oop, mtSymbol>* e_ptr1,
-                                        int bkt2, int e_cnt2,
-                                        HashtableEntry<oop, mtSymbol>* e_ptr2);
-  static VerifyRetTypes verify_entry(int bkt, int e_cnt,
-                                     HashtableEntry<oop, mtSymbol>* e_ptr,
-                                     VerifyMesgModes mesg_mode);
-  static int verify_and_compare_entries();
+  // Rehash the string table if it gets out of balance
+  static void rehash_table();
+  static bool needs_rehashing()
+    { return StringTable::the_table()->_needs_rehashing; }
 
   // Sharing
+ private:
+  oop lookup_shared(jchar* name, int len, unsigned int hash) NOT_CDS_JAVA_HEAP_RETURN_(NULL);
+  static void copy_shared_string_table(CompactStringTableWriter* ch_table) NOT_CDS_JAVA_HEAP_RETURN;
+ public:
+  static oop create_archived_string(oop s, Thread* THREAD);
   static void set_shared_string_mapped() { _shared_string_mapped = true; }
   static bool shared_string_mapped()       { return _shared_string_mapped; }
   static void shared_oops_do(OopClosure* f) NOT_CDS_JAVA_HEAP_RETURN;
-  static bool copy_shared_string(GrowableArray<MemRegion> *string_space,
-                                 CompactStringTableWriter* ch_table) NOT_CDS_JAVA_HEAP_RETURN_(false);
-  static oop  create_archived_string(oop s, Thread* THREAD) NOT_CDS_JAVA_HEAP_RETURN_(NULL);
-  static void write_to_archive(GrowableArray<MemRegion> *string_space) NOT_CDS_JAVA_HEAP_RETURN;
+  static void write_to_archive() NOT_CDS_JAVA_HEAP_RETURN;
   static void serialize(SerializeClosure* soc) NOT_CDS_JAVA_HEAP_RETURN;
 
-  // Rehash the symbol table if it gets out of balance
-  static void rehash_table();
-  static bool needs_rehashing() { return _needs_rehashing; }
+  // Jcmd
+  static void dump(outputStream* st, bool verbose=false);
+  // Debugging
+  static size_t verify_and_compare_entries();
+  static void verify();
+};
 
-  // Parallel chunked scanning
-  static void clear_parallel_claimed_index() { _parallel_claimed_idx = 0; }
-  static int parallel_claimed_index() { return _parallel_claimed_idx; }
-};
 #endif // SHARE_VM_CLASSFILE_STRINGTABLE_HPP
--- a/src/hotspot/share/classfile/systemDictionary.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/classfile/systemDictionary.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -76,7 +76,7 @@
 #include "runtime/java.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/mutexLocker.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/signature.hpp"
 #include "services/classLoadingService.hpp"
--- a/src/hotspot/share/classfile/verifier.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/classfile/verifier.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -47,7 +47,7 @@
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/jniHandles.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/os.hpp"
 #include "runtime/safepointVerifiers.hpp"
 #include "runtime/thread.hpp"
--- a/src/hotspot/share/code/nmethod.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/code/nmethod.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -51,7 +51,7 @@
 #include "runtime/frame.inline.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/jniHandles.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/os.hpp"
 #include "runtime/safepointVerifiers.hpp"
 #include "runtime/sharedRuntime.hpp"
--- a/src/hotspot/share/gc/cms/adaptiveFreeList.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/cms/adaptiveFreeList.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -29,7 +29,7 @@
 #include "memory/freeList.inline.hpp"
 #include "runtime/globals.hpp"
 #include "runtime/mutex.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/vmThread.hpp"
 
 template <>
--- a/src/hotspot/share/gc/cms/cmsCardTable.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/cms/cmsCardTable.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -34,7 +34,7 @@
 #include "oops/oop.inline.hpp"
 #include "runtime/java.hpp"
 #include "runtime/mutexLocker.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/vmThread.hpp"
 
 CMSCardTable::CMSCardTable(MemRegion whole_heap) :
--- a/src/hotspot/share/gc/cms/cmsHeap.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/cms/cmsHeap.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -220,13 +220,14 @@
                                 ScanningOption so,
                                 bool only_strong_roots,
                                 OopsInGenClosure* root_closure,
-                                CLDClosure* cld_closure) {
+                                CLDClosure* cld_closure,
+                                OopStorage::ParState<false, false>* par_state_string) {
   MarkingCodeBlobClosure mark_code_closure(root_closure, !CodeBlobToOopClosure::FixRelocations);
   CLDClosure* weak_cld_closure = only_strong_roots ? NULL : cld_closure;
 
   process_roots(scope, so, root_closure, cld_closure, weak_cld_closure, &mark_code_closure);
   if (!only_strong_roots) {
-    process_string_table_roots(scope, root_closure);
+    process_string_table_roots(scope, root_closure, par_state_string);
   }
 
   if (young_gen_as_roots &&
--- a/src/hotspot/share/gc/cms/cmsHeap.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/cms/cmsHeap.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -30,6 +30,7 @@
 #include "gc/shared/collectedHeap.hpp"
 #include "gc/shared/gcCause.hpp"
 #include "gc/shared/genCollectedHeap.hpp"
+#include "gc/shared/oopStorageParState.hpp"
 #include "utilities/growableArray.hpp"
 
 class CLDClosure;
@@ -90,7 +91,8 @@
                          ScanningOption so,
                          bool only_strong_roots,
                          OopsInGenClosure* root_closure,
-                         CLDClosure* cld_closure);
+                         CLDClosure* cld_closure,
+                         OopStorage::ParState<false, false>* par_state_string = NULL);
 
   GCMemoryManager* old_manager() const { return _old_manager; }
 
--- a/src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -45,7 +45,7 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/init.hpp"
 #include "runtime/java.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/vmThread.hpp"
 #include "utilities/align.hpp"
 #include "utilities/copy.hpp"
--- a/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -54,6 +54,7 @@
 #include "gc/shared/genCollectedHeap.hpp"
 #include "gc/shared/genOopClosures.inline.hpp"
 #include "gc/shared/isGCActiveMark.hpp"
+#include "gc/shared/oopStorageParState.hpp"
 #include "gc/shared/referencePolicy.hpp"
 #include "gc/shared/space.inline.hpp"
 #include "gc/shared/strongRootsScope.hpp"
@@ -74,7 +75,7 @@
 #include "runtime/globals_extension.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/java.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/timer.hpp"
 #include "runtime/vmThread.hpp"
 #include "services/memoryService.hpp"
@@ -2769,10 +2770,12 @@
  protected:
   CMSCollector*     _collector;
   uint              _n_workers;
+  OopStorage::ParState<false, false> _par_state_string;
   CMSParMarkTask(const char* name, CMSCollector* collector, uint n_workers) :
       AbstractGangTask(name),
       _collector(collector),
-      _n_workers(n_workers) {}
+      _n_workers(n_workers),
+      _par_state_string(StringTable::weak_storage()) {}
   // Work method in support of parallel rescan ... of young gen spaces
   void do_young_space_rescan(OopsInGenClosure* cl,
                              ContiguousSpace* space,
@@ -4274,7 +4277,9 @@
                           GenCollectedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
                           _collector->should_unload_classes(),
                           &par_mri_cl,
-                          &cld_closure);
+                          &cld_closure,
+                          &_par_state_string);
+
   assert(_collector->should_unload_classes()
          || (_collector->CMSCollector::roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache),
          "if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
@@ -4403,7 +4408,8 @@
                           GenCollectedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
                           _collector->should_unload_classes(),
                           &par_mrias_cl,
-                          NULL);     // The dirty klasses will be handled below
+                          NULL,     // The dirty klasses will be handled below
+                          &_par_state_string);
 
   assert(_collector->should_unload_classes()
          || (_collector->CMSCollector::roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache),
--- a/src/hotspot/share/gc/cms/parNewGeneration.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/cms/parNewGeneration.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/stringTable.hpp"
 #include "gc/cms/cmsHeap.inline.hpp"
 #include "gc/cms/compactibleFreeListSpace.hpp"
 #include "gc/cms/concurrentMarkSweepGeneration.hpp"
@@ -589,7 +590,8 @@
     _young_gen(young_gen), _old_gen(old_gen),
     _young_old_boundary(young_old_boundary),
     _state_set(state_set),
-    _strong_roots_scope(strong_roots_scope)
+    _strong_roots_scope(strong_roots_scope),
+    _par_state_string(StringTable::weak_storage())
 {}
 
 void ParNewGenTask::work(uint worker_id) {
@@ -611,7 +613,8 @@
   heap->young_process_roots(_strong_roots_scope,
                            &par_scan_state.to_space_root_closure(),
                            &par_scan_state.older_gen_closure(),
-                           &cld_scan_closure);
+                           &cld_scan_closure,
+                           &_par_state_string);
 
   par_scan_state.end_strong_roots();
 
--- a/src/hotspot/share/gc/cms/parNewGeneration.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/cms/parNewGeneration.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -29,6 +29,7 @@
 #include "gc/serial/defNewGeneration.hpp"
 #include "gc/shared/copyFailedInfo.hpp"
 #include "gc/shared/gcTrace.hpp"
+#include "gc/shared/oopStorageParState.hpp"
 #include "gc/shared/plab.hpp"
 #include "gc/shared/preservedMarks.hpp"
 #include "gc/shared/taskqueue.hpp"
@@ -236,6 +237,7 @@
   HeapWord*                    _young_old_boundary;
   class ParScanThreadStateSet* _state_set;
   StrongRootsScope*            _strong_roots_scope;
+  OopStorage::ParState<false, false> _par_state_string;
 
 public:
   ParNewGenTask(ParNewGeneration*      young_gen,
--- a/src/hotspot/share/gc/g1/collectionSetChooser.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/g1/collectionSetChooser.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -147,7 +147,7 @@
 void CollectionSetChooser::add_region(HeapRegion* hr) {
   assert(!hr->is_pinned(),
          "Pinned region shouldn't be added to the collection set (index %u)", hr->hrm_index());
-  assert(!hr->is_young(), "should not be young!");
+  assert(hr->is_old(), "should be old but is %s", hr->get_type_str());
   assert(hr->rem_set()->is_complete(),
          "Trying to add region %u to the collection set with incomplete remembered set", hr->hrm_index());
   _regions.append(hr);
@@ -185,7 +185,7 @@
 
 void CollectionSetChooser::set_region(uint index, HeapRegion* hr) {
   assert(regions_at(index) == NULL, "precondition");
-  assert(!hr->is_young(), "should not be young!");
+  assert(hr->is_old(), "should be old but is %s", hr->get_type_str());
   regions_at_put(index, hr);
   hr->calc_gc_efficiency();
 }
@@ -233,18 +233,19 @@
     _cset_updater(hrSorted, true /* parallel */, chunk_size) { }
 
   bool do_heap_region(HeapRegion* r) {
-    // Do we have any marking information for this region?
-    if (r->is_marked()) {
-      // We will skip any region that's currently used as an old GC
-      // alloc region (we should not consider those for collection
-      // before we fill them up).
-      if (_cset_updater.should_add(r) && !_g1h->is_old_gc_alloc_region(r)) {
-        _cset_updater.add_region(r);
-      } else if (r->is_old()) {
-        // Can clean out the remembered sets of all regions that we did not choose but
-        // we created the remembered set for.
-        r->rem_set()->clear(true);
-      }
+    // We will skip any region that's currently used as an old GC
+    // alloc region (we should not consider those for collection
+    // before we fill them up).
+    if (_cset_updater.should_add(r) && !_g1h->is_old_gc_alloc_region(r)) {
+      _cset_updater.add_region(r);
+    } else if (r->is_old()) {
+      // Keep remembered sets for humongous regions, otherwise clean out remembered
+      // sets for old regions.
+      r->rem_set()->clear(true /* only_cardset */);
+    } else {
+      assert(!r->is_old() || !r->rem_set()->is_tracked(),
+             "Missed to clear unused remembered set of region %u (%s) that is %s",
+             r->hrm_index(), r->get_type_str(), r->rem_set()->get_state_str());
     }
     return false;
   }
@@ -280,11 +281,10 @@
 }
 
 bool CollectionSetChooser::should_add(HeapRegion* hr) const {
-  assert(hr->is_marked(), "pre-condition");
-  assert(!hr->is_young(), "should never consider young regions");
-  return !hr->is_pinned() &&
-          region_occupancy_low_enough_for_evac(hr->live_bytes()) &&
-          hr->rem_set()->is_complete();
+  return !hr->is_young() &&
+         !hr->is_pinned() &&
+         region_occupancy_low_enough_for_evac(hr->live_bytes()) &&
+         hr->rem_set()->is_complete();
 }
 
 void CollectionSetChooser::rebuild(WorkGang* workers, uint n_regions) {
--- a/src/hotspot/share/gc/g1/g1AllocRegion.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1AllocRegion.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, 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
@@ -29,7 +29,7 @@
 #include "logging/log.hpp"
 #include "logging/logStream.hpp"
 #include "memory/resourceArea.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "utilities/align.hpp"
 
 G1CollectedHeap* G1AllocRegion::_g1h = NULL;
--- a/src/hotspot/share/gc/g1/g1CardTable.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1CardTable.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -28,7 +28,7 @@
 #include "gc/shared/memset_with_concurrent_readers.hpp"
 #include "logging/log.hpp"
 #include "runtime/atomic.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 
 bool G1CardTable::mark_card_deferred(size_t card_index) {
   jbyte val = _byte_map[card_index];
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -69,6 +69,7 @@
 #include "gc/shared/gcTraceTime.inline.hpp"
 #include "gc/shared/generationSpec.hpp"
 #include "gc/shared/isGCActiveMark.hpp"
+#include "gc/shared/oopStorageParState.hpp"
 #include "gc/shared/preservedMarks.inline.hpp"
 #include "gc/shared/suspendibleThreadSet.hpp"
 #include "gc/shared/referenceProcessor.inline.hpp"
@@ -86,7 +87,7 @@
 #include "runtime/flags/flagSetting.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/init.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/threadSMR.hpp"
 #include "runtime/vmThread.hpp"
 #include "utilities/align.hpp"
@@ -3218,6 +3219,7 @@
 private:
   BoolObjectClosure* _is_alive;
   G1StringDedupUnlinkOrOopsDoClosure _dedup_closure;
+  OopStorage::ParState<false /* concurrent */, false /* const */> _par_state_string;
 
   int _initial_string_table_size;
   int _initial_symbol_table_size;
@@ -3237,24 +3239,19 @@
     AbstractGangTask("String/Symbol Unlinking"),
     _is_alive(is_alive),
     _dedup_closure(is_alive, NULL, false),
+    _par_state_string(StringTable::weak_storage()),
     _process_strings(process_strings), _strings_processed(0), _strings_removed(0),
     _process_symbols(process_symbols), _symbols_processed(0), _symbols_removed(0),
     _process_string_dedup(process_string_dedup) {
 
-    _initial_string_table_size = StringTable::the_table()->table_size();
+    _initial_string_table_size = (int) StringTable::the_table()->table_size();
     _initial_symbol_table_size = SymbolTable::the_table()->table_size();
-    if (process_strings) {
-      StringTable::clear_parallel_claimed_index();
-    }
     if (process_symbols) {
       SymbolTable::clear_parallel_claimed_index();
     }
   }
 
   ~G1StringAndSymbolCleaningTask() {
-    guarantee(!_process_strings || StringTable::parallel_claimed_index() >= _initial_string_table_size,
-              "claim value %d after unlink less than initial string table size %d",
-              StringTable::parallel_claimed_index(), _initial_string_table_size);
     guarantee(!_process_symbols || SymbolTable::parallel_claimed_index() >= _initial_symbol_table_size,
               "claim value %d after unlink less than initial symbol table size %d",
               SymbolTable::parallel_claimed_index(), _initial_symbol_table_size);
@@ -3273,7 +3270,7 @@
     int symbols_processed = 0;
     int symbols_removed = 0;
     if (_process_strings) {
-      StringTable::possibly_parallel_unlink(_is_alive, &strings_processed, &strings_removed);
+      StringTable::possibly_parallel_unlink(&_par_state_string, _is_alive, &strings_processed, &strings_removed);
       Atomic::add(strings_processed, &_strings_processed);
       Atomic::add(strings_removed, &_strings_removed);
     }
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -32,7 +32,7 @@
 #include "gc/g1/heapRegionManager.inline.hpp"
 #include "gc/g1/heapRegionSet.inline.hpp"
 #include "gc/shared/taskqueue.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 
 G1EvacStats* G1CollectedHeap::alloc_buffer_stats(InCSetState dest) {
   switch (dest.value()) {
--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -1651,7 +1651,11 @@
   }
 
   if (has_overflown()) {
-    // We can not trust g1_is_alive if the marking stack overflowed
+    // We can not trust g1_is_alive and the contents of the heap if the marking stack
+    // overflowed while processing references. Exit the VM.
+    fatal("Overflow during reference processing, can not continue. Please "
+          "increase MarkStackSizeMax (current value: " SIZE_FORMAT ") and "
+          "restart.", MarkStackSizeMax);
     return;
   }
 
--- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -468,15 +468,24 @@
   _pss(pss),
   _start(Ticks::now()),
   _total_time(total_time),
-  _trim_time(trim_time) {
+  _trim_time(trim_time),
+  _stopped(false) {
 
   assert(_pss->trim_ticks().value() == 0, "Possibly remaining trim ticks left over from previous use");
 }
 
 G1EvacPhaseWithTrimTimeTracker::~G1EvacPhaseWithTrimTimeTracker() {
+  if (!_stopped) {
+    stop();
+  }
+}
+
+void G1EvacPhaseWithTrimTimeTracker::stop() {
+  assert(!_stopped, "Should only be called once");
   _total_time += (Ticks::now() - _start) - _pss->trim_ticks();
   _trim_time += _pss->trim_ticks();
   _pss->reset_trim_ticks();
+  _stopped = true;
 }
 
 G1GCParPhaseTimesTracker::G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id) :
@@ -504,6 +513,8 @@
 
 G1EvacPhaseTimesTracker::~G1EvacPhaseTimesTracker() {
   if (_phase_times != NULL) {
+    // Explicitly stop the trim tracker since it's not yet destructed.
+    _trim_tracker.stop();
     // Exclude trim time by increasing the start time.
     _start_time += _trim_time;
     _phase_times->record_or_add_objcopy_time_secs(_worker_id, _trim_time.seconds());
--- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -373,9 +373,13 @@
 
   Tickspan& _total_time;
   Tickspan& _trim_time;
+
+  bool _stopped;
 public:
   G1EvacPhaseWithTrimTimeTracker(G1ParScanThreadState* pss, Tickspan& total_time, Tickspan& trim_time);
   ~G1EvacPhaseWithTrimTimeTracker();
+
+  void stop();
 };
 
 class G1GCParPhaseTimesTracker : public CHeapObj<mtGC> {
--- a/src/hotspot/share/gc/g1/g1Policy.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1Policy.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -825,10 +825,10 @@
 
 size_t G1Policy::predict_bytes_to_copy(HeapRegion* hr) const {
   size_t bytes_to_copy;
-  if (hr->is_marked())
+  if (!hr->is_young()) {
     bytes_to_copy = hr->max_live_bytes();
-  else {
-    assert(hr->is_young() && hr->age_in_surv_rate_group() != -1, "invariant");
+  } else {
+    assert(hr->age_in_surv_rate_group() != -1, "invariant");
     int age = hr->age_in_surv_rate_group();
     double yg_surv_rate = predict_yg_surv_rate(age, hr->surv_rate_group());
     bytes_to_copy = (size_t) (hr->used() * yg_surv_rate);
--- a/src/hotspot/share/gc/g1/g1RootProcessor.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1RootProcessor.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -38,6 +38,7 @@
 #include "gc/g1/g1RootClosures.hpp"
 #include "gc/g1/g1RootProcessor.hpp"
 #include "gc/g1/heapRegion.inline.hpp"
+#include "gc/shared/oopStorageParState.hpp"
 #include "gc/shared/referenceProcessor.hpp"
 #include "gc/shared/weakProcessor.hpp"
 #include "memory/allocation.inline.hpp"
@@ -72,6 +73,7 @@
     _process_strong_tasks(G1RP_PS_NumElements),
     _srs(n_workers),
     _lock(Mutex::leaf, "G1 Root Scanning barrier lock", false, Monitor::_safepoint_check_never),
+    _par_state_string(StringTable::weak_storage()),
     _n_workers_discovered_strong_classes(0) {}
 
 void G1RootProcessor::evacuate_roots(G1ParScanThreadState* pss, uint worker_i) {
@@ -301,7 +303,7 @@
   G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::StringTableRoots, worker_i);
   // All threads execute the following. A specific chunk of buckets
   // from the StringTable are the individual tasks.
-  StringTable::possibly_parallel_oops_do(closures->weak_oops());
+  StringTable::possibly_parallel_oops_do(&_par_state_string, closures->weak_oops());
 }
 
 void G1RootProcessor::process_code_cache_roots(CodeBlobClosure* code_closure,
--- a/src/hotspot/share/gc/g1/g1RootProcessor.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1RootProcessor.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_GC_G1_G1ROOTPROCESSOR_HPP
 #define SHARE_VM_GC_G1_G1ROOTPROCESSOR_HPP
 
+#include "gc/shared/oopStorageParState.hpp"
 #include "gc/shared/strongRootsScope.hpp"
 #include "memory/allocation.hpp"
 #include "runtime/mutex.hpp"
@@ -49,6 +50,7 @@
   G1CollectedHeap* _g1h;
   SubTasksDone _process_strong_tasks;
   StrongRootsScope _srs;
+  OopStorage::ParState<false, false> _par_state_string;
 
   // Used to implement the Thread work barrier.
   Monitor _lock;
--- a/src/hotspot/share/gc/g1/g1_globals.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1_globals.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -108,9 +108,6 @@
           "When expanding, % of uncommitted space to claim.")               \
           range(0, 100)                                                     \
                                                                             \
-  develop(bool, G1RSBarrierRegionFilter, true,                              \
-          "If true, generate region filtering code in RS barrier")          \
-                                                                            \
   product(size_t, G1UpdateBufferSize, 256,                                  \
           "Size of an update buffer")                                       \
           range(1, NOT_LP64(32*M) LP64_ONLY(1*G))                           \
--- a/src/hotspot/share/gc/g1/heapRegion.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/g1/heapRegion.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -43,7 +43,7 @@
 #include "oops/compressedOops.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/atomic.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "utilities/growableArray.hpp"
 
 int    HeapRegion::LogOfHRGrainBytes = 0;
--- a/src/hotspot/share/gc/g1/heapRegion.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/g1/heapRegion.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -541,10 +541,6 @@
   // objects during evac failure handling.
   void note_self_forwarding_removal_end(size_t marked_bytes);
 
-  // Returns "false" iff no object in the region was allocated when the
-  // last mark phase ended.
-  bool is_marked() { return _prev_top_at_mark_start != bottom(); }
-
   void reset_during_compaction() {
     assert(is_humongous(),
            "should only be called for humongous regions");
--- a/src/hotspot/share/gc/parallel/gcTaskManager.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/parallel/gcTaskManager.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -34,7 +34,7 @@
 #include "memory/resourceArea.hpp"
 #include "runtime/mutex.hpp"
 #include "runtime/mutexLocker.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/os.hpp"
 
 //
--- a/src/hotspot/share/gc/shared/cardTableBarrierSet.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/shared/cardTableBarrierSet.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -27,7 +27,7 @@
 
 #include "gc/shared/cardTableBarrierSet.hpp"
 #include "gc/shared/cardTable.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 
 template <DecoratorSet decorators, typename T>
 inline void CardTableBarrierSet::write_ref_field_post(T* field, oop newVal) {
--- a/src/hotspot/share/gc/shared/collectedHeap.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/shared/collectedHeap.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -373,7 +373,8 @@
       return result;
     }
   }
-  return Universe::heap()->mem_allocate(size, gc_overhead_limit_was_exceeded);
+
+  return allocate_outside_tlab(klass, size, gc_overhead_limit_was_exceeded, THREAD);
 }
 
 HeapWord* CollectedHeap::allocate_from_tlab_slow(Klass* klass, size_t size, TRAPS) {
--- a/src/hotspot/share/gc/shared/collectedHeap.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/shared/collectedHeap.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -144,6 +144,9 @@
   inline static HeapWord* allocate_from_tlab(Klass* klass, size_t size, TRAPS);
   static HeapWord* allocate_from_tlab_slow(Klass* klass, size_t size, TRAPS);
 
+  inline static HeapWord* allocate_outside_tlab(Klass* klass, size_t size,
+                                                bool* gc_overhead_limit_was_exceeded, TRAPS);
+
   // Raw memory allocation facilities
   // The obj and array allocate methods are covers for these methods.
   // mem_allocate() should never be
--- a/src/hotspot/share/gc/shared/collectedHeap.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/shared/collectedHeap.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -142,14 +142,6 @@
   HeapWord* result = heap->obj_allocate_raw(klass, size, &gc_overhead_limit_was_exceeded, THREAD);
 
   if (result != NULL) {
-    NOT_PRODUCT(Universe::heap()->
-      check_for_non_bad_heap_word_value(result, size));
-    assert(!HAS_PENDING_EXCEPTION,
-           "Unexpected exception, will result in uninitialized storage");
-    THREAD->incr_allocated_bytes(size * HeapWordSize);
-
-    AllocTracer::send_allocation_outside_tlab(klass, result, size * HeapWordSize, THREAD);
-
     return result;
   }
 
@@ -198,6 +190,22 @@
   return obj;
 }
 
+HeapWord* CollectedHeap::allocate_outside_tlab(Klass* klass, size_t size,
+                                               bool* gc_overhead_limit_was_exceeded, TRAPS) {
+  HeapWord* result = Universe::heap()->mem_allocate(size, gc_overhead_limit_was_exceeded);
+  if (result == NULL) {
+    return result;
+  }
+
+  NOT_PRODUCT(Universe::heap()->check_for_non_bad_heap_word_value(result, size));
+  assert(!HAS_PENDING_EXCEPTION,
+         "Unexpected exception, will result in uninitialized storage");
+  THREAD->incr_allocated_bytes(size * HeapWordSize);
+
+  AllocTracer::send_allocation_outside_tlab(klass, result, size * HeapWordSize, THREAD);
+  return result;
+}
+
 void CollectedHeap::init_obj(HeapWord* obj, size_t size) {
   assert(obj != NULL, "cannot initialize NULL object");
   const size_t hs = oopDesc::header_size();
--- a/src/hotspot/share/gc/shared/genCollectedHeap.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/shared/genCollectedHeap.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -44,6 +44,7 @@
 #include "gc/shared/genCollectedHeap.hpp"
 #include "gc/shared/genOopClosures.inline.hpp"
 #include "gc/shared/generationSpec.hpp"
+#include "gc/shared/oopStorageParState.inline.hpp"
 #include "gc/shared/space.hpp"
 #include "gc/shared/strongRootsScope.hpp"
 #include "gc/shared/vmGCOperations.hpp"
@@ -851,12 +852,17 @@
 }
 
 void GenCollectedHeap::process_string_table_roots(StrongRootsScope* scope,
-                                                  OopClosure* root_closure) {
+                                                  OopClosure* root_closure,
+                                                  OopStorage::ParState<false, false>* par_state_string) {
   assert(root_closure != NULL, "Must be set");
   // All threads execute the following. A specific chunk of buckets
   // from the StringTable are the individual tasks.
+
+  // Either we should be single threaded or have a ParState
+  assert((scope->n_threads() <= 1) || par_state_string != NULL, "Parallel but no ParState");
+
   if (scope->n_threads() > 1) {
-    StringTable::possibly_parallel_oops_do(root_closure);
+    StringTable::possibly_parallel_oops_do(par_state_string, root_closure);
   } else {
     StringTable::oops_do(root_closure);
   }
@@ -865,12 +871,13 @@
 void GenCollectedHeap::young_process_roots(StrongRootsScope* scope,
                                            OopsInGenClosure* root_closure,
                                            OopsInGenClosure* old_gen_closure,
-                                           CLDClosure* cld_closure) {
+                                           CLDClosure* cld_closure,
+                                           OopStorage::ParState<false, false>* par_state_string) {
   MarkingCodeBlobClosure mark_code_closure(root_closure, CodeBlobToOopClosure::FixRelocations);
 
   process_roots(scope, SO_ScavengeCodeCache, root_closure,
                 cld_closure, cld_closure, &mark_code_closure);
-  process_string_table_roots(scope, root_closure);
+  process_string_table_roots(scope, root_closure, par_state_string);
 
   if (!_process_strong_tasks->is_task_claimed(GCH_PS_younger_gens)) {
     root_closure->reset_generation();
@@ -890,7 +897,8 @@
                                           ScanningOption so,
                                           bool only_strong_roots,
                                           OopsInGenClosure* root_closure,
-                                          CLDClosure* cld_closure) {
+                                          CLDClosure* cld_closure,
+                                          OopStorage::ParState<false, false>* par_state_string) {
   MarkingCodeBlobClosure mark_code_closure(root_closure, is_adjust_phase);
   CLDClosure* weak_cld_closure = only_strong_roots ? NULL : cld_closure;
 
@@ -899,7 +907,7 @@
     // We never treat the string table as roots during marking
     // for the full gc, so we only need to process it during
     // the adjust phase.
-    process_string_table_roots(scope, root_closure);
+    process_string_table_roots(scope, root_closure, par_state_string);
   }
 
   _process_strong_tasks->all_tasks_completed(scope->n_threads());
--- a/src/hotspot/share/gc/shared/genCollectedHeap.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/shared/genCollectedHeap.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -28,6 +28,7 @@
 #include "gc/shared/collectedHeap.hpp"
 #include "gc/shared/collectorPolicy.hpp"
 #include "gc/shared/generation.hpp"
+#include "gc/shared/oopStorageParState.hpp"
 #include "gc/shared/softRefGenPolicy.hpp"
 
 class AdaptiveSizePolicy;
@@ -401,7 +402,8 @@
                      CodeBlobToOopClosure* code_roots);
 
   void process_string_table_roots(StrongRootsScope* scope,
-                                  OopClosure* root_closure);
+                                  OopClosure* root_closure,
+                                  OopStorage::ParState<false, false>* par_state_string);
 
   // Accessor for memory state verification support
   NOT_PRODUCT(
@@ -415,14 +417,16 @@
   void young_process_roots(StrongRootsScope* scope,
                            OopsInGenClosure* root_closure,
                            OopsInGenClosure* old_gen_closure,
-                           CLDClosure* cld_closure);
+                           CLDClosure* cld_closure,
+                           OopStorage::ParState<false, false>* par_state_string = NULL);
 
   void full_process_roots(StrongRootsScope* scope,
                           bool is_adjust_phase,
                           ScanningOption so,
                           bool only_strong_roots,
                           OopsInGenClosure* root_closure,
-                          CLDClosure* cld_closure);
+                          CLDClosure* cld_closure,
+                          OopStorage::ParState<false, false>* par_state_string = NULL);
 
   // Apply "root_closure" to all the weak roots of the system.
   // These include JNI weak roots, string table,
--- a/src/hotspot/share/gc/shared/oopStorage.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/shared/oopStorage.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -33,7 +33,7 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/mutex.hpp"
 #include "runtime/mutexLocker.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/safepoint.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "runtime/thread.hpp"
--- a/src/hotspot/share/gc/shared/space.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/shared/space.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -36,7 +36,7 @@
 #include "oops/oop.inline.hpp"
 #include "runtime/atomic.hpp"
 #include "runtime/java.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/prefetch.inline.hpp"
 #include "runtime/safepoint.hpp"
 #include "utilities/align.hpp"
--- a/src/hotspot/share/gc/shared/strongRootsScope.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/shared/strongRootsScope.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -38,8 +38,6 @@
 
 StrongRootsScope::StrongRootsScope(uint n_threads) : _n_threads(n_threads) {
   Threads::change_thread_claim_parity();
-  // Zero the claimed high water mark in the StringTable
-  StringTable::clear_parallel_claimed_index();
 }
 
 StrongRootsScope::~StrongRootsScope() {
--- a/src/hotspot/share/gc/shared/taskqueue.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/gc/shared/taskqueue.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -29,7 +29,7 @@
 #include "memory/allocation.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/atomic.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/stack.inline.hpp"
 
--- a/src/hotspot/share/interpreter/bytecodeInterpreter.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/interpreter/bytecodeInterpreter.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -49,7 +49,7 @@
 #include "runtime/frame.inline.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/threadCritical.hpp"
 #include "utilities/exceptions.hpp"
--- a/src/hotspot/share/jfr/leakprofiler/leakProfiler.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/jfr/leakprofiler/leakProfiler.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -32,7 +32,7 @@
 #include "memory/iterator.hpp"
 #include "oops/oop.hpp"
 #include "runtime/atomic.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/vmThread.hpp"
 #include "utilities/ostream.hpp"
--- a/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -38,7 +38,7 @@
 #include "logging/log.hpp"
 #include "memory/resourceArea.hpp"
 #include "runtime/mutexLocker.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/os.inline.hpp"
 #include "runtime/safepoint.hpp"
 
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -33,7 +33,7 @@
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/atomic.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/vm_version.hpp"
 #include "runtime/jniHandles.inline.hpp"
 #include "runtime/thread.inline.hpp"
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdBits.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdBits.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -27,7 +27,7 @@
 
 #include "jfr/utilities/jfrTypes.hpp"
 #include "runtime/atomic.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "utilities/macros.hpp"
 
 #ifdef VM_LITTLE_ENDIAN
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -25,7 +25,7 @@
 #include "precompiled.hpp"
 #include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.hpp"
 #include "runtime/safepoint.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 
 // Alternating epochs on each rotation allow for concurrent tagging.
 // The regular epoch shift happens only during a safepoint.
--- a/src/hotspot/share/jfr/recorder/service/jfrPostBox.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/jfr/recorder/service/jfrPostBox.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -26,7 +26,7 @@
 #include "jfr/recorder/service/jfrPostBox.hpp"
 #include "jfr/utilities/jfrTryLock.hpp"
 #include "runtime/atomic.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/thread.inline.hpp"
 
 #define MSG_IS_SYNCHRONOUS ( (MSGBIT(MSG_ROTATE)) |          \
--- a/src/hotspot/share/jfr/recorder/service/jfrRecorderService.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/jfr/recorder/service/jfrRecorderService.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -46,7 +46,7 @@
 #include "runtime/atomic.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/mutexLocker.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/os.hpp"
 #include "runtime/safepoint.hpp"
 #include "runtime/thread.inline.hpp"
--- a/src/hotspot/share/jfr/recorder/storage/jfrBuffer.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/jfr/recorder/storage/jfrBuffer.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -25,7 +25,7 @@
 #include "precompiled.hpp"
 #include "jfr/recorder/storage/jfrBuffer.hpp"
 #include "runtime/atomic.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/thread.inline.hpp"
 
 static const u1* const MUTEX_CLAIM = NULL;
--- a/src/hotspot/share/jfr/recorder/storage/jfrStorage.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/jfr/recorder/storage/jfrStorage.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -38,7 +38,7 @@
 #include "jfr/writers/jfrNativeEventWriter.hpp"
 #include "logging/log.hpp"
 #include "runtime/mutexLocker.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/os.inline.hpp"
 #include "runtime/safepoint.hpp"
 #include "runtime/thread.hpp"
--- a/src/hotspot/share/jfr/recorder/storage/jfrStorageControl.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/jfr/recorder/storage/jfrStorageControl.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -26,7 +26,7 @@
 #include "jfr/recorder/storage/jfrStorageControl.hpp"
 #include "runtime/atomic.hpp"
 #include "runtime/mutexLocker.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 
 // returns the updated value
 static jlong atomic_add(size_t value, size_t volatile* const dest) {
--- a/src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -25,7 +25,7 @@
 #include "precompiled.hpp"
 #include "jfr/recorder/storage/jfrVirtualMemory.hpp"
 #include "memory/virtualspace.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/os.hpp"
 #include "services/memTracker.hpp"
 #include "utilities/globalDefinitions.hpp"
--- a/src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -35,7 +35,7 @@
 #include "logging/log.hpp"
 #include "runtime/atomic.hpp"
 #include "runtime/mutexLocker.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/safepoint.hpp"
 #include "runtime/thread.inline.hpp"
 
--- a/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolBuffer.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolBuffer.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -25,7 +25,7 @@
 #include "precompiled.hpp"
 #include "jfr/recorder/stringpool/jfrStringPoolBuffer.hpp"
 #include "runtime/atomic.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/thread.inline.hpp"
 
 JfrStringPoolBuffer::JfrStringPoolBuffer() : JfrBuffer(), _string_count_pos(0), _string_count_top(0) {}
--- a/src/hotspot/share/jfr/utilities/jfrAllocation.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/jfr/utilities/jfrAllocation.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -28,7 +28,7 @@
 #include "logging/log.hpp"
 #include "memory/allocation.inline.hpp"
 #include "runtime/atomic.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/vm_version.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/macros.hpp"
--- a/src/hotspot/share/jfr/utilities/jfrHashtable.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/jfr/utilities/jfrHashtable.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -26,7 +26,7 @@
 #define SHARE_VM_JFR_UTILITIES_JFRHASHTABLE_HPP
 
 #include "memory/allocation.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/macros.hpp"
 
--- a/src/hotspot/share/logging/logOutputList.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/logging/logOutputList.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -26,7 +26,7 @@
 #include "logging/logOutputList.hpp"
 #include "memory/allocation.inline.hpp"
 #include "runtime/atomic.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "utilities/globalDefinitions.hpp"
 
 jint LogOutputList::increase_readers() {
--- a/src/hotspot/share/memory/metaspace.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/memory/metaspace.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -40,7 +40,7 @@
 #include "memory/metaspaceTracer.hpp"
 #include "memory/universe.hpp"
 #include "runtime/init.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "services/memTracker.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/debug.hpp"
--- a/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -15,7 +15,7 @@
 #include "memory/metaspace/metaspaceCommon.hpp"
 #include "memory/metaspace/virtualSpaceList.hpp"
 #include "memory/metaspace/virtualSpaceNode.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/safepoint.hpp"
 
--- a/src/hotspot/share/memory/metaspaceShared.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/memory/metaspaceShared.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -1841,7 +1841,7 @@
   G1CollectedHeap::heap()->begin_archive_alloc_range();
 
   // Archive interned string objects
-  StringTable::write_to_archive(closed_archive);
+  StringTable::write_to_archive();
 
   G1CollectedHeap::heap()->end_archive_alloc_range(closed_archive,
                                                    os::vm_allocation_granularity());
--- a/src/hotspot/share/oops/accessBackend.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/oops/accessBackend.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -247,14 +247,14 @@
 }
 
 class RawAccessBarrierArrayCopy: public AllStatic {
+  template<typename T> struct IsHeapWordSized: public IntegralConstant<bool, sizeof(T) == HeapWordSize> { };
 public:
   template <DecoratorSet decorators, typename T>
   static inline typename EnableIf<
-  HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value>::type
+    HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value>::type
   arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
             arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
             size_t length) {
-
     src_raw = arrayOopDesc::obj_offset_to_raw(src_obj, src_offset_in_bytes, src_raw);
     dst_raw = arrayOopDesc::obj_offset_to_raw(dst_obj, dst_offset_in_bytes, dst_raw);
 
@@ -270,48 +270,68 @@
 
   template <DecoratorSet decorators, typename T>
   static inline typename EnableIf<
-    !HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value>::type
-  arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, const T* src_raw, arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw, size_t length) {
+    !HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value &&
+    HasDecorator<decorators, ARRAYCOPY_ARRAYOF>::value>::type
+  arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
+            arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
+            size_t length) {
+    src_raw = arrayOopDesc::obj_offset_to_raw(src_obj, src_offset_in_bytes, src_raw);
+    dst_raw = arrayOopDesc::obj_offset_to_raw(dst_obj, dst_offset_in_bytes, dst_raw);
 
+    AccessInternal::arraycopy_arrayof_conjoint(src_raw, dst_raw, length);
+  }
+
+  template <DecoratorSet decorators, typename T>
+  static inline typename EnableIf<
+    !HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value &&
+    HasDecorator<decorators, ARRAYCOPY_DISJOINT>::value && IsHeapWordSized<T>::value>::type
+  arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
+            arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
+            size_t length) {
     src_raw = arrayOopDesc::obj_offset_to_raw(src_obj, src_offset_in_bytes, src_raw);
     dst_raw = arrayOopDesc::obj_offset_to_raw(dst_obj, dst_offset_in_bytes, dst_raw);
 
-    if (HasDecorator<decorators, ARRAYCOPY_ARRAYOF>::value) {
-      AccessInternal::arraycopy_arrayof_conjoint(const_cast<T*>(src_raw), dst_raw, length);
-    } else if (HasDecorator<decorators, ARRAYCOPY_DISJOINT>::value && sizeof(T) == HeapWordSize) {
-      // There is only a disjoint optimization for word granularity copying
-      if (HasDecorator<decorators, ARRAYCOPY_ATOMIC>::value) {
-        AccessInternal::arraycopy_disjoint_words_atomic(const_cast<T*>(src_raw), dst_raw, length);
-      } else {
-        AccessInternal::arraycopy_disjoint_words(const_cast<T*>(src_raw), dst_raw, length);
-      }
+    // There is only a disjoint optimization for word granularity copying
+    if (HasDecorator<decorators, ARRAYCOPY_ATOMIC>::value) {
+      AccessInternal::arraycopy_disjoint_words_atomic(src_raw, dst_raw, length);
     } else {
-      if (HasDecorator<decorators, ARRAYCOPY_ATOMIC>::value) {
-        AccessInternal::arraycopy_conjoint_atomic(const_cast<T*>(src_raw), dst_raw, length);
-      } else {
-        AccessInternal::arraycopy_conjoint(const_cast<T*>(src_raw), dst_raw, length);
-      }
+      AccessInternal::arraycopy_disjoint_words(src_raw, dst_raw, length);
     }
   }
 
-  template <DecoratorSet decorators>
+  template <DecoratorSet decorators, typename T>
   static inline typename EnableIf<
-    !HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value>::type
-  arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, const void* src_raw,
-            arrayOop dst_obj, size_t dst_offset_in_bytes, void* dst_raw,
+    !HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value &&
+    !(HasDecorator<decorators, ARRAYCOPY_DISJOINT>::value && IsHeapWordSized<T>::value) &&
+    !HasDecorator<decorators, ARRAYCOPY_ARRAYOF>::value &&
+    !HasDecorator<decorators, ARRAYCOPY_ATOMIC>::value>::type
+  arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
+            arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
             size_t length) {
-
     src_raw = arrayOopDesc::obj_offset_to_raw(src_obj, src_offset_in_bytes, src_raw);
     dst_raw = arrayOopDesc::obj_offset_to_raw(dst_obj, dst_offset_in_bytes, dst_raw);
 
-    if (HasDecorator<decorators, ARRAYCOPY_ATOMIC>::value) {
-      AccessInternal::arraycopy_conjoint_atomic(const_cast<void*>(src_raw), dst_raw, length);
-    } else {
-      AccessInternal::arraycopy_conjoint(const_cast<void*>(src_raw), dst_raw, length);
-    }
+    AccessInternal::arraycopy_conjoint(src_raw, dst_raw, length);
+  }
+
+  template <DecoratorSet decorators, typename T>
+  static inline typename EnableIf<
+    !HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value &&
+    !(HasDecorator<decorators, ARRAYCOPY_DISJOINT>::value && IsHeapWordSized<T>::value) &&
+    !HasDecorator<decorators, ARRAYCOPY_ARRAYOF>::value &&
+    HasDecorator<decorators, ARRAYCOPY_ATOMIC>::value>::type
+  arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
+            arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
+            size_t length) {
+    src_raw = arrayOopDesc::obj_offset_to_raw(src_obj, src_offset_in_bytes, src_raw);
+    dst_raw = arrayOopDesc::obj_offset_to_raw(dst_obj, dst_offset_in_bytes, dst_raw);
+
+    AccessInternal::arraycopy_conjoint_atomic(src_raw, dst_raw, length);
   }
 };
 
+template<> struct RawAccessBarrierArrayCopy::IsHeapWordSized<void>: public IntegralConstant<bool, false> { };
+
 template <DecoratorSet decorators>
 template <typename T>
 inline bool RawAccessBarrier<decorators>::arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
--- a/src/hotspot/share/oops/array.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/oops/array.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -26,7 +26,7 @@
 #define SHARE_VM_OOPS_ARRAY_INLINE_HPP
 
 #include "oops/array.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 
 template <typename T>
 inline T Array<T>::at_acquire(const int which) { return OrderAccess::load_acquire(adr_at(which)); }
--- a/src/hotspot/share/oops/arrayKlass.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/oops/arrayKlass.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -25,7 +25,7 @@
 #ifndef SHARE_VM_OOPS_ARRAYKLASS_INLINE_HPP
 #define SHARE_VM_OOPS_ARRAYKLASS_INLINE_HPP
 
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "oops/arrayKlass.hpp"
 
 inline Klass* ArrayKlass::higher_dimension_acquire() const {
--- a/src/hotspot/share/oops/constantPool.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/oops/constantPool.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -27,7 +27,7 @@
 
 #include "oops/constantPool.hpp"
 #include "oops/cpCache.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 
 inline CPSlot ConstantPool::slot_at(int which) const {
   assert(is_within_bounds(which), "index out of bounds");
--- a/src/hotspot/share/oops/cpCache.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/oops/cpCache.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -42,7 +42,7 @@
 #include "prims/methodHandles.hpp"
 #include "runtime/atomic.hpp"
 #include "runtime/handles.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "utilities/macros.hpp"
 
 // Implementation of ConstantPoolCacheEntry
--- a/src/hotspot/share/oops/cpCache.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/oops/cpCache.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -27,7 +27,7 @@
 
 #include "oops/cpCache.hpp"
 #include "oops/oopHandle.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 
 inline int ConstantPoolCacheEntry::indices_ord() const { return OrderAccess::load_acquire(&_indices); }
 
--- a/src/hotspot/share/oops/instanceKlass.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/oops/instanceKlass.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -71,7 +71,7 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/mutexLocker.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/thread.inline.hpp"
 #include "services/classLoadingService.hpp"
 #include "services/threadService.hpp"
--- a/src/hotspot/share/oops/instanceKlass.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/oops/instanceKlass.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -29,7 +29,7 @@
 #include "oops/instanceKlass.hpp"
 #include "oops/klass.hpp"
 #include "oops/oop.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/macros.hpp"
--- a/src/hotspot/share/oops/instanceRefKlass.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/oops/instanceRefKlass.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -53,13 +53,20 @@
   }
 }
 
+static inline oop load_referent(oop obj, ReferenceType type) {
+  if (type == REF_PHANTOM) {
+    return HeapAccess<ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE>::oop_load(java_lang_ref_Reference::referent_addr_raw(obj));
+  } else {
+    return HeapAccess<ON_WEAK_OOP_REF | AS_NO_KEEPALIVE>::oop_load(java_lang_ref_Reference::referent_addr_raw(obj));
+  }
+}
+
 template <typename T, class OopClosureType>
 bool InstanceRefKlass::try_discover(oop obj, ReferenceType type, OopClosureType* closure) {
   ReferenceDiscoverer* rd = closure->ref_discoverer();
   if (rd != NULL) {
-    T referent_oop = RawAccess<>::oop_load((T*)java_lang_ref_Reference::referent_addr_raw(obj));
-    if (!CompressedOops::is_null(referent_oop)) {
-      oop referent = CompressedOops::decode_not_null(referent_oop);
+    oop referent = load_referent(obj, type);
+    if (referent != NULL) {
       if (!referent->is_gc_marked()) {
         // Only try to discover if not yet marked.
         return rd->discover_reference(obj, type);
@@ -179,9 +186,9 @@
 
   log_develop_trace(gc, ref)("InstanceRefKlass %s for obj " PTR_FORMAT, s, p2i(obj));
   log_develop_trace(gc, ref)("     referent_addr/* " PTR_FORMAT " / " PTR_FORMAT,
-      p2i(referent_addr), p2i(referent_addr ? RawAccess<>::oop_load(referent_addr) : (oop)NULL));
+      p2i(referent_addr), p2i((oop)HeapAccess<ON_UNKNOWN_OOP_REF | AS_NO_KEEPALIVE>::oop_load_at(obj, java_lang_ref_Reference::referent_offset)));
   log_develop_trace(gc, ref)("     discovered_addr/* " PTR_FORMAT " / " PTR_FORMAT,
-      p2i(discovered_addr), p2i(discovered_addr ? RawAccess<>::oop_load(discovered_addr) : (oop)NULL));
+      p2i(discovered_addr), p2i((oop)HeapAccess<AS_NO_KEEPALIVE>::oop_load(discovered_addr)));
 }
 #endif
 
--- a/src/hotspot/share/oops/klass.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/oops/klass.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -43,7 +43,7 @@
 #include "oops/oopHandle.inline.hpp"
 #include "runtime/atomic.hpp"
 #include "runtime/handles.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/stack.inline.hpp"
 
--- a/src/hotspot/share/oops/method.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/oops/method.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -54,7 +54,7 @@
 #include "runtime/frame.inline.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/init.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/relocator.hpp"
 #include "runtime/safepointVerifiers.hpp"
 #include "runtime/sharedRuntime.hpp"
--- a/src/hotspot/share/oops/method.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/oops/method.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -26,7 +26,7 @@
 #define SHARE_VM_OOPS_METHOD_INLINE_HPP
 
 #include "oops/method.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 
 inline address Method::from_compiled_entry() const {
   return OrderAccess::load_acquire(&_from_compiled_entry);
--- a/src/hotspot/share/oops/methodData.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/oops/methodData.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -37,7 +37,7 @@
 #include "runtime/compilationPolicy.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/handles.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/safepointVerifiers.hpp"
 #include "utilities/align.hpp"
 #include "utilities/copy.hpp"
--- a/src/hotspot/share/oops/methodData.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/oops/methodData.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -26,7 +26,7 @@
 #define SHARE_VM_OOPS_METHODDATA_INLINE_HPP
 
 #include "oops/methodData.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 
 inline void DataLayout::release_set_cell_at(int index, intptr_t value) {
   OrderAccess::release_store(&_cells[index], value);
--- a/src/hotspot/share/oops/oop.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/oops/oop.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -35,7 +35,7 @@
 #include "oops/markOop.inline.hpp"
 #include "oops/oop.hpp"
 #include "runtime/atomic.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/os.hpp"
 #include "utilities/align.hpp"
 #include "utilities/macros.hpp"
--- a/src/hotspot/share/oops/weakHandle.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/oops/weakHandle.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/systemDictionary.hpp"
+#include "classfile/stringTable.hpp"
 #include "gc/shared/oopStorage.hpp"
 #include "oops/access.inline.hpp"
 #include "oops/oop.hpp"
@@ -35,6 +36,10 @@
   return SystemDictionary::vm_weak_oop_storage();
 }
 
+template <> OopStorage* WeakHandle<vm_string_table_data>::get_storage() {
+  return StringTable::weak_storage();
+}
+
 template <WeakHandleType T>
 WeakHandle<T> WeakHandle<T>::create(Handle obj) {
   assert(obj() != NULL, "no need to create weak null oop");
@@ -68,4 +73,5 @@
 
 // Provide instantiation.
 template class WeakHandle<vm_class_loader_data>;
+template class WeakHandle<vm_string_table_data>;
 
--- a/src/hotspot/share/oops/weakHandle.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/oops/weakHandle.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -39,12 +39,11 @@
 // This is the vm version of jweak but has different GC lifetimes and policies,
 // depending on the type.
 
-enum WeakHandleType { vm_class_loader_data, vm_string };
+enum WeakHandleType { vm_class_loader_data, vm_string, vm_string_table_data };
 
 template <WeakHandleType T>
 class WeakHandle {
  public:
-
  private:
   oop* _obj;
 
@@ -59,6 +58,8 @@
   void release() const;
   bool is_null() const { return _obj == NULL; }
 
+  void replace(oop with_obj);
+
   void print() const;
   void print_on(outputStream* st) const;
 };
--- a/src/hotspot/share/oops/weakHandle.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/oops/weakHandle.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -40,4 +40,10 @@
   return RootAccess<ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE>::oop_load(_obj);
 }
 
+template <WeakHandleType T>
+void WeakHandle<T>::replace(oop with_obj) {
+  RootAccess<ON_PHANTOM_OOP_REF>::oop_store(_obj, with_obj);
+}
+
 #endif // SHARE_VM_OOPS_WEAKHANDLE_INLINE_HPP
+
--- a/src/hotspot/share/opto/c2_globals.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/opto/c2_globals.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -53,6 +53,9 @@
   diagnostic(bool, StressGCM, false,                                        \
           "Randomize instruction scheduling in GCM")                        \
                                                                             \
+  develop(bool, StressMethodHandleLinkerInlining, false,                    \
+          "Stress inlining through method handle linkers")                  \
+                                                                            \
   develop(intx, OptoPrologueNops, 0,                                        \
           "Insert this many extra nop instructions "                        \
           "in the prologue of every nmethod")                               \
--- a/src/hotspot/share/opto/callGenerator.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/opto/callGenerator.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -932,7 +932,7 @@
           speculative_receiver_type = (receiver_type != NULL) ? receiver_type->speculative_type() : NULL;
         }
         CallGenerator* cg = C->call_generator(target, vtable_index, call_does_dispatch, jvms,
-                                              true /* allow_inline */,
+                                              !StressMethodHandleLinkerInlining /* allow_inline */,
                                               PROB_ALWAYS,
                                               speculative_receiver_type);
         return cg;
--- a/src/hotspot/share/opto/loopnode.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/opto/loopnode.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -2641,6 +2641,9 @@
   int old_progress = C->major_progress();
   uint orig_worklist_size = _igvn._worklist.size();
 
+  // Reset major-progress flag for the driver's heuristics
+  C->clear_major_progress();
+
 #ifndef PRODUCT
   // Capture for later assert
   uint unique = C->unique();
@@ -2711,16 +2714,11 @@
   if( !_verify_me && !_verify_only && _ltree_root->_child ) {
     C->print_method(PHASE_BEFORE_BEAUTIFY_LOOPS, 3);
     if( _ltree_root->_child->beautify_loops( this ) ) {
-      // IdealLoopTree::split_outer_loop may produce phi-nodes with a single in edge.
-      // Transform them away.
-      _igvn.optimize();
-
       // Re-build loop tree!
       _ltree_root->_child = NULL;
       _nodes.clear();
       reallocate_preorders();
       build_loop_tree();
-
       // Check for bailout, and return
       if (C->failing()) {
         return;
@@ -2732,9 +2730,6 @@
     }
   }
 
-  // Reset major-progress flag for the driver's heuristics
-  C->clear_major_progress();
-
   // Build Dominators for elision of NULL checks & loop finding.
   // Since nodes do not have a slot for immediate dominator, make
   // a persistent side array for that info indexed on node->_idx.
--- a/src/hotspot/share/precompiled/precompiled.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/precompiled/precompiled.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -187,7 +187,7 @@
 # include "runtime/mutexLocker.hpp"
 # include "runtime/objectMonitor.hpp"
 # include "runtime/orderAccess.hpp"
-# include "runtime/orderAccess.inline.hpp"
+# include "runtime/orderAccess.hpp"
 # include "runtime/os.hpp"
 # include "runtime/osThread.hpp"
 # include "runtime/perfData.hpp"
--- a/src/hotspot/share/prims/jni.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/prims/jni.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -73,7 +73,7 @@
 #include "runtime/javaCalls.hpp"
 #include "runtime/jfieldIDWorkaround.hpp"
 #include "runtime/jniHandles.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/reflection.hpp"
 #include "runtime/safepointVerifiers.hpp"
 #include "runtime/sharedRuntime.hpp"
--- a/src/hotspot/share/prims/jvm.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/prims/jvm.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -64,7 +64,7 @@
 #include "runtime/javaCalls.hpp"
 #include "runtime/jfieldIDWorkaround.hpp"
 #include "runtime/jniHandles.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/os.inline.hpp"
 #include "runtime/perfData.hpp"
 #include "runtime/reflection.hpp"
@@ -1115,7 +1115,7 @@
     return NULL;
   }
 
-  objArrayOop signers = java_lang_Class::signers(JNIHandles::resolve_non_null(cls));
+  objArrayHandle signers(THREAD, java_lang_Class::signers(JNIHandles::resolve_non_null(cls)));
 
   // If there are no signers set in the class, or if the class
   // is an array, return NULL.
--- a/src/hotspot/share/prims/jvmtiRawMonitor.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/prims/jvmtiRawMonitor.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -27,7 +27,7 @@
 #include "prims/jvmtiRawMonitor.hpp"
 #include "runtime/atomic.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/thread.inline.hpp"
 
 GrowableArray<JvmtiRawMonitor*> *JvmtiPendingMonitors::_monitors = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<JvmtiRawMonitor*>(1,true);
--- a/src/hotspot/share/prims/unsafe.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/prims/unsafe.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -40,7 +40,7 @@
 #include "runtime/globals.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/jniHandles.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/reflection.hpp"
 #include "runtime/thread.hpp"
 #include "runtime/threadSMR.hpp"
--- a/src/hotspot/share/runtime/arguments.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/arguments.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -4447,6 +4447,18 @@
   PropertyList_add(plist, k, v, writeable == WriteableProperty, internal == InternalProperty);
 }
 
+// Update existing property with new value.
+void Arguments::PropertyList_update_value(SystemProperty* plist, const char* k, const char* v) {
+  SystemProperty* prop;
+  for (prop = plist; prop != NULL; prop = prop->next()) {
+    if (strcmp(k, prop->key()) == 0) {
+        prop->set_value(v);
+        return;
+    }
+  }
+  assert(false, "invalid property");
+}
+
 // Copies src into buf, replacing "%%" with "%" and "%p" with pid
 // Returns true if all of the source pointed by src has been copied over to
 // the destination buffer pointed by buf. Otherwise, returns false.
--- a/src/hotspot/share/runtime/arguments.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/arguments.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -651,6 +651,7 @@
   static void PropertyList_unique_add(SystemProperty** plist, const char* k, const char* v,
                                       PropertyAppendable append, PropertyWriteable writeable,
                                       PropertyInternal internal);
+  static void PropertyList_update_value(SystemProperty* plist, const char* k, const char* v);
   static const char* PropertyList_get_value(SystemProperty* plist, const char* key);
   static const char* PropertyList_get_readable_value(SystemProperty* plist, const char* key);
   static int  PropertyList_count(SystemProperty* pl);
--- a/src/hotspot/share/runtime/globals.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/globals.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -2542,8 +2542,9 @@
           "Relax the access control checks in the verifier")                \
                                                                             \
   product(uintx, StringTableSize, defaultStringTableSize,                   \
-          "Number of buckets in the interned String table")                 \
-          range(minimumStringTableSize, 111*defaultStringTableSize)         \
+          "Number of buckets in the interned String table "                 \
+          "(will be rounded to nearest higher power of 2)")                 \
+          range(minimumStringTableSize, 16777216ul)                         \
                                                                             \
   experimental(uintx, SymbolTableSize, defaultSymbolTableSize,              \
           "Number of buckets in the JVM internal Symbol table")             \
--- a/src/hotspot/share/runtime/interfaceSupport.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/interfaceSupport.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/init.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/os.inline.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/safepointVerifiers.hpp"
--- a/src/hotspot/share/runtime/java.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/java.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -524,14 +524,9 @@
   }
 
   if (VerifyStringTableAtExit) {
-    int fail_cnt = 0;
-    {
-      MutexLocker ml(StringTable_lock);
-      fail_cnt = StringTable::verify_and_compare_entries();
-    }
-
+    size_t fail_cnt = StringTable::verify_and_compare_entries();
     if (fail_cnt != 0) {
-      tty->print_cr("ERROR: fail_cnt=%d", fail_cnt);
+      tty->print_cr("ERROR: fail_cnt=" SIZE_FORMAT, fail_cnt);
       guarantee(fail_cnt == 0, "unexpected StringTable verification failures");
     }
   }
--- a/src/hotspot/share/runtime/mutex.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/mutex.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -26,7 +26,7 @@
 #include "runtime/atomic.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/mutex.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/osThread.hpp"
 #include "runtime/safepointMechanism.inline.hpp"
 #include "runtime/thread.inline.hpp"
--- a/src/hotspot/share/runtime/mutexLocker.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/mutexLocker.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -48,6 +48,8 @@
 Mutex*   JNIGlobalActive_lock         = NULL;
 Mutex*   JNIWeakAlloc_lock            = NULL;
 Mutex*   JNIWeakActive_lock           = NULL;
+Mutex*   StringTableWeakAlloc_lock    = NULL;
+Mutex*   StringTableWeakActive_lock   = NULL;
 Mutex*   JNIHandleBlockFreeList_lock  = NULL;
 Mutex*   VMWeakAlloc_lock             = NULL;
 Mutex*   VMWeakActive_lock            = NULL;
@@ -186,6 +188,9 @@
   def(VMWeakAlloc_lock             , PaddedMutex  , vmweak,      true,  Monitor::_safepoint_check_never);
   def(VMWeakActive_lock            , PaddedMutex  , vmweak-1,    true,  Monitor::_safepoint_check_never);
 
+  def(StringTableWeakAlloc_lock    , PaddedMutex  , vmweak,      true,  Monitor::_safepoint_check_never);
+  def(StringTableWeakActive_lock   , PaddedMutex  , vmweak-1,    true,  Monitor::_safepoint_check_never);
+
   if (UseConcMarkSweepGC || UseG1GC) {
     def(FullGCCount_lock           , PaddedMonitor, leaf,        true,  Monitor::_safepoint_check_never);      // in support of ExplicitGCInvokesConcurrent
   }
--- a/src/hotspot/share/runtime/mutexLocker.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/mutexLocker.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -42,6 +42,8 @@
 extern Mutex*   JNIGlobalActive_lock;            // JNI global storage active list lock
 extern Mutex*   JNIWeakAlloc_lock;               // JNI weak storage allocate list lock
 extern Mutex*   JNIWeakActive_lock;              // JNI weak storage active list lock
+extern Mutex*   StringTableWeakAlloc_lock;       // StringTable weak storage allocate list lock
+extern Mutex*   StringTableWeakActive_lock;      // STringTable weak storage active list lock
 extern Mutex*   JNIHandleBlockFreeList_lock;     // a lock on the JNI handle block free list
 extern Mutex*   VMWeakAlloc_lock;                // VM Weak Handles storage allocate list lock
 extern Mutex*   VMWeakActive_lock;               // VM Weak Handles storage active list lock
--- a/src/hotspot/share/runtime/objectMonitor.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/objectMonitor.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -36,7 +36,7 @@
 #include "runtime/mutexLocker.hpp"
 #include "runtime/objectMonitor.hpp"
 #include "runtime/objectMonitor.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/osThread.hpp"
 #include "runtime/safepointMechanism.inline.hpp"
 #include "runtime/sharedRuntime.hpp"
--- a/src/hotspot/share/runtime/orderAccess.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/orderAccess.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -27,6 +27,7 @@
 
 #include "memory/allocation.hpp"
 #include "runtime/atomic.hpp"
+#include "utilities/macros.hpp"
 
 //                Memory Access Ordering Model
 //
@@ -311,4 +312,38 @@
   }
 };
 
+#include OS_CPU_HEADER(orderAccess)
+
+template<> inline void ScopedFenceGeneral<X_ACQUIRE>::postfix()       { OrderAccess::acquire(); }
+template<> inline void ScopedFenceGeneral<RELEASE_X>::prefix()        { OrderAccess::release(); }
+template<> inline void ScopedFenceGeneral<RELEASE_X_FENCE>::prefix()  { OrderAccess::release(); }
+template<> inline void ScopedFenceGeneral<RELEASE_X_FENCE>::postfix() { OrderAccess::fence();   }
+
+
+template <typename FieldType, ScopedFenceType FenceType>
+inline void OrderAccess::ordered_store(volatile FieldType* p, FieldType v) {
+  ScopedFence<FenceType> f((void*)p);
+  Atomic::store(v, p);
+}
+
+template <typename FieldType, ScopedFenceType FenceType>
+inline FieldType OrderAccess::ordered_load(const volatile FieldType* p) {
+  ScopedFence<FenceType> f((void*)p);
+  return Atomic::load(p);
+}
+
+template <typename T>
+inline T OrderAccess::load_acquire(const volatile T* p) {
+  return LoadImpl<T, PlatformOrderedLoad<sizeof(T), X_ACQUIRE> >()(p);
+}
+
+template <typename T, typename D>
+inline void OrderAccess::release_store(volatile D* p, T v) {
+  StoreImpl<T, D, PlatformOrderedStore<sizeof(D), RELEASE_X> >()(v, p);
+}
+
+template <typename T, typename D>
+inline void OrderAccess::release_store_fence(volatile D* p, T v) {
+  StoreImpl<T, D, PlatformOrderedStore<sizeof(D), RELEASE_X_FENCE> >()(v, p);
+}
 #endif // SHARE_VM_RUNTIME_ORDERACCESS_HPP
--- a/src/hotspot/share/runtime/orderAccess.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2014, 2016 SAP SE. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef SHARE_VM_RUNTIME_ORDERACCESS_INLINE_HPP
-#define SHARE_VM_RUNTIME_ORDERACCESS_INLINE_HPP
-
-#include "runtime/orderAccess.hpp"
-#include "utilities/macros.hpp"
-
-#include OS_CPU_HEADER_INLINE(orderAccess)
-
-template<> inline void ScopedFenceGeneral<X_ACQUIRE>::postfix()       { OrderAccess::acquire(); }
-template<> inline void ScopedFenceGeneral<RELEASE_X>::prefix()        { OrderAccess::release(); }
-template<> inline void ScopedFenceGeneral<RELEASE_X_FENCE>::prefix()  { OrderAccess::release(); }
-template<> inline void ScopedFenceGeneral<RELEASE_X_FENCE>::postfix() { OrderAccess::fence();   }
-
-
-template <typename FieldType, ScopedFenceType FenceType>
-inline void OrderAccess::ordered_store(volatile FieldType* p, FieldType v) {
-  ScopedFence<FenceType> f((void*)p);
-  Atomic::store(v, p);
-}
-
-template <typename FieldType, ScopedFenceType FenceType>
-inline FieldType OrderAccess::ordered_load(const volatile FieldType* p) {
-  ScopedFence<FenceType> f((void*)p);
-  return Atomic::load(p);
-}
-
-template <typename T>
-inline T OrderAccess::load_acquire(const volatile T* p) {
-  return LoadImpl<T, PlatformOrderedLoad<sizeof(T), X_ACQUIRE> >()(p);
-}
-
-template <typename T, typename D>
-inline void OrderAccess::release_store(volatile D* p, T v) {
-  StoreImpl<T, D, PlatformOrderedStore<sizeof(D), RELEASE_X> >()(v, p);
-}
-
-template <typename T, typename D>
-inline void OrderAccess::release_store_fence(volatile D* p, T v) {
-  StoreImpl<T, D, PlatformOrderedStore<sizeof(D), RELEASE_X_FENCE> >()(v, p);
-}
-#endif // SHARE_VM_RUNTIME_ORDERACCESS_INLINE_HPP
--- a/src/hotspot/share/runtime/perfMemory.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/perfMemory.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -30,7 +30,7 @@
 #include "runtime/java.hpp"
 #include "runtime/mutex.hpp"
 #include "runtime/mutexLocker.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/os.hpp"
 #include "runtime/perfData.hpp"
 #include "runtime/perfMemory.hpp"
--- a/src/hotspot/share/runtime/safepoint.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/safepoint.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -50,7 +50,7 @@
 #include "runtime/frame.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/mutexLocker.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/osThread.hpp"
 #include "runtime/safepoint.hpp"
 #include "runtime/safepointMechanism.inline.hpp"
--- a/src/hotspot/share/runtime/serviceThread.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/serviceThread.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/stringTable.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/serviceThread.hpp"
@@ -82,6 +83,7 @@
     bool has_gc_notification_event = false;
     bool has_dcmd_notification_event = false;
     bool acs_notify = false;
+    bool stringtable_work = false;
     JvmtiDeferredEvent jvmti_event;
     {
       // Need state transition ThreadBlockInVM so that this thread
@@ -98,7 +100,8 @@
       while (!(sensors_changed = LowMemoryDetector::has_pending_requests()) &&
              !(has_jvmti_events = JvmtiDeferredEventQueue::has_events()) &&
               !(has_gc_notification_event = GCNotifier::has_event()) &&
-              !(has_dcmd_notification_event = DCmdFactory::has_pending_jmx_notification())) {
+              !(has_dcmd_notification_event = DCmdFactory::has_pending_jmx_notification()) &&
+              !(stringtable_work = StringTable::has_work())) {
         // wait until one of the sensors has pending requests, or there is a
         // pending JVMTI event or JMX GC notification to post
         Service_lock->wait(Mutex::_no_safepoint_check_flag);
@@ -109,6 +112,10 @@
       }
     }
 
+    if (stringtable_work) {
+      StringTable::do_concurrent_work(jt);
+    }
+
     if (has_jvmti_events) {
       jvmti_event.post();
     }
--- a/src/hotspot/share/runtime/sharedRuntime.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/sharedRuntime.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -1082,6 +1082,7 @@
 
   Bytecode_invoke bytecode(caller, bci);
   int bytecode_index = bytecode.index();
+  bc = bytecode.invoke_code();
 
   methodHandle attached_method = extract_attached_method(vfst);
   if (attached_method.not_null()) {
@@ -1095,6 +1096,11 @@
 
       // Adjust invocation mode according to the attached method.
       switch (bc) {
+        case Bytecodes::_invokevirtual:
+          if (attached_method->method_holder()->is_interface()) {
+            bc = Bytecodes::_invokeinterface;
+          }
+          break;
         case Bytecodes::_invokeinterface:
           if (!attached_method->method_holder()->is_interface()) {
             bc = Bytecodes::_invokevirtual;
@@ -1110,10 +1116,10 @@
           break;
       }
     }
-  } else {
-    bc = bytecode.invoke_code();
   }
 
+  assert(bc != Bytecodes::_illegal, "not initialized");
+
   bool has_receiver = bc != Bytecodes::_invokestatic &&
                       bc != Bytecodes::_invokedynamic &&
                       bc != Bytecodes::_invokehandle;
--- a/src/hotspot/share/runtime/sweeper.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/sweeper.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -38,7 +38,7 @@
 #include "runtime/compilationPolicy.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/mutexLocker.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/os.hpp"
 #include "runtime/sweeper.hpp"
 #include "runtime/thread.inline.hpp"
--- a/src/hotspot/share/runtime/thread.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/thread.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -80,7 +80,7 @@
 #include "runtime/memprofiler.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/objectMonitor.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/osThread.hpp"
 #include "runtime/prefetch.inline.hpp"
 #include "runtime/safepoint.hpp"
@@ -1132,6 +1132,9 @@
   ResourceMark rm(THREAD);
   const char *vm_info = VM_Version::vm_info_string();
 
+  // update the native system property first
+  Arguments::PropertyList_update_value(Arguments::system_properties(), "java.vm.info", vm_info);
+
   // java.lang.System class
   Klass* klass =  SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
 
@@ -3779,9 +3782,10 @@
 
   initialize_java_lang_classes(main_thread, CHECK_JNI_ERR);
 
-  // We need this for ClassDataSharing - the initial vm.info property is set
-  // with the default value of CDS "sharing" which may be reset through
-  // command line options.
+  // We need this to update the java.vm.info property in case any flags used
+  // to initially define it have been changed. This is needed for both CDS and
+  // AOT, since UseSharedSpaces and UseAOT may be changed after java.vm.info
+  // is initially computed. See Abstract_VM_Version::vm_info_string().
   reset_vm_info_property(CHECK_JNI_ERR);
 
   quicken_jni_functions();
--- a/src/hotspot/share/runtime/thread.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/thread.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -27,7 +27,7 @@
 
 #include "runtime/atomic.hpp"
 #include "runtime/globals.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/os.inline.hpp"
 #include "runtime/thread.hpp"
 
--- a/src/hotspot/share/runtime/vmStructs.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/vmStructs.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -164,7 +164,6 @@
 typedef Hashtable<intptr_t, mtInternal>       IntptrHashtable;
 typedef Hashtable<Symbol*, mtSymbol>          SymbolHashtable;
 typedef HashtableEntry<Symbol*, mtClass>      SymbolHashtableEntry;
-typedef Hashtable<oop, mtSymbol>              StringHashtable;
 typedef Hashtable<InstanceKlass*, mtClass>       KlassHashtable;
 typedef HashtableEntry<InstanceKlass*, mtClass>  KlassHashtableEntry;
 typedef CompactHashtable<Symbol*, char>       SymbolCompactHashTable;
@@ -476,12 +475,6 @@
      static_field(SymbolTable,                 _shared_table,                                 SymbolCompactHashTable)                \
      static_field(RehashableSymbolHashtable,   _seed,                                         juint)                                 \
                                                                                                                                      \
-  /***************/                                                                                                                  \
-  /* StringTable */                                                                                                                  \
-  /***************/                                                                                                                  \
-                                                                                                                                     \
-     static_field(StringTable,                 _the_table,                                    StringTable*)                          \
-                                                                                                                                     \
   /********************/                                                                                                             \
   /* CompactHashTable */                                                                                                             \
   /********************/                                                                                                             \
@@ -1365,7 +1358,6 @@
   declare_toplevel_type(BasicHashtable<mtSymbol>)                         \
     declare_type(RehashableSymbolHashtable, BasicHashtable<mtSymbol>)     \
   declare_type(SymbolTable, SymbolHashtable)                              \
-  declare_type(StringTable, StringHashtable)                              \
     declare_type(Dictionary, KlassHashtable)                              \
   declare_toplevel_type(BasicHashtableEntry<mtInternal>)                  \
   declare_type(IntptrHashtableEntry, BasicHashtableEntry<mtInternal>)     \
--- a/src/hotspot/share/runtime/vm_operations.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/runtime/vm_operations.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -103,6 +103,7 @@
   template(RotateGCLog)                           \
   template(WhiteBoxOperation)                     \
   template(ClassLoaderStatsOperation)             \
+  template(ClassLoaderHierarchyOperation)         \
   template(DumpHashtable)                         \
   template(DumpTouchedMethods)                    \
   template(MarkActiveNMethods)                    \
--- a/src/hotspot/share/services/diagnosticCommand.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/services/diagnosticCommand.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "jvm.h"
+#include "classfile/classLoaderHierarchyDCmd.hpp"
 #include "classfile/classLoaderStats.hpp"
 #include "classfile/compactHashtable.hpp"
 #include "compiler/compileBroker.hpp"
@@ -101,6 +102,7 @@
 #endif // INCLUDE_JVMTI
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(full_export, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassLoaderStatsDCmd>(full_export, true, false));
+  DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassLoaderHierarchyDCmd>(full_export, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompileQueueDCmd>(full_export, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeListDCmd>(full_export, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeCacheDCmd>(full_export, true, false));
--- a/src/hotspot/share/services/memTracker.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/services/memTracker.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -25,7 +25,7 @@
 #include "jvm.h"
 
 #include "runtime/mutex.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/vmThread.hpp"
 #include "runtime/vm_operations.hpp"
 #include "services/memBaseline.hpp"
--- a/src/hotspot/share/services/memoryManager.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/services/memoryManager.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -29,7 +29,7 @@
 #include "oops/oop.inline.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/javaCalls.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "services/lowMemoryDetector.hpp"
 #include "services/management.hpp"
 #include "services/memoryManager.hpp"
--- a/src/hotspot/share/services/memoryPool.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/services/memoryPool.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -29,7 +29,7 @@
 #include "oops/oop.inline.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/javaCalls.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "services/lowMemoryDetector.hpp"
 #include "services/management.hpp"
 #include "services/memoryManager.hpp"
--- a/src/hotspot/share/utilities/concurrentHashTable.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/utilities/concurrentHashTable.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -484,6 +484,9 @@
   void statistics_to(Thread* thread, VALUE_SIZE_FUNC& vs_f, outputStream* st,
                      const char* table_name);
 
+  // Moves all nodes from this table to to_cht
+  bool try_move_nodes_to(Thread* thread, ConcurrentHashTable<VALUE, CONFIG, F>* to_cht);
+
   // This is a Curiously Recurring Template Pattern (CRPT) interface for the
   // specialization.
   struct BaseConfig {
--- a/src/hotspot/share/utilities/concurrentHashTable.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/utilities/concurrentHashTable.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -27,7 +27,7 @@
 
 #include "memory/allocation.inline.hpp"
 #include "runtime/atomic.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/prefetch.inline.hpp"
 #include "utilities/concurrentHashTable.hpp"
 #include "utilities/globalCounter.inline.hpp"
@@ -293,7 +293,7 @@
 inline void ConcurrentHashTable<VALUE, CONFIG, F>::
   write_synchonize_on_visible_epoch(Thread* thread)
 {
-  assert(_resize_lock->owned_by_self(), "Re-size lock not held");
+  assert(_resize_lock_owner == thread, "Re-size lock not held");
   OrderAccess::fence(); // Prevent below load from floating up.
   // If no reader saw this version we can skip write_synchronize.
   if (OrderAccess::load_acquire(&_invisible_epoch) == thread) {
@@ -488,7 +488,7 @@
 {
   // Here we have resize lock so table is SMR safe, and there is no new
   // table. Can do this in parallel if we want.
-  assert(_resize_lock->owned_by_self(), "Re-size lock not held");
+  assert(_resize_lock_owner == thread, "Re-size lock not held");
   Node* ndel[BULK_DELETE_LIMIT];
   InternalTable* table = get_table();
   assert(start_idx < stop_idx, "Must be");
@@ -500,9 +500,9 @@
   // own read-side.
   GlobalCounter::critical_section_begin(thread);
   for (size_t bucket_it = start_idx; bucket_it < stop_idx; bucket_it++) {
-    Bucket* bucket  = _table->get_bucket(bucket_it);
+    Bucket* bucket = table->get_bucket(bucket_it);
     Bucket* prefetch_bucket = (bucket_it+1) < stop_idx ?
-                              _table->get_bucket(bucket_it+1) : NULL;
+                              table->get_bucket(bucket_it+1) : NULL;
 
     if (!HaveDeletables<IsPointer<VALUE>::value, EVALUATE_FUNC>::
         have_deletable(bucket, eval_f, prefetch_bucket)) {
@@ -695,17 +695,13 @@
   if (!try_resize_lock(thread)) {
     return false;
   }
-
-  assert(_resize_lock->owned_by_self(), "Re-size lock not held");
-
+  assert(_resize_lock_owner == thread, "Re-size lock not held");
   if (_table->_log2_size == _log2_start_size ||
       _table->_log2_size <= log2_size) {
     unlock_resize_lock(thread);
     return false;
   }
-
   _new_table = new InternalTable(_table->_log2_size - 1);
-
   return true;
 }
 
@@ -713,8 +709,7 @@
 inline void ConcurrentHashTable<VALUE, CONFIG, F>::
   internal_shrink_epilog(Thread* thread)
 {
-  assert(_resize_lock->owned_by_self(), "Re-size lock not held");
-  assert(_resize_lock_owner, "Should be locked");
+  assert(_resize_lock_owner == thread, "Re-size lock not held");
 
   InternalTable* old_table = set_table_from_new();
   _size_limit_reached = false;
@@ -771,14 +766,13 @@
   internal_shrink(Thread* thread, size_t log2_size)
 {
   if (!internal_shrink_prolog(thread, log2_size)) {
-    assert(!_resize_lock->owned_by_self(), "Re-size lock held");
+    assert(_resize_lock_owner != thread, "Re-size lock held");
     return false;
   }
-  assert(_resize_lock->owned_by_self(), "Re-size lock not held");
   assert(_resize_lock_owner == thread, "Should be locked by me");
   internal_shrink_range(thread, 0, _new_table->_size);
   internal_shrink_epilog(thread);
-  assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
+  assert(_resize_lock_owner != thread, "Re-size lock held");
   return true;
 }
 
@@ -815,8 +809,7 @@
 inline void ConcurrentHashTable<VALUE, CONFIG, F>::
   internal_grow_epilog(Thread* thread)
 {
-  assert(_resize_lock->owned_by_self(), "Re-size lock not held");
-  assert(_resize_lock_owner, "Should be locked");
+  assert(_resize_lock_owner == thread, "Should be locked");
 
   InternalTable* old_table = set_table_from_new();
   unlock_resize_lock(thread);
@@ -835,14 +828,13 @@
   internal_grow(Thread* thread, size_t log2_size)
 {
   if (!internal_grow_prolog(thread, log2_size)) {
-    assert(!_resize_lock->owned_by_self(), "Re-size lock held");
+    assert(_resize_lock_owner != thread, "Re-size lock held");
     return false;
   }
-  assert(_resize_lock->owned_by_self(), "Re-size lock not held");
   assert(_resize_lock_owner == thread, "Should be locked by me");
   internal_grow_range(thread, 0, _table->_size);
   internal_grow_epilog(thread);
-  assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
+  assert(_resize_lock_owner != thread, "Re-size lock held");
   return true;
 }
 
@@ -955,15 +947,13 @@
 inline void ConcurrentHashTable<VALUE, CONFIG, F>::
   do_scan_locked(Thread* thread, FUNC& scan_f)
 {
-  assert(_resize_lock->owned_by_self() ||
-         (thread->is_VM_thread() && SafepointSynchronize::is_at_safepoint()),
-         "Re-size lock not held or not VMThread at safepoint");
+  assert(_resize_lock_owner == thread, "Re-size lock not held");
   // We can do a critical section over the entire loop but that would block
   // updates for a long time. Instead we choose to block resizes.
   InternalTable* table = get_table();
-  for (size_t bucket_it = 0; bucket_it < _table->_size; bucket_it++) {
+  for (size_t bucket_it = 0; bucket_it < table->_size; bucket_it++) {
     ScopedCS cs(thread, this);
-    if (!visit_nodes(_table->get_bucket(bucket_it), scan_f)) {
+    if (!visit_nodes(table->get_bucket(bucket_it), scan_f)) {
       break; /* ends critical section */
     }
   } /* ends critical section */
@@ -1094,17 +1084,11 @@
 inline bool ConcurrentHashTable<VALUE, CONFIG, F>::
   try_scan(Thread* thread, SCAN_FUNC& scan_f)
 {
-  assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
-  bool vm_and_safepoint = thread->is_VM_thread() &&
-                          SafepointSynchronize::is_at_safepoint();
-  if (!vm_and_safepoint && !try_resize_lock(thread)) {
+  if (!try_resize_lock(thread)) {
     return false;
   }
   do_scan_locked(thread, scan_f);
-  if (!vm_and_safepoint) {
-    unlock_resize_lock(thread);
-  }
-  assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
+  unlock_resize_lock(thread);
   return true;
 }
 
@@ -1113,11 +1097,11 @@
 inline void ConcurrentHashTable<VALUE, CONFIG, F>::
   do_scan(Thread* thread, SCAN_FUNC& scan_f)
 {
-  assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
+  assert(_resize_lock_owner != thread, "Re-size lock held");
   lock_resize_lock(thread);
   do_scan_locked(thread, scan_f);
   unlock_resize_lock(thread);
-  assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
+  assert(_resize_lock_owner != thread, "Re-size lock held");
 }
 
 template <typename VALUE, typename CONFIG, MEMFLAGS F>
@@ -1126,12 +1110,11 @@
   try_bulk_delete(Thread* thread, EVALUATE_FUNC& eval_f, DELETE_FUNC& del_f)
 {
   if (!try_resize_lock(thread)) {
-    assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
     return false;
   }
   do_bulk_delete_locked(thread, eval_f, del_f);
   unlock_resize_lock(thread);
-  assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
+  assert(_resize_lock_owner != thread, "Re-size lock held");
   return true;
 }
 
@@ -1140,11 +1123,9 @@
 inline void ConcurrentHashTable<VALUE, CONFIG, F>::
   bulk_delete(Thread* thread, EVALUATE_FUNC& eval_f, DELETE_FUNC& del_f)
 {
-  assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
   lock_resize_lock(thread);
   do_bulk_delete_locked(thread, eval_f, del_f);
   unlock_resize_lock(thread);
-  assert(!_resize_lock->owned_by_self(), "Re-size lock not held");
 }
 
 template <typename VALUE, typename CONFIG, MEMFLAGS F>
@@ -1155,17 +1136,16 @@
 {
   NumberSeq summary;
   size_t literal_bytes = 0;
-  if ((thread->is_VM_thread() && !SafepointSynchronize::is_at_safepoint()) ||
-      (!thread->is_VM_thread() && !try_resize_lock(thread))) {
+  if (!try_resize_lock(thread)) {
     st->print_cr("statistics unavailable at this moment");
     return;
   }
 
   InternalTable* table = get_table();
-  for (size_t bucket_it = 0; bucket_it < _table->_size; bucket_it++) {
+  for (size_t bucket_it = 0; bucket_it < table->_size; bucket_it++) {
     ScopedCS cs(thread, this);
     size_t count = 0;
-    Bucket* bucket = _table->get_bucket(bucket_it);
+    Bucket* bucket = table->get_bucket(bucket_it);
     if (bucket->have_redirect() || bucket->is_locked()) {
         continue;
     }
@@ -1208,9 +1188,37 @@
   st->print_cr("Std. dev. of bucket size: %9.3f", summary.sd());
   st->print_cr("Maximum bucket size     : %9" PRIuPTR,
                (size_t)summary.maximum());
-  if (!thread->is_VM_thread()) {
-    unlock_resize_lock(thread);
+  unlock_resize_lock(thread);
+}
+
+template <typename VALUE, typename CONFIG, MEMFLAGS F>
+inline bool ConcurrentHashTable<VALUE, CONFIG, F>::
+  try_move_nodes_to(Thread* thread, ConcurrentHashTable<VALUE, CONFIG, F>* to_cht)
+{
+  if (!try_resize_lock(thread)) {
+    return false;
   }
+  assert(_new_table == NULL, "Must be NULL");
+  for (size_t bucket_it = 0; bucket_it < _table->_size; bucket_it++) {
+    Bucket* bucket = _table->get_bucket(bucket_it);
+    assert(!bucket->have_redirect() && !bucket->is_locked(), "Table must be uncontended");
+    while (bucket->first() != NULL) {
+      Node* move_node = bucket->first();
+      bool ok = bucket->cas_first(move_node->next(), move_node);
+      assert(ok, "Uncontended cas must work");
+      bool dead_hash = false;
+      size_t insert_hash = CONFIG::get_hash(*move_node->value(), &dead_hash);
+      if (!dead_hash) {
+        Bucket* insert_bucket = to_cht->get_bucket(insert_hash);
+        assert(!bucket->have_redirect() && !bucket->is_locked(), "Not bit should be present");
+        move_node->set_next(insert_bucket->first());
+        ok = insert_bucket->cas_first(move_node, insert_bucket->first());
+        assert(ok, "Uncontended cas must work");
+      }
+    }
+  }
+  unlock_resize_lock(thread);
+  return true;
 }
 
 #endif // include guard
--- a/src/hotspot/share/utilities/concurrentHashTableTasks.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/utilities/concurrentHashTableTasks.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -25,6 +25,7 @@
 #ifndef SHARE_UTILITIES_CONCURRENT_HASH_TABLE_TASKS_INLINE_HPP
 #define SHARE_UTILITIES_CONCURRENT_HASH_TABLE_TASKS_INLINE_HPP
 
+#include "utilities/globalDefinitions.hpp"
 #include "utilities/concurrentHashTable.inline.hpp"
 
 // This inline file contains BulkDeleteTask and GrowTasks which are both bucket
@@ -63,6 +64,7 @@
   // Calculate starting values.
   void setup() {
     _size_log2 = _cht->_table->_log2_size;
+    _task_size_log2 = MIN2(_task_size_log2, _size_log2);
     size_t tmp = _size_log2 > _task_size_log2 ?
                  _size_log2 - _task_size_log2 : 0;
     _stop_task = (((size_t)1) << tmp);
--- a/src/hotspot/share/utilities/globalCounter.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/utilities/globalCounter.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "utilities/globalCounter.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/thread.hpp"
 #include "runtime/threadSMR.inline.hpp"
 #include "runtime/vmThread.hpp"
--- a/src/hotspot/share/utilities/globalCounter.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/utilities/globalCounter.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -25,7 +25,7 @@
 #ifndef SHARE_UTILITIES_GLOBAL_COUNTER_INLINE_HPP
 #define SHARE_UTILITIES_GLOBAL_COUNTER_INLINE_HPP
 
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/thread.inline.hpp"
 #include "utilities/globalCounter.hpp"
 
--- a/src/hotspot/share/utilities/globalDefinitions.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/utilities/globalDefinitions.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -424,8 +424,8 @@
 //----------------------------------------------------------------------------------------------------
 // Default and minimum StringTableSize values
 
-const int defaultStringTableSize = NOT_LP64(1009) LP64_ONLY(60013);
-const int minimumStringTableSize = 1009;
+const int defaultStringTableSize = NOT_LP64(1024) LP64_ONLY(65536);
+const int minimumStringTableSize = 128;
 
 const int defaultSymbolTableSize = 20011;
 const int minimumSymbolTableSize = 1009;
--- a/src/hotspot/share/utilities/hashtable.inline.hpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/hotspot/share/utilities/hashtable.inline.hpp	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -26,7 +26,7 @@
 #define SHARE_VM_UTILITIES_HASHTABLE_INLINE_HPP
 
 #include "memory/allocation.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "utilities/hashtable.hpp"
 #include "utilities/dtrace.hpp"
 
--- a/src/java.base/aix/native/libjsig/jsig.c	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,238 +0,0 @@
-/*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-/* CopyrightVersion 1.2 */
-
-/* This is a special library that should be loaded before libc &
- * libthread to interpose the signal handler installation functions:
- * sigaction(), signal(), sigset().
- * Used for signal-chaining. See RFE 4381843.
- */
-
-#include <signal.h>
-#include <dlfcn.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include "jni.h"
-
-#define bool int
-#define true 1
-#define false 0
-
-static struct sigaction sact[NSIG]; /* saved signal handlers */
-static sigset_t jvmsigs; /* Signals used by jvm. */
-
-/* Used to synchronize the installation of signal handlers. */
-static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
-static pthread_t tid = 0;
-
-typedef void (*sa_handler_t)(int);
-typedef void (*sa_sigaction_t)(int, siginfo_t *, void *);
-// signal_t is already defined on AIX.
-typedef sa_handler_t (*signal_like_function_t)(int, sa_handler_t);
-typedef int (*sigaction_t)(int, const struct sigaction *, struct sigaction *);
-
-static signal_like_function_t os_signal = 0; /* os's version of signal()/sigset() */
-static sigaction_t os_sigaction = 0; /* os's version of sigaction() */
-
-static bool jvm_signal_installing = false;
-static bool jvm_signal_installed = false;
-
-static void signal_lock() {
-  pthread_mutex_lock(&mutex);
-  /* When the jvm is installing its set of signal handlers, threads
-   * other than the jvm thread should wait. */
-  if (jvm_signal_installing) {
-    if (tid != pthread_self()) {
-      pthread_cond_wait(&cond, &mutex);
-    }
-  }
-}
-
-static void signal_unlock() {
-  pthread_mutex_unlock(&mutex);
-}
-
-static sa_handler_t call_os_signal(int sig, sa_handler_t disp,
-                                   bool is_sigset) {
-  if (os_signal == NULL) {
-    if (!is_sigset) {
-      // Aix: call functions directly instead of dlsym'ing them.
-      os_signal = signal;
-    } else {
-      // Aix: call functions directly instead of dlsym'ing them.
-      os_signal = sigset;
-    }
-    if (os_signal == NULL) {
-      printf("%s\n", dlerror());
-      exit(0);
-    }
-  }
-  return (*os_signal)(sig, disp);
-}
-
-static void save_signal_handler(int sig, sa_handler_t disp) {
-  sigset_t set;
-  sact[sig].sa_handler = disp;
-  sigemptyset(&set);
-  sact[sig].sa_mask = set;
-  sact[sig].sa_flags = 0;
-}
-
-static sa_handler_t set_signal(int sig, sa_handler_t disp, bool is_sigset) {
-  sa_handler_t oldhandler;
-  bool sigused;
-
-  signal_lock();
-
-  sigused = sigismember(&jvmsigs, sig);
-  if (jvm_signal_installed && sigused) {
-    /* jvm has installed its signal handler for this signal. */
-    /* Save the handler. Don't really install it. */
-    oldhandler = sact[sig].sa_handler;
-    save_signal_handler(sig, disp);
-
-    signal_unlock();
-    return oldhandler;
-  } else if (jvm_signal_installing) {
-    /* jvm is installing its signal handlers. Install the new
-     * handlers and save the old ones. jvm uses sigaction().
-     * Leave the piece here just in case. */
-    oldhandler = call_os_signal(sig, disp, is_sigset);
-    save_signal_handler(sig, oldhandler);
-
-    /* Record the signals used by jvm */
-    sigaddset(&jvmsigs, sig);
-
-    signal_unlock();
-    return oldhandler;
-  } else {
-    /* jvm has no relation with this signal (yet). Install the
-     * the handler. */
-    oldhandler = call_os_signal(sig, disp, is_sigset);
-
-    signal_unlock();
-    return oldhandler;
-  }
-}
-
-JNIEXPORT sa_handler_t JNICALL
-signal(int sig, sa_handler_t disp) {
-  return set_signal(sig, disp, false);
-}
-
-JNIEXPORT sa_handler_t JNICALL
-sigset(int sig, sa_handler_t disp) {
-  return set_signal(sig, disp, true);
-}
-
-static int call_os_sigaction(int sig, const struct sigaction  *act,
-                             struct sigaction *oact) {
-  if (os_sigaction == NULL) {
-    // Aix: call functions directly instead of dlsym'ing them.
-    os_sigaction = sigaction;
-    if (os_sigaction == NULL) {
-      printf("%s\n", dlerror());
-      exit(0);
-    }
-  }
-  return (*os_sigaction)(sig, act, oact);
-}
-
-JNIEXPORT int JNICALL
-sigaction(int sig, const struct sigaction *act, struct sigaction *oact) {
-  int res;
-  bool sigused;
-  struct sigaction oldAct;
-
-  signal_lock();
-
-  sigused = sigismember(&jvmsigs, sig);
-  if (jvm_signal_installed && sigused) {
-    /* jvm has installed its signal handler for this signal. */
-    /* Save the handler. Don't really install it. */
-    if (oact != NULL) {
-      *oact = sact[sig];
-    }
-    if (act != NULL) {
-      sact[sig] = *act;
-    }
-
-    signal_unlock();
-    return 0;
-  } else if (jvm_signal_installing) {
-    /* jvm is installing its signal handlers. Install the new
-     * handlers and save the old ones. */
-    res = call_os_sigaction(sig, act, &oldAct);
-    sact[sig] = oldAct;
-    if (oact != NULL) {
-      *oact = oldAct;
-    }
-
-    /* Record the signals used by jvm. */
-    sigaddset(&jvmsigs, sig);
-
-    signal_unlock();
-    return res;
-  } else {
-    /* jvm has no relation with this signal (yet). Install the
-     * the handler. */
-    res = call_os_sigaction(sig, act, oact);
-
-    signal_unlock();
-    return res;
-  }
-}
-
-/* The three functions for the jvm to call into. */
-JNIEXPORT void JNICALL
-JVM_begin_signal_setting() {
-  signal_lock();
-  sigemptyset(&jvmsigs);
-  jvm_signal_installing = true;
-  tid = pthread_self();
-  signal_unlock();
-}
-
-JNIEXPORT void JNICALL
-JVM_end_signal_setting() {
-  signal_lock();
-  jvm_signal_installed = true;
-  jvm_signal_installing = false;
-  pthread_cond_broadcast(&cond);
-  signal_unlock();
-}
-
-JNIEXPORT struct sigaction * JNICALL
-JVM_get_signal_action(int sig) {
-  /* Does race condition make sense here? */
-  if (sigismember(&jvmsigs, sig)) {
-    return &sact[sig];
-  }
-  return NULL;
-}
--- a/src/java.base/share/classes/java/lang/Object.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/lang/Object.java	Mon Jun 11 09:29:44 2018 +0200
@@ -333,12 +333,12 @@
      * by being <em>notified</em> or <em>interrupted</em>, or until a
      * certain amount of real time has elapsed.
      * <p>
-     * In all respects, this method behaves as if {@code wait(timeout, 0)}
+     * In all respects, this method behaves as if {@code wait(timeoutMillis, 0)}
      * had been called. See the specification of the {@link #wait(long, int)} method
      * for details.
      *
-     * @param  timeout the maximum time to wait, in milliseconds
-     * @throws IllegalArgumentException if the value of {@code timeout} is negative
+     * @param  timeoutMillis the maximum time to wait, in milliseconds
+     * @throws IllegalArgumentException if {@code timeoutMillis} is negative
      * @throws IllegalMonitorStateException if the current thread is not
      *         the owner of the object's monitor
      * @throws InterruptedException if any thread interrupted the current thread before or
@@ -349,7 +349,7 @@
      * @see    #wait()
      * @see    #wait(long, int)
      */
-    public final native void wait(long timeout) throws InterruptedException;
+    public final native void wait(long timeoutMillis) throws InterruptedException;
 
     /**
      * Causes the current thread to wait until it is awakened, typically
@@ -378,7 +378,7 @@
      * thread <var>T</var>.
      * <li>The specified amount of real time has elapsed, more or less.
      * The amount of real time, in nanoseconds, is given by the expression
-     * {@code 1000000 * timeout + nanos}. If {@code timeout} and {@code nanos}
+     * {@code 1000000 * timeoutMillis + nanos}. If {@code timeoutMillis} and {@code nanos}
      * are both zero, then real time is not taken into consideration and the
      * thread waits until awakened by one of the other causes.
      * <li>Thread <var>T</var> is awakened spuriously. (See below.)
@@ -423,17 +423,17 @@
      * <pre>{@code
      *     synchronized (obj) {
      *         while (<condition does not hold> and <timeout not exceeded>) {
-     *             long timeout = ... ; // recompute timeout values
+     *             long timeoutMillis = ... ; // recompute timeout values
      *             int nanos = ... ;
-     *             obj.wait(timeout, nanos);
+     *             obj.wait(timeoutMillis, nanos);
      *         }
      *         ... // Perform action appropriate to condition or timeout
      *     }
      * }</pre>
      *
-     * @param  timeout the maximum time to wait, in milliseconds
+     * @param  timeoutMillis the maximum time to wait, in milliseconds
      * @param  nanos   additional time, in nanoseconds, in the range range 0-999999 inclusive
-     * @throws IllegalArgumentException if the value of {@code timeout} is negative,
+     * @throws IllegalArgumentException if {@code timeoutMillis} is negative,
      *         or if the value of {@code nanos} is out of range
      * @throws IllegalMonitorStateException if the current thread is not
      *         the owner of the object's monitor
@@ -445,9 +445,9 @@
      * @see    #wait()
      * @see    #wait(long)
      */
-    public final void wait(long timeout, int nanos) throws InterruptedException {
-        if (timeout < 0) {
-            throw new IllegalArgumentException("timeout value is negative");
+    public final void wait(long timeoutMillis, int nanos) throws InterruptedException {
+        if (timeoutMillis < 0) {
+            throw new IllegalArgumentException("timeoutMillis value is negative");
         }
 
         if (nanos < 0 || nanos > 999999) {
@@ -456,10 +456,10 @@
         }
 
         if (nanos > 0) {
-            timeout++;
+            timeoutMillis++;
         }
 
-        wait(timeout);
+        wait(timeoutMillis);
     }
 
     /**
--- a/src/java.base/share/classes/java/net/SocketOutputStream.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/net/SocketOutputStream.java	Mon Jun 11 09:29:44 2018 +0200
@@ -109,10 +109,6 @@
         try {
             socketWrite0(fd, b, off, len);
         } catch (SocketException se) {
-            if (se instanceof sun.net.ConnectionResetException) {
-                impl.setConnectionReset();
-                se = new SocketException("Connection reset");
-            }
             if (impl.isClosedOrPending()) {
                 throw new SocketException("Socket closed");
             } else {
--- a/src/java.base/share/classes/java/nio/channels/SelectionKey.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/nio/channels/SelectionKey.java	Mon Jun 11 09:29:44 2018 +0200
@@ -190,6 +190,83 @@
     public abstract SelectionKey interestOps(int ops);
 
     /**
+     * Atomically sets this key's interest set to the bitwise union ("or") of
+     * the existing interest set and the given value. This method is guaranteed
+     * to be atomic with respect to other concurrent calls to this method or to
+     * {@link #interestOpsAnd(int)}.
+     *
+     * <p> This method may be invoked at any time.  If this method is invoked
+     * while a selection operation is in progress then it has no effect upon
+     * that operation; the change to the key's interest set will be seen by the
+     * next selection operation.
+     *
+     * @implSpec The default implementation synchronizes on this key and invokes
+     * {@code interestOps()} and {@code interestOps(int)} to retrieve and set
+     * this key's interest set.
+     *
+     * @param  ops  The interest set to apply
+     *
+     * @return  The previous interest set
+     *
+     * @throws  IllegalArgumentException
+     *          If a bit in the set does not correspond to an operation that
+     *          is supported by this key's channel, that is, if
+     *          {@code (ops & ~channel().validOps()) != 0}
+     *
+     * @throws  CancelledKeyException
+     *          If this key has been cancelled
+     *
+     * @since 11
+     */
+    public int interestOpsOr(int ops) {
+        synchronized (this) {
+            int oldVal = interestOps();
+            interestOps(oldVal | ops);
+            return oldVal;
+        }
+    }
+
+    /**
+     * Atomically sets this key's interest set to the bitwise intersection ("and")
+     * of the existing interest set and the given value. This method is guaranteed
+     * to be atomic with respect to other concurrent calls to this method or to
+     * {@link #interestOpsOr(int)}.
+     *
+     * <p> This method may be invoked at any time.  If this method is invoked
+     * while a selection operation is in progress then it has no effect upon
+     * that operation; the change to the key's interest set will be seen by the
+     * next selection operation.
+     *
+     * @apiNote Unlike the {@code interestOps(int)} and {@code interestOpsOr(int)}
+     * methods, this method does not throw {@code IllegalArgumentException} when
+     * invoked with bits in the interest set that do not correspond to an
+     * operation that is supported by this key's channel. This is to allow
+     * operation bits in the interest set to be cleared using bitwise complement
+     * values, e.g., {@code interestOpsAnd(~SelectionKey.OP_READ)} will remove
+     * the {@code OP_READ} from the interest set without affecting other bits.
+     *
+     * @implSpec The default implementation synchronizes on this key and invokes
+     * {@code interestOps()} and {@code interestOps(int)} to retrieve and set
+     * this key's interest set.
+     *
+     * @param  ops  The interest set to apply
+     *
+     * @return  The previous interest set
+     *
+     * @throws  CancelledKeyException
+     *          If this key has been cancelled
+     *
+     * @since 11
+     */
+    public int interestOpsAnd(int ops) {
+        synchronized (this) {
+            int oldVal = interestOps();
+            interestOps(oldVal & ops);
+            return oldVal;
+        }
+    }
+
+    /**
      * Retrieves this key's ready-operation set.
      *
      * <p> It is guaranteed that the returned set will only contain operation
--- a/src/java.base/share/classes/java/nio/file/Files.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/nio/file/Files.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2018, 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
@@ -1391,8 +1391,9 @@
      *          specific exception)</i>
      * @throws  DirectoryNotEmptyException
      *          the {@code REPLACE_EXISTING} option is specified but the file
-     *          cannot be replaced because it is a non-empty directory
-     *          <i>(optional specific exception)</i>
+     *          cannot be replaced because it is a non-empty directory, or the
+     *          source is a non-empty directory containing entries that would
+     *          be required to be moved <i>(optional specific exceptions)</i>
      * @throws  AtomicMoveNotSupportedException
      *          if the options array contains the {@code ATOMIC_MOVE} option but
      *          the file cannot be moved as an atomic file system operation.
--- a/src/java.base/share/classes/java/time/Clock.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/time/Clock.java	Mon Jun 11 09:29:44 2018 +0200
@@ -586,7 +586,7 @@
      * This is typically used for testing.
      */
     static final class FixedClock extends Clock implements Serializable {
-       private static final long serialVersionUID = 7430389292664866958L;
+        private static final long serialVersionUID = 7430389292664866958L;
         private final Instant instant;
         private final ZoneId zone;
 
@@ -636,7 +636,7 @@
      * Implementation of a clock that adds an offset to an underlying clock.
      */
     static final class OffsetClock extends Clock implements Serializable {
-       private static final long serialVersionUID = 2007484719125426256L;
+        private static final long serialVersionUID = 2007484719125426256L;
         private final Clock baseClock;
         private final Duration offset;
 
--- a/src/java.base/share/classes/java/time/Duration.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/time/Duration.java	Mon Jun 11 09:29:44 2018 +0200
@@ -231,7 +231,7 @@
      * This method allows an arbitrary number of nanoseconds to be passed in.
      * The factory will alter the values of the second and nanosecond in order
      * to ensure that the stored nanosecond is in the range 0 to 999,999,999.
-     * For example, the following will result in the exactly the same duration:
+     * For example, the following will result in exactly the same duration:
      * <pre>
      *  Duration.ofSeconds(3, 1);
      *  Duration.ofSeconds(4, -999_999_999);
@@ -1357,12 +1357,14 @@
      * Truncating the duration returns a copy of the original with conceptual fields
      * smaller than the specified unit set to zero.
      * For example, truncating with the {@link ChronoUnit#MINUTES MINUTES} unit will
-     * round down to the nearest minute, setting the seconds and nanoseconds to zero.
+     * round down towards zero to the nearest minute, setting the seconds and
+     * nanoseconds to zero.
      * <p>
      * The unit must have a {@linkplain TemporalUnit#getDuration() duration}
      * that divides into the length of a standard day without remainder.
-     * This includes all supplied time units on {@link ChronoUnit} and
-     * {@link ChronoUnit#DAYS DAYS}. Other ChronoUnits throw an exception.
+     * This includes all
+     * {@linkplain ChronoUnit#isTimeBased() time-based units on {@code ChronoUnit}}
+     * and {@link ChronoUnit#DAYS DAYS}. Other ChronoUnits throw an exception.
      * <p>
      * This instance is immutable and unaffected by this method call.
      *
@@ -1388,7 +1390,7 @@
             throw new UnsupportedTemporalTypeException("Unit must divide into a standard day without remainder");
         }
         long nod = (seconds % LocalTime.SECONDS_PER_DAY) * LocalTime.NANOS_PER_SECOND + nanos;
-        long result = (nod / dur) * dur ;
+        long result = (nod / dur) * dur;
         return plusNanos(result - nod);
     }
 
--- a/src/java.base/share/classes/java/time/Instant.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/time/Instant.java	Mon Jun 11 09:29:44 2018 +0200
@@ -311,7 +311,7 @@
      * This method allows an arbitrary number of nanoseconds to be passed in.
      * The factory will alter the values of the second and nanosecond in order
      * to ensure that the stored nanosecond is in the range 0 to 999,999,999.
-     * For example, the following will result in the exactly the same instant:
+     * For example, the following will result in exactly the same instant:
      * <pre>
      *  Instant.ofEpochSecond(3, 1);
      *  Instant.ofEpochSecond(4, -999_999_999);
@@ -757,7 +757,7 @@
             throw new UnsupportedTemporalTypeException("Unit must divide into a standard day without remainder");
         }
         long nod = (seconds % LocalTime.SECONDS_PER_DAY) * LocalTime.NANOS_PER_SECOND + nanos;
-        long result = Math.floorDiv(nod, dur) * dur ;
+        long result = Math.floorDiv(nod, dur) * dur;
         return plusNanos(result - nod);
     }
 
--- a/src/java.base/share/classes/java/time/LocalTime.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/time/LocalTime.java	Mon Jun 11 09:29:44 2018 +0200
@@ -356,14 +356,14 @@
      * @return the local time, not null
      * @since 9
      */
-     public static LocalTime ofInstant(Instant instant, ZoneId zone) {
-         Objects.requireNonNull(instant, "instant");
-         Objects.requireNonNull(zone, "zone");
-         ZoneOffset offset = zone.getRules().getOffset(instant);
-         long localSecond = instant.getEpochSecond() + offset.getTotalSeconds();
-         int secsOfDay = Math.floorMod(localSecond, SECONDS_PER_DAY);
-         return ofNanoOfDay(secsOfDay * NANOS_PER_SECOND + instant.getNano());
-     }
+    public static LocalTime ofInstant(Instant instant, ZoneId zone) {
+        Objects.requireNonNull(instant, "instant");
+        Objects.requireNonNull(zone, "zone");
+        ZoneOffset offset = zone.getRules().getOffset(instant);
+        long localSecond = instant.getEpochSecond() + offset.getTotalSeconds();
+        int secsOfDay = Math.floorMod(localSecond, SECONDS_PER_DAY);
+        return ofNanoOfDay(secsOfDay * NANOS_PER_SECOND + instant.getNano());
+    }
 
     //-----------------------------------------------------------------------
     /**
--- a/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java	Mon Jun 11 09:29:44 2018 +0200
@@ -110,7 +110,7 @@
  *        int year = date.get(ChronoField.YEAR);
  *        System.out.printf("  Today is %s %s %d-%s-%d%n", date.getChronology().getID(),
  *                dow, day, month, year);
-
+ *
  *        // Print today's date and the last day of the year
  *        ChronoLocalDate now1 = Chronology.of("Hijrah").dateNow();
  *        ChronoLocalDate first = now1.with(ChronoField.DAY_OF_MONTH, 1)
--- a/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTime.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTime.java	Mon Jun 11 09:29:44 2018 +0200
@@ -201,7 +201,7 @@
      *
      * @return the date part of this date-time, not null
      */
-    D toLocalDate() ;
+    D toLocalDate();
 
     /**
      * Gets the local time part of this date-time.
--- a/src/java.base/share/classes/java/time/chrono/Chronology.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/time/chrono/Chronology.java	Mon Jun 11 09:29:44 2018 +0200
@@ -736,8 +736,8 @@
      * @throws DateTimeException if any of the values are out of range
      * @since 9
      */
-     public default long epochSecond(int prolepticYear, int month, int dayOfMonth,
-                                     int hour, int minute, int second, ZoneOffset zoneOffset) {
+    public default long epochSecond(int prolepticYear, int month, int dayOfMonth,
+                                    int hour, int minute, int second, ZoneOffset zoneOffset) {
         Objects.requireNonNull(zoneOffset, "zoneOffset");
         HOUR_OF_DAY.checkValidValue(hour);
         MINUTE_OF_HOUR.checkValidValue(minute);
@@ -765,8 +765,8 @@
      * @throws DateTimeException if any of the values are out of range
      * @since 9
      */
-     public default long epochSecond(Era era, int yearOfEra, int month, int dayOfMonth,
-                                     int hour, int minute, int second, ZoneOffset zoneOffset) {
+    public default long epochSecond(Era era, int yearOfEra, int month, int dayOfMonth,
+                                    int hour, int minute, int second, ZoneOffset zoneOffset) {
         Objects.requireNonNull(era, "era");
         return epochSecond(prolepticYear(era, yearOfEra), month, dayOfMonth, hour, minute, second, zoneOffset);
     }
--- a/src/java.base/share/classes/java/time/chrono/IsoChronology.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/time/chrono/IsoChronology.java	Mon Jun 11 09:29:44 2018 +0200
@@ -287,9 +287,9 @@
      *         or if the day-of-month is invalid for the month-of-year
      * @since 9
      */
-     @Override
-     public long epochSecond(int prolepticYear, int month, int dayOfMonth,
-                             int hour, int minute, int second, ZoneOffset zoneOffset) {
+    @Override
+    public long epochSecond(int prolepticYear, int month, int dayOfMonth,
+                            int hour, int minute, int second, ZoneOffset zoneOffset) {
         YEAR.checkValidValue(prolepticYear);
         MONTH_OF_YEAR.checkValidValue(month);
         DAY_OF_MONTH.checkValidValue(dayOfMonth);
--- a/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java	Mon Jun 11 09:29:44 2018 +0200
@@ -459,38 +459,38 @@
         return era.getPrivateEra().getSinceDate().getYear() + yearOfEra - 1;
     }
 
-     private ChronoLocalDate resolveYMD(JapaneseEra era, int yoe, Map<TemporalField,Long> fieldValues, ResolverStyle resolverStyle) {
-         fieldValues.remove(ERA);
-         fieldValues.remove(YEAR_OF_ERA);
-         if (resolverStyle == ResolverStyle.LENIENT) {
-             int y = prolepticYearLenient(era, yoe);
-             long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1);
-             long days = Math.subtractExact(fieldValues.remove(DAY_OF_MONTH), 1);
-             return date(y, 1, 1).plus(months, MONTHS).plus(days, DAYS);
-         }
-         int moy = range(MONTH_OF_YEAR).checkValidIntValue(fieldValues.remove(MONTH_OF_YEAR), MONTH_OF_YEAR);
-         int dom = range(DAY_OF_MONTH).checkValidIntValue(fieldValues.remove(DAY_OF_MONTH), DAY_OF_MONTH);
-         if (resolverStyle == ResolverStyle.SMART) {  // previous valid
-             if (yoe < 1) {
-                 throw new DateTimeException("Invalid YearOfEra: " + yoe);
-             }
-             int y = prolepticYearLenient(era, yoe);
-             JapaneseDate result;
-             try {
-                 result = date(y, moy, dom);
-             } catch (DateTimeException ex) {
-                 result = date(y, moy, 1).with(TemporalAdjusters.lastDayOfMonth());
-             }
-             // handle the era being changed
-             // only allow if the new date is in the same Jan-Dec as the era change
-             // determine by ensuring either original yoe or result yoe is 1
-             if (result.getEra() != era && result.get(YEAR_OF_ERA) > 1 && yoe > 1) {
-                 throw new DateTimeException("Invalid YearOfEra for Era: " + era + " " + yoe);
-             }
-             return result;
-         }
-         return date(era, yoe, moy, dom);
-     }
+    private ChronoLocalDate resolveYMD(JapaneseEra era, int yoe, Map<TemporalField,Long> fieldValues, ResolverStyle resolverStyle) {
+        fieldValues.remove(ERA);
+        fieldValues.remove(YEAR_OF_ERA);
+        if (resolverStyle == ResolverStyle.LENIENT) {
+            int y = prolepticYearLenient(era, yoe);
+            long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1);
+            long days = Math.subtractExact(fieldValues.remove(DAY_OF_MONTH), 1);
+            return date(y, 1, 1).plus(months, MONTHS).plus(days, DAYS);
+        }
+        int moy = range(MONTH_OF_YEAR).checkValidIntValue(fieldValues.remove(MONTH_OF_YEAR), MONTH_OF_YEAR);
+        int dom = range(DAY_OF_MONTH).checkValidIntValue(fieldValues.remove(DAY_OF_MONTH), DAY_OF_MONTH);
+        if (resolverStyle == ResolverStyle.SMART) {  // previous valid
+            if (yoe < 1) {
+                throw new DateTimeException("Invalid YearOfEra: " + yoe);
+            }
+            int y = prolepticYearLenient(era, yoe);
+            JapaneseDate result;
+            try {
+                result = date(y, moy, dom);
+            } catch (DateTimeException ex) {
+                result = date(y, moy, 1).with(TemporalAdjusters.lastDayOfMonth());
+            }
+            // handle the era being changed
+            // only allow if the new date is in the same Jan-Dec as the era change
+            // determine by ensuring either original yoe or result yoe is 1
+            if (result.getEra() != era && result.get(YEAR_OF_ERA) > 1 && yoe > 1) {
+                throw new DateTimeException("Invalid YearOfEra for Era: " + era + " " + yoe);
+            }
+            return result;
+        }
+        return date(era, yoe, moy, dom);
+    }
 
     private ChronoLocalDate resolveYD(JapaneseEra era, int yoe, Map <TemporalField,Long> fieldValues, ResolverStyle resolverStyle) {
         fieldValues.remove(ERA);
--- a/src/java.base/share/classes/java/time/chrono/JapaneseEra.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/time/chrono/JapaneseEra.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -123,14 +123,19 @@
      */
     public static final JapaneseEra SHOWA = new JapaneseEra(1, LocalDate.of(1926, 12, 25));
     /**
-     * The singleton instance for the 'Heisei' era (1989-01-08 - current)
+     * The singleton instance for the 'Heisei' era (1989-01-08 - 2019-04-30)
      * which has the value 2.
      */
     public static final JapaneseEra HEISEI = new JapaneseEra(2, LocalDate.of(1989, 1, 8));
+    /**
+     * The singleton instance for the 'NewEra' era (2019-05-01 - current)
+     * which has the value 3.
+     */
+    private static final JapaneseEra NEWERA = new JapaneseEra(3, LocalDate.of(2019, 5, 1));
 
     // The number of predefined JapaneseEra constants.
     // There may be a supplemental era defined by the property.
-    private static final int N_ERA_CONSTANTS = HEISEI.getValue() + ERA_OFFSET;
+    private static final int N_ERA_CONSTANTS = NEWERA.getValue() + ERA_OFFSET;
 
     /**
      * Serialization version.
@@ -148,6 +153,7 @@
         KNOWN_ERAS[1] = TAISHO;
         KNOWN_ERAS[2] = SHOWA;
         KNOWN_ERAS[3] = HEISEI;
+        KNOWN_ERAS[4] = NEWERA;
         for (int i = N_ERA_CONSTANTS; i < ERA_CONFIG.length; i++) {
             CalendarDate date = ERA_CONFIG[i].getSinceDate();
             LocalDate isoDate = LocalDate.of(date.getYear(), date.getMonth(), date.getDayOfMonth());
--- a/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java	Mon Jun 11 09:29:44 2018 +0200
@@ -3049,7 +3049,7 @@
      * Prints and parses a numeric date-time field with optional padding.
      */
     static final class FractionPrinterParser extends NumberPrinterParser {
-       private final boolean decimalPoint;
+        private final boolean decimalPoint;
 
         /**
          * Constructor.
--- a/src/java.base/share/classes/java/time/format/DecimalStyle.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/time/format/DecimalStyle.java	Mon Jun 11 09:29:44 2018 +0200
@@ -216,7 +216,6 @@
      *
      * @param zeroDigit  the character for zero
      * @return  a copy with a new character that represents zero, not null
-
      */
     public DecimalStyle withZeroDigit(char zeroDigit) {
         if (zeroDigit == this.zeroDigit) {
--- a/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java	Mon Jun 11 09:29:44 2018 +0200
@@ -119,7 +119,7 @@
  * Providers must ensure that once a rule has been seen by the application, the
  * rule must continue to be available.
  * <p>
-*  Providers are encouraged to implement a meaningful {@code toString} method.
+ * Providers are encouraged to implement a meaningful {@code toString} method.
  * <p>
  * Many systems would like to update time-zone rules dynamically without stopping the JVM.
  * When examined in detail, this is a complex problem.
--- a/src/java.base/share/classes/java/util/Formatter.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/util/Formatter.java	Mon Jun 11 09:29:44 2018 +0200
@@ -2914,7 +2914,7 @@
                 a.append(System.lineSeparator());
                 break;
             case Conversion.PERCENT_SIGN:
-                a.append('%');
+                print("%", l);
                 break;
             default:
                 assert false;
--- a/src/java.base/share/classes/java/util/JapaneseImperialCalendar.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/util/JapaneseImperialCalendar.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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
@@ -50,6 +50,7 @@
  *     2       Taisho      1912-07-30T00:00:00 local time
  *     3       Showa       1926-12-25T00:00:00 local time
  *     4       Heisei      1989-01-08T00:00:00 local time
+ *     5       NewEra      2019-05-01T00:00:00 local time
  * ------------------------------------------------------
  * }</pre>
  *
@@ -71,8 +72,10 @@
  * </pre>
  * where
  * <dl>
- * <dt>{@code <name>:}<dd>the full name of the new era (non-ASCII characters allowed)
- * <dt>{@code <abbr>:}<dd>the abbreviation of the new era (non-ASCII characters allowed)
+ * <dt>{@code <name>:}<dd>the full name of the new era (non-ASCII characters allowed,
+ * either in platform's native encoding or in Unicode escape notation, {@code \\uXXXX})
+ * <dt>{@code <abbr>:}<dd>the abbreviation of the new era (non-ASCII characters allowed,
+ * either in platform's native encoding or in Unicode escape notation, {@code \\uXXXX})
  * <dt>{@code <time['u']>:}<dd>the start time of the new era represented by
  * milliseconds from 1970-01-01T00:00:00 local time or UTC if {@code 'u'} is
  * appended to the milliseconds value. (ASCII digits only)
@@ -125,6 +128,11 @@
      */
     public static final int HEISEI = 4;
 
+    /**
+     * The ERA constant designating the NewEra era.
+     */
+    private static final int NEWERA = 5;
+
     private static final int EPOCH_OFFSET   = 719163; // Fixed date of January 1, 1970 (Gregorian)
 
     // Useful millisecond constants.  Although ONE_DAY and ONE_WEEK can fit
@@ -155,6 +163,9 @@
     // Fixed date of the first date of each era.
     private static final long[] sinceFixedDates;
 
+    // The current era
+    private static final int currentEra;
+
     /*
      * <pre>
      *                                 Greatest       Least
@@ -251,13 +262,18 @@
         // eras[BEFORE_MEIJI] and sinceFixedDate[BEFORE_MEIJI] are the
         // same as Gregorian.
         int index = BEFORE_MEIJI;
+        int current = index;
         sinceFixedDates[index] = gcal.getFixedDate(BEFORE_MEIJI_ERA.getSinceDate());
         eras[index++] = BEFORE_MEIJI_ERA;
         for (Era e : es) {
+            if(e.getSince(TimeZone.NO_TIMEZONE) < System.currentTimeMillis()) {
+                current = index;
+            }
             CalendarDate d = e.getSinceDate();
             sinceFixedDates[index] = gcal.getFixedDate(d);
             eras[index++] = e;
         }
+        currentEra = current;
 
         LEAST_MAX_VALUES[ERA] = MAX_VALUES[ERA] = eras.length - 1;
 
@@ -1743,12 +1759,12 @@
                     }
                 } else if (transitionYear) {
                     if (jdate.getYear() == 1) {
-                        // As of Heisei (since Meiji) there's no case
+                        // As of NewEra (since Meiji) there's no case
                         // that there are multiple transitions in a
                         // year.  Historically there was such
                         // case. There might be such case again in the
                         // future.
-                        if (era > HEISEI) {
+                        if (era > NEWERA) {
                             CalendarDate pd = eras[era - 1].getSinceDate();
                             if (normalizedYear == pd.getYear()) {
                                 d.setMonth(pd.getMonth()).setDayOfMonth(pd.getDayOfMonth());
@@ -1883,7 +1899,7 @@
             year = isSet(YEAR) ? internalGet(YEAR) : 1;
         } else {
             if (isSet(YEAR)) {
-                era = eras.length - 1;
+                era = currentEra;
                 year = internalGet(YEAR);
             } else {
                 // Equivalent to 1970 (Gregorian)
@@ -2367,7 +2383,7 @@
      * default ERA is the current era, but a zero (unset) ERA means before Meiji.
      */
     private int internalGetEra() {
-        return isSet(ERA) ? internalGet(ERA) : eras.length - 1;
+        return isSet(ERA) ? internalGet(ERA) : currentEra;
     }
 
     /**
--- a/src/java.base/share/classes/java/util/concurrent/TimeUnit.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/util/concurrent/TimeUnit.java	Mon Jun 11 09:29:44 2018 +0200
@@ -35,6 +35,7 @@
 
 package java.util.concurrent;
 
+import java.time.Duration;
 import java.time.temporal.ChronoUnit;
 import java.util.Objects;
 
@@ -192,6 +193,50 @@
     }
 
     /**
+     * Converts the given time duration to this unit.
+     *
+     * <p>For any TimeUnit {@code unit},
+     * {@code unit.convert(Duration.ofNanos(n))}
+     * is equivalent to
+     * {@code unit.convert(n, NANOSECONDS)}, and
+     * {@code unit.convert(Duration.of(n, unit.toChronoUnit()))}
+     * is equivalent to {@code n} (in the absence of overflow).
+     *
+     * @param duration the time duration
+     * @return the converted duration in this unit,
+     * or {@code Long.MIN_VALUE} if conversion would negatively overflow,
+     * or {@code Long.MAX_VALUE} if it would positively overflow.
+     * @throws NullPointerException if {@code duration} is null
+     * @see Duration#of(long,TemporalUnit)
+     * @since 11
+     */
+    public long convert(Duration duration) {
+        long secs = duration.getSeconds();
+        int nano = duration.getNano();
+        if (secs < 0 && nano > 0) {
+            // use representation compatible with integer division
+            secs++;
+            nano -= SECOND_SCALE;
+        }
+        final long s, nanoVal;
+        // Optimize for the common case - NANOSECONDS without overflow
+        if (this == NANOSECONDS)
+            nanoVal = nano;
+        else if ((s = scale) < SECOND_SCALE)
+            nanoVal = nano / s;
+        else if (this == SECONDS)
+            return secs;
+        else
+            return secs / secRatio;
+        long val = secs * secRatio + nanoVal;
+        return ((secs < maxSecs && secs > -maxSecs) ||
+                (secs == maxSecs && val > 0) ||
+                (secs == -maxSecs && val < 0))
+            ? val
+            : (secs > 0) ? Long.MAX_VALUE : Long.MIN_VALUE;
+    }
+
+    /**
      * Equivalent to
      * {@link #convert(long, TimeUnit) NANOSECONDS.convert(duration, this)}.
      * @param duration the duration
@@ -221,10 +266,8 @@
      */
     public long toMicros(long duration) {
         long s, m;
-        if ((s = scale) == MICRO_SCALE)
-            return duration;
-        else if (s < MICRO_SCALE)
-            return duration / microRatio;
+        if ((s = scale) <= MICRO_SCALE)
+            return (s == MICRO_SCALE) ? duration : duration / microRatio;
         else if (duration > (m = maxMicros))
             return Long.MAX_VALUE;
         else if (duration < -m)
@@ -243,10 +286,8 @@
      */
     public long toMillis(long duration) {
         long s, m;
-        if ((s = scale) == MILLI_SCALE)
-            return duration;
-        else if (s < MILLI_SCALE)
-            return duration / milliRatio;
+        if ((s = scale) <= MILLI_SCALE)
+            return (s == MILLI_SCALE) ? duration : duration / milliRatio;
         else if (duration > (m = maxMillis))
             return Long.MAX_VALUE;
         else if (duration < -m)
@@ -265,10 +306,8 @@
      */
     public long toSeconds(long duration) {
         long s, m;
-        if ((s = scale) == SECOND_SCALE)
-            return duration;
-        else if (s < SECOND_SCALE)
-            return duration / secRatio;
+        if ((s = scale) <= SECOND_SCALE)
+            return (s == SECOND_SCALE) ? duration : duration / secRatio;
         else if (duration > (m = maxSecs))
             return Long.MAX_VALUE;
         else if (duration < -m)
--- a/src/java.base/share/classes/java/util/jar/JarFile.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/util/jar/JarFile.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -93,10 +93,14 @@
  * argument.  This assures that classes compatible with the major
  * version of the running JVM are loaded from multi-release jar files.
  *
- * <p>If the verify flag is on when opening a signed jar file, the content of
- * the file is verified against its signature embedded inside the file. Please
- * note that the verification process does not include validating the signer's
- * certificate. A caller should inspect the return value of
+ * <p> If the {@code verify} flag is on when opening a signed jar file, the content
+ * of the jar entry is verified against the signature embedded inside the manifest
+ * that is associated with its {@link JarEntry#getRealName() path name}. For a
+ * multi-release jar file, the content of a versioned entry is verfieid against
+ * its own signature and {@link JarEntry#getCodeSigners()} returns its own signers.
+ *
+ * Please note that the verification process does not include validating the
+ * signer's certificate. A caller should inspect the return value of
  * {@link JarEntry#getCodeSigners()} to further determine if the signature
  * can be trusted.
  *
--- a/src/java.base/share/classes/java/util/jar/Manifest.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/java/util/jar/Manifest.java	Mon Jun 11 09:29:44 2018 +0200
@@ -393,7 +393,27 @@
                 off += n;
                 total += n;
                 pos = tpos;
-                if (c == '\n' || c == '\r') {
+                c = tbuf[tpos-1];
+                if (c == '\n') {
+                    break;
+                }
+                if (c == '\r') {
+                    if (count == pos) {
+                        // try to see if there is a trailing LF
+                        fill();
+                        if (pos < count && tbuf[pos] == '\n') {
+                            if (total < len) {
+                                b[off++] = '\n';
+                                total++;
+                            } else {
+                                // we should always have big enough lbuf but
+                                // just in case we don't, replace the last CR
+                                // with LF.
+                                b[off - 1] = '\n';
+                            }
+                            pos++;
+                        }
+                    }
                     break;
                 }
             }
--- a/src/java.base/share/classes/sun/launcher/LauncherHelper.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/sun/launcher/LauncherHelper.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2018, 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
@@ -502,12 +502,13 @@
     }
 
     // From src/share/bin/java.c:
-    //   enum LaunchMode { LM_UNKNOWN = 0, LM_CLASS, LM_JAR, LM_MODULE }
+    //   enum LaunchMode { LM_UNKNOWN = 0, LM_CLASS, LM_JAR, LM_MODULE, LM_SOURCE }
 
     private static final int LM_UNKNOWN = 0;
     private static final int LM_CLASS   = 1;
     private static final int LM_JAR     = 2;
     private static final int LM_MODULE  = 3;
+    private static final int LM_SOURCE  = 4;
 
     static void abort(Throwable t, String msgKey, Object... args) {
         if (msgKey != null) {
@@ -538,13 +539,21 @@
      *
      * @return the application's main class
      */
+    @SuppressWarnings("fallthrough")
     public static Class<?> checkAndLoadMain(boolean printToStderr,
                                             int mode,
                                             String what) {
         initOutput(printToStderr);
 
-        Class<?> mainClass = (mode == LM_MODULE) ? loadModuleMainClass(what)
-                                                 : loadMainClass(mode, what);
+        Class<?> mainClass = null;
+        switch (mode) {
+            case LM_MODULE: case LM_SOURCE:
+                mainClass = loadModuleMainClass(what);
+                break;
+            default:
+                mainClass = loadMainClass(mode, what);
+                break;
+        }
 
         // record the real main class for UI purposes
         // neither method above can return null, they will abort()
--- a/src/java.base/share/classes/sun/launcher/resources/launcher.properties	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/sun/launcher/resources/launcher.properties	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2018, 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
@@ -25,13 +25,17 @@
 
 # Translators please note do not translate the options themselves
 java.launcher.opt.header  =   Usage: {0} [options] <mainclass> [args...]\n\
-\           (to execute a class)\n   or  {0} [options] -jar <jarfile> [args...]\n\
+\           (to execute a class)\n\
+\   or  {0} [options] -jar <jarfile> [args...]\n\
 \           (to execute a jar file)\n\
 \   or  {0} [options] -m <module>[/<mainclass>] [args...]\n\
 \       {0} [options] --module <module>[/<mainclass>] [args...]\n\
-\           (to execute the main class in a module)\n\n\
-\ Arguments following the main class, -jar <jarfile>, -m or --module\n\
-\ <module>/<mainclass> are passed as the arguments to main class.\n\n\
+\           (to execute the main class in a module)\n\
+\   or  {0} [options] <sourcefile> [args]\n\
+\           (to execute a single source-file program)\n\n\
+\ Arguments following the main class, source file, -jar <jarfile>,\n\
+\ -m or --module <module>/<mainclass> are passed as the arguments to\n\
+\ main class.\n\n\
 \ where options include:\n\n
 
 java.launcher.opt.vmselect   =\    {0}\t  to select the "{1}" VM\n
@@ -114,7 +118,7 @@
 \    -disable-@files\n\
 \                  prevent further argument file expansion\n\
 \    --enable-preview\n\
-\                  allow classes to depend on preview features of this release
+\                  allow classes to depend on preview features of this release\n\
 \To specify an argument for a long option, you can use --<name>=<value> or\n\
 \--<name> <value>.\n
 
@@ -176,7 +180,9 @@
 \    --patch-module <module>=<file>({0}<file>)*\n\
 \                      override or augment a module with classes and resources\n\
 \                      in JAR files or directories.\n\
-\    --disable-@files  disable further argument file expansion\n\n\
+\    --disable-@files  disable further argument file expansion\n\
+\    --source <version>\n\
+\                      set the version of the source in source-file mode.\n\n\
 These extra options are subject to change without notice.\n
 
 # Translators please note do not translate the options themselves
--- a/src/java.base/share/classes/sun/nio/ch/SelectionKeyImpl.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/sun/nio/ch/SelectionKeyImpl.java	Mon Jun 11 09:29:44 2018 +0200
@@ -25,6 +25,9 @@
 
 package sun.nio.ch;
 
+import java.lang.invoke.ConstantBootstraps;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.VarHandle;
 import java.nio.channels.CancelledKeyException;
 import java.nio.channels.SelectableChannel;
 import java.nio.channels.SelectionKey;
@@ -39,6 +42,13 @@
 public final class SelectionKeyImpl
     extends AbstractSelectionKey
 {
+    private static final VarHandle INTERESTOPS =
+            ConstantBootstraps.fieldVarHandle(
+                    MethodHandles.lookup(),
+                    "interestOps",
+                    VarHandle.class,
+                    SelectionKeyImpl.class, int.class);
+
     private final SelChImpl channel;
     private final SelectorImpl selector;
 
@@ -84,7 +94,35 @@
     @Override
     public SelectionKey interestOps(int ops) {
         ensureValid();
-        return nioInterestOps(ops);
+        if ((ops & ~channel().validOps()) != 0)
+            throw new IllegalArgumentException();
+        int oldOps = (int) INTERESTOPS.getAndSet(this, ops);
+        if (ops != oldOps) {
+            selector.setEventOps(this);
+        }
+        return this;
+    }
+
+    @Override
+    public int interestOpsOr(int ops) {
+        ensureValid();
+        if ((ops & ~channel().validOps()) != 0)
+            throw new IllegalArgumentException();
+        int oldVal = (int) INTERESTOPS.getAndBitwiseOr(this, ops);
+        if (oldVal != (oldVal | ops)) {
+            selector.setEventOps(this);
+        }
+        return oldVal;
+    }
+
+    @Override
+    public int interestOpsAnd(int ops) {
+        ensureValid();
+        int oldVal = (int) INTERESTOPS.getAndBitwiseAnd(this, ops);
+        if (oldVal != (oldVal & ops)) {
+            selector.setEventOps(this);
+        }
+        return oldVal;
     }
 
     @Override
--- a/src/java.base/share/classes/sun/text/resources/FormatData.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/sun/text/resources/FormatData.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2018, 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
@@ -106,6 +106,7 @@
             "T",
             "S",
             "H",
+            "N", // NewEra
         };
 
         // Japanese imperial calendar era strings
@@ -115,6 +116,7 @@
             "Taisho",
             "Showa",
             "Heisei",
+            "NewEra", // NewEra
         };
 
         return new Object[][] {
--- a/src/java.base/share/classes/sun/text/resources/JavaTimeSupplementary.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/sun/text/resources/JavaTimeSupplementary.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -159,6 +159,7 @@
             "Taisho",
             "Showa",
             "Heisei",
+            "NewEra", // New Era
         };
 
         final String[] sharedShortEras = {
--- a/src/java.base/share/classes/sun/util/calendar/Era.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/sun/util/calendar/Era.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -48,6 +48,7 @@
  *                           Taisho           1912-07-30T00:00:00 local time
  *                           Showa            1926-12-25T00:00:00 local time
  *                           Heisei           1989-01-08T00:00:00 local time
+ *                           NewEra           2019-05-01T00:00:00 local time
  *   -----------------------------------------------------------------------
  * }</pre>
  *
--- a/src/java.base/share/classes/sun/util/calendar/LocalGregorianCalendar.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/sun/util/calendar/LocalGregorianCalendar.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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
@@ -27,6 +27,8 @@
 
 import java.security.AccessController;
 import java.util.TimeZone;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import sun.security.action.GetPropertyAction;
 
 /**
@@ -41,11 +43,12 @@
         new Era("Taisho", "T", -1812153600000L, true),
         new Era("Showa",  "S", -1357603200000L, true),
         new Era("Heisei", "H",   600220800000L, true),
+        new Era("NewEra", "N",  1556668800000L, true),
     };
 
     private static boolean isValidEra(Era newEra, Era[] eras) {
         Era last = eras[eras.length - 1];
-        if (last.getSinceDate().getYear() >= newEra.getSinceDate().getYear()) {
+        if (last.getSince(null) >= newEra.getSince(null)) {
             return false;
         }
         // The new era name should be unique. Its abbr may not.
@@ -173,7 +176,7 @@
                 return null;
             }
             String key = keyvalue[0].trim();
-            String value = keyvalue[1].trim();
+            String value = convertUnicodeEscape(keyvalue[1].trim());
             switch (key) {
             case "name":
                 eraName = value;
@@ -203,6 +206,17 @@
         return new Era(eraName, abbr, since, localTime);
     }
 
+    private static String convertUnicodeEscape(String src) {
+        Matcher m = Pattern.compile("\\\\u([0-9a-fA-F]{4})").matcher(src);
+        StringBuilder sb = new StringBuilder();
+        while (m.find()) {
+            m.appendReplacement(sb,
+                Character.toString((char)Integer.parseUnsignedInt(m.group(1), 16)));
+        }
+        m.appendTail(sb);
+        return sb.toString();
+    }
+
     private LocalGregorianCalendar(String name, Era[] eras) {
         this.name = name;
         this.eras = eras;
--- a/src/java.base/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -35,8 +35,8 @@
 import sun.util.calendar.Era;
 
 /**
- * Concrete implementation of the  {@link java.util.spi.CalendarDataProvider
- * CalendarDataProvider} class for the JRE LocaleProviderAdapter.
+ * Concrete implementation of the {@link java.util.spi.CalendarNameProvider
+ * CalendarNameProvider} class for the JRE LocaleProviderAdapter.
  *
  * @author Masayoshi Okutsu
  * @author Naoto Sato
@@ -77,28 +77,43 @@
                 if (field == DAY_OF_WEEK || field == YEAR) {
                     --value;
                 }
-                if (value < 0 || value > strings.length) {
+                if (value < 0) {
                     return null;
-                } else if (value == strings.length) {
+                } else if (value >= strings.length) {
                     if (field == ERA && "japanese".equals(calendarType)) {
-                        // get the supplemental era, if any, specified through
-                        // the property "jdk.calendar.japanese.supplemental.era"
-                        // which is always the last element.
                         Era[] jeras = CalendarSystem.forName("japanese").getEras();
-                        if (jeras.length == value) {
-                            Era supEra = jeras[value - 1]; // 0-based index
-                            if (javatime) {
-                                return getBaseStyle(style) == NARROW_FORMAT ?
-                                    supEra.getAbbreviation() :
-                                    supEra.getName();
-                            } else {
-                                return (style & LONG) != 0 ?
-                                    supEra.getName() :
-                                    supEra.getAbbreviation();
+                        if (value <= jeras.length) {
+                            // Localized era name could not be retrieved from this provider.
+                            // This can occur either for NewEra or SupEra.
+                            //
+                            // If it's CLDR provider, try COMPAT first, which is guaranteed to have
+                            // the name for NewEra.
+                            if (type == LocaleProviderAdapter.Type.CLDR) {
+                                lr = LocaleProviderAdapter.forJRE().getLocaleResources(locale);
+                                key = getResourceKeyFor(LocaleProviderAdapter.Type.JRE,
+                                                calendarType, field, style, javatime);
+                                strings =
+                                    javatime ? lr.getJavaTimeNames(key) : lr.getCalendarNames(key);
                             }
+                            if (strings == null || value >= strings.length) {
+                                // Get the default name for SupEra
+                                Era supEra = jeras[value - 1]; // 0-based index
+                                if (javatime) {
+                                    return getBaseStyle(style) == NARROW_FORMAT ?
+                                        supEra.getAbbreviation() :
+                                        supEra.getName();
+                                } else {
+                                    return (style & LONG) != 0 ?
+                                        supEra.getName() :
+                                        supEra.getAbbreviation();
+                                }
+                            }
+                        } else {
+                            return null;
                         }
+                    } else {
+                        return null;
                     }
-                    return null;
                 }
                 name = strings[value];
                 // If name is empty in standalone, try its `format' style.
@@ -180,7 +195,7 @@
         return map;
     }
 
-    private int getBaseStyle(int style) {
+    private static int getBaseStyle(int style) {
         return style & ~(SHORT_STANDALONE - SHORT_FORMAT);
     }
 
@@ -261,6 +276,11 @@
     }
 
     private String getResourceKey(String type, int field, int style, boolean javatime) {
+        return getResourceKeyFor(this.type, type, field, style, javatime);
+    }
+
+    private static String getResourceKeyFor(LocaleProviderAdapter.Type adapterType,
+                            String type, int field, int style, boolean javatime) {
         int baseStyle = getBaseStyle(style);
         boolean isStandalone = (style != baseStyle);
 
@@ -284,7 +304,7 @@
                 // JRE and CLDR use different resource key conventions
                 // due to historical reasons. (JRE DateFormatSymbols.getEras returns
                 // abbreviations while other getShort*() return abbreviations.)
-                if (this.type == LocaleProviderAdapter.Type.JRE) {
+                if (adapterType == LocaleProviderAdapter.Type.JRE) {
                     if (javatime) {
                         if (baseStyle == LONG) {
                             key.append("long.");
@@ -336,7 +356,7 @@
         return key.length() > 0 ? key.toString() : null;
     }
 
-    private String toStyleName(int baseStyle) {
+    private static String toStyleName(int baseStyle) {
         switch (baseStyle) {
         case SHORT:
             return "Abbreviations";
--- a/src/java.base/share/native/launcher/main.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/native/launcher/main.c	Mon Jun 11 09:29:44 2018 +0200
@@ -183,7 +183,7 @@
         }
         // Iterate the rest of command line
         for (i = 1; i < argc; i++) {
-            JLI_List argsInFile = JLI_PreprocessArg(argv[i]);
+            JLI_List argsInFile = JLI_PreprocessArg(argv[i], JNI_TRUE);
             if (NULL == argsInFile) {
                 JLI_List_add(args, JLI_StringDup(argv[i]));
             } else {
--- a/src/java.base/share/native/libjli/args.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/native/libjli/args.c	Mon Jun 11 09:29:44 2018 +0200
@@ -79,6 +79,11 @@
 static jboolean stopExpansion = JNI_FALSE;
 static jboolean relaunch = JNI_FALSE;
 
+/*
+ * Prototypes for internal functions.
+ */
+static jboolean expand(JLI_List args, const char *str, const char *var_name);
+
 JNIEXPORT void JNICALL
 JLI_InitArgProcessing(jboolean hasJavaArgs, jboolean disableArgFile) {
     // No expansion for relaunch
@@ -300,6 +305,8 @@
 
     ctx.state = FIND_NEXT;
     ctx.parts = JLI_List_new(4);
+    // initialize to avoid -Werror=maybe-uninitialized issues from gcc 7.3 onwards.
+    ctx.quote_char = '"';
 
     /* arbitrarily pick 8, seems to be a reasonable number of arguments */
     rv = JLI_List_new(8);
@@ -376,9 +383,22 @@
     return rv;
 }
 
+/*
+ * expand a string into a list of words separated by whitespace.
+ */
+static JLI_List expandArg(const char *arg) {
+    JLI_List rv;
+
+    /* arbitrarily pick 8, seems to be a reasonable number of arguments */
+    rv = JLI_List_new(8);
+
+    expand(rv, arg, NULL);
+
+    return rv;
+}
+
 JNIEXPORT JLI_List JNICALL
-JLI_PreprocessArg(const char *arg)
-{
+JLI_PreprocessArg(const char *arg, jboolean expandSourceOpt) {
     JLI_List rv;
 
     if (firstAppArgIndex > 0) {
@@ -392,6 +412,12 @@
         return NULL;
     }
 
+    if (expandSourceOpt
+            && JLI_StrCCmp(arg, "--source") == 0
+            && JLI_StrChr(arg, ' ') != NULL) {
+        return expandArg(arg);
+    }
+
     if (arg[0] != '@') {
         checkArg(arg);
         return NULL;
@@ -435,9 +461,6 @@
 JNIEXPORT jboolean JNICALL
 JLI_AddArgsFromEnvVar(JLI_List args, const char *var_name) {
     char *env = getenv(var_name);
-    char *p, *arg;
-    char quote;
-    JLI_List argsInFile;
 
     if (firstAppArgIndex == 0) {
         // Not 'java', return
@@ -453,44 +476,64 @@
     }
 
     JLI_ReportMessage(ARG_INFO_ENVVAR, var_name, env);
+    return expand(args, env, var_name);
+}
+
+/*
+ * Expand a string into a list of args.
+ * If the string is the result of looking up an environment variable,
+ * var_name should be set to the name of that environment variable,
+ * for use if needed in error messages.
+ */
+
+static jboolean expand(JLI_List args, const char *str, const char *var_name) {
+    jboolean inEnvVar = (var_name != NULL);
+
+    char *p, *arg;
+    char quote;
+    JLI_List argsInFile;
 
     // This is retained until the process terminates as it is saved as the args
-    p = JLI_MemAlloc(JLI_StrLen(env) + 1);
-    while (*env != '\0') {
-        while (*env != '\0' && isspace(*env)) {
-            env++;
+    p = JLI_MemAlloc(JLI_StrLen(str) + 1);
+    while (*str != '\0') {
+        while (*str != '\0' && isspace(*str)) {
+            str++;
         }
 
         // Trailing space
-        if (*env == '\0') {
+        if (*str == '\0') {
             break;
         }
 
         arg = p;
-        while (*env != '\0' && !isspace(*env)) {
-            if (*env == '"' || *env == '\'') {
-                quote = *env++;
-                while (*env != quote && *env != '\0') {
-                    *p++ = *env++;
+        while (*str != '\0' && !isspace(*str)) {
+            if (inEnvVar && (*str == '"' || *str == '\'')) {
+                quote = *str++;
+                while (*str != quote && *str != '\0') {
+                    *p++ = *str++;
                 }
 
-                if (*env == '\0') {
+                if (*str == '\0') {
                     JLI_ReportMessage(ARG_ERROR8, var_name);
                     exit(1);
                 }
-                env++;
+                str++;
             } else {
-                *p++ = *env++;
+                *p++ = *str++;
             }
         }
 
         *p++ = '\0';
 
-        argsInFile = JLI_PreprocessArg(arg);
+        argsInFile = JLI_PreprocessArg(arg, JNI_FALSE);
 
         if (NULL == argsInFile) {
             if (isTerminalOpt(arg)) {
-                JLI_ReportMessage(ARG_ERROR9, arg, var_name);
+                if (inEnvVar) {
+                    JLI_ReportMessage(ARG_ERROR9, arg, var_name);
+                } else {
+                    JLI_ReportMessage(ARG_ERROR15, arg);
+                }
                 exit(1);
             }
             JLI_List_add(args, arg);
@@ -501,7 +544,11 @@
             for (idx = 0; idx < cnt; idx++) {
                 arg = argsInFile->elements[idx];
                 if (isTerminalOpt(arg)) {
-                    JLI_ReportMessage(ARG_ERROR10, arg, argFile, var_name);
+                    if (inEnvVar) {
+                        JLI_ReportMessage(ARG_ERROR10, arg, argFile, var_name);
+                    } else {
+                        JLI_ReportMessage(ARG_ERROR16, arg, argFile);
+                    }
                     exit(1);
                 }
                 JLI_List_add(args, arg);
@@ -517,11 +564,15 @@
          * caught now.
          */
         if (firstAppArgIndex != NOT_FOUND) {
-            JLI_ReportMessage(ARG_ERROR11, var_name);
+            if (inEnvVar) {
+                JLI_ReportMessage(ARG_ERROR11, var_name);
+            } else {
+                JLI_ReportMessage(ARG_ERROR17);
+            }
             exit(1);
         }
 
-        assert (*env == '\0' || isspace(*env));
+        assert (*str == '\0' || isspace(*str));
     }
 
     return JNI_TRUE;
@@ -642,7 +693,7 @@
 
     if (argc > 1) {
         for (i = 0; i < argc; i++) {
-            JLI_List tokens = JLI_PreprocessArg(argv[i]);
+            JLI_List tokens = JLI_PreprocessArg(argv[i], JNI_FALSE);
             if (NULL != tokens) {
                 for (j = 0; j < tokens->size; j++) {
                     printf("Token[%lu]: <%s>\n", (unsigned long) j, tokens->elements[j]);
--- a/src/java.base/share/native/libjli/emessages.h	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/native/libjli/emessages.h	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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
@@ -51,6 +51,11 @@
 #define ARG_ERROR10     "Error: Option %s in %s is not allowed in environment variable %s"
 #define ARG_ERROR11     "Error: Cannot specify main class in environment variable %s"
 #define ARG_ERROR12     "Error: %s requires module name"
+#define ARG_ERROR13     "Error: %s requires source version"
+#define ARG_ERROR14     "Error: Option %s is not allowed with --source"
+#define ARG_ERROR15     "Error: Option %s is not allowed in this context"
+#define ARG_ERROR16     "Error: Option %s in %s is not allowed in this context"
+#define ARG_ERROR17     "Error: Cannot specify main class in this context"
 
 #define JVM_ERROR1      "Error: Could not create the Java Virtual Machine.\n" GEN_ERROR
 #define JVM_ERROR2      "Error: Could not detach main thread.\n" JNI_ERROR
--- a/src/java.base/share/native/libjli/java.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/native/libjli/java.c	Mon Jun 11 09:29:44 2018 +0200
@@ -172,6 +172,9 @@
 static void FreeKnownVMs();
 static jboolean IsWildCardEnabled();
 
+
+#define SOURCE_LAUNCHER_MAIN_ENTRY "jdk.compiler/com.sun.tools.javac.launcher.Main"
+
 /*
  * This reports error.  VM will not be created and no usage is printed.
  */
@@ -214,7 +217,7 @@
  * Entry point.
  */
 JNIEXPORT int JNICALL
-JLI_Launch(int argc, char ** argv,              /* main argc, argc */
+JLI_Launch(int argc, char ** argv,              /* main argc, argv */
         int jargc, const char** jargv,          /* java args */
         int appclassc, const char** appclassv,  /* app classpath */
         const char* fullversion,                /* full version defined */
@@ -317,8 +320,7 @@
     /* Parse command line options; if the return value of
      * ParseArguments is false, the program should exit.
      */
-    if (!ParseArguments(&argc, &argv, &mode, &what, &ret, jrepath))
-    {
+    if (!ParseArguments(&argc, &argv, &mode, &what, &ret, jrepath)) {
         return(ret);
     }
 
@@ -585,7 +587,8 @@
     return IsClassPathOption(name) ||
            IsLauncherMainOption(name) ||
            JLI_StrCmp(name, "--describe-module") == 0 ||
-           JLI_StrCmp(name, "-d") == 0;
+           JLI_StrCmp(name, "-d") == 0 ||
+           JLI_StrCmp(name, "--source") == 0;
 }
 
 /*
@@ -627,6 +630,29 @@
 }
 
 /*
+ * Check if it is OK to set the mode.
+ * If the mode was previously set, and should not be changed,
+ * a fatal error is reported.
+ */
+static int
+checkMode(int mode, int newMode, const char *arg) {
+    if (mode == LM_SOURCE) {
+        JLI_ReportErrorMessage(ARG_ERROR14, arg);
+        exit(1);
+    }
+    return newMode;
+}
+
+/*
+ * Test if an arg identifies a source file.
+ */
+jboolean
+IsSourceFile(const char *arg) {
+    struct stat st;
+    return (JLI_HasSuffix(arg, ".java") && stat(arg, &st) == 0);
+}
+
+/*
  * Checks the command line options to find which JVM type was
  * specified.  If no command line option was given for the JVM type,
  * the default type is used.  The environment variable
@@ -1230,7 +1256,8 @@
         value = equals+1;
         if (JLI_StrCCmp(arg, "--describe-module=") == 0 ||
             JLI_StrCCmp(arg, "--module=") == 0 ||
-            JLI_StrCCmp(arg, "--class-path=") == 0) {
+            JLI_StrCCmp(arg, "--class-path=") == 0||
+            JLI_StrCCmp(arg, "--source=") == 0) {
             kind = LAUNCHER_OPTION_WITH_ARGUMENT;
         } else {
             kind = VM_LONG_OPTION;
@@ -1274,17 +1301,28 @@
  */
         if (JLI_StrCmp(arg, "-jar") == 0) {
             ARG_CHECK(argc, ARG_ERROR2, arg);
-            mode = LM_JAR;
+            mode = checkMode(mode, LM_JAR, arg);
         } 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;
+            mode = checkMode(mode, LM_MODULE, arg);
             if (has_arg) {
                *pwhat = value;
                 break;
             }
+        } else if (JLI_StrCmp(arg, "--source") == 0 ||
+                   JLI_StrCCmp(arg, "--source=") == 0) {
+            REPORT_ERROR (has_arg, ARG_ERROR13, arg);
+            mode = LM_SOURCE;
+            if (has_arg) {
+                const char *prop = "-Djdk.internal.javac.source=";
+                size_t size = JLI_StrLen(prop) + JLI_StrLen(value) + 1;
+                char *propValue = (char *)JLI_MemAlloc(size);
+                JLI_Snprintf(propValue, size, "%s%s", prop, value);
+                AddOption(propValue, NULL);
+            }
         } else if (JLI_StrCmp(arg, "--class-path") == 0 ||
                    JLI_StrCCmp(arg, "--class-path=") == 0 ||
                    JLI_StrCmp(arg, "-classpath") == 0 ||
@@ -1435,12 +1473,25 @@
         if (!_have_classpath) {
             SetClassPath(".");
         }
-        mode = LM_CLASS;
+        mode = IsSourceFile(arg) ? LM_SOURCE : LM_CLASS;
+    } else if (mode == LM_CLASS && IsSourceFile(arg)) {
+        /* override LM_CLASS mode if given a source file */
+        mode = LM_SOURCE;
     }
 
-    if (argc >= 0) {
-        *pargc = argc;
-        *pargv = argv;
+    if (mode == LM_SOURCE) {
+        AddOption("--add-modules=ALL-DEFAULT", NULL);
+        *pwhat = SOURCE_LAUNCHER_MAIN_ENTRY;
+        // adjust (argc, argv) so that the name of the source file
+        // is included in the args passed to the source launcher
+        // main entry class
+        *pargc = argc + 1;
+        *pargv = argv - 1;
+    } else {
+        if (argc >= 0) {
+            *pargc = argc;
+            *pargv = argv;
+        }
     }
 
     *pmode = mode;
--- a/src/java.base/share/native/libjli/java.h	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/native/libjli/java.h	Mon Jun 11 09:29:44 2018 +0200
@@ -230,11 +230,12 @@
     LM_UNKNOWN = 0,
     LM_CLASS,
     LM_JAR,
-    LM_MODULE
+    LM_MODULE,
+    LM_SOURCE
 };
 
 static const char *launchModeNames[]
-    = { "Unknown", "Main class", "JAR file", "Module" };
+    = { "Unknown", "Main class", "JAR file", "Module", "Source" };
 
 typedef struct {
     int    argc;
--- a/src/java.base/share/native/libjli/jli_util.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/native/libjli/jli_util.c	Mon Jun 11 09:29:44 2018 +0200
@@ -84,6 +84,16 @@
     free(ptr);
 }
 
+jboolean
+JLI_HasSuffix(const char *s1, const char *s2)
+{
+    char *p = JLI_StrRChr(s1, '.');
+    if (p == NULL || *p == '\0') {
+        return JNI_FALSE;
+    }
+    return (JLI_StrCaseCmp(p, s2) == 0);
+}
+
 /*
  * debug helpers we use
  */
--- a/src/java.base/share/native/libjli/jli_util.h	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/share/native/libjli/jli_util.h	Mon Jun 11 09:29:44 2018 +0200
@@ -51,7 +51,8 @@
 JNIEXPORT void JNICALL
 JLI_MemFree(void *ptr);
 
-int   JLI_StrCCmp(const char *s1, const char* s2);
+int   JLI_StrCCmp(const char *s1, const char *s2);
+jboolean   JLI_HasSuffix(const char *s1, const char *s2);
 
 typedef struct {
     char *arg;
@@ -158,7 +159,7 @@
 JLI_InitArgProcessing(jboolean hasJavaArgs, jboolean disableArgFile);
 
 JNIEXPORT JLI_List JNICALL
-JLI_PreprocessArg(const char *arg);
+JLI_PreprocessArg(const char *arg, jboolean expandSourceOpt);
 
 JNIEXPORT jboolean JNICALL
 JLI_AddArgsFromEnvVar(JLI_List args, const char *var_name);
--- a/src/java.base/unix/classes/sun/nio/fs/UnixCopyFile.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/unix/classes/sun/nio/fs/UnixCopyFile.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, 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
@@ -373,6 +373,22 @@
         }
     }
 
+    // throw a DirectoryNotEmpty exception if appropriate
+    static void ensureEmptyDir(UnixPath dir) throws IOException {
+        try {
+            long ptr = opendir(dir);
+            try (UnixDirectoryStream stream =
+                new UnixDirectoryStream(dir, ptr, e -> true)) {
+                if (stream.iterator().hasNext()) {
+                    throw new DirectoryNotEmptyException(
+                        dir.getPathForExceptionMessage());
+                }
+            }
+        } catch (UnixException e) {
+            e.rethrowAsIOException(dir);
+        }
+    }
+
     // move file from source to target
     static void move(UnixPath source, UnixPath target, CopyOption... options)
         throws IOException
@@ -465,6 +481,7 @@
 
         // copy source to target
         if (sourceAttrs.isDirectory()) {
+            ensureEmptyDir(source);
             copyDirectory(source, sourceAttrs, target, flags);
         } else {
             if (sourceAttrs.isSymbolicLink()) {
--- a/src/java.base/unix/native/libnet/SocketOutputStream.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/unix/native/libnet/SocketOutputStream.c	Mon Jun 11 09:29:44 2018 +0200
@@ -108,13 +108,8 @@
                     loff += n;
                     continue;
                 }
-                if (errno == ECONNRESET) {
-                    JNU_ThrowByName(env, "sun/net/ConnectionResetException",
-                        "Connection reset");
-                } else {
-                    JNU_ThrowByNameWithMessageAndLastError
-                        (env, "java/net/SocketException", "Write failed");
-                }
+                JNU_ThrowByNameWithMessageAndLastError
+                    (env, "java/net/SocketException", "Write failed");
                 if (bufP != BUF) {
                     free(bufP);
                 }
--- a/src/java.base/windows/classes/sun/nio/fs/WindowsFileCopy.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/windows/classes/sun/nio/fs/WindowsFileCopy.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, 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
@@ -249,6 +249,17 @@
         }
     }
 
+    // throw a DirectoryNotEmpty exception if not empty
+    static void ensureEmptyDir(WindowsPath dir) throws IOException {
+        try (WindowsDirectoryStream dirStream =
+            new WindowsDirectoryStream(dir, (e) -> true)) {
+            if (dirStream.iterator().hasNext()) {
+                throw new DirectoryNotEmptyException(
+                    dir.getPathForExceptionMessage());
+            }
+        }
+    }
+
     /**
      * Move file from source to target
      */
@@ -407,6 +418,7 @@
         // create new directory or directory junction
         try {
             if (sourceAttrs.isDirectory()) {
+                ensureEmptyDir(source);
                 CreateDirectory(targetPath, 0L);
             } else {
                 String linkTarget = WindowsLinkSupport.readLink(source);
--- a/src/java.base/windows/native/libjava/TimeZone_md.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/windows/native/libjava/TimeZone_md.c	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, 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
@@ -437,6 +437,8 @@
     char *mapFileName;
     char lineBuffer[MAX_ZONE_CHAR * 4];
     int noMapID = *mapID == '\0';       /* no mapID on Vista and later */
+    int offset = 0;
+    const char* errorMessage = "unknown error";
 
     mapFileName = malloc(strlen(java_home_dir) + strlen(MAPPINGS_FILE) + 1);
     if (mapFileName == NULL) {
@@ -472,10 +474,14 @@
             items[itemIndex] = start;
             while (*idx && *idx != ':') {
                 if (++idx >= endp) {
+                    errorMessage = "premature end of line";
+                    offset = (int)(idx - lineBuffer);
                     goto illegal_format;
                 }
             }
             if (*idx == '\0') {
+                errorMessage = "illegal null character found";
+                offset = (int)(idx - lineBuffer);
                 goto illegal_format;
             }
             *idx++ = '\0';
@@ -483,6 +489,8 @@
         }
 
         if (*idx != '\n') {
+            errorMessage = "illegal non-newline character found";
+            offset = (int)(idx - lineBuffer);
             goto illegal_format;
         }
 
@@ -516,7 +524,8 @@
 
  illegal_format:
     (void) fclose(fp);
-    jio_fprintf(stderr, "tzmappings: Illegal format at line %d.\n", line);
+    jio_fprintf(stderr, "Illegal format in tzmappings file: %s at line %d, offset %d.\n",
+                errorMessage, line, offset);
     return NULL;
 }
 
--- a/src/java.base/windows/native/libjli/cmdtoargs.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.base/windows/native/libjli/cmdtoargs.c	Mon Jun 11 09:29:44 2018 +0200
@@ -246,7 +246,7 @@
     // iterate through rest of command line
     while (src != NULL) {
         src = next_arg(src, arg, &wildcard);
-        argsInFile = JLI_PreprocessArg(arg);
+        argsInFile = JLI_PreprocessArg(arg, JNI_TRUE);
         if (argsInFile != NULL) {
             // resize to accommodate another Arg
             cnt = argsInFile->size;
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/CFileDialog.m	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/CFileDialog.m	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, 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
@@ -46,7 +46,7 @@
 canChooseDirectories:(BOOL)inChooseDirectories
              withEnv:(JNIEnv*)env;
 {
-    if (self == [super init]) {
+  if (self = [super init]) {
         fHasFileFilter = inHasFilter;
         fFileDialog = JNFNewGlobalRef(env, inDialog);
         fDirectory = inPath;
@@ -92,7 +92,7 @@
 - (void)safeSaveOrLoad {
     NSSavePanel *thePanel = nil;
 
-    /* 
+    /*
      * 8013553: turns off extension hiding for the native file dialog.
      * This way is used because setExtensionHidden(NO) doesn't work
      * as expected.
--- a/src/java.desktop/macosx/native/libsplashscreen/libpng/zlib.h	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This header file is used to hijack the include of "zlib.h" from libpng on
- * Macos. We do that to be able to build on macos 10.13 or later, but still
- * keep binary compatibility with older versions (as specified to configure).
- *
- * The problem is that in 10.13, Macos shipped with a newer version of zlib,
- * which exports the function inflateValidate. There is a call to this
- * function in pngrutil.c, guarded by a preprocessor check of ZLIB_VERNUM being
- * high enough. If we compile this call in and link to the newer version of
- * zlib, we will get link errors if the code is executed on an older Mac with
- * an older version of zlib.
- *
- * The zlib.h header in Macos has been annotated with Macos specific macros that
- * guard these kinds of version specific APIs, but libpng is not using those
- * checks in its conditionals, just ZLIB_VERNUM. To fix this, we check for the
- * MAC_OS_X_VERSION_MIN_REQUIRED macro here and adjust the ZLIB_VERNUM to the
- # known version bundled with that release. This solution is certainly a hack,
- * but it seems the affected versions of zlib.h are compatible enough for this
- * to work.
- */
-
-#include <zlib.h>
-#include <AvailabilityMacros.h>
-
-#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12
-#  undef ZLIB_VERNUM
-#  define ZLIB_VERNUM 0x1250
-#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_13
-#  undef ZLIB_VERNUM
-#  define ZLIB_VERNUM 0x1280
-#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/macosx/native/libsplashscreen/libpng/zlibwrapper/zlib.h	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This header file is used to hijack the include of "zlib.h" from libpng on
+ * Macos. We do that to be able to build on macos 10.13 or later, but still
+ * keep binary compatibility with older versions (as specified to configure).
+ *
+ * The problem is that in 10.13, Macos shipped with a newer version of zlib,
+ * which exports the function inflateValidate. There is a call to this
+ * function in pngrutil.c, guarded by a preprocessor check of ZLIB_VERNUM being
+ * high enough. If we compile this call in and link to the newer version of
+ * zlib, we will get link errors if the code is executed on an older Mac with
+ * an older version of zlib.
+ *
+ * The zlib.h header in Macos has been annotated with Macos specific macros that
+ * guard these kinds of version specific APIs, but libpng is not using those
+ * checks in its conditionals, just ZLIB_VERNUM. To fix this, we check for the
+ * MAC_OS_X_VERSION_MIN_REQUIRED macro here and adjust the ZLIB_VERNUM to the
+ # known version bundled with that release. This solution is certainly a hack,
+ * but it seems the affected versions of zlib.h are compatible enough for this
+ * to work.
+ */
+
+#include <zlib.h>
+#include <AvailabilityMacros.h>
+
+#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12
+#  undef ZLIB_VERNUM
+#  define ZLIB_VERNUM 0x1250
+#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_13
+#  undef ZLIB_VERNUM
+#  define ZLIB_VERNUM 0x1280
+#endif
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEG.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEG.java	Mon Jun 11 09:29:44 2018 +0200
@@ -187,13 +187,7 @@
     public static final int JCS_RGB = 2;           // red/green/blue
     public static final int JCS_YCbCr = 3;         // Y/Cb/Cr (also known as YUV)
     public static final int JCS_CMYK = 4;          // C/M/Y/K
-    public static final int JCS_YCC = 5;           // PhotoYCC
-    public static final int JCS_RGBA = 6;          // RGB-Alpha
-    public static final int JCS_YCbCrA = 7;        // Y/Cb/Cr/Alpha
-    // 8 and 9 were old "Legacy" codes which the old code never identified
-    // on reading anyway.  Support for writing them is being dropped, too.
-    public static final int JCS_YCCA = 10;         // PhotoYCC-Alpha
-    public static final int JCS_YCCK = 11;         // Y/Cb/Cr/K
+    public static final int JCS_YCCK = 5;         // Y/Cb/Cr/K
 
     public static final int NUM_JCS_CODES = JCS_YCCK+1;
 
@@ -212,22 +206,6 @@
     public static class JCS {
         public static final ColorSpace sRGB =
             ColorSpace.getInstance(ColorSpace.CS_sRGB);
-
-        private static ColorSpace YCC = null;
-        private static boolean yccInited = false;
-
-        public static ColorSpace getYCC() {
-            if (!yccInited) {
-                try {
-                    YCC = ColorSpace.getInstance(ColorSpace.CS_PYCC);
-                } catch (IllegalArgumentException e) {
-                    // PYCC.pf may not always be installed
-                } finally {
-                    yccInited = true;
-                }
-            }
-            return YCC;
-        }
     }
 
     // Default value for ImageWriteParam
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java	Mon Jun 11 09:29:44 2018 +0200
@@ -933,21 +933,6 @@
         case JPEG.JCS_RGB:
             list.add(raw);
             list.add(getImageType(JPEG.JCS_GRAYSCALE));
-            list.add(getImageType(JPEG.JCS_YCC));
-            break;
-        case JPEG.JCS_RGBA:
-            list.add(raw);
-            break;
-        case JPEG.JCS_YCC:
-            if (raw != null) {  // Might be null if PYCC.pf not installed
-                list.add(raw);
-                list.add(getImageType(JPEG.JCS_RGB));
-            }
-            break;
-        case JPEG.JCS_YCCA:
-            if (raw != null) {  // Might be null if PYCC.pf not installed
-                list.add(raw);
-            }
             break;
         case JPEG.JCS_YCbCr:
             // As there is no YCbCr ColorSpace, we can't support
@@ -972,12 +957,6 @@
             }
 
             list.add(getImageType(JPEG.JCS_GRAYSCALE));
-            list.add(getImageType(JPEG.JCS_YCC));
-            break;
-        case JPEG.JCS_YCbCrA:  // Default is to convert to RGBA
-            // As there is no YCbCr ColorSpace, we can't support
-            // the raw type.
-            list.add(getImageType(JPEG.JCS_RGBA));
             break;
         }
 
@@ -1065,36 +1044,6 @@
                 throw new IIOException("Incompatible color conversion");
             }
             break;
-        case JPEG.JCS_RGBA:
-            // No conversions available; image must be RGBA
-            if ((csType != ColorSpace.TYPE_RGB) ||
-                (cm.getNumComponents() != numComponents)) {
-                throw new IIOException("Incompatible color conversion");
-            }
-            break;
-        case JPEG.JCS_YCC:
-            {
-                ColorSpace YCC = JPEG.JCS.getYCC();
-                if (YCC == null) { // We can't do YCC at all
-                    throw new IIOException("Incompatible color conversion");
-                }
-                if ((cs != YCC) &&
-                    (cm.getNumComponents() == numComponents)) {
-                    convert = new ColorConvertOp(YCC, cs, null);
-                }
-            }
-            break;
-        case JPEG.JCS_YCCA:
-            {
-                ColorSpace YCC = JPEG.JCS.getYCC();
-                // No conversions available; image must be YCCA
-                if ((YCC == null) || // We can't do YCC at all
-                    (cs != YCC) ||
-                    (cm.getNumComponents() != numComponents)) {
-                    throw new IIOException("Incompatible color conversion");
-                }
-            }
-            break;
         default:
             // Anything else we can't handle at all
             throw new IIOException("Incompatible color conversion");
@@ -1929,36 +1878,6 @@
                         DataBuffer.TYPE_BYTE,
                         false,
                         false);
-            case JPEG.JCS_RGBA:
-                return ImageTypeSpecifier.createPacked(JPEG.JCS.sRGB,
-                        0xff000000,
-                        0x00ff0000,
-                        0x0000ff00,
-                        0x000000ff,
-                        DataBuffer.TYPE_INT,
-                        false);
-            case JPEG.JCS_YCC:
-                if (JPEG.JCS.getYCC() != null) {
-                    return ImageTypeSpecifier.createInterleaved(
-                            JPEG.JCS.getYCC(),
-                        JPEG.bandOffsets[2],
-                        DataBuffer.TYPE_BYTE,
-                        false,
-                        false);
-                } else {
-                    return null;
-                }
-            case JPEG.JCS_YCCA:
-                if (JPEG.JCS.getYCC() != null) {
-                    return ImageTypeSpecifier.createInterleaved(
-                            JPEG.JCS.getYCC(),
-                        JPEG.bandOffsets[3],
-                        DataBuffer.TYPE_BYTE,
-                        true,
-                        false);
-                } else {
-                    return null;
-                }
             default:
                 return null;
         }
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	Mon Jun 11 09:29:44 2018 +0200
@@ -754,115 +754,47 @@
                             }
                             break;
                         case ColorSpace.TYPE_RGB:
-                            if (!alpha) {
-                                if (jfif != null) {
+                            if (jfif != null) {
+                                outCsType = JPEG.JCS_YCbCr;
+                                if (JPEG.isNonStandardICC(cs)
+                                    || ((cs instanceof ICC_ColorSpace)
+                                        && (jfif.iccSegment != null))) {
+                                    iccProfile =
+                                        ((ICC_ColorSpace) cs).getProfile();
+                                }
+                            } else if (adobe != null) {
+                                switch (adobe.transform) {
+                                case JPEG.ADOBE_UNKNOWN:
+                                    outCsType = JPEG.JCS_RGB;
+                                    break;
+                                case JPEG.ADOBE_YCC:
                                     outCsType = JPEG.JCS_YCbCr;
-                                    if (JPEG.isNonStandardICC(cs)
-                                        || ((cs instanceof ICC_ColorSpace)
-                                            && (jfif.iccSegment != null))) {
-                                        iccProfile =
-                                            ((ICC_ColorSpace) cs).getProfile();
-                                    }
-                                } else if (adobe != null) {
-                                    switch (adobe.transform) {
-                                    case JPEG.ADOBE_UNKNOWN:
-                                        outCsType = JPEG.JCS_RGB;
-                                        break;
-                                    case JPEG.ADOBE_YCC:
+                                    break;
+                                default:
+                                    warningOccurred
+                                    (WARNING_IMAGE_METADATA_ADOBE_MISMATCH);
+                                    newAdobeTransform = JPEG.ADOBE_UNKNOWN;
+                                    outCsType = JPEG.JCS_RGB;
+                                    break;
+                                }
+                            } else {
+                                // consult the ids
+                                int outCS = sof.getIDencodedCSType();
+                                // if they don't resolve it,
+                                // consult the sampling factors
+                                if (outCS != JPEG.JCS_UNKNOWN) {
+                                    outCsType = outCS;
+                                } else {
+                                    boolean subsampled =
+                                    isSubsampled(sof.componentSpecs);
+                                    if (subsampled) {
                                         outCsType = JPEG.JCS_YCbCr;
-                                        break;
-                                    default:
-                                        warningOccurred
-                                        (WARNING_IMAGE_METADATA_ADOBE_MISMATCH);
-                                        newAdobeTransform = JPEG.ADOBE_UNKNOWN;
-                                        outCsType = JPEG.JCS_RGB;
-                                        break;
-                                    }
-                                } else {
-                                    // consult the ids
-                                    int outCS = sof.getIDencodedCSType();
-                                    // if they don't resolve it,
-                                    // consult the sampling factors
-                                    if (outCS != JPEG.JCS_UNKNOWN) {
-                                        outCsType = outCS;
                                     } else {
-                                        boolean subsampled =
-                                        isSubsampled(sof.componentSpecs);
-                                        if (subsampled) {
-                                            outCsType = JPEG.JCS_YCbCr;
-                                        } else {
-                                            outCsType = JPEG.JCS_RGB;
-                                        }
-                                    }
-                                }
-                            } else { // RGBA
-                                if (jfif != null) {
-                                    ignoreJFIF = true;
-                                    warningOccurred
-                                    (WARNING_IMAGE_METADATA_JFIF_MISMATCH);
-                                }
-                                if (adobe != null) {
-                                    if (adobe.transform
-                                        != JPEG.ADOBE_UNKNOWN) {
-                                        newAdobeTransform = JPEG.ADOBE_UNKNOWN;
-                                        warningOccurred
-                                        (WARNING_IMAGE_METADATA_ADOBE_MISMATCH);
-                                    }
-                                    outCsType = JPEG.JCS_RGBA;
-                                } else {
-                                    // consult the ids
-                                    int outCS = sof.getIDencodedCSType();
-                                    // if they don't resolve it,
-                                    // consult the sampling factors
-                                    if (outCS != JPEG.JCS_UNKNOWN) {
-                                        outCsType = outCS;
-                                    } else {
-                                        boolean subsampled =
-                                        isSubsampled(sof.componentSpecs);
-                                        outCsType = subsampled ?
-                                            JPEG.JCS_YCbCrA : JPEG.JCS_RGBA;
+                                        outCsType = JPEG.JCS_RGB;
                                     }
                                 }
                             }
                             break;
-                        case ColorSpace.TYPE_3CLR:
-                            if (cs == JPEG.JCS.getYCC()) {
-                                if (!alpha) {
-                                    if (jfif != null) {
-                                        convertTosRGB = true;
-                                        convertOp =
-                                        new ColorConvertOp(cs,
-                                                           JPEG.JCS.sRGB,
-                                                           null);
-                                        outCsType = JPEG.JCS_YCbCr;
-                                    } else if (adobe != null) {
-                                        if (adobe.transform
-                                            != JPEG.ADOBE_YCC) {
-                                            newAdobeTransform = JPEG.ADOBE_YCC;
-                                            warningOccurred
-                                            (WARNING_IMAGE_METADATA_ADOBE_MISMATCH);
-                                        }
-                                        outCsType = JPEG.JCS_YCC;
-                                    } else {
-                                        outCsType = JPEG.JCS_YCC;
-                                    }
-                                } else { // PhotoYCCA
-                                    if (jfif != null) {
-                                        ignoreJFIF = true;
-                                        warningOccurred
-                                        (WARNING_IMAGE_METADATA_JFIF_MISMATCH);
-                                    } else if (adobe != null) {
-                                        if (adobe.transform
-                                            != JPEG.ADOBE_UNKNOWN) {
-                                            newAdobeTransform
-                                            = JPEG.ADOBE_UNKNOWN;
-                                            warningOccurred
-                                            (WARNING_IMAGE_METADATA_ADOBE_MISMATCH);
-                                        }
-                                    }
-                                    outCsType = JPEG.JCS_YCCA;
-                                }
-                            }
                         }
                     }
                 } // else no dest, metadata, not an image.  Defaults ok
@@ -1564,27 +1496,10 @@
                 retval = JPEG.JCS_GRAYSCALE;
                 break;
             case ColorSpace.TYPE_RGB:
-                if (alpha) {
-                    retval = JPEG.JCS_RGBA;
-                } else {
-                    retval = JPEG.JCS_RGB;
-                }
+                retval = JPEG.JCS_RGB;
                 break;
             case ColorSpace.TYPE_YCbCr:
-                if (alpha) {
-                    retval = JPEG.JCS_YCbCrA;
-                } else {
-                    retval = JPEG.JCS_YCbCr;
-                }
-                break;
-            case ColorSpace.TYPE_3CLR:
-                if (cs == JPEG.JCS.getYCC()) {
-                    if (alpha) {
-                        retval = JPEG.JCS_YCCA;
-                    } else {
-                        retval = JPEG.JCS_YCC;
-                    }
-                }
+                retval = JPEG.JCS_YCbCr;
                 break;
             case ColorSpace.TYPE_CMYK:
                 retval = JPEG.JCS_CMYK;
@@ -1604,27 +1519,10 @@
                 retval = JPEG.JCS_GRAYSCALE;
                 break;
             case ColorSpace.TYPE_RGB:
-                if (alpha) {
-                    retval = JPEG.JCS_RGBA;
-                } else {
-                    retval = JPEG.JCS_RGB;
-                }
+                retval = JPEG.JCS_RGB;
                 break;
             case ColorSpace.TYPE_YCbCr:
-                if (alpha) {
-                    retval = JPEG.JCS_YCbCrA;
-                } else {
-                    retval = JPEG.JCS_YCbCr;
-                }
-                break;
-            case ColorSpace.TYPE_3CLR:
-                if (cs == JPEG.JCS.getYCC()) {
-                    if (alpha) {
-                        retval = JPEG.JCS_YCCA;
-                    } else {
-                        retval = JPEG.JCS_YCC;
-                    }
-                }
+                retval = JPEG.JCS_YCbCr;
                 break;
             case ColorSpace.TYPE_CMYK:
                 retval = JPEG.JCS_CMYK;
@@ -1651,27 +1549,10 @@
                 retval = JPEG.JCS_GRAYSCALE;
                 break;
             case ColorSpace.TYPE_RGB:
-                if (alpha) {
-                    retval = JPEG.JCS_YCbCrA;
-                } else {
-                    retval = JPEG.JCS_YCbCr;
-                }
+                retval = JPEG.JCS_YCbCr;
                 break;
             case ColorSpace.TYPE_YCbCr:
-                if (alpha) {
-                    retval = JPEG.JCS_YCbCrA;
-                } else {
-                    retval = JPEG.JCS_YCbCr;
-                }
-                break;
-            case ColorSpace.TYPE_3CLR:
-                if (cs == JPEG.JCS.getYCC()) {
-                    if (alpha) {
-                        retval = JPEG.JCS_YCCA;
-                    } else {
-                        retval = JPEG.JCS_YCC;
-                    }
-                }
+                retval = JPEG.JCS_YCbCr;
                 break;
             case ColorSpace.TYPE_CMYK:
                 retval = JPEG.JCS_YCCK;
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriterSpi.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriterSpi.java	Mon Jun 11 09:29:44 2018 +0200
@@ -73,7 +73,11 @@
 
     public boolean canEncodeImage(ImageTypeSpecifier type) {
         SampleModel sampleModel = type.getSampleModel();
+        ColorModel cm = type.getColorModel();
 
+        if (cm.hasAlpha()) {
+            return false;
+        }
         // Find the maximum bit depth across all channels
         int[] sampleSize = sampleModel.getSampleSize();
         int bitDepth = sampleSize[0];
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java	Mon Jun 11 09:29:44 2018 +0200
@@ -491,17 +491,6 @@
                     wantJFIF = false;
                 }
                 break;
-            case ColorSpace.TYPE_3CLR:
-                if (cs == JPEG.JCS.getYCC()) {
-                    wantJFIF = false;
-                    componentIDs[0] = (byte) 'Y';
-                    componentIDs[1] = (byte) 'C';
-                    componentIDs[2] = (byte) 'c';
-                    if (hasAlpha) {
-                        componentIDs[3] = (byte) 'A';
-                    }
-                }
-                break;
             case ColorSpace.TYPE_YCbCr:
                 if (hasExtraComponents) { // e.g. K or alpha
                     wantJFIF = false;
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java	Mon Jun 11 09:29:44 2018 +0200
@@ -182,29 +182,11 @@
         switch(componentSpecs.length) {
         case 3:
             if ((componentSpecs[0].componentId == 'R')
-                &&(componentSpecs[0].componentId == 'G')
-                &&(componentSpecs[0].componentId == 'B')) {
+                &&(componentSpecs[1].componentId == 'G')
+                &&(componentSpecs[2].componentId == 'B')) {
                 return JPEG.JCS_RGB;
             }
-            if ((componentSpecs[0].componentId == 'Y')
-                &&(componentSpecs[0].componentId == 'C')
-                &&(componentSpecs[0].componentId == 'c')) {
-                return JPEG.JCS_YCC;
-            }
             break;
-        case 4:
-            if ((componentSpecs[0].componentId == 'R')
-                &&(componentSpecs[0].componentId == 'G')
-                &&(componentSpecs[0].componentId == 'B')
-                &&(componentSpecs[0].componentId == 'A')) {
-                return JPEG.JCS_RGBA;
-            }
-            if ((componentSpecs[0].componentId == 'Y')
-                &&(componentSpecs[0].componentId == 'C')
-                &&(componentSpecs[0].componentId == 'c')
-                &&(componentSpecs[0].componentId == 'A')) {
-                return JPEG.JCS_YCCA;
-            }
         }
 
         return JPEG.JCS_UNKNOWN;
--- a/src/java.desktop/share/classes/java/awt/Robot.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/java/awt/Robot.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, 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
@@ -29,10 +29,10 @@
 import java.awt.event.KeyEvent;
 import java.awt.geom.AffineTransform;
 import java.awt.image.BaseMultiResolutionImage;
-import java.awt.image.MultiResolutionImage;
 import java.awt.image.BufferedImage;
 import java.awt.image.DataBufferInt;
 import java.awt.image.DirectColorModel;
+import java.awt.image.MultiResolutionImage;
 import java.awt.image.Raster;
 import java.awt.image.WritableRaster;
 import java.awt.peer.RobotPeer;
@@ -41,7 +41,7 @@
 import sun.awt.ComponentFactory;
 import sun.awt.SunToolkit;
 import sun.awt.image.SunWritableRaster;
-import sun.swing.SwingUtilities2;
+import sun.java2d.SunGraphicsEnvironment;
 
 /**
  * This class is used to generate native system input events
@@ -505,7 +505,7 @@
                 .getLocalGraphicsEnvironment()
                 .getDefaultScreenDevice().
                 getDefaultConfiguration();
-        gc = SwingUtilities2.getGraphicsConfigurationAtPoint(
+        gc = SunGraphicsEnvironment.getGraphicsConfigurationAtPoint(
                 gc, screenRect.getCenterX(), screenRect.getCenterY());
 
         AffineTransform tx = gc.getDefaultTransform();
--- a/src/java.desktop/share/classes/java/awt/desktop/AboutEvent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/java/awt/desktop/AboutEvent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -25,6 +25,9 @@
 
 package java.awt.desktop;
 
+import java.awt.Desktop;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
 
 /**
  * Event sent when the application is asked to open its about window.
@@ -34,12 +37,19 @@
  * @since 9
  */
 public final class AboutEvent extends AppEvent {
+
     private static final long serialVersionUID = -5987180734802756477L;
 
     /**
-     * Constructs an {@code AboutEvent}
+     * Constructs an {@code AboutEvent}.
+     *
+     * @throws HeadlessException if {@link GraphicsEnvironment#isHeadless()}
+     *         returns {@code true}
+     * @throws UnsupportedOperationException if Desktop API is not supported on
+     *         the current platform
+     * @see Desktop#isDesktopSupported()
+     * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public AboutEvent() {
     }
-
 }
--- a/src/java.desktop/share/classes/java/awt/desktop/AppEvent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/java/awt/desktop/AppEvent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -26,11 +26,13 @@
 package java.awt.desktop;
 
 import java.awt.Desktop;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
 import java.util.EventObject;
 
 /**
  * AppEvents are sent to listeners and handlers installed on the
- * {@link java.awt.Desktop}.
+ * {@link java.awt.Desktop} instance of the current desktop context.
  *
  * @since 9
  */
@@ -38,8 +40,17 @@
 
     private static final long serialVersionUID = -5958503993556009432L;
 
+    /**
+     * Constructs an {@code AppEvent}.
+     *
+     * @throws HeadlessException if {@link GraphicsEnvironment#isHeadless()}
+     *         returns {@code true}
+     * @throws UnsupportedOperationException if Desktop API is not supported on
+     *         the current platform
+     * @see Desktop#isDesktopSupported()
+     * @see java.awt.GraphicsEnvironment#isHeadless
+     */
     AppEvent() {
         super(Desktop.getDesktop());
     }
-
 }
--- a/src/java.desktop/share/classes/java/awt/desktop/AppForegroundEvent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/java/awt/desktop/AppForegroundEvent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -25,6 +25,9 @@
 
 package java.awt.desktop;
 
+import java.awt.Desktop;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
 
 /**
  * Event sent when the application has become the foreground app, and when it is
@@ -36,12 +39,19 @@
  * @since 9
  */
 public final class AppForegroundEvent extends AppEvent {
+
     private static final long serialVersionUID = -5513582555740533911L;
 
     /**
-     * Constructs an {@code AppForegroundEvent}
+     * Constructs an {@code AppForegroundEvent}.
+     *
+     * @throws HeadlessException if {@link GraphicsEnvironment#isHeadless()}
+     *         returns {@code true}
+     * @throws UnsupportedOperationException if Desktop API is not supported on
+     *         the current platform
+     * @see Desktop#isDesktopSupported()
+     * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public AppForegroundEvent() {
     }
-
 }
--- a/src/java.desktop/share/classes/java/awt/desktop/AppHiddenEvent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/java/awt/desktop/AppHiddenEvent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -25,6 +25,9 @@
 
 package java.awt.desktop;
 
+import java.awt.Desktop;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
 
 /**
  * Event sent when the application has been hidden or shown.
@@ -35,12 +38,19 @@
  * @since 9
  */
 public final class AppHiddenEvent extends AppEvent {
+
     private static final long serialVersionUID = 2637465279476429224L;
 
     /**
-     * Constructs an {@code AppHiddenEvent}
+     * Constructs an {@code AppHiddenEvent}.
+     *
+     * @throws HeadlessException if {@link GraphicsEnvironment#isHeadless()}
+     *         returns {@code true}
+     * @throws UnsupportedOperationException if Desktop API is not supported on
+     *         the current platform
+     * @see Desktop#isDesktopSupported()
+     * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public AppHiddenEvent() {
     }
-
 }
--- a/src/java.desktop/share/classes/java/awt/desktop/AppReopenedEvent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/java/awt/desktop/AppReopenedEvent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -25,6 +25,9 @@
 
 package java.awt.desktop;
 
+import java.awt.Desktop;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
 
 /**
  * Event sent when the application is asked to re-open itself.
@@ -34,12 +37,19 @@
  * @since 9
  */
 public final class AppReopenedEvent extends AppEvent {
+
     private static final long serialVersionUID = 1503238361530407990L;
 
     /**
-     * Constructs an {@code AppReopenedEvent}
+     * Constructs an {@code AppReopenedEvent}.
+     *
+     * @throws HeadlessException if {@link GraphicsEnvironment#isHeadless()}
+     *         returns {@code true}
+     * @throws UnsupportedOperationException if Desktop API is not supported on
+     *         the current platform
+     * @see Desktop#isDesktopSupported()
+     * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public AppReopenedEvent() {
     }
-
 }
--- a/src/java.desktop/share/classes/java/awt/desktop/FilesEvent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/java/awt/desktop/FilesEvent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -25,30 +25,41 @@
 
 package java.awt.desktop;
 
+import java.awt.Desktop;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 
-
 /**
  * Auxiliary event containing a list of files.
  *
  * @since 9
  */
 public class FilesEvent extends AppEvent {
+
     private static final long serialVersionUID = 5271763715462312871L;
     final List<File> files;
 
     /**
-     * Constructs a {@code FilesEvent}
-     * @param files files
+     * Constructs a {@code FilesEvent}.
+     *
+     * @param  files the list of files
+     * @throws HeadlessException if {@link GraphicsEnvironment#isHeadless()}
+     *         returns {@code true}
+     * @throws UnsupportedOperationException if Desktop API is not supported on
+     *         the current platform
+     * @see Desktop#isDesktopSupported()
+     * @see java.awt.GraphicsEnvironment#isHeadless
      */
     FilesEvent(final List<File> files) {
         this.files = files;
     }
 
     /**
-     * Gets the list of files
+     * Gets the list of files.
+     *
      * @return the list of files
      */
     public List<File> getFiles() {
@@ -56,5 +67,4 @@
                 ? null
                 : new ArrayList<>(files);
     }
-
 }
--- a/src/java.desktop/share/classes/java/awt/desktop/OpenFilesEvent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/java/awt/desktop/OpenFilesEvent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -25,10 +25,12 @@
 
 package java.awt.desktop;
 
+import java.awt.Desktop;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
 import java.io.File;
 import java.util.List;
 
-
 /**
  * Event sent when the app is asked to open a list of files.
  *
@@ -37,13 +39,21 @@
  * @since 9
  */
 public final class OpenFilesEvent extends FilesEvent {
+
     private static final long serialVersionUID = -3982871005867718956L;
     final String searchTerm;
 
     /**
-     * Constructs an {@code OpenFilesEvent}
-     * @param files files
-     * @param searchTerm searchTerm
+     * Constructs an {@code OpenFilesEvent}.
+     *
+     * @param  files the list of files
+     * @param  searchTerm the search term
+     * @throws HeadlessException if {@link GraphicsEnvironment#isHeadless()}
+     *         returns {@code true}
+     * @throws UnsupportedOperationException if Desktop API is not supported on
+     *         the current platform
+     * @see Desktop#isDesktopSupported()
+     * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public OpenFilesEvent(final List<File> files, final String searchTerm) {
         super(files);
@@ -57,7 +67,7 @@
      * term that was used to find the files. This is for example the case
      * on Mac OS X, when the files were opened using the Spotlight search
      * menu or a Finder search window.
-     *
+     * <p>
      * This is useful for highlighting the search term in the documents when
      * they are opened.
      *
@@ -66,5 +76,4 @@
     public String getSearchTerm() {
         return searchTerm;
     }
-
 }
--- a/src/java.desktop/share/classes/java/awt/desktop/OpenURIEvent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/java/awt/desktop/OpenURIEvent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -25,9 +25,11 @@
 
 package java.awt.desktop;
 
+import java.awt.Desktop;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
 import java.net.URI;
 
-
 /**
  * Event sent when the app is asked to open a {@code URI}.
  *
@@ -36,12 +38,20 @@
  * @since 9
  */
 public final class OpenURIEvent extends AppEvent {
+
     private static final long serialVersionUID = 221209100935933476L;
     final URI uri;
 
     /**
-     * Constructs an {@code OpenURIEvent}
-     * @param uri {@code URI}
+     * Constructs an {@code OpenURIEvent}.
+     *
+     * @param  uri the {@code URI} the app was asked to open
+     * @throws HeadlessException if {@link GraphicsEnvironment#isHeadless()}
+     *         returns {@code true}
+     * @throws UnsupportedOperationException if Desktop API is not supported on
+     *         the current platform
+     * @see Desktop#isDesktopSupported()
+     * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public OpenURIEvent(final URI uri) {
         this.uri = uri;
@@ -54,5 +64,4 @@
     public URI getURI() {
         return uri;
     }
-
 }
--- a/src/java.desktop/share/classes/java/awt/desktop/PreferencesEvent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/java/awt/desktop/PreferencesEvent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -25,6 +25,9 @@
 
 package java.awt.desktop;
 
+import java.awt.Desktop;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
 
 /**
  * Event sent when the application is asked to open its preferences window.
@@ -34,12 +37,19 @@
  * @since 9
  */
 public final class PreferencesEvent extends AppEvent {
+
     private static final long serialVersionUID = -6398607097086476160L;
 
     /**
-     * Constructs a {@code PreferencesEvent}
+     * Constructs a {@code PreferencesEvent}.
+     *
+     * @throws HeadlessException if {@link GraphicsEnvironment#isHeadless()}
+     *         returns {@code true}
+     * @throws UnsupportedOperationException if Desktop API is not supported on
+     *         the current platform
+     * @see Desktop#isDesktopSupported()
+     * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public PreferencesEvent() {
     }
-
 }
--- a/src/java.desktop/share/classes/java/awt/desktop/PrintFilesEvent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/java/awt/desktop/PrintFilesEvent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -23,13 +23,14 @@
  * questions.
  */
 
-
 package java.awt.desktop;
 
+import java.awt.Desktop;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
 import java.io.File;
 import java.util.List;
 
-
 /**
  * Event sent when the app is asked to print a list of files.
  *
@@ -37,14 +38,21 @@
  * @since 9
  */
 public final class PrintFilesEvent extends FilesEvent {
+
     private static final long serialVersionUID = -5752560876153618618L;
 
     /**
-     * Constructs a {@code PrintFilesEvent}
-     * @param files files
+     * Constructs a {@code PrintFilesEvent}.
+     *
+     * @param  files the list of files
+     * @throws HeadlessException if {@link GraphicsEnvironment#isHeadless()}
+     *         returns {@code true}
+     * @throws UnsupportedOperationException if Desktop API is not supported on
+     *         the current platform
+     * @see Desktop#isDesktopSupported()
+     * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public PrintFilesEvent(final List<File> files) {
         super(files);
     }
-
 }
--- a/src/java.desktop/share/classes/java/awt/desktop/QuitEvent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/java/awt/desktop/QuitEvent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -25,6 +25,10 @@
 
 package java.awt.desktop;
 
+import java.awt.Desktop;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
+
 /**
  * Event sent when the application is asked to quit.
  *
@@ -37,7 +41,14 @@
     private static final long serialVersionUID = -256100795532403146L;
 
     /**
-     * Constructs a {@code QuitEvent}
+     * Constructs a {@code QuitEvent}.
+     *
+     * @throws HeadlessException if {@link GraphicsEnvironment#isHeadless()}
+     *         returns {@code true}
+     * @throws UnsupportedOperationException if Desktop API is not supported on
+     *         the current platform
+     * @see Desktop#isDesktopSupported()
+     * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public QuitEvent() {
     }
--- a/src/java.desktop/share/classes/java/awt/desktop/ScreenSleepEvent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/java/awt/desktop/ScreenSleepEvent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -22,8 +22,13 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package java.awt.desktop;
 
+import java.awt.Desktop;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
+
 /**
  * Event sent when the displays attached to the system enter and exit power save
  * sleep.
@@ -38,7 +43,14 @@
     private static final long serialVersionUID = 7521606180376544150L;
 
     /**
-     * Constructs a ScreenSleepEvent
+     * Constructs a {@code ScreenSleepEvent}.
+     *
+     * @throws HeadlessException if {@link GraphicsEnvironment#isHeadless()}
+     *         returns {@code true}
+     * @throws UnsupportedOperationException if Desktop API is not supported on
+     *         the current platform
+     * @see Desktop#isDesktopSupported()
+     * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public ScreenSleepEvent() {
     }
--- a/src/java.desktop/share/classes/java/awt/desktop/SystemSleepEvent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/java/awt/desktop/SystemSleepEvent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -25,6 +25,10 @@
 
 package java.awt.desktop;
 
+import java.awt.Desktop;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
+
 /**
  * Event sent when the system enters and exits power save sleep.
  *
@@ -38,7 +42,14 @@
     private static final long serialVersionUID = 11372269824930549L;
 
     /**
-     * Constructs a SystemSleepEvent
+     * Constructs a {@code SystemSleepEvent}.
+     *
+     * @throws HeadlessException if {@link GraphicsEnvironment#isHeadless()}
+     *         returns {@code true}
+     * @throws UnsupportedOperationException if Desktop API is not supported on
+     *         the current platform
+     * @see Desktop#isDesktopSupported()
+     * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public SystemSleepEvent() {
     }
--- a/src/java.desktop/share/classes/java/awt/desktop/UserSessionEvent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/java/awt/desktop/UserSessionEvent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -22,8 +22,13 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package java.awt.desktop;
 
+import java.awt.Desktop;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
+
 /**
  * Event sent when the user session has been changed.
  *
@@ -66,9 +71,15 @@
     }
 
     /**
-     * Constructs a {@code UserSessionEvent}
+     * Constructs a {@code UserSessionEvent}.
      *
-     * @param reason of session change
+     * @param  reason the reason of the user session change
+     * @throws HeadlessException if {@link GraphicsEnvironment#isHeadless()}
+     *         returns {@code true}
+     * @throws UnsupportedOperationException if Desktop API is not supported on
+     *         the current platform
+     * @see Desktop#isDesktopSupported()
+     * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public UserSessionEvent(Reason reason) {
         this.reason = reason;
--- a/src/java.desktop/share/classes/javax/print/ServiceUI.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/javax/print/ServiceUI.java	Mon Jun 11 09:29:44 2018 +0200
@@ -25,8 +25,6 @@
 
 package javax.print;
 
-import java.awt.Dialog;
-import java.awt.Frame;
 import java.awt.GraphicsConfiguration;
 import java.awt.GraphicsEnvironment;
 import java.awt.HeadlessException;
@@ -35,11 +33,11 @@
 
 import javax.print.attribute.Attribute;
 import javax.print.attribute.AttributeSet;
+import javax.print.attribute.standard.DialogOwner;
 import javax.print.attribute.PrintRequestAttributeSet;
 import javax.print.attribute.standard.Destination;
 import javax.print.attribute.standard.Fidelity;
 
-import sun.print.DialogOwner;
 import sun.print.ServiceDialog;
 import sun.print.SunAlternateMedia;
 
@@ -185,6 +183,7 @@
 
         DialogOwner dlgOwner = (DialogOwner)attributes.get(DialogOwner.class);
         Window owner = (dlgOwner != null) ? dlgOwner.getOwner() : null;
+        boolean setOnTop = (dlgOwner != null) && (owner == null);
 
         Rectangle gcBounds = (gc == null) ?  GraphicsEnvironment.
             getLocalGraphicsEnvironment().getDefaultScreenDevice().
@@ -192,21 +191,17 @@
 
         x += gcBounds.x;
         y += gcBounds.y;
-        ServiceDialog dialog;
-        if (owner instanceof Frame) {
-            dialog = new ServiceDialog(gc,
-                                       x,
-                                       y,
-                                       services, defaultIndex,
-                                       flavor, attributes,
-                                       (Frame)owner);
-        } else {
-            dialog = new ServiceDialog(gc,
-                                       x,
-                                       y,
-                                       services, defaultIndex,
-                                       flavor, attributes,
-                                       (Dialog)owner);
+        ServiceDialog dialog = new ServiceDialog(gc,
+                                                 x,
+                                                 y,
+                                                 services, defaultIndex,
+                                                 flavor, attributes,
+                                                 owner);
+        if (setOnTop) {
+            try {
+                dialog.setAlwaysOnTop(true);
+            } catch (SecurityException e) {
+            }
         }
         Rectangle dlgBounds = dialog.getBounds();
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/share/classes/javax/print/attribute/standard/DialogOwner.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.print.attribute.standard;
+
+import java.awt.Window;
+import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintRequestAttribute;
+import sun.print.DialogOwnerAccessor;
+
+/**
+ * An attribute class used to support requesting a print or page setup dialog
+ * be kept displayed on top of all windows or some specific window.
+ * <p>
+ * Constructed without any arguments it will request that a print or page
+ * setup dialog be configured as if the application directly was to specify
+ * {@code java.awt.Window.setAlwaysOnTop(true)}, subject to permission checks.
+ * <p>
+ * Constructed with a {@link java.awt.Window} parameter, it requests that
+ * the dialog be owned by the specified window.
+ *
+ * @since 11
+ */
+public final class DialogOwner implements PrintRequestAttribute {
+
+    private static class Accessor extends DialogOwnerAccessor {
+
+         public long getOwnerID(DialogOwner owner) {
+             return owner.getID();
+         }
+    }
+
+    static private Accessor accessor = new Accessor();
+    static {
+             DialogOwnerAccessor.setAccessor(accessor);
+    }
+
+    private static final long serialVersionUID = -1901909867156076547L;
+
+    private Window owner;
+    private transient long id;
+
+    /**
+     * Constructs an instance which can be used to request
+     * {@code java.awt.Window.setAlwaysOnTop(true)} behaviour.
+     * This should be used where there is no application preferred owner window.
+     * Whether this has any effect depends on if always on top is supported
+     * for this platform and the particular dialog to be displayed.
+     */
+    public DialogOwner() {
+    }
+
+    /**
+     * Constructs an instance which can be used to request that the
+     * specified {@link java.awt.Window} be the owner of the dialog.
+     * @param owner window.
+     */
+    public DialogOwner(Window owner) {
+        this.owner = owner;
+    }
+
+    /**
+     * Constructs an instance which requests that the dialog be displayed
+     * as if it were a child of a native platform window, specified
+     * using its opqaue platform identifier or handle.
+     * This is useful mainly for the case where the id represents a window
+     * which may not be an AWT {@code Window}, but instead was created by
+     * another UI toolkit, such as OpenJFX.
+     * Any effect is platform dependent.
+     * @param id a native window identifier or handle
+     */
+    DialogOwner(long id) {
+        this.id = id;
+    }
+
+    /**
+     * Returns a native platform id or handle, if one was specified,
+     * otherwise, zero.
+     * @return a native platform id.
+     */
+    long getID() {
+        return id;
+    }
+
+    /**
+     * Returns a {@code Window owner}, if one was specified,
+     * otherwise {@code null}.
+     * @return an owner window.
+     */
+    public Window getOwner() {
+        return owner;
+    }
+
+    /**
+     * Get the printing attribute class which is to be used as the "category"
+     * for this printing attribute value.
+     * <p>
+     * For class {@code DialogOwner}, the category is class
+     * {@code DialogOwner} itself.
+     *
+     * @return printing attribute class (category), an instance of class
+     *         {@link Class java.lang.Class}
+     */
+    public final Class<? extends Attribute> getCategory() {
+        return DialogOwner.class;
+    }
+
+    /**
+     * Get the name of the category of which this attribute value is an
+     * instance.
+     * <p>
+     * For class {@code DialogOwner}, the category name is
+     * {@code "dialog-owner"}.
+     *
+     */
+    public final String getName() {
+        return "dialog-owner";
+
+    }
+}
--- a/src/java.desktop/share/classes/sun/applet/AppletClassLoader.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/sun/applet/AppletClassLoader.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2018, 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
@@ -25,31 +25,28 @@
 
 package sun.applet;
 
-import java.lang.NullPointerException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.net.SocketPermission;
-import java.net.URLConnection;
-import java.net.MalformedURLException;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
+import java.io.BufferedInputStream;
 import java.io.EOFException;
 import java.io.File;
 import java.io.FilePermission;
 import java.io.IOException;
-import java.io.BufferedInputStream;
 import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.net.URLConnection;
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.CodeSource;
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.NoSuchElementException;
-import java.security.AccessController;
-import java.security.AccessControlContext;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedExceptionAction;
-import java.security.PrivilegedActionException;
-import java.security.CodeSource;
-import java.security.Permission;
-import java.security.PermissionCollection;
+
 import sun.awt.AppContext;
 import sun.awt.SunToolkit;
 import sun.net.www.ParseUtil;
@@ -151,13 +148,10 @@
         try {
             return super.loadClass(name, resolve);
         } catch (ClassNotFoundException e) {
-            //printError(name, e.getException());
             throw e;
         } catch (RuntimeException e) {
-            //printError(name, e);
             throw e;
         } catch (Error e) {
-            //printError(name, e);
             throw e;
         }
     }
@@ -825,30 +819,6 @@
     {
         return jdk12AppletInfo.get(clazz.toString());
     }
-
-    private static AppletMessageHandler mh =
-        new AppletMessageHandler("appletclassloader");
-
-    /*
-     * Prints a class loading error message.
-     */
-    private static void printError(String name, Throwable e) {
-        String s = null;
-        if (e == null) {
-            s = mh.getMessage("filenotfound", name);
-        } else if (e instanceof IOException) {
-            s = mh.getMessage("fileioexception", name);
-        } else if (e instanceof ClassFormatError) {
-            s = mh.getMessage("fileformat", name);
-        } else if (e instanceof ThreadDeath) {
-            s = mh.getMessage("filedeath", name);
-        } else if (e instanceof Error) {
-            s = mh.getMessage("fileerror", e.toString(), name);
-        }
-        if (s != null) {
-            System.err.println(s);
-        }
-    }
 }
 
 /*
--- a/src/java.desktop/share/classes/sun/applet/AppletEvent.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.applet;
-
-import java.util.EventObject;
-
-
-/**
- * AppletEvent class.
- *
- * @author  Sunita Mani
- *
- * @deprecated The Applet API is deprecated. See the
- * <a href="../../java/applet/package-summary.html"> java.applet package
- * documentation</a> for further information.
- */
-@SuppressWarnings("serial") // JDK-implementation class
-@Deprecated(since = "9")
-public class AppletEvent extends EventObject {
-
-    private Object arg;
-    private int id;
-
-
-    public AppletEvent(Object source, int id, Object argument) {
-        super(source);
-        this.arg = argument;
-        this.id = id;
-    }
-
-    public int getID() {
-        return id;
-    }
-
-    public Object getArgument() {
-        return arg;
-    }
-
-    public String toString() {
-        String str = getClass().getName() + "[source=" + source + " + id="+ id;
-        if (arg != null) {
-            str += " + arg=" + arg;
-        }
-        str += " ]";
-        return str;
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/AppletEventMulticaster.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.applet;
-
-import java.util.EventListener;
-import java.io.Serializable;
-import java.io.ObjectOutputStream;
-import java.io.IOException;
-
-/**
- * AppletEventMulticaster class.  This class manages an immutable
- * structure consisting of a chain of AppletListeners and is
- * responsible for dispatching events to them.
- *
- * @author  Sunita Mani
- *
- * @deprecated The Applet API is deprecated. See the
- * <a href="../../java/applet/package-summary.html"> java.applet package
- * documentation</a> for further information.
- */
-@Deprecated(since = "9")
-public class AppletEventMulticaster implements AppletListener {
-
-    private final AppletListener a, b;
-
-    public AppletEventMulticaster(AppletListener a, AppletListener b) {
-        this.a = a; this.b = b;
-    }
-
-    public void appletStateChanged(AppletEvent e) {
-        a.appletStateChanged(e);
-        b.appletStateChanged(e);
-    }
-
-    /**
-     * Adds Applet-listener-a with Applet-listener-b and
-     * returns the resulting multicast listener.
-     * @param a Applet-listener-a
-     * @param b Applet-listener-b
-     */
-    public static AppletListener add(AppletListener a, AppletListener b) {
-        return addInternal(a, b);
-    }
-
-    /**
-     * Removes the old Applet-listener from Applet-listener-l and
-     * returns the resulting multicast listener.
-     * @param l Applet-listener-l
-     * @param oldl the Applet-listener being removed
-     */
-    public static AppletListener remove(AppletListener l, AppletListener oldl) {
-        return removeInternal(l, oldl);
-    }
-
-    /**
-     * Returns the resulting multicast listener from adding listener-a
-     * and listener-b together.
-     * If listener-a is null, it returns listener-b;
-     * If listener-b is null, it returns listener-a
-     * If neither are null, then it creates and returns
-     * a new AppletEventMulticaster instance which chains a with b.
-     * @param a event listener-a
-     * @param b event listener-b
-     */
-    private static AppletListener addInternal(AppletListener a, AppletListener b) {
-        if (a == null)  return b;
-        if (b == null)  return a;
-        return new AppletEventMulticaster(a, b);
-    }
-
-
-    /**
-     * Removes a listener from this multicaster and returns the
-     * resulting multicast listener.
-     * @param oldl the listener to be removed
-     */
-    protected AppletListener remove(AppletListener oldl) {
-        if (oldl == a)  return b;
-        if (oldl == b)  return a;
-        AppletListener a2 = removeInternal(a, oldl);
-        AppletListener b2 = removeInternal(b, oldl);
-        if (a2 == a && b2 == b) {
-            return this;        // it's not here
-        }
-        return addInternal(a2, b2);
-    }
-
-
-    /**
-     * Returns the resulting multicast listener after removing the
-     * old listener from listener-l.
-     * If listener-l equals the old listener OR listener-l is null,
-     * returns null.
-     * Else if listener-l is an instance of AppletEventMulticaster
-     * then it removes the old listener from it.
-     * Else, returns listener l.
-     * @param l the listener being removed from
-     * @param oldl the listener being removed
-     */
-    private static AppletListener removeInternal(AppletListener l, AppletListener oldl) {
-        if (l == oldl || l == null) {
-            return null;
-        } else if (l instanceof AppletEventMulticaster) {
-            return ((AppletEventMulticaster)l).remove(oldl);
-        } else {
-            return l;           // it's not here
-        }
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/AppletIOException.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.applet;
-
-import java.io.IOException;
-
-/**
- * An applet IO exception.
- *
- * @author      Koji Uno
- *
- * @deprecated The Applet API is deprecated. See the
- * <a href="../../java/applet/package-summary.html"> java.applet package
- * documentation</a> for further information.
- */
-@SuppressWarnings("serial") // JDK implementation class
-@Deprecated(since = "9")
-public class AppletIOException extends IOException {
-    private String key = null;
-    private Object msgobj = null;
-
-    public AppletIOException(String key) {
-        super(key);
-        this.key = key;
-
-    }
-    public AppletIOException(String key, Object arg) {
-        this(key);
-        msgobj = arg;
-    }
-
-    public String getLocalizedMessage() {
-        if( msgobj != null)
-            return amh.getMessage(key, msgobj);
-        else
-            return amh.getMessage(key);
-    }
-
-    private static AppletMessageHandler amh = new AppletMessageHandler("appletioexception");
-
-}
--- a/src/java.desktop/share/classes/sun/applet/AppletIllegalArgumentException.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.applet;
-
-/**
- * An applet security exception.
- *
- * @author      Arthur van Hoff
- *
- * @deprecated The Applet API is deprecated. See the
- * <a href="../../java/applet/package-summary.html"> java.applet package
- * documentation</a> for further information.
- */
-@SuppressWarnings("serial") // JDK implementation class
-@Deprecated(since = "9")
-public class AppletIllegalArgumentException extends IllegalArgumentException {
-    private String key = null;
-
-    public AppletIllegalArgumentException(String key) {
-        super(key);
-        this.key = key;
-
-    }
-
-    public String getLocalizedMessage() {
-        return amh.getMessage(key);
-    }
-
-    private static AppletMessageHandler amh = new AppletMessageHandler("appletillegalargumentexception");
-}
--- a/src/java.desktop/share/classes/sun/applet/AppletImageRef.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.applet;
-
-import java.awt.Toolkit;
-import java.awt.Image;
-import java.lang.ref.SoftReference;
-import sun.awt.image.URLImageSource;
-import java.net.URL;
-
-@Deprecated(since = "9")
-class AppletImageRef {
-    private SoftReference<Image> soft = null;
-
-    URL url;
-
-    /**
-     * Returns a pointer to the object referenced by this Ref.  If the object
-     * has been thrown away by the garbage collector, it will be
-     * reconstituted. This method does everything necessary to ensure that the garbage
-     * collector throws things away in Least Recently Used(LRU) order.  Applications should
-     * never override this method. The get() method effectively caches calls to
-     * reconstitute().
-     */
-    public synchronized Image get() {
-        Image t = check();
-        if (t == null) {
-            t = reconstitute();
-            setThing(t);
-        }
-        return t;
-    }
-
-    /**
-     * Create the Ref
-     */
-    AppletImageRef(URL url) {
-        this.url = url;
-    }
-
-    /**
-     * Flushes the cached object.  Forces the next invocation of get() to
-     * invoke reconstitute().
-     */
-    public synchronized void flush() {
-        SoftReference<Image> s = soft;
-        if (s != null) s.clear();
-        soft = null;
-    }
-
-    /**
-     * Sets the thing to the specified object.
-     * @param thing the specified object
-     */
-    public synchronized void setThing(Image thing) {
-        flush();
-        soft = new SoftReference<>(thing);
-    }
-
-    /**
-     * Checks to see what object is being pointed at by this Ref and returns it.
-     */
-    public synchronized Image check() {
-        SoftReference<Image> s = soft;
-        if (s == null) return null;
-        return s.get();
-    }
-
-    /**
-     * Reconsitute the image.  Only called when the ref has been flushed.
-     */
-    public Image reconstitute() {
-        Image img = Toolkit.getDefaultToolkit().createImage(new URLImageSource(url));
-        return img;
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/AppletListener.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.applet;
-
-import java.util.EventListener;
-
-/**
- * Applet Listener interface.  This interface is to be implemented
- * by objects interested in AppletEvents.
- *
- * @author  Sunita Mani
- *
- * @deprecated The Applet API is deprecated. See the
- * <a href="../../java/applet/package-summary.html"> java.applet package
- * documentation</a> for further information.
- */
-@Deprecated(since = "9")
-public interface AppletListener extends EventListener {
-    public void appletStateChanged(AppletEvent e);
-}
--- a/src/java.desktop/share/classes/sun/applet/AppletMessageHandler.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.applet;
-
-import java.util.ResourceBundle;
-import java.util.MissingResourceException;
-import java.text.MessageFormat;
-
-/**
- * An hanlder of localized messages.
- *
- * @author      Koji Uno
- */
-class AppletMessageHandler {
-    private static ResourceBundle rb;
-    private String baseKey = null;
-
-    static {
-        try {
-            rb = ResourceBundle.getBundle
-                ("sun.applet.resources.MsgAppletViewer");
-        } catch (MissingResourceException e) {
-            System.out.println(e.getMessage());
-            System.exit(1);
-        }
-    }
-
-    AppletMessageHandler(String baseKey) {
-        this.baseKey = baseKey;
-    }
-
-    String getMessage(String key) {
-        return rb.getString(getQualifiedKey(key));
-    }
-
-    String getMessage(String key, Object arg){
-        String basemsgfmt = rb.getString(getQualifiedKey(key));
-        MessageFormat msgfmt = new MessageFormat(basemsgfmt);
-        Object msgobj[] = new Object[1];
-        if (arg == null) {
-            arg = "null"; // mimic java.io.PrintStream.print(String)
-        }
-        msgobj[0] = arg;
-        return msgfmt.format(msgobj);
-    }
-
-    String getMessage(String key, Object arg1, Object arg2) {
-        String basemsgfmt = rb.getString(getQualifiedKey(key));
-        MessageFormat msgfmt = new MessageFormat(basemsgfmt);
-        Object msgobj[] = new Object[2];
-        if (arg1 == null) {
-            arg1 = "null";
-        }
-        if (arg2 == null) {
-            arg2 = "null";
-        }
-        msgobj[0] = arg1;
-        msgobj[1] = arg2;
-        return msgfmt.format(msgobj);
-    }
-
-    String getMessage(String key, Object arg1, Object arg2, Object arg3) {
-        String basemsgfmt = rb.getString(getQualifiedKey(key));
-        MessageFormat msgfmt = new MessageFormat(basemsgfmt);
-        Object msgobj[] = new Object[3];
-        if (arg1 == null) {
-            arg1 = "null";
-        }
-        if (arg2 == null) {
-            arg2 = "null";
-        }
-        if (arg3 == null) {
-            arg3 = "null";
-        }
-        msgobj[0] = arg1;
-        msgobj[1] = arg2;
-        msgobj[2] = arg3;
-        return msgfmt.format(msgobj);
-    }
-
-    String getMessage(String key, Object arg[]) {
-        String basemsgfmt = rb.getString(getQualifiedKey(key));
-        MessageFormat msgfmt = new MessageFormat(basemsgfmt);
-        return msgfmt.format(arg);
-    }
-
-    String getQualifiedKey(String subKey) {
-        return baseKey + "." + subKey;
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/AppletObjectInputStream.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- * COPYRIGHT goes here
- */
-
-package sun.applet;
-
-import java.io.*;
-import java.lang.reflect.Array;
-
-/**
- * This subclass of ObjectInputStream delegates loading of classes to
- * an existing ClassLoader.
- *
- * @deprecated The Applet API is deprecated. See the
- * <a href="../../java/applet/package-summary.html"> java.applet package
- * documentation</a> for further information.
- */
-@Deprecated(since = "9")
-class AppletObjectInputStream extends ObjectInputStream
-{
-    private AppletClassLoader loader;
-
-    /**
-     * Loader must be non-null;
-     */
-
-    public AppletObjectInputStream(InputStream in, AppletClassLoader loader)
-            throws IOException, StreamCorruptedException {
-
-        super(in);
-        if (loader == null) {
-            throw new AppletIllegalArgumentException("appletillegalargumentexception.objectinputstream");
-
-        }
-        this.loader = loader;
-    }
-
-    /**
-     * Make a primitive array class
-     */
-
-    private Class<?> primitiveType(char type) {
-        switch (type) {
-        case 'B': return byte.class;
-        case 'C': return char.class;
-        case 'D': return double.class;
-        case 'F': return float.class;
-        case 'I': return int.class;
-        case 'J': return long.class;
-        case 'S': return short.class;
-        case 'Z': return boolean.class;
-        default: return null;
-        }
-    }
-
-    /**
-     * Use the given ClassLoader rather than using the system class
-     */
-    protected Class<?> resolveClass(ObjectStreamClass classDesc)
-        throws IOException, ClassNotFoundException {
-
-        String cname = classDesc.getName();
-        if (cname.startsWith("[")) {
-            // An array
-            Class<?> component;            // component class
-            int dcount;                 // dimension
-            for (dcount=1; cname.charAt(dcount)=='['; dcount++) ;
-            if (cname.charAt(dcount) == 'L') {
-                component = loader.loadClass(cname.substring(dcount+1,
-                                                             cname.length()-1));
-            } else {
-                if (cname.length() != dcount+1) {
-                    throw new ClassNotFoundException(cname);// malformed
-                }
-                component = primitiveType(cname.charAt(dcount));
-            }
-            int dim[] = new int[dcount];
-            for (int i=0; i<dcount; i++) {
-                dim[i]=0;
-            }
-            return Array.newInstance(component, dim).getClass();
-        } else {
-            return loader.loadClass(cname);
-        }
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/AppletPanel.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1270 +0,0 @@
-/*
- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.applet;
-
-import java.applet.*;
-import java.awt.*;
-import java.awt.event.*;
-import java.io.*;
-import java.lang.ref.WeakReference;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.JarURLConnection;
-import java.net.SocketPermission;
-import java.net.URL;
-import java.security.*;
-import java.util.*;
-import java.util.Locale;
-import java.util.concurrent.LinkedBlockingQueue;
-import sun.awt.AWTAccessor;
-import sun.awt.AppContext;
-import sun.awt.EmbeddedFrame;
-import sun.awt.SunToolkit;
-import sun.awt.util.PerformanceLogger;
-import sun.security.util.SecurityConstants;
-
-/**
- * Applet panel class. The panel manages and manipulates the
- * applet as it is being loaded. It forks a separate thread in a new
- * thread group to call the applet's init(), start(), stop(), and
- * destroy() methods.
- *
- * @deprecated The Applet API is deprecated. See the
- * <a href="../../java/applet/package-summary.html"> java.applet package
- * documentation</a> for further information.
- *
- * @author      Arthur van Hoff
- */
-@SuppressWarnings({"serial"}) // JDK implementation class
-@Deprecated(since = "9")
-public
-abstract class AppletPanel extends Panel implements AppletStub, Runnable {
-
-    /**
-     * The applet (if loaded).
-     */
-    Applet applet;
-
-
-    /**
-     * The classloader for the applet.
-     */
-    protected AppletClassLoader loader;
-
-    /* applet event ids */
-    public static final int APPLET_DISPOSE = 0;
-    public static final int APPLET_LOAD = 1;
-    public static final int APPLET_INIT = 2;
-    public static final int APPLET_START = 3;
-    public static final int APPLET_STOP = 4;
-    public static final int APPLET_DESTROY = 5;
-    public static final int APPLET_QUIT = 6;
-    public static final int APPLET_ERROR = 7;
-
-    /* send to the parent to force relayout */
-    public static final int APPLET_RESIZE = 51234;
-
-    /* sent to a (distant) parent to indicate that the applet is being
-     * loaded or as completed loading
-     */
-    public static final int APPLET_LOADING = 51235;
-    public static final int APPLET_LOADING_COMPLETED = 51236;
-
-    /**
-     * The current status. One of:
-     *    APPLET_DISPOSE,
-     *    APPLET_LOAD,
-     *    APPLET_INIT,
-     *    APPLET_START,
-     *    APPLET_STOP,
-     *    APPLET_DESTROY,
-     *    APPLET_ERROR.
-     */
-    protected int status;
-
-    /**
-     * The thread for the applet.
-     */
-    protected Thread handler;
-
-
-    /**
-     * The initial applet size.
-     */
-    Dimension defaultAppletSize = new Dimension(10, 10);
-
-    /**
-     * The current applet size.
-     */
-    Dimension currentAppletSize = new Dimension(10, 10);
-
-    /**
-     * The thread to use during applet loading
-     */
-
-    Thread loaderThread = null;
-
-    /**
-     * Flag to indicate that a loading has been cancelled
-     */
-    boolean loadAbortRequest = false;
-
-    /* abstract classes */
-    protected abstract String getCode();
-    protected abstract String getJarFiles();
-
-    @Override
-    public abstract int    getWidth();
-    @Override
-    public abstract int    getHeight();
-    public abstract boolean hasInitialFocus();
-
-    private static int threadGroupNumber = 0;
-
-    protected void setupAppletAppContext() {
-        // do nothing
-    }
-
-    /*
-     * Creates a thread to run the applet. This method is called
-     * each time an applet is loaded and reloaded.
-     */
-    synchronized void createAppletThread() {
-        // Create a thread group for the applet, and start a new
-        // thread to load the applet.
-        String nm = "applet-" + getCode();
-        loader = getClassLoader(getCodeBase(), getClassLoaderCacheKey());
-        loader.grab(); // Keep this puppy around!
-
-        // 4668479: Option to turn off codebase lookup in AppletClassLoader
-        // during resource requests. [stanley.ho]
-        String param = getParameter("codebase_lookup");
-
-        if (param != null && param.equals("false"))
-            loader.setCodebaseLookup(false);
-        else
-            loader.setCodebaseLookup(true);
-
-
-        ThreadGroup appletGroup = loader.getThreadGroup();
-        handler = new Thread(appletGroup, this, "thread " + nm, 0, false);
-        // set the context class loader for this thread
-        AccessController.doPrivileged(new PrivilegedAction<Object>() {
-                @Override
-                public Object run() {
-                    handler.setContextClassLoader(loader);
-                    return null;
-                }
-            });
-        handler.start();
-    }
-
-    void joinAppletThread() throws InterruptedException {
-        if (handler != null) {
-            handler.join();
-            handler = null;
-        }
-    }
-
-    void release() {
-        if (loader != null) {
-            loader.release();
-            loader = null;
-        }
-    }
-
-    /**
-     * Construct an applet viewer and start the applet.
-     */
-    public void init() {
-        try {
-            // Get the width (if any)
-            defaultAppletSize.width = getWidth();
-            currentAppletSize.width = defaultAppletSize.width;
-
-            // Get the height (if any)
-            defaultAppletSize.height = getHeight();
-            currentAppletSize.height = defaultAppletSize.height;
-
-        } catch (NumberFormatException e) {
-            // Turn on the error flag and let TagAppletPanel
-            // do the right thing.
-            status = APPLET_ERROR;
-            showAppletStatus("badattribute.exception");
-            showAppletLog("badattribute.exception");
-            showAppletException(e);
-        }
-
-        setLayout(new BorderLayout());
-
-        createAppletThread();
-    }
-
-    /**
-     * Minimum size
-     */
-    @Override
-    @SuppressWarnings("deprecation")
-    public Dimension minimumSize() {
-        return new Dimension(defaultAppletSize.width,
-                             defaultAppletSize.height);
-    }
-
-    /**
-     * Preferred size
-     */
-    @Override
-    @SuppressWarnings("deprecation")
-    public Dimension preferredSize() {
-        return new Dimension(currentAppletSize.width,
-                             currentAppletSize.height);
-    }
-
-    private AppletListener listeners;
-
-    /**
-     * AppletEvent Queue
-     */
-    private LinkedBlockingQueue<Integer> queue = null;
-
-    public synchronized void addAppletListener(AppletListener l) {
-        listeners = AppletEventMulticaster.add(listeners, l);
-    }
-
-    public synchronized void removeAppletListener(AppletListener l) {
-        listeners = AppletEventMulticaster.remove(listeners, l);
-    }
-
-    /**
-     * Dispatch event to the listeners..
-     */
-    public void dispatchAppletEvent(int id, Object argument) {
-        //System.out.println("SEND= " + id);
-        if (listeners != null) {
-            AppletEvent evt = new AppletEvent(this, id, argument);
-            listeners.appletStateChanged(evt);
-        }
-    }
-
-    /**
-     * Send an event. Queue it for execution by the handler thread.
-     */
-    public void sendEvent(int id) {
-        synchronized(this) {
-            if (queue == null) {
-                //System.out.println("SEND0= " + id);
-                queue = new LinkedBlockingQueue<>();
-            }
-            boolean inserted = queue.add(id);
-            notifyAll();
-        }
-        if (id == APPLET_QUIT) {
-            try {
-                joinAppletThread(); // Let the applet event handler exit
-            } catch (InterruptedException e) {
-            }
-
-            // AppletClassLoader.release() must be called by a Thread
-            // not within the applet's ThreadGroup
-            if (loader == null)
-                loader = getClassLoader(getCodeBase(), getClassLoaderCacheKey());
-            release();
-        }
-    }
-
-    /**
-     * Get an event from the queue.
-     */
-    synchronized AppletEvent getNextEvent() throws InterruptedException {
-        while (queue == null || queue.isEmpty()) {
-            wait();
-        }
-        int eventId = queue.take();
-        return new AppletEvent(this, eventId, null);
-    }
-
-    boolean emptyEventQueue() {
-        if ((queue == null) || (queue.isEmpty()))
-            return true;
-        else
-            return false;
-    }
-
-    /**
-     * This kludge is specific to get over AccessControlException thrown during
-     * Applet.stop() or destroy() when static thread is suspended.  Set a flag
-     * in AppletClassLoader to indicate that an
-     * AccessControlException for RuntimePermission "modifyThread" or
-     * "modifyThreadGroup" had occurred.
-     */
-     private void setExceptionStatus(AccessControlException e) {
-     Permission p = e.getPermission();
-     if (p instanceof RuntimePermission) {
-         if (p.getName().startsWith("modifyThread")) {
-             if (loader == null)
-                 loader = getClassLoader(getCodeBase(), getClassLoaderCacheKey());
-             loader.setExceptionStatus();
-         }
-     }
-     }
-
-    /**
-     * Execute applet events.
-     * Here is the state transition diagram
-     *
-     * <pre>{@literal
-     *   Note: (XXX) is the action
-     *         APPLET_XXX is the state
-     *  (applet code loaded) --> APPLET_LOAD -- (applet init called)--> APPLET_INIT --
-     *  (applet start called) --> APPLET_START -- (applet stop called) --> APPLET_STOP --
-     *  (applet destroyed called) --> APPLET_DESTROY --> (applet gets disposed) -->
-     *   APPLET_DISPOSE --> ...
-     * }</pre>
-     *
-     * In the legacy lifecycle model. The applet gets loaded, inited and started. So it stays
-     * in the APPLET_START state unless the applet goes away(refresh page or leave the page).
-     * So the applet stop method called and the applet enters APPLET_STOP state. Then if the applet
-     * is revisited, it will call applet start method and enter the APPLET_START state and stay there.
-     *
-     * In the modern lifecycle model. When the applet first time visited, it is same as legacy lifecycle
-     * model. However, when the applet page goes away. It calls applet stop method and enters APPLET_STOP
-     * state and then applet destroyed method gets called and enters APPLET_DESTROY state.
-     *
-     * This code is also called by AppletViewer. In AppletViewer "Restart" menu, the applet is jump from
-     * APPLET_STOP to APPLET_DESTROY and to APPLET_INIT .
-     *
-     * Also, the applet can jump from APPLET_INIT state to APPLET_DESTROY (in Netscape/Mozilla case).
-     * Same as APPLET_LOAD to
-     * APPLET_DISPOSE since all of this are triggered by browser.
-     *
-     */
-    @Override
-    public void run() {
-
-        Thread curThread = Thread.currentThread();
-        if (curThread == loaderThread) {
-            // if we are in the loader thread, cause
-            // loading to occur.  We may exit this with
-            // status being APPLET_DISPOSE, APPLET_ERROR,
-            // or APPLET_LOAD
-            runLoader();
-            return;
-        }
-
-        boolean disposed = false;
-        while (!disposed && !curThread.isInterrupted()) {
-            AppletEvent evt;
-            try {
-                evt = getNextEvent();
-            } catch (InterruptedException e) {
-                showAppletStatus("bail");
-                return;
-            }
-
-            //showAppletStatus("EVENT = " + evt.getID());
-            try {
-                switch (evt.getID()) {
-                  case APPLET_LOAD:
-                      if (!okToLoad()) {
-                          break;
-                      }
-                      // This complexity allows loading of applets to be
-                      // interruptable.  The actual thread loading runs
-                      // in a separate thread, so it can be interrupted
-                      // without harming the applet thread.
-                      // So that we don't have to worry about
-                      // concurrency issues, the main applet thread waits
-                      // until the loader thread terminates.
-                      // (one way or another).
-                      if (loaderThread == null) {
-                          setLoaderThread(new Thread(null, this,
-                                          "AppletLoader", 0, false));
-                          loaderThread.start();
-                          // we get to go to sleep while this runs
-                          loaderThread.join();
-                          setLoaderThread(null);
-                      } else {
-                          // REMIND: issue an error -- this case should never
-                          // occur.
-                      }
-                      break;
-
-                  case APPLET_INIT:
-                    // AppletViewer "Restart" will jump from destroy method to
-                    // init, that is why we need to check status w/ APPLET_DESTROY
-                      if (status != APPLET_LOAD && status != APPLET_DESTROY) {
-                          showAppletStatus("notloaded");
-                          break;
-                      }
-                      applet.resize(defaultAppletSize);
-
-                      if (PerformanceLogger.loggingEnabled()) {
-                          PerformanceLogger.setTime("Applet Init");
-                          PerformanceLogger.outputLog();
-                      }
-                      applet.init();
-
-                      //Need the default(fallback) font to be created in this AppContext
-                      Font f = getFont();
-                      if (f == null ||
-                          "dialog".equals(f.getFamily().toLowerCase(Locale.ENGLISH)) &&
-                          f.getSize() == 12 && f.getStyle() == Font.PLAIN) {
-                          setFont(new Font(Font.DIALOG, Font.PLAIN, 12));
-                      }
-
-                      // Validate the applet in event dispatch thread
-                      // to avoid deadlock.
-                      try {
-                          final AppletPanel p = this;
-                          Runnable r = new Runnable() {
-                              @Override
-                              public void run() {
-                                  p.validate();
-                              }
-                          };
-                          AWTAccessor.getEventQueueAccessor().invokeAndWait(applet, r);
-                      }
-                      catch(InterruptedException ie) {
-                      }
-                      catch(InvocationTargetException ite) {
-                      }
-
-                      status = APPLET_INIT;
-                      showAppletStatus("inited");
-                      break;
-
-                  case APPLET_START:
-                  {
-                      if (status != APPLET_INIT && status != APPLET_STOP) {
-                          showAppletStatus("notinited");
-                          break;
-                      }
-                      applet.resize(currentAppletSize);
-                      applet.start();
-
-                      // Validate and show the applet in event dispatch thread
-                      // to avoid deadlock.
-                      try {
-                          final AppletPanel p = this;
-                          final Applet a = applet;
-                          Runnable r = new Runnable() {
-                              @Override
-                              public void run() {
-                                  p.validate();
-                                  a.setVisible(true);
-
-                                  // Fix for BugTraq ID 4041703.
-                                  // Set the default focus for an applet.
-                                  if (hasInitialFocus()) {
-                                      setDefaultFocus();
-                                  }
-                              }
-                          };
-                          AWTAccessor.getEventQueueAccessor().invokeAndWait(applet, r);
-                      }
-                      catch(InterruptedException ie) {
-                      }
-                      catch(InvocationTargetException ite) {
-                      }
-
-                      status = APPLET_START;
-                      showAppletStatus("started");
-                      break;
-                  }
-
-                case APPLET_STOP:
-                    if (status != APPLET_START) {
-                        showAppletStatus("notstarted");
-                        break;
-                    }
-                    status = APPLET_STOP;
-
-                    // Hide the applet in event dispatch thread
-                    // to avoid deadlock.
-                    try {
-                        final Applet a = applet;
-                        Runnable r = new Runnable() {
-                            @Override
-                            public void run() {
-                                a.setVisible(false);
-                            }
-                        };
-                        AWTAccessor.getEventQueueAccessor().invokeAndWait(applet, r);
-                    }
-                    catch(InterruptedException ie) {
-                    }
-                    catch(InvocationTargetException ite) {
-                    }
-
-
-                    // During Applet.stop(), any AccessControlException on an involved Class remains in
-                    // the "memory" of the AppletClassLoader.  If the same instance of the ClassLoader is
-                    // reused, the same exception will occur during class loading.  Set the AppletClassLoader's
-                    // exceptionStatusSet flag to allow recognition of what had happened
-                    // when reusing AppletClassLoader object.
-                    try {
-                        applet.stop();
-                    } catch (java.security.AccessControlException e) {
-                        setExceptionStatus(e);
-                        // rethrow exception to be handled as it normally would be.
-                        throw e;
-                    }
-                    showAppletStatus("stopped");
-                    break;
-
-                case APPLET_DESTROY:
-                    if (status != APPLET_STOP && status != APPLET_INIT) {
-                        showAppletStatus("notstopped");
-                        break;
-                    }
-                    status = APPLET_DESTROY;
-
-                    // During Applet.destroy(), any AccessControlException on an involved Class remains in
-                    // the "memory" of the AppletClassLoader.  If the same instance of the ClassLoader is
-                    // reused, the same exception will occur during class loading.  Set the AppletClassLoader's
-                    // exceptionStatusSet flag to allow recognition of what had happened
-                    // when reusing AppletClassLoader object.
-                    try {
-                        applet.destroy();
-                    } catch (java.security.AccessControlException e) {
-                        setExceptionStatus(e);
-                        // rethrow exception to be handled as it normally would be.
-                        throw e;
-                    }
-                    showAppletStatus("destroyed");
-                    break;
-
-                case APPLET_DISPOSE:
-                    if (status != APPLET_DESTROY && status != APPLET_LOAD) {
-                        showAppletStatus("notdestroyed");
-                        break;
-                    }
-                    status = APPLET_DISPOSE;
-
-                    try {
-                        final Applet a = applet;
-                        Runnable r = new Runnable() {
-                            @Override
-                            public void run() {
-                                remove(a);
-                            }
-                        };
-                        AWTAccessor.getEventQueueAccessor().invokeAndWait(applet, r);
-                    }
-                    catch(InterruptedException ie)
-                    {
-                    }
-                    catch(InvocationTargetException ite)
-                    {
-                    }
-                    applet = null;
-                    showAppletStatus("disposed");
-                    disposed = true;
-                    break;
-
-                case APPLET_QUIT:
-                    return;
-                }
-            } catch (Exception e) {
-                status = APPLET_ERROR;
-                if (e.getMessage() != null) {
-                    showAppletStatus("exception2", e.getClass().getName(),
-                                     e.getMessage());
-                } else {
-                    showAppletStatus("exception", e.getClass().getName());
-                }
-                showAppletException(e);
-            } catch (ThreadDeath e) {
-                showAppletStatus("death");
-                return;
-            } catch (Error e) {
-                status = APPLET_ERROR;
-                if (e.getMessage() != null) {
-                    showAppletStatus("error2", e.getClass().getName(),
-                                     e.getMessage());
-                } else {
-                    showAppletStatus("error", e.getClass().getName());
-                }
-                showAppletException(e);
-            }
-            clearLoadAbortRequest();
-        }
-    }
-
-    /**
-     * Gets most recent focus owner component associated with the given window.
-     * It does that without calling Window.getMostRecentFocusOwner since it
-     * provides its own logic contradicting with setDefautlFocus. Instead, it
-     * calls KeyboardFocusManager directly.
-     */
-    private Component getMostRecentFocusOwnerForWindow(Window w) {
-        return AWTAccessor.getKeyboardFocusManagerAccessor()
-                .getMostRecentFocusOwner(w);
-    }
-
-    /*
-     * Fix for BugTraq ID 4041703.
-     * Set the focus to a reasonable default for an Applet.
-     */
-    private void setDefaultFocus() {
-        Component toFocus = null;
-        Container parent = getParent();
-
-        if(parent != null) {
-            if (parent instanceof Window) {
-                toFocus = getMostRecentFocusOwnerForWindow((Window)parent);
-                if (toFocus == parent || toFocus == null) {
-                    toFocus = parent.getFocusTraversalPolicy().
-                        getInitialComponent((Window)parent);
-                }
-            } else if (parent.isFocusCycleRoot()) {
-                toFocus = parent.getFocusTraversalPolicy().
-                    getDefaultComponent(parent);
-            }
-        }
-
-        if (toFocus != null) {
-            if (parent instanceof EmbeddedFrame) {
-                ((EmbeddedFrame) parent).synthesizeWindowActivation(true);
-            }
-            // EmbeddedFrame might have focus before the applet was added.
-            // Thus after its activation the most recent focus owner will be
-            // restored. We need the applet's initial focusabled component to
-            // be focused here.
-            toFocus.requestFocusInWindow();
-        }
-    }
-
-    /**
-     * Load the applet into memory.
-     * Runs in a seperate (and interruptible) thread from the rest of the
-     * applet event processing so that it can be gracefully interrupted from
-     * things like HotJava.
-     */
-    @SuppressWarnings("deprecation")
-    private void runLoader() {
-        if (status != APPLET_DISPOSE) {
-            showAppletStatus("notdisposed");
-            return;
-        }
-
-        dispatchAppletEvent(APPLET_LOADING, null);
-
-        // REMIND -- might be cool to visually indicate loading here --
-        // maybe do animation?
-        status = APPLET_LOAD;
-
-        // Create a class loader
-        loader = getClassLoader(getCodeBase(), getClassLoaderCacheKey());
-
-        // Load the archives if present.
-        // REMIND - this probably should be done in a separate thread,
-        // or at least the additional archives (epll).
-
-        String code = getCode();
-
-        // setup applet AppContext
-        // this must be called before loadJarFiles
-        setupAppletAppContext();
-
-        try {
-            loadJarFiles(loader);
-            applet = createApplet(loader);
-        } catch (ClassNotFoundException e) {
-            status = APPLET_ERROR;
-            showAppletStatus("notfound", code);
-            showAppletLog("notfound", code);
-            showAppletException(e);
-            return;
-        } catch (InstantiationException e) {
-            status = APPLET_ERROR;
-            showAppletStatus("nocreate", code);
-            showAppletLog("nocreate", code);
-            showAppletException(e);
-            return;
-        } catch (IllegalAccessException e) {
-            status = APPLET_ERROR;
-            showAppletStatus("noconstruct", code);
-            showAppletLog("noconstruct", code);
-            showAppletException(e);
-            // sbb -- I added a return here
-            return;
-        } catch (Exception e) {
-            status = APPLET_ERROR;
-            showAppletStatus("exception", e.getMessage());
-            showAppletException(e);
-            return;
-        } catch (ThreadDeath e) {
-            status = APPLET_ERROR;
-            showAppletStatus("death");
-            return;
-        } catch (Error e) {
-            status = APPLET_ERROR;
-            showAppletStatus("error", e.getMessage());
-            showAppletException(e);
-            return;
-        } finally {
-            // notify that loading is no longer going on
-            dispatchAppletEvent(APPLET_LOADING_COMPLETED, null);
-        }
-
-        // Fixed #4508194: NullPointerException thrown during
-        // quick page switch
-        //
-        if (applet != null)
-        {
-            // Stick it in the frame
-            applet.setStub(this);
-            applet.hide();
-            add("Center", applet);
-            showAppletStatus("loaded");
-            validate();
-        }
-    }
-
-    protected Applet createApplet(final AppletClassLoader loader) throws ClassNotFoundException,
-                                                                         IllegalAccessException, IOException, InstantiationException, InterruptedException {
-        String code = getCode();
-
-        if (code != null) {
-            applet = (Applet)loader.loadCode(code).newInstance();
-        } else {
-            String msg = "nocode";
-            status = APPLET_ERROR;
-            showAppletStatus(msg);
-            showAppletLog(msg);
-            repaint();
-        }
-
-        // Determine the JDK level that the applet targets.
-        // This is critical for enabling certain backward
-        // compatibility switch if an applet is a JDK 1.1
-        // applet. [stanley.ho]
-        findAppletJDKLevel(applet);
-
-        if (Thread.interrupted()) {
-            try {
-                status = APPLET_DISPOSE; // APPLET_ERROR?
-                applet = null;
-                // REMIND: This may not be exactly the right thing: the
-                // status is set by the stop button and not necessarily
-                // here.
-                showAppletStatus("death");
-            } finally {
-                Thread.currentThread().interrupt(); // resignal interrupt
-            }
-            return null;
-        }
-        return applet;
-    }
-
-    protected void loadJarFiles(AppletClassLoader loader) throws IOException,
-                                                                 InterruptedException {
-        // Load the archives if present.
-        // REMIND - this probably should be done in a separate thread,
-        // or at least the additional archives (epll).
-        String jarFiles = getJarFiles();
-
-        if (jarFiles != null) {
-            StringTokenizer st = new StringTokenizer(jarFiles, ",", false);
-            while(st.hasMoreTokens()) {
-                String tok = st.nextToken().trim();
-                try {
-                    loader.addJar(tok);
-                } catch (IllegalArgumentException e) {
-                    // bad archive name
-                    continue;
-                }
-            }
-        }
-    }
-
-    /**
-     * Request that the loading of the applet be stopped.
-     */
-    protected synchronized void stopLoading() {
-        // REMIND: fill in the body
-        if (loaderThread != null) {
-            //System.out.println("Interrupting applet loader thread: " + loaderThread);
-            loaderThread.interrupt();
-        } else {
-            setLoadAbortRequest();
-        }
-    }
-
-
-    protected synchronized boolean okToLoad() {
-        return !loadAbortRequest;
-    }
-
-    protected synchronized void clearLoadAbortRequest() {
-        loadAbortRequest = false;
-    }
-
-    protected synchronized void setLoadAbortRequest() {
-        loadAbortRequest = true;
-    }
-
-
-    private synchronized void setLoaderThread(Thread loaderThread) {
-        this.loaderThread = loaderThread;
-    }
-
-    /**
-     * Return true when the applet has been started.
-     */
-    @Override
-    public boolean isActive() {
-        return status == APPLET_START;
-    }
-
-
-    private EventQueue appEvtQ = null;
-    /**
-     * Is called when the applet wants to be resized.
-     */
-    @Override
-    public void appletResize(int width, int height) {
-        currentAppletSize.width = width;
-        currentAppletSize.height = height;
-        final Dimension currentSize = new Dimension(currentAppletSize.width,
-                                                    currentAppletSize.height);
-
-        if(loader != null) {
-            AppContext appCtxt = loader.getAppContext();
-            if(appCtxt != null)
-                appEvtQ = (java.awt.EventQueue)appCtxt.get(AppContext.EVENT_QUEUE_KEY);
-        }
-
-        final AppletPanel ap = this;
-        if (appEvtQ != null){
-            appEvtQ.postEvent(new InvocationEvent(Toolkit.getDefaultToolkit(),
-                                                  new Runnable() {
-                                                      @Override
-                                                      public void run() {
-                                                          if (ap != null) {
-                                                              ap.dispatchAppletEvent(
-                                                                      APPLET_RESIZE,
-                                                                      currentSize);
-                                                          }
-                                                      }
-                                                  }));
-        }
-    }
-
-    @Override
-    public void setBounds(int x, int y, int width, int height) {
-        super.setBounds(x, y, width, height);
-        currentAppletSize.width = width;
-        currentAppletSize.height = height;
-    }
-
-    public Applet getApplet() {
-        return applet;
-    }
-
-    /**
-     * Status line. Called by the AppletPanel to provide
-     * feedback on the Applet's state.
-     */
-    protected void showAppletStatus(String status) {
-        getAppletContext().showStatus(amh.getMessage(status));
-    }
-
-    protected void showAppletStatus(String status, Object arg) {
-        getAppletContext().showStatus(amh.getMessage(status, arg));
-    }
-    protected void showAppletStatus(String status, Object arg1, Object arg2) {
-        getAppletContext().showStatus(amh.getMessage(status, arg1, arg2));
-    }
-
-    /**
-     * Called by the AppletPanel to print to the log.
-     */
-    protected void showAppletLog(String msg) {
-        System.out.println(amh.getMessage(msg));
-    }
-
-    protected void showAppletLog(String msg, Object arg) {
-        System.out.println(amh.getMessage(msg, arg));
-    }
-
-    /**
-     * Called by the AppletPanel to provide
-     * feedback when an exception has happened.
-     */
-    protected void showAppletException(Throwable t) {
-        t.printStackTrace();
-        repaint();
-    }
-
-    /**
-     * Get caching key for classloader cache
-     */
-    public String getClassLoaderCacheKey()
-    {
-        /**
-         * Fixed #4501142: Classloader sharing policy doesn't
-         * take "archive" into account. This will be overridden
-         * by Java Plug-in.                     [stanleyh]
-         */
-        return getCodeBase().toString();
-    }
-
-    /**
-     * The class loaders
-     */
-    private static HashMap<String, AppletClassLoader> classloaders = new HashMap<>();
-
-    /**
-     * Flush a class loader.
-     */
-    public static synchronized void flushClassLoader(String key) {
-        classloaders.remove(key);
-    }
-
-    /**
-     * Flush all class loaders.
-     */
-    public static synchronized void flushClassLoaders() {
-        classloaders = new HashMap<>();
-    }
-
-    /**
-     * This method actually creates an AppletClassLoader.
-     *
-     * It can be override by subclasses (such as the Plug-in)
-     * to provide different classloaders.
-     */
-    protected AppletClassLoader createClassLoader(final URL codebase) {
-        return new AppletClassLoader(codebase);
-    }
-
-    /**
-     * Get a class loader. Create in a restricted context
-     */
-    synchronized AppletClassLoader getClassLoader(final URL codebase, final String key) {
-        AppletClassLoader c = classloaders.get(key);
-        if (c == null) {
-            AccessControlContext acc =
-                getAccessControlContext(codebase);
-            c = AccessController.doPrivileged(
-                    new PrivilegedAction<AppletClassLoader>() {
-                        @Override
-                        public AppletClassLoader run() {
-                            AppletClassLoader ac = createClassLoader(codebase);
-                            /* Should the creation of the classloader be
-                             * within the class synchronized block?  Since
-                             * this class is used by the plugin, take care
-                             * to avoid deadlocks, or specialize
-                             * AppletPanel within the plugin.  It may take
-                             * an arbitrary amount of time to create a
-                             * class loader (involving getting Jar files
-                             * etc.) and may block unrelated applets from
-                             * finishing createAppletThread (due to the
-                             * class synchronization). If
-                             * createAppletThread does not finish quickly,
-                             * the applet cannot process other messages,
-                             * particularly messages such as destroy
-                             * (which timeout when called from the browser).
-                             */
-                            synchronized (getClass()) {
-                                AppletClassLoader res = classloaders.get(key);
-                                if (res == null) {
-                                    classloaders.put(key, ac);
-                                    return ac;
-                                } else {
-                                    return res;
-                                }
-                            }
-                        }
-                    },acc);
-        }
-        return c;
-    }
-
-    /**
-     * get the context for the AppletClassLoader we are creating.
-     * the context is granted permission to create the class loader,
-     * connnect to the codebase, and whatever else the policy grants
-     * to all codebases.
-     */
-    private AccessControlContext getAccessControlContext(final URL codebase) {
-
-        PermissionCollection perms = AccessController.doPrivileged(
-                new PrivilegedAction<PermissionCollection>() {
-                    @Override
-                    public PermissionCollection run() {
-                        Policy p = java.security.Policy.getPolicy();
-                        if (p != null) {
-                            return p.getPermissions(new CodeSource(null,
-                                                                   (java.security.cert.Certificate[]) null));
-                        } else {
-                            return null;
-                        }
-                    }
-                });
-
-        if (perms == null)
-            perms = new Permissions();
-
-        //XXX: this is needed to be able to create the classloader itself!
-
-        perms.add(SecurityConstants.CREATE_CLASSLOADER_PERMISSION);
-
-        Permission p;
-        java.net.URLConnection urlConnection = null;
-        try {
-            urlConnection = codebase.openConnection();
-            p = urlConnection.getPermission();
-        } catch (java.io.IOException ioe) {
-            p = null;
-        }
-
-        if (p != null)
-            perms.add(p);
-
-        if (p instanceof FilePermission) {
-
-            String path = p.getName();
-
-            int endIndex = path.lastIndexOf(File.separatorChar);
-
-            if (endIndex != -1) {
-                path = path.substring(0, endIndex+1);
-
-                if (path.endsWith(File.separator)) {
-                    path += "-";
-                }
-                perms.add(new FilePermission(path,
-                                             SecurityConstants.FILE_READ_ACTION));
-            }
-        } else {
-            URL locUrl = codebase;
-            if (urlConnection instanceof JarURLConnection) {
-                locUrl = ((JarURLConnection)urlConnection).getJarFileURL();
-            }
-            String host = locUrl.getHost();
-            if (host != null && (host.length() > 0))
-                perms.add(new SocketPermission(host,
-                                               SecurityConstants.SOCKET_CONNECT_ACCEPT_ACTION));
-        }
-
-        ProtectionDomain domain =
-            new ProtectionDomain(new CodeSource(codebase,
-                                                (java.security.cert.Certificate[]) null), perms);
-        AccessControlContext acc =
-            new AccessControlContext(new ProtectionDomain[] { domain });
-
-        return acc;
-    }
-
-    public Thread getAppletHandlerThread() {
-        return handler;
-    }
-
-    public int getAppletWidth() {
-        return currentAppletSize.width;
-    }
-
-    public int getAppletHeight() {
-        return currentAppletSize.height;
-    }
-
-    public static void changeFrameAppContext(Frame frame, AppContext newAppContext)
-    {
-        // Fixed #4754451: Applet can have methods running on main
-        // thread event queue.
-        //
-        // The cause of this bug is that the frame of the applet
-        // is created in main thread group. Thus, when certain
-        // AWT/Swing events are generated, the events will be
-        // dispatched through the wrong event dispatch thread.
-        //
-        // To fix this, we rearrange the AppContext with the frame,
-        // so the proper event queue will be looked up.
-        //
-        // Swing also maintains a Frame list for the AppContext,
-        // so we will have to rearrange it as well.
-
-        // Check if frame's AppContext has already been set properly
-        AppContext oldAppContext = SunToolkit.targetToAppContext(frame);
-
-        if (oldAppContext == newAppContext)
-            return;
-
-        // Synchronization on Window.class is needed for locking the
-        // critical section of the window list in AppContext.
-        synchronized (Window.class)
-        {
-            WeakReference<Window> weakRef = null;
-            // Remove frame from the Window list in wrong AppContext
-            {
-                // Lookup current frame's AppContext
-                @SuppressWarnings("unchecked")
-                Vector<WeakReference<Window>> windowList =
-                    (Vector<WeakReference<Window>>)oldAppContext.get(Window.class);
-                if (windowList != null) {
-                    for (WeakReference<Window> ref : windowList) {
-                        if (ref.get() == frame) {
-                            weakRef = ref;
-                            break;
-                        }
-                    }
-                    // Remove frame from wrong AppContext
-                    if (weakRef != null)
-                        windowList.remove(weakRef);
-                }
-            }
-
-            // Put the frame into the applet's AppContext map
-            SunToolkit.insertTargetMapping(frame, newAppContext);
-
-            // Insert frame into the Window list in the applet's AppContext map
-            {
-                @SuppressWarnings("unchecked")
-                Vector<WeakReference<Window>> windowList =
-                    (Vector<WeakReference<Window>>)newAppContext.get(Window.class);
-                if (windowList == null) {
-                    windowList = new Vector<WeakReference<Window>>();
-                    newAppContext.put(Window.class, windowList);
-                }
-                // use the same weakRef here as it is used elsewhere
-                windowList.add(weakRef);
-            }
-        }
-    }
-
-    // Flag to indicate if applet is targeted for JDK 1.1.
-    private boolean jdk11Applet = false;
-
-    // Flag to indicate if applet is targeted for JDK 1.2.
-    private boolean jdk12Applet = false;
-
-    /**
-     * Determine JDK level of an applet.
-     */
-    private void findAppletJDKLevel(Applet applet)
-    {
-        // To determine the JDK level of an applet, the
-        // most reliable way is to check the major version
-        // of the applet class file.
-
-        // synchronized on applet class object, so calling from
-        // different instances of the same applet will be
-        // serialized.
-        Class<?> appletClass = applet.getClass();
-
-        synchronized(appletClass)  {
-            // Determine if the JDK level of an applet has been
-            // checked before.
-            Boolean jdk11Target = loader.isJDK11Target(appletClass);
-            Boolean jdk12Target = loader.isJDK12Target(appletClass);
-
-            // if applet JDK level has been checked before, retrieve
-            // value and return.
-            if (jdk11Target != null || jdk12Target != null) {
-                jdk11Applet = (jdk11Target == null) ? false : jdk11Target.booleanValue();
-                jdk12Applet = (jdk12Target == null) ? false : jdk12Target.booleanValue();
-                return;
-            }
-
-            String name = appletClass.getName();
-
-            // first convert any '.' to '/'
-            name = name.replace('.', '/');
-
-            // append .class
-            final String resourceName = name + ".class";
-
-            byte[] classHeader = new byte[8];
-
-            try (InputStream is = AccessController.doPrivileged(
-                    (PrivilegedAction<InputStream>) () -> loader.getResourceAsStream(resourceName))) {
-
-                // Read the first 8 bytes of the class file
-                int byteRead = is.read(classHeader, 0, 8);
-
-                // return if the header is not read in entirely
-                // for some reasons.
-                if (byteRead != 8)
-                    return;
-            }
-            catch (IOException e)   {
-                return;
-            }
-
-            // Check major version in class file header
-            int major_version = readShort(classHeader, 6);
-
-            // Major version in class file is as follows:
-            //   45 - JDK 1.1
-            //   46 - JDK 1.2
-            //   47 - JDK 1.3
-            //   48 - JDK 1.4
-            //   49 - JDK 1.5
-            if (major_version < 46)
-                jdk11Applet = true;
-            else if (major_version == 46)
-                jdk12Applet = true;
-
-            // Store applet JDK level in AppContext for later lookup,
-            // e.g. page switch.
-            loader.setJDK11Target(appletClass, jdk11Applet);
-            loader.setJDK12Target(appletClass, jdk12Applet);
-        }
-    }
-
-    /**
-     * Return true if applet is targeted to JDK 1.1.
-     */
-    protected boolean isJDK11Applet()   {
-        return jdk11Applet;
-    }
-
-    /**
-     * Return true if applet is targeted to JDK1.2.
-     */
-    protected boolean isJDK12Applet()   {
-        return jdk12Applet;
-    }
-
-    /**
-     * Read short from byte array.
-     */
-    private int readShort(byte[] b, int off)    {
-        int hi = readByte(b[off]);
-        int lo = readByte(b[off + 1]);
-        return (hi << 8) | lo;
-    }
-
-    private int readByte(byte b) {
-        return ((int)b) & 0xFF;
-    }
-
-
-    private static AppletMessageHandler amh = new AppletMessageHandler("appletpanel");
-}
--- a/src/java.desktop/share/classes/sun/applet/AppletProps.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,227 +0,0 @@
-/*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.applet;
-
-import java.awt.*;
-import java.io.*;
-import java.util.Properties;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedExceptionAction;
-import java.security.PrivilegedActionException;
-
-import sun.security.action.*;
-
-@SuppressWarnings("serial") // JDK implementation class
-@Deprecated(since = "9")
-class AppletProps extends Frame {
-
-    TextField proxyHost;
-    TextField proxyPort;
-    Choice accessMode;
-
-    @SuppressWarnings("deprecation")
-    AppletProps() {
-        setTitle(amh.getMessage("title"));
-        Panel p = new Panel();
-        p.setLayout(new GridLayout(0, 2));
-
-        p.add(new Label(amh.getMessage("label.http.server", "Http proxy server:")));
-        p.add(proxyHost = new TextField());
-
-        p.add(new Label(amh.getMessage("label.http.proxy")));
-        p.add(proxyPort = new TextField());
-
-        p.add(new Label(amh.getMessage("label.class")));
-        p.add(accessMode = new Choice());
-        accessMode.addItem(amh.getMessage("choice.class.item.restricted"));
-        accessMode.addItem(amh.getMessage("choice.class.item.unrestricted"));
-
-        add("Center", p);
-        p = new Panel();
-        p.add(new Button(amh.getMessage("button.apply")));
-        p.add(new Button(amh.getMessage("button.reset")));
-        p.add(new Button(amh.getMessage("button.cancel")));
-        add("South", p);
-        move(200, 150);
-        pack();
-        reset();
-    }
-
-    void reset() {
-        AppletSecurity security = (AppletSecurity) System.getSecurityManager();
-        if (security != null)
-            security.reset();
-
-        String proxyhost = AccessController.doPrivileged(
-                new GetPropertyAction("http.proxyHost"));
-        String proxyport = AccessController.doPrivileged(
-                new GetPropertyAction("http.proxyPort"));
-
-        Boolean tmp = AccessController.doPrivileged(
-                new GetBooleanAction("package.restrict.access.sun"));
-
-        boolean packageRestrict = tmp.booleanValue();
-        if (packageRestrict) {
-           accessMode.select(amh.getMessage("choice.class.item.restricted"));
-        } else {
-           accessMode.select(amh.getMessage("choice.class.item.unrestricted"));
-        }
-
-        if (proxyhost != null) {
-            proxyHost.setText(proxyhost);
-            proxyPort.setText(proxyport);
-        } else {
-            proxyHost.setText("");
-            proxyPort.setText("");
-        }
-    }
-
-    @SuppressWarnings("deprecation")
-    void apply() {
-        String proxyHostValue = proxyHost.getText().trim();
-        String proxyPortValue = proxyPort.getText().trim();
-
-        // Get properties
-        final Properties props = AccessController.doPrivileged(
-             new PrivilegedAction<Properties>() {
-                 public Properties run() {
-                     return System.getProperties();
-                 }
-        });
-
-        if (proxyHostValue.length() != 0) {
-            /* 4066402 */
-            /* Check for parsable value in proxy port number field before */
-            /* applying. Display warning to user until parsable value is  */
-            /* entered. */
-            int proxyPortNumber = 0;
-            try {
-                proxyPortNumber = Integer.parseInt(proxyPortValue);
-            } catch (NumberFormatException e) {}
-
-            if (proxyPortNumber <= 0) {
-                proxyPort.selectAll();
-                proxyPort.requestFocus();
-                (new AppletPropsErrorDialog(this,
-                                            amh.getMessage("title.invalidproxy"),
-                                            amh.getMessage("label.invalidproxy"),
-                                            amh.getMessage("button.ok"))).show();
-                return;
-            }
-            /* end 4066402 */
-
-            props.put("http.proxyHost", proxyHostValue);
-            props.put("http.proxyPort", proxyPortValue);
-        } else {
-            props.put("http.proxyHost", "");
-        }
-
-        if (amh.getMessage("choice.class.item.restricted").equals(accessMode.getSelectedItem())) {
-            props.put("package.restrict.access.sun", "true");
-        } else {
-            props.put("package.restrict.access.sun", "false");
-        }
-
-        // Save properties
-        try {
-            reset();
-            AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
-                public Object run() throws IOException {
-                    File dotAV = Main.theUserPropertiesFile;
-                    FileOutputStream out = new FileOutputStream(dotAV);
-                    Properties avProps = new Properties();
-                    for (int i = 0; i < Main.avDefaultUserProps.length; i++) {
-                        String avKey = Main.avDefaultUserProps[i][0];
-                        avProps.setProperty(avKey, props.getProperty(avKey));
-                    }
-                    avProps.store(out, amh.getMessage("prop.store"));
-                    out.close();
-                    return null;
-                }
-            });
-            hide();
-        } catch (java.security.PrivilegedActionException e) {
-            System.out.println(amh.getMessage("apply.exception",
-                                              e.getException()));
-            // XXX what's the general feeling on stack traces to System.out?
-            e.printStackTrace();
-            reset();
-        }
-    }
-
-    @SuppressWarnings("deprecation")
-    public boolean action(Event evt, Object obj) {
-        if (amh.getMessage("button.apply").equals(obj)) {
-            apply();
-            return true;
-        }
-        if (amh.getMessage("button.reset").equals(obj)) {
-            reset();
-            return true;
-        }
-        if (amh.getMessage("button.cancel").equals(obj)) {
-            reset();
-            hide();
-            return true;
-        }
-        return false;
-    }
-
-    private static AppletMessageHandler amh = new AppletMessageHandler("appletprops");
-
-}
-
-/* 4066432 */
-/* Dialog class to display property-related errors to user */
-@SuppressWarnings("serial") // JDK implementation class
-@Deprecated(since = "9")
-class AppletPropsErrorDialog extends Dialog {
-    @SuppressWarnings("deprecation")
-    public AppletPropsErrorDialog(Frame parent, String title, String message,
-                String buttonText) {
-        super(parent, title, true);
-        Panel p = new Panel();
-        add("Center", new Label(message));
-        p.add(new Button(buttonText));
-        add("South", p);
-        pack();
-
-        Dimension dDim = size();
-        Rectangle fRect = parent.bounds();
-        move(fRect.x + ((fRect.width - dDim.width) / 2),
-             fRect.y + ((fRect.height - dDim.height) / 2));
-    }
-
-    @SuppressWarnings("deprecation")
-    public boolean action(Event event, Object object) {
-        hide();
-        dispose();
-        return true;
-    }
-}
-
-/* end 4066432 */
--- a/src/java.desktop/share/classes/sun/applet/AppletResourceLoader.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.applet;
-
-import java.net.URL;
-import java.awt.Image;
-
-/**
- * Part of this class still remains only to support legacy, 100%-impure
- * applications such as HotJava 1.0.1.
- */
-@Deprecated
-public class AppletResourceLoader {
-    public static Image getImage(URL url) {
-        return AppletViewer.getCachedImage(url);
-    }
-
-    public static void flushImages() {
-        AppletViewer.flushImageCache();
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/AppletSecurityException.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.applet;
-
-/**
- * An applet security exception.
- *
- * @author      Arthur van Hoff
- */
-@SuppressWarnings("serial") // JDK-implementation class
-public
-class AppletSecurityException extends SecurityException {
-    private String key = null;
-    private Object msgobj[] = null;
-
-    public AppletSecurityException(String name) {
-        super(name);
-        this.key = name;
-    }
-
-    public AppletSecurityException(String name, String arg) {
-        this(name);
-        msgobj = new Object[1];
-        msgobj[0] = (Object)arg;
-    }
-
-    public AppletSecurityException(String name, String arg1, String arg2) {
-        this(name);
-        msgobj = new Object[2];
-        msgobj[0] = (Object)arg1;
-        msgobj[1] = (Object)arg2;
-    }
-
-    public String getLocalizedMessage() {
-        if( msgobj != null)
-            return amh.getMessage(key, msgobj);
-        else
-            return amh.getMessage(key);
-    }
-
-    private static AppletMessageHandler amh = new AppletMessageHandler("appletsecurityexception");
-
-}
--- a/src/java.desktop/share/classes/sun/applet/AppletViewer.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1312 +0,0 @@
-/*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.applet;
-
-import java.util.*;
-import java.io.*;
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.print.*;
-import javax.print.attribute.*;
-import java.applet.*;
-import java.net.URL;
-import java.net.SocketPermission;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import sun.awt.SunToolkit;
-import sun.awt.AppContext;
-
-/**
- * A frame to show the applet tag in.
- */
-@SuppressWarnings("serial") // JDK-implementation class
-@Deprecated(since = "9")
-final class TextFrame extends Frame {
-
-    /**
-     * Create the tag frame.
-     */
-    @SuppressWarnings("deprecation")
-    TextFrame(int x, int y, String title, String text) {
-        setTitle(title);
-        TextArea txt = new TextArea(20, 60);
-        txt.setText(text);
-        txt.setEditable(false);
-
-        add("Center", txt);
-
-        Panel p = new Panel();
-        add("South", p);
-        Button b = new Button(amh.getMessage("button.dismiss", "Dismiss"));
-        p.add(b);
-
-        class ActionEventListener implements ActionListener {
-            @Override
-            public void actionPerformed(ActionEvent evt) {
-                dispose();
-            }
-        }
-        b.addActionListener(new ActionEventListener());
-
-        pack();
-        move(x, y);
-        setVisible(true);
-
-        WindowListener windowEventListener = new WindowAdapter() {
-
-            @Override
-            public void windowClosing(WindowEvent evt) {
-                dispose();
-            }
-        };
-
-        addWindowListener(windowEventListener);
-    }
-    private static AppletMessageHandler amh = new AppletMessageHandler("textframe");
-
-}
-
-/**
- * Lets us construct one using unix-style one shot behaviors.
- */
-@Deprecated(since = "9")
-final class StdAppletViewerFactory implements AppletViewerFactory {
-
-    @Override
-    public AppletViewer createAppletViewer(int x, int y,
-                                           URL doc, Hashtable<String, String> atts) {
-        return new AppletViewer(x, y, doc, atts, System.out, this);
-    }
-
-    @Override
-    public MenuBar getBaseMenuBar() {
-        return new MenuBar();
-    }
-
-    @Override
-    public boolean isStandalone() {
-        return true;
-    }
-}
-
-/**
- * The applet viewer makes it possible to run a Java applet without using a browser.
- * For details on the syntax that <B>appletviewer</B> supports, see
- * <a href="../../../docs/tooldocs/appletviewertags.html">AppletViewer Tags</a>.
- * (The document named appletviewertags.html in the JDK's docs/tooldocs directory,
- *  once the JDK docs have been installed.)
- *
- * @deprecated The Applet API is deprecated. See the
- * <a href="../../java/applet/package-summary.html"> java.applet package
- * documentation</a> for further information.
- */
-@SuppressWarnings({"serial"}) // JDK-implementation class
-@Deprecated(since = "9")
-public class AppletViewer extends Frame implements AppletContext, Printable {
-
-    /**
-     * Some constants...
-     */
-    private static String defaultSaveFile = "Applet.ser";
-
-    /**
-     * The panel in which the applet is being displayed.
-     */
-    AppletViewerPanel panel;
-
-    /**
-     * The status line.
-     */
-    Label label;
-
-    /**
-     * output status messages to this stream
-     */
-
-    PrintStream statusMsgStream;
-
-    /**
-     * For cloning
-     */
-    AppletViewerFactory factory;
-
-    @Deprecated(since = "9")
-    private final class UserActionListener implements ActionListener {
-        @Override
-        public void actionPerformed(ActionEvent evt) {
-            processUserAction(evt);
-        }
-    }
-
-    /**
-     * Create the applet viewer.
-     */
-    public AppletViewer(int x, int y, URL doc, Hashtable<String, String> atts,
-                        PrintStream statusMsgStream, AppletViewerFactory factory) {
-        this.factory = factory;
-        this.statusMsgStream = statusMsgStream;
-        setTitle(amh.getMessage("tool.title", atts.get("code")));
-
-        MenuBar mb = factory.getBaseMenuBar();
-
-        Menu m = new Menu(amh.getMessage("menu.applet"));
-
-        addMenuItem(m, "menuitem.restart");
-        addMenuItem(m, "menuitem.reload");
-        addMenuItem(m, "menuitem.stop");
-        addMenuItem(m, "menuitem.save");
-        addMenuItem(m, "menuitem.start");
-        addMenuItem(m, "menuitem.clone");
-        m.add(new MenuItem("-"));
-        addMenuItem(m, "menuitem.tag");
-        addMenuItem(m, "menuitem.info");
-        addMenuItem(m, "menuitem.edit").disable();
-        addMenuItem(m, "menuitem.encoding");
-        m.add(new MenuItem("-"));
-        addMenuItem(m, "menuitem.print");
-        m.add(new MenuItem("-"));
-        addMenuItem(m, "menuitem.props");
-        m.add(new MenuItem("-"));
-        addMenuItem(m, "menuitem.close");
-        if (factory.isStandalone()) {
-            addMenuItem(m, "menuitem.quit");
-        }
-
-        mb.add(m);
-
-        setMenuBar(mb);
-
-        add("Center", panel = new AppletViewerPanel(doc, atts));
-        add("South", label = new Label(amh.getMessage("label.hello")));
-        panel.init();
-        appletPanels.addElement(panel);
-
-        pack();
-        move(x, y);
-        setVisible(true);
-
-        WindowListener windowEventListener = new WindowAdapter() {
-
-            @Override
-            public void windowClosing(WindowEvent evt) {
-                appletClose();
-            }
-
-            @Override
-            public void windowIconified(WindowEvent evt) {
-                appletStop();
-            }
-
-            @Override
-            public void windowDeiconified(WindowEvent evt) {
-                appletStart();
-            }
-        };
-
-        @Deprecated(since = "9")
-        class AppletEventListener implements AppletListener
-        {
-            final Frame frame;
-
-            public AppletEventListener(Frame frame)
-            {
-                this.frame = frame;
-            }
-
-            @Override
-            @SuppressWarnings("deprecation")
-            public void appletStateChanged(AppletEvent evt)
-            {
-                AppletPanel src = (AppletPanel)evt.getSource();
-
-                switch (evt.getID()) {
-                    case AppletPanel.APPLET_RESIZE: {
-                        if(src != null) {
-                            resize(preferredSize());
-                            validate();
-                        }
-                        break;
-                    }
-                    case AppletPanel.APPLET_LOADING_COMPLETED: {
-                        Applet a = src.getApplet(); // sun.applet.AppletPanel
-
-                        // Fixed #4754451: Applet can have methods running on main
-                        // thread event queue.
-                        //
-                        // The cause of this bug is that the frame of the applet
-                        // is created in main thread group. Thus, when certain
-                        // AWT/Swing events are generated, the events will be
-                        // dispatched through the wrong event dispatch thread.
-                        //
-                        // To fix this, we rearrange the AppContext with the frame,
-                        // so the proper event queue will be looked up.
-                        //
-                        // Swing also maintains a Frame list for the AppContext,
-                        // so we will have to rearrange it as well.
-                        //
-                        if (a != null)
-                            AppletPanel.changeFrameAppContext(frame, SunToolkit.targetToAppContext(a));
-                        else
-                            AppletPanel.changeFrameAppContext(frame, AppContext.getAppContext());
-
-                        break;
-                    }
-                }
-            }
-        };
-
-        addWindowListener(windowEventListener);
-        panel.addAppletListener(new AppletEventListener(this));
-
-        // Start the applet
-        showStatus(amh.getMessage("status.start"));
-        initEventQueue();
-    }
-
-    // XXX 99/9/10 probably should be "private"
-    public MenuItem addMenuItem(Menu m, String s) {
-        MenuItem mItem = new MenuItem(amh.getMessage(s));
-        mItem.addActionListener(new UserActionListener());
-        return m.add(mItem);
-    }
-
-    /**
-     * Send the initial set of events to the appletviewer event queue.
-     * On start-up the current behaviour is to load the applet and call
-     * Applet.init() and Applet.start().
-     */
-    private void initEventQueue() {
-        // appletviewer.send.event is an undocumented and unsupported system
-        // property which is used exclusively for testing purposes.
-        String eventList = System.getProperty("appletviewer.send.event");
-
-        if (eventList == null) {
-            // Add the standard events onto the event queue.
-            panel.sendEvent(AppletPanel.APPLET_LOAD);
-            panel.sendEvent(AppletPanel.APPLET_INIT);
-            panel.sendEvent(AppletPanel.APPLET_START);
-        } else {
-            // We're testing AppletViewer.  Force the specified set of events
-            // onto the event queue, wait for the events to be processed, and
-            // exit.
-
-            // The list of events that will be executed is provided as a
-            // ","-separated list.  No error-checking will be done on the list.
-            String [] events = splitSeparator(",", eventList);
-
-            for (int i = 0; i < events.length; i++) {
-                System.out.println("Adding event to queue: " + events[i]);
-                if (events[i].equals("dispose"))
-                    panel.sendEvent(AppletPanel.APPLET_DISPOSE);
-                else if (events[i].equals("load"))
-                    panel.sendEvent(AppletPanel.APPLET_LOAD);
-                else if (events[i].equals("init"))
-                    panel.sendEvent(AppletPanel.APPLET_INIT);
-                else if (events[i].equals("start"))
-                    panel.sendEvent(AppletPanel.APPLET_START);
-                else if (events[i].equals("stop"))
-                    panel.sendEvent(AppletPanel.APPLET_STOP);
-                else if (events[i].equals("destroy"))
-                    panel.sendEvent(AppletPanel.APPLET_DESTROY);
-                else if (events[i].equals("quit"))
-                    panel.sendEvent(AppletPanel.APPLET_QUIT);
-                else if (events[i].equals("error"))
-                    panel.sendEvent(AppletPanel.APPLET_ERROR);
-                else
-                    // non-fatal error if we get an unrecognized event
-                    System.out.println("Unrecognized event name: " + events[i]);
-            }
-
-            while (!panel.emptyEventQueue()) ;
-            appletSystemExit();
-        }
-    }
-
-    /**
-     * Split a string based on the presence of a specified separator.  Returns
-     * an array of arbitrary length.  The end of each element in the array is
-     * indicated by the separator of the end of the string.  If there is a
-     * separator immediately before the end of the string, the final element
-     * will be empty.  None of the strings will contain the separator.  Useful
-     * when separating strings such as "foo/bar/bas" using separator "/".
-     *
-     * @param sep  The separator.
-     * @param s    The string to split.
-     * @return     An array of strings.  Each string in the array is determined
-     *             by the location of the provided sep in the original string,
-     *             s.  Whitespace not stripped.
-     */
-    private String [] splitSeparator(String sep, String s) {
-        Vector<String> v = new Vector<>();
-        int tokenStart = 0;
-        int tokenEnd   = 0;
-
-        while ((tokenEnd = s.indexOf(sep, tokenStart)) != -1) {
-            v.addElement(s.substring(tokenStart, tokenEnd));
-            tokenStart = tokenEnd+1;
-        }
-        // Add the final element.
-        v.addElement(s.substring(tokenStart));
-
-        String [] retVal = new String[v.size()];
-        v.copyInto(retVal);
-        return retVal;
-    }
-
-    /*
-     * Methods for java.applet.AppletContext
-     */
-
-    private static Map<URL, AudioClip> audioClips = new HashMap<>();
-
-    /**
-     * Get an audio clip.
-     */
-    @Override
-    public AudioClip getAudioClip(URL url) {
-        checkConnect(url);
-        synchronized (audioClips) {
-            AudioClip clip = audioClips.get(url);
-            if (clip == null) {
-                audioClips.put(url, clip = new AppletAudioClip(url));
-            }
-            return clip;
-        }
-    }
-
-    private static Map<URL, AppletImageRef> imageRefs = new HashMap<>();
-
-    /**
-     * Get an image.
-     */
-    @Override
-    public Image getImage(URL url) {
-        return getCachedImage(url);
-    }
-
-    /**
-     * Get an image.
-     */
-    static Image getCachedImage(URL url) {
-        // System.getSecurityManager().checkConnection(url.getHost(), url.getPort());
-        synchronized (imageRefs) {
-            AppletImageRef ref = imageRefs.get(url);
-            if (ref == null) {
-                ref = new AppletImageRef(url);
-                imageRefs.put(url, ref);
-            }
-            return ref.get();
-        }
-    }
-
-    /**
-     * Flush the image cache.
-     */
-    static void flushImageCache() {
-        imageRefs.clear();
-    }
-
-    static Vector<AppletPanel> appletPanels = new Vector<>();
-
-    /**
-     * Get an applet by name.
-     */
-    @Override
-    public Applet getApplet(String name) {
-        AppletSecurity security = (AppletSecurity)System.getSecurityManager();
-        name = name.toLowerCase();
-        SocketPermission panelSp =
-            new SocketPermission(panel.getCodeBase().getHost(), "connect");
-        for (Enumeration<AppletPanel> e = appletPanels.elements() ; e.hasMoreElements() ;) {
-            AppletPanel p = e.nextElement();
-            String param = p.getParameter("name");
-            if (param != null) {
-                param = param.toLowerCase();
-            }
-            if (name.equals(param) &&
-                p.getDocumentBase().equals(panel.getDocumentBase())) {
-
-                SocketPermission sp =
-                    new SocketPermission(p.getCodeBase().getHost(), "connect");
-
-                if (panelSp.implies(sp)) {
-                    return p.applet;
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Return an enumeration of all the accessible
-     * applets on this page.
-     */
-    @Override
-    public Enumeration<Applet> getApplets() {
-        AppletSecurity security = (AppletSecurity)System.getSecurityManager();
-        Vector<Applet> v = new Vector<>();
-        SocketPermission panelSp =
-            new SocketPermission(panel.getCodeBase().getHost(), "connect");
-
-        for (Enumeration<AppletPanel> e = appletPanels.elements() ; e.hasMoreElements() ;) {
-            AppletPanel p = e.nextElement();
-            if (p.getDocumentBase().equals(panel.getDocumentBase())) {
-
-                SocketPermission sp =
-                    new SocketPermission(p.getCodeBase().getHost(), "connect");
-                if (panelSp.implies(sp)) {
-                    v.addElement(p.applet);
-                }
-            }
-        }
-        return v.elements();
-    }
-
-    /**
-     * Ignore.
-     */
-    @Override
-    public void showDocument(URL url) {
-    }
-
-    /**
-     * Ignore.
-     */
-    @Override
-    public void showDocument(URL url, String target) {
-    }
-
-    /**
-     * Show status.
-     */
-    @Override
-    public void showStatus(String status) {
-        label.setText(status);
-    }
-
-    @Override
-    public void setStream(String key, InputStream stream)throws IOException{
-        // We do nothing.
-    }
-
-    @Override
-    public InputStream getStream(String key){
-        // We do nothing.
-        return null;
-    }
-
-    @Override
-    public Iterator<String> getStreamKeys(){
-        // We do nothing.
-        return null;
-    }
-
-    /**
-     * System parameters.
-     */
-    static Hashtable<String, String> systemParam = new Hashtable<>();
-
-    static {
-        systemParam.put("codebase", "codebase");
-        systemParam.put("code", "code");
-        systemParam.put("alt", "alt");
-        systemParam.put("width", "width");
-        systemParam.put("height", "height");
-        systemParam.put("align", "align");
-        systemParam.put("vspace", "vspace");
-        systemParam.put("hspace", "hspace");
-    }
-
-    /**
-     * Print the HTML tag.
-     */
-    public static void printTag(PrintStream out, Hashtable<String, String> atts) {
-        out.print("<applet");
-
-        String v = atts.get("codebase");
-        if (v != null) {
-            out.print(" codebase=\"" + v + "\"");
-        }
-
-        v = atts.get("code");
-        if (v == null) {
-            v = "applet.class";
-        }
-        out.print(" code=\"" + v + "\"");
-        v = atts.get("width");
-        if (v == null) {
-            v = "150";
-        }
-        out.print(" width=" + v);
-
-        v = atts.get("height");
-        if (v == null) {
-            v = "100";
-        }
-        out.print(" height=" + v);
-
-        v = atts.get("name");
-        if (v != null) {
-            out.print(" name=\"" + v + "\"");
-        }
-        out.println(">");
-
-        // A very slow sorting algorithm
-        int len = atts.size();
-        String params[] = new String[len];
-        len = 0;
-        for (Enumeration<String> e = atts.keys() ; e.hasMoreElements() ;) {
-            String param = e.nextElement();
-            int i = 0;
-            for (; i < len ; i++) {
-                if (params[i].compareTo(param) >= 0) {
-                    break;
-                }
-            }
-            System.arraycopy(params, i, params, i + 1, len - i);
-            params[i] = param;
-            len++;
-        }
-
-        for (int i = 0 ; i < len ; i++) {
-            String param = params[i];
-            if (systemParam.get(param) == null) {
-                out.println("<param name=" + param +
-                            " value=\"" + atts.get(param) + "\">");
-            }
-        }
-        out.println("</applet>");
-    }
-
-    /**
-     * Make sure the atrributes are uptodate.
-     */
-    @SuppressWarnings("deprecation")
-    public void updateAtts() {
-        Dimension d = panel.size();
-        Insets in = panel.insets();
-        panel.atts.put("width",
-                       Integer.toString(d.width - (in.left + in.right)));
-        panel.atts.put("height",
-                       Integer.toString(d.height - (in.top + in.bottom)));
-    }
-
-    /**
-     * Restart the applet.
-     */
-    void appletRestart() {
-        panel.sendEvent(AppletPanel.APPLET_STOP);
-        panel.sendEvent(AppletPanel.APPLET_DESTROY);
-        panel.sendEvent(AppletPanel.APPLET_INIT);
-        panel.sendEvent(AppletPanel.APPLET_START);
-    }
-
-    /**
-     * Reload the applet.
-     */
-    void appletReload() {
-        panel.sendEvent(AppletPanel.APPLET_STOP);
-        panel.sendEvent(AppletPanel.APPLET_DESTROY);
-        panel.sendEvent(AppletPanel.APPLET_DISPOSE);
-
-        /**
-         * Fixed #4501142: Classloader sharing policy doesn't
-         * take "archive" into account. This will be overridden
-         * by Java Plug-in.                     [stanleyh]
-         */
-        AppletPanel.flushClassLoader(panel.getClassLoaderCacheKey());
-
-        /*
-         * Make sure we don't have two threads running through the event queue
-         * at the same time.
-         */
-        try {
-            panel.joinAppletThread();
-            panel.release();
-        } catch (InterruptedException e) {
-            return;   // abort the reload
-        }
-
-        panel.createAppletThread();
-        panel.sendEvent(AppletPanel.APPLET_LOAD);
-        panel.sendEvent(AppletPanel.APPLET_INIT);
-        panel.sendEvent(AppletPanel.APPLET_START);
-    }
-
-    /**
-     * Save the applet to a well known file (for now) as a serialized object
-     */
-    @SuppressWarnings("deprecation")
-    void appletSave() {
-        AccessController.doPrivileged(new PrivilegedAction<Object>() {
-
-            @Override
-            public Object run() {
-                // XXX: this privileged block should be made smaller
-                // by initializing a private static variable with "user.dir"
-
-                // Applet needs to be stopped for serialization to succeed.
-                // Since panel.sendEvent only queues the event, there is a
-                // chance that the event will not be processed before
-                // serialization begins.  However, by sending the event before
-                // FileDialog is created, enough time is given such that this
-                // situation is unlikely to ever occur.
-
-                panel.sendEvent(AppletPanel.APPLET_STOP);
-                FileDialog fd = new FileDialog(AppletViewer.this,
-                                               amh.getMessage("appletsave.filedialogtitle"),
-                                               FileDialog.SAVE);
-                // needed for a bug under Solaris...
-                fd.setDirectory(System.getProperty("user.dir"));
-                fd.setFile(defaultSaveFile);
-                fd.show();
-                String fname = fd.getFile();
-                if (fname == null) {
-                    // Restart applet if Save is cancelled.
-                    panel.sendEvent(AppletPanel.APPLET_START);
-                    return null;                // cancelled
-                }
-                String dname = fd.getDirectory();
-                File file = new File(dname, fname);
-
-                try (FileOutputStream fos = new FileOutputStream(file);
-                     BufferedOutputStream bos = new BufferedOutputStream(fos);
-                     ObjectOutputStream os = new ObjectOutputStream(bos)) {
-
-                    showStatus(amh.getMessage("appletsave.err1", panel.applet.toString(), file.toString()));
-                    os.writeObject(panel.applet);
-                } catch (IOException ex) {
-                    System.err.println(amh.getMessage("appletsave.err2", ex));
-                } finally {
-                    panel.sendEvent(AppletPanel.APPLET_START);
-                }
-                return null;
-            }
-        });
-    }
-
-    /**
-     * Clone the viewer and the applet.
-     */
-    @SuppressWarnings("deprecation")
-    void appletClone() {
-        Point p = location();
-        updateAtts();
-        @SuppressWarnings("unchecked")
-        Hashtable<String, String> tmp = (Hashtable<String, String>) panel.atts.clone();
-        factory.createAppletViewer(p.x + XDELTA, p.y + YDELTA,
-                                   panel.documentURL, tmp);
-    }
-
-    /**
-     * Show the applet tag.
-     */
-    @SuppressWarnings("deprecation")
-    void appletTag() {
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        updateAtts();
-        printTag(new PrintStream(out), panel.atts);
-        showStatus(amh.getMessage("applettag"));
-
-        Point p = location();
-        new TextFrame(p.x + XDELTA, p.y + YDELTA, amh.getMessage("applettag.textframe"), out.toString());
-    }
-
-    /**
-     * Show the applet info.
-     */
-    @SuppressWarnings("deprecation")
-    void appletInfo() {
-        String str = panel.applet.getAppletInfo();
-        if (str == null) {
-            str = amh.getMessage("appletinfo.applet");
-        }
-        str += "\n\n";
-
-        String atts[][] = panel.applet.getParameterInfo();
-        if (atts != null) {
-            for (int i = 0 ; i < atts.length ; i++) {
-                str += atts[i][0] + " -- " + atts[i][1] + " -- " + atts[i][2] + "\n";
-            }
-        } else {
-            str += amh.getMessage("appletinfo.param");
-        }
-
-        Point p = location();
-        new TextFrame(p.x + XDELTA, p.y + YDELTA, amh.getMessage("appletinfo.textframe"), str);
-
-    }
-
-    /**
-     * Show character encoding type
-     */
-    void appletCharacterEncoding() {
-        showStatus(amh.getMessage("appletencoding", encoding));
-    }
-
-    /**
-     * Edit the applet.
-     */
-    void appletEdit() {
-    }
-
-    /**
-     * Print the applet.
-     */
-    void appletPrint() {
-        PrinterJob pj = PrinterJob.getPrinterJob();
-
-        if (pj != null) {
-            PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
-            if (pj.printDialog(aset)) {
-                pj.setPrintable(this);
-                try {
-                    pj.print(aset);
-                    statusMsgStream.println(amh.getMessage("appletprint.finish"));
-                } catch (PrinterException e) {
-                   statusMsgStream.println(amh.getMessage("appletprint.fail"));
-                }
-            } else {
-                statusMsgStream.println(amh.getMessage("appletprint.cancel"));
-            }
-        } else {
-            statusMsgStream.println(amh.getMessage("appletprint.fail"));
-        }
-    }
-
-    @Override
-    public int print(Graphics graphics, PageFormat pf, int pageIndex) {
-        if (pageIndex > 0) {
-            return Printable.NO_SUCH_PAGE;
-        } else {
-            Graphics2D g2d = (Graphics2D)graphics;
-            g2d.translate(pf.getImageableX(), pf.getImageableY());
-            panel.applet.printAll(graphics);
-            return Printable.PAGE_EXISTS;
-        }
-    }
-
-    /**
-     * Properties.
-     */
-    static AppletProps props;
-    public static synchronized void networkProperties() {
-        if (props == null) {
-            props = new AppletProps();
-        }
-        props.addNotify();
-        props.setVisible(true);
-    }
-
-    /**
-     * Start the applet.
-     */
-    void appletStart() {
-        panel.sendEvent(AppletPanel.APPLET_START);
-    }
-
-    /**
-     * Stop the applet.
-     */
-    void appletStop() {
-        panel.sendEvent(AppletPanel.APPLET_STOP);
-    }
-
-    /**
-     * Shutdown a viewer.
-     * Stop, Destroy, Dispose and Quit a viewer
-     */
-    private void appletShutdown(AppletPanel p) {
-        p.sendEvent(AppletPanel.APPLET_STOP);
-        p.sendEvent(AppletPanel.APPLET_DESTROY);
-        p.sendEvent(AppletPanel.APPLET_DISPOSE);
-        p.sendEvent(AppletPanel.APPLET_QUIT);
-    }
-
-    /**
-     * Close this viewer.
-     * Stop, Destroy, Dispose and Quit an AppletView, then
-     * reclaim resources and exit the program if this is
-     * the last applet.
-     */
-    void appletClose() {
-
-        // The caller thread is event dispatch thread, so
-        // spawn a new thread to avoid blocking the event queue
-        // when calling appletShutdown.
-        //
-        final AppletPanel p = panel;
-
-        new Thread(null, new Runnable()
-        {
-            @Override
-            public void run()
-            {
-                appletShutdown(p);
-                appletPanels.removeElement(p);
-                dispose();
-
-                if (countApplets() == 0) {
-                    appletSystemExit();
-                }
-            }
-        },
-        "AppletCloser", 0, false).start();
-    }
-
-    /**
-     * Exit the program.
-     * Exit from the program (if not stand alone) - do no clean-up
-     */
-    private void appletSystemExit() {
-        if (factory.isStandalone())
-            System.exit(0);
-    }
-
-    /**
-     * Quit all viewers.
-     * Shutdown all viewers properly then
-     * exit from the program (if not stand alone)
-     */
-    protected void appletQuit()
-    {
-        // The caller thread is event dispatch thread, so
-        // spawn a new thread to avoid blocking the event queue
-        // when calling appletShutdown.
-        //
-        new Thread(null, new Runnable()
-        {
-            @Override
-            public void run()
-            {
-                for (Enumeration<AppletPanel> e = appletPanels.elements() ; e.hasMoreElements() ;) {
-                    AppletPanel p = e.nextElement();
-                    appletShutdown(p);
-                }
-                appletSystemExit();
-            }
-        },
-         "AppletQuit", 0, false).start();
-    }
-
-    /**
-     * Handle events.
-     */
-    public void processUserAction(ActionEvent evt) {
-
-        String label = ((MenuItem)evt.getSource()).getLabel();
-
-        if (amh.getMessage("menuitem.restart").equals(label)) {
-            appletRestart();
-            return;
-        }
-
-        if (amh.getMessage("menuitem.reload").equals(label)) {
-            appletReload();
-            return;
-        }
-
-        if (amh.getMessage("menuitem.clone").equals(label)) {
-            appletClone();
-            return;
-        }
-
-        if (amh.getMessage("menuitem.stop").equals(label)) {
-            appletStop();
-            return;
-        }
-
-        if (amh.getMessage("menuitem.save").equals(label)) {
-            appletSave();
-            return;
-        }
-
-        if (amh.getMessage("menuitem.start").equals(label)) {
-            appletStart();
-            return;
-        }
-
-        if (amh.getMessage("menuitem.tag").equals(label)) {
-            appletTag();
-            return;
-        }
-
-        if (amh.getMessage("menuitem.info").equals(label)) {
-            appletInfo();
-            return;
-        }
-
-        if (amh.getMessage("menuitem.encoding").equals(label)) {
-            appletCharacterEncoding();
-            return;
-        }
-
-        if (amh.getMessage("menuitem.edit").equals(label)) {
-            appletEdit();
-            return;
-        }
-
-        if (amh.getMessage("menuitem.print").equals(label)) {
-            appletPrint();
-            return;
-        }
-
-        if (amh.getMessage("menuitem.props").equals(label)) {
-            networkProperties();
-            return;
-        }
-
-        if (amh.getMessage("menuitem.close").equals(label)) {
-            appletClose();
-            return;
-        }
-
-        if (factory.isStandalone() && amh.getMessage("menuitem.quit").equals(label)) {
-            appletQuit();
-            return;
-        }
-        //statusMsgStream.println("evt = " + evt);
-    }
-
-    /**
-     * How many applets are running?
-     */
-
-    public static int countApplets() {
-        return appletPanels.size();
-    }
-
-
-    /**
-     * The current character.
-     */
-    static int c;
-
-    /**
-     * Scan spaces.
-     */
-    public static void skipSpace(Reader in) throws IOException {
-        while ((c >= 0) &&
-               ((c == ' ') || (c == '\t') || (c == '\n') || (c == '\r'))) {
-            c = in.read();
-        }
-    }
-
-    /**
-     * Scan identifier
-     */
-    public static String scanIdentifier(Reader in) throws IOException {
-        StringBuilder sb = new StringBuilder();
-        while (true) {
-            if (((c >= 'a') && (c <= 'z')) ||
-                ((c >= 'A') && (c <= 'Z')) ||
-                ((c >= '0') && (c <= '9')) || (c == '_')) {
-                sb.append((char) c);
-                c = in.read();
-            } else {
-                return sb.toString();
-            }
-        }
-    }
-
-    /**
-     * Scan tag
-     */
-    public static Hashtable<String, String> scanTag(Reader in) throws IOException {
-        Hashtable<String, String> atts = new Hashtable<>();
-        skipSpace(in);
-        while (c >= 0 && c != '>') {
-            String att = scanIdentifier(in);
-            String val = "";
-            skipSpace(in);
-            if (c == '=') {
-                int quote = -1;
-                c = in.read();
-                skipSpace(in);
-                if ((c == '\'') || (c == '\"')) {
-                    quote = c;
-                    c = in.read();
-                }
-                StringBuilder sb = new StringBuilder();
-                while ((c > 0) &&
-                       (((quote < 0) && (c != ' ') && (c != '\t') &&
-                         (c != '\n') && (c != '\r') && (c != '>'))
-                        || ((quote >= 0) && (c != quote)))) {
-                    sb.append((char) c);
-                    c = in.read();
-                }
-                if (c == quote) {
-                    c = in.read();
-                }
-                skipSpace(in);
-                val = sb.toString();
-            }
-            //statusMsgStream.println("PUT " + att + " = '" + val + "'");
-            if (! val.equals("")) {
-                atts.put(att.toLowerCase(java.util.Locale.ENGLISH), val);
-            }
-            while (true) {
-                if ((c == '>') || (c < 0) ||
-                    ((c >= 'a') && (c <= 'z')) ||
-                    ((c >= 'A') && (c <= 'Z')) ||
-                    ((c >= '0') && (c <= '9')) || (c == '_'))
-                    break;
-                c = in.read();
-            }
-            //skipSpace(in);
-        }
-        return atts;
-    }
-
-    /* values used for placement of AppletViewer's frames */
-    private static int x = 0;
-    private static int y = 0;
-    private static final int XDELTA = 30;
-    private static final int YDELTA = XDELTA;
-
-    static String encoding = null;
-
-    private static Reader makeReader(InputStream is) {
-        if (encoding != null) {
-            try {
-                return new BufferedReader(new InputStreamReader(is, encoding));
-            } catch (IOException x) { }
-        }
-        InputStreamReader r = new InputStreamReader(is);
-        encoding = r.getEncoding();
-        return new BufferedReader(r);
-    }
-
-    /**
-     * Scan an html file for {@code <applet>} tags
-     */
-    public static void parse(URL url, String enc) throws IOException {
-        encoding = enc;
-        parse(url, System.out, new StdAppletViewerFactory());
-    }
-
-    public static void parse(URL url) throws IOException {
-        parse(url, System.out, new StdAppletViewerFactory());
-    }
-
-    public static void parse(URL url, PrintStream statusMsgStream,
-                             AppletViewerFactory factory) throws IOException {
-        // <OBJECT> <EMBED> tag flags
-        boolean isAppletTag = false;
-        boolean isObjectTag = false;
-        boolean isEmbedTag = false;
-
-        // warning messages
-        String requiresNameWarning = amh.getMessage("parse.warning.requiresname");
-        String paramOutsideWarning = amh.getMessage("parse.warning.paramoutside");
-        String appletRequiresCodeWarning = amh.getMessage("parse.warning.applet.requirescode");
-        String appletRequiresHeightWarning = amh.getMessage("parse.warning.applet.requiresheight");
-        String appletRequiresWidthWarning = amh.getMessage("parse.warning.applet.requireswidth");
-        String objectRequiresCodeWarning = amh.getMessage("parse.warning.object.requirescode");
-        String objectRequiresHeightWarning = amh.getMessage("parse.warning.object.requiresheight");
-        String objectRequiresWidthWarning = amh.getMessage("parse.warning.object.requireswidth");
-        String embedRequiresCodeWarning = amh.getMessage("parse.warning.embed.requirescode");
-        String embedRequiresHeightWarning = amh.getMessage("parse.warning.embed.requiresheight");
-        String embedRequiresWidthWarning = amh.getMessage("parse.warning.embed.requireswidth");
-        String appNotLongerSupportedWarning = amh.getMessage("parse.warning.appnotLongersupported");
-
-        java.net.URLConnection conn = url.openConnection();
-        Reader in = makeReader(conn.getInputStream());
-        /* The original URL may have been redirected - this
-         * sets it to whatever URL/codebase we ended up getting
-         */
-        url = conn.getURL();
-
-        int ydisp = 1;
-        Hashtable<String, String> atts = null;
-
-        while(true) {
-            c = in.read();
-            if (c == -1)
-                break;
-
-            if (c == '<') {
-                c = in.read();
-                if (c == '/') {
-                    c = in.read();
-                    String nm = scanIdentifier(in);
-                    if (nm.equalsIgnoreCase("applet") ||
-                        nm.equalsIgnoreCase("object") ||
-                        nm.equalsIgnoreCase("embed")) {
-
-                        // We can't test for a code tag until </OBJECT>
-                        // because it is a parameter, not an attribute.
-                        if(isObjectTag) {
-                            if (atts.get("code") == null && atts.get("object") == null) {
-                                statusMsgStream.println(objectRequiresCodeWarning);
-                                atts = null;
-                            }
-                        }
-
-                        if (atts != null) {
-                            // XXX 5/18 In general this code just simply
-                            // shouldn't be part of parsing.  It's presence
-                            // causes things to be a little too much of a
-                            // hack.
-                            factory.createAppletViewer(x, y, url, atts);
-                            x += XDELTA;
-                            y += YDELTA;
-                            // make sure we don't go too far!
-                            Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
-                            if ((x > d.width - 300) || (y > d.height - 300)) {
-                                x = 0;
-                                y = 2 * ydisp * YDELTA;
-                                ydisp++;
-                            }
-                        }
-                        atts = null;
-                        isAppletTag = false;
-                        isObjectTag = false;
-                        isEmbedTag = false;
-                    }
-                }
-                else {
-                    String nm = scanIdentifier(in);
-                    if (nm.equalsIgnoreCase("param")) {
-                        Hashtable<String, String> t = scanTag(in);
-                        String att = t.get("name");
-                        if (att == null) {
-                            statusMsgStream.println(requiresNameWarning);
-                        } else {
-                            String val = t.get("value");
-                            if (val == null) {
-                                statusMsgStream.println(requiresNameWarning);
-                            } else if (atts != null) {
-                                atts.put(att.toLowerCase(), val);
-                            } else {
-                                statusMsgStream.println(paramOutsideWarning);
-                            }
-                        }
-                    }
-                    else if (nm.equalsIgnoreCase("applet")) {
-                        isAppletTag = true;
-                        atts = scanTag(in);
-                        if (atts.get("code") == null && atts.get("object") == null) {
-                            statusMsgStream.println(appletRequiresCodeWarning);
-                            atts = null;
-                        } else if (atts.get("width") == null) {
-                            statusMsgStream.println(appletRequiresWidthWarning);
-                            atts = null;
-                        } else if (atts.get("height") == null) {
-                            statusMsgStream.println(appletRequiresHeightWarning);
-                            atts = null;
-                        }
-                    }
-                    else if (nm.equalsIgnoreCase("object")) {
-                        isObjectTag = true;
-                        atts = scanTag(in);
-                        // The <OBJECT> attribute codebase isn't what
-                        // we want. If its defined, remove it.
-                        if(atts.get("codebase") != null) {
-                            atts.remove("codebase");
-                        }
-
-                        if (atts.get("width") == null) {
-                            statusMsgStream.println(objectRequiresWidthWarning);
-                            atts = null;
-                        } else if (atts.get("height") == null) {
-                            statusMsgStream.println(objectRequiresHeightWarning);
-                            atts = null;
-                        }
-                    }
-                    else if (nm.equalsIgnoreCase("embed")) {
-                        isEmbedTag = true;
-                        atts = scanTag(in);
-
-                        if (atts.get("code") == null && atts.get("object") == null) {
-                            statusMsgStream.println(embedRequiresCodeWarning);
-                            atts = null;
-                        } else if (atts.get("width") == null) {
-                            statusMsgStream.println(embedRequiresWidthWarning);
-                            atts = null;
-                        } else if (atts.get("height") == null) {
-                            statusMsgStream.println(embedRequiresHeightWarning);
-                            atts = null;
-                        }
-                    }
-                    else if (nm.equalsIgnoreCase("app")) {
-                        statusMsgStream.println(appNotLongerSupportedWarning);
-                        Hashtable<String, String> atts2 = scanTag(in);
-                        nm = atts2.get("class");
-                        if (nm != null) {
-                            atts2.remove("class");
-                            atts2.put("code", nm + ".class");
-                        }
-                        nm = atts2.get("src");
-                        if (nm != null) {
-                            atts2.remove("src");
-                            atts2.put("codebase", nm);
-                        }
-                        if (atts2.get("width") == null) {
-                            atts2.put("width", "100");
-                        }
-                        if (atts2.get("height") == null) {
-                            atts2.put("height", "100");
-                        }
-                        printTag(statusMsgStream, atts2);
-                        statusMsgStream.println();
-                    }
-                }
-            }
-        }
-        in.close();
-    }
-
-    /**
-     * Old main entry point.
-     *
-     * @deprecated
-     */
-    @Deprecated
-    public static void main(String argv[]) {
-        // re-route everything to the new main entry point
-        Main.main(argv);
-    }
-
-    private static AppletMessageHandler amh = new AppletMessageHandler("appletviewer");
-
-    private static void checkConnect(URL url)
-    {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            try {
-                java.security.Permission perm =
-                    url.openConnection().getPermission();
-                if (perm != null)
-                    security.checkPermission(perm);
-                else
-                    security.checkConnect(url.getHost(), url.getPort());
-            } catch (java.io.IOException ioe) {
-                    security.checkConnect(url.getHost(), url.getPort());
-            }
-        }
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/AppletViewerFactory.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 1996, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * AppletViewerFactory.java
- */
-
-package sun.applet;
-
-import java.util.Hashtable;
-import java.net.URL;
-import java.awt.MenuBar;
-
-@Deprecated(since = "9")
-public interface AppletViewerFactory {
-        public AppletViewer createAppletViewer(int x, int y, URL doc,
-                                               Hashtable<String, String> atts);
-        public MenuBar getBaseMenuBar();
-        public boolean isStandalone();
-}
--- a/src/java.desktop/share/classes/sun/applet/AppletViewerPanel.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,221 +0,0 @@
-/*
- * Copyright (c) 1995, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.applet;
-
-import java.util.*;
-import java.io.*;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.awt.*;
-import java.applet.*;
-
-
-/**
- * Sample applet panel class. The panel manages and manipulates the
- * applet as it is being loaded. It forks a seperate thread in a new
- * thread group to call the applet's init(), start(), stop(), and
- * destroy() methods.
- *
- * @author      Arthur van Hoff
- *
- * @deprecated The Applet API is deprecated. See the
- * <a href="../../java/applet/package-summary.html"> java.applet package
- * documentation</a> for further information.
- */
-@Deprecated(since = "9")
-class AppletViewerPanel extends AppletPanel {
-
-    /* Are we debugging? */
-    static boolean debug = false;
-
-    /**
-     * The document url.
-     */
-    URL documentURL;
-
-    /**
-     * The base url.
-     */
-    URL baseURL;
-
-    /**
-     * The attributes of the applet.
-     */
-    Hashtable<String, String> atts;
-
-    /*
-     * JDK 1.1 serialVersionUID
-     */
-    private static final long serialVersionUID = 8890989370785545619L;
-
-    /**
-     * Construct an applet viewer and start the applet.
-     */
-    AppletViewerPanel(URL documentURL, Hashtable<String, String> atts) {
-        this.documentURL = documentURL;
-        this.atts = atts;
-
-        String att = getParameter("codebase");
-        if (att != null) {
-            if (!att.endsWith("/")) {
-                att += "/";
-            }
-            try {
-                baseURL = new URL(documentURL, att);
-            } catch (MalformedURLException e) {
-            }
-        }
-        if (baseURL == null) {
-            String file = documentURL.getFile();
-            int i = file.lastIndexOf('/');
-            if (i >= 0 && i < file.length() - 1) {
-                try {
-                    baseURL = new URL(documentURL, file.substring(0, i + 1));
-                } catch (MalformedURLException e) {
-                }
-            }
-        }
-
-        // when all is said & done, baseURL shouldn't be null
-        if (baseURL == null)
-                baseURL = documentURL;
-
-
-    }
-
-    /**
-     * Get an applet parameter.
-     */
-    public String getParameter(String name) {
-        return atts.get(name.toLowerCase());
-    }
-
-    /**
-     * Get the document url.
-     */
-    public URL getDocumentBase() {
-        return documentURL;
-
-    }
-
-    /**
-     * Get the base url.
-     */
-    public URL getCodeBase() {
-        return baseURL;
-    }
-
-    /**
-     * Get the width.
-     */
-    public int getWidth() {
-        String w = getParameter("width");
-        if (w != null) {
-            return Integer.valueOf(w).intValue();
-        }
-        return 0;
-    }
-
-
-    /**
-     * Get the height.
-     */
-    public int getHeight() {
-        String h = getParameter("height");
-        if (h != null) {
-            return Integer.valueOf(h).intValue();
-        }
-        return 0;
-    }
-
-    /**
-     * Get initial_focus
-     */
-    public boolean hasInitialFocus()
-    {
-
-        // 6234219: Do not set initial focus on an applet
-        // during startup if applet is targeted for
-        // JDK 1.1/1.2. [stanley.ho]
-        if (isJDK11Applet() || isJDK12Applet())
-            return false;
-
-        String initialFocus = getParameter("initial_focus");
-
-        if (initialFocus != null)
-        {
-            if (initialFocus.toLowerCase().equals("false"))
-                return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * Get the code parameter
-     */
-    public String getCode() {
-        return getParameter("code");
-    }
-
-
-    /**
-     * Return the list of jar files if specified.
-     * Otherwise return null.
-     */
-    public String getJarFiles() {
-        return getParameter("archive");
-    }
-
-    /**
-     * Return the value of the object param
-     */
-    public String getSerializedObject() {
-        return getParameter("object");// another name?
-    }
-
-
-    /**
-     * Get the applet context. For now this is
-     * also implemented by the AppletPanel class.
-     */
-    @SuppressWarnings("deprecation")
-    public AppletContext getAppletContext() {
-        return (AppletContext)getParent();
-    }
-
-    static void debug(String s) {
-        if(debug)
-            System.err.println("AppletViewerPanel:::" + s);
-    }
-
-    static void debug(String s, Throwable t) {
-        if(debug) {
-            t.printStackTrace();
-            debug(s);
-        }
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/Main.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,460 +0,0 @@
-/*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.applet;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.util.Enumeration;
-import java.util.Properties;
-import java.util.Vector;
-import sun.net.www.ParseUtil;
-
-/**
- * The main entry point into AppletViewer.
- *
- * @deprecated The Applet API is deprecated. See the
- * <a href="../../java/applet/package-summary.html"> java.applet package
- * documentation</a> for further information.
- */
-@Deprecated(since = "9")
-public class Main {
-    /**
-     * The file which contains all of the AppletViewer specific properties.
-     */
-    static File theUserPropertiesFile;
-
-    /**
-     * The default key/value pairs for the required user-specific properties.
-     */
-    static final String [][] avDefaultUserProps = {
-        // There's a bootstrapping problem here.  If we don't have a proxyHost,
-        // then we will not be able to connect to a URL outside the firewall;
-        // however, there's no way for us to set the proxyHost without starting
-        // AppletViewer.  This problem existed before the re-write.
-        {"http.proxyHost", ""},
-        {"http.proxyPort", "80"},
-        {"package.restrict.access.sun", "true"}
-    };
-
-    static {
-        File userHome = new File(System.getProperty("user.home"));
-        // make sure we can write to this location
-        userHome.canWrite();
-
-        theUserPropertiesFile = new File(userHome, ".appletviewer");
-    }
-
-    // i18n
-    private static AppletMessageHandler amh = new AppletMessageHandler("appletviewer");
-
-    /**
-     * Member variables set according to options passed in to AppletViewer.
-     */
-    private boolean helpFlag  = false;
-    private String  encoding  = null;
-    private boolean noSecurityFlag  = false;
-    private static boolean cmdLineTestFlag = false;
-
-    /**
-     * The list of valid URLs passed in to AppletViewer.
-     */
-    private static Vector<URL> urlList = new Vector<>(1);
-
-    // This is used in init().  Getting rid of this is desirable but depends
-    // on whether the property that uses it is necessary/standard.
-    public static final String theVersion = System.getProperty("java.version");
-
-    /**
-     * The main entry point into AppletViewer.
-     */
-    public static void main(String [] args) {
-        Main m = new Main();
-        int ret = m.run(args);
-
-        // Exit immediately if we got some sort of error along the way.
-        // For debugging purposes, if we have passed in "-XcmdLineTest" we
-        // force a premature exit.
-        if ((ret != 0) || (cmdLineTestFlag))
-            System.exit(ret);
-    }
-
-    private int run(String [] args) {
-        // DECODE ARGS
-        try {
-            System.err.println(lookup("deprecated"));
-            System.err.flush();
-            if (args.length == 0) {
-                usage();
-                return 0;
-            }
-            for (int i = 0; i < args.length; ) {
-                int j = decodeArg(args, i);
-                if (j == 0) {
-                    throw new ParseException(lookup("main.err.unrecognizedarg",
-                                                    args[i]));
-                }
-                i += j;
-            }
-        } catch (ParseException e) {
-            System.err.println(e.getMessage());
-            return 1;
-        }
-
-        // CHECK ARGUMENTS
-        if (helpFlag) {
-            usage();
-            return 0;
-        }
-
-        if (urlList.size() == 0) {
-            System.err.println(lookup("main.err.inputfile"));
-            return 1;
-        }
-
-        // INSTALL THE SECURITY MANAGER (if necessary)
-        if (!noSecurityFlag && (System.getSecurityManager() == null))
-            init();
-
-        // LAUNCH APPLETVIEWER FOR EACH URL
-        for (int i = 0; i < urlList.size(); i++) {
-            try {
-                // XXX 5/17 this parsing method should be changed/fixed so that
-                // it doesn't do both parsing of the html file and launching of
-                // the AppletPanel
-                AppletViewer.parse(urlList.elementAt(i), encoding);
-            } catch (IOException e) {
-                System.err.println(lookup("main.err.io", e.getMessage()));
-                return 1;
-            }
-        }
-        return 0;
-    }
-
-    private static void usage() {
-        System.out.println(lookup("usage"));
-    }
-
-    /**
-     * Decode a single argument in an array and return the number of elements
-     * used.
-     *
-     * @param args The array of arguments.
-     * @param i    The argument to decode.
-     * @return     The number of array elements used when the argument was
-     *             decoded.
-     * @exception ParseException
-     *             Thrown when there is a problem with something in the
-     *             argument array.
-     */
-    private int decodeArg(String [] args, int i) throws ParseException {
-        String arg = args[i];
-        int argc = args.length;
-
-        if ("-help".equalsIgnoreCase(arg) || "-?".equals(arg)) {
-            helpFlag = true;
-            return 1;
-        } else if ("-encoding".equals(arg) && (i < argc - 1)) {
-            if (encoding != null)
-                throw new ParseException(lookup("main.err.dupoption", arg));
-            encoding = args[++i];
-            return 2;
-        } else if ("-Xnosecurity".equals(arg)) {
-            // This is an undocumented (and, in the future, unsupported)
-            // flag which prevents AppletViewer from installing its own
-            // SecurityManager.
-
-            System.err.println();
-            System.err.println(lookup("main.warn.nosecmgr"));
-            System.err.println();
-
-            noSecurityFlag = true;
-            return 1;
-        } else if ("-XcmdLineTest".equals(arg)) {
-            // This is an internal flag which should be used for command-line
-            // testing.  It instructs AppletViewer to force a premature exit
-            // immediately after the applet has been launched.
-            cmdLineTestFlag = true;
-            return 1;
-        } else if (arg.startsWith("-")) {
-            throw new ParseException(lookup("main.err.unsupportedopt", arg));
-        } else {
-            // we found what we hope is a url
-            URL url = parseURL(arg);
-            if (url != null) {
-                urlList.addElement(url);
-                return 1;
-            }
-        }
-        return 0;
-    }
-
-    /**
-     * Following the relevant RFC, construct a valid URL based on the passed in
-     * string.
-     *
-     * @param url  a string which represents either a relative or absolute URL.
-     * @return     a URL when the passed in string can be interpreted according
-     *             to the RFC, {@code null} otherwise.
-     * @exception  ParseException
-     *             Thrown when we are unable to construct a proper URL from the
-     *             passed in string.
-     */
-    private URL parseURL(String url) throws ParseException {
-        URL u = null;
-        // prefix of the urls with 'file' scheme
-        String prefix = "file:";
-
-        try {
-            if (url.indexOf(':') <= 1)
-            {
-                // appletviewer accepts only unencoded filesystem paths
-                u = ParseUtil.fileToEncodedURL(new File(url));
-            } else if (url.startsWith(prefix) &&
-                       url.length() != prefix.length() &&
-                       !(new File(url.substring(prefix.length())).isAbsolute()))
-            {
-                // relative file URL, like this "file:index.html"
-                // ensure that this file URL is absolute
-                // ParseUtil.fileToEncodedURL should be done last (see 6329251)
-                String path = ParseUtil.fileToEncodedURL(new File(System.getProperty("user.dir"))).getPath() +
-                    url.substring(prefix.length());
-                u = new URL("file", "", path);
-            } else {
-                // appletviewer accepts only encoded urls
-                u = new URL(url);
-            }
-        } catch (MalformedURLException e) {
-            throw new ParseException(lookup("main.err.badurl",
-                                            url, e.getMessage()));
-        }
-
-        return u;
-    }
-
-    private void init() {
-        // GET APPLETVIEWER USER-SPECIFIC PROPERTIES
-        Properties avProps = getAVProps();
-
-        // ADD OTHER RANDOM PROPERTIES
-        // XXX 5/18 need to revisit why these are here, is there some
-        // standard for what is available?
-
-        // Standard browser properties
-        avProps.put("browser", "sun.applet.AppletViewer");
-        avProps.put("browser.version", "1.06");
-        avProps.put("browser.vendor", "Oracle Corporation");
-        avProps.put("http.agent", "Java(tm) 2 SDK, Standard Edition v" + theVersion);
-
-        // Define which packages can be extended by applets
-        // XXX 5/19 probably not needed, not checked in AppletSecurity
-        avProps.put("package.restrict.definition.java", "true");
-        avProps.put("package.restrict.definition.sun", "true");
-
-        // Define which properties can be read by applets.
-        // A property named by "key" can be read only when its twin
-        // property "key.applet" is true.  The following ten properties
-        // are open by default.  Any other property can be explicitly
-        // opened up by the browser user by calling appletviewer with
-        // -J-Dkey.applet=true
-        avProps.put("java.version.applet", "true");
-        avProps.put("java.vendor.applet", "true");
-        avProps.put("java.vendor.url.applet", "true");
-        avProps.put("java.class.version.applet", "true");
-        avProps.put("os.name.applet", "true");
-        avProps.put("os.version.applet", "true");
-        avProps.put("os.arch.applet", "true");
-        avProps.put("file.separator.applet", "true");
-        avProps.put("path.separator.applet", "true");
-        avProps.put("line.separator.applet", "true");
-
-        // Read in the System properties.  If something is going to be
-        // over-written, warn about it.
-        Properties sysProps = System.getProperties();
-        for (Enumeration<?> e = sysProps.propertyNames(); e.hasMoreElements(); ) {
-            String key = (String) e.nextElement();
-            String val = sysProps.getProperty(key);
-            String oldVal;
-            if ((oldVal = (String) avProps.setProperty(key, val)) != null)
-                System.err.println(lookup("main.warn.prop.overwrite", key,
-                                          oldVal, val));
-        }
-
-        // INSTALL THE PROPERTY LIST
-        System.setProperties(avProps);
-
-        // Create and install the security manager
-        if (!noSecurityFlag) {
-            System.setSecurityManager(new AppletSecurity());
-        } else {
-            System.err.println(lookup("main.nosecmgr"));
-        }
-
-        // REMIND: Create and install a socket factory!
-    }
-
-    /**
-     * Read the AppletViewer user-specific properties.  Typically, these
-     * properties should reside in the file $USER/.appletviewer.  If this file
-     * does not exist, one will be created.  Information for this file will
-     * be gleaned from $USER/.hotjava/properties.  If that file does not exist,
-     * then default values will be used.
-     *
-     * @return     A Properties object containing all of the AppletViewer
-     *             user-specific properties.
-     */
-    private Properties getAVProps() {
-        Properties avProps = new Properties();
-
-        File dotAV = theUserPropertiesFile;
-        if (dotAV.exists()) {
-            // we must have already done the conversion
-            if (dotAV.canRead()) {
-                // just read the file
-                avProps = getAVProps(dotAV);
-            } else {
-                // send out warning and use defaults
-                System.err.println(lookup("main.warn.cantreadprops",
-                                          dotAV.toString()));
-                avProps = setDefaultAVProps();
-            }
-        } else {
-            // create the $USER/.appletviewer file
-
-            // see if $USER/.hotjava/properties exists
-            File userHome = new File(System.getProperty("user.home"));
-            File dotHJ = new File(userHome, ".hotjava");
-            dotHJ = new File(dotHJ, "properties");
-            if (dotHJ.exists()) {
-                // just read the file
-                avProps = getAVProps(dotHJ);
-            } else {
-                // send out warning and use defaults
-                System.err.println(lookup("main.warn.cantreadprops",
-                                          dotHJ.toString()));
-                avProps = setDefaultAVProps();
-            }
-
-            // SAVE THE FILE
-            try (FileOutputStream out = new FileOutputStream(dotAV)) {
-                avProps.store(out, lookup("main.prop.store"));
-            } catch (IOException e) {
-                System.err.println(lookup("main.err.prop.cantsave",
-                                          dotAV.toString()));
-            }
-        }
-        return avProps;
-    }
-
-    /**
-     * Set the AppletViewer user-specific properties to be the default values.
-     *
-     * @return     A Properties object containing all of the AppletViewer
-     *             user-specific properties, set to the default values.
-     */
-    private Properties setDefaultAVProps() {
-        Properties avProps = new Properties();
-        for (int i = 0; i < avDefaultUserProps.length; i++) {
-            avProps.setProperty(avDefaultUserProps[i][0],
-                                avDefaultUserProps[i][1]);
-        }
-        return avProps;
-    }
-
-    /**
-     * Given a file, find only the properties that are setable by AppletViewer.
-     *
-     * @param inFile A Properties file from which we select the properties of
-     *             interest.
-     * @return     A Properties object containing all of the AppletViewer
-     *             user-specific properties.
-     */
-    private Properties getAVProps(File inFile) {
-        Properties avProps  = new Properties();
-
-        // read the file
-        Properties tmpProps = new Properties();
-        try (FileInputStream in = new FileInputStream(inFile)) {
-            tmpProps.load(new BufferedInputStream(in));
-        } catch (IOException e) {
-            System.err.println(lookup("main.err.prop.cantread", inFile.toString()));
-        }
-
-        // pick off the properties we care about
-        for (int i = 0; i < avDefaultUserProps.length; i++) {
-            String value = tmpProps.getProperty(avDefaultUserProps[i][0]);
-            if (value != null) {
-                // the property exists in the file, so replace the default
-                avProps.setProperty(avDefaultUserProps[i][0], value);
-            } else {
-                // just use the default
-                avProps.setProperty(avDefaultUserProps[i][0],
-                                    avDefaultUserProps[i][1]);
-            }
-        }
-        return avProps;
-    }
-
-    /**
-     * Methods for easier i18n handling.
-     */
-
-    private static String lookup(String key) {
-        return amh.getMessage(key);
-    }
-
-    private static String lookup(String key, String arg0) {
-        return amh.getMessage(key, arg0);
-    }
-
-    private static String lookup(String key, String arg0, String arg1) {
-        return amh.getMessage(key, arg0, arg1);
-    }
-
-    private static String lookup(String key, String arg0, String arg1,
-                                 String arg2) {
-        return amh.getMessage(key, arg0, arg1, arg2);
-    }
-
-    @SuppressWarnings("serial") // JDK implementation class
-    class ParseException extends RuntimeException
-    {
-        public ParseException(String msg) {
-            super(msg);
-        }
-
-        public ParseException(Throwable t) {
-            super(t.getMessage());
-            this.t = t;
-        }
-
-        Throwable t = null;
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.applet.resources;
-
-import java.util.ListResourceBundle;
-
-public class MsgAppletViewer extends ListResourceBundle {
-
-    public Object[][] getContents() {
-        Object[][] temp = new Object[][] {
-            {"textframe.button.dismiss", "Dismiss"},
-            {"appletviewer.tool.title", "Applet Viewer: {0}"},
-            {"appletviewer.menu.applet", "Applet"},
-            {"appletviewer.menuitem.restart", "Restart"},
-            {"appletviewer.menuitem.reload", "Reload"},
-            {"appletviewer.menuitem.stop", "Stop"},
-            {"appletviewer.menuitem.save", "Save..."},
-            {"appletviewer.menuitem.start", "Start"},
-            {"appletviewer.menuitem.clone", "Clone..."},
-            {"appletviewer.menuitem.tag", "Tag..."},
-            {"appletviewer.menuitem.info", "Info..."},
-            {"appletviewer.menuitem.edit", "Edit"},
-            {"appletviewer.menuitem.encoding", "Character Encoding"},
-            {"appletviewer.menuitem.print", "Print..."},
-            {"appletviewer.menuitem.props", "Properties..."},
-            {"appletviewer.menuitem.close", "Close"},
-            {"appletviewer.menuitem.quit", "Quit"},
-            {"appletviewer.label.hello", "Hello..."},
-            {"appletviewer.status.start", "starting applet..."},
-            {"appletviewer.appletsave.filedialogtitle","Serialize Applet into File"},
-            {"appletviewer.appletsave.err1", "serializing an {0} to {1}"},
-            {"appletviewer.appletsave.err2", "in appletSave: {0}"},
-            {"appletviewer.applettag", "Tag shown"},
-            {"appletviewer.applettag.textframe", "Applet HTML Tag"},
-            {"appletviewer.appletinfo.applet", "-- no applet info --"},
-            {"appletviewer.appletinfo.param", "-- no parameter info --"},
-            {"appletviewer.appletinfo.textframe", "Applet Info"},
-            {"appletviewer.appletprint.fail", "Printing failed."},
-            {"appletviewer.appletprint.finish", "Finished printing."},
-            {"appletviewer.appletprint.cancel", "Printing cancelled."},
-            {"appletviewer.appletencoding", "Character Encoding: {0}"},
-            {"appletviewer.parse.warning.requiresname", "Warning: <param name=... value=...> tag requires name attribute."},
-            {"appletviewer.parse.warning.paramoutside", "Warning: <param> tag outside <applet> ... </applet>."},
-            {"appletviewer.parse.warning.applet.requirescode", "Warning: <applet> tag requires code attribute."},
-            {"appletviewer.parse.warning.applet.requiresheight", "Warning: <applet> tag requires height attribute."},
-            {"appletviewer.parse.warning.applet.requireswidth", "Warning: <applet> tag requires width attribute."},
-            {"appletviewer.parse.warning.object.requirescode", "Warning: <object> tag requires code attribute."},
-            {"appletviewer.parse.warning.object.requiresheight", "Warning: <object> tag requires height attribute."},
-            {"appletviewer.parse.warning.object.requireswidth", "Warning: <object> tag requires width attribute."},
-            {"appletviewer.parse.warning.embed.requirescode", "Warning: <embed> tag requires code attribute."},
-            {"appletviewer.parse.warning.embed.requiresheight", "Warning: <embed> tag requires height attribute."},
-            {"appletviewer.parse.warning.embed.requireswidth", "Warning: <embed> tag requires width attribute."},
-            {"appletviewer.parse.warning.appnotLongersupported", "Warning: <app> tag no longer supported, use <applet> instead:"},
-            {"appletviewer.deprecated", "Warning: Applet API and AppletViewer are deprecated."},
-            {"appletviewer.usage", "Usage: appletviewer <options> url(s)\n\nwhere <options> include:\n  -encoding <encoding>    Specify character encoding used by HTML files\n  -J<runtime flag>        Pass argument to the java interpreter\n\nThe -J option is non-standard and subject to change without notice."},
-            {"appletviewer.main.err.unsupportedopt", "Unsupported option: {0}"},
-            {"appletviewer.main.err.unrecognizedarg", "Unrecognized argument: {0}"},
-            {"appletviewer.main.err.dupoption", "Duplicate use of option: {0}"},
-            {"appletviewer.main.err.inputfile", "No input files specified."},
-            {"appletviewer.main.err.badurl", "Bad URL: {0} ( {1} )"},
-            {"appletviewer.main.err.io", "I/O exception while reading: {0}"},
-            {"appletviewer.main.err.readablefile", "Make sure that {0} is a file and is readable."},
-            {"appletviewer.main.err.correcturl", "Is {0} the correct URL?"},
-            {"appletviewer.main.prop.store", "User-specific properties for AppletViewer"},
-            {"appletviewer.main.err.prop.cantread", "Can''t read user properties file: {0}"},
-            {"appletviewer.main.err.prop.cantsave", "Can''t save user properties file: {0}"},
-            {"appletviewer.main.warn.nosecmgr", "Warning: disabling security."},
-            {"appletviewer.main.debug.cantfinddebug", "Can''t find the debugger!"},
-            {"appletviewer.main.debug.cantfindmain", "Can''t find main method in the debugger!"},
-            {"appletviewer.main.debug.exceptionindebug", "Exception in the debugger!"},
-            {"appletviewer.main.debug.cantaccess", "Can''t access the debugger!"},
-            {"appletviewer.main.nosecmgr", "Warning: SecurityManager not installed!"},
-            {"appletviewer.main.warning", "Warning: No applets were started. Make sure the input contains an <applet> tag."},
-            {"appletviewer.main.warn.prop.overwrite", "Warning: Temporarily overwriting system property at user''s request: key: {0} old value: {1} new value: {2}"},
-            {"appletviewer.main.warn.cantreadprops", "Warning: Can''t read AppletViewer properties file: {0} Using defaults."},
-            {"appletioexception.loadclass.throw.interrupted", "class loading interrupted: {0}"},
-            {"appletioexception.loadclass.throw.notloaded", "class not loaded: {0}"},
-            {"appletclassloader.loadcode.verbose", "Opening stream to: {0} to get {1}"},
-            {"appletclassloader.filenotfound", "File not found when looking for: {0}"},
-            {"appletclassloader.fileformat", "File format exception when loading: {0}"},
-            {"appletclassloader.fileioexception", "I/O exception when loading: {0}"},
-            {"appletclassloader.fileexception", "{0} exception when loading: {1}"},
-            {"appletclassloader.filedeath", "{0} killed when loading: {1}"},
-            {"appletclassloader.fileerror", "{0} error when loading: {1}"},
-            {"appletclassloader.findclass.verbose.openstream", "Opening stream to: {0} to get {1}"},
-            {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource for name: {0}"},
-            {"appletclassloader.getresource.verbose.found", "Found resource: {0} as a system resource"},
-            {"appletclassloader.getresourceasstream.verbose", "Found resource: {0} as a system resource"},
-            {"appletpanel.runloader.err", "Either object or code parameter!"},
-            {"appletpanel.runloader.exception", "exception while deserializing {0}"},
-            {"appletpanel.destroyed", "Applet destroyed."},
-            {"appletpanel.loaded", "Applet loaded."},
-            {"appletpanel.started", "Applet started."},
-            {"appletpanel.inited", "Applet initialized."},
-            {"appletpanel.stopped", "Applet stopped."},
-            {"appletpanel.disposed", "Applet disposed."},
-            {"appletpanel.nocode", "APPLET tag missing CODE parameter."},
-            {"appletpanel.notfound", "load: class {0} not found."},
-            {"appletpanel.nocreate", "load: {0} can''t be instantiated."},
-            {"appletpanel.noconstruct", "load: {0} is not public or has no public constructor."},
-            {"appletpanel.death", "killed"},
-            {"appletpanel.exception", "exception: {0}."},
-            {"appletpanel.exception2", "exception: {0}: {1}."},
-            {"appletpanel.error", "error: {0}."},
-            {"appletpanel.error2", "error: {0}: {1}."},
-            {"appletpanel.notloaded", "Init: applet not loaded."},
-            {"appletpanel.notinited", "Start: applet not initialized."},
-            {"appletpanel.notstarted", "Stop: applet not started."},
-            {"appletpanel.notstopped", "Destroy: applet not stopped."},
-            {"appletpanel.notdestroyed", "Dispose: applet not destroyed."},
-            {"appletpanel.notdisposed", "Load: applet not disposed."},
-            {"appletpanel.bail", "Interrupted: bailing out."},
-            {"appletpanel.filenotfound", "File not found when looking for: {0}"},
-            {"appletpanel.fileformat", "File format exception when loading: {0}"},
-            {"appletpanel.fileioexception", "I/O exception when loading: {0}"},
-            {"appletpanel.fileexception", "{0} exception when loading: {1}"},
-            {"appletpanel.filedeath", "{0} killed when loading: {1}"},
-            {"appletpanel.fileerror", "{0} error when loading: {1}"},
-            {"appletpanel.badattribute.exception", "HTML parsing: incorrect value for width/height attribute"},
-            {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream requires non-null loader"},
-            {"appletprops.title", "AppletViewer Properties"},
-            {"appletprops.label.http.server", "Http proxy server:"},
-            {"appletprops.label.http.proxy", "Http proxy port:"},
-            {"appletprops.label.network", "Network access:"},
-            {"appletprops.choice.network.item.none", "None"},
-            {"appletprops.choice.network.item.applethost", "Applet Host"},
-            {"appletprops.choice.network.item.unrestricted", "Unrestricted"},
-            {"appletprops.label.class", "Class access:"},
-            {"appletprops.choice.class.item.restricted", "Restricted"},
-            {"appletprops.choice.class.item.unrestricted", "Unrestricted"},
-            {"appletprops.label.unsignedapplet", "Allow unsigned applets:"},
-            {"appletprops.choice.unsignedapplet.no", "No"},
-            {"appletprops.choice.unsignedapplet.yes", "Yes"},
-            {"appletprops.button.apply", "Apply"},
-            {"appletprops.button.cancel", "Cancel"},
-            {"appletprops.button.reset", "Reset"},
-            {"appletprops.apply.exception", "Failed to save properties: {0}"},
-            /* 4066432 */
-            {"appletprops.title.invalidproxy", "Invalid Entry"},
-            {"appletprops.label.invalidproxy", "Proxy Port must be a positive integer value."},
-            {"appletprops.button.ok", "OK"},
-            /* end 4066432 */
-            {"appletprops.prop.store", "User-specific properties for AppletViewer"},
-            {"appletsecurityexception.checkcreateclassloader", "Security Exception: classloader"},
-            {"appletsecurityexception.checkaccess.thread", "Security Exception: thread"},
-            {"appletsecurityexception.checkaccess.threadgroup", "Security Exception: threadgroup: {0}"},
-            {"appletsecurityexception.checkexit", "Security Exception: exit: {0}"},
-            {"appletsecurityexception.checkexec", "Security Exception: exec: {0}"},
-            {"appletsecurityexception.checklink", "Security Exception: link: {0}"},
-            {"appletsecurityexception.checkpropsaccess", "Security Exception: properties"},
-            {"appletsecurityexception.checkpropsaccess.key", "Security Exception: properties access {0}"},
-            {"appletsecurityexception.checkread.exception1", "Security Exception: {0}, {1}"},
-            {"appletsecurityexception.checkread.exception2", "Security Exception: file.read: {0}"},
-            {"appletsecurityexception.checkread", "Security Exception: file.read: {0} == {1}"},
-            {"appletsecurityexception.checkwrite.exception", "Security Exception: {0}, {1}"},
-            {"appletsecurityexception.checkwrite", "Security Exception: file.write: {0} == {1}"},
-            {"appletsecurityexception.checkread.fd", "Security Exception: fd.read"},
-            {"appletsecurityexception.checkwrite.fd", "Security Exception: fd.write"},
-            {"appletsecurityexception.checklisten", "Security Exception: socket.listen: {0}"},
-            {"appletsecurityexception.checkaccept", "Security Exception: socket.accept: {0}:{1}"},
-            {"appletsecurityexception.checkconnect.networknone", "Security Exception: socket.connect: {0}->{1}"},
-            {"appletsecurityexception.checkconnect.networkhost1", "Security Exception: Couldn''t connect to {0} with origin from {1}."},
-            {"appletsecurityexception.checkconnect.networkhost2", "Security Exception: Couldn''t resolve IP for host {0} or for {1}. "},
-            {"appletsecurityexception.checkconnect.networkhost3", "Security Exception: Could not resolve IP for host {0}. See the trustProxy property."},
-            {"appletsecurityexception.checkconnect", "Security Exception: connect: {0}->{1}"},
-            {"appletsecurityexception.checkpackageaccess", "Security Exception: cannot access package: {0}"},
-            {"appletsecurityexception.checkpackagedefinition", "Security Exception: cannot define package: {0}"},
-            {"appletsecurityexception.cannotsetfactory", "Security Exception: cannot set factory"},
-            {"appletsecurityexception.checkgetprintjob", "Security Exception: getPrintJob"},
-            {"appletsecurityexception.checksecurityaccess", "Security Exception: security operation: {0}"},
-            {"appletsecurityexception.getsecuritycontext.unknown", "unknown class loader type. unable to check for getContext"},
-            {"appletsecurityexception.checkread.unknown", "unknown class loader type. unable to check for checking read {0}"},
-            {"appletsecurityexception.checkconnect.unknown", "unknown class loader type. unable to check for checking connect"},
-        };
-
-        return temp;
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_de.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.applet.resources;
-
-import java.util.ListResourceBundle;
-
-public class MsgAppletViewer_de extends ListResourceBundle {
-
-    public Object[][] getContents() {
-        Object[][] temp = new Object[][] {
-            {"textframe.button.dismiss", "Verwerfen"},
-            {"appletviewer.tool.title", "Applet Viewer: {0}"},
-            {"appletviewer.menu.applet", "Applet"},
-            {"appletviewer.menuitem.restart", "Neu starten"},
-            {"appletviewer.menuitem.reload", "Neu laden"},
-            {"appletviewer.menuitem.stop", "Stoppen"},
-            {"appletviewer.menuitem.save", "Speichern..."},
-            {"appletviewer.menuitem.start", "Starten..."},
-            {"appletviewer.menuitem.clone", "Klonen..."},
-            {"appletviewer.menuitem.tag", "Tag..."},
-            {"appletviewer.menuitem.info", "Informationen..."},
-            {"appletviewer.menuitem.edit", "Bearbeiten"},
-            {"appletviewer.menuitem.encoding", "Zeichencodierung"},
-            {"appletviewer.menuitem.print", "Drucken..."},
-            {"appletviewer.menuitem.props", "Eigenschaften..."},
-            {"appletviewer.menuitem.close", "Schlie\u00DFen"},
-            {"appletviewer.menuitem.quit", "Beenden"},
-            {"appletviewer.label.hello", "Hallo..."},
-            {"appletviewer.status.start", "Applet wird gestartet..."},
-            {"appletviewer.appletsave.filedialogtitle","Applet in Datei serialisieren"},
-            {"appletviewer.appletsave.err1", "{0} in {1} serialisieren"},
-            {"appletviewer.appletsave.err2", "in appletSave: {0}"},
-            {"appletviewer.applettag", "Angezeigtes Tag"},
-            {"appletviewer.applettag.textframe", "Applet-HTML-Tag"},
-            {"appletviewer.appletinfo.applet", "-- keine Applet-Informationen --"},
-            {"appletviewer.appletinfo.param", "-- keine Parameterinformationen --"},
-            {"appletviewer.appletinfo.textframe", "Applet-Informationen"},
-            {"appletviewer.appletprint.fail", "Druck nicht erfolgreich."},
-            {"appletviewer.appletprint.finish", "Druck abgeschlossen."},
-            {"appletviewer.appletprint.cancel", "Druck abgebrochen."},
-            {"appletviewer.appletencoding", "Zeichencodierung: {0}"},
-            {"appletviewer.parse.warning.requiresname", "Warnung: F\u00FCr <param name=... value=...>-Tag ist ein \"name\"-Attribut erforderlich."},
-            {"appletviewer.parse.warning.paramoutside", "Warnung: <param>-Tag au\u00DFerhalb von <applet> ... </applet>."},
-            {"appletviewer.parse.warning.applet.requirescode", "Warnung: F\u00FCr <applet>-Tag ist ein \"code\"-Attribut erforderlich."},
-            {"appletviewer.parse.warning.applet.requiresheight", "Warnung: F\u00FCr <applet>-Tag ist ein \"height\"-Attribut erforderlich."},
-            {"appletviewer.parse.warning.applet.requireswidth", "Warnung: F\u00FCr <applet>-Tag ist ein \"width\"-Attribut erforderlich."},
-            {"appletviewer.parse.warning.object.requirescode", "Warnung: F\u00FCr <object>-Tag ist ein \"code\"-Attribut erforderlich."},
-            {"appletviewer.parse.warning.object.requiresheight", "Warnung: F\u00FCr <object>-Tag ist ein \"height\"-Attribut erforderlich."},
-            {"appletviewer.parse.warning.object.requireswidth", "Warnung: F\u00FCr <object>-Tag ist ein \"width\"-Attribut erforderlich."},
-            {"appletviewer.parse.warning.embed.requirescode", "Warnung: F\u00FCr <embed>-Tag ist ein \"code\"-Attribut erforderlich."},
-            {"appletviewer.parse.warning.embed.requiresheight", "Warnung: F\u00FCr <embed>-Tag ist ein \"height\"-Attribut erforderlich."},
-            {"appletviewer.parse.warning.embed.requireswidth", "Warnung: F\u00FCr <embed>-Tag ist ein \"width\"-Attribut erforderlich."},
-            {"appletviewer.parse.warning.appnotLongersupported", "Warnung: <app>-Tag wird nicht mehr unterst\u00FCtzt. Verwenden Sie stattdessen <applet>:"},
-            {"appletviewer.deprecated", "Warnung: Applet-API und AppletViewer sind veraltet."},
-            {"appletviewer.usage", "Verwendung: appletviewer <Optionen> url(s)\n\nwobei die <Optionen> Folgendes umfassen:\n  -encoding <Codierung>    Zeichencodierung f\u00FCr HTML-Dateien angeben\n  -J<Laufzeitkennzeichen>        Argument an den Java-Interpreter \u00FCbergeben\n\nDie Option \"-J\" ist nicht standardm\u00E4\u00DFig und kann ohne vorherige Ank\u00FCndigung ge\u00E4ndert werden."},
-            {"appletviewer.main.err.unsupportedopt", "Nicht unterst\u00FCtzte Option: {0}"},
-            {"appletviewer.main.err.unrecognizedarg", "Unbekanntes Argument: {0}"},
-            {"appletviewer.main.err.dupoption", "Doppelte Verwendung von Option: {0}"},
-            {"appletviewer.main.err.inputfile", "Keine Eingabedateien angegeben."},
-            {"appletviewer.main.err.badurl", "Ung\u00FCltige URL: {0} ( {1} )"},
-            {"appletviewer.main.err.io", "I/O-Ausnahme beim Lesen von: {0}"},
-            {"appletviewer.main.err.readablefile", "Stellen Sie sicher, dass {0} eine lesbare Datei ist."},
-            {"appletviewer.main.err.correcturl", "Ist {0} die richtige URL?"},
-            {"appletviewer.main.prop.store", "Benutzerspezifische Eigenschaften f\u00FCr AppletViewer"},
-            {"appletviewer.main.err.prop.cantread", "Benutzereigenschaftendatei kann nicht gelesen werden: {0}"},
-            {"appletviewer.main.err.prop.cantsave", "Benutzereigenschaftendatei kann nicht gespeichert werden: {0}"},
-            {"appletviewer.main.warn.nosecmgr", "Warnung: Sicherheit wird deaktiviert."},
-            {"appletviewer.main.debug.cantfinddebug", "Debugger kann nicht gefunden werden."},
-            {"appletviewer.main.debug.cantfindmain", "Hauptmethode im Debugger kann nicht gefunden werden."},
-            {"appletviewer.main.debug.exceptionindebug", "Ausnahme im Debugger."},
-            {"appletviewer.main.debug.cantaccess", "Zugriff auf Debugger nicht m\u00F6glich."},
-            {"appletviewer.main.nosecmgr", "Warnung: SecurityManager nicht installiert."},
-            {"appletviewer.main.warning", "Warnung: Es wurden keine Applets gestartet. Stellen Sie sicher, dass die Eingabe ein <applet>-Tag enth\u00E4lt."},
-            {"appletviewer.main.warn.prop.overwrite", "Warnung: Systemeigenschaft wird tempor\u00E4r aufgrund von Benutzeranforderung \u00FCberschrieben: Schl\u00FCssel: {0} Alter Wert: {1} Neuer Wert: {2}"},
-            {"appletviewer.main.warn.cantreadprops", "Warnung: AppletViewer-Eigenschaftendatei kann nicht gelesen werden: {0} Standardwerte werden verwendet."},
-            {"appletioexception.loadclass.throw.interrupted", "Laden der Klasse unterbrochen: {0}"},
-            {"appletioexception.loadclass.throw.notloaded", "Klasse nicht geladen: {0}"},
-            {"appletclassloader.loadcode.verbose", "\u00D6ffnen von Stream zu: {0}, um {1} abzurufen"},
-            {"appletclassloader.filenotfound", "Datei nicht gefunden beim Suchen nach: {0}"},
-            {"appletclassloader.fileformat", "Dateiformatausnahme beim Laden von: {0}"},
-            {"appletclassloader.fileioexception", "I/O-Ausnahme beim Laden von: {0}"},
-            {"appletclassloader.fileexception", "{0}-Ausnahme beim Laden von: {1}"},
-            {"appletclassloader.filedeath", "{0} abgebrochen beim Laden von: {1}"},
-            {"appletclassloader.fileerror", "{0}-Fehler beim Laden von: {1}"},
-            {"appletclassloader.findclass.verbose.openstream", "\u00D6ffnen von Stream zu: {0}, um {1} abzurufen"},
-            {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource f\u00FCr Name: {0}"},
-            {"appletclassloader.getresource.verbose.found", "Ressource {0} als Systemressource gefunden"},
-            {"appletclassloader.getresourceasstream.verbose", "Ressource {0} als Systemressource gefunden"},
-            {"appletpanel.runloader.err", "Objekt oder Codeparameter."},
-            {"appletpanel.runloader.exception", "Ausnahme beim Deserialisieren von {0}"},
-            {"appletpanel.destroyed", "Applet zerst\u00F6rt."},
-            {"appletpanel.loaded", "Applet geladen."},
-            {"appletpanel.started", "Applet gestartet."},
-            {"appletpanel.inited", "Applet initialisiert."},
-            {"appletpanel.stopped", "Applet gestoppt."},
-            {"appletpanel.disposed", "Applet verworfen."},
-            {"appletpanel.nocode", "Bei APPLET-Tag fehlt CODE-Parameter."},
-            {"appletpanel.notfound", "Laden: Klasse {0} nicht gefunden."},
-            {"appletpanel.nocreate", "Laden: {0} kann nicht instanziiert werden."},
-            {"appletpanel.noconstruct", "Laden: {0} ist nicht \"public\" oder hat keinen \"public\"-Constructor."},
-            {"appletpanel.death", "abgebrochen"},
-            {"appletpanel.exception", "Ausnahme: {0}."},
-            {"appletpanel.exception2", "Ausnahme: {0}: {1}."},
-            {"appletpanel.error", "Fehler: {0}."},
-            {"appletpanel.error2", "Fehler: {0}: {1}."},
-            {"appletpanel.notloaded", "Init.: Applet nicht geladen."},
-            {"appletpanel.notinited", "Starten: Applet nicht initialisiert."},
-            {"appletpanel.notstarted", "Stoppen: Applet nicht gestartet."},
-            {"appletpanel.notstopped", "Zerst\u00F6ren: Applet nicht gestoppt."},
-            {"appletpanel.notdestroyed", "Verwerfen: Applet nicht zerst\u00F6rt."},
-            {"appletpanel.notdisposed", "Laden: Applet nicht verworfen."},
-            {"appletpanel.bail", "Unterbrochen: Zur\u00FCckziehen."},
-            {"appletpanel.filenotfound", "Datei nicht gefunden beim Suchen nach: {0}"},
-            {"appletpanel.fileformat", "Dateiformatausnahme beim Laden von: {0}"},
-            {"appletpanel.fileioexception", "I/O-Ausnahme beim Laden von: {0}"},
-            {"appletpanel.fileexception", "{0}-Ausnahme beim Laden von: {1}"},
-            {"appletpanel.filedeath", "{0} abgebrochen beim Laden von: {1}"},
-            {"appletpanel.fileerror", "{0}-Fehler beim Laden von: {1}"},
-            {"appletpanel.badattribute.exception", "HTML-Parsing: Falscher Wert f\u00FCr \"width/height\"-Attribut"},
-            {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream erfordert Loader ungleich null"},
-            {"appletprops.title", "AppletViewer-Eigenschaften"},
-            {"appletprops.label.http.server", "HTTP-Proxyserver:"},
-            {"appletprops.label.http.proxy", "HTTP-Proxyport:"},
-            {"appletprops.label.network", "Netzwerkzugriff:"},
-            {"appletprops.choice.network.item.none", "Keine"},
-            {"appletprops.choice.network.item.applethost", "Applet-Host"},
-            {"appletprops.choice.network.item.unrestricted", "Uneingeschr\u00E4nkt"},
-            {"appletprops.label.class", "Klassenzugriff:"},
-            {"appletprops.choice.class.item.restricted", "Eingeschr\u00E4nkt"},
-            {"appletprops.choice.class.item.unrestricted", "Uneingeschr\u00E4nkt"},
-            {"appletprops.label.unsignedapplet", "Nicht signierte Applets zulassen:"},
-            {"appletprops.choice.unsignedapplet.no", "Nein"},
-            {"appletprops.choice.unsignedapplet.yes", "Ja"},
-            {"appletprops.button.apply", "Anwenden"},
-            {"appletprops.button.cancel", "Abbrechen"},
-            {"appletprops.button.reset", "Zur\u00FCcksetzen"},
-            {"appletprops.apply.exception", "Eigenschaften konnten nicht gespeichert werden: {0}"},
-            /* 4066432 */
-            {"appletprops.title.invalidproxy", "Ung\u00FCltiger Eintrag"},
-            {"appletprops.label.invalidproxy", "Proxyport muss ein positiver Ganzzahlwert sein."},
-            {"appletprops.button.ok", "OK"},
-            /* end 4066432 */
-            {"appletprops.prop.store", "Benutzerspezifische Eigenschaften f\u00FCr AppletViewer"},
-            {"appletsecurityexception.checkcreateclassloader", "Sicherheitsausnahme: Class Loader"},
-            {"appletsecurityexception.checkaccess.thread", "Sicherheitsausnahme: Thread"},
-            {"appletsecurityexception.checkaccess.threadgroup", "Sicherheitsausnahme: Threadgruppe: {0}"},
-            {"appletsecurityexception.checkexit", "Sicherheitsausnahme: Beenden: {0}"},
-            {"appletsecurityexception.checkexec", "Sicherheitsausnahme: Ausf\u00FChrung: {0}"},
-            {"appletsecurityexception.checklink", "Sicherheitsausnahme: Link: {0}"},
-            {"appletsecurityexception.checkpropsaccess", "Sicherheitsausnahme: Eigenschaften"},
-            {"appletsecurityexception.checkpropsaccess.key", "Sicherheitsausnahme: Eigenschaftszugriff {0}"},
-            {"appletsecurityexception.checkread.exception1", "Sicherheitsausnahme: {0}, {1}"},
-            {"appletsecurityexception.checkread.exception2", "Sicherheitsausnahme: file.read: {0}"},
-            {"appletsecurityexception.checkread", "Sicherheitsausnahme: file.read: {0} == {1}"},
-            {"appletsecurityexception.checkwrite.exception", "Sicherheitsausnahme: {0}, {1}"},
-            {"appletsecurityexception.checkwrite", "Sicherheitsausnahme: file.write: {0} == {1}"},
-            {"appletsecurityexception.checkread.fd", "Sicherheitsausnahme: fd.read"},
-            {"appletsecurityexception.checkwrite.fd", "Sicherheitsausnahme: fd.write"},
-            {"appletsecurityexception.checklisten", "Sicherheitsausnahme: socket.listen: {0}"},
-            {"appletsecurityexception.checkaccept", "Sicherheitsausnahme: socket.accept: {0}:{1}"},
-            {"appletsecurityexception.checkconnect.networknone", "Sicherheitsausnahme: socket.connect: {0}->{1}"},
-            {"appletsecurityexception.checkconnect.networkhost1", "Sicherheitsausnahme: Verbindung mit {0} mit Ursprung aus {1} konnte nicht hergestellt werden."},
-            {"appletsecurityexception.checkconnect.networkhost2", "Sicherheitsausnahme: IP f\u00FCr Host {0} oder f\u00FCr {1} konnte nicht aufgel\u00F6st werden. "},
-            {"appletsecurityexception.checkconnect.networkhost3", "Sicherheitsausnahme: IP f\u00FCr Host {0} konnte nicht aufgel\u00F6st werden. Siehe trustProxy-Eigenschaft."},
-            {"appletsecurityexception.checkconnect", "Sicherheitsausnahme: Verbinden: {0}->{1}"},
-            {"appletsecurityexception.checkpackageaccess", "Sicherheitsausnahme: Zugriff auf Package nicht m\u00F6glich: {0}"},
-            {"appletsecurityexception.checkpackagedefinition", "Sicherheitsausnahme: Package kann nicht definiert werden: {0}"},
-            {"appletsecurityexception.cannotsetfactory", "Sicherheitsausnahme: Factory kann nicht festgelegt werden"},
-            {"appletsecurityexception.checkmemberaccess", "Sicherheitsausnahme: Mitgliedszugriff pr\u00FCfen"},
-            {"appletsecurityexception.checkgetprintjob", "Sicherheitsausnahme: getPrintJob"},
-            {"appletsecurityexception.checksystemclipboardaccess", "Sicherheitsausnahme: getSystemClipboard"},
-            {"appletsecurityexception.checkawteventqueueaccess", "Sicherheitsausnahme: getEventQueue"},
-            {"appletsecurityexception.checksecurityaccess", "Sicherheitsausnahme: Sicherheitsvorgang: {0}"},
-            {"appletsecurityexception.getsecuritycontext.unknown", "Unbekannter Class Loader-Typ. Pr\u00FCfen auf getContext nicht m\u00F6glich"},
-            {"appletsecurityexception.checkread.unknown", "Unbekannter Class Loader-Typ. Pr\u00FCfen auf checkRead {0} nicht m\u00F6glich"},
-            {"appletsecurityexception.checkconnect.unknown", "Unbekannter Class Loader-Typ. Pr\u00FCfen auf checkConnect nicht m\u00F6glich"},
-        };
-
-        return temp;
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_es.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.applet.resources;
-
-import java.util.ListResourceBundle;
-
-public class MsgAppletViewer_es extends ListResourceBundle {
-
-    public Object[][] getContents() {
-        Object[][] temp = new Object[][] {
-            {"textframe.button.dismiss", "Descartar"},
-            {"appletviewer.tool.title", "Visor de Applet: {0}"},
-            {"appletviewer.menu.applet", "Applet"},
-            {"appletviewer.menuitem.restart", "Reiniciar"},
-            {"appletviewer.menuitem.reload", "Volver a Cargar"},
-            {"appletviewer.menuitem.stop", "Parar"},
-            {"appletviewer.menuitem.save", "Guardar..."},
-            {"appletviewer.menuitem.start", "Iniciar"},
-            {"appletviewer.menuitem.clone", "Clonar..."},
-            {"appletviewer.menuitem.tag", "Etiqueta..."},
-            {"appletviewer.menuitem.info", "Informaci\u00F3n..."},
-            {"appletviewer.menuitem.edit", "Editar"},
-            {"appletviewer.menuitem.encoding", "Codificaci\u00F3n de Caracteres"},
-            {"appletviewer.menuitem.print", "Imprimir..."},
-            {"appletviewer.menuitem.props", "Propiedades..."},
-            {"appletviewer.menuitem.close", "Cerrar"},
-            {"appletviewer.menuitem.quit", "Salir"},
-            {"appletviewer.label.hello", "Hola..."},
-            {"appletviewer.status.start", "iniciando applet..."},
-            {"appletviewer.appletsave.filedialogtitle","Serializar Applet en Archivo"},
-            {"appletviewer.appletsave.err1", "serializando {0} en {1}"},
-            {"appletviewer.appletsave.err2", "en appletSave: {0}"},
-            {"appletviewer.applettag", "Etiqueta Mostrada"},
-            {"appletviewer.applettag.textframe", "Etiqueta HTML de Applet"},
-            {"appletviewer.appletinfo.applet", "-- ninguna informaci\u00F3n de applet --"},
-            {"appletviewer.appletinfo.param", "-- ninguna informaci\u00F3n de par\u00E1metros --"},
-            {"appletviewer.appletinfo.textframe", "Informaci\u00F3n del Applet"},
-            {"appletviewer.appletprint.fail", "Fallo de impresi\u00F3n."},
-            {"appletviewer.appletprint.finish", "Impresi\u00F3n terminada."},
-            {"appletviewer.appletprint.cancel", "Impresi\u00F3n cancelada."},
-            {"appletviewer.appletencoding", "Codificaci\u00F3n de Caracteres: {0}"},
-            {"appletviewer.parse.warning.requiresname", "Advertencia: la etiqueta <param name=... value=...> requiere un atributo name."},
-            {"appletviewer.parse.warning.paramoutside", "Advertencia: la etiqueta <param> est\u00E1 fuera de <applet> ... </applet>."},
-            {"appletviewer.parse.warning.applet.requirescode", "Advertencia: la etiqueta <applet> requiere el atributo code."},
-            {"appletviewer.parse.warning.applet.requiresheight", "Advertencia: la etiqueta <applet> requiere el atributo height."},
-            {"appletviewer.parse.warning.applet.requireswidth", "Advertencia: la etiqueta <applet> requiere el atributo width."},
-            {"appletviewer.parse.warning.object.requirescode", "Advertencia: la etiqueta <object> requiere el atributo code."},
-            {"appletviewer.parse.warning.object.requiresheight", "Advertencia: la etiqueta <object> requiere el atributo height."},
-            {"appletviewer.parse.warning.object.requireswidth", "Advertencia: la etiqueta <object> requiere el atributo width."},
-            {"appletviewer.parse.warning.embed.requirescode", "Advertencia: la etiqueta <embed> requiere el atributo code."},
-            {"appletviewer.parse.warning.embed.requiresheight", "Advertencia: la etiqueta <embed> requiere el atributo height."},
-            {"appletviewer.parse.warning.embed.requireswidth", "Advertencia: la etiqueta <embed> requiere el atributo width."},
-            {"appletviewer.parse.warning.appnotLongersupported", "Advertencia: la etiqueta <app> ya no est\u00E1 soportada, utilice <applet> en su lugar:"},
-            {"appletviewer.deprecated", "Advertencia: la API de applet y AppletViewer est\u00E1n en desuso."},
-            {"appletviewer.usage", "Sintaxis: appletviewer <opciones> url(s)\n\ndonde <opciones> incluye:\n  -encoding <codificaci\u00F3n>    Especificar la codificaci\u00F3n de caracteres utilizada por los archivos HTML\n  -J<indicador de tiempo de ejecuci\u00F3n>        Transferir argumento al int\u00E9rprete de Java\n\nLa opci\u00F3n -J es no est\u00E1ndar y est\u00E1 sujeta a cambios sin previo aviso."},
-            {"appletviewer.main.err.unsupportedopt", "Opci\u00F3n no soportada: {0}"},
-            {"appletviewer.main.err.unrecognizedarg", "Argumento no reconocido: {0}"},
-            {"appletviewer.main.err.dupoption", "Uso duplicado de la opci\u00F3n: {0}"},
-            {"appletviewer.main.err.inputfile", "No se ha especificado ning\u00FAn archivo de entrada."},
-            {"appletviewer.main.err.badurl", "URL Err\u00F3nea: {0} ( {1} )"},
-            {"appletviewer.main.err.io", "Excepci\u00F3n de E/S durante la lectura: {0}"},
-            {"appletviewer.main.err.readablefile", "Aseg\u00FArese de que {0} es un archivo y que se puede leer."},
-            {"appletviewer.main.err.correcturl", "\u00BFEs {0} la URL correcta?"},
-            {"appletviewer.main.prop.store", "Propiedades Espec\u00EDficas del Usuario para AppletViewer"},
-            {"appletviewer.main.err.prop.cantread", "No se puede leer el archivo de propiedades del usuario: {0}"},
-            {"appletviewer.main.err.prop.cantsave", "No se puede guardar el archivo de propiedades del usuario: {0}"},
-            {"appletviewer.main.warn.nosecmgr", "Advertencia: desactivando seguridad."},
-            {"appletviewer.main.debug.cantfinddebug", "No se ha encontrado el depurador."},
-            {"appletviewer.main.debug.cantfindmain", "No se ha encontrado el m\u00E9todo principal en el depurador."},
-            {"appletviewer.main.debug.exceptionindebug", "Excepci\u00F3n en el depurador."},
-            {"appletviewer.main.debug.cantaccess", "No se puede acceder al depurador."},
-            {"appletviewer.main.nosecmgr", "Advertencia: no se ha instalado SecurityManager."},
-            {"appletviewer.main.warning", "Advertencia: no se ha iniciado ning\u00FAn applet. Aseg\u00FArese de que la entrada contiene una etiqueta <applet>."},
-            {"appletviewer.main.warn.prop.overwrite", "Advertencia: se sobrescribir\u00E1 temporalmente la propiedad del sistema cuando lo solicite el usuario: clave: {0} valor anterior: {1} nuevo valor: {2}"},
-            {"appletviewer.main.warn.cantreadprops", "Advertencia: no se puede leer el archivo de propiedades de AppletViewer: {0}. Utilizando valores por defecto."},
-            {"appletioexception.loadclass.throw.interrupted", "carga de clase interrumpida: {0}"},
-            {"appletioexception.loadclass.throw.notloaded", "clase no cargada: {0}"},
-            {"appletclassloader.loadcode.verbose", "Abriendo flujo a: {0} para obtener {1}"},
-            {"appletclassloader.filenotfound", "No se ha encontrado el archivo al buscar: {0}"},
-            {"appletclassloader.fileformat", "Excepci\u00F3n de formato de archivo al cargar: {0}"},
-            {"appletclassloader.fileioexception", "Excepci\u00F3n de E/S al cargar: {0}"},
-            {"appletclassloader.fileexception", "Excepci\u00F3n de {0} al cargar: {1}"},
-            {"appletclassloader.filedeath", "{0} interrumpido al cargar: {1}"},
-            {"appletclassloader.fileerror", "error de {0} al cargar: {1}"},
-            {"appletclassloader.findclass.verbose.openstream", "Abriendo flujo a: {0} para obtener {1}"},
-            {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource para nombre: {0}"},
-            {"appletclassloader.getresource.verbose.found", "Recurso encontrado: {0} como un recurso de sistema"},
-            {"appletclassloader.getresourceasstream.verbose", "Recurso encontrado: {0} como un recurso de sistema"},
-            {"appletpanel.runloader.err", "Par\u00E1metro de c\u00F3digo u objeto."},
-            {"appletpanel.runloader.exception", "excepci\u00F3n al deserializar {0}"},
-            {"appletpanel.destroyed", "Applet destruido."},
-            {"appletpanel.loaded", "Applet cargado."},
-            {"appletpanel.started", "Applet iniciado."},
-            {"appletpanel.inited", "Applet inicializado."},
-            {"appletpanel.stopped", "Applet parado."},
-            {"appletpanel.disposed", "Applet desechado."},
-            {"appletpanel.nocode", "Falta el par\u00E1metro CODE en la etiqueta APPLET."},
-            {"appletpanel.notfound", "cargar: clase {0} no encontrada."},
-            {"appletpanel.nocreate", "cargar: {0} no se puede instanciar."},
-            {"appletpanel.noconstruct", "cargar: {0} no es p\u00FAblico o no tiene un constructor p\u00FAblico."},
-            {"appletpanel.death", "interrumpido"},
-            {"appletpanel.exception", "excepci\u00F3n: {0}."},
-            {"appletpanel.exception2", "excepci\u00F3n: {0}: {1}."},
-            {"appletpanel.error", "error: {0}."},
-            {"appletpanel.error2", "error: {0}: {1}."},
-            {"appletpanel.notloaded", "Iniciaci\u00F3n: applet no cargado."},
-            {"appletpanel.notinited", "Iniciar: applet no inicializado."},
-            {"appletpanel.notstarted", "Parar: applet no iniciado."},
-            {"appletpanel.notstopped", "Destruir: applet no parado."},
-            {"appletpanel.notdestroyed", "Desechar: applet no destruido."},
-            {"appletpanel.notdisposed", "Cargar: applet no desechado."},
-            {"appletpanel.bail", "Interrumpido: rescatando."},
-            {"appletpanel.filenotfound", "No se ha encontrado el archivo al buscar: {0}"},
-            {"appletpanel.fileformat", "Excepci\u00F3n de formato de archivo al cargar: {0}"},
-            {"appletpanel.fileioexception", "Excepci\u00F3n de E/S al cargar: {0}"},
-            {"appletpanel.fileexception", "Excepci\u00F3n de {0} al cargar: {1}"},
-            {"appletpanel.filedeath", "{0} interrumpido al cargar: {1}"},
-            {"appletpanel.fileerror", "error de {0} al cargar: {1}"},
-            {"appletpanel.badattribute.exception", "An\u00E1lisis HTML: valor incorrecto para el atributo width/height."},
-            {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream requiere un cargador no nulo"},
-            {"appletprops.title", "Propiedades de AppletViewer"},
-            {"appletprops.label.http.server", "Servidor Proxy HTTP:"},
-            {"appletprops.label.http.proxy", "Puerto Proxy HTTP:"},
-            {"appletprops.label.network", "Acceso de Red:"},
-            {"appletprops.choice.network.item.none", "Ninguno"},
-            {"appletprops.choice.network.item.applethost", "Host del Applet"},
-            {"appletprops.choice.network.item.unrestricted", "No Restringido"},
-            {"appletprops.label.class", "Acceso de Clase:"},
-            {"appletprops.choice.class.item.restricted", "Restringido"},
-            {"appletprops.choice.class.item.unrestricted", "No Restringido"},
-            {"appletprops.label.unsignedapplet", "Permitir Applets no Firmados:"},
-            {"appletprops.choice.unsignedapplet.no", "No"},
-            {"appletprops.choice.unsignedapplet.yes", "S\u00ED"},
-            {"appletprops.button.apply", "Aplicar"},
-            {"appletprops.button.cancel", "Cancelar"},
-            {"appletprops.button.reset", "Restablecer"},
-            {"appletprops.apply.exception", "Fallo al guardar las propiedades: {0}"},
-            /* 4066432 */
-            {"appletprops.title.invalidproxy", "Entrada no V\u00E1lida"},
-            {"appletprops.label.invalidproxy", "El puerto proxy debe ser un valor entero positivo."},
-            {"appletprops.button.ok", "Aceptar"},
-            /* end 4066432 */
-            {"appletprops.prop.store", "Propiedades espec\u00EDficas del usuario para AppletViewer"},
-            {"appletsecurityexception.checkcreateclassloader", "Excepci\u00F3n de Seguridad: classloader"},
-            {"appletsecurityexception.checkaccess.thread", "Excepci\u00F3n de Seguridad: thread"},
-            {"appletsecurityexception.checkaccess.threadgroup", "Excepci\u00F3n de Seguridad: threadgroup: {0}"},
-            {"appletsecurityexception.checkexit", "Excepci\u00F3n de Seguridad: salir: {0}"},
-            {"appletsecurityexception.checkexec", "Excepci\u00F3n de Seguridad: ejecutar: {0}"},
-            {"appletsecurityexception.checklink", "Excepci\u00F3n de Seguridad: enlace: {0}"},
-            {"appletsecurityexception.checkpropsaccess", "Excepci\u00F3n de Seguridad: propiedades"},
-            {"appletsecurityexception.checkpropsaccess.key", "Excepci\u00F3n de Seguridad: acceso a propiedades {0}"},
-            {"appletsecurityexception.checkread.exception1", "Excepci\u00F3n de Seguridad: {0}, {1}"},
-            {"appletsecurityexception.checkread.exception2", "Excepci\u00F3n de Seguridad: file.read: {0}"},
-            {"appletsecurityexception.checkread", "Excepci\u00F3n de Seguridad: file.read: {0} == {1}"},
-            {"appletsecurityexception.checkwrite.exception", "Excepci\u00F3n de Seguridad: {0}, {1}"},
-            {"appletsecurityexception.checkwrite", "Excepci\u00F3n de Seguridad: file.write: {0} == {1}"},
-            {"appletsecurityexception.checkread.fd", "Excepci\u00F3n de Seguridad: fd.read"},
-            {"appletsecurityexception.checkwrite.fd", "Excepci\u00F3n de Seguridad: fd.write"},
-            {"appletsecurityexception.checklisten", "Excepci\u00F3n de Seguridad: socket.listen: {0}"},
-            {"appletsecurityexception.checkaccept", "Excepci\u00F3n de Seguridad: socket.accept: {0}:{1}"},
-            {"appletsecurityexception.checkconnect.networknone", "Excepci\u00F3n de Seguridad: socket.connect: {0}->{1}"},
-            {"appletsecurityexception.checkconnect.networkhost1", "Excepci\u00F3n de Seguridad: no se puede conectar a {0} con origen de {1}."},
-            {"appletsecurityexception.checkconnect.networkhost2", "Excepci\u00F3n de Seguridad: no se puede resolver la IP para el host {0} o para {1}. "},
-            {"appletsecurityexception.checkconnect.networkhost3", "Excepci\u00F3n de Seguridad: no se puede resolver la IP para el host {0}. Consulte la propiedad trustProxy."},
-            {"appletsecurityexception.checkconnect", "Excepci\u00F3n de Seguridad: conexi\u00F3n: {0}->{1}"},
-            {"appletsecurityexception.checkpackageaccess", "Excepci\u00F3n de Seguridad: no se puede acceder al paquete: {0}"},
-            {"appletsecurityexception.checkpackagedefinition", "Excepci\u00F3n de Seguridad: no se puede definir el paquete: {0}"},
-            {"appletsecurityexception.cannotsetfactory", "Excepci\u00F3n de Seguridad: no se puede definir el valor de f\u00E1brica"},
-            {"appletsecurityexception.checkmemberaccess", "Excepci\u00F3n de Seguridad: comprobar el acceso de miembro"},
-            {"appletsecurityexception.checkgetprintjob", "Excepci\u00F3n de Seguridad: getPrintJob"},
-            {"appletsecurityexception.checksystemclipboardaccess", "Excepci\u00F3n de Seguridad: getSystemClipboard"},
-            {"appletsecurityexception.checkawteventqueueaccess", "Excepci\u00F3n de Seguridad: getEventQueue"},
-            {"appletsecurityexception.checksecurityaccess", "Excepci\u00F3n de Seguridad: operaci\u00F3n de seguridad: {0}"},
-            {"appletsecurityexception.getsecuritycontext.unknown", "tipo de cargador de clase desconocido. no se puede comprobar para getContext"},
-            {"appletsecurityexception.checkread.unknown", "tipo de cargador de clase desconocido. no se puede comprobar para lectura de comprobaci\u00F3n {0}"},
-            {"appletsecurityexception.checkconnect.unknown", "tipo de cargador de clase desconocido. no se puede comprobar para conexi\u00F3n de comprobaci\u00F3n"},
-        };
-
-        return temp;
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_fr.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.applet.resources;
-
-import java.util.ListResourceBundle;
-
-public class MsgAppletViewer_fr extends ListResourceBundle {
-
-    public Object[][] getContents() {
-        Object[][] temp = new Object[][] {
-            {"textframe.button.dismiss", "Abandonner"},
-            {"appletviewer.tool.title", "Visualiseur d''applets : {0}"},
-            {"appletviewer.menu.applet", "Applet"},
-            {"appletviewer.menuitem.restart", "Red\u00E9marrer"},
-            {"appletviewer.menuitem.reload", "Recharger"},
-            {"appletviewer.menuitem.stop", "Arr\u00EAter"},
-            {"appletviewer.menuitem.save", "Enregistrer..."},
-            {"appletviewer.menuitem.start", "D\u00E9marrer"},
-            {"appletviewer.menuitem.clone", "Cloner..."},
-            {"appletviewer.menuitem.tag", "Baliser..."},
-            {"appletviewer.menuitem.info", "Informations..."},
-            {"appletviewer.menuitem.edit", "Modifier"},
-            {"appletviewer.menuitem.encoding", "Encodage de caract\u00E8res"},
-            {"appletviewer.menuitem.print", "Imprimer..."},
-            {"appletviewer.menuitem.props", "Propri\u00E9t\u00E9s..."},
-            {"appletviewer.menuitem.close", "Fermer"},
-            {"appletviewer.menuitem.quit", "Quitter"},
-            {"appletviewer.label.hello", "Bonjour..."},
-            {"appletviewer.status.start", "d\u00E9marrage de l'applet..."},
-            {"appletviewer.appletsave.filedialogtitle","S\u00E9rialiser l'applet dans le fichier"},
-            {"appletviewer.appletsave.err1", "S\u00E9rialisation de {0} vers {1}"},
-            {"appletviewer.appletsave.err2", "dans appletSave : {0}"},
-            {"appletviewer.applettag", "Balise affich\u00E9e"},
-            {"appletviewer.applettag.textframe", "Balise HTML d'applet"},
-            {"appletviewer.appletinfo.applet", "-- aucune information d'applet --"},
-            {"appletviewer.appletinfo.param", "-- aucune information de param\u00E8tre --"},
-            {"appletviewer.appletinfo.textframe", "Informations d'applet"},
-            {"appletviewer.appletprint.fail", "Echec de l'impression."},
-            {"appletviewer.appletprint.finish", "Impression termin\u00E9e."},
-            {"appletviewer.appletprint.cancel", "Impression annul\u00E9e."},
-            {"appletviewer.appletencoding", "Encodage de caract\u00E8res : {0}"},
-            {"appletviewer.parse.warning.requiresname", "Avertissement : la balise <param name=... value=...> requiert un attribut de nom."},
-            {"appletviewer.parse.warning.paramoutside", "Avertissement : la balise <param> est en dehors des balises <applet> ... </applet>."},
-            {"appletviewer.parse.warning.applet.requirescode", "Avertissement : la balise <applet> requiert un attribut de code."},
-            {"appletviewer.parse.warning.applet.requiresheight", "Avertissement : la balise <applet> requiert un attribut de hauteur."},
-            {"appletviewer.parse.warning.applet.requireswidth", "Avertissement : la balise <applet> requiert un attribut de largeur."},
-            {"appletviewer.parse.warning.object.requirescode", "Avertissement : la balise <object> requiert un attribut de code."},
-            {"appletviewer.parse.warning.object.requiresheight", "Avertissement : la balise <object> requiert un attribut de hauteur."},
-            {"appletviewer.parse.warning.object.requireswidth", "Avertissement : la balise <object> requiert un attribut de largeur."},
-            {"appletviewer.parse.warning.embed.requirescode", "Avertissement : la balise <embed> requiert un attribut de code."},
-            {"appletviewer.parse.warning.embed.requiresheight", "Avertissement : la balise <embed> requiert un attribut de hauteur."},
-            {"appletviewer.parse.warning.embed.requireswidth", "Avertissement : la balise <embed> requiert un attribut de largeur."},
-            {"appletviewer.parse.warning.appnotLongersupported", "Avertissement : la balise <app> n'est plus prise en charge, utilisez <applet> \u00E0 la place :"},
-            {"appletviewer.deprecated", "Avertissement : l'API d'applet et AppletViewer sont en phase d'abandon."},
-            {"appletviewer.usage", "Syntaxe : appletviewer <options> url(s)\n\no\u00F9 <options> inclut :\n  -encoding <encoding>    Indiquer l'encodage de caract\u00E8res utilis\u00E9 par les fichiers HTML\n  -J<runtime flag>        Transmettre l'argument \u00E0 l'interpr\u00E9teur Java\n\nL'option -J n'est pas standard et elle peut \u00EAtre modifi\u00E9e sans pr\u00E9avis."},
-            {"appletviewer.main.err.unsupportedopt", "Option non prise en charge : {0}"},
-            {"appletviewer.main.err.unrecognizedarg", "Argument non reconnu : {0}"},
-            {"appletviewer.main.err.dupoption", "Utilisation en double de l''option : {0}"},
-            {"appletviewer.main.err.inputfile", "Aucun fichier d'entr\u00E9e indiqu\u00E9."},
-            {"appletviewer.main.err.badurl", "URL incorrecte : {0} ({1})"},
-            {"appletviewer.main.err.io", "Exception d''E/S lors de la lecture : {0}"},
-            {"appletviewer.main.err.readablefile", "Assurez-vous que {0} est un fichier accessible en lecture."},
-            {"appletviewer.main.err.correcturl", "L''\u00E9l\u00E9ment {0} est-il l''URL correcte ?"},
-            {"appletviewer.main.prop.store", "Propri\u00E9t\u00E9s utilisateur pour AppletViewer"},
-            {"appletviewer.main.err.prop.cantread", "Impossible de lire le fichier de propri\u00E9t\u00E9s utilisateur : {0}"},
-            {"appletviewer.main.err.prop.cantsave", "Impossible d''enregistrer le fichier de propri\u00E9t\u00E9s utilisateur : {0}"},
-            {"appletviewer.main.warn.nosecmgr", "Avertissement : d\u00E9sactivation de la s\u00E9curit\u00E9."},
-            {"appletviewer.main.debug.cantfinddebug", "D\u00E9bogueur introuvable."},
-            {"appletviewer.main.debug.cantfindmain", "La m\u00E9thode principale est introuvable dans le d\u00E9bogueur."},
-            {"appletviewer.main.debug.exceptionindebug", "Exception d\u00E9tect\u00E9e dans le d\u00E9bogueur."},
-            {"appletviewer.main.debug.cantaccess", "Impossible d'acc\u00E9der au d\u00E9bogueur."},
-            {"appletviewer.main.nosecmgr", "Avertissement : SecurityManager n'est pas install\u00E9."},
-            {"appletviewer.main.warning", "Avertissement : aucune applet n'a \u00E9t\u00E9 d\u00E9marr\u00E9e. Assurez-vous que l'entr\u00E9e contient une balise <applet>."},
-            {"appletviewer.main.warn.prop.overwrite", "Avertissement : remplacement temporaire de la propri\u00E9t\u00E9 syst\u00E8me \u00E0 la demande de l''utilisateur - Cl\u00E9 : {0}, ancienne valeur : {1}, nouvelle valeur : {2}"},
-            {"appletviewer.main.warn.cantreadprops", "Avertissement : impossible de lire le fichier de propri\u00E9t\u00E9s d''AppletViewer : {0} Utilisation des valeurs par d\u00E9faut."},
-            {"appletioexception.loadclass.throw.interrupted", "chargement de classe interrompu : {0}"},
-            {"appletioexception.loadclass.throw.notloaded", "classe non charg\u00E9e : {0}"},
-            {"appletclassloader.loadcode.verbose", "Ouverture du flux de donn\u00E9es dans {0} pour obtenir {1}"},
-            {"appletclassloader.filenotfound", "Fichier introuvable lors de la recherche de {0}"},
-            {"appletclassloader.fileformat", "Exception de format de fichier d\u00E9tect\u00E9e lors du chargement de : {0}"},
-            {"appletclassloader.fileioexception", "Exception d''E/S lors du chargement de : {0}"},
-            {"appletclassloader.fileexception", "Exception {0} lors du chargement de : {1}"},
-            {"appletclassloader.filedeath", "Fermeture de {0} lors du chargement de : {1}"},
-            {"appletclassloader.fileerror", "Erreur {0} lors du chargement de : {1}"},
-            {"appletclassloader.findclass.verbose.openstream", "Ouverture du flux de donn\u00E9es dans {0} pour obtenir {1}"},
-            {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource pour le nom : {0}"},
-            {"appletclassloader.getresource.verbose.found", "Ressource {0} trouv\u00E9e en tant que ressource syst\u00E8me"},
-            {"appletclassloader.getresourceasstream.verbose", "Ressource {0} trouv\u00E9e en tant que ressource syst\u00E8me"},
-            {"appletpanel.runloader.err", "Param\u00E8tre d'objet ou de code."},
-            {"appletpanel.runloader.exception", "exception lors de la d\u00E9s\u00E9rialisation de {0}"},
-            {"appletpanel.destroyed", "Applet d\u00E9truite."},
-            {"appletpanel.loaded", "Applet charg\u00E9e."},
-            {"appletpanel.started", "Applet d\u00E9marr\u00E9e."},
-            {"appletpanel.inited", "Applet initialis\u00E9e."},
-            {"appletpanel.stopped", "Applet arr\u00EAt\u00E9e."},
-            {"appletpanel.disposed", "Applet \u00E9limin\u00E9e."},
-            {"appletpanel.nocode", "Param\u00E8tre CODE manquant dans la balise APPLET."},
-            {"appletpanel.notfound", "Charger : la classe {0} est introuvable."},
-            {"appletpanel.nocreate", "Charger : impossible d''instantier {0}."},
-            {"appletpanel.noconstruct", "Charger : l''\u00E9l\u00E9ment {0} n''est pas public ou ne poss\u00E8de aucun constructeur public."},
-            {"appletpanel.death", "arr\u00EAt\u00E9"},
-            {"appletpanel.exception", "exception : {0}."},
-            {"appletpanel.exception2", "exception : {0} : {1}."},
-            {"appletpanel.error", "erreur : {0}."},
-            {"appletpanel.error2", "erreur : {0} : {1}."},
-            {"appletpanel.notloaded", "Initialiser : applet non charg\u00E9e."},
-            {"appletpanel.notinited", "D\u00E9marrer : applet non initialis\u00E9e."},
-            {"appletpanel.notstarted", "Arr\u00EAter : applet non d\u00E9marr\u00E9e."},
-            {"appletpanel.notstopped", "D\u00E9truire : applet non arr\u00EAt\u00E9e."},
-            {"appletpanel.notdestroyed", "Eliminer : applet non d\u00E9truite."},
-            {"appletpanel.notdisposed", "Charger : applet non \u00E9limin\u00E9e."},
-            {"appletpanel.bail", "Interrompu : r\u00E9solution."},
-            {"appletpanel.filenotfound", "Fichier introuvable lors de la recherche de {0}"},
-            {"appletpanel.fileformat", "Exception de format de fichier d\u00E9tect\u00E9e lors du chargement de : {0}"},
-            {"appletpanel.fileioexception", "Exception d''E/S lors du chargement de : {0}"},
-            {"appletpanel.fileexception", "Exception {0} lors du chargement de : {1}"},
-            {"appletpanel.filedeath", "Fermeture de {0} lors du chargement de : {1}"},
-            {"appletpanel.fileerror", "Erreur {0} lors du chargement de : {1}"},
-            {"appletpanel.badattribute.exception", "Analyse HTML : valeur incorrecte pour l'attribut de largeur/hauteur"},
-            {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream requiert un chargeur non NULL"},
-            {"appletprops.title", "Propri\u00E9t\u00E9s d'AppletViewer"},
-            {"appletprops.label.http.server", "Serveur proxy HTTP :"},
-            {"appletprops.label.http.proxy", "Port proxy HTTP :"},
-            {"appletprops.label.network", "Acc\u00E8s au r\u00E9seau :"},
-            {"appletprops.choice.network.item.none", "Aucun"},
-            {"appletprops.choice.network.item.applethost", "H\u00F4te de l'applet"},
-            {"appletprops.choice.network.item.unrestricted", "Sans restriction"},
-            {"appletprops.label.class", "Acc\u00E8s \u00E0 la classe :"},
-            {"appletprops.choice.class.item.restricted", "Avec restriction"},
-            {"appletprops.choice.class.item.unrestricted", "Sans restriction"},
-            {"appletprops.label.unsignedapplet", "Autoriser les applets non sign\u00E9es :"},
-            {"appletprops.choice.unsignedapplet.no", "Non"},
-            {"appletprops.choice.unsignedapplet.yes", "Oui"},
-            {"appletprops.button.apply", "Appliquer"},
-            {"appletprops.button.cancel", "Annuler"},
-            {"appletprops.button.reset", "R\u00E9initialiser"},
-            {"appletprops.apply.exception", "Echec de l''enregistrement des propri\u00E9t\u00E9s : {0}"},
-            /* 4066432 */
-            {"appletprops.title.invalidproxy", "Entr\u00E9e non valide"},
-            {"appletprops.label.invalidproxy", "Le port proxy doit \u00EAtre un entier positif."},
-            {"appletprops.button.ok", "OK"},
-            /* end 4066432 */
-            {"appletprops.prop.store", "Propri\u00E9t\u00E9s utilisateur pour AppletViewer"},
-            {"appletsecurityexception.checkcreateclassloader", "Exception de s\u00E9curit\u00E9 : chargeur de classe"},
-            {"appletsecurityexception.checkaccess.thread", "Exception de s\u00E9curit\u00E9 : thread"},
-            {"appletsecurityexception.checkaccess.threadgroup", "Exception de s\u00E9curit\u00E9 : groupe de threads : {0}"},
-            {"appletsecurityexception.checkexit", "Exception de s\u00E9curit\u00E9 : sortie : {0}"},
-            {"appletsecurityexception.checkexec", "Exception de s\u00E9curit\u00E9 : ex\u00E9cution : {0}"},
-            {"appletsecurityexception.checklink", "Exception de s\u00E9curit\u00E9 : lien : {0}"},
-            {"appletsecurityexception.checkpropsaccess", "Exception de s\u00E9curit\u00E9 : propri\u00E9t\u00E9s"},
-            {"appletsecurityexception.checkpropsaccess.key", "Exception de s\u00E9curit\u00E9 : acc\u00E8s aux propri\u00E9t\u00E9s {0}"},
-            {"appletsecurityexception.checkread.exception1", "Exception de s\u00E9curit\u00E9 : {0}, {1}"},
-            {"appletsecurityexception.checkread.exception2", "Exception de s\u00E9curit\u00E9 : file.read : {0}"},
-            {"appletsecurityexception.checkread", "Exception de s\u00E9curit\u00E9 : file.read : {0} == {1}"},
-            {"appletsecurityexception.checkwrite.exception", "Exception de s\u00E9curit\u00E9 : {0}, {1}"},
-            {"appletsecurityexception.checkwrite", "Exception de s\u00E9curit\u00E9 : file.write : {0} == {1}"},
-            {"appletsecurityexception.checkread.fd", "Exception de s\u00E9curit\u00E9 : fd.read"},
-            {"appletsecurityexception.checkwrite.fd", "Exception de s\u00E9curit\u00E9 : fd.write"},
-            {"appletsecurityexception.checklisten", "Exception de s\u00E9curit\u00E9 : socket.listen : {0}"},
-            {"appletsecurityexception.checkaccept", "Exception de s\u00E9curit\u00E9 : socket.accept : {0} : {1}"},
-            {"appletsecurityexception.checkconnect.networknone", "Exception de s\u00E9curit\u00E9 : socket.connect : {0} -> {1}"},
-            {"appletsecurityexception.checkconnect.networkhost1", "Exception de s\u00E9curit\u00E9 : impossible de se connecter \u00E0 {0} dont l''origine est {1}."},
-            {"appletsecurityexception.checkconnect.networkhost2", "Exception de s\u00E9curit\u00E9 : impossible de r\u00E9soudre l''adresse IP pour l''h\u00F4te {0} ou pour {1}. "},
-            {"appletsecurityexception.checkconnect.networkhost3", "Exception de s\u00E9curit\u00E9 : impossible de r\u00E9soudre l''adresse IP pour l''h\u00F4te {0}. Voir la propri\u00E9t\u00E9 trustProxy."},
-            {"appletsecurityexception.checkconnect", "Exception de s\u00E9curit\u00E9 : connexion : {0} -> {1}"},
-            {"appletsecurityexception.checkpackageaccess", "Exception de s\u00E9curit\u00E9 : impossible d''acc\u00E9der au package : {0}"},
-            {"appletsecurityexception.checkpackagedefinition", "Exception de s\u00E9curit\u00E9 : impossible de d\u00E9finir le package : {0}"},
-            {"appletsecurityexception.cannotsetfactory", "Exception de s\u00E9curit\u00E9 : impossible de d\u00E9finir la fabrique"},
-            {"appletsecurityexception.checkmemberaccess", "Exception de s\u00E9curit\u00E9 : v\u00E9rifier l'acc\u00E8s des membres"},
-            {"appletsecurityexception.checkgetprintjob", "Exception de s\u00E9curit\u00E9 : getPrintJob"},
-            {"appletsecurityexception.checksystemclipboardaccess", "Exception de s\u00E9curit\u00E9 : getSystemClipboard"},
-            {"appletsecurityexception.checkawteventqueueaccess", "Exception de s\u00E9curit\u00E9 : getEventQueue"},
-            {"appletsecurityexception.checksecurityaccess", "Exception de s\u00E9curit\u00E9 : op\u00E9ration de s\u00E9curit\u00E9 : {0}"},
-            {"appletsecurityexception.getsecuritycontext.unknown", "type de chargeur de classe inconnu, impossible de rechercher getContext"},
-            {"appletsecurityexception.checkread.unknown", "type de chargeur de classe inconnu, impossible de rechercher la v\u00E9rification de lecture {0}"},
-            {"appletsecurityexception.checkconnect.unknown", "type de chargeur de classe inconnu, impossible de rechercher la v\u00E9rification de connexion"},
-        };
-
-        return temp;
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_it.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.applet.resources;
-
-import java.util.ListResourceBundle;
-
-public class MsgAppletViewer_it extends ListResourceBundle {
-
-    public Object[][] getContents() {
-        Object[][] temp = new Object[][] {
-            {"textframe.button.dismiss", "Chiudi"},
-            {"appletviewer.tool.title", "Visualizzatore applet: {0}"},
-            {"appletviewer.menu.applet", "Applet"},
-            {"appletviewer.menuitem.restart", "Riavvia"},
-            {"appletviewer.menuitem.reload", "Ricarica"},
-            {"appletviewer.menuitem.stop", "Arresta"},
-            {"appletviewer.menuitem.save", "Salva..."},
-            {"appletviewer.menuitem.start", "Avvia"},
-            {"appletviewer.menuitem.clone", "Copia..."},
-            {"appletviewer.menuitem.tag", "Tag..."},
-            {"appletviewer.menuitem.info", "Informazioni..."},
-            {"appletviewer.menuitem.edit", "Modifica"},
-            {"appletviewer.menuitem.encoding", "Codifica caratteri"},
-            {"appletviewer.menuitem.print", "Stampa..."},
-            {"appletviewer.menuitem.props", "Propriet\u00E0..."},
-            {"appletviewer.menuitem.close", "Chiudi"},
-            {"appletviewer.menuitem.quit", "Esci"},
-            {"appletviewer.label.hello", "Benvenuti..."},
-            {"appletviewer.status.start", "avvio applet in corso..."},
-            {"appletviewer.appletsave.filedialogtitle","Serializza applet in file"},
-            {"appletviewer.appletsave.err1", "serializzazione di {0} in {1}"},
-            {"appletviewer.appletsave.err2", "in appletSave: {0}"},
-            {"appletviewer.applettag", "Tag visualizzata"},
-            {"appletviewer.applettag.textframe", "Applet tag HTML"},
-            {"appletviewer.appletinfo.applet", "-- nessuna informazione sull'applet --"},
-            {"appletviewer.appletinfo.param", "-- nessuna informazione sul parametro --"},
-            {"appletviewer.appletinfo.textframe", "Informazioni applet"},
-            {"appletviewer.appletprint.fail", "Stampa non riuscita."},
-            {"appletviewer.appletprint.finish", "Stampa completata."},
-            {"appletviewer.appletprint.cancel", "Stampa annullata."},
-            {"appletviewer.appletencoding", "Codifica caratteri: {0}"},
-            {"appletviewer.parse.warning.requiresname", "Avvertenza: la tag <param name=... value=...> richiede un attributo name."},
-            {"appletviewer.parse.warning.paramoutside", "Avvertenza: la tag <param> non rientra in <applet>... </applet>."},
-            {"appletviewer.parse.warning.applet.requirescode", "Avvertenza: la tag <applet> richiede un attributo code."},
-            {"appletviewer.parse.warning.applet.requiresheight", "Avvertenza: la tag <applet> richiede un attributo height."},
-            {"appletviewer.parse.warning.applet.requireswidth", "Avvertenza: la tag <applet> richiede un attributo width."},
-            {"appletviewer.parse.warning.object.requirescode", "Avvertenza: la tag <object> richiede un attributo code."},
-            {"appletviewer.parse.warning.object.requiresheight", "Avvertenza: la tag <object> richiede un attributo height."},
-            {"appletviewer.parse.warning.object.requireswidth", "Avvertenza: la tag <object> richiede un attributo width."},
-            {"appletviewer.parse.warning.embed.requirescode", "Avvertenza: la tag <embed> richiede un attributo code."},
-            {"appletviewer.parse.warning.embed.requiresheight", "Avvertenza: la tag <embed> richiede un attributo height."},
-            {"appletviewer.parse.warning.embed.requireswidth", "Avvertenza: la tag <embed> richiede un attributo width."},
-            {"appletviewer.parse.warning.appnotLongersupported", "Avvertenza: la tag <app> non \u00E8 pi\u00F9 supportata. Utilizzare <applet>:"},
-            {"appletviewer.deprecated", "Avvertenza: l'API dell'applet e AppletViewer non sono pi\u00F9 validi."},
-            {"appletviewer.usage", "Uso: appletviewer <options> url(s)\n\ndove <options> includono:\n  -encoding <encoding>    Specifica la codifica dei caratteri utilizzata dai file HTML\n  -J<runtime flag>        Passa l'argomento all'interpreter Java\n\nL'opzione -J non \u00E8 standard ed \u00E8 soggetta a modifica senza preavviso."},
-            {"appletviewer.main.err.unsupportedopt", "Opzione non supportata: {0}"},
-            {"appletviewer.main.err.unrecognizedarg", "Argomento non riconosciuto: {0}"},
-            {"appletviewer.main.err.dupoption", "Uso duplicato dell''opzione: {0}"},
-            {"appletviewer.main.err.inputfile", "Nessun file di input specificato."},
-            {"appletviewer.main.err.badurl", "URL non valido: {0} ( {1} )"},
-            {"appletviewer.main.err.io", "Eccezione I/O durante la lettura di {0}"},
-            {"appletviewer.main.err.readablefile", "Assicurarsi che {0} sia un file e che sia leggibile."},
-            {"appletviewer.main.err.correcturl", "{0} \u00E8 l''URL corretto?"},
-            {"appletviewer.main.prop.store", "Propriet\u00E0 specifiche dell'utente per AppletViewer"},
-            {"appletviewer.main.err.prop.cantread", "Impossibile leggere il file delle propriet\u00E0 utente: {0}"},
-            {"appletviewer.main.err.prop.cantsave", "Impossibile salvare il file delle propriet\u00E0 utente: {0}"},
-            {"appletviewer.main.warn.nosecmgr", "Avvertenza: la sicurezza verr\u00E0 disabilitata."},
-            {"appletviewer.main.debug.cantfinddebug", "Impossibile trovare il debugger."},
-            {"appletviewer.main.debug.cantfindmain", "Impossibile trovare il metodo principale nel debugger."},
-            {"appletviewer.main.debug.exceptionindebug", "Eccezione nel debugger."},
-            {"appletviewer.main.debug.cantaccess", "Impossibile accedere al debugger."},
-            {"appletviewer.main.nosecmgr", "Avvertenza: SecurityManager non installato."},
-            {"appletviewer.main.warning", "Avvertenza: nessuna applet avviata. Assicurarsi che l'input contenga una tag <applet>."},
-            {"appletviewer.main.warn.prop.overwrite", "Avvertenza: la propriet\u00E0 di sistema verr\u00E0 sovrascritta temporaneamente su richiesta dell''utente. Chiave {0}, valore precedente {1}, nuovo valore {2}."},
-            {"appletviewer.main.warn.cantreadprops", "Avvertenza: impossibile leggere il file delle propriet\u00E0 AppletViewer {0}. Verranno utilizzate le impostazioni predefinite."},
-            {"appletioexception.loadclass.throw.interrupted", "caricamento della classe interrotto: {0}"},
-            {"appletioexception.loadclass.throw.notloaded", "classe non caricata: {0}"},
-            {"appletclassloader.loadcode.verbose", "Apertura del flusso per {0} per recuperare {1}"},
-            {"appletclassloader.filenotfound", "File non trovato durante la ricerca di {0}"},
-            {"appletclassloader.fileformat", "Eccezione di formato file durante il caricamento di {0}"},
-            {"appletclassloader.fileioexception", "Eccezione I/O durante il caricamento di {0}"},
-            {"appletclassloader.fileexception", "Eccezione {0} durante il caricamento di {1}"},
-            {"appletclassloader.filedeath", "{0} terminato durante il caricamento di {1}"},
-            {"appletclassloader.fileerror", "Errore {0} durante il caricamento di {1}"},
-            {"appletclassloader.findclass.verbose.openstream", "Apertura del flusso per {0} per recuperare {1}"},
-            {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource per il nome: {0}"},
-            {"appletclassloader.getresource.verbose.found", "\u00C8 stata trovata la risorsa {0} come risorsa di sistema"},
-            {"appletclassloader.getresourceasstream.verbose", "\u00C8 stata trovata la risorsa {0} come risorsa di sistema"},
-            {"appletpanel.runloader.err", "Parametro di oggetto o di codice."},
-            {"appletpanel.runloader.exception", "eccezione durante la deserializzazione di {0}"},
-            {"appletpanel.destroyed", "Applet rimossa."},
-            {"appletpanel.loaded", "Applet caricata."},
-            {"appletpanel.started", "Applet avviata."},
-            {"appletpanel.inited", "Applet inizializzata."},
-            {"appletpanel.stopped", "Applet arrestata."},
-            {"appletpanel.disposed", "Applet eliminata."},
-            {"appletpanel.nocode", "Nella tag APPLET manca il parametro CODE."},
-            {"appletpanel.notfound", "caricamento: classe {0} non trovata."},
-            {"appletpanel.nocreate", "caricamento: impossibile creare un''istanza di {0}."},
-            {"appletpanel.noconstruct", "caricamento: {0} non \u00E8 pubblico o non ha un costruttore pubblico."},
-            {"appletpanel.death", "terminato"},
-            {"appletpanel.exception", "eccezione: {0}"},
-            {"appletpanel.exception2", "eccezione: {0}: {1}."},
-            {"appletpanel.error", "errore: {0}."},
-            {"appletpanel.error2", "errore: {0}: {1}."},
-            {"appletpanel.notloaded", "Inizializzazione: applet non caricata."},
-            {"appletpanel.notinited", "Avvio: applet non inizializzata."},
-            {"appletpanel.notstarted", "Arresto: applet non avviata."},
-            {"appletpanel.notstopped", "Rimozione: applet non arrestata."},
-            {"appletpanel.notdestroyed", "Eliminazione: applet non rimossa."},
-            {"appletpanel.notdisposed", "Caricamento: applet non eliminata."},
-            {"appletpanel.bail", "Interrotto: chiusura."},
-            {"appletpanel.filenotfound", "File non trovato durante la ricerca di {0}"},
-            {"appletpanel.fileformat", "Eccezione di formato file durante il caricamento di {0}"},
-            {"appletpanel.fileioexception", "Eccezione I/O durante il caricamento di {0}"},
-            {"appletpanel.fileexception", "Eccezione {0} durante il caricamento di {1}"},
-            {"appletpanel.filedeath", "{0} terminato durante il caricamento di {1}"},
-            {"appletpanel.fileerror", "Errore {0} durante il caricamento di {1}"},
-            {"appletpanel.badattribute.exception", "Analisi HTML: valore errato per l'attributo width/height"},
-            {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream richiede un loader non nullo"},
-            {"appletprops.title", "Propriet\u00E0 AppletViewer"},
-            {"appletprops.label.http.server", "Server proxy http:"},
-            {"appletprops.label.http.proxy", "Porta proxy http:"},
-            {"appletprops.label.network", "Accesso alla rete:"},
-            {"appletprops.choice.network.item.none", "Nessuno"},
-            {"appletprops.choice.network.item.applethost", "Host applet"},
-            {"appletprops.choice.network.item.unrestricted", "Non limitato"},
-            {"appletprops.label.class", "Accesso alla classe:"},
-            {"appletprops.choice.class.item.restricted", "Limitato"},
-            {"appletprops.choice.class.item.unrestricted", "Non limitato"},
-            {"appletprops.label.unsignedapplet", "Consenti applet senza firma:"},
-            {"appletprops.choice.unsignedapplet.no", "No"},
-            {"appletprops.choice.unsignedapplet.yes", "S\u00EC"},
-            {"appletprops.button.apply", "Applica"},
-            {"appletprops.button.cancel", "Annulla"},
-            {"appletprops.button.reset", "Reimposta"},
-            {"appletprops.apply.exception", "Salvataggio delle propriet\u00E0 non riuscito: {0}"},
-            /* 4066432 */
-            {"appletprops.title.invalidproxy", "Voce non valida"},
-            {"appletprops.label.invalidproxy", "La porta del proxy deve essere un valore intero positivo."},
-            {"appletprops.button.ok", "OK"},
-            /* end 4066432 */
-            {"appletprops.prop.store", "Propriet\u00E0 specifiche dell'utente per AppletViewer"},
-            {"appletsecurityexception.checkcreateclassloader", "Eccezione di sicurezza: classloader"},
-            {"appletsecurityexception.checkaccess.thread", "Eccezione di sicurezza: thread"},
-            {"appletsecurityexception.checkaccess.threadgroup", "Eccezione di sicurezza: threadgroup: {0}"},
-            {"appletsecurityexception.checkexit", "Eccezione di sicurezza: exit: {0}"},
-            {"appletsecurityexception.checkexec", "Eccezione di sicurezza: exec: {0}"},
-            {"appletsecurityexception.checklink", "Eccezione di sicurezza: link: {0}"},
-            {"appletsecurityexception.checkpropsaccess", "Eccezione di sicurezza: properties"},
-            {"appletsecurityexception.checkpropsaccess.key", "Eccezione di sicurezza: properties access {0}"},
-            {"appletsecurityexception.checkread.exception1", "Eccezione di sicurezza: {0}, {1}"},
-            {"appletsecurityexception.checkread.exception2", "Eccezione di sicurezza: file.read: {0}"},
-            {"appletsecurityexception.checkread", "Eccezione di sicurezza: file.read: {0} == {1}"},
-            {"appletsecurityexception.checkwrite.exception", "Eccezione di sicurezza: {0}, {1}"},
-            {"appletsecurityexception.checkwrite", "Eccezione di sicurezza: file.write: {0} == {1}"},
-            {"appletsecurityexception.checkread.fd", "Eccezione di sicurezza: fd.read"},
-            {"appletsecurityexception.checkwrite.fd", "Eccezione di sicurezza: fd.write"},
-            {"appletsecurityexception.checklisten", "Eccezione di sicurezza: socket.listen: {0}"},
-            {"appletsecurityexception.checkaccept", "Eccezione di sicurezza: socket.accept: {0}:{1}"},
-            {"appletsecurityexception.checkconnect.networknone", "Eccezione di sicurezza: socket.connect: {0}->{1}"},
-            {"appletsecurityexception.checkconnect.networkhost1", "Eccezione di sicurezza: impossibile connettersi a {0} con origine da {1}."},
-            {"appletsecurityexception.checkconnect.networkhost2", "Eccezione di sicurezza: impossibile risolvere l''IP per l''host {0} o per {1}. "},
-            {"appletsecurityexception.checkconnect.networkhost3", "Eccezione di sicurezza: impossibile non risolvere l''IP per l''host {0}. Vedere la propriet\u00E0 trustProxy."},
-            {"appletsecurityexception.checkconnect", "Eccezione di sicurezza: connect: {0}->{1}"},
-            {"appletsecurityexception.checkpackageaccess", "Eccezione di sicurezza: impossibile accedere al package {0}"},
-            {"appletsecurityexception.checkpackagedefinition", "Eccezione di sicurezza: impossibile definire il package {0}"},
-            {"appletsecurityexception.cannotsetfactory", "Eccezione di sicurezza: impossibile impostare il factory"},
-            {"appletsecurityexception.checkmemberaccess", "Eccezione di sicurezza: controllare l'accesso dei membri"},
-            {"appletsecurityexception.checkgetprintjob", "Eccezione di sicurezza: getPrintJob"},
-            {"appletsecurityexception.checksystemclipboardaccess", "Eccezione di sicurezza: getSystemClipboard"},
-            {"appletsecurityexception.checkawteventqueueaccess", "Eccezione di sicurezza: getEventQueue"},
-            {"appletsecurityexception.checksecurityaccess", "Eccezione di sicurezza: operazione di sicurezza {0}"},
-            {"appletsecurityexception.getsecuritycontext.unknown", "tipo di loader della classe sconosciuto. Impossibile verificare la presenza di getContext."},
-            {"appletsecurityexception.checkread.unknown", "tipo di loader della classe sconosciuto. Impossibile verificare la presenza della lettura di controllo {0}."},
-            {"appletsecurityexception.checkconnect.unknown", "tipo di loader della classe sconosciuto. Impossibile verificare la presenza della connessione di controllo."},
-        };
-
-        return temp;
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_ja.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.applet.resources;
-
-import java.util.ListResourceBundle;
-
-public class MsgAppletViewer_ja extends ListResourceBundle {
-
-    public Object[][] getContents() {
-        Object[][] temp = new Object[][] {
-            {"textframe.button.dismiss", "\u53D6\u6D88"},
-            {"appletviewer.tool.title", "\u30A2\u30D7\u30EC\u30C3\u30C8\u30FB\u30D3\u30E5\u30FC\u30A2: {0}"},
-            {"appletviewer.menu.applet", "\u30A2\u30D7\u30EC\u30C3\u30C8"},
-            {"appletviewer.menuitem.restart", "\u518D\u8D77\u52D5"},
-            {"appletviewer.menuitem.reload", "\u518D\u30ED\u30FC\u30C9"},
-            {"appletviewer.menuitem.stop", "\u505C\u6B62"},
-            {"appletviewer.menuitem.save", "\u4FDD\u5B58..."},
-            {"appletviewer.menuitem.start", "\u958B\u59CB"},
-            {"appletviewer.menuitem.clone", "\u30AF\u30ED\u30FC\u30F3..."},
-            {"appletviewer.menuitem.tag", "\u30BF\u30B0..."},
-            {"appletviewer.menuitem.info", "\u60C5\u5831..."},
-            {"appletviewer.menuitem.edit", "\u7DE8\u96C6"},
-            {"appletviewer.menuitem.encoding", "\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0"},
-            {"appletviewer.menuitem.print", "\u5370\u5237..."},
-            {"appletviewer.menuitem.props", "\u30D7\u30ED\u30D1\u30C6\u30A3..."},
-            {"appletviewer.menuitem.close", "\u9589\u3058\u308B"},
-            {"appletviewer.menuitem.quit", "\u7D42\u4E86"},
-            {"appletviewer.label.hello", "Hello..."},
-            {"appletviewer.status.start", "\u30A2\u30D7\u30EC\u30C3\u30C8\u3092\u958B\u59CB\u3057\u3066\u3044\u307E\u3059..."},
-            {"appletviewer.appletsave.filedialogtitle","\u30A2\u30D7\u30EC\u30C3\u30C8\u3092\u30D5\u30A1\u30A4\u30EB\u306B\u30B7\u30EA\u30A2\u30E9\u30A4\u30BA"},
-            {"appletviewer.appletsave.err1", "{0}\u3092{1}\u306B\u30B7\u30EA\u30A2\u30E9\u30A4\u30BA"},
-            {"appletviewer.appletsave.err2", "appletSave\u5185: {0}"},
-            {"appletviewer.applettag", "\u30BF\u30B0\u306E\u8868\u793A"},
-            {"appletviewer.applettag.textframe", "\u30A2\u30D7\u30EC\u30C3\u30C8HTML\u30BF\u30B0"},
-            {"appletviewer.appletinfo.applet", "-- \u30A2\u30D7\u30EC\u30C3\u30C8\u60C5\u5831\u306A\u3057 --"},
-            {"appletviewer.appletinfo.param", "-- \u30D1\u30E9\u30E1\u30FC\u30BF\u60C5\u5831\u306A\u3057 --"},
-            {"appletviewer.appletinfo.textframe", "\u30A2\u30D7\u30EC\u30C3\u30C8\u60C5\u5831"},
-            {"appletviewer.appletprint.fail", "\u5370\u5237\u304C\u5931\u6557\u3057\u307E\u3057\u305F\u3002"},
-            {"appletviewer.appletprint.finish", "\u5370\u5237\u3092\u7D42\u4E86\u3057\u307E\u3057\u305F\u3002"},
-            {"appletviewer.appletprint.cancel", "\u5370\u5237\u304C\u53D6\u308A\u6D88\u3055\u308C\u307E\u3057\u305F\u3002"},
-            {"appletviewer.appletencoding", "\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0: {0}"},
-            {"appletviewer.parse.warning.requiresname", "\u8B66\u544A: <param name=... value=...>\u30BF\u30B0\u306Bname\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-            {"appletviewer.parse.warning.paramoutside", "\u8B66\u544A: <param>\u30BF\u30B0\u304C<applet> ... </applet>\u306E\u5916\u5074\u3067\u3059\u3002"},
-            {"appletviewer.parse.warning.applet.requirescode", "\u8B66\u544A: <applet>\u30BF\u30B0\u306Bcode\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-            {"appletviewer.parse.warning.applet.requiresheight", "\u8B66\u544A: <applet>\u30BF\u30B0\u306Bheight\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-            {"appletviewer.parse.warning.applet.requireswidth", "\u8B66\u544A: <applet>\u30BF\u30B0\u306Bwidth\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-            {"appletviewer.parse.warning.object.requirescode", "\u8B66\u544A: <object>\u30BF\u30B0\u306Bcode\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-            {"appletviewer.parse.warning.object.requiresheight", "\u8B66\u544A: <object>\u30BF\u30B0\u306Bheight\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-            {"appletviewer.parse.warning.object.requireswidth", "\u8B66\u544A: <object>\u30BF\u30B0\u306Bwidth\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-            {"appletviewer.parse.warning.embed.requirescode", "\u8B66\u544A: <embed>\u30BF\u30B0\u306Bcode\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-            {"appletviewer.parse.warning.embed.requiresheight", "\u8B66\u544A: <embed>\u30BF\u30B0\u306Bheight\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-            {"appletviewer.parse.warning.embed.requireswidth", "\u8B66\u544A: <embed>\u30BF\u30B0\u306Bwidth\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-            {"appletviewer.parse.warning.appnotLongersupported", "\u8B66\u544A: <app>\u30BF\u30B0\u306F\u73FE\u5728\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u304B\u308F\u308A\u306B<applet>\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-            {"appletviewer.deprecated", "\u8B66\u544A: \u30A2\u30D7\u30EC\u30C3\u30C8API\u304A\u3088\u3073AppletViewer\u306F\u975E\u63A8\u5968\u3067\u3059\u3002"},
-            {"appletviewer.usage", "\u4F7F\u7528\u65B9\u6CD5: appletviewer <options> url(s)\n\n<options>\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059:\n  -encoding <encoding>    HTML\u30D5\u30A1\u30A4\u30EB\u306B\u3088\u3063\u3066\u4F7F\u7528\u3055\u308C\u308B\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3059\u308B\n  -J<runtime flag>        \u5F15\u6570\u3092Java\u30A4\u30F3\u30BF\u30D7\u30EA\u30BF\u306B\u6E21\u3059\n\n-J\u306F\u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3042\u308A\u3001\u4E88\u544A\u306A\u3057\u306B\u5909\u66F4\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002"},
-            {"appletviewer.main.err.unsupportedopt", "\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044\u30AA\u30D7\u30B7\u30E7\u30F3: {0}"},
-            {"appletviewer.main.err.unrecognizedarg", "\u8A8D\u8B58\u3055\u308C\u306A\u3044\u5F15\u6570: {0}"},
-            {"appletviewer.main.err.dupoption", "\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u4F7F\u7528\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059: {0}"},
-            {"appletviewer.main.err.inputfile", "\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-            {"appletviewer.main.err.badurl", "\u4E0D\u6B63\u306AURL: {0} ( {1} )"},
-            {"appletviewer.main.err.io", "\u8AAD\u8FBC\u307F\u4E2D\u306E\u5165\u51FA\u529B\u4F8B\u5916\u3067\u3059: {0}"},
-            {"appletviewer.main.err.readablefile", "{0}\u304C\u30D5\u30A1\u30A4\u30EB\u3067\u3042\u308A\u3001\u8AAD\u8FBC\u307F\u53EF\u80FD\u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-            {"appletviewer.main.err.correcturl", "{0}\u306F\u6B63\u3057\u3044URL\u3067\u3059\u304B\u3002"},
-            {"appletviewer.main.prop.store", "AppletViewer\u7528\u306E\u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D7\u30ED\u30D1\u30C6\u30A3"},
-            {"appletviewer.main.err.prop.cantread", "\u30E6\u30FC\u30B6\u30FC\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: {0}"},
-            {"appletviewer.main.err.prop.cantsave", "\u30E6\u30FC\u30B6\u30FC\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093: {0}"},
-            {"appletviewer.main.warn.nosecmgr", "\u8B66\u544A: \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u3092\u7121\u52B9\u5316\u3057\u307E\u3059\u3002"},
-            {"appletviewer.main.debug.cantfinddebug", "\u30C7\u30D0\u30C3\u30AC\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"},
-            {"appletviewer.main.debug.cantfindmain", "\u30C7\u30D0\u30C3\u30AC\u306E\u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"},
-            {"appletviewer.main.debug.exceptionindebug", "\u30C7\u30D0\u30C3\u30AC\u306B\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002"},
-            {"appletviewer.main.debug.cantaccess", "\u30C7\u30D0\u30C3\u30AC\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093\u3002"},
-            {"appletviewer.main.nosecmgr", "\u8B66\u544A: SecurityManager\u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-            {"appletviewer.main.warning", "\u8B66\u544A: \u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u958B\u59CB\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u5165\u529B\u306B<applet>\u30BF\u30B0\u304C\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-            {"appletviewer.main.warn.prop.overwrite", "\u8B66\u544A: \u30E6\u30FC\u30B6\u30FC\u306E\u30EA\u30AF\u30A8\u30B9\u30C8\u3067\u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u4E00\u6642\u7684\u306B\u4E0A\u66F8\u304D\u3057\u307E\u3059: \u30AD\u30FC: {0} \u53E4\u3044\u5024: {1} \u65B0\u3057\u3044\u5024: {2}"},
-            {"appletviewer.main.warn.cantreadprops", "\u8B66\u544A: AppletViewer\u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30D5\u30A1\u30A4\u30EB{0}\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002"},
-            {"appletioexception.loadclass.throw.interrupted", "\u30AF\u30E9\u30B9\u306E\u30ED\u30FC\u30C9\u304C\u4E2D\u65AD\u3057\u307E\u3057\u305F: {0}"},
-            {"appletioexception.loadclass.throw.notloaded", "\u30AF\u30E9\u30B9\u304C\u30ED\u30FC\u30C9\u3055\u308C\u307E\u305B\u3093: {0}"},
-            {"appletclassloader.loadcode.verbose", "{1}\u3092\u53D6\u5F97\u3059\u308B\u305F\u3081\u306E{0}\u3078\u306E\u30B9\u30C8\u30EA\u30FC\u30E0\u3092\u958B\u304D\u307E\u3059"},
-            {"appletclassloader.filenotfound", "{0}\u306E\u691C\u7D22\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"},
-            {"appletclassloader.fileformat", "{0}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
-            {"appletclassloader.fileioexception", "{0}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B\u5165\u51FA\u529B\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
-            {"appletclassloader.fileexception", "{1}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B{0}\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
-            {"appletclassloader.filedeath", "{1}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B{0}\u304C\u5F37\u5236\u7D42\u4E86\u3057\u307E\u3057\u305F"},
-            {"appletclassloader.fileerror", "{1}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B{0}\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
-            {"appletclassloader.findclass.verbose.openstream", "{1}\u3092\u53D6\u5F97\u3059\u308B\u305F\u3081\u306E{0}\u3078\u306E\u30B9\u30C8\u30EA\u30FC\u30E0\u3092\u958B\u304D\u307E\u3059"},
-            {"appletclassloader.getresource.verbose.forname", "\u540D\u524D{0}\u306EAppletClassLoader.getResource\u3067\u3059"},
-            {"appletclassloader.getresource.verbose.found", "\u30EA\u30BD\u30FC\u30B9{0}\u304C\u30B7\u30B9\u30C6\u30E0\u30FB\u30EA\u30BD\u30FC\u30B9\u3068\u3057\u3066\u691C\u51FA\u3055\u308C\u307E\u3057\u305F"},
-            {"appletclassloader.getresourceasstream.verbose", "\u30EA\u30BD\u30FC\u30B9{0}\u304C\u30B7\u30B9\u30C6\u30E0\u30FB\u30EA\u30BD\u30FC\u30B9\u3068\u3057\u3066\u691C\u51FA\u3055\u308C\u307E\u3057\u305F"},
-            {"appletpanel.runloader.err", "\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u307E\u305F\u306F\u30B3\u30FC\u30C9\u30FB\u30D1\u30E9\u30E1\u30FC\u30BF\u306E\u3044\u305A\u308C\u304B\u3067\u3059\u3002"},
-            {"appletpanel.runloader.exception", "{0}\u306E\u30C7\u30B7\u30EA\u30A2\u30E9\u30A4\u30BA\u4E2D\u306B\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
-            {"appletpanel.destroyed", "\u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u7834\u68C4\u3055\u308C\u307E\u3057\u305F\u3002"},
-            {"appletpanel.loaded", "\u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u30ED\u30FC\u30C9\u3055\u308C\u307E\u3057\u305F\u3002"},
-            {"appletpanel.started", "\u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u958B\u59CB\u3055\u308C\u307E\u3057\u305F\u3002"},
-            {"appletpanel.inited", "\u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u521D\u671F\u5316\u3055\u308C\u307E\u3057\u305F\u3002"},
-            {"appletpanel.stopped", "\u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u505C\u6B62\u3055\u308C\u307E\u3057\u305F\u3002"},
-            {"appletpanel.disposed", "\u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u7834\u68C4\u3055\u308C\u307E\u3057\u305F\u3002"},
-            {"appletpanel.nocode", "APPLET\u30BF\u30B0\u306BCODE\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-            {"appletpanel.notfound", "\u30ED\u30FC\u30C9: \u30AF\u30E9\u30B9{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"},
-            {"appletpanel.nocreate", "\u30ED\u30FC\u30C9: {0}\u3092\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3067\u304D\u307E\u305B\u3093\u3002"},
-            {"appletpanel.noconstruct", "\u30ED\u30FC\u30C9: {0}\u306Fpublic\u3067\u306A\u3044\u304B\u3001public\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u3092\u6301\u3063\u3066\u3044\u307E\u305B\u3093\u3002"},
-            {"appletpanel.death", "\u5F37\u5236\u7D42\u4E86\u3055\u308C\u307E\u3057\u305F"},
-            {"appletpanel.exception", "\u4F8B\u5916: {0}\u3002"},
-            {"appletpanel.exception2", "\u4F8B\u5916: {0}: {1}\u3002"},
-            {"appletpanel.error", "\u30A8\u30E9\u30FC: {0}\u3002"},
-            {"appletpanel.error2", "\u30A8\u30E9\u30FC: {0}: {1}\u3002"},
-            {"appletpanel.notloaded", "\u521D\u671F\u5316: \u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u30ED\u30FC\u30C9\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-            {"appletpanel.notinited", "\u958B\u59CB: \u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u521D\u671F\u5316\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-            {"appletpanel.notstarted", "\u505C\u6B62: \u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u958B\u59CB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-            {"appletpanel.notstopped", "\u7834\u68C4: \u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u505C\u6B62\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-            {"appletpanel.notdestroyed", "\u7834\u68C4: \u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u7834\u68C4\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-            {"appletpanel.notdisposed", "\u30ED\u30FC\u30C9: \u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u7834\u68C4\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-            {"appletpanel.bail", "\u4E2D\u65AD\u6E08: \u7D42\u4E86\u3057\u3066\u3044\u307E\u3059\u3002"},
-            {"appletpanel.filenotfound", "{0}\u306E\u691C\u7D22\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"},
-            {"appletpanel.fileformat", "{0}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
-            {"appletpanel.fileioexception", "{0}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B\u5165\u51FA\u529B\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
-            {"appletpanel.fileexception", "{1}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B{0}\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
-            {"appletpanel.filedeath", "{1}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B{0}\u304C\u5F37\u5236\u7D42\u4E86\u3057\u307E\u3057\u305F"},
-            {"appletpanel.fileerror", "{1}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B{0}\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
-            {"appletpanel.badattribute.exception", "HTML\u89E3\u6790: width\u307E\u305F\u306Fheight\u5C5E\u6027\u306E\u5024\u304C\u4E0D\u6B63\u3067\u3059"},
-            {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream\u306F\u975Enull\u306E\u30ED\u30FC\u30C0\u30FC\u304C\u5FC5\u8981\u3067\u3059"},
-            {"appletprops.title", "AppletViewer\u30D7\u30ED\u30D1\u30C6\u30A3"},
-            {"appletprops.label.http.server", "Http\u30D7\u30ED\u30AD\u30B7\u30FB\u30B5\u30FC\u30D0\u30FC:"},
-            {"appletprops.label.http.proxy", "Http\u30D7\u30ED\u30AD\u30B7\u30FB\u30DD\u30FC\u30C8:"},
-            {"appletprops.label.network", "\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30FB\u30A2\u30AF\u30BB\u30B9:"},
-            {"appletprops.choice.network.item.none", "\u306A\u3057"},
-            {"appletprops.choice.network.item.applethost", "\u30A2\u30D7\u30EC\u30C3\u30C8\u30FB\u30DB\u30B9\u30C8"},
-            {"appletprops.choice.network.item.unrestricted", "\u5236\u9650\u306A\u3057"},
-            {"appletprops.label.class", "\u30AF\u30E9\u30B9\u30FB\u30A2\u30AF\u30BB\u30B9:"},
-            {"appletprops.choice.class.item.restricted", "\u5236\u9650\u4ED8\u304D"},
-            {"appletprops.choice.class.item.unrestricted", "\u5236\u9650\u306A\u3057"},
-            {"appletprops.label.unsignedapplet", "\u7F72\u540D\u3055\u308C\u3066\u3044\u306A\u3044\u30A2\u30D7\u30EC\u30C3\u30C8\u3092\u8A31\u53EF:"},
-            {"appletprops.choice.unsignedapplet.no", "\u3044\u3044\u3048"},
-            {"appletprops.choice.unsignedapplet.yes", "\u306F\u3044"},
-            {"appletprops.button.apply", "\u9069\u7528"},
-            {"appletprops.button.cancel", "\u53D6\u6D88"},
-            {"appletprops.button.reset", "\u30EA\u30BB\u30C3\u30C8"},
-            {"appletprops.apply.exception", "\u30D7\u30ED\u30D1\u30C6\u30A3{0}\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F"},
-            /* 4066432 */
-            {"appletprops.title.invalidproxy", "\u30A8\u30F3\u30C8\u30EA\u304C\u7121\u52B9\u3067\u3059"},
-            {"appletprops.label.invalidproxy", "\u30D7\u30ED\u30AD\u30B7\u30FB\u30DD\u30FC\u30C8\u306F\u6B63\u306E\u6574\u6570\u5024\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
-            {"appletprops.button.ok", "OK"},
-            /* end 4066432 */
-            {"appletprops.prop.store", "AppletViewer\u7528\u306E\u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D7\u30ED\u30D1\u30C6\u30A3"},
-            {"appletsecurityexception.checkcreateclassloader", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30AF\u30E9\u30B9\u30ED\u30FC\u30C0\u30FC"},
-            {"appletsecurityexception.checkaccess.thread", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30B9\u30EC\u30C3\u30C9"},
-            {"appletsecurityexception.checkaccess.threadgroup", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30B9\u30EC\u30C3\u30C9\u30B0\u30EB\u30FC\u30D7: {0}"},
-            {"appletsecurityexception.checkexit", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u7D42\u4E86: {0}"},
-            {"appletsecurityexception.checkexec", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u5B9F\u884C: {0}"},
-            {"appletsecurityexception.checklink", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30EA\u30F3\u30AF: {0}"},
-            {"appletsecurityexception.checkpropsaccess", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30D7\u30ED\u30D1\u30C6\u30A3"},
-            {"appletsecurityexception.checkpropsaccess.key", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30A2\u30AF\u30BB\u30B9{0}"},
-            {"appletsecurityexception.checkread.exception1", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: {0}, {1}"},
-            {"appletsecurityexception.checkread.exception2", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: file.read: {0}"},
-            {"appletsecurityexception.checkread", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: file.read: {0} == {1}"},
-            {"appletsecurityexception.checkwrite.exception", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: {0}, {1}"},
-            {"appletsecurityexception.checkwrite", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: file.write: {0} == {1}"},
-            {"appletsecurityexception.checkread.fd", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: fd.read"},
-            {"appletsecurityexception.checkwrite.fd", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: fd.write"},
-            {"appletsecurityexception.checklisten", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: socket.listen: {0}"},
-            {"appletsecurityexception.checkaccept", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: socket.accept: {0}:{1}"},
-            {"appletsecurityexception.checkconnect.networknone", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: socket.connect: {0}->{1}"},
-            {"appletsecurityexception.checkconnect.networkhost1", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: {1}\u306E\u8D77\u70B9\u3092\u4F7F\u7528\u3057\u3066{0}\u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
-            {"appletsecurityexception.checkconnect.networkhost2", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30DB\u30B9\u30C8{0}\u307E\u305F\u306F{1}\u306EIP\u3092\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002 "},
-            {"appletsecurityexception.checkconnect.networkhost3", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30DB\u30B9\u30C8{0}\u306EIP\u3092\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002trustProxy\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-            {"appletsecurityexception.checkconnect", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u63A5\u7D9A: {0}->{1}"},
-            {"appletsecurityexception.checkpackageaccess", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093: {0}"},
-            {"appletsecurityexception.checkpackagedefinition", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u5B9A\u7FA9\u3067\u304D\u307E\u305B\u3093: {0}"},
-            {"appletsecurityexception.cannotsetfactory", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30D5\u30A1\u30AF\u30C8\u30EA\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093"},
-            {"appletsecurityexception.checkmemberaccess", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30E1\u30F3\u30D0\u30FC\u30FB\u30A2\u30AF\u30BB\u30B9\u306E\u78BA\u8A8D"},
-            {"appletsecurityexception.checkgetprintjob", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: getPrintJob"},
-            {"appletsecurityexception.checksystemclipboardaccess", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: getSystemClipboard"},
-            {"appletsecurityexception.checkawteventqueueaccess", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: getEventQueue"},
-            {"appletsecurityexception.checksecurityaccess", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u64CD\u4F5C: {0}"},
-            {"appletsecurityexception.getsecuritycontext.unknown", "\u4E0D\u660E\u306A\u30AF\u30E9\u30B9\u30ED\u30FC\u30C0\u30FC\u30FB\u30BF\u30A4\u30D7\u3067\u3059\u3002getContext\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093"},
-            {"appletsecurityexception.checkread.unknown", "\u4E0D\u660E\u306A\u30AF\u30E9\u30B9\u30ED\u30FC\u30C0\u30FC\u30FB\u30BF\u30A4\u30D7\u3067\u3059\u3002{0}\u306E\u8AAD\u53D6\u308A\u30C1\u30A7\u30C3\u30AF\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093"},
-            {"appletsecurityexception.checkconnect.unknown", "\u4E0D\u660E\u306A\u30AF\u30E9\u30B9\u30ED\u30FC\u30C0\u30FC\u30FB\u30BF\u30A4\u30D7\u3067\u3059\u3002\u63A5\u7D9A\u30C1\u30A7\u30C3\u30AF\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093"},
-        };
-
-        return temp;
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_ko.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.applet.resources;
-
-import java.util.ListResourceBundle;
-
-public class MsgAppletViewer_ko extends ListResourceBundle {
-
-    public Object[][] getContents() {
-        Object[][] temp = new Object[][] {
-            {"textframe.button.dismiss", "\uD574\uC81C"},
-            {"appletviewer.tool.title", "\uC560\uD50C\uB9BF \uBDF0\uC5B4: {0}"},
-            {"appletviewer.menu.applet", "\uC560\uD50C\uB9BF"},
-            {"appletviewer.menuitem.restart", "\uC7AC\uC2DC\uC791"},
-            {"appletviewer.menuitem.reload", "\uC7AC\uB85C\uB4DC"},
-            {"appletviewer.menuitem.stop", "\uC815\uC9C0"},
-            {"appletviewer.menuitem.save", "\uC800\uC7A5..."},
-            {"appletviewer.menuitem.start", "\uC2DC\uC791"},
-            {"appletviewer.menuitem.clone", "\uBCF5\uC81C..."},
-            {"appletviewer.menuitem.tag", "\uD0DC\uADF8 \uC9C0\uC815..."},
-            {"appletviewer.menuitem.info", "\uC815\uBCF4..."},
-            {"appletviewer.menuitem.edit", "\uD3B8\uC9D1"},
-            {"appletviewer.menuitem.encoding", "\uBB38\uC790 \uC778\uCF54\uB529"},
-            {"appletviewer.menuitem.print", "\uC778\uC1C4..."},
-            {"appletviewer.menuitem.props", "\uC18D\uC131..."},
-            {"appletviewer.menuitem.close", "\uB2EB\uAE30"},
-            {"appletviewer.menuitem.quit", "\uC885\uB8CC"},
-            {"appletviewer.label.hello", "\uC2DC\uC791..."},
-            {"appletviewer.status.start", "\uC560\uD50C\uB9BF\uC744 \uC2DC\uC791\uD558\uB294 \uC911..."},
-            {"appletviewer.appletsave.filedialogtitle","\uD30C\uC77C\uB85C \uC560\uD50C\uB9BF \uC9C1\uB82C\uD654"},
-            {"appletviewer.appletsave.err1", "{0}\uC744(\uB97C) {1}(\uC73C)\uB85C \uC9C1\uB82C\uD654\uD558\uB294 \uC911"},
-            {"appletviewer.appletsave.err2", "appletSave\uC5D0 \uC624\uB958 \uBC1C\uC0DD: {0}"},
-            {"appletviewer.applettag", "\uD0DC\uADF8\uAC00 \uD45C\uC2DC\uB428"},
-            {"appletviewer.applettag.textframe", "\uC560\uD50C\uB9BF HTML \uD0DC\uADF8"},
-            {"appletviewer.appletinfo.applet", "-- \uC560\uD50C\uB9BF \uC815\uBCF4 \uC5C6\uC74C --"},
-            {"appletviewer.appletinfo.param", "-- \uB9E4\uAC1C\uBCC0\uC218 \uC815\uBCF4 \uC5C6\uC74C --"},
-            {"appletviewer.appletinfo.textframe", "\uC560\uD50C\uB9BF \uC815\uBCF4"},
-            {"appletviewer.appletprint.fail", "\uC778\uC1C4\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."},
-            {"appletviewer.appletprint.finish", "\uC778\uC1C4\uB97C \uC644\uB8CC\uD588\uC2B5\uB2C8\uB2E4."},
-            {"appletviewer.appletprint.cancel", "\uC778\uC1C4\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-            {"appletviewer.appletencoding", "\uBB38\uC790 \uC778\uCF54\uB529: {0}"},
-            {"appletviewer.parse.warning.requiresname", "\uACBD\uACE0: <param name=... value=...> \uD0DC\uADF8\uC5D0\uB294 name \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},
-            {"appletviewer.parse.warning.paramoutside", "\uACBD\uACE0: <param> \uD0DC\uADF8\uAC00 <applet> ... </applet> \uBC16\uC5D0 \uC788\uC2B5\uB2C8\uB2E4."},
-            {"appletviewer.parse.warning.applet.requirescode", "\uACBD\uACE0: <applet> \uD0DC\uADF8\uC5D0\uB294 code \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},
-            {"appletviewer.parse.warning.applet.requiresheight", "\uACBD\uACE0: <applet> \uD0DC\uADF8\uC5D0\uB294 height \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},
-            {"appletviewer.parse.warning.applet.requireswidth", "\uACBD\uACE0: <applet> \uD0DC\uADF8\uC5D0\uB294 width \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},
-            {"appletviewer.parse.warning.object.requirescode", "\uACBD\uACE0: <object> \uD0DC\uADF8\uC5D0\uB294 code \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},
-            {"appletviewer.parse.warning.object.requiresheight", "\uACBD\uACE0: <object> \uD0DC\uADF8\uC5D0\uB294 height \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},
-            {"appletviewer.parse.warning.object.requireswidth", "\uACBD\uACE0: <object> \uD0DC\uADF8\uC5D0\uB294 width \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},
-            {"appletviewer.parse.warning.embed.requirescode", "\uACBD\uACE0: <embed> \uD0DC\uADF8\uC5D0\uB294 code \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},
-            {"appletviewer.parse.warning.embed.requiresheight", "\uACBD\uACE0: <embed> \uD0DC\uADF8\uC5D0\uB294 height \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},
-            {"appletviewer.parse.warning.embed.requireswidth", "\uACBD\uACE0: <embed> \uD0DC\uADF8\uC5D0\uB294 width \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},
-            {"appletviewer.parse.warning.appnotLongersupported", "\uACBD\uACE0: <app> \uD0DC\uADF8\uB294 \uB354 \uC774\uC0C1 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uB300\uC2E0 <applet>\uC744 \uC0AC\uC6A9\uD558\uC2ED\uC2DC\uC624."},
-            {"appletviewer.deprecated", "\uACBD\uACE0: \uC560\uD50C\uB9BF API \uBC0F AppletViewer\uAC00 \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-            {"appletviewer.usage", "\uC0AC\uC6A9\uBC95: appletviewer <options> url(s)\n\n\uC5EC\uAE30\uC11C <options>\uB294 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4.\n  -encoding <encoding>    HTML \uD30C\uC77C\uC5D0 \uC0AC\uC6A9\uB420 \uBB38\uC790 \uC778\uCF54\uB529\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n  -J<runtime flag>        Java \uC778\uD130\uD504\uB9AC\uD130\uB85C \uC778\uC218\uB97C \uC804\uB2EC\uD569\uB2C8\uB2E4.\n\n-J \uC635\uC158\uC740 \uD45C\uC900\uC774 \uC544\uB2C8\uBA70 \uC608\uACE0 \uC5C6\uC774 \uBCC0\uACBD\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4."},
-            {"appletviewer.main.err.unsupportedopt", "\uC9C0\uC6D0\uB418\uC9C0 \uC54A\uB294 \uC635\uC158: {0}"},
-            {"appletviewer.main.err.unrecognizedarg", "\uC54C \uC218 \uC5C6\uB294 \uC778\uC218: {0}"},
-            {"appletviewer.main.err.dupoption", "\uC911\uBCF5\uB41C \uC635\uC158 \uC0AC\uC6A9: {0}"},
-            {"appletviewer.main.err.inputfile", "\uC9C0\uC815\uB41C \uC785\uB825 \uD30C\uC77C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},
-            {"appletviewer.main.err.badurl", "\uC798\uBABB\uB41C URL: {0}({1})"},
-            {"appletviewer.main.err.io", "\uC77D\uB294 \uC911 I/O \uC608\uC678\uC0AC\uD56D \uBC1C\uC0DD: {0}"},
-            {"appletviewer.main.err.readablefile", "{0}\uC774(\uAC00) \uD30C\uC77C\uC774\uBA70 \uC77D\uAE30 \uAC00\uB2A5\uD55C \uC0C1\uD0DC\uC778\uC9C0 \uD655\uC778\uD558\uC2ED\uC2DC\uC624."},
-            {"appletviewer.main.err.correcturl", "{0}\uC774(\uAC00) \uC62C\uBC14\uB978 URL\uC785\uB2C8\uAE4C?"},
-            {"appletviewer.main.prop.store", "\uC0AC\uC6A9\uC790 \uAD00\uB828 AppletViewer \uC18D\uC131"},
-            {"appletviewer.main.err.prop.cantread", "\uC0AC\uC6A9\uC790 \uC18D\uC131 \uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC74C: {0}"},
-            {"appletviewer.main.err.prop.cantsave", "\uC0AC\uC6A9\uC790 \uC18D\uC131 \uD30C\uC77C\uC744 \uC800\uC7A5\uD560 \uC218 \uC5C6\uC74C: {0}"},
-            {"appletviewer.main.warn.nosecmgr", "\uACBD\uACE0: \uBCF4\uC548\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD558\uB294 \uC911\uC785\uB2C8\uB2E4."},
-            {"appletviewer.main.debug.cantfinddebug", "\uB514\uBC84\uAC70\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-            {"appletviewer.main.debug.cantfindmain", "\uB514\uBC84\uAC70\uC5D0\uC11C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-            {"appletviewer.main.debug.exceptionindebug", "\uB514\uBC84\uAC70\uC5D0 \uC608\uC678\uC0AC\uD56D\uC774 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4!"},
-            {"appletviewer.main.debug.cantaccess", "\uB514\uBC84\uAC70\uC5D0 \uC561\uC138\uC2A4\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-            {"appletviewer.main.nosecmgr", "\uACBD\uACE0: SecurityManager\uAC00 \uC124\uCE58\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4!"},
-            {"appletviewer.main.warning", "\uACBD\uACE0: \uC2DC\uC791\uB41C \uC560\uD50C\uB9BF\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. <applet> \uD0DC\uADF8\uAC00 \uC785\uB825\uB418\uC5C8\uB294\uC9C0 \uD655\uC778\uD558\uC2ED\uC2DC\uC624."},
-            {"appletviewer.main.warn.prop.overwrite", "\uACBD\uACE0: \uC0AC\uC6A9\uC790\uC758 \uC694\uCCAD\uC5D0 \uB530\uB77C \uC77C\uC2DC\uC801\uC73C\uB85C \uC2DC\uC2A4\uD15C \uC18D\uC131\uC744 \uACB9\uCCD0 \uC4F0\uB294 \uC911: \uD0A4: {0}, \uC774\uC804 \uAC12: {1}, \uC0C8 \uAC12: {2}"},
-            {"appletviewer.main.warn.cantreadprops", "\uACBD\uACE0: AppletViewer \uC18D\uC131 \uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC74C: {0}. \uAE30\uBCF8\uAC12\uC744 \uC0AC\uC6A9\uD558\uB294 \uC911\uC785\uB2C8\uB2E4."},
-            {"appletioexception.loadclass.throw.interrupted", "\uD074\uB798\uC2A4 \uB85C\uB4DC\uAC00 \uC911\uB2E8\uB428: {0}"},
-            {"appletioexception.loadclass.throw.notloaded", "\uD074\uB798\uC2A4\uAC00 \uB85C\uB4DC\uB418\uC9C0 \uC54A\uC74C: {0}"},
-            {"appletclassloader.loadcode.verbose", "{1}\uC744(\uB97C) \uAC00\uC838\uC624\uAE30 \uC704\uD574 {0}\uC5D0 \uB300\uD55C \uC2A4\uD2B8\uB9BC\uC744 \uC5EC\uB294 \uC911"},
-            {"appletclassloader.filenotfound", "{0}\uC744(\uB97C) \uAC80\uC0C9\uD558\uB294 \uC911 \uD30C\uC77C\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."},
-            {"appletclassloader.fileformat", "\uB85C\uB4DC \uC911 \uD30C\uC77C \uD615\uC2DD \uC608\uC678\uC0AC\uD56D \uBC1C\uC0DD: {0}"},
-            {"appletclassloader.fileioexception", "\uB85C\uB4DC \uC911 I/O \uC608\uC678\uC0AC\uD56D \uBC1C\uC0DD: {0}"},
-            {"appletclassloader.fileexception", "\uB85C\uB4DC \uC911 {0} \uC608\uC678\uC0AC\uD56D \uBC1C\uC0DD: {1}"},
-            {"appletclassloader.filedeath", "\uB85C\uB4DC \uC911 {0}\uC774(\uAC00) \uC885\uB8CC\uB428: {1}"},
-            {"appletclassloader.fileerror", "\uB85C\uB4DC \uC911 {0} \uC624\uB958 \uBC1C\uC0DD: {1}"},
-            {"appletclassloader.findclass.verbose.openstream", "{1}\uC744(\uB97C) \uAC00\uC838\uC624\uAE30 \uC704\uD574 {0}\uC5D0 \uB300\uD55C \uC2A4\uD2B8\uB9BC\uC744 \uC5EC\uB294 \uC911"},
-            {"appletclassloader.getresource.verbose.forname", "\uC774\uB984\uC5D0 \uB300\uD55C AppletClassLoader.getResource: {0}"},
-            {"appletclassloader.getresource.verbose.found", "\uC2DC\uC2A4\uD15C \uB9AC\uC18C\uC2A4\uB85C {0} \uB9AC\uC18C\uC2A4\uB97C \uCC3E\uC558\uC2B5\uB2C8\uB2E4."},
-            {"appletclassloader.getresourceasstream.verbose", "\uC2DC\uC2A4\uD15C \uB9AC\uC18C\uC2A4\uB85C {0} \uB9AC\uC18C\uC2A4\uB97C \uCC3E\uC558\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.runloader.err", "\uAC1D\uCCB4 \uB610\uB294 \uCF54\uB4DC \uB9E4\uAC1C\uBCC0\uC218\uC785\uB2C8\uB2E4!"},
-            {"appletpanel.runloader.exception", "{0}\uC758 \uC9C1\uB82C\uD654\uB97C \uD574\uC81C\uD558\uB294 \uC911 \uC608\uC678\uC0AC\uD56D\uC774 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.destroyed", "\uC560\uD50C\uB9BF\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.loaded", "\uC560\uD50C\uB9BF\uC774 \uB85C\uB4DC\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.started", "\uC560\uD50C\uB9BF\uC774 \uC2DC\uC791\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.inited", "\uC560\uD50C\uB9BF\uC774 \uCD08\uAE30\uD654\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.stopped", "\uC560\uD50C\uB9BF\uC774 \uC815\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.disposed", "\uC560\uD50C\uB9BF\uC774 \uBC30\uCE58\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.nocode", "APPLET \uD0DC\uADF8\uC5D0 CODE \uB9E4\uAC1C\uBCC0\uC218\uAC00 \uB204\uB77D\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.notfound", "\uB85C\uB4DC: {0} \uD074\uB798\uC2A4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.nocreate", "\uB85C\uB4DC: {0}\uC744(\uB97C) \uC778\uC2A4\uD134\uC2A4\uD654\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.noconstruct", "\uB85C\uB4DC: {0}\uC740(\uB294) \uACF5\uC6A9\uC774 \uC544\uB2C8\uAC70\uB098 \uACF5\uC6A9 \uC0DD\uC131\uC790\uB97C \uD3EC\uD568\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.death", "\uC885\uB8CC\uB428"},
-            {"appletpanel.exception", "\uC608\uC678\uC0AC\uD56D: {0}."},
-            {"appletpanel.exception2", "\uC608\uC678\uC0AC\uD56D: {0}: {1}."},
-            {"appletpanel.error", "\uC624\uB958: {0}."},
-            {"appletpanel.error2", "\uC624\uB958: {0}: {1}."},
-            {"appletpanel.notloaded", "\uCD08\uAE30\uD654: \uC560\uD50C\uB9BF\uC774 \uB85C\uB4DC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.notinited", "\uC2DC\uC791: \uC560\uD50C\uB9BF\uC774 \uCD08\uAE30\uD654\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.notstarted", "\uC815\uC9C0: \uC560\uD50C\uB9BF\uC774 \uC2DC\uC791\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.notstopped", "\uC0AD\uC81C: \uC560\uD50C\uB9BF\uC774 \uC815\uC9C0\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.notdestroyed", "\uBC30\uCE58: \uC560\uD50C\uB9BF\uC774 \uC0AD\uC81C\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.notdisposed", "\uB85C\uB4DC: \uC560\uD50C\uB9BF\uC774 \uBC30\uCE58\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.bail", "\uC911\uB2E8\uB428: \uC911\uB2E8\uD558\uB294 \uC911\uC785\uB2C8\uB2E4."},
-            {"appletpanel.filenotfound", "{0}\uC744(\uB97C) \uAC80\uC0C9\uD558\uB294 \uC911 \uD30C\uC77C\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."},
-            {"appletpanel.fileformat", "\uB85C\uB4DC \uC911 \uD30C\uC77C \uD615\uC2DD \uC608\uC678\uC0AC\uD56D \uBC1C\uC0DD: {0}"},
-            {"appletpanel.fileioexception", "\uB85C\uB4DC \uC911 I/O \uC608\uC678\uC0AC\uD56D \uBC1C\uC0DD: {0}"},
-            {"appletpanel.fileexception", "\uB85C\uB4DC \uC911 {0} \uC608\uC678\uC0AC\uD56D \uBC1C\uC0DD: {1}"},
-            {"appletpanel.filedeath", "\uB85C\uB4DC \uC911 {0}\uC774(\uAC00) \uC885\uB8CC\uB428: {1}"},
-            {"appletpanel.fileerror", "\uB85C\uB4DC \uC911 {0} \uC624\uB958 \uBC1C\uC0DD: {1}"},
-            {"appletpanel.badattribute.exception", "HTML \uAD6C\uBB38\uBD84\uC11D \uC911: width/height \uC18D\uC131\uC5D0 \uB300\uD55C \uAC12\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-            {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream\uC5D0 \uB110\uC774 \uC544\uB2CC \uB85C\uB354\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4."},
-            {"appletprops.title", "AppletViewer \uC18D\uC131"},
-            {"appletprops.label.http.server", "HTTP \uD504\uB85D\uC2DC \uC11C\uBC84:"},
-            {"appletprops.label.http.proxy", "HTTP \uD504\uB85D\uC2DC \uD3EC\uD2B8:"},
-            {"appletprops.label.network", "\uB124\uD2B8\uC6CC\uD06C \uC561\uC138\uC2A4:"},
-            {"appletprops.choice.network.item.none", "\uC5C6\uC74C"},
-            {"appletprops.choice.network.item.applethost", "\uC560\uD50C\uB9BF \uD638\uC2A4\uD2B8"},
-            {"appletprops.choice.network.item.unrestricted", "\uC81C\uD55C\uB418\uC9C0 \uC54A\uC74C"},
-            {"appletprops.label.class", "\uD074\uB798\uC2A4 \uC561\uC138\uC2A4:"},
-            {"appletprops.choice.class.item.restricted", "\uC81C\uD55C\uB428"},
-            {"appletprops.choice.class.item.unrestricted", "\uC81C\uD55C\uB418\uC9C0 \uC54A\uC74C"},
-            {"appletprops.label.unsignedapplet", "\uC11C\uBA85\uB418\uC9C0 \uC54A\uC740 \uC560\uD50C\uB9BF \uD5C8\uC6A9:"},
-            {"appletprops.choice.unsignedapplet.no", "\uC544\uB2C8\uC624"},
-            {"appletprops.choice.unsignedapplet.yes", "\uC608"},
-            {"appletprops.button.apply", "\uC801\uC6A9"},
-            {"appletprops.button.cancel", "\uCDE8\uC18C"},
-            {"appletprops.button.reset", "\uC7AC\uC124\uC815"},
-            {"appletprops.apply.exception", "\uC18D\uC131 \uC800\uC7A5 \uC2E4\uD328: {0}"},
-            /* 4066432 */
-            {"appletprops.title.invalidproxy", "\uBD80\uC801\uD569\uD55C \uD56D\uBAA9"},
-            {"appletprops.label.invalidproxy", "\uD504\uB85D\uC2DC \uD3EC\uD2B8\uB294 \uC591\uC758 \uC815\uC218 \uAC12\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-            {"appletprops.button.ok", "\uD655\uC778"},
-            /* end 4066432 */
-            {"appletprops.prop.store", "\uC0AC\uC6A9\uC790 \uAD00\uB828 AppletViewer \uC18D\uC131"},
-            {"appletsecurityexception.checkcreateclassloader", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uD074\uB798\uC2A4 \uB85C\uB354"},
-            {"appletsecurityexception.checkaccess.thread", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uC2A4\uB808\uB4DC"},
-            {"appletsecurityexception.checkaccess.threadgroup", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uC2A4\uB808\uB4DC \uADF8\uB8F9: {0}"},
-            {"appletsecurityexception.checkexit", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uC885\uB8CC: {0}"},
-            {"appletsecurityexception.checkexec", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uC2E4\uD589: {0}"},
-            {"appletsecurityexception.checklink", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uB9C1\uD06C: {0}"},
-            {"appletsecurityexception.checkpropsaccess", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uC18D\uC131"},
-            {"appletsecurityexception.checkpropsaccess.key", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uC18D\uC131 \uC561\uC138\uC2A4 {0}"},
-            {"appletsecurityexception.checkread.exception1", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: {0}, {1}"},
-            {"appletsecurityexception.checkread.exception2", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: file.read: {0}"},
-            {"appletsecurityexception.checkread", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: file.read: {0} == {1}"},
-            {"appletsecurityexception.checkwrite.exception", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: {0}, {1}"},
-            {"appletsecurityexception.checkwrite", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: file.write: {0} == {1}"},
-            {"appletsecurityexception.checkread.fd", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: fd.read"},
-            {"appletsecurityexception.checkwrite.fd", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: fd.write"},
-            {"appletsecurityexception.checklisten", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: socket.listen: {0}"},
-            {"appletsecurityexception.checkaccept", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: socket.accept: {0}:{1}"},
-            {"appletsecurityexception.checkconnect.networknone", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: socket.connect: {0}->{1}"},
-            {"appletsecurityexception.checkconnect.networkhost1", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: {1}\uC5D0\uC11C {0}\uC5D0 \uC811\uC18D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-            {"appletsecurityexception.checkconnect.networkhost2", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: {0} \uD638\uC2A4\uD2B8 \uB610\uB294 {1}\uC5D0 \uB300\uD55C IP\uB97C \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. "},
-            {"appletsecurityexception.checkconnect.networkhost3", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: {0} \uD638\uC2A4\uD2B8\uC5D0 \uB300\uD55C IP\uB97C \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. trustProxy \uC18D\uC131\uC744 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624."},
-            {"appletsecurityexception.checkconnect", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uC811\uC18D: {0}->{1}"},
-            {"appletsecurityexception.checkpackageaccess", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uD328\uD0A4\uC9C0\uC5D0 \uC561\uC138\uC2A4\uD560 \uC218 \uC5C6\uC74C: {0}"},
-            {"appletsecurityexception.checkpackagedefinition", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uD328\uD0A4\uC9C0\uB97C \uC815\uC758\uD560 \uC218 \uC5C6\uC74C: {0}"},
-            {"appletsecurityexception.cannotsetfactory", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uD329\uD1A0\uB9AC\uB97C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-            {"appletsecurityexception.checkmemberaccess", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uBA64\uBC84 \uC561\uC138\uC2A4\uB97C \uD655\uC778\uD558\uC2ED\uC2DC\uC624."},
-            {"appletsecurityexception.checkgetprintjob", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: getPrintJob"},
-            {"appletsecurityexception.checksystemclipboardaccess", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: getSystemClipboard"},
-            {"appletsecurityexception.checkawteventqueueaccess", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: getEventQueue"},
-            {"appletsecurityexception.checksecurityaccess", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uBCF4\uC548 \uC791\uC5C5: {0}"},
-            {"appletsecurityexception.getsecuritycontext.unknown", "\uC54C \uC218 \uC5C6\uB294 \uD074\uB798\uC2A4 \uB85C\uB354 \uC720\uD615\uC785\uB2C8\uB2E4. getContext\uB97C \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-            {"appletsecurityexception.checkread.unknown", "\uC54C \uC218 \uC5C6\uB294 \uD074\uB798\uC2A4 \uB85C\uB354 \uC720\uD615\uC785\uB2C8\uB2E4. {0} \uC77D\uAE30\uB97C \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-            {"appletsecurityexception.checkconnect.unknown", "\uC54C \uC218 \uC5C6\uB294 \uD074\uB798\uC2A4 \uB85C\uB354 \uC720\uD615\uC785\uB2C8\uB2E4. \uC811\uC18D\uC744 \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        };
-
-        return temp;
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_pt_BR.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.applet.resources;
-
-import java.util.ListResourceBundle;
-
-public class MsgAppletViewer_pt_BR extends ListResourceBundle {
-
-    public Object[][] getContents() {
-        Object[][] temp = new Object[][] {
-            {"textframe.button.dismiss", "Rejeitar"},
-            {"appletviewer.tool.title", "Visualizador do Applet: {0}"},
-            {"appletviewer.menu.applet", "Applet"},
-            {"appletviewer.menuitem.restart", "Reiniciar"},
-            {"appletviewer.menuitem.reload", "Recarregar"},
-            {"appletviewer.menuitem.stop", "Interromper"},
-            {"appletviewer.menuitem.save", "Salvar"},
-            {"appletviewer.menuitem.start", "Iniciar"},
-            {"appletviewer.menuitem.clone", "Clonar..."},
-            {"appletviewer.menuitem.tag", "Tag..."},
-            {"appletviewer.menuitem.info", "Informa\u00E7\u00F5es..."},
-            {"appletviewer.menuitem.edit", "Editar"},
-            {"appletviewer.menuitem.encoding", "Codifica\u00E7\u00E3o do Caractere"},
-            {"appletviewer.menuitem.print", "Imprimir..."},
-            {"appletviewer.menuitem.props", "Propriedades..."},
-            {"appletviewer.menuitem.close", "Fechar"},
-            {"appletviewer.menuitem.quit", "Sair"},
-            {"appletviewer.label.hello", "Ol\u00E1..."},
-            {"appletviewer.status.start", "iniciando o applet..."},
-            {"appletviewer.appletsave.filedialogtitle","Serializar Applet no Arquivo"},
-            {"appletviewer.appletsave.err1", "serializando um {0} para {1}"},
-            {"appletviewer.appletsave.err2", "no appletSave: {0}"},
-            {"appletviewer.applettag", "Tag mostrada"},
-            {"appletviewer.applettag.textframe", "Tag HTML do Applet"},
-            {"appletviewer.appletinfo.applet", "-- nenhuma informa\u00E7\u00E3o do applet --"},
-            {"appletviewer.appletinfo.param", "-- sem informa\u00E7\u00E3o de par\u00E2metro --"},
-            {"appletviewer.appletinfo.textframe", "Informa\u00E7\u00F5es do Applet"},
-            {"appletviewer.appletprint.fail", "Falha na impress\u00E3o."},
-            {"appletviewer.appletprint.finish", "Impress\u00E3o finalizada."},
-            {"appletviewer.appletprint.cancel", "Impress\u00E3o cancelada."},
-            {"appletviewer.appletencoding", "Codifica\u00E7\u00E3o de Caractere: {0}"},
-            {"appletviewer.parse.warning.requiresname", "Advert\u00EAncia: a tag <param name=... value=...> requer um atributo de nome."},
-            {"appletviewer.parse.warning.paramoutside", "Advert\u00EAncia: a tag <param> externa <applet> ... </applet>."},
-            {"appletviewer.parse.warning.applet.requirescode", "Advert\u00EAncia: a tag <applet> requer um atributo de c\u00F3digo."},
-            {"appletviewer.parse.warning.applet.requiresheight", "Advert\u00EAncia: a tag <applet> requer um atributo de altura."},
-            {"appletviewer.parse.warning.applet.requireswidth", "Advert\u00EAncia: a tag <applet> requer um atributo de largura."},
-            {"appletviewer.parse.warning.object.requirescode", "Advert\u00EAncia: a tag <object> requer um atributo de c\u00F3digo."},
-            {"appletviewer.parse.warning.object.requiresheight", "Advert\u00EAncia: a tag <object> requer um atributo de altura."},
-            {"appletviewer.parse.warning.object.requireswidth", "Advert\u00EAncia: a tag <object> requer um atributo de largura."},
-            {"appletviewer.parse.warning.embed.requirescode", "Advert\u00EAncia: a tag <embed> requer um atributo de c\u00F3digo."},
-            {"appletviewer.parse.warning.embed.requiresheight", "Advert\u00EAncia: a tag <embed> requer um atributo de altura."},
-            {"appletviewer.parse.warning.embed.requireswidth", "Advert\u00EAncia: a tag <embed> requer um atributo de largura."},
-            {"appletviewer.parse.warning.appnotLongersupported", "Advert\u00EAncia: a tag <app> n\u00E3o \u00E9 mais suportada; use <applet>:"},
-            {"appletviewer.deprecated", "Advert\u00EAncia: A API do e o AppletViewer est\u00E3o obsoletos."},
-            {"appletviewer.usage", "Uso: appletviewer <op\u00E7\u00F5es> url(s)\n\nem que as <op\u00E7\u00F5es> incluem:\n  -encoding <codifica\u00E7\u00E3o>    Especifica a codifica\u00E7\u00E3o de caractere usada pelos arquivos HTML\n  -J<flag de runtime>        Informa o argumento ao intepretador java\n\nA op\u00E7\u00E3o -J n\u00E3o \u00E9 padr\u00E3o e est\u00E1 sujeita \u00E0 altera\u00E7\u00E3o sem notifica\u00E7\u00E3o."},
-            {"appletviewer.main.err.unsupportedopt", "Op\u00E7\u00E3o n\u00E3o suportada: {0}"},
-            {"appletviewer.main.err.unrecognizedarg", "Argumento n\u00E3o reconhecido: {0}"},
-            {"appletviewer.main.err.dupoption", "Uso duplicado da op\u00E7\u00E3o: {0}"},
-            {"appletviewer.main.err.inputfile", "Nenhum arquivo de entrada especificado."},
-            {"appletviewer.main.err.badurl", "URL Inv\u00E1lido: {0} ( {1} )"},
-            {"appletviewer.main.err.io", "Exce\u00E7\u00E3o de E/S ao ler: {0}"},
-            {"appletviewer.main.err.readablefile", "Certifique-se de que {0} seja um arquivo e seja leg\u00EDvel."},
-            {"appletviewer.main.err.correcturl", "O URL {0} est\u00E1 correto?"},
-            {"appletviewer.main.prop.store", "Propriedades espec\u00EDficas do usu\u00E1rio do AppletViewer"},
-            {"appletviewer.main.err.prop.cantread", "N\u00E3o \u00E9 poss\u00EDvel ler o arquivo de propriedades do usu\u00E1rio: {0}"},
-            {"appletviewer.main.err.prop.cantsave", "N\u00E3o \u00E9 poss\u00EDvel salvar o arquivo de propriedades do usu\u00E1rio: {0}"},
-            {"appletviewer.main.warn.nosecmgr", "Advert\u00EAncia: desativando a seguran\u00E7a."},
-            {"appletviewer.main.debug.cantfinddebug", "N\u00E3o \u00E9 poss\u00EDvel localizar o depurador!"},
-            {"appletviewer.main.debug.cantfindmain", "N\u00E3o \u00E9 poss\u00EDvel localizar o m\u00E9todo main no depurador!"},
-            {"appletviewer.main.debug.exceptionindebug", "Exce\u00E7\u00E3o no depurador!"},
-            {"appletviewer.main.debug.cantaccess", "N\u00E3o \u00E9 poss\u00EDvel acessar o depurador!"},
-            {"appletviewer.main.nosecmgr", "Advert\u00EAncia: SecurityManager n\u00E3o instalado!"},
-            {"appletviewer.main.warning", "Advert\u00EAncia: Nenhum applet iniciado. Certifique-se de que a entrada contenha uma tag <applet>."},
-            {"appletviewer.main.warn.prop.overwrite", "Advert\u00EAncia: Substituindo a propriedade do sistema temporariamente a pedido do usu\u00E1rio: chave: {0} valor antigo: {1} valor novo: {2}"},
-            {"appletviewer.main.warn.cantreadprops", "Advert\u00EAncia: N\u00E3o \u00E9 poss\u00EDvel ler o arquivo de propriedades AppletViewer: {0} Usando padr\u00F5es."},
-            {"appletioexception.loadclass.throw.interrupted", "carregamento de classe interrompido: {0}"},
-            {"appletioexception.loadclass.throw.notloaded", "classe n\u00E3o carregada: {0}"},
-            {"appletclassloader.loadcode.verbose", "Fluxo de abertura para: {0} para obter {1}"},
-            {"appletclassloader.filenotfound", "Arquivo n\u00E3o encontrado ao procurar: {0}"},
-            {"appletclassloader.fileformat", "Exce\u00E7\u00E3o de formato do arquivo ao carregar: {0}"},
-            {"appletclassloader.fileioexception", "Exce\u00E7\u00E3o de E/S ao carregar: {0}"},
-            {"appletclassloader.fileexception", "exce\u00E7\u00E3o de {0} ao carregar: {1}"},
-            {"appletclassloader.filedeath", "{0} eliminado ao carregar: {1}"},
-            {"appletclassloader.fileerror", "erro de {0} ao carregar: {1}"},
-            {"appletclassloader.findclass.verbose.openstream", "Fluxo de abertura para: {0} para obter {1}"},
-            {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource do nome: {0}"},
-            {"appletclassloader.getresource.verbose.found", "Recurso encontrado: {0} como um recurso do sistema"},
-            {"appletclassloader.getresourceasstream.verbose", "Recurso encontrado: {0} como um recurso do sistema"},
-            {"appletpanel.runloader.err", "Par\u00E2metro de c\u00F3digo ou objeto!"},
-            {"appletpanel.runloader.exception", "exce\u00E7\u00E3o ao desserializar {0}"},
-            {"appletpanel.destroyed", "Applet destru\u00EDdo."},
-            {"appletpanel.loaded", "Applet carregado."},
-            {"appletpanel.started", "Applet iniciado."},
-            {"appletpanel.inited", "Applet inicializado."},
-            {"appletpanel.stopped", "Applet interrompido."},
-            {"appletpanel.disposed", "Applet descartado."},
-            {"appletpanel.nocode", "A tag APPLET n\u00E3o encontrou o par\u00E2metro CODE."},
-            {"appletpanel.notfound", "carga: classe {0} n\u00E3o encontrada."},
-            {"appletpanel.nocreate", "carga: {0} n\u00E3o pode ser instanciada."},
-            {"appletpanel.noconstruct", "carga: {0} n\u00E3o \u00E9 p\u00FAblica ou n\u00E3o tem construtor p\u00FAblico."},
-            {"appletpanel.death", "eliminado"},
-            {"appletpanel.exception", "exce\u00E7\u00E3o: {0}."},
-            {"appletpanel.exception2", "exce\u00E7\u00E3o: {0}: {1}."},
-            {"appletpanel.error", "erro: {0}."},
-            {"appletpanel.error2", "erro: {0}: {1}."},
-            {"appletpanel.notloaded", "Inic: applet n\u00E3o carregado."},
-            {"appletpanel.notinited", "Iniciar: applet n\u00E3o inicializado."},
-            {"appletpanel.notstarted", "Interromper: applet n\u00E3o inicializado."},
-            {"appletpanel.notstopped", "Destruir: applet n\u00E3o interrompido."},
-            {"appletpanel.notdestroyed", "Descartar: applet n\u00E3o destru\u00EDdo."},
-            {"appletpanel.notdisposed", "Carregar: applet n\u00E3o descartado."},
-            {"appletpanel.bail", "Interrompido: esvaziando."},
-            {"appletpanel.filenotfound", "Arquivo n\u00E3o encontrado ao procurar: {0}"},
-            {"appletpanel.fileformat", "Exce\u00E7\u00E3o de formato do arquivo ao carregar: {0}"},
-            {"appletpanel.fileioexception", "Exce\u00E7\u00E3o de E/S ao carregar: {0}"},
-            {"appletpanel.fileexception", "exce\u00E7\u00E3o de {0} ao carregar: {1}"},
-            {"appletpanel.filedeath", "{0} eliminado ao carregar: {1}"},
-            {"appletpanel.fileerror", "erro de {0} ao carregar: {1}"},
-            {"appletpanel.badattribute.exception", "Parsing de HTML: valor incorreto do atributo de largura/altura"},
-            {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream requer um carregador n\u00E3o nulo"},
-            {"appletprops.title", "Propriedades do AppletViewer"},
-            {"appletprops.label.http.server", "Servidor proxy Http:"},
-            {"appletprops.label.http.proxy", "Porta proxy Http:"},
-            {"appletprops.label.network", "Acesso de rede:"},
-            {"appletprops.choice.network.item.none", "Nenhum"},
-            {"appletprops.choice.network.item.applethost", "Host do Applet"},
-            {"appletprops.choice.network.item.unrestricted", "Irrestrito"},
-            {"appletprops.label.class", "Acesso \u00E0 classe:"},
-            {"appletprops.choice.class.item.restricted", "Restrito"},
-            {"appletprops.choice.class.item.unrestricted", "Irrestrito"},
-            {"appletprops.label.unsignedapplet", "Permitir applets n\u00E3o assinados:"},
-            {"appletprops.choice.unsignedapplet.no", "N\u00E3o"},
-            {"appletprops.choice.unsignedapplet.yes", "Sim"},
-            {"appletprops.button.apply", "Aplicar"},
-            {"appletprops.button.cancel", "Cancelar"},
-            {"appletprops.button.reset", "Redefinir"},
-            {"appletprops.apply.exception", "Falha ao salvar as propriedades: {0}"},
-            /* 4066432 */
-            {"appletprops.title.invalidproxy", "Entrada Inv\u00E1lida"},
-            {"appletprops.label.invalidproxy", "A Porta Proxy deve ser um valor inteiro positivo."},
-            {"appletprops.button.ok", "OK"},
-            /* end 4066432 */
-            {"appletprops.prop.store", "Propriedades espec\u00EDficas do usu\u00E1rio do AppletViewer"},
-            {"appletsecurityexception.checkcreateclassloader", "Exce\u00E7\u00E3o de Seguran\u00E7a: carregador de classes"},
-            {"appletsecurityexception.checkaccess.thread", "Exce\u00E7\u00E3o de Seguran\u00E7a: thread"},
-            {"appletsecurityexception.checkaccess.threadgroup", "Exce\u00E7\u00E3o de Seguran\u00E7a: grupo de threads: {0}"},
-            {"appletsecurityexception.checkexit", "Exce\u00E7\u00E3o de Seguran\u00E7a: sa\u00EDda: {0}"},
-            {"appletsecurityexception.checkexec", "Exce\u00E7\u00E3o de Seguran\u00E7a: exec.: {0}"},
-            {"appletsecurityexception.checklink", "Exce\u00E7\u00E3o de Seguran\u00E7a: link: {0}"},
-            {"appletsecurityexception.checkpropsaccess", "Exce\u00E7\u00E3o de Seguran\u00E7a: propriedades"},
-            {"appletsecurityexception.checkpropsaccess.key", "Exce\u00E7\u00E3o de Seguran\u00E7a: acesso \u00E0s propriedades {0}"},
-            {"appletsecurityexception.checkread.exception1", "Exce\u00E7\u00E3o de Seguran\u00E7a: {0}, {1}"},
-            {"appletsecurityexception.checkread.exception2", "Exce\u00E7\u00E3o de Seguran\u00E7a: file.read: {0}"},
-            {"appletsecurityexception.checkread", "Exce\u00E7\u00E3o de Seguran\u00E7a: file.read: {0} == {1}"},
-            {"appletsecurityexception.checkwrite.exception", "Exce\u00E7\u00E3o de Seguran\u00E7a: {0}, {1}"},
-            {"appletsecurityexception.checkwrite", "Exce\u00E7\u00E3o de Seguran\u00E7a: file.write: {0} == {1}"},
-            {"appletsecurityexception.checkread.fd", "Exce\u00E7\u00E3o de Seguran\u00E7a: fd.read"},
-            {"appletsecurityexception.checkwrite.fd", "Exce\u00E7\u00E3o de Seguran\u00E7a: fd.write"},
-            {"appletsecurityexception.checklisten", "Exce\u00E7\u00E3o de Seguran\u00E7a: socket.listen: {0}"},
-            {"appletsecurityexception.checkaccept", "Exce\u00E7\u00E3o de Seguran\u00E7a: socket.accept: {0}:{1}"},
-            {"appletsecurityexception.checkconnect.networknone", "Exce\u00E7\u00E3o de Seguran\u00E7a: socket.connect: {0}->{1}"},
-            {"appletsecurityexception.checkconnect.networkhost1", "Exce\u00E7\u00E3o de Seguran\u00E7a: N\u00E3o foi poss\u00EDvel estabelecer conex\u00E3o com {0} com a origem de {1}."},
-            {"appletsecurityexception.checkconnect.networkhost2", "Exce\u00E7\u00E3o de Seguran\u00E7a: N\u00E3o foi poss\u00EDvel resolver o IP para o host {0} ou para {1}. "},
-            {"appletsecurityexception.checkconnect.networkhost3", "Exce\u00E7\u00E3o de Seguran\u00E7a: N\u00E3o foi poss\u00EDvel resolver o IP para o host {0}. Consulte a propriedade trustProxy."},
-            {"appletsecurityexception.checkconnect", "Exce\u00E7\u00E3o de Seguran\u00E7a: conectar: {0}->{1}"},
-            {"appletsecurityexception.checkpackageaccess", "Exce\u00E7\u00E3o de Seguran\u00E7a: n\u00E3o \u00E9 poss\u00EDvel acessar o pacote: {0}"},
-            {"appletsecurityexception.checkpackagedefinition", "Exce\u00E7\u00E3o de Seguran\u00E7a: n\u00E3o \u00E9 poss\u00EDvel definir o pacote: {0}"},
-            {"appletsecurityexception.cannotsetfactory", "Exce\u00E7\u00E3o de Seguran\u00E7a: n\u00E3o \u00E9 poss\u00EDvel definir o factory"},
-            {"appletsecurityexception.checkmemberaccess", "Exce\u00E7\u00E3o de Seguran\u00E7a: verificar acesso do membro"},
-            {"appletsecurityexception.checkgetprintjob", "Exce\u00E7\u00E3o de Seguran\u00E7a: getPrintJob"},
-            {"appletsecurityexception.checksystemclipboardaccess", "Exce\u00E7\u00E3o de Seguran\u00E7a: getSystemClipboard"},
-            {"appletsecurityexception.checkawteventqueueaccess", "Exce\u00E7\u00E3o de Seguran\u00E7a: getEventQueue"},
-            {"appletsecurityexception.checksecurityaccess", "Exce\u00E7\u00E3o de Seguran\u00E7a: opera\u00E7\u00E3o de seguran\u00E7a: {0}"},
-            {"appletsecurityexception.getsecuritycontext.unknown", "tipo de carregador de classe desconhecido. n\u00E3o \u00E9 poss\u00EDvel verificar getContext"},
-            {"appletsecurityexception.checkread.unknown", "tipo de carregador de classe desconhecido. n\u00E3o \u00E9 poss\u00EDvel verificar a leitura {0}"},
-            {"appletsecurityexception.checkconnect.unknown", "tipo de carregador de classe desconhecido. n\u00E3o \u00E9 poss\u00EDvel verificar a conex\u00E3o"},
-        };
-
-        return temp;
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_sv.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.applet.resources;
-
-import java.util.ListResourceBundle;
-
-public class MsgAppletViewer_sv extends ListResourceBundle {
-
-    public Object[][] getContents() {
-        Object[][] temp = new Object[][] {
-            {"textframe.button.dismiss", "St\u00E4ng"},
-            {"appletviewer.tool.title", "Applet Viewer: {0}"},
-            {"appletviewer.menu.applet", "Applet"},
-            {"appletviewer.menuitem.restart", "Starta om"},
-            {"appletviewer.menuitem.reload", "Ladda om"},
-            {"appletviewer.menuitem.stop", "Stopp"},
-            {"appletviewer.menuitem.save", "Spara..."},
-            {"appletviewer.menuitem.start", "Starta"},
-            {"appletviewer.menuitem.clone", "Klona..."},
-            {"appletviewer.menuitem.tag", "Tagg..."},
-            {"appletviewer.menuitem.info", "Information..."},
-            {"appletviewer.menuitem.edit", "Redigera"},
-            {"appletviewer.menuitem.encoding", "Teckenkodning"},
-            {"appletviewer.menuitem.print", "Skriv ut..."},
-            {"appletviewer.menuitem.props", "Egenskaper..."},
-            {"appletviewer.menuitem.close", "St\u00E4ng"},
-            {"appletviewer.menuitem.quit", "Avsluta"},
-            {"appletviewer.label.hello", "Hej..."},
-            {"appletviewer.status.start", "startar applet..."},
-            {"appletviewer.appletsave.filedialogtitle","Serialisera applet till fil"},
-            {"appletviewer.appletsave.err1", "serialiserar {0} till {1}"},
-            {"appletviewer.appletsave.err2", "i appletSave: {0}"},
-            {"appletviewer.applettag", "Tagg visas"},
-            {"appletviewer.applettag.textframe", "HTML-tagg f\u00F6r applet"},
-            {"appletviewer.appletinfo.applet", "-- ingen appletinformation --"},
-            {"appletviewer.appletinfo.param", "-- ingen parameterinformation --"},
-            {"appletviewer.appletinfo.textframe", "Appletinformation"},
-            {"appletviewer.appletprint.fail", "Kunde inte skriva ut."},
-            {"appletviewer.appletprint.finish", "Utskriften klar."},
-            {"appletviewer.appletprint.cancel", "Utskriften avbruten."},
-            {"appletviewer.appletencoding", "Teckenkodning: {0}"},
-            {"appletviewer.parse.warning.requiresname", "Varning: <param name=... value=...>-taggen kr\u00E4ver ett namnattribut."},
-            {"appletviewer.parse.warning.paramoutside", "Varning: <param>-taggen finns utanf\u00F6r <applet> ... </applet>."},
-            {"appletviewer.parse.warning.applet.requirescode", "Varning: <applet>-taggen kr\u00E4ver ett kodattribut."},
-            {"appletviewer.parse.warning.applet.requiresheight", "Varning: <applet>-taggen kr\u00E4ver ett h\u00F6jdattribut."},
-            {"appletviewer.parse.warning.applet.requireswidth", "Varning: <applet>-taggen kr\u00E4ver ett breddattribut."},
-            {"appletviewer.parse.warning.object.requirescode", "Varning: <object>-taggen kr\u00E4ver ett kodattribut."},
-            {"appletviewer.parse.warning.object.requiresheight", "Varning: <object>-taggen kr\u00E4ver ett h\u00F6jdattribut."},
-            {"appletviewer.parse.warning.object.requireswidth", "Varning: <object>-taggen kr\u00E4ver ett breddattribut."},
-            {"appletviewer.parse.warning.embed.requirescode", "Varning: <embed>-taggen kr\u00E4ver ett kodattribut."},
-            {"appletviewer.parse.warning.embed.requiresheight", "Varning: <embed>-taggen kr\u00E4ver ett h\u00F6jdattribut."},
-            {"appletviewer.parse.warning.embed.requireswidth", "Varning: <embed>-taggen kr\u00E4ver ett breddattribut."},
-            {"appletviewer.parse.warning.appnotLongersupported", "Varning: <app>-taggen st\u00F6ds inte l\u00E4ngre, anv\u00E4nd <applet> ist\u00E4llet:"},
-            {"appletviewer.deprecated", "Varning: Applet-API:t och AppletViewer \u00E4r inaktuella."},
-            {"appletviewer.usage", "Syntax: appletviewer <options> url(s)\n\nd\u00E4r <options> \u00E4r:\n  -encoding <encoding>    Ange teckenkodning som anv\u00E4nds av HTML-filer\n  -J<runtime flag>        \u00D6verf\u00F6r argument till java-tolken\n\nAlternativet -J \u00E4r inte standard och kan \u00E4ndras utan f\u00F6reg\u00E5ende meddelande."},
-            {"appletviewer.main.err.unsupportedopt", "Alternativ som inte st\u00F6ds: {0}"},
-            {"appletviewer.main.err.unrecognizedarg", "Ok\u00E4nt argument: {0}"},
-            {"appletviewer.main.err.dupoption", "Duplicerat alternativ: {0}"},
-            {"appletviewer.main.err.inputfile", "Inga angivna indatafiler."},
-            {"appletviewer.main.err.badurl", "Felaktig URL: {0} ( {1} )"},
-            {"appletviewer.main.err.io", "I/O-undantag vid l\u00E4sning: {0}"},
-            {"appletviewer.main.err.readablefile", "Kontrollera att {0} \u00E4r en fil som \u00E4r l\u00E4sbar."},
-            {"appletviewer.main.err.correcturl", "\u00C4r {0} den korrekta URL:en?"},
-            {"appletviewer.main.prop.store", "Anv\u00E4ndarspecifika egenskaper f\u00F6r AppletViewer"},
-            {"appletviewer.main.err.prop.cantread", "Kan inte l\u00E4sa egenskapsfilen: {0}"},
-            {"appletviewer.main.err.prop.cantsave", "Kan inte spara egenskapsfilen: {0}"},
-            {"appletviewer.main.warn.nosecmgr", "Varning! S\u00E4kerheten avaktiveras."},
-            {"appletviewer.main.debug.cantfinddebug", "Hittar inte fels\u00F6kningsprogrammet!"},
-            {"appletviewer.main.debug.cantfindmain", "Hittar inte huvudmetoden i fels\u00F6kningsprogrammet!"},
-            {"appletviewer.main.debug.exceptionindebug", "Undantag i fels\u00F6kningsprogrammet!"},
-            {"appletviewer.main.debug.cantaccess", "Det finns ingen \u00E5tkomst till fels\u00F6kningsprogrammet!"},
-            {"appletviewer.main.nosecmgr", "Varning: SecurityManager har inte installerats!"},
-            {"appletviewer.main.warning", "Varning: Inga appletar har startats. Kontrollera att indata inneh\u00E5ller <applet>-tagg."},
-            {"appletviewer.main.warn.prop.overwrite", "Varning: Skriver tillf\u00E4lligt \u00F6ver systemegenskap enligt beg\u00E4ran fr\u00E5n anv\u00E4ndare: nyckel: {0} tidigare v\u00E4rde: {1} nytt v\u00E4rde: {2}"},
-            {"appletviewer.main.warn.cantreadprops", "Varning: Kan inte l\u00E4sa egenskapsfil f\u00F6r AppletViewer: {0} Standardv\u00E4rden anv\u00E4nds."},
-            {"appletioexception.loadclass.throw.interrupted", "klassladdning avbr\u00F6ts: {0}"},
-            {"appletioexception.loadclass.throw.notloaded", "klass inte laddad: {0}"},
-            {"appletclassloader.loadcode.verbose", "\u00D6ppnar str\u00F6m till: {0} f\u00F6r h\u00E4mtning av {1}"},
-            {"appletclassloader.filenotfound", "Hittade inte fil vid s\u00F6kning efter: {0}"},
-            {"appletclassloader.fileformat", "Undantag av filformat vid laddning av: {0}"},
-            {"appletclassloader.fileioexception", "I/O-undantag vid laddning: {0}"},
-            {"appletclassloader.fileexception", "{0} undantag vid laddning: {1}"},
-            {"appletclassloader.filedeath", "{0} avslutad vid laddning: {1}"},
-            {"appletclassloader.fileerror", "{0} fel vid laddning: {1}"},
-            {"appletclassloader.findclass.verbose.openstream", "\u00D6ppnar str\u00F6m till: {0} f\u00F6r h\u00E4mtning av {1}"},
-            {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource f\u00F6r namnet: {0}"},
-            {"appletclassloader.getresource.verbose.found", "Hittade resursen: {0} som systemresurs"},
-            {"appletclassloader.getresourceasstream.verbose", "Hittade resursen: {0} som systemresurs"},
-            {"appletpanel.runloader.err", "Antingen objekt- eller kodparameter!"},
-            {"appletpanel.runloader.exception", "undantag vid avserialisering {0}"},
-            {"appletpanel.destroyed", "Applet raderad."},
-            {"appletpanel.loaded", "Applet laddad."},
-            {"appletpanel.started", "Applet startad."},
-            {"appletpanel.inited", "Applet initierad."},
-            {"appletpanel.stopped", "Applet stoppad."},
-            {"appletpanel.disposed", "Applet kasserad."},
-            {"appletpanel.nocode", "APPLET-tagg saknar CODE-parameter."},
-            {"appletpanel.notfound", "load: hittade inte klassen {0}."},
-            {"appletpanel.nocreate", "load: {0} kan inte instansieras."},
-            {"appletpanel.noconstruct", "load: {0} \u00E4r inte allm\u00E4n eller saknar allm\u00E4n konstruktor."},
-            {"appletpanel.death", "avslutad"},
-            {"appletpanel.exception", "undantag: {0}."},
-            {"appletpanel.exception2", "undantag: {0}: {1}."},
-            {"appletpanel.error", "fel: {0}."},
-            {"appletpanel.error2", "fel {0}: {1}."},
-            {"appletpanel.notloaded", "Initiera: applet \u00E4r inte laddad."},
-            {"appletpanel.notinited", "Starta: applet \u00E4r inte initierad."},
-            {"appletpanel.notstarted", "Stoppa: applet har inte startats."},
-            {"appletpanel.notstopped", "Radera: applet har inte stoppats."},
-            {"appletpanel.notdestroyed", "Kassera: applet har inte raderats."},
-            {"appletpanel.notdisposed", "Ladda: applet har inte kasserats."},
-            {"appletpanel.bail", "Avbruten."},
-            {"appletpanel.filenotfound", "Hittade inte fil vid s\u00F6kning efter: {0}"},
-            {"appletpanel.fileformat", "Undantag av filformat vid laddning av: {0}"},
-            {"appletpanel.fileioexception", "I/O-undantag vid laddning: {0}"},
-            {"appletpanel.fileexception", "{0} undantag vid laddning: {1}"},
-            {"appletpanel.filedeath", "{0} avslutad vid laddning: {1}"},
-            {"appletpanel.fileerror", "{0} fel vid laddning: {1}"},
-            {"appletpanel.badattribute.exception", "HTML-tolkning: felaktigt v\u00E4rde f\u00F6r bredd-/h\u00F6jdattribut"},
-            {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream kr\u00E4ver laddare med icke-null"},
-            {"appletprops.title", "AppletViewer-egenskaper"},
-            {"appletprops.label.http.server", "HTTP-proxyserver:"},
-            {"appletprops.label.http.proxy", "HTTP-proxyport:"},
-            {"appletprops.label.network", "N\u00E4tverks\u00E5tkomst:"},
-            {"appletprops.choice.network.item.none", "Ingen"},
-            {"appletprops.choice.network.item.applethost", "Appletv\u00E4rd"},
-            {"appletprops.choice.network.item.unrestricted", "Obegr\u00E4nsad"},
-            {"appletprops.label.class", "Klass\u00E5tkomst:"},
-            {"appletprops.choice.class.item.restricted", "Begr\u00E4nsad"},
-            {"appletprops.choice.class.item.unrestricted", "Obegr\u00E4nsad"},
-            {"appletprops.label.unsignedapplet", "Till\u00E5t osignerade appletar:"},
-            {"appletprops.choice.unsignedapplet.no", "Nej"},
-            {"appletprops.choice.unsignedapplet.yes", "Ja"},
-            {"appletprops.button.apply", "Anv\u00E4nd"},
-            {"appletprops.button.cancel", "Avbryt"},
-            {"appletprops.button.reset", "\u00C5terst\u00E4ll"},
-            {"appletprops.apply.exception", "Kunde inte spara egenskaper: {0}"},
-            /* 4066432 */
-            {"appletprops.title.invalidproxy", "Ogiltig post"},
-            {"appletprops.label.invalidproxy", "Proxyport m\u00E5ste vara ett positivt heltal."},
-            {"appletprops.button.ok", "OK"},
-            /* end 4066432 */
-            {"appletprops.prop.store", "Anv\u00E4ndarspecifika egenskaper f\u00F6r AppletViewer"},
-            {"appletsecurityexception.checkcreateclassloader", "S\u00E4kerhetsundantag: klassladdare"},
-            {"appletsecurityexception.checkaccess.thread", "S\u00E4kerhetsundantag: tr\u00E5d"},
-            {"appletsecurityexception.checkaccess.threadgroup", "S\u00E4kerhetsundantag: tr\u00E5dgrupp: {0}"},
-            {"appletsecurityexception.checkexit", "S\u00E4kerhetsundantag: utg\u00E5ng: {0}"},
-            {"appletsecurityexception.checkexec", "S\u00E4kerhetsundantag: exec: {0}"},
-            {"appletsecurityexception.checklink", "S\u00E4kerhetsundantag: l\u00E4nk: {0}"},
-            {"appletsecurityexception.checkpropsaccess", "S\u00E4kerhetsundantag: egenskaper"},
-            {"appletsecurityexception.checkpropsaccess.key", "S\u00E4kerhetsundantag: egenskaps\u00E5tkomst {0}"},
-            {"appletsecurityexception.checkread.exception1", "S\u00E4kerhetsundantag: {0}, {1}"},
-            {"appletsecurityexception.checkread.exception2", "S\u00E4kerhetsundantag: file.read: {0}"},
-            {"appletsecurityexception.checkread", "S\u00E4kerhetsundantag: file.read: {0} == {1}"},
-            {"appletsecurityexception.checkwrite.exception", "S\u00E4kerhetsundantag: {0}, {1}"},
-            {"appletsecurityexception.checkwrite", "S\u00E4kerhetsundantag: file.write: {0} == {1}"},
-            {"appletsecurityexception.checkread.fd", "S\u00E4kerhetsundantag: fd.read"},
-            {"appletsecurityexception.checkwrite.fd", "S\u00E4kerhetsundantag: fd.write"},
-            {"appletsecurityexception.checklisten", "S\u00E4kerhetsundantag: socket.listen: {0}"},
-            {"appletsecurityexception.checkaccept", "S\u00E4kerhetsundantag: socket.accept: {0}:{1}"},
-            {"appletsecurityexception.checkconnect.networknone", "S\u00E4kerhetsundantag: socket.connect: {0}->{1}"},
-            {"appletsecurityexception.checkconnect.networkhost1", "S\u00E4kerhetsundantag: Kunde inte ansluta till {0} med ursprung fr\u00E5n {1}."},
-            {"appletsecurityexception.checkconnect.networkhost2", "S\u00E4kerhetsundantag: Kunde inte matcha IP f\u00F6r v\u00E4rd {0} eller f\u00F6r {1}. "},
-            {"appletsecurityexception.checkconnect.networkhost3", "S\u00E4kerhetsundantag: Kunde inte matcha IP f\u00F6r v\u00E4rd {0}. Se egenskapen trustProxy."},
-            {"appletsecurityexception.checkconnect", "S\u00E4kerhetsundantag: connect: {0}->{1}"},
-            {"appletsecurityexception.checkpackageaccess", "S\u00E4kerhetsundantag: ingen \u00E5tkomst till paket: {0}"},
-            {"appletsecurityexception.checkpackagedefinition", "S\u00E4kerhetsundantag: kan inte definiera paket: {0}"},
-            {"appletsecurityexception.cannotsetfactory", "S\u00E4kerhetsundantag: kan inte ange fabrik"},
-            {"appletsecurityexception.checkmemberaccess", "S\u00E4kerhetsundantag: kontrollera medlems\u00E5tkomst"},
-            {"appletsecurityexception.checkgetprintjob", "S\u00E4kerhetsundantag: getPrintJob"},
-            {"appletsecurityexception.checksystemclipboardaccess", "S\u00E4kerhetsundantag: getSystemClipboard"},
-            {"appletsecurityexception.checkawteventqueueaccess", "S\u00E4kerhetsundantag: getEventQueue"},
-            {"appletsecurityexception.checksecurityaccess", "S\u00E4kerhetsundantag: s\u00E4kerhets\u00E5tg\u00E4rd: {0}"},
-            {"appletsecurityexception.getsecuritycontext.unknown", "ok\u00E4nd typ av klassladdare. kan inte kontrollera getContext"},
-            {"appletsecurityexception.checkread.unknown", "ok\u00E4nd typ av klassladdare. kan inte kontrollera kontroll\u00E4sning {0}"},
-            {"appletsecurityexception.checkconnect.unknown", "ok\u00E4nd typ av klassladdare. kan inte kontrollera kontrollanslutning"},
-        };
-
-        return temp;
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_zh_CN.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.applet.resources;
-
-import java.util.ListResourceBundle;
-
-public class MsgAppletViewer_zh_CN extends ListResourceBundle {
-
-    public Object[][] getContents() {
-        Object[][] temp = new Object[][] {
-            {"textframe.button.dismiss", "\u5173\u95ED"},
-            {"appletviewer.tool.title", "\u5C0F\u5E94\u7528\u7A0B\u5E8F\u67E5\u770B\u5668: {0}"},
-            {"appletviewer.menu.applet", "\u5C0F\u5E94\u7528\u7A0B\u5E8F"},
-            {"appletviewer.menuitem.restart", "\u91CD\u65B0\u542F\u52A8"},
-            {"appletviewer.menuitem.reload", "\u91CD\u65B0\u52A0\u8F7D"},
-            {"appletviewer.menuitem.stop", "\u505C\u6B62"},
-            {"appletviewer.menuitem.save", "\u4FDD\u5B58..."},
-            {"appletviewer.menuitem.start", "\u542F\u52A8"},
-            {"appletviewer.menuitem.clone", "\u514B\u9686..."},
-            {"appletviewer.menuitem.tag", "\u6807\u8BB0..."},
-            {"appletviewer.menuitem.info", "\u4FE1\u606F..."},
-            {"appletviewer.menuitem.edit", "\u7F16\u8F91"},
-            {"appletviewer.menuitem.encoding", "\u5B57\u7B26\u7F16\u7801"},
-            {"appletviewer.menuitem.print", "\u6253\u5370..."},
-            {"appletviewer.menuitem.props", "\u5C5E\u6027..."},
-            {"appletviewer.menuitem.close", "\u5173\u95ED"},
-            {"appletviewer.menuitem.quit", "\u9000\u51FA"},
-            {"appletviewer.label.hello", "\u60A8\u597D..."},
-            {"appletviewer.status.start", "\u6B63\u5728\u542F\u52A8\u5C0F\u5E94\u7528\u7A0B\u5E8F..."},
-            {"appletviewer.appletsave.filedialogtitle","\u5C06\u5C0F\u5E94\u7528\u7A0B\u5E8F\u5E8F\u5217\u5316\u4E3A\u6587\u4EF6"},
-            {"appletviewer.appletsave.err1", "\u5C06{0}\u5E8F\u5217\u5316\u4E3A{1}"},
-            {"appletviewer.appletsave.err2", "\u5728 appletSave \u4E2D: {0}"},
-            {"appletviewer.applettag", "\u663E\u793A\u7684\u6807\u8BB0"},
-            {"appletviewer.applettag.textframe", "\u5C0F\u5E94\u7528\u7A0B\u5E8F HTML \u6807\u8BB0"},
-            {"appletviewer.appletinfo.applet", "-- \u6CA1\u6709\u5C0F\u5E94\u7528\u7A0B\u5E8F\u4FE1\u606F --"},
-            {"appletviewer.appletinfo.param", "-- \u6CA1\u6709\u53C2\u6570\u4FE1\u606F --"},
-            {"appletviewer.appletinfo.textframe", "\u5C0F\u5E94\u7528\u7A0B\u5E8F\u4FE1\u606F"},
-            {"appletviewer.appletprint.fail", "\u6253\u5370\u5931\u8D25\u3002"},
-            {"appletviewer.appletprint.finish", "\u5DF2\u5B8C\u6210\u6253\u5370\u3002"},
-            {"appletviewer.appletprint.cancel", "\u6253\u5370\u5DF2\u53D6\u6D88\u3002"},
-            {"appletviewer.appletencoding", "\u5B57\u7B26\u7F16\u7801: {0}"},
-            {"appletviewer.parse.warning.requiresname", "\u8B66\u544A: <param name=... value=...> \u6807\u8BB0\u9700\u8981\u540D\u79F0\u5C5E\u6027\u3002"},
-            {"appletviewer.parse.warning.paramoutside", "\u8B66\u544A: <param> \u6807\u8BB0\u5728 <applet> ... </applet> \u5916\u90E8\u3002"},
-            {"appletviewer.parse.warning.applet.requirescode", "\u8B66\u544A: <applet> \u6807\u8BB0\u9700\u8981\u4EE3\u7801\u5C5E\u6027\u3002"},
-            {"appletviewer.parse.warning.applet.requiresheight", "\u8B66\u544A: <applet> \u6807\u8BB0\u9700\u8981\u9AD8\u5EA6\u5C5E\u6027\u3002"},
-            {"appletviewer.parse.warning.applet.requireswidth", "\u8B66\u544A: <applet> \u6807\u8BB0\u9700\u8981\u5BBD\u5EA6\u5C5E\u6027\u3002"},
-            {"appletviewer.parse.warning.object.requirescode", "\u8B66\u544A: <object> \u6807\u8BB0\u9700\u8981\u4EE3\u7801\u5C5E\u6027\u3002"},
-            {"appletviewer.parse.warning.object.requiresheight", "\u8B66\u544A: <object> \u6807\u8BB0\u9700\u8981\u9AD8\u5EA6\u5C5E\u6027\u3002"},
-            {"appletviewer.parse.warning.object.requireswidth", "\u8B66\u544A: <object> \u6807\u8BB0\u9700\u8981\u5BBD\u5EA6\u5C5E\u6027\u3002"},
-            {"appletviewer.parse.warning.embed.requirescode", "\u8B66\u544A: <embed> \u6807\u8BB0\u9700\u8981\u4EE3\u7801\u5C5E\u6027\u3002"},
-            {"appletviewer.parse.warning.embed.requiresheight", "\u8B66\u544A: <embed> \u6807\u8BB0\u9700\u8981\u9AD8\u5EA6\u5C5E\u6027\u3002"},
-            {"appletviewer.parse.warning.embed.requireswidth", "\u8B66\u544A: <embed> \u6807\u8BB0\u9700\u8981\u5BBD\u5EA6\u5C5E\u6027\u3002"},
-            {"appletviewer.parse.warning.appnotLongersupported", "\u8B66\u544A: \u4E0D\u518D\u652F\u6301 <app> \u6807\u8BB0, \u8BF7\u6539\u7528 <applet>:"},
-            {"appletviewer.deprecated", "\u8B66\u544A: \u5C0F\u5E94\u7528\u7A0B\u5E8F API \u548C AppletViewer \u5DF2\u8FC7\u65F6\u3002"},
-            {"appletviewer.usage", "\u7528\u6CD5: appletviewer <options> url(s)\n\n\u5176\u4E2D <options> \u5305\u62EC:\n  -encoding <encoding>    \u6307\u5B9A HTML \u6587\u4EF6\u4F7F\u7528\u7684\u5B57\u7B26\u7F16\u7801\n  -J<runtime flag>        \u5C06\u53C2\u6570\u4F20\u9012\u5230 java \u89E3\u91CA\u5668\n\n-J \u9009\u9879\u662F\u975E\u6807\u51C6\u9009\u9879, \u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002"},
-            {"appletviewer.main.err.unsupportedopt", "\u4E0D\u652F\u6301\u7684\u9009\u9879: {0}"},
-            {"appletviewer.main.err.unrecognizedarg", "\u65E0\u6CD5\u8BC6\u522B\u7684\u53C2\u6570: {0}"},
-            {"appletviewer.main.err.dupoption", "\u91CD\u590D\u4F7F\u7528\u9009\u9879: {0}"},
-            {"appletviewer.main.err.inputfile", "\u672A\u6307\u5B9A\u8F93\u5165\u6587\u4EF6\u3002"},
-            {"appletviewer.main.err.badurl", "\u9519\u8BEF URL: {0} ({1})"},
-            {"appletviewer.main.err.io", "\u8BFB\u53D6{0}\u65F6\u51FA\u73B0 I/O \u5F02\u5E38\u9519\u8BEF"},
-            {"appletviewer.main.err.readablefile", "\u786E\u4FDD{0}\u662F\u6587\u4EF6\u4E14\u53EF\u8BFB\u3002"},
-            {"appletviewer.main.err.correcturl", "{0} \u662F\u5426\u662F\u6B63\u786E\u7684 URL?"},
-            {"appletviewer.main.prop.store", "AppletViewer \u7684\u7528\u6237\u7279\u5B9A\u5C5E\u6027"},
-            {"appletviewer.main.err.prop.cantread", "\u65E0\u6CD5\u8BFB\u53D6\u7528\u6237\u5C5E\u6027\u6587\u4EF6: {0}"},
-            {"appletviewer.main.err.prop.cantsave", "\u65E0\u6CD5\u4FDD\u5B58\u7528\u6237\u5C5E\u6027\u6587\u4EF6: {0}"},
-            {"appletviewer.main.warn.nosecmgr", "\u8B66\u544A: \u7981\u7528\u5B89\u5168\u3002"},
-            {"appletviewer.main.debug.cantfinddebug", "\u627E\u4E0D\u5230\u8C03\u8BD5\u5668!"},
-            {"appletviewer.main.debug.cantfindmain", "\u5728\u8C03\u8BD5\u5668\u4E2D\u627E\u4E0D\u5230 main \u65B9\u6CD5!"},
-            {"appletviewer.main.debug.exceptionindebug", "\u8C03\u8BD5\u5668\u4E2D\u5B58\u5728\u5F02\u5E38\u9519\u8BEF!"},
-            {"appletviewer.main.debug.cantaccess", "\u65E0\u6CD5\u8BBF\u95EE\u8C03\u8BD5\u5668!"},
-            {"appletviewer.main.nosecmgr", "\u8B66\u544A: \u672A\u5B89\u88C5 SecurityManager!"},
-            {"appletviewer.main.warning", "\u8B66\u544A: \u672A\u542F\u52A8\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002\u786E\u4FDD\u8F93\u5165\u5305\u542B <applet> \u6807\u8BB0\u3002"},
-            {"appletviewer.main.warn.prop.overwrite", "\u8B66\u544A: \u6839\u636E\u7528\u6237\u8BF7\u6C42\u4E34\u65F6\u8986\u76D6\u7CFB\u7EDF\u5C5E\u6027: \u5173\u952E\u5B57: {0}, \u65E7\u503C: {1}, \u65B0\u503C: {2}"},
-            {"appletviewer.main.warn.cantreadprops", "\u8B66\u544A: \u65E0\u6CD5\u8BFB\u53D6 AppletViewer \u5C5E\u6027\u6587\u4EF6: {0}\u3002\u8BF7\u4F7F\u7528\u9ED8\u8BA4\u503C\u3002"},
-            {"appletioexception.loadclass.throw.interrupted", "\u7C7B\u52A0\u8F7D\u4E2D\u65AD: {0}"},
-            {"appletioexception.loadclass.throw.notloaded", "\u672A\u52A0\u8F7D\u7C7B: {0}"},
-            {"appletclassloader.loadcode.verbose", "\u6253\u5F00\u5230{0}\u7684\u6D41\u4EE5\u83B7\u53D6{1}"},
-            {"appletclassloader.filenotfound", "\u67E5\u627E\u65F6\u627E\u4E0D\u5230\u6587\u4EF6: {0}"},
-            {"appletclassloader.fileformat", "\u52A0\u8F7D\u65F6\u51FA\u73B0\u6587\u4EF6\u683C\u5F0F\u5F02\u5E38\u9519\u8BEF: {0}"},
-            {"appletclassloader.fileioexception", "\u52A0\u8F7D\u65F6\u51FA\u73B0 I/O \u5F02\u5E38\u9519\u8BEF: {0}"},
-            {"appletclassloader.fileexception", "\u52A0\u8F7D\u65F6\u51FA\u73B0{0}\u5F02\u5E38\u9519\u8BEF: {1}"},
-            {"appletclassloader.filedeath", "\u52A0\u8F7D\u65F6\u5DF2\u7EC8\u6B62{0}: {1}"},
-            {"appletclassloader.fileerror", "\u52A0\u8F7D\u65F6\u51FA\u73B0{0}\u9519\u8BEF: {1}"},
-            {"appletclassloader.findclass.verbose.openstream", "\u6253\u5F00\u5230{0}\u7684\u6D41\u4EE5\u83B7\u53D6{1}"},
-            {"appletclassloader.getresource.verbose.forname", "\u540D\u79F0\u7684 AppletClassLoader.getResource: {0}"},
-            {"appletclassloader.getresource.verbose.found", "\u5DF2\u627E\u5230\u4F5C\u4E3A\u7CFB\u7EDF\u8D44\u6E90\u7684\u8D44\u6E90{0}"},
-            {"appletclassloader.getresourceasstream.verbose", "\u5DF2\u627E\u5230\u4F5C\u4E3A\u7CFB\u7EDF\u8D44\u6E90\u7684\u8D44\u6E90{0}"},
-            {"appletpanel.runloader.err", "\u5BF9\u8C61\u6216\u4EE3\u7801\u53C2\u6570!"},
-            {"appletpanel.runloader.exception", "\u53CD\u5E8F\u5217\u5316{0}\u65F6\u51FA\u73B0\u5F02\u5E38\u9519\u8BEF"},
-            {"appletpanel.destroyed", "\u5DF2\u9500\u6BC1\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"},
-            {"appletpanel.loaded", "\u5DF2\u52A0\u8F7D\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"},
-            {"appletpanel.started", "\u5DF2\u542F\u52A8\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"},
-            {"appletpanel.inited", "\u5DF2\u521D\u59CB\u5316\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"},
-            {"appletpanel.stopped", "\u5DF2\u505C\u6B62\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"},
-            {"appletpanel.disposed", "\u5DF2\u5904\u7406\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"},
-            {"appletpanel.nocode", "APPLET \u6807\u8BB0\u7F3A\u5C11 CODE \u53C2\u6570\u3002"},
-            {"appletpanel.notfound", "\u52A0\u8F7D: \u627E\u4E0D\u5230\u7C7B{0}\u3002"},
-            {"appletpanel.nocreate", "\u52A0\u8F7D: \u65E0\u6CD5\u5B9E\u4F8B\u5316{0}\u3002"},
-            {"appletpanel.noconstruct", "\u52A0\u8F7D: {0}\u4E0D\u662F\u516C\u5171\u7684, \u6216\u8005\u6CA1\u6709\u516C\u5171\u6784\u9020\u5668\u3002"},
-            {"appletpanel.death", "\u5DF2\u7EC8\u6B62"},
-            {"appletpanel.exception", "\u5F02\u5E38\u9519\u8BEF: {0}\u3002"},
-            {"appletpanel.exception2", "\u5F02\u5E38\u9519\u8BEF: {0}: {1}\u3002"},
-            {"appletpanel.error", "\u9519\u8BEF: {0}\u3002"},
-            {"appletpanel.error2", "\u9519\u8BEF: {0}: {1}\u3002"},
-            {"appletpanel.notloaded", "\u521D\u59CB\u5316: \u672A\u52A0\u8F7D\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"},
-            {"appletpanel.notinited", "\u542F\u52A8: \u672A\u521D\u59CB\u5316\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"},
-            {"appletpanel.notstarted", "\u505C\u6B62: \u672A\u542F\u52A8\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"},
-            {"appletpanel.notstopped", "\u9500\u6BC1: \u672A\u505C\u6B62\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"},
-            {"appletpanel.notdestroyed", "\u5904\u7406: \u672A\u9500\u6BC1\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"},
-            {"appletpanel.notdisposed", "\u52A0\u8F7D: \u672A\u5904\u7406\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"},
-            {"appletpanel.bail", "\u5DF2\u4E2D\u65AD: \u79BB\u5F00\u3002"},
-            {"appletpanel.filenotfound", "\u67E5\u627E\u65F6\u627E\u4E0D\u5230\u6587\u4EF6: {0}"},
-            {"appletpanel.fileformat", "\u52A0\u8F7D\u65F6\u51FA\u73B0\u6587\u4EF6\u683C\u5F0F\u5F02\u5E38\u9519\u8BEF: {0}"},
-            {"appletpanel.fileioexception", "\u52A0\u8F7D\u65F6\u51FA\u73B0 I/O \u5F02\u5E38\u9519\u8BEF: {0}"},
-            {"appletpanel.fileexception", "\u52A0\u8F7D\u65F6\u51FA\u73B0{0}\u5F02\u5E38\u9519\u8BEF: {1}"},
-            {"appletpanel.filedeath", "\u52A0\u8F7D\u65F6\u5DF2\u7EC8\u6B62{0}: {1}"},
-            {"appletpanel.fileerror", "\u52A0\u8F7D\u65F6\u51FA\u73B0{0}\u9519\u8BEF: {1}"},
-            {"appletpanel.badattribute.exception", "HTML \u89E3\u6790: \u5BBD\u5EA6/\u9AD8\u5EA6\u5C5E\u6027\u7684\u503C\u4E0D\u6B63\u786E"},
-            {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream \u9700\u8981\u975E\u7A7A\u52A0\u8F7D\u5668"},
-            {"appletprops.title", "AppletViewer \u5C5E\u6027"},
-            {"appletprops.label.http.server", "Http \u4EE3\u7406\u670D\u52A1\u5668:"},
-            {"appletprops.label.http.proxy", "Http \u4EE3\u7406\u7AEF\u53E3:"},
-            {"appletprops.label.network", "\u7F51\u7EDC\u8BBF\u95EE\u6743\u9650:"},
-            {"appletprops.choice.network.item.none", "\u65E0"},
-            {"appletprops.choice.network.item.applethost", "\u5C0F\u5E94\u7528\u7A0B\u5E8F\u4E3B\u673A"},
-            {"appletprops.choice.network.item.unrestricted", "\u4E0D\u53D7\u9650\u5236"},
-            {"appletprops.label.class", "\u7C7B\u8BBF\u95EE\u6743\u9650:"},
-            {"appletprops.choice.class.item.restricted", "\u53D7\u9650\u5236"},
-            {"appletprops.choice.class.item.unrestricted", "\u4E0D\u53D7\u9650\u5236"},
-            {"appletprops.label.unsignedapplet", "\u5141\u8BB8\u672A\u7B7E\u540D\u5C0F\u5E94\u7528\u7A0B\u5E8F:"},
-            {"appletprops.choice.unsignedapplet.no", "\u5426"},
-            {"appletprops.choice.unsignedapplet.yes", "\u662F"},
-            {"appletprops.button.apply", "\u5E94\u7528"},
-            {"appletprops.button.cancel", "\u53D6\u6D88"},
-            {"appletprops.button.reset", "\u91CD\u7F6E"},
-            {"appletprops.apply.exception", "\u65E0\u6CD5\u4FDD\u5B58\u5C5E\u6027: {0}"},
-            /* 4066432 */
-            {"appletprops.title.invalidproxy", "\u6761\u76EE\u65E0\u6548"},
-            {"appletprops.label.invalidproxy", "\u4EE3\u7406\u7AEF\u53E3\u5FC5\u987B\u662F\u4E00\u4E2A\u6B63\u6574\u6570\u503C\u3002"},
-            {"appletprops.button.ok", "\u786E\u5B9A"},
-            /* end 4066432 */
-            {"appletprops.prop.store", "AppletViewer \u7684\u7528\u6237\u7279\u5B9A\u5C5E\u6027"},
-            {"appletsecurityexception.checkcreateclassloader", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u7C7B\u52A0\u8F7D\u5668"},
-            {"appletsecurityexception.checkaccess.thread", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u7EBF\u7A0B"},
-            {"appletsecurityexception.checkaccess.threadgroup", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u7EBF\u7A0B\u7EC4: {0}"},
-            {"appletsecurityexception.checkexit", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u9000\u51FA: {0}"},
-            {"appletsecurityexception.checkexec", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u6267\u884C: {0}"},
-            {"appletsecurityexception.checklink", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u94FE\u63A5: {0}"},
-            {"appletsecurityexception.checkpropsaccess", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u5C5E\u6027"},
-            {"appletsecurityexception.checkpropsaccess.key", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u5C5E\u6027\u8BBF\u95EE{0}"},
-            {"appletsecurityexception.checkread.exception1", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: {0}, {1}"},
-            {"appletsecurityexception.checkread.exception2", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: file.read: {0}"},
-            {"appletsecurityexception.checkread", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: file.read: {0} == {1}"},
-            {"appletsecurityexception.checkwrite.exception", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: {0}, {1}"},
-            {"appletsecurityexception.checkwrite", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: file.write: {0} == {1}"},
-            {"appletsecurityexception.checkread.fd", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: fd.read"},
-            {"appletsecurityexception.checkwrite.fd", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: fd.write"},
-            {"appletsecurityexception.checklisten", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: socket.listen: {0}"},
-            {"appletsecurityexception.checkaccept", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: socket.accept: {0}:{1}"},
-            {"appletsecurityexception.checkconnect.networknone", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: socket.connect: {0}->{1}"},
-            {"appletsecurityexception.checkconnect.networkhost1", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u65E0\u6CD5\u8FDE\u63A5\u5230\u6E90\u81EA{1}\u7684{0}\u3002"},
-            {"appletsecurityexception.checkconnect.networkhost2", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u65E0\u6CD5\u89E3\u6790\u4E3B\u673A{0}\u6216{1}\u7684 IP\u3002"},
-            {"appletsecurityexception.checkconnect.networkhost3", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u65E0\u6CD5\u89E3\u6790\u4E3B\u673A{0}\u7684 IP\u3002\u8BF7\u53C2\u9605 trustProxy \u5C5E\u6027\u3002"},
-            {"appletsecurityexception.checkconnect", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u8FDE\u63A5: {0}->{1}"},
-            {"appletsecurityexception.checkpackageaccess", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u65E0\u6CD5\u8BBF\u95EE\u7A0B\u5E8F\u5305: {0}"},
-            {"appletsecurityexception.checkpackagedefinition", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u65E0\u6CD5\u5B9A\u4E49\u7A0B\u5E8F\u5305: {0}"},
-            {"appletsecurityexception.cannotsetfactory", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u65E0\u6CD5\u8BBE\u7F6E\u5DE5\u5382"},
-            {"appletsecurityexception.checkmemberaccess", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u68C0\u67E5\u6210\u5458\u8BBF\u95EE\u6743\u9650"},
-            {"appletsecurityexception.checkgetprintjob", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: getPrintJob"},
-            {"appletsecurityexception.checksystemclipboardaccess", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: getSystemClipboard"},
-            {"appletsecurityexception.checkawteventqueueaccess", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: getEventQueue"},
-            {"appletsecurityexception.checksecurityaccess", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u5B89\u5168\u64CD\u4F5C: {0}"},
-            {"appletsecurityexception.getsecuritycontext.unknown", "\u7C7B\u52A0\u8F7D\u5668\u7C7B\u578B\u672A\u77E5\u3002\u65E0\u6CD5\u68C0\u67E5 getContext"},
-            {"appletsecurityexception.checkread.unknown", "\u7C7B\u52A0\u8F7D\u5668\u7C7B\u578B\u672A\u77E5\u3002\u65E0\u6CD5\u4E3A\u68C0\u67E5\u8BFB\u53D6\u6743\u9650{0}\u800C\u8FDB\u884C\u68C0\u67E5"},
-            {"appletsecurityexception.checkconnect.unknown", "\u7C7B\u52A0\u8F7D\u5668\u7C7B\u578B\u672A\u77E5\u3002\u65E0\u6CD5\u4E3A\u68C0\u67E5\u8FDE\u63A5\u800C\u8FDB\u884C\u68C0\u67E5"},
-        };
-
-        return temp;
-    }
-}
--- a/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer_zh_TW.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.applet.resources;
-
-import java.util.ListResourceBundle;
-
-public class MsgAppletViewer_zh_TW extends ListResourceBundle {
-
-    public Object[][] getContents() {
-        Object[][] temp = new Object[][] {
-            {"textframe.button.dismiss", "\u95DC\u9589"},
-            {"appletviewer.tool.title", "Applet \u6AA2\u8996\u5668: {0}"},
-            {"appletviewer.menu.applet", "Applet"},
-            {"appletviewer.menuitem.restart", "\u91CD\u65B0\u555F\u52D5"},
-            {"appletviewer.menuitem.reload", "\u91CD\u65B0\u8F09\u5165"},
-            {"appletviewer.menuitem.stop", "\u505C\u6B62"},
-            {"appletviewer.menuitem.save", "\u5132\u5B58..."},
-            {"appletviewer.menuitem.start", "\u555F\u52D5"},
-            {"appletviewer.menuitem.clone", "\u8907\u88FD..."},
-            {"appletviewer.menuitem.tag", "\u6A19\u8A18..."},
-            {"appletviewer.menuitem.info", "\u8CC7\u8A0A..."},
-            {"appletviewer.menuitem.edit", "\u7DE8\u8F2F"},
-            {"appletviewer.menuitem.encoding", "\u5B57\u5143\u7DE8\u78BC"},
-            {"appletviewer.menuitem.print", "\u5217\u5370..."},
-            {"appletviewer.menuitem.props", "\u5C6C\u6027..."},
-            {"appletviewer.menuitem.close", "\u95DC\u9589"},
-            {"appletviewer.menuitem.quit", "\u7D50\u675F"},
-            {"appletviewer.label.hello", "\u60A8\u597D..."},
-            {"appletviewer.status.start", "\u6B63\u5728\u555F\u52D5 Applet..."},
-            {"appletviewer.appletsave.filedialogtitle","\u5C07 Applet \u5E8F\u5217\u5316\u70BA\u6A94\u6848"},
-            {"appletviewer.appletsave.err1", "\u5C07 {0} \u5E8F\u5217\u5316\u70BA {1}"},
-            {"appletviewer.appletsave.err2", "\u5728 appletSave \u4E2D: {0}"},
-            {"appletviewer.applettag", "\u986F\u793A\u7684\u6A19\u8A18"},
-            {"appletviewer.applettag.textframe", "Applet HTML \u6A19\u8A18"},
-            {"appletviewer.appletinfo.applet", "-- \u7121 Applet \u8CC7\u8A0A --"},
-            {"appletviewer.appletinfo.param", "-- \u7121\u53C3\u6578\u8CC7\u8A0A --"},
-            {"appletviewer.appletinfo.textframe", "Applet \u8CC7\u8A0A"},
-            {"appletviewer.appletprint.fail", "\u5217\u5370\u5931\u6557\u3002"},
-            {"appletviewer.appletprint.finish", "\u5B8C\u6210\u5217\u5370\u3002"},
-            {"appletviewer.appletprint.cancel", "\u5217\u5370\u53D6\u6D88\u3002"},
-            {"appletviewer.appletencoding", "\u5B57\u5143\u7DE8\u78BC: {0}"},
-            {"appletviewer.parse.warning.requiresname", "\u8B66\u544A: <\u53C3\u6578\u540D\u7A31=... \u503C=...> \u6A19\u8A18\u9700\u8981\u540D\u7A31\u5C6C\u6027\u3002"},
-            {"appletviewer.parse.warning.paramoutside", "\u8B66\u544A: <param> \u6A19\u8A18\u5728 <applet> ... </applet> \u4E4B\u5916\u3002"},
-            {"appletviewer.parse.warning.applet.requirescode", "\u8B66\u544A: <applet> \u6A19\u8A18\u9700\u8981\u4EE3\u78BC\u5C6C\u6027\u3002"},
-            {"appletviewer.parse.warning.applet.requiresheight", "\u8B66\u544A: <applet> \u6A19\u8A18\u9700\u8981\u9AD8\u5EA6\u5C6C\u6027\u3002"},
-            {"appletviewer.parse.warning.applet.requireswidth", "\u8B66\u544A: <applet> \u6A19\u8A18\u9700\u8981\u5BEC\u5EA6\u5C6C\u6027\u3002"},
-            {"appletviewer.parse.warning.object.requirescode", "\u8B66\u544A: <object> \u6A19\u8A18\u9700\u8981\u4EE3\u78BC\u5C6C\u6027\u3002"},
-            {"appletviewer.parse.warning.object.requiresheight", "\u8B66\u544A: <object> \u6A19\u8A18\u9700\u8981\u9AD8\u5EA6\u5C6C\u6027\u3002"},
-            {"appletviewer.parse.warning.object.requireswidth", "\u8B66\u544A: <object> \u6A19\u8A18\u9700\u8981\u5BEC\u5EA6\u5C6C\u6027\u3002"},
-            {"appletviewer.parse.warning.embed.requirescode", "\u8B66\u544A: <embed> \u6A19\u8A18\u9700\u8981\u4EE3\u78BC\u5C6C\u6027\u3002"},
-            {"appletviewer.parse.warning.embed.requiresheight", "\u8B66\u544A: <embed> \u6A19\u8A18\u9700\u8981\u9AD8\u5EA6\u5C6C\u6027\u3002"},
-            {"appletviewer.parse.warning.embed.requireswidth", "\u8B66\u544A: <embed> \u6A19\u8A18\u9700\u8981\u5BEC\u5EA6\u5C6C\u6027\u3002"},
-            {"appletviewer.parse.warning.appnotLongersupported", "\u8B66\u544A: \u4E0D\u518D\u652F\u63F4 <app> \u6A19\u8A18\uFF0C\u8ACB\u6539\u7528 <applet>:"},
-            {"appletviewer.deprecated", "\u8B66\u544A: \u5DF2\u4E0D\u518D\u4F7F\u7528 Applet API \u548C AppletViewer\u3002"},
-            {"appletviewer.usage", "\u7528\u6CD5: appletviewer <options> url(s)\n\n\u5176\u4E2D\u7684 <options> \u5305\u62EC:\n  -encoding <encoding>    \u6307\u5B9A HTML \u6A94\u6848\u4F7F\u7528\u7684\u5B57\u5143\u7DE8\u78BC\n  -J<runtime flag>        \u5C07\u5F15\u6578\u50B3\u9001\u81F3 Java \u89E3\u8B6F\u5668\n\n-J \u9078\u9805\u4E0D\u662F\u6A19\u6E96\u9078\u9805\uFF0C\u82E5\u6709\u8B8A\u66F4\u4E0D\u53E6\u884C\u901A\u77E5\u3002"},
-            {"appletviewer.main.err.unsupportedopt", "\u4E0D\u652F\u63F4\u7684\u9078\u9805: {0}"},
-            {"appletviewer.main.err.unrecognizedarg", "\u7121\u6CD5\u8FA8\u8B58\u7684\u5F15\u6578: {0}"},
-            {"appletviewer.main.err.dupoption", "\u91CD\u8907\u4F7F\u7528\u9078\u9805: {0}"},
-            {"appletviewer.main.err.inputfile", "\u672A\u6307\u5B9A\u8F38\u5165\u6A94\u6848\u3002"},
-            {"appletviewer.main.err.badurl", "\u932F\u8AA4\u7684 URL: {0} ( {1} )"},
-            {"appletviewer.main.err.io", "\u8B80\u53D6\u6642\u767C\u751F I/O \u7570\u5E38\u72C0\u6CC1: {0}"},
-            {"appletviewer.main.err.readablefile", "\u78BA\u8A8D {0} \u70BA\u6A94\u6848\u4E14\u53EF\u8B80\u53D6\u3002"},
-            {"appletviewer.main.err.correcturl", "{0} \u662F\u5426\u70BA\u6B63\u78BA\u7684 URL\uFF1F"},
-            {"appletviewer.main.prop.store", "AppletViewer \u7684\u4F7F\u7528\u8005\u7279\u5B9A\u5C6C\u6027"},
-            {"appletviewer.main.err.prop.cantread", "\u7121\u6CD5\u8B80\u53D6\u4F7F\u7528\u8005\u5C6C\u6027\u6A94\u6848: {0}"},
-            {"appletviewer.main.err.prop.cantsave", "\u7121\u6CD5\u5132\u5B58\u4F7F\u7528\u8005\u5C6C\u6027\u6A94\u6848: {0}"},
-            {"appletviewer.main.warn.nosecmgr", "\u8B66\u544A: \u505C\u7528\u5B89\u5168\u529F\u80FD\u3002"},
-            {"appletviewer.main.debug.cantfinddebug", "\u627E\u4E0D\u5230\u9664\u932F\u7A0B\u5F0F\uFF01"},
-            {"appletviewer.main.debug.cantfindmain", "\u5728\u9664\u932F\u7A0B\u5F0F\u4E2D\u627E\u4E0D\u5230\u4E3B\u8981\u65B9\u6CD5\uFF01"},
-            {"appletviewer.main.debug.exceptionindebug", "\u9664\u932F\u7A0B\u5F0F\u767C\u751F\u7570\u5E38\u72C0\u6CC1\uFF01"},
-            {"appletviewer.main.debug.cantaccess", "\u7121\u6CD5\u5B58\u53D6\u9664\u932F\u7A0B\u5F0F\uFF01"},
-            {"appletviewer.main.nosecmgr", "\u8B66\u544A: \u672A\u5B89\u88DD SecurityManager\uFF01"},
-            {"appletviewer.main.warning", "\u8B66\u544A: \u672A\u555F\u52D5 Applet\u3002\u8ACB\u78BA\u8A8D\u8F38\u5165\u5305\u542B <applet> \u6A19\u8A18\u3002"},
-            {"appletviewer.main.warn.prop.overwrite", "\u8B66\u544A: \u4F9D\u7167\u4F7F\u7528\u8005\u8981\u6C42\uFF0C\u66AB\u6642\u8986\u5BEB\u7CFB\u7D71\u5C6C\u6027: \u7D22\u5F15\u9375: {0} \u820A\u503C: {1} \u65B0\u503C: {2}"},
-            {"appletviewer.main.warn.cantreadprops", "\u8B66\u544A: \u7121\u6CD5\u8B80\u53D6 AppletViewer \u5C6C\u6027\u6A94\u6848: {0} \u4F7F\u7528\u9810\u8A2D\u503C\u3002"},
-            {"appletioexception.loadclass.throw.interrupted", "\u985E\u5225\u8F09\u5165\u4E2D\u65B7: {0}"},
-            {"appletioexception.loadclass.throw.notloaded", "\u672A\u8F09\u5165\u985E\u5225: {0}"},
-            {"appletclassloader.loadcode.verbose", "\u958B\u555F {0} \u7684\u4E32\u6D41\u4EE5\u53D6\u5F97 {1}"},
-            {"appletclassloader.filenotfound", "\u5C0B\u627E {0} \u6642\u627E\u4E0D\u5230\u6A94\u6848"},
-            {"appletclassloader.fileformat", "\u8F09\u5165\u6642\u767C\u751F\u6A94\u6848\u683C\u5F0F\u7570\u5E38\u72C0\u6CC1: {0}"},
-            {"appletclassloader.fileioexception", "\u8F09\u5165\u6642\u767C\u751F I/O \u7570\u5E38\u72C0\u6CC1: {0}"},
-            {"appletclassloader.fileexception", "\u8F09\u5165\u6642\u767C\u751F {0} \u7570\u5E38\u72C0\u6CC1: {1}"},
-            {"appletclassloader.filedeath", "\u8F09\u5165\u6642\u522A\u9664 {0}: {1}"},
-            {"appletclassloader.fileerror", "\u8F09\u5165\u6642\u767C\u751F {0} \u932F\u8AA4: {1}"},
-            {"appletclassloader.findclass.verbose.openstream", "\u958B\u555F {0} \u7684\u4E32\u6D41\u4EE5\u53D6\u5F97 {1}"},
-            {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource \u7684\u540D\u7A31: {0}"},
-            {"appletclassloader.getresource.verbose.found", "\u627E\u5230\u8CC7\u6E90: {0} \u4F5C\u70BA\u7CFB\u7D71\u8CC7\u6E90"},
-            {"appletclassloader.getresourceasstream.verbose", "\u627E\u5230\u8CC7\u6E90: {0} \u4F5C\u70BA\u7CFB\u7D71\u8CC7\u6E90"},
-            {"appletpanel.runloader.err", "\u7269\u4EF6\u6216\u4EE3\u78BC\u53C3\u6578\uFF01"},
-            {"appletpanel.runloader.exception", "\u9084\u539F\u5E8F\u5217\u5316 {0} \u6642\u767C\u751F\u7570\u5E38\u72C0\u6CC1"},
-            {"appletpanel.destroyed", "\u5DF2\u640D\u6BC0 Applet\u3002"},
-            {"appletpanel.loaded", "\u5DF2\u8F09\u5165 Applet\u3002"},
-            {"appletpanel.started", "\u5DF2\u555F\u7528 Applet\u3002"},
-            {"appletpanel.inited", "\u5DF2\u8D77\u59CB Applet\u3002"},
-            {"appletpanel.stopped", "\u5DF2\u505C\u6B62 Applet\u3002"},
-            {"appletpanel.disposed", "\u5DF2\u8655\u7F6E Applet\u3002"},
-            {"appletpanel.nocode", "APPLET \u6A19\u8A18\u907A\u6F0F CODE \u53C3\u6578\u3002"},
-            {"appletpanel.notfound", "\u8F09\u5165: \u627E\u4E0D\u5230\u985E\u5225 {0}\u3002"},
-            {"appletpanel.nocreate", "\u8F09\u5165: \u7121\u6CD5\u5EFA\u7ACB {0}\u3002"},
-            {"appletpanel.noconstruct", "\u8F09\u5165: {0} \u975E\u516C\u7528\u6216\u6C92\u6709\u516C\u7528\u5EFA\u69CB\u5B50\u3002"},
-            {"appletpanel.death", "\u5DF2\u522A\u9664"},
-            {"appletpanel.exception", "\u7570\u5E38\u72C0\u6CC1: {0}\u3002"},
-            {"appletpanel.exception2", "\u7570\u5E38\u72C0\u6CC1: {0}: {1}\u3002"},
-            {"appletpanel.error", "\u932F\u8AA4: {0}\u3002"},
-            {"appletpanel.error2", "\u932F\u8AA4: {0}: {1}\u3002"},
-            {"appletpanel.notloaded", "\u8D77\u59CB: \u672A\u8F09\u5165 Applet\u3002"},
-            {"appletpanel.notinited", "\u555F\u52D5: \u672A\u8D77\u59CB Applet\u3002"},
-            {"appletpanel.notstarted", "\u505C\u6B62: \u672A\u555F\u52D5 Applet\u3002"},
-            {"appletpanel.notstopped", "\u640D\u6BC0: \u672A\u505C\u6B62 Applet\u3002"},
-            {"appletpanel.notdestroyed", "\u8655\u7F6E: \u672A\u640D\u6BC0 Applet\u3002"},
-            {"appletpanel.notdisposed", "\u8F09\u5165: \u672A\u8655\u7F6E Applet\u3002"},
-            {"appletpanel.bail", "\u5DF2\u4E2D\u65B7: \u6B63\u5728\u7D50\u675F\u3002"},
-            {"appletpanel.filenotfound", "\u5C0B\u627E {0} \u6642\u627E\u4E0D\u5230\u6A94\u6848"},
-            {"appletpanel.fileformat", "\u8F09\u5165\u6642\u767C\u751F\u6A94\u6848\u683C\u5F0F\u7570\u5E38\u72C0\u6CC1: {0}"},
-            {"appletpanel.fileioexception", "\u8F09\u5165\u6642\u767C\u751F I/O \u7570\u5E38\u72C0\u6CC1: {0}"},
-            {"appletpanel.fileexception", "\u8F09\u5165\u6642\u767C\u751F {0} \u7570\u5E38\u72C0\u6CC1: {1}"},
-            {"appletpanel.filedeath", "\u8F09\u5165\u6642\u522A\u9664 {0}: {1}"},
-            {"appletpanel.fileerror", "\u8F09\u5165\u6642\u767C\u751F {0} \u932F\u8AA4: {1}"},
-            {"appletpanel.badattribute.exception", "HTML \u5256\u6790: \u5BEC\u5EA6/\u9AD8\u5EA6\u5C6C\u6027\u7684\u503C\u4E0D\u6B63\u78BA"},
-            {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream \u9700\u8981\u975E\u7A7A\u503C\u8F09\u5165\u5668"},
-            {"appletprops.title", "AppletViewer \u5C6C\u6027"},
-            {"appletprops.label.http.server", "Http \u4EE3\u7406\u4E3B\u6A5F\u4F3A\u670D\u5668:"},
-            {"appletprops.label.http.proxy", "Http \u4EE3\u7406\u4E3B\u6A5F\u9023\u63A5\u57E0:"},
-            {"appletprops.label.network", "\u7DB2\u8DEF\u5B58\u53D6:"},
-            {"appletprops.choice.network.item.none", "\u7121"},
-            {"appletprops.choice.network.item.applethost", "Applet \u4E3B\u6A5F"},
-            {"appletprops.choice.network.item.unrestricted", "\u4E0D\u53D7\u9650\u5236"},
-            {"appletprops.label.class", "\u985E\u5225\u5B58\u53D6:"},
-            {"appletprops.choice.class.item.restricted", "\u53D7\u9650\u5236"},
-            {"appletprops.choice.class.item.unrestricted", "\u4E0D\u53D7\u9650\u5236"},
-            {"appletprops.label.unsignedapplet", "\u5141\u8A31\u672A\u7C3D\u7F72\u7684 Applet:"},
-            {"appletprops.choice.unsignedapplet.no", "\u5426"},
-            {"appletprops.choice.unsignedapplet.yes", "\u662F"},
-            {"appletprops.button.apply", "\u5957\u7528"},
-            {"appletprops.button.cancel", "\u53D6\u6D88"},
-            {"appletprops.button.reset", "\u91CD\u8A2D"},
-            {"appletprops.apply.exception", "\u7121\u6CD5\u5132\u5B58\u5C6C\u6027: {0}"},
-            /* 4066432 */
-            {"appletprops.title.invalidproxy", "\u7121\u6548\u7684\u9805\u76EE"},
-            {"appletprops.label.invalidproxy", "\u4EE3\u7406\u4E3B\u6A5F\u9023\u63A5\u57E0\u5FC5\u9808\u662F\u6B63\u6574\u6578\u503C\u3002"},
-            {"appletprops.button.ok", "\u78BA\u5B9A"},
-            /* end 4066432 */
-            {"appletprops.prop.store", "AppletViewer \u7684\u4F7F\u7528\u8005\u7279\u5B9A\u5C6C\u6027"},
-            {"appletsecurityexception.checkcreateclassloader", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: classloader"},
-            {"appletsecurityexception.checkaccess.thread", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: thread"},
-            {"appletsecurityexception.checkaccess.threadgroup", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: threadgroup: {0}"},
-            {"appletsecurityexception.checkexit", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: exit: {0}"},
-            {"appletsecurityexception.checkexec", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: exec: {0}"},
-            {"appletsecurityexception.checklink", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: link: {0}"},
-            {"appletsecurityexception.checkpropsaccess", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u5C6C\u6027"},
-            {"appletsecurityexception.checkpropsaccess.key", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u5C6C\u6027\u5B58\u53D6 {0}"},
-            {"appletsecurityexception.checkread.exception1", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: {0}\uFF0C{1}"},
-            {"appletsecurityexception.checkread.exception2", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: file.read: {0}"},
-            {"appletsecurityexception.checkread", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: file.read: {0} == {1}"},
-            {"appletsecurityexception.checkwrite.exception", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: {0}\uFF0C{1}"},
-            {"appletsecurityexception.checkwrite", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: file.write: {0} == {1}"},
-            {"appletsecurityexception.checkread.fd", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: fd.read"},
-            {"appletsecurityexception.checkwrite.fd", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: fd.write"},
-            {"appletsecurityexception.checklisten", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: socket.listen: {0}"},
-            {"appletsecurityexception.checkaccept", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: socket.accept: {0}:{1}"},
-            {"appletsecurityexception.checkconnect.networknone", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: socket.connect: {0}->{1}"},
-            {"appletsecurityexception.checkconnect.networkhost1", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u7121\u6CD5\u5F9E\u4F86\u6E90 {1} \u9023\u7DDA\u81F3 {0}\u3002"},
-            {"appletsecurityexception.checkconnect.networkhost2", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u7121\u6CD5\u89E3\u6790\u4E3B\u6A5F {0} \u6216 {1} \u7684 IP\u3002"},
-            {"appletsecurityexception.checkconnect.networkhost3", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u7121\u6CD5\u89E3\u6790\u4E3B\u6A5F {0} \u7684 IP\u3002\u8ACB\u53C3\u95B1 trustProxy \u5C6C\u6027\u3002"},
-            {"appletsecurityexception.checkconnect", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: connect: {0}->{1}"},
-            {"appletsecurityexception.checkpackageaccess", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u7121\u6CD5\u5B58\u53D6\u5957\u88DD\u7A0B\u5F0F: {0}"},
-            {"appletsecurityexception.checkpackagedefinition", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u7121\u6CD5\u5B9A\u7FA9\u5957\u88DD\u7A0B\u5F0F: {0}"},
-            {"appletsecurityexception.cannotsetfactory", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u7121\u6CD5\u8A2D\u5B9A\u8655\u7406\u7AD9"},
-            {"appletsecurityexception.checkmemberaccess", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u6AA2\u67E5\u6210\u54E1\u5B58\u53D6"},
-            {"appletsecurityexception.checkgetprintjob", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: getPrintJob"},
-            {"appletsecurityexception.checksystemclipboardaccess", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: getSystemClipboard"},
-            {"appletsecurityexception.checkawteventqueueaccess", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: getEventQueue"},
-            {"appletsecurityexception.checksecurityaccess", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u5B89\u5168\u4F5C\u696D: {0}"},
-            {"appletsecurityexception.getsecuritycontext.unknown", "\u4E0D\u660E\u7684\u985E\u5225\u8F09\u5165\u5668\u985E\u578B\u3002\u7121\u6CD5\u6AA2\u67E5 getContext"},
-            {"appletsecurityexception.checkread.unknown", "\u4E0D\u660E\u7684\u985E\u5225\u8F09\u5165\u5668\u985E\u578B\u3002\u7121\u6CD5\u6AA2\u67E5 read {0}"},
-            {"appletsecurityexception.checkconnect.unknown", "\u4E0D\u660E\u7684\u985E\u5225\u8F09\u5165\u5668\u985E\u578B\u3002\u7121\u6CD5\u6AA2\u67E5\u9023\u7DDA"},
-        };
-
-        return temp;
-    }
-}
--- a/src/java.desktop/share/classes/sun/java2d/SunGraphicsEnvironment.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/sun/java2d/SunGraphicsEnvironment.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -33,40 +33,26 @@
 import java.awt.GraphicsDevice;
 import java.awt.GraphicsEnvironment;
 import java.awt.Insets;
+import java.awt.Point;
 import java.awt.Rectangle;
 import java.awt.Toolkit;
-import java.awt.font.TextAttribute;
+import java.awt.geom.AffineTransform;
 import java.awt.image.BufferedImage;
 import java.awt.peer.ComponentPeer;
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.FilenameFilter;
 import java.io.InputStreamReader;
-import java.io.IOException;
-import java.text.AttributedCharacterIterator;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
+import java.security.AccessController;
 import java.util.Locale;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import java.util.StringTokenizer;
 import java.util.TreeMap;
-import java.util.Vector;
-import java.util.concurrent.ConcurrentHashMap;
-import sun.awt.AppContext;
+
 import sun.awt.DisplayChangedListener;
-import sun.awt.FontConfiguration;
 import sun.awt.SunDisplayChanger;
-import sun.font.CompositeFontDescriptor;
-import sun.font.Font2D;
 import sun.font.FontManager;
 import sun.font.FontManagerFactory;
 import sun.font.FontManagerForSGE;
-import sun.font.NativeFont;
-import java.security.AccessController;
+import sun.java2d.pipe.Region;
 import sun.security.action.GetPropertyAction;
 
 /**
@@ -389,4 +375,48 @@
             return -1;
         }
     }
+
+    /**
+     * Returns the graphics configuration which bounds contain the given point.
+     *
+     * @param  current the default configuration which is checked in the first
+     *         place
+     * @param  x the x coordinate of the given point
+     * @param  y the y coordinate of the given point
+     * @return the graphics configuration
+     */
+    public static GraphicsConfiguration getGraphicsConfigurationAtPoint(
+            GraphicsConfiguration current, double x, double y) {
+        if (current.getBounds().contains(x, y)) {
+            return current;
+        }
+        GraphicsEnvironment env = getLocalGraphicsEnvironment();
+        for (GraphicsDevice device : env.getScreenDevices()) {
+            GraphicsConfiguration config = device.getDefaultConfiguration();
+            if (config.getBounds().contains(x, y)) {
+                return config;
+            }
+        }
+        return current;
+    }
+
+    /**
+     * Converts coordinates from the user's space to the device space using
+     * appropriate device transformation.
+     *
+     * @param  x coordinate in the user space
+     * @param  y coordinate in the user space
+     * @return the point which uses device space(pixels)
+     */
+    public static Point convertToDeviceSpace(double x, double y) {
+        GraphicsConfiguration gc = getLocalGraphicsEnvironment()
+                        .getDefaultScreenDevice().getDefaultConfiguration();
+        gc = getGraphicsConfigurationAtPoint(gc, x, y);
+
+        AffineTransform tx = gc.getDefaultTransform();
+        x = Region.clipRound(x * tx.getScaleX());
+        y = Region.clipRound(y * tx.getScaleY());
+
+        return new Point((int) x, (int) y);
+    }
 }
--- a/src/java.desktop/share/classes/sun/print/DialogOnTop.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.print;
-
-import javax.print.attribute.Attribute;
-import javax.print.attribute.PrintRequestAttribute;
-
-/*
- * An implementation class used to request the dialog be set always-on-top.
- * It needs to be read and honoured by the dialog code which will use
- * java.awt.Window.setAlwaysOnTop(true) in cases where it is supported.
- */
-public class DialogOnTop implements PrintRequestAttribute {
-
-    private static final long serialVersionUID = -1901909867156076547L;
-
-    long id;
-
-    public DialogOnTop() {
-    }
-
-    public DialogOnTop(long id) {
-        this.id = id;
-    }
-
-    public final Class<? extends Attribute> getCategory() {
-        return DialogOnTop.class;
-    }
-
-    public long getID() {
-        return id;
-    }
-
-    public final String getName() {
-        return "dialog-on-top";
-    }
-
-    public String toString() {
-       return "dialog-on-top";
-    }
-}
--- a/src/java.desktop/share/classes/sun/print/DialogOwner.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.print;
-
-import java.awt.Dialog;
-import javax.print.attribute.Attribute;
-import javax.print.attribute.PrintRequestAttribute;
-import java.awt.Frame;
-import java.awt.Window;
-
-/**
- * Class DialogOwner is a printing attribute class that identifies
- * the window that owns the print dialog.
- *
- * <P>
- * <B>IPP Compatibility:</B> This is not an IPP attribute.
- * <P>
- *
- */
-@SuppressWarnings("serial") // JDK-implementation class
-public final class DialogOwner
-    implements PrintRequestAttribute {
-
-    private Window dlgOwner;
-
-    /**
-     * Construct a new dialog owner attribute with the given frame.
-     *
-     * @param  frame the frame that owns the print dialog
-     */
-    public DialogOwner(Frame frame) {
-        dlgOwner = frame;
-    }
-
-    /**
-     * Construct a new dialog owner attribute with the given dialog.
-     *
-     * @param  dialog the dialog that owns the print dialog
-     */
-    public DialogOwner(Dialog dialog) {
-        dlgOwner = dialog;
-    }
-
-    /**
-     * Returns the string table for class DialogOwner.
-     */
-    public Window getOwner() {
-        return dlgOwner;
-    }
-
-
-    /**
-     * Get the printing attribute class which is to be used as the "category"
-     * for this printing attribute value.
-     * <P>
-     * For class DialogOwner the category is class
-     * DialogOwner itself.
-     *
-     * @return  Printing attribute class (category), an instance of class
-     *          {@link java.lang.Class java.lang.Class}.
-     */
-    public Class<? extends Attribute> getCategory() {
-        return DialogOwner.class;
-    }
-
-
-    /**
-     * Get the name of the category of which this attribute value is an
-     * instance.
-     * <P>
-     * For class DialogOwner the category name is
-     * {@code "dialog-owner"}.
-     *
-     * @return  Attribute category name.
-     */
-    public String getName() {
-        return "dialog-owner";
-    }
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/share/classes/sun/print/DialogOwnerAccessor.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.print;
+
+import javax.print.attribute.standard.DialogOwner;
+
+public abstract class DialogOwnerAccessor {
+
+    public abstract long getOwnerID(DialogOwner owner);
+
+    public static DialogOwnerAccessor accessor = null;
+
+    public static void setAccessor(DialogOwnerAccessor acc) {
+        accessor = acc;
+    }
+
+    public static long getID(DialogOwner owner) {
+        if (accessor == null || owner == null) {
+            return 0;
+        } else {
+            return accessor.getOwnerID(owner);
+        }
+    }
+}
--- a/src/java.desktop/share/classes/sun/print/PrintJob2D.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/sun/print/PrintJob2D.java	Mon Jun 11 09:29:44 2018 +0200
@@ -60,6 +60,7 @@
 import javax.print.attribute.standard.Copies;
 import javax.print.attribute.standard.Destination;
 import javax.print.attribute.standard.DialogTypeSelection;
+import javax.print.attribute.standard.DialogOwner;
 import javax.print.attribute.standard.JobName;
 import javax.print.attribute.standard.MediaSize;
 import javax.print.attribute.standard.PrintQuality;
--- a/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java	Mon Jun 11 09:29:44 2018 +0200
@@ -74,6 +74,7 @@
 import javax.print.attribute.standard.Copies;
 import javax.print.attribute.standard.Destination;
 import javax.print.attribute.standard.DialogTypeSelection;
+import javax.print.attribute.standard.DialogOwner;
 import javax.print.attribute.standard.Fidelity;
 import javax.print.attribute.standard.JobName;
 import javax.print.attribute.standard.JobSheets;
@@ -830,17 +831,24 @@
         int x = gcBounds.x+50;
         int y = gcBounds.y+50;
         ServiceDialog pageDialog;
+        boolean setOnTop = false;
         if (onTop != null) {
             attributes.add(onTop);
+            Window owner = onTop.getOwner();
+            if (owner != null) {
+                w = owner; // use the one specifed by the app
+            } else if (DialogOwnerAccessor.getID(onTop) == 0) {
+                setOnTop = true;
+            }
         }
-        if (w instanceof Frame) {
             pageDialog = new ServiceDialog(gc, x, y, service,
                                            DocFlavor.SERVICE_FORMATTED.PAGEABLE,
-                                           attributes,(Frame)w);
-        } else {
-            pageDialog = new ServiceDialog(gc, x, y, service,
-                                           DocFlavor.SERVICE_FORMATTED.PAGEABLE,
-                                           attributes, (Dialog)w);
+                                           attributes, w);
+        if (setOnTop) {
+            try {
+                pageDialog.setAlwaysOnTop(true);
+            } catch (SecurityException e) {
+            }
         }
 
         Rectangle dlgBounds = pageDialog.getBounds();
@@ -988,8 +996,7 @@
               * (it might be set in java.awt.PrintJob.printDialog)
               */
             if (attributes.get(DialogOwner.class) == null) {
-                attributes.add(w instanceof Frame ? new DialogOwner((Frame)w) :
-                                                    new DialogOwner((Dialog)w));
+                attributes.add(new DialogOwner(w));
             }
         } else {
             grCfg = GraphicsEnvironment.getLocalGraphicsEnvironment().
@@ -2581,7 +2588,7 @@
         }
     }
 
-    private DialogOnTop onTop = null;
+    private DialogOwner onTop = null;
 
     private long parentWindowID = 0L;
 
@@ -2597,9 +2604,9 @@
 
     private void setParentWindowID(PrintRequestAttributeSet attrs) {
         parentWindowID = 0L;
-        onTop = (DialogOnTop)attrs.get(DialogOnTop.class);
+        onTop = (DialogOwner)attrs.get(DialogOwner.class);
         if (onTop != null) {
-            parentWindowID = onTop.getID();
+            parentWindowID = DialogOwnerAccessor.getID(onTop);
         }
     }
 }
--- a/src/java.desktop/share/classes/sun/print/ServiceDialog.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/sun/print/ServiceDialog.java	Mon Jun 11 09:29:44 2018 +0200
@@ -38,6 +38,7 @@
 import java.awt.GridLayout;
 import java.awt.Insets;
 import java.awt.Toolkit;
+import java.awt.Window;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.FocusEvent;
@@ -136,33 +137,13 @@
                          int defaultServiceIndex,
                          DocFlavor flavor,
                          PrintRequestAttributeSet attributes,
-                         Dialog dialog)
+                         Window window)
     {
-        super(dialog, getMsg("dialog.printtitle"), true, gc);
+        super(window, getMsg("dialog.printtitle"), Dialog.DEFAULT_MODALITY_TYPE, gc);
         initPrintDialog(x, y, services, defaultServiceIndex,
                         flavor, attributes);
     }
 
-
-
-    /**
-     * Constructor for the "standard" print dialog (containing all relevant
-     * tabs)
-     */
-    public ServiceDialog(GraphicsConfiguration gc,
-                         int x, int y,
-                         PrintService[] services,
-                         int defaultServiceIndex,
-                         DocFlavor flavor,
-                         PrintRequestAttributeSet attributes,
-                         Frame frame)
-    {
-        super(frame, getMsg("dialog.printtitle"), true, gc);
-        initPrintDialog(x, y, services, defaultServiceIndex,
-                        flavor, attributes);
-    }
-
-
     /**
      * Initialize print dialog.
      */
@@ -184,8 +165,22 @@
             isAWT = true;
         }
 
-        if (attributes.get(DialogOnTop.class) != null) {
-            setAlwaysOnTop(true);
+        if (attributes.get(DialogOwner.class) != null) {
+            DialogOwner owner = (DialogOwner)attributes.get(DialogOwner.class);
+            /* When the ServiceDialog is constructed the caller of the
+             * constructor checks for this attribute and if it specifies a
+             * window then it will use that in the constructor instead of
+             * inferring one from keyboard focus.
+             * In this case the owner of the dialog is the same as that
+             * specified in the attribute and we do not need to set the
+             * on top property
+             */
+            if ((getOwner() == null) || (owner.getOwner() != getOwner())) {
+                try {
+                    setAlwaysOnTop(true);
+                } catch (SecurityException e) {
+                }
+            }
         }
         Container c = getContentPane();
         c.setLayout(new BorderLayout());
@@ -244,28 +239,13 @@
                          PrintService ps,
                          DocFlavor flavor,
                          PrintRequestAttributeSet attributes,
-                         Dialog dialog)
+                         Window window)
     {
-        super(dialog, getMsg("dialog.pstitle"), true, gc);
+        super(window, getMsg("dialog.pstitle"), Dialog.DEFAULT_MODALITY_TYPE, gc);
         initPageDialog(x, y, ps, flavor, attributes);
     }
 
     /**
-     * Constructor for the solitary "page setup" dialog
-     */
-    public ServiceDialog(GraphicsConfiguration gc,
-                         int x, int y,
-                         PrintService ps,
-                         DocFlavor flavor,
-                         PrintRequestAttributeSet attributes,
-                         Frame frame)
-    {
-        super(frame, getMsg("dialog.pstitle"), true, gc);
-        initPageDialog(x, y, ps, flavor, attributes);
-    }
-
-
-    /**
      * Initialize "page setup" dialog
      */
     void initPageDialog(int x, int y,
@@ -278,8 +258,15 @@
         this.asOriginal = attributes;
         this.asCurrent = new HashPrintRequestAttributeSet(attributes);
 
-        if (attributes.get(DialogOnTop.class) != null) {
-            setAlwaysOnTop(true);
+        if (attributes.get(DialogOwner.class) != null) {
+            /* See comments in same block in initPrintDialog */
+            DialogOwner owner = (DialogOwner)attributes.get(DialogOwner.class);
+            if ((getOwner() == null) || (owner.getOwner() != getOwner())) {
+                try {
+                    setAlwaysOnTop(true);
+                } catch (SecurityException e) {
+                }
+            }
         }
 
         Container c = getContentPane();
--- a/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -52,6 +52,7 @@
 import javax.swing.tree.TreeModel;
 import javax.swing.tree.TreePath;
 
+import sun.java2d.pipe.Region;
 import sun.print.ProxyPrintGraphics;
 import sun.awt.*;
 import java.io.*;
@@ -2241,35 +2242,6 @@
     }
 
     /**
-     *
-     * Returns the graphics configuration which bounds contain the given
-     * point
-     *
-     * @param current the default configuration which is checked in the first place
-     * @param x the x coordinate of the given point
-     * @param y the y coordinate of the given point
-     * @return the graphics configuration
-     */
-    public static GraphicsConfiguration getGraphicsConfigurationAtPoint(GraphicsConfiguration current, double x, double y) {
-
-        if (current.getBounds().contains(x, y)) {
-            return current;
-        }
-
-        GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
-        GraphicsDevice[] devices = env.getScreenDevices();
-
-        for (GraphicsDevice device : devices) {
-            GraphicsConfiguration config = device.getDefaultConfiguration();
-            if (config.getBounds().contains(x, y)) {
-                return config;
-            }
-        }
-
-        return current;
-    }
-
-    /**
      * Used to listen to "blit" repaints in RepaintManager.
      */
     public interface RepaintListener {
--- a/src/java.desktop/share/legal/freetype.md	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/legal/freetype.md	Mon Jun 11 09:29:44 2018 +0200
@@ -1,4 +1,4 @@
-## The FreeType Project: Freetype v2.9
+## The FreeType Project: Freetype v2.9.1
 
 
 ### FreeType Notice
--- a/src/java.desktop/share/native/libfreetype/UPDATING.txt	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/UPDATING.txt	Mon Jun 11 09:29:44 2018 +0200
@@ -12,6 +12,8 @@
 Before attempting compilation be sure to diff the JDK copy and the freetype copy
 of src/java.desktop/share/native/libfreetype/include/freetype/config/ftoption.h
 and re-apply the same edits made for the JDK option file.
+Also modules the JDK does not include must be commented out in
+src/java.desktop/share/native/libfreetype/include/freetype/config/ftmodule.h.
 Notably JDK is not using GZIP or LZW or BDF support which are on by default
 for the freetype distribution.
 If you don't make the edits the build will fail due to not copying the relevant
--- a/src/java.desktop/share/native/libfreetype/include/freetype/config/ftconfig.h	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/include/freetype/config/ftconfig.h	Mon Jun 11 09:29:44 2018 +0200
@@ -422,9 +422,9 @@
 #endif /* !FT_BASE_DEF */
 
 
-  /*   When compiling FreeType as a DLL, some systems/compilers need a     */
-  /*   special attribute in front OR after the return type of function     */
-  /*   declarations.                                                       */
+  /*   When compiling FreeType as a DLL or DSO with hidden visibility      */
+  /*   some systems/compilers need a special attribute in front OR after   */
+  /*   the return type of function declarations.                           */
   /*                                                                       */
   /*   Two macros are used within the FreeType source code to define       */
   /*   exported library functions: FT_EXPORT and FT_EXPORT_DEF.            */
@@ -455,19 +455,28 @@
   /*                                                                       */
 #ifndef FT_EXPORT
 
-#ifdef __cplusplus
+#ifdef FT2_BUILD_LIBRARY
+
+#if defined( _WIN32 ) && ( defined( _DLL ) || defined( DLL_EXPORT ) )
+#define FT_EXPORT( x )  __declspec( dllexport )  x
+#elif defined( __GNUC__ ) && __GNUC__ >= 4
+#define FT_EXPORT( x )  __attribute__(( visibility( "default" ) ))  x
+#elif defined( __cplusplus )
 #define FT_EXPORT( x )  extern "C"  x
 #else
 #define FT_EXPORT( x )  extern  x
 #endif
 
-#ifdef _MSC_VER
-#undef FT_EXPORT
-#ifdef _DLL
-#define FT_EXPORT( x )  __declspec( dllexport )  x
 #else
+
+#if defined( FT2_DLLIMPORT )
 #define FT_EXPORT( x )  __declspec( dllimport )  x
+#elif defined( __cplusplus )
+#define FT_EXPORT( x )  extern "C"  x
+#else
+#define FT_EXPORT( x )  extern  x
 #endif
+
 #endif
 
 #endif /* !FT_EXPORT */
--- a/src/java.desktop/share/native/libfreetype/include/freetype/config/ftoption.h	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/include/freetype/config/ftoption.h	Mon Jun 11 09:29:44 2018 +0200
@@ -82,6 +82,10 @@
   /* to control the various font drivers and modules.  The controllable    */
   /* properties are listed in the section @properties.                     */
   /*                                                                       */
+  /* You have to undefine this configuration option on platforms that lack */
+  /* the concept of environment variables (and thus don't have the         */
+  /* `getenv' function), for example Windows CE.                           */
+  /*                                                                       */
   /* `FREETYPE_PROPERTIES' has the following syntax form (broken here into */
   /* multiple lines for better readability).                               */
   /*                                                                       */
--- a/src/java.desktop/share/native/libfreetype/include/freetype/freetype.h	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/include/freetype/freetype.h	Mon Jun 11 09:29:44 2018 +0200
@@ -724,11 +724,12 @@
   /*      Same as FT_ENCODING_JOHAB.  Deprecated.                          */
   /*                                                                       */
   /* <Note>                                                                */
-  /*    By default, FreeType automatically synthesizes a Unicode charmap   */
-  /*    for PostScript fonts, using their glyph name dictionaries.         */
-  /*    However, it also reports the encodings defined explicitly in the   */
-  /*    font file, for the cases when they are needed, with the Adobe      */
-  /*    values as well.                                                    */
+  /*    By default, FreeType enables a Unicode charmap and tags it with    */
+  /*    FT_ENCODING_UNICODE when it is either provided or can be generated */
+  /*    from PostScript glyph name dictionaries in the font file.          */
+  /*    All other encodings are considered legacy and tagged only if       */
+  /*    explicitly defined in the font file.  Otherwise, FT_ENCODING_NONE  */
+  /*    is used.                                                           */
   /*                                                                       */
   /*    FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap  */
   /*    is neither Unicode nor ISO-8859-1 (otherwise it is set to          */
@@ -1175,7 +1176,7 @@
   /*      interpolating between them.  Supported formats are Adobe MM,     */
   /*      TrueType GX, and OpenType variation fonts.                       */
   /*                                                                       */
-  /*      See the multiple-masters specific API for details.               */
+  /*      See section @multiple_masters for API details.                   */
   /*                                                                       */
   /*    FT_FACE_FLAG_GLYPH_NAMES ::                                        */
   /*      The face contains glyph names, which can be retrieved using      */
@@ -2062,8 +2063,8 @@
   /*    data :: A pointer to the parameter data.                           */
   /*                                                                       */
   /* <Note>                                                                */
-  /*    The ID and function of parameters are driver-specific.  See the    */
-  /*    various FT_PARAM_TAG_XXX flags for more information.               */
+  /*    The ID and function of parameters are driver-specific.  See        */
+  /*    section @parameter_tags for more information.                      */
   /*                                                                       */
   typedef struct  FT_Parameter_
   {
@@ -2833,6 +2834,10 @@
   /*    since its glyph indices are not listed in any of the font's        */
   /*    charmaps.                                                          */
   /*                                                                       */
+  /*    If no active cmap is set up (i.e., `face->charmap' is zero), the   */
+  /*    call to @FT_Get_Char_Index is omitted, and the function behaves    */
+  /*    identically to @FT_Load_Glyph.                                     */
+  /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Load_Char( FT_Face   face,
                 FT_ULong  char_code,
@@ -3065,7 +3070,7 @@
    *
    *     Advance widths are rounded to integer values; however, using the
    *     `lsb_delta' and `rsb_delta' fields of @FT_GlyphSlotRec, it is
-   *     possible to get fractional advance widths for sub-pixel positioning
+   *     possible to get fractional advance widths for subpixel positioning
    *     (which is recommended to use).
    *
    *     If configuration option AF_CONFIG_OPTION_TT_SIZE_METRICS is active,
@@ -3204,13 +3209,13 @@
   /*      opacity).                                                        */
   /*                                                                       */
   /*    FT_RENDER_MODE_LCD ::                                              */
-  /*      This mode corresponds to horizontal RGB and BGR sub-pixel        */
+  /*      This mode corresponds to horizontal RGB and BGR subpixel         */
   /*      displays like LCD screens.  It produces 8-bit bitmaps that are   */
   /*      3~times the width of the original glyph outline in pixels, and   */
   /*      which use the @FT_PIXEL_MODE_LCD mode.                           */
   /*                                                                       */
   /*    FT_RENDER_MODE_LCD_V ::                                            */
-  /*      This mode corresponds to vertical RGB and BGR sub-pixel displays */
+  /*      This mode corresponds to vertical RGB and BGR subpixel displays  */
   /*      (like PDA screens, rotated LCD displays, etc.).  It produces     */
   /*      8-bit bitmaps that are 3~times the height of the original        */
   /*      glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode.   */
@@ -4552,7 +4557,7 @@
    */
 #define FREETYPE_MAJOR  2
 #define FREETYPE_MINOR  9
-#define FREETYPE_PATCH  0
+#define FREETYPE_PATCH  1
 
 
   /*************************************************************************/
--- a/src/java.desktop/share/native/libfreetype/include/freetype/ftdriver.h	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/include/freetype/ftdriver.h	Mon Jun 11 09:29:44 2018 +0200
@@ -111,9 +111,9 @@
    *
    *   One of the reasons to not hint horizontally is antialiasing for LCD
    *   screens: The pixel geometry of modern displays supplies three
-   *   vertical sub-pixels as the eye moves horizontally across each visible
+   *   vertical subpixels as the eye moves horizontally across each visible
    *   pixel.  On devices where we can be certain this characteristic is
-   *   present a rasterizer can take advantage of the sub-pixels to add
+   *   present a rasterizer can take advantage of the subpixels to add
    *   increments of weight.  In Western writing systems this turns out to
    *   be the more critical direction anyway; the weights and spacing of
    *   vertical stems (see above) are central to Armenian, Cyrillic, Greek,
--- a/src/java.desktop/share/native/libfreetype/include/freetype/ftgasp.h	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/include/freetype/ftgasp.h	Mon Jun 11 09:29:44 2018 +0200
@@ -29,6 +29,9 @@
 #endif
 
 
+FT_BEGIN_HEADER
+
+
   /***************************************************************************
    *
    * @section:
@@ -131,6 +134,8 @@
   /* */
 
 
+FT_END_HEADER
+
 #endif /* FTGASP_H_ */
 
 
--- a/src/java.desktop/share/native/libfreetype/include/freetype/internal/ftobjs.h	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/include/freetype/internal/ftobjs.h	Mon Jun 11 09:29:44 2018 +0200
@@ -155,7 +155,7 @@
 
   } FT_CMapRec;
 
-  /* typecase any pointer to a charmap handle */
+  /* typecast any pointer to a charmap handle */
 #define FT_CMAP( x )  ( (FT_CMap)( x ) )
 
   /* obvious macros */
--- a/src/java.desktop/share/native/libfreetype/src/autofit/afblue.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/autofit/afblue.c	Mon Jun 11 09:29:44 2018 +0200
@@ -166,6 +166,10 @@
     '\0',
     '\xE2', '\xB4', '\x84', ' ', '\xE2', '\xB4', '\x85', ' ', '\xE2', '\xB4', '\x94', ' ', '\xE2', '\xB4', '\x95', ' ', '\xE2', '\xB4', '\x81', ' ', '\xE2', '\xB4', '\x82', ' ', '\xE2', '\xB4', '\x98', ' ', '\xE2', '\xB4', '\x9D',  /* ⴄ ⴅ ⴔ ⴕ ⴁ ⴂ ⴘ ⴝ */
     '\0',
+    '\xE1', '\xB2', '\x9C', ' ', '\xE1', '\xB2', '\x9F', ' ', '\xE1', '\xB2', '\xB3', ' ', '\xE1', '\xB2', '\xB8', ' ', '\xE1', '\xB2', '\x92', ' ', '\xE1', '\xB2', '\x94', ' ', '\xE1', '\xB2', '\x9D', ' ', '\xE1', '\xB2', '\xB4',  /* Ნ Ჟ Ჳ Ჸ Გ Ე Ო Ჴ */
+    '\0',
+    '\xE1', '\xB2', '\x98', ' ', '\xE1', '\xB2', '\xB2', ' ', '\xE1', '\xB2', '\x9D', ' ', '\xE1', '\xB2', '\xA9', ' ', '\xE1', '\xB2', '\x9B', ' ', '\xE1', '\xB2', '\xA8', ' ', '\xE1', '\xB2', '\xAF', ' ', '\xE1', '\xB2', '\xBD',  /* Ი Ჲ Ო Ჩ Მ Შ Ჯ Ჽ */
+    '\0',
     '\xE2', '\xB0', '\x85', ' ', '\xE2', '\xB0', '\x94', ' ', '\xE2', '\xB0', '\xAA', ' ', '\xE2', '\xB0', '\x84', ' ', '\xE2', '\xB0', '\x82', ' ', '\xE2', '\xB0', '\x8A', ' ', '\xE2', '\xB0', '\xAB', ' ', '\xE2', '\xB0', '\x8B',  /* Ⰵ Ⱄ Ⱚ Ⰴ Ⰲ Ⰺ Ⱛ Ⰻ */
     '\0',
     '\xE2', '\xB0', '\x85', ' ', '\xE2', '\xB0', '\x84', ' ', '\xE2', '\xB0', '\x82', ' ', '\xE2', '\xB0', '\xAA', ' ', '\xE2', '\xB0', '\x9E', ' ', '\xE2', '\xB0', '\xA1', ' ', '\xE2', '\xB0', '\x8A', ' ', '\xE2', '\xB0', '\x94',  /* Ⰵ Ⰴ Ⰲ Ⱚ Ⱎ Ⱑ Ⰺ Ⱄ */
@@ -539,6 +543,8 @@
     { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM,    0                                 },
     { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER,  AF_BLUE_PROPERTY_LATIN_TOP        },
     { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER, 0                                 },
+    { AF_BLUE_STRING_GEORGIAN_MTAVRULI_TOP,        AF_BLUE_PROPERTY_LATIN_TOP        },
+    { AF_BLUE_STRING_GEORGIAN_MTAVRULI_BOTTOM,     0                                 },
     { AF_BLUE_STRING_MAX,                          0                                 },
     { AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP,    AF_BLUE_PROPERTY_LATIN_TOP        },
     { AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM, 0                                 },
--- a/src/java.desktop/share/native/libfreetype/src/autofit/afblue.dat	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/autofit/afblue.dat	Mon Jun 11 09:29:44 2018 +0200
@@ -242,6 +242,11 @@
   AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER
     "ⴄ ⴅ ⴔ ⴕ ⴁ ⴂ ⴘ ⴝ"
 
+  AF_BLUE_STRING_GEORGIAN_MTAVRULI_TOP
+    "Ნ Ჟ Ჳ Ჸ Გ Ე Ო Ჴ"
+  AF_BLUE_STRING_GEORGIAN_MTAVRULI_BOTTOM
+    "Ი Ჲ Ო Ჩ Მ Შ Ჯ Ჽ"
+
   AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP
     "Ⰵ Ⱄ Ⱚ Ⰴ Ⰲ Ⰺ Ⱛ Ⰻ"
   AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM
@@ -795,13 +800,14 @@
     { AF_BLUE_STRING_ETHIOPIC_BOTTOM, 0                          }
     { AF_BLUE_STRING_MAX,             0                          }
 
-  // blue zones for Mtavruli are missing (not yet defined in Unicode)
   AF_BLUE_STRINGSET_GEOR
     { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP,       AF_BLUE_PROPERTY_LATIN_TOP      |
                                                    AF_BLUE_PROPERTY_LATIN_X_HEIGHT   }
     { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM,    0                                 }
     { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER,  AF_BLUE_PROPERTY_LATIN_TOP        }
     { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER, 0                                 }
+    { AF_BLUE_STRING_GEORGIAN_MTAVRULI_TOP,        AF_BLUE_PROPERTY_LATIN_TOP        }
+    { AF_BLUE_STRING_GEORGIAN_MTAVRULI_BOTTOM,     0                                 }
     { AF_BLUE_STRING_MAX,                          0                                 }
 
   AF_BLUE_STRINGSET_GEOK
--- a/src/java.desktop/share/native/libfreetype/src/autofit/afblue.h	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/autofit/afblue.h	Mon Jun 11 09:29:44 2018 +0200
@@ -147,119 +147,121 @@
     AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM = 1813,
     AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER = 1845,
     AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER = 1877,
-    AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP = 1909,
-    AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM = 1941,
-    AF_BLUE_STRING_GLAGOLITIC_SMALL_TOP = 1973,
-    AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM = 2005,
-    AF_BLUE_STRING_GOTHIC_TOP = 2037,
-    AF_BLUE_STRING_GOTHIC_BOTTOM = 2077,
-    AF_BLUE_STRING_GREEK_CAPITAL_TOP = 2097,
-    AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 2118,
-    AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 2136,
-    AF_BLUE_STRING_GREEK_SMALL = 2154,
-    AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 2178,
-    AF_BLUE_STRING_GUJARATI_TOP = 2202,
-    AF_BLUE_STRING_GUJARATI_BOTTOM = 2234,
-    AF_BLUE_STRING_GUJARATI_ASCENDER = 2266,
-    AF_BLUE_STRING_GUJARATI_DESCENDER = 2316,
-    AF_BLUE_STRING_GUJARATI_DIGIT_TOP = 2349,
-    AF_BLUE_STRING_GURMUKHI_BASE = 2369,
-    AF_BLUE_STRING_GURMUKHI_HEAD = 2401,
-    AF_BLUE_STRING_GURMUKHI_TOP = 2433,
-    AF_BLUE_STRING_GURMUKHI_BOTTOM = 2465,
-    AF_BLUE_STRING_GURMUKHI_DIGIT_TOP = 2497,
-    AF_BLUE_STRING_HEBREW_TOP = 2517,
-    AF_BLUE_STRING_HEBREW_BOTTOM = 2541,
-    AF_BLUE_STRING_HEBREW_DESCENDER = 2559,
-    AF_BLUE_STRING_KANNADA_TOP = 2574,
-    AF_BLUE_STRING_KANNADA_BOTTOM = 2618,
-    AF_BLUE_STRING_KAYAH_LI_TOP = 2650,
-    AF_BLUE_STRING_KAYAH_LI_BOTTOM = 2674,
-    AF_BLUE_STRING_KAYAH_LI_ASCENDER = 2694,
-    AF_BLUE_STRING_KAYAH_LI_DESCENDER = 2702,
-    AF_BLUE_STRING_KAYAH_LI_LARGE_DESCENDER = 2714,
-    AF_BLUE_STRING_KHMER_TOP = 2735,
-    AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP = 2759,
-    AF_BLUE_STRING_KHMER_BOTTOM = 2799,
-    AF_BLUE_STRING_KHMER_DESCENDER = 2831,
-    AF_BLUE_STRING_KHMER_LARGE_DESCENDER = 2865,
-    AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP = 2952,
-    AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM = 2960,
-    AF_BLUE_STRING_LAO_TOP = 2968,
-    AF_BLUE_STRING_LAO_BOTTOM = 3000,
-    AF_BLUE_STRING_LAO_ASCENDER = 3032,
-    AF_BLUE_STRING_LAO_LARGE_ASCENDER = 3048,
-    AF_BLUE_STRING_LAO_DESCENDER = 3060,
-    AF_BLUE_STRING_LATIN_CAPITAL_TOP = 3084,
-    AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 3100,
-    AF_BLUE_STRING_LATIN_SMALL_F_TOP = 3116,
-    AF_BLUE_STRING_LATIN_SMALL_TOP = 3130,
-    AF_BLUE_STRING_LATIN_SMALL_BOTTOM = 3146,
-    AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 3162,
-    AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 3172,
-    AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 3192,
-    AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 3212,
-    AF_BLUE_STRING_LATIN_SUBS_SMALL = 3232,
-    AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 3268,
-    AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 3288,
-    AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 3319,
-    AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 3348,
-    AF_BLUE_STRING_LATIN_SUPS_SMALL = 3374,
-    AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 3399,
-    AF_BLUE_STRING_LISU_TOP = 3410,
-    AF_BLUE_STRING_LISU_BOTTOM = 3442,
-    AF_BLUE_STRING_MALAYALAM_TOP = 3474,
-    AF_BLUE_STRING_MALAYALAM_BOTTOM = 3518,
-    AF_BLUE_STRING_MYANMAR_TOP = 3550,
-    AF_BLUE_STRING_MYANMAR_BOTTOM = 3582,
-    AF_BLUE_STRING_MYANMAR_ASCENDER = 3614,
-    AF_BLUE_STRING_MYANMAR_DESCENDER = 3642,
-    AF_BLUE_STRING_NKO_TOP = 3674,
-    AF_BLUE_STRING_NKO_BOTTOM = 3698,
-    AF_BLUE_STRING_NKO_SMALL_TOP = 3713,
-    AF_BLUE_STRING_NKO_SMALL_BOTTOM = 3722,
-    AF_BLUE_STRING_OL_CHIKI = 3734,
-    AF_BLUE_STRING_OLD_TURKIC_TOP = 3758,
-    AF_BLUE_STRING_OLD_TURKIC_BOTTOM = 3773,
-    AF_BLUE_STRING_OSAGE_CAPITAL_TOP = 3793,
-    AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM = 3833,
-    AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER = 3863,
-    AF_BLUE_STRING_OSAGE_SMALL_TOP = 3878,
-    AF_BLUE_STRING_OSAGE_SMALL_BOTTOM = 3918,
-    AF_BLUE_STRING_OSAGE_SMALL_ASCENDER = 3958,
-    AF_BLUE_STRING_OSAGE_SMALL_DESCENDER = 3983,
-    AF_BLUE_STRING_OSMANYA_TOP = 3998,
-    AF_BLUE_STRING_OSMANYA_BOTTOM = 4038,
-    AF_BLUE_STRING_SAURASHTRA_TOP = 4078,
-    AF_BLUE_STRING_SAURASHTRA_BOTTOM = 4110,
-    AF_BLUE_STRING_SHAVIAN_TOP = 4130,
-    AF_BLUE_STRING_SHAVIAN_BOTTOM = 4140,
-    AF_BLUE_STRING_SHAVIAN_DESCENDER = 4165,
-    AF_BLUE_STRING_SHAVIAN_SMALL_TOP = 4175,
-    AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM = 4210,
-    AF_BLUE_STRING_SINHALA_TOP = 4225,
-    AF_BLUE_STRING_SINHALA_BOTTOM = 4257,
-    AF_BLUE_STRING_SINHALA_DESCENDER = 4289,
-    AF_BLUE_STRING_SUNDANESE_TOP = 4333,
-    AF_BLUE_STRING_SUNDANESE_BOTTOM = 4357,
-    AF_BLUE_STRING_SUNDANESE_DESCENDER = 4389,
-    AF_BLUE_STRING_TAI_VIET_TOP = 4397,
-    AF_BLUE_STRING_TAI_VIET_BOTTOM = 4417,
-    AF_BLUE_STRING_TAMIL_TOP = 4429,
-    AF_BLUE_STRING_TAMIL_BOTTOM = 4461,
-    AF_BLUE_STRING_TELUGU_TOP = 4493,
-    AF_BLUE_STRING_TELUGU_BOTTOM = 4521,
-    AF_BLUE_STRING_THAI_TOP = 4549,
-    AF_BLUE_STRING_THAI_BOTTOM = 4573,
-    AF_BLUE_STRING_THAI_ASCENDER = 4601,
-    AF_BLUE_STRING_THAI_LARGE_ASCENDER = 4613,
-    AF_BLUE_STRING_THAI_DESCENDER = 4625,
-    AF_BLUE_STRING_THAI_LARGE_DESCENDER = 4641,
-    AF_BLUE_STRING_THAI_DIGIT_TOP = 4649,
-    AF_BLUE_STRING_TIFINAGH = 4661,
-    AF_BLUE_STRING_VAI_TOP = 4693,
-    AF_BLUE_STRING_VAI_BOTTOM = 4725,
-    af_blue_1_1 = 4756,
+    AF_BLUE_STRING_GEORGIAN_MTAVRULI_TOP = 1909,
+    AF_BLUE_STRING_GEORGIAN_MTAVRULI_BOTTOM = 1941,
+    AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP = 1973,
+    AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM = 2005,
+    AF_BLUE_STRING_GLAGOLITIC_SMALL_TOP = 2037,
+    AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM = 2069,
+    AF_BLUE_STRING_GOTHIC_TOP = 2101,
+    AF_BLUE_STRING_GOTHIC_BOTTOM = 2141,
+    AF_BLUE_STRING_GREEK_CAPITAL_TOP = 2161,
+    AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 2182,
+    AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 2200,
+    AF_BLUE_STRING_GREEK_SMALL = 2218,
+    AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 2242,
+    AF_BLUE_STRING_GUJARATI_TOP = 2266,
+    AF_BLUE_STRING_GUJARATI_BOTTOM = 2298,
+    AF_BLUE_STRING_GUJARATI_ASCENDER = 2330,
+    AF_BLUE_STRING_GUJARATI_DESCENDER = 2380,
+    AF_BLUE_STRING_GUJARATI_DIGIT_TOP = 2413,
+    AF_BLUE_STRING_GURMUKHI_BASE = 2433,
+    AF_BLUE_STRING_GURMUKHI_HEAD = 2465,
+    AF_BLUE_STRING_GURMUKHI_TOP = 2497,
+    AF_BLUE_STRING_GURMUKHI_BOTTOM = 2529,
+    AF_BLUE_STRING_GURMUKHI_DIGIT_TOP = 2561,
+    AF_BLUE_STRING_HEBREW_TOP = 2581,
+    AF_BLUE_STRING_HEBREW_BOTTOM = 2605,
+    AF_BLUE_STRING_HEBREW_DESCENDER = 2623,
+    AF_BLUE_STRING_KANNADA_TOP = 2638,
+    AF_BLUE_STRING_KANNADA_BOTTOM = 2682,
+    AF_BLUE_STRING_KAYAH_LI_TOP = 2714,
+    AF_BLUE_STRING_KAYAH_LI_BOTTOM = 2738,
+    AF_BLUE_STRING_KAYAH_LI_ASCENDER = 2758,
+    AF_BLUE_STRING_KAYAH_LI_DESCENDER = 2766,
+    AF_BLUE_STRING_KAYAH_LI_LARGE_DESCENDER = 2778,
+    AF_BLUE_STRING_KHMER_TOP = 2799,
+    AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP = 2823,
+    AF_BLUE_STRING_KHMER_BOTTOM = 2863,
+    AF_BLUE_STRING_KHMER_DESCENDER = 2895,
+    AF_BLUE_STRING_KHMER_LARGE_DESCENDER = 2929,
+    AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP = 3016,
+    AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM = 3024,
+    AF_BLUE_STRING_LAO_TOP = 3032,
+    AF_BLUE_STRING_LAO_BOTTOM = 3064,
+    AF_BLUE_STRING_LAO_ASCENDER = 3096,
+    AF_BLUE_STRING_LAO_LARGE_ASCENDER = 3112,
+    AF_BLUE_STRING_LAO_DESCENDER = 3124,
+    AF_BLUE_STRING_LATIN_CAPITAL_TOP = 3148,
+    AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 3164,
+    AF_BLUE_STRING_LATIN_SMALL_F_TOP = 3180,
+    AF_BLUE_STRING_LATIN_SMALL_TOP = 3194,
+    AF_BLUE_STRING_LATIN_SMALL_BOTTOM = 3210,
+    AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 3226,
+    AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 3236,
+    AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 3256,
+    AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 3276,
+    AF_BLUE_STRING_LATIN_SUBS_SMALL = 3296,
+    AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 3332,
+    AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 3352,
+    AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 3383,
+    AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 3412,
+    AF_BLUE_STRING_LATIN_SUPS_SMALL = 3438,
+    AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 3463,
+    AF_BLUE_STRING_LISU_TOP = 3474,
+    AF_BLUE_STRING_LISU_BOTTOM = 3506,
+    AF_BLUE_STRING_MALAYALAM_TOP = 3538,
+    AF_BLUE_STRING_MALAYALAM_BOTTOM = 3582,
+    AF_BLUE_STRING_MYANMAR_TOP = 3614,
+    AF_BLUE_STRING_MYANMAR_BOTTOM = 3646,
+    AF_BLUE_STRING_MYANMAR_ASCENDER = 3678,
+    AF_BLUE_STRING_MYANMAR_DESCENDER = 3706,
+    AF_BLUE_STRING_NKO_TOP = 3738,
+    AF_BLUE_STRING_NKO_BOTTOM = 3762,
+    AF_BLUE_STRING_NKO_SMALL_TOP = 3777,
+    AF_BLUE_STRING_NKO_SMALL_BOTTOM = 3786,
+    AF_BLUE_STRING_OL_CHIKI = 3798,
+    AF_BLUE_STRING_OLD_TURKIC_TOP = 3822,
+    AF_BLUE_STRING_OLD_TURKIC_BOTTOM = 3837,
+    AF_BLUE_STRING_OSAGE_CAPITAL_TOP = 3857,
+    AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM = 3897,
+    AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER = 3927,
+    AF_BLUE_STRING_OSAGE_SMALL_TOP = 3942,
+    AF_BLUE_STRING_OSAGE_SMALL_BOTTOM = 3982,
+    AF_BLUE_STRING_OSAGE_SMALL_ASCENDER = 4022,
+    AF_BLUE_STRING_OSAGE_SMALL_DESCENDER = 4047,
+    AF_BLUE_STRING_OSMANYA_TOP = 4062,
+    AF_BLUE_STRING_OSMANYA_BOTTOM = 4102,
+    AF_BLUE_STRING_SAURASHTRA_TOP = 4142,
+    AF_BLUE_STRING_SAURASHTRA_BOTTOM = 4174,
+    AF_BLUE_STRING_SHAVIAN_TOP = 4194,
+    AF_BLUE_STRING_SHAVIAN_BOTTOM = 4204,
+    AF_BLUE_STRING_SHAVIAN_DESCENDER = 4229,
+    AF_BLUE_STRING_SHAVIAN_SMALL_TOP = 4239,
+    AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM = 4274,
+    AF_BLUE_STRING_SINHALA_TOP = 4289,
+    AF_BLUE_STRING_SINHALA_BOTTOM = 4321,
+    AF_BLUE_STRING_SINHALA_DESCENDER = 4353,
+    AF_BLUE_STRING_SUNDANESE_TOP = 4397,
+    AF_BLUE_STRING_SUNDANESE_BOTTOM = 4421,
+    AF_BLUE_STRING_SUNDANESE_DESCENDER = 4453,
+    AF_BLUE_STRING_TAI_VIET_TOP = 4461,
+    AF_BLUE_STRING_TAI_VIET_BOTTOM = 4481,
+    AF_BLUE_STRING_TAMIL_TOP = 4493,
+    AF_BLUE_STRING_TAMIL_BOTTOM = 4525,
+    AF_BLUE_STRING_TELUGU_TOP = 4557,
+    AF_BLUE_STRING_TELUGU_BOTTOM = 4585,
+    AF_BLUE_STRING_THAI_TOP = 4613,
+    AF_BLUE_STRING_THAI_BOTTOM = 4637,
+    AF_BLUE_STRING_THAI_ASCENDER = 4665,
+    AF_BLUE_STRING_THAI_LARGE_ASCENDER = 4677,
+    AF_BLUE_STRING_THAI_DESCENDER = 4689,
+    AF_BLUE_STRING_THAI_LARGE_DESCENDER = 4705,
+    AF_BLUE_STRING_THAI_DIGIT_TOP = 4713,
+    AF_BLUE_STRING_TIFINAGH = 4725,
+    AF_BLUE_STRING_VAI_TOP = 4757,
+    AF_BLUE_STRING_VAI_BOTTOM = 4789,
+    af_blue_1_1 = 4820,
 #ifdef AF_CONFIG_OPTION_CJK
     AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1,
     AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 203,
@@ -336,41 +338,41 @@
     AF_BLUE_STRINGSET_DSRT = 75,
     AF_BLUE_STRINGSET_ETHI = 80,
     AF_BLUE_STRINGSET_GEOR = 83,
-    AF_BLUE_STRINGSET_GEOK = 88,
-    AF_BLUE_STRINGSET_GLAG = 95,
-    AF_BLUE_STRINGSET_GOTH = 100,
-    AF_BLUE_STRINGSET_GREK = 103,
-    AF_BLUE_STRINGSET_GUJR = 110,
-    AF_BLUE_STRINGSET_GURU = 116,
-    AF_BLUE_STRINGSET_HEBR = 122,
-    AF_BLUE_STRINGSET_KALI = 126,
-    AF_BLUE_STRINGSET_KHMR = 132,
-    AF_BLUE_STRINGSET_KHMS = 138,
-    AF_BLUE_STRINGSET_KNDA = 141,
-    AF_BLUE_STRINGSET_LAO = 144,
-    AF_BLUE_STRINGSET_LATN = 150,
-    AF_BLUE_STRINGSET_LATB = 157,
-    AF_BLUE_STRINGSET_LATP = 164,
-    AF_BLUE_STRINGSET_LISU = 171,
-    AF_BLUE_STRINGSET_MLYM = 174,
-    AF_BLUE_STRINGSET_MYMR = 177,
-    AF_BLUE_STRINGSET_NKOO = 182,
-    AF_BLUE_STRINGSET_NONE = 187,
-    AF_BLUE_STRINGSET_OLCK = 188,
-    AF_BLUE_STRINGSET_ORKH = 191,
-    AF_BLUE_STRINGSET_OSGE = 194,
-    AF_BLUE_STRINGSET_OSMA = 202,
-    AF_BLUE_STRINGSET_SAUR = 205,
-    AF_BLUE_STRINGSET_SHAW = 208,
-    AF_BLUE_STRINGSET_SINH = 214,
-    AF_BLUE_STRINGSET_SUND = 218,
-    AF_BLUE_STRINGSET_TAML = 222,
-    AF_BLUE_STRINGSET_TAVT = 225,
-    AF_BLUE_STRINGSET_TELU = 228,
-    AF_BLUE_STRINGSET_TFNG = 231,
-    AF_BLUE_STRINGSET_THAI = 234,
-    AF_BLUE_STRINGSET_VAII = 242,
-    af_blue_2_1 = 245,
+    AF_BLUE_STRINGSET_GEOK = 90,
+    AF_BLUE_STRINGSET_GLAG = 97,
+    AF_BLUE_STRINGSET_GOTH = 102,
+    AF_BLUE_STRINGSET_GREK = 105,
+    AF_BLUE_STRINGSET_GUJR = 112,
+    AF_BLUE_STRINGSET_GURU = 118,
+    AF_BLUE_STRINGSET_HEBR = 124,
+    AF_BLUE_STRINGSET_KALI = 128,
+    AF_BLUE_STRINGSET_KHMR = 134,
+    AF_BLUE_STRINGSET_KHMS = 140,
+    AF_BLUE_STRINGSET_KNDA = 143,
+    AF_BLUE_STRINGSET_LAO = 146,
+    AF_BLUE_STRINGSET_LATN = 152,
+    AF_BLUE_STRINGSET_LATB = 159,
+    AF_BLUE_STRINGSET_LATP = 166,
+    AF_BLUE_STRINGSET_LISU = 173,
+    AF_BLUE_STRINGSET_MLYM = 176,
+    AF_BLUE_STRINGSET_MYMR = 179,
+    AF_BLUE_STRINGSET_NKOO = 184,
+    AF_BLUE_STRINGSET_NONE = 189,
+    AF_BLUE_STRINGSET_OLCK = 190,
+    AF_BLUE_STRINGSET_ORKH = 193,
+    AF_BLUE_STRINGSET_OSGE = 196,
+    AF_BLUE_STRINGSET_OSMA = 204,
+    AF_BLUE_STRINGSET_SAUR = 207,
+    AF_BLUE_STRINGSET_SHAW = 210,
+    AF_BLUE_STRINGSET_SINH = 216,
+    AF_BLUE_STRINGSET_SUND = 220,
+    AF_BLUE_STRINGSET_TAML = 224,
+    AF_BLUE_STRINGSET_TAVT = 227,
+    AF_BLUE_STRINGSET_TELU = 230,
+    AF_BLUE_STRINGSET_TFNG = 233,
+    AF_BLUE_STRINGSET_THAI = 236,
+    AF_BLUE_STRINGSET_VAII = 244,
+    af_blue_2_1 = 247,
 #ifdef AF_CONFIG_OPTION_CJK
     AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0,
     af_blue_2_1_1 = af_blue_2_1 + 2,
--- a/src/java.desktop/share/native/libfreetype/src/autofit/afranges.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/autofit/afranges.c	Mon Jun 11 09:29:44 2018 +0200
@@ -91,7 +91,7 @@
     AF_UNIRANGE_REC(  0x06E7,  0x06E8 ),
     AF_UNIRANGE_REC(  0x06EA,  0x06ED ),
     AF_UNIRANGE_REC(  0x08D4,  0x08E1 ),
-    AF_UNIRANGE_REC(  0x08E3,  0x08FF ),
+    AF_UNIRANGE_REC(  0x08D3,  0x08FF ),
     AF_UNIRANGE_REC(  0xFBB2,  0xFBC1 ),
     AF_UNIRANGE_REC(  0xFE70,  0xFE70 ),
     AF_UNIRANGE_REC(  0xFE72,  0xFE72 ),
@@ -163,6 +163,7 @@
     AF_UNIRANGE_REC(  0x09C1,  0x09C4 ),
     AF_UNIRANGE_REC(  0x09CD,  0x09CD ),
     AF_UNIRANGE_REC(  0x09E2,  0x09E3 ),
+    AF_UNIRANGE_REC(  0x09FE,  0x09FE ),
     AF_UNIRANGE_REC(       0,       0 )
   };
 
@@ -190,6 +191,7 @@
   {
     AF_UNIRANGE_REC( 0x11100, 0x11102 ),
     AF_UNIRANGE_REC( 0x11127, 0x11134 ),
+    AF_UNIRANGE_REC( 0x11146, 0x11146 ),
     AF_UNIRANGE_REC(       0,       0 )
   };
 
@@ -304,6 +306,7 @@
     AF_UNIRANGE_REC(  0x0953,  0x0957 ),
     AF_UNIRANGE_REC(  0x0962,  0x0963 ),
     AF_UNIRANGE_REC(  0xA8E0,  0xA8F1 ),
+    AF_UNIRANGE_REC(  0xA8FF,  0xA8FF ),
     AF_UNIRANGE_REC(       0,       0 )
   };
 
@@ -338,11 +341,8 @@
 
   const AF_Script_UniRangeRec  af_geor_uniranges[] =
   {
-    AF_UNIRANGE_REC(  0x10D0,  0x10FF ),  /* Georgian (Mkhedruli) */
-#if 0
-    /* the following range is proposed for inclusion in Unicode */
-    AF_UNIRANGE_REC(  0x1C90,  0x1CBF ),  /* Georgian (Mtavruli)  */
-#endif
+    AF_UNIRANGE_REC(  0x10D0,  0x10FF ),  /* Georgian (Mkhedruli)          */
+    AF_UNIRANGE_REC(  0x1C90,  0x1CBF ),  /* Georgian Extended (Mtavruli)  */
     AF_UNIRANGE_REC(       0,       0 )
   };
 
@@ -355,8 +355,8 @@
   const AF_Script_UniRangeRec  af_geok_uniranges[] =
   {
     /* Khutsuri */
-    AF_UNIRANGE_REC(  0x10A0,  0x10CD ),  /* Georgian (Asomtavruli) */
-    AF_UNIRANGE_REC(  0x2D00,  0x2D2D ),  /* Georgian (Nuskhuri)    */
+    AF_UNIRANGE_REC(  0x10A0,  0x10CD ),  /* Georgian (Asomtavruli)         */
+    AF_UNIRANGE_REC(  0x2D00,  0x2D2D ),  /* Georgian Supplement (Nuskhuri) */
     AF_UNIRANGE_REC(       0,       0 )
   };
 
@@ -425,6 +425,7 @@
     AF_UNIRANGE_REC(  0x0AC1,  0x0AC8 ),
     AF_UNIRANGE_REC(  0x0ACD,  0x0ACD ),
     AF_UNIRANGE_REC(  0x0AE2,  0x0AE3 ),
+    AF_UNIRANGE_REC(  0x0AFA,  0x0AFF ),
     AF_UNIRANGE_REC(       0,       0 )
   };
 
@@ -655,7 +656,8 @@
 
   const AF_Script_UniRangeRec  af_mlym_nonbase_uniranges[] =
   {
-    AF_UNIRANGE_REC(  0x0D01,  0x0D01 ),
+    AF_UNIRANGE_REC(  0x0D00,  0x0D01 ),
+    AF_UNIRANGE_REC(  0x0D3B,  0x0D3C ),
     AF_UNIRANGE_REC(  0x0D4D,  0x0D4E ),
     AF_UNIRANGE_REC(  0x0D62,  0x0D63 ),
     AF_UNIRANGE_REC(       0,       0 )
@@ -697,6 +699,7 @@
   const AF_Script_UniRangeRec  af_nkoo_nonbase_uniranges[] =
   {
     AF_UNIRANGE_REC(  0x07EB,  0x07F5 ),
+    AF_UNIRANGE_REC(  0x07FD,  0x07FD ),
     AF_UNIRANGE_REC(       0,       0 )
   };
 
@@ -856,6 +859,7 @@
   const AF_Script_UniRangeRec  af_telu_nonbase_uniranges[] =
   {
     AF_UNIRANGE_REC(  0x0C00,  0x0C00 ),
+    AF_UNIRANGE_REC(  0x0C04,  0x0C04 ),
     AF_UNIRANGE_REC(  0x0C3E,  0x0C40 ),
     AF_UNIRANGE_REC(  0x0C46,  0x0C56 ),
     AF_UNIRANGE_REC(  0x0C62,  0x0C63 ),
@@ -1006,10 +1010,13 @@
     AF_UNIRANGE_REC(  0xFE30,  0xFE4F ),  /* CJK Compatibility Forms                 */
     AF_UNIRANGE_REC(  0xFF00,  0xFFEF ),  /* Halfwidth and Fullwidth Forms           */
     AF_UNIRANGE_REC( 0x1B000, 0x1B0FF ),  /* Kana Supplement                         */
+    AF_UNIRANGE_REC( 0x1B100, 0x1B12F ),  /* Kana Extended-A                         */
     AF_UNIRANGE_REC( 0x1D300, 0x1D35F ),  /* Tai Xuan Hing Symbols                   */
     AF_UNIRANGE_REC( 0x20000, 0x2A6DF ),  /* CJK Unified Ideographs Extension B      */
     AF_UNIRANGE_REC( 0x2A700, 0x2B73F ),  /* CJK Unified Ideographs Extension C      */
     AF_UNIRANGE_REC( 0x2B740, 0x2B81F ),  /* CJK Unified Ideographs Extension D      */
+    AF_UNIRANGE_REC( 0x2B820, 0x2CEAF ),  /* CJK Unified Ideographs Extension E      */
+    AF_UNIRANGE_REC( 0x2CEB0, 0x2EBEF ),  /* CJK Unified Ideographs Extension F      */
     AF_UNIRANGE_REC( 0x2F800, 0x2FA1F ),  /* CJK Compatibility Ideographs Supplement */
     AF_UNIRANGE_REC(       0,       0 )
   };
--- a/src/java.desktop/share/native/libfreetype/src/autofit/afscript.h	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/autofit/afscript.h	Mon Jun 11 09:29:44 2018 +0200
@@ -137,7 +137,7 @@
           "Georgian (Mkhedruli)",
           HB_SCRIPT_GEORGIAN,
           HINTING_BOTTOM_TO_TOP,
-          "\xE1\x83\x98 \xE1\x83\x94 \xE1\x83\x90" ) /* ი ე ა */
+          "\xE1\x83\x98 \xE1\x83\x94 \xE1\x83\x90 \xE1\xB2\xBF" ) /* ი ე ა Ი */
 
   SCRIPT( geok, GEOK,
           "Georgian (Khutsuri)",
--- a/src/java.desktop/share/native/libfreetype/src/autofit/aftypes.h	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/autofit/aftypes.h	Mon Jun 11 09:29:44 2018 +0200
@@ -76,9 +76,9 @@
 
   typedef struct  AF_WidthRec_
   {
-    FT_Pos  org;  /* original position/width in font units              */
-    FT_Pos  cur;  /* current/scaled position/width in device sub-pixels */
-    FT_Pos  fit;  /* current/fitted position/width in device sub-pixels */
+    FT_Pos  org;  /* original position/width in font units             */
+    FT_Pos  cur;  /* current/scaled position/width in device subpixels */
+    FT_Pos  fit;  /* current/fitted position/width in device subpixels */
 
   } AF_WidthRec, *AF_Width;
 
--- a/src/java.desktop/share/native/libfreetype/src/base/ftbitmap.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/base/ftbitmap.c	Mon Jun 11 09:29:44 2018 +0200
@@ -237,7 +237,7 @@
       unsigned char*  out = buffer;
 
       unsigned char*  limit = bitmap->buffer + pitch * bitmap->rows;
-      unsigned int    delta = new_pitch - pitch;
+      unsigned int    delta = new_pitch - len;
 
 
       FT_MEM_ZERO( out, new_pitch * ypixels );
@@ -247,8 +247,10 @@
       {
         FT_MEM_COPY( out, in, len );
         in  += pitch;
-        out += pitch;
+        out += len;
 
+        /* we use FT_QALLOC_MULT, which doesn't zero out the buffer;      */
+        /* consequently, we have to manually zero out the remaining bytes */
         FT_MEM_ZERO( out, delta );
         out += delta;
       }
@@ -261,14 +263,14 @@
       unsigned char*  out = buffer;
 
       unsigned char*  limit = bitmap->buffer + pitch * bitmap->rows;
-      unsigned int    delta = new_pitch - pitch;
+      unsigned int    delta = new_pitch - len;
 
 
       while ( in < limit )
       {
         FT_MEM_COPY( out, in, len );
         in  += pitch;
-        out += pitch;
+        out += len;
 
         FT_MEM_ZERO( out, delta );
         out += delta;
--- a/src/java.desktop/share/native/libfreetype/src/base/ftlcdfil.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/base/ftlcdfil.c	Mon Jun 11 09:29:44 2018 +0200
@@ -77,7 +77,7 @@
 
 
     /* take care of bitmap flow */
-    if ( pitch > 0 )
+    if ( pitch > 0 && height > 0 )
       origin += pitch * (FT_Int)( height - 1 );
 
     /* horizontal in-place FIR filter */
@@ -192,7 +192,7 @@
 
 
     /* take care of bitmap flow */
-    if ( pitch > 0 )
+    if ( pitch > 0 && height > 0 )
       origin += pitch * (FT_Int)( height - 1 );
 
     /* horizontal in-place intra-pixel filter */
--- a/src/java.desktop/share/native/libfreetype/src/base/ftoutln.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/base/ftoutln.c	Mon Jun 11 09:29:44 2018 +0200
@@ -286,12 +286,13 @@
     FT_TRACE5(( "FT_Outline_Decompose: Done\n", n ));
     return FT_Err_Ok;
 
+  Invalid_Outline:
+    error = FT_THROW( Invalid_Outline );
+    /* fall through */
+
   Exit:
     FT_TRACE5(( "FT_Outline_Decompose: Error 0x%x\n", error ));
     return error;
-
-  Invalid_Outline:
-    return FT_THROW( Invalid_Outline );
   }
 
 
--- a/src/java.desktop/share/native/libfreetype/src/cff/cffload.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/cff/cffload.c	Mon Jun 11 09:29:44 2018 +0200
@@ -1933,6 +1933,24 @@
     else if ( priv->initial_random_seed == 0 )
       priv->initial_random_seed = 987654321;
 
+    /* some sanitizing to avoid overflows later on; */
+    /* the upper limits are ad-hoc values           */
+    if ( priv->blue_shift > 1000 || priv->blue_shift < 0 )
+    {
+      FT_TRACE2(( "cff_load_private_dict:"
+                  " setting unlikely BlueShift value %d to default (7)\n",
+                  priv->blue_shift ));
+      priv->blue_shift = 7;
+    }
+
+    if ( priv->blue_fuzz > 1000 || priv->blue_fuzz < 0 )
+    {
+      FT_TRACE2(( "cff_load_private_dict:"
+                  " setting unlikely BlueFuzz value %d to default (1)\n",
+                  priv->blue_fuzz ));
+      priv->blue_fuzz = 1;
+    }
+
   Exit:
     /* clean up */
     cff_blend_clear( subfont ); /* clear blend stack */
--- a/src/java.desktop/share/native/libfreetype/src/psaux/psintrp.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/psaux/psintrp.c	Mon Jun 11 09:29:44 2018 +0200
@@ -852,7 +852,8 @@
 
         curY = ADD_INT32( curY, cf2_stack_popFixed( opStack ) );
 
-        cf2_glyphpath_moveTo( &glyphPath, curX, curY );
+        if ( !decoder->flex_state )
+          cf2_glyphpath_moveTo( &glyphPath, curX, curY );
 
         break;
 
@@ -2674,7 +2675,8 @@
 
         curX = ADD_INT32( curX, cf2_stack_popFixed( opStack ) );
 
-        cf2_glyphpath_moveTo( &glyphPath, curX, curY );
+        if ( !decoder->flex_state )
+          cf2_glyphpath_moveTo( &glyphPath, curX, curY );
 
         break;
 
--- a/src/java.desktop/share/native/libfreetype/src/pshinter/pshglob.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/pshinter/pshglob.c	Mon Jun 11 09:29:44 2018 +0200
@@ -227,8 +227,8 @@
   }
 
 
-  /* Re-read blue zones from the original fonts and store them into out */
-  /* private structure.  This function re-orders, sanitizes and         */
+  /* Re-read blue zones from the original fonts and store them into our */
+  /* private structure.  This function re-orders, sanitizes, and        */
   /* fuzz-expands the zones as well.                                    */
   static void
   psh_blues_set_zones( PSH_Blues  target,
--- a/src/java.desktop/share/native/libfreetype/src/sfnt/sfobjs.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/sfnt/sfobjs.c	Mon Jun 11 09:29:44 2018 +0200
@@ -1144,6 +1144,8 @@
     FT_Bool       has_outline;
     FT_Bool       is_apple_sbit;
     FT_Bool       is_apple_sbix;
+    FT_Bool       has_CBLC;
+    FT_Bool       has_CBDT;
     FT_Bool       ignore_typographic_family    = FALSE;
     FT_Bool       ignore_typographic_subfamily = FALSE;
 
@@ -1224,6 +1226,13 @@
         goto Exit;
     }
 
+    has_CBLC = !face->goto_table( face, TTAG_CBLC, stream, 0 );
+    has_CBDT = !face->goto_table( face, TTAG_CBDT, stream, 0 );
+
+    /* Ignore outlines for CBLC/CBDT fonts. */
+    if ( has_CBLC || has_CBDT )
+      has_outline = FALSE;
+
     /* OpenType 1.8.2 introduced limits to this value;    */
     /* however, they make sense for older SFNT fonts also */
     if ( face->header.Units_Per_EM <    16 ||
--- a/src/java.desktop/share/native/libfreetype/src/sfnt/ttcmap.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/sfnt/ttcmap.c	Mon Jun 11 09:29:44 2018 +0200
@@ -222,10 +222,10 @@
   /***** The following charmap lookup and iteration functions all      *****/
   /***** assume that the value `charcode' fulfills the following.      *****/
   /*****                                                               *****/
-  /*****   - For one byte characters, `charcode' is simply the         *****/
+  /*****   - For one-byte characters, `charcode' is simply the         *****/
   /*****     character code.                                           *****/
   /*****                                                               *****/
-  /*****   - For two byte characters, `charcode' is the 2-byte         *****/
+  /*****   - For two-byte characters, `charcode' is the 2-byte         *****/
   /*****     character code in big endian format.  More precisely:     *****/
   /*****                                                               *****/
   /*****       (charcode >> 8)    is the first byte value              *****/
@@ -252,11 +252,11 @@
   /*   subs        518            SUBHEAD[NSUBS]  sub-headers array        */
   /*   glyph_ids   518+NSUB*8     USHORT[]        glyph ID array           */
   /*                                                                       */
-  /* The `keys' table is used to map charcode high-bytes to sub-headers.   */
+  /* The `keys' table is used to map charcode high bytes to sub-headers.   */
   /* The value of `NSUBS' is the number of sub-headers defined in the      */
   /* table and is computed by finding the maximum of the `keys' table.     */
   /*                                                                       */
-  /* Note that for any n, `keys[n]' is a byte offset within the `subs'     */
+  /* Note that for any `n', `keys[n]' is a byte offset within the `subs'   */
   /* table, i.e., it is the corresponding sub-header index multiplied      */
   /* by 8.                                                                 */
   /*                                                                       */
@@ -269,8 +269,8 @@
   /*   delta       4           SHORT           see below                   */
   /*   offset      6           USHORT          see below                   */
   /*                                                                       */
-  /* A sub-header defines, for each high-byte, the range of valid          */
-  /* low-bytes within the charmap.  Note that the range defined by `first' */
+  /* A sub-header defines, for each high byte, the range of valid          */
+  /* low bytes within the charmap.  Note that the range defined by `first' */
   /* and `count' must be completely included in the interval [0..255]      */
   /* according to the specification.                                       */
   /*                                                                       */
@@ -360,7 +360,7 @@
       /* check range within 0..255 */
       if ( valid->level >= FT_VALIDATE_PARANOID )
       {
-        if ( first_code >= 256 || first_code + code_count > 256 )
+        if ( first_code >= 256 || code_count > 256 - first_code )
           FT_INVALID_DATA;
       }
 
@@ -412,7 +412,7 @@
     {
       FT_UInt   char_lo = (FT_UInt)( char_code & 0xFF );
       FT_UInt   char_hi = (FT_UInt)( char_code >> 8 );
-      FT_Byte*  p       = table + 6;    /* keys table */
+      FT_Byte*  p       = table + 6;    /* keys table       */
       FT_Byte*  subs    = table + 518;  /* subheaders table */
       FT_Byte*  sub;
 
@@ -425,8 +425,8 @@
         sub = subs;  /* jump to first sub-header */
 
         /* check that the sub-header for this byte is 0, which */
-        /* indicates that it is really a valid one-byte value  */
-        /* Otherwise, return 0                                 */
+        /* indicates that it is really a valid one-byte value; */
+        /* otherwise, return 0                                 */
         /*                                                     */
         p += char_lo * 2;
         if ( TT_PEEK_USHORT( p ) != 0 )
@@ -445,6 +445,7 @@
         if ( sub == subs )
           goto Exit;
       }
+
       result = sub;
     }
 
@@ -517,6 +518,13 @@
         FT_UInt   pos, idx;
 
 
+        if ( char_lo >= start + count && charcode <= 0xFF )
+        {
+          /* this happens only for a malformed cmap */
+          charcode = 0x100;
+          continue;
+        }
+
         if ( offset == 0 )
         {
           if ( charcode == 0x100 )
@@ -549,19 +557,18 @@
             }
           }
         }
+
+        /* if unsuccessful, avoid `charcode' leaving */
+        /* the current 256-character block           */
+        if ( count )
+          charcode--;
       }
 
-      /* If `charcode' is <= 0xFF, retry with `charcode + 1'.  If        */
-      /* `charcode' is 0x100 after the loop, do nothing since we have    */
-      /* just reached the first sub-header for two-byte character codes. */
-      /*                                                                 */
-      /* For all other cases, we jump to the next sub-header and adjust  */
-      /* `charcode' accordingly.                                         */
+      /* If `charcode' is <= 0xFF, retry with `charcode + 1'.      */
+      /* Otherwise jump to the next 256-character block and retry. */
     Next_SubHeader:
       if ( charcode <= 0xFF )
         charcode++;
-      else if ( charcode == 0x100 )
-        ;
       else
         charcode = FT_PAD_FLOOR( charcode, 0x100 ) + 0x100;
     }
--- a/src/java.desktop/share/native/libfreetype/src/sfnt/ttpost.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/sfnt/ttpost.c	Mon Jun 11 09:29:44 2018 +0200
@@ -473,8 +473,8 @@
   /*    idx    :: The glyph index.                                         */
   /*                                                                       */
   /* <InOut>                                                               */
-  /*    PSname :: The address of a string pointer.  Will be NULL in case   */
-  /*              of error, otherwise it is a pointer to the glyph name.   */
+  /*    PSname :: The address of a string pointer.  Undefined in case of   */
+  /*              error, otherwise it is a pointer to the glyph name.      */
   /*                                                                       */
   /*              You must not modify the returned string!                 */
   /*                                                                       */
--- a/src/java.desktop/share/native/libfreetype/src/sfnt/ttsbit.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/sfnt/ttsbit.c	Mon Jun 11 09:29:44 2018 +0200
@@ -1514,7 +1514,7 @@
     FT_FRAME_EXIT();
 
     if ( glyph_start == glyph_end )
-      return FT_THROW( Invalid_Argument );
+      return FT_THROW( Missing_Bitmap );
     if ( glyph_start > glyph_end                     ||
          glyph_end - glyph_start < 8                 ||
          face->ebdt_size - strike_offset < glyph_end )
--- a/src/java.desktop/share/native/libfreetype/src/smooth/ftgrays.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/smooth/ftgrays.c	Mon Jun 11 09:29:44 2018 +0200
@@ -404,7 +404,7 @@
   /* need to define them to "float" or "double" when experimenting with   */
   /* new algorithms                                                       */
 
-  typedef long  TPos;     /* sub-pixel coordinate              */
+  typedef long  TPos;     /* subpixel coordinate               */
   typedef int   TCoord;   /* integer scanline/pixel coordinate */
   typedef int   TArea;    /* cell areas, coordinate products   */
 
--- a/src/java.desktop/share/native/libfreetype/src/truetype/ttgload.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/truetype/ttgload.c	Mon Jun 11 09:29:44 2018 +0200
@@ -1219,7 +1219,7 @@
              * Theoretically, a glyph's bytecode can toggle ClearType's
              * `backward compatibility' mode, which would allow modification
              * of the advance width.  In reality, however, applications
-             * neither allow nor expect modified advance widths if sub-pixel
+             * neither allow nor expect modified advance widths if subpixel
              * rendering is active.
              *
              */
@@ -2709,6 +2709,10 @@
          ( load_flags & FT_LOAD_NO_BITMAP ) == 0 &&
          IS_DEFAULT_INSTANCE                     )
     {
+      FT_Fixed  x_scale = size->root.metrics.x_scale;
+      FT_Fixed  y_scale = size->root.metrics.y_scale;
+
+
       error = load_sbit_image( size, glyph, glyph_index, load_flags );
       if ( FT_ERR_EQ( error, Missing_Bitmap ) )
       {
@@ -2716,9 +2720,13 @@
         /* if we have a bitmap-only font, return an empty glyph            */
         if ( !FT_IS_SCALABLE( glyph->face ) )
         {
-          TT_Face    face = (TT_Face)glyph->face;
-          FT_Short   left_bearing = 0, top_bearing = 0;
-          FT_UShort  advance_width = 0, advance_height = 0;
+          TT_Face  face = (TT_Face)glyph->face;
+
+          FT_Short  left_bearing = 0;
+          FT_Short  top_bearing  = 0;
+
+          FT_UShort  advance_width  = 0;
+          FT_UShort  advance_height = 0;
 
 
           /* to return an empty glyph, however, we need metrics data   */
@@ -2744,13 +2752,13 @@
           glyph->metrics.width  = 0;
           glyph->metrics.height = 0;
 
-          glyph->metrics.horiBearingX = left_bearing;
+          glyph->metrics.horiBearingX = FT_MulFix( left_bearing, x_scale );
           glyph->metrics.horiBearingY = 0;
-          glyph->metrics.horiAdvance  = advance_width;
+          glyph->metrics.horiAdvance  = FT_MulFix( advance_width, x_scale );
 
           glyph->metrics.vertBearingX = 0;
-          glyph->metrics.vertBearingY = top_bearing;
-          glyph->metrics.vertAdvance  = advance_height;
+          glyph->metrics.vertBearingY = FT_MulFix( top_bearing, y_scale );
+          glyph->metrics.vertAdvance  = FT_MulFix( advance_height, y_scale );
 
           glyph->format            = FT_GLYPH_FORMAT_BITMAP;
           glyph->bitmap.pixel_mode = FT_PIXEL_MODE_MONO;
@@ -2781,13 +2789,11 @@
           /* sanity checks: if `xxxAdvance' in the sbit metric */
           /* structure isn't set, use `linearXXXAdvance'      */
           if ( !glyph->metrics.horiAdvance && glyph->linearHoriAdvance )
-            glyph->metrics.horiAdvance =
-              FT_MulFix( glyph->linearHoriAdvance,
-                         size->metrics->x_scale );
+            glyph->metrics.horiAdvance = FT_MulFix( glyph->linearHoriAdvance,
+                                                    x_scale );
           if ( !glyph->metrics.vertAdvance && glyph->linearVertAdvance )
-            glyph->metrics.vertAdvance =
-              FT_MulFix( glyph->linearVertAdvance,
-                         size->metrics->y_scale );
+            glyph->metrics.vertAdvance = FT_MulFix( glyph->linearVertAdvance,
+                                                    y_scale );
         }
 
         return FT_Err_Ok;
--- a/src/java.desktop/share/native/libfreetype/src/truetype/ttgxvar.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/truetype/ttgxvar.c	Mon Jun 11 09:29:44 2018 +0200
@@ -1733,17 +1733,13 @@
     /* based on the [min,def,max] values for the axis to be [-1,0,1]. */
     /* Then, if there's an `avar' table, we renormalize this range.   */
 
-    FT_TRACE5(( "%d design coordinate%s:\n",
-                num_coords,
-                num_coords == 1 ? "" : "s" ));
-
     a = mmvar->axis;
     for ( i = 0; i < num_coords; i++, a++ )
     {
       FT_Fixed  coord = coords[i];
 
 
-      FT_TRACE5(( "  %.5f\n", coord / 65536.0 ));
+      FT_TRACE5(( "    %d: %.5f\n", i, coord / 65536.0 ));
       if ( coord > a->maximum || coord < a->minimum )
       {
         FT_TRACE1((
@@ -2043,12 +2039,15 @@
 
       FT_TRACE2(( "loaded\n" ));
 
-      FT_TRACE5(( "number of GX style axes: %d\n", fvar_head.axisCount ));
+      FT_TRACE5(( "%d variation ax%s\n",
+                  fvar_head.axisCount,
+                  fvar_head.axisCount == 1 ? "is" : "es" ));
 
       if ( FT_NEW( face->blend ) )
         goto Exit;
 
-      num_axes = fvar_head.axisCount;
+      num_axes              = fvar_head.axisCount;
+      face->blend->num_axis = num_axes;
     }
     else
       num_axes = face->blend->num_axis;
@@ -2142,6 +2141,10 @@
       {
         GX_FVar_Axis  axis_rec;
 
+#ifdef FT_DEBUG_LEVEL_TRACE
+        int  invalid = 0;
+#endif
+
 
         if ( FT_STREAM_READ_FIELDS( fvaraxis_fields, &axis_rec ) )
           goto Exit;
@@ -2162,22 +2165,31 @@
         if ( a->minimum > a->def ||
              a->def > a->maximum )
         {
-          FT_TRACE2(( "TT_Get_MM_Var:"
-                      " invalid \"%s\" axis record; disabling\n",
-                      a->name ));
-
           a->minimum = a->def;
           a->maximum = a->def;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+          invalid = 1;
+#endif
         }
 
-        FT_TRACE5(( "  \"%s\":"
-                    " minimum=%.5f, default=%.5f, maximum=%.5f,"
-                    " flags=0x%04X\n",
+#ifdef FT_DEBUG_LEVEL_TRACE
+        if ( i == 0 )
+          FT_TRACE5(( "  idx   tag  "
+                   /* "  XXX  `XXXX'" */
+                      "    minimum     default     maximum   flags\n" ));
+                   /* "  XXXX.XXXXX  XXXX.XXXXX  XXXX.XXXXX  0xXXXX" */
+
+        FT_TRACE5(( "  %3d  `%s'"
+                    "  %10.5f  %10.5f  %10.5f  0x%04X%s\n",
+                    i,
                     a->name,
                     a->minimum / 65536.0,
                     a->def / 65536.0,
                     a->maximum / 65536.0,
-                    *axis_flags ));
+                    *axis_flags,
+                    invalid ? " (invalid, disabled)" : "" ));
+#endif
 
         a++;
         axis_flags++;
@@ -2202,6 +2214,10 @@
           goto Exit;
       }
 
+      FT_TRACE5(( "%d instance%s\n",
+                  fvar_head.instanceCount,
+                  fvar_head.instanceCount == 1 ? "" : "s" ));
+
       ns  = mmvar->namedstyle;
       nsc = face->blend->normalized_stylecoords;
       for ( i = 0; i < fvar_head.instanceCount; i++, ns++ )
@@ -2224,6 +2240,52 @@
         else
           ns->psid = 0xFFFF;
 
+#ifdef FT_DEBUG_LEVEL_TRACE
+        {
+          SFNT_Service  sfnt = (SFNT_Service)face->sfnt;
+
+          FT_String*  strname = NULL;
+          FT_String*  psname  = NULL;
+
+          FT_ULong  pos;
+
+
+          pos = FT_STREAM_POS();
+
+          if ( ns->strid != 0xFFFF )
+          {
+            (void)sfnt->get_name( face,
+                                  (FT_UShort)ns->strid,
+                                  &strname );
+            if ( strname && !ft_strcmp( strname, ".notdef" ) )
+              strname = NULL;
+          }
+
+          if ( ns->psid != 0xFFFF )
+          {
+            (void)sfnt->get_name( face,
+                                  (FT_UShort)ns->psid,
+                                  &psname );
+            if ( psname && !ft_strcmp( psname, ".notdef" ) )
+              psname = NULL;
+          }
+
+          (void)FT_STREAM_SEEK( pos );
+
+          FT_TRACE5(( "  instance %d (%s%s%s, %s%s%s)\n",
+                      i,
+                      strname ? "name: `" : "",
+                      strname ? strname : "unnamed",
+                      strname ? "'" : "",
+                      psname ? "PS name: `" : "",
+                      psname ? psname : "no PS name",
+                      psname ? "'" : "" ));
+
+          FT_FREE( strname );
+          FT_FREE( psname );
+        }
+#endif /* FT_DEBUG_LEVEL_TRACE */
+
         ft_var_to_normalized( face, num_axes, ns->coords, nsc );
         nsc += num_axes;
 
@@ -2381,11 +2443,12 @@
       num_coords = mmvar->num_axis;
     }
 
-    FT_TRACE5(( "normalized design coordinates:\n" ));
+    FT_TRACE5(( "TT_Set_MM_Blend:\n"
+                "  normalized design coordinates:\n" ));
 
     for ( i = 0; i < num_coords; i++ )
     {
-      FT_TRACE5(( "  %.5f\n", coords[i] / 65536.0 ));
+      FT_TRACE5(( "    %.5f\n", coords[i] / 65536.0 ));
       if ( coords[i] < -0x00010000L || coords[i] > 0x00010000L )
       {
         FT_TRACE1(( "TT_Set_MM_Blend: normalized design coordinate %.5f\n"
@@ -2761,8 +2824,9 @@
       }
     }
 
-    /* return value -1 indicates `no change' */
-    if ( !have_diff )
+    /* return value -1 indicates `no change';                      */
+    /* we can exit early if `normalizedcoords' is already computed */
+    if ( blend->normalizedcoords && !have_diff )
       return -1;
 
     if ( FT_NEW_ARRAY( normalized, mmvar->num_axis ) )
@@ -2771,6 +2835,8 @@
     if ( !face->blend->avar_loaded )
       ft_var_load_avar( face );
 
+    FT_TRACE5(( "TT_Set_Var_Design:\n"
+                "  normalized design coordinates:\n" ));
     ft_var_to_normalized( face, num_coords, blend->coords, normalized );
 
     error = tt_set_mm_blend( face, mmvar->num_axis, normalized, 0 );
--- a/src/java.desktop/share/native/libfreetype/src/truetype/ttinterp.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/truetype/ttinterp.c	Mon Jun 11 09:29:44 2018 +0200
@@ -2165,7 +2165,7 @@
       val = ADD_LONG( distance,
                       exc->threshold - exc->phase + compensation ) &
               -exc->period;
-      val += exc->phase;
+      val = ADD_LONG( val, exc->phase );
       if ( val < 0 )
         val = exc->phase;
     }
@@ -2174,7 +2174,7 @@
       val = NEG_LONG( SUB_LONG( exc->threshold - exc->phase + compensation,
                                 distance ) &
                         -exc->period );
-      val -= exc->phase;
+      val = SUB_LONG( val, exc->phase );
       if ( val > 0 )
         val = -exc->phase;
     }
@@ -2216,7 +2216,7 @@
       val = ( ADD_LONG( distance,
                         exc->threshold - exc->phase + compensation ) /
                 exc->period ) * exc->period;
-      val += exc->phase;
+      val = ADD_LONG( val, exc->phase );
       if ( val < 0 )
         val = exc->phase;
     }
@@ -2225,7 +2225,7 @@
       val = NEG_LONG( ( SUB_LONG( exc->threshold - exc->phase + compensation,
                                   distance ) /
                           exc->period ) * exc->period );
-      val -= exc->phase;
+      val = SUB_LONG( val, exc->phase );
       if ( val > 0 )
         val = -exc->phase;
     }
@@ -2954,7 +2954,7 @@
   static void
   Ins_CEILING( FT_Long*  args )
   {
-    args[0] = FT_PIX_CEIL( args[0] );
+    args[0] = FT_PIX_CEIL_LONG( args[0] );
   }
 
 
@@ -3289,7 +3289,10 @@
     if ( args[0] < 0 )
       exc->error = FT_THROW( Bad_Argument );
     else
-      exc->GS.loop = args[0];
+    {
+      /* we heuristically limit the number of loops to 16 bits */
+      exc->GS.loop = args[0] > 0xFFFFL ? 0xFFFFL : args[0];
+    }
   }
 
 
@@ -5782,6 +5785,7 @@
     FT_F26Dot6  distance;
 #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
     FT_F26Dot6  control_value_cutin = 0;
+    FT_F26Dot6  delta;
 
 
     if ( SUBPIXEL_HINTING_INFINALITY )
@@ -5817,11 +5821,15 @@
     distance = PROJECT( exc->zp1.cur + point, exc->zp0.cur + exc->GS.rp0 );
 
 #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
+    delta = SUB_LONG( distance, args[1] );
+    if ( delta < 0 )
+      delta = NEG_LONG( delta );
+
     /* subpixel hinting - make MSIRP respect CVT cut-in; */
-    if ( SUBPIXEL_HINTING_INFINALITY                                    &&
-         exc->ignore_x_mode                                             &&
-         exc->GS.freeVector.x != 0                                      &&
-         FT_ABS( SUB_LONG( distance, args[1] ) ) >= control_value_cutin )
+    if ( SUBPIXEL_HINTING_INFINALITY  &&
+         exc->ignore_x_mode           &&
+         exc->GS.freeVector.x != 0    &&
+         delta >= control_value_cutin )
       distance = args[1];
 #endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
 
@@ -5869,16 +5877,18 @@
       if ( SUBPIXEL_HINTING_INFINALITY &&
            exc->ignore_x_mode          &&
            exc->GS.freeVector.x != 0   )
-        distance = Round_None(
-                     exc,
-                     cur_dist,
-                     exc->tt_metrics.compensations[0] ) - cur_dist;
+        distance = SUB_LONG(
+                     Round_None( exc,
+                                 cur_dist,
+                                 exc->tt_metrics.compensations[0] ),
+                     cur_dist );
       else
 #endif
-        distance = exc->func_round(
-                     exc,
-                     cur_dist,
-                     exc->tt_metrics.compensations[0] ) - cur_dist;
+        distance = SUB_LONG(
+                     exc->func_round( exc,
+                                      cur_dist,
+                                      exc->tt_metrics.compensations[0] ),
+                     cur_dist );
     }
     else
       distance = 0;
@@ -5978,7 +5988,14 @@
 
     if ( ( exc->opcode & 1 ) != 0 )   /* rounding and control cut-in flag */
     {
-      if ( FT_ABS( distance - org_dist ) > control_value_cutin )
+      FT_F26Dot6  delta;
+
+
+      delta = SUB_LONG( distance, org_dist );
+      if ( delta < 0 )
+        delta = NEG_LONG( delta );
+
+      if ( delta > control_value_cutin )
         distance = org_dist;
 
 #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
@@ -6176,7 +6193,7 @@
     minimum_distance    = exc->GS.minimum_distance;
     control_value_cutin = exc->GS.control_value_cutin;
     point               = (FT_UShort)args[0];
-    cvtEntry            = (FT_ULong)( args[1] + 1 );
+    cvtEntry            = (FT_ULong)( ADD_LONG( args[1], 1 ) );
 
 #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
     if ( SUBPIXEL_HINTING_INFINALITY                        &&
@@ -6259,6 +6276,9 @@
 
       if ( exc->GS.gep0 == exc->GS.gep1 )
       {
+        FT_F26Dot6  delta;
+
+
         /* XXX: According to Greg Hitchcock, the following wording is */
         /*      the right one:                                        */
         /*                                                            */
@@ -6271,7 +6291,11 @@
         /*      `ttinst2.doc', version 1.66, is thus incorrect since  */
         /*      it implies `>=' instead of `>'.                       */
 
-        if ( FT_ABS( cvt_dist - org_dist ) > control_value_cutin )
+        delta = SUB_LONG( cvt_dist, org_dist );
+        if ( delta < 0 )
+          delta = NEG_LONG( delta );
+
+        if ( delta > control_value_cutin )
           cvt_dist = org_dist;
       }
 
@@ -6289,7 +6313,14 @@
            exc->ignore_x_mode           &&
            exc->GS.gep0 == exc->GS.gep1 )
       {
-        if ( FT_ABS( cvt_dist - org_dist ) > control_value_cutin )
+        FT_F26Dot6  delta;
+
+
+        delta = SUB_LONG( cvt_dist, org_dist );
+        if ( delta < 0 )
+          delta = NEG_LONG( delta );
+
+        if ( delta > control_value_cutin )
           cvt_dist = org_dist;
       }
 #endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
@@ -7532,8 +7563,16 @@
       return;
     }
 
-    for ( i = 0; i < num_axes; i++ )
-      args[i] = coords[i] >> 2; /* convert 16.16 to 2.14 format */
+    if ( coords )
+    {
+      for ( i = 0; i < num_axes; i++ )
+        args[i] = coords[i] >> 2; /* convert 16.16 to 2.14 format */
+    }
+    else
+    {
+      for ( i = 0; i < num_axes; i++ )
+        args[i] = 0;
+    }
   }
 
 
@@ -8487,8 +8526,8 @@
 
   LNo_Error_:
     FT_TRACE4(( "  %d instruction%s executed\n",
-                ins_counter == 1 ? "" : "s",
-                ins_counter ));
+                ins_counter,
+                ins_counter == 1 ? "" : "s" ));
     return FT_Err_Ok;
 
   LErrorCodeOverflow_:
--- a/src/java.desktop/share/native/libfreetype/src/truetype/ttobjs.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/truetype/ttobjs.c	Mon Jun 11 09:29:44 2018 +0200
@@ -147,7 +147,7 @@
   {
 
 #define TRICK_NAMES_MAX_CHARACTERS  19
-#define TRICK_NAMES_COUNT           23
+#define TRICK_NAMES_COUNT           26
 
     static const char trick_names[TRICK_NAMES_COUNT]
                                  [TRICK_NAMES_MAX_CHARACTERS + 1] =
@@ -167,12 +167,15 @@
       "DFGirl-W6-WIN-BF",   /* dftt-h6.ttf; version 1.00, 1993 */
       "DFGothic-EB",        /* DynaLab Inc. 1992-1995 */
       "DFGyoSho-Lt",        /* DynaLab Inc. 1992-1995 */
+      "DFHei-Md-HK-BF",     /* maybe DynaLab Inc. */
       "DFHSGothic-W5",      /* DynaLab Inc. 1992-1995 */
       "DFHSMincho-W3",      /* DynaLab Inc. 1992-1995 */
       "DFHSMincho-W7",      /* DynaLab Inc. 1992-1995 */
       "DFKaiSho-SB",        /* dfkaisb.ttf */
       "DFKaiShu",
+      "DFKaiShu-Md-HK-BF",  /* maybe DynaLab Inc. */
       "DFKai-SB",           /* kaiu.ttf; version 3.00, 1998 [DFKaiShu-SB-Estd-BF] */
+      "DFMing-Bd-HK-BF",    /* maybe DynaLab Inc. */
       "DLC",                /* dftt-m7.ttf; version 1.00, 1993 [DLCMingBold] */
                             /* dftt-f5.ttf; version 1.00, 1993 [DLCFongSung] */
       "DLCHayMedium",       /* dftt-b5.ttf; version 1.00, 1993 */
@@ -270,7 +273,7 @@
   tt_check_trickyness_sfnt_ids( TT_Face  face )
   {
 #define TRICK_SFNT_IDS_PER_FACE   3
-#define TRICK_SFNT_IDS_NUM_FACES  26
+#define TRICK_SFNT_IDS_NUM_FACES  29
 
     static const tt_sfnt_id_rec sfnt_id[TRICK_SFNT_IDS_NUM_FACES]
                                        [TRICK_SFNT_IDS_PER_FACE] = {
@@ -299,6 +302,11 @@
         { 0xCE5956E9UL, 0x0000BC85UL }, /* fpgm */
         { 0x8272F416UL, 0x00000045UL }  /* prep */
       },
+      { /* DFHei-Md-HK-BF */
+        { 0x1257EB46UL, 0x00000350UL }, /* cvt  */
+        { 0xF699D160UL, 0x0000715FUL }, /* fpgm */
+        { 0xD222F568UL, 0x000003BCUL }  /* prep */
+      },
       { /* DFHSGothic-W5 */
         { 0x1262EB4EUL, 0x00000350UL }, /* cvt  */
         { 0xE86A5D64UL, 0x00007940UL }, /* fpgm */
@@ -324,6 +332,16 @@
         { 0xA6E78C01UL, 0x00008998UL }, /* fpgm */
         { 0x13A42602UL, 0x0000007EUL }  /* prep */
       },
+      { /* DFKaiShu-Md-HK-BF */
+        { 0x11E5EAD4UL, 0x00000360UL }, /* cvt  */
+        { 0x9DB282B2UL, 0x0000C06EUL }, /* fpgm */
+        { 0x53E6D7CAUL, 0x00000082UL }  /* prep */
+      },
+      { /* DFMing-Bd-HK-BF */
+        { 0x1243EB18UL, 0x00000350UL }, /* cvt  */
+        { 0xBA0A8C30UL, 0x000074ADUL }, /* fpgm */
+        { 0xF3D83409UL, 0x0000037BUL }  /* prep */
+      },
       { /* DLCLiShu */
         { 0x07DCF546UL, 0x00000308UL }, /* cvt  */
         { 0x40FE7C90UL, 0x00008E2AUL }, /* fpgm */
--- a/src/java.desktop/share/native/libfreetype/src/type1/t1load.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libfreetype/src/type1/t1load.c	Mon Jun 11 09:29:44 2018 +0200
@@ -2493,6 +2493,24 @@
       type1->encoding.num_chars  = loader.num_chars;
     }
 
+    /* some sanitizing to avoid overflows later on; */
+    /* the upper limits are ad-hoc values           */
+    if ( priv->blue_shift > 1000 || priv->blue_shift < 0 )
+    {
+      FT_TRACE2(( "T1_Open_Face:"
+                  " setting unlikely BlueShift value %d to default (7)\n",
+                  priv->blue_shift ));
+      priv->blue_shift = 7;
+    }
+
+    if ( priv->blue_fuzz > 1000 || priv->blue_fuzz < 0 )
+    {
+      FT_TRACE2(( "T1_Open_Face:"
+                  " setting unlikely BlueFuzz value %d to default (1)\n",
+                  priv->blue_fuzz ));
+      priv->blue_fuzz = 1;
+    }
+
   Exit:
     t1_done_loader( &loader );
     return error;
--- a/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c	Mon Jun 11 09:29:44 2018 +0200
@@ -1762,11 +1762,6 @@
                 }
             }
             break;
-#ifdef YCCALPHA
-        case JCS_YCC:
-            cinfo->out_color_space = JCS_YCC;
-            break;
-#endif
         case JCS_YCCK:
             if ((cinfo->saw_Adobe_marker) && (cinfo->Adobe_transform != 2)) {
                 /*
--- a/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c	Mon Jun 11 09:29:44 2018 +0200
@@ -569,11 +569,7 @@
   /* select buffered-image mode if it is a progressive JPEG only */
   buffered_mode = cinfo.buffered_image = jpeg_has_multiple_scans(&cinfo);
   grayscale = (cinfo.out_color_space == JCS_GRAYSCALE);
-#ifdef YCCALPHA
-  hasalpha = (cinfo.out_color_space == JCS_RGBA);
-#else
   hasalpha = 0;
-#endif
   /* We can ignore the return value from jpeg_read_header since
    *   (a) suspension is not possible with the stdio data source, and
    *                                    (nor with the Java input source)
--- a/src/java.desktop/share/native/libsplashscreen/java_awt_SplashScreen.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/share/native/libsplashscreen/java_awt_SplashScreen.c	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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
@@ -28,6 +28,7 @@
 #include <jni.h>
 #include <jni_util.h>
 #include <sizecalc.h>
+#include "java_awt_SplashScreen.h"
 
 JNIEXPORT jint JNICALL
 DEF_JNI_OnLoad(JavaVM * vm, void *reserved)
--- a/src/java.desktop/unix/classes/sun/print/IPPPrintService.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/unix/classes/sun/print/IPPPrintService.java	Mon Jun 11 09:29:44 2018 +0200
@@ -25,6 +25,8 @@
 
 package sun.print;
 
+import java.awt.GraphicsEnvironment;
+import java.awt.Toolkit;
 import javax.print.attribute.*;
 import javax.print.attribute.standard.*;
 import javax.print.DocFlavor;
@@ -1071,6 +1073,11 @@
             catList.add(PrinterResolution.class);
         }
 
+        if (GraphicsEnvironment.isHeadless() == false) {
+            catList.add(DialogOwner.class);
+            catList.add(DialogTypeSelection.class);
+        }
+
         supportedCats = new Class<?>[catList.size()];
         catList.toArray(supportedCats);
         Class<?>[] copyCats = new Class<?>[supportedCats.length];
@@ -1392,10 +1399,38 @@
                 }
             }
             return false;
-        } if (attr.getCategory() == PrinterResolution.class) {
+        } else if (attr.getCategory() == PrinterResolution.class) {
             if (attr instanceof PrinterResolution) {
                 return isSupportedResolution((PrinterResolution)attr);
             }
+        } else if (attr.getCategory() == DialogOwner.class) {
+            DialogOwner owner = (DialogOwner)attr;
+            // ID not supported on any dialog type on Unix platforms.
+            if (DialogOwnerAccessor.getID(owner) != 0) {
+                return false;
+            }
+            // On Mac we have no control over the native dialog.
+            DialogTypeSelection dst = (attributes == null) ? null :
+               (DialogTypeSelection)attributes.get(DialogTypeSelection.class);
+            if (PrintServiceLookupProvider.isMac() &&
+                dst == DialogTypeSelection.NATIVE) {
+                return false;
+            }
+            // The other case is always a Swing dialog on all Unix platforms.
+            // So we only need to check that the toolkit supports
+            // always on top.
+            if (owner.getOwner() != null) {
+                return true;
+            } else {
+                return Toolkit.getDefaultToolkit().isAlwaysOnTopSupported();
+            }
+        } else if (attr.getCategory() == DialogTypeSelection.class) {
+            if (PrintServiceLookupProvider.isMac()) {
+                return true;
+            } else {
+               DialogTypeSelection dst = (DialogTypeSelection)attr;
+               return attr == DialogTypeSelection.COMMON;
+            }
         }
         return true;
     }
--- a/src/java.desktop/unix/classes/sun/print/UnixPrintService.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/unix/classes/sun/print/UnixPrintService.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,6 +31,8 @@
 import java.util.ArrayList;
 import java.util.Locale;
 
+import java.awt.GraphicsEnvironment;
+import java.awt.Toolkit;
 import javax.print.DocFlavor;
 import javax.print.DocPrintJob;
 import javax.print.PrintService;
@@ -54,6 +56,8 @@
 import javax.print.attribute.standard.Copies;
 import javax.print.attribute.standard.CopiesSupported;
 import javax.print.attribute.standard.Destination;
+import javax.print.attribute.standard.DialogOwner;
+import javax.print.attribute.standard.DialogTypeSelection;
 import javax.print.attribute.standard.Fidelity;
 import javax.print.attribute.standard.Media;
 import javax.print.attribute.standard.MediaPrintableArea;
@@ -619,10 +623,15 @@
     }
 
     public Class<?>[] getSupportedAttributeCategories() {
-        int totalCats = otherAttrCats.length;
-        Class<?>[] cats = new Class<?>[totalCats];
-        System.arraycopy(otherAttrCats, 0, cats, 0, otherAttrCats.length);
-        return cats;
+        ArrayList<Class<?>> categList = new ArrayList<>(otherAttrCats.length);
+        for (Class<?> c : otherAttrCats) {
+            categList.add(c);
+        }
+        if (GraphicsEnvironment.isHeadless() == false) {
+            categList.add(DialogOwner.class);
+            categList.add(DialogTypeSelection.class);
+        }
+        return categList.toArray(new Class<?>[categList.size()]);
     }
 
     public boolean
@@ -1023,6 +1032,24 @@
                 flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE))) {
                 return false;
             }
+        } else if (attr.getCategory() == DialogOwner.class) {
+            DialogOwner owner = (DialogOwner)attr;
+            // ID not supported on any dialog type on Unix platforms.
+            if (DialogOwnerAccessor.getID(owner) != 0) {
+                return false;
+            }
+            // UnixPrintService is not used on Mac, so this is
+            // always some Unix system that does not have CUPS/IPP
+            // Which means we always use a Swing dialog and we need
+            // only check if alwaysOnTop is supported by the toolkit.
+            if (owner.getOwner() != null) {
+                return true;
+            } else {
+                return Toolkit.getDefaultToolkit().isAlwaysOnTopSupported();
+            }
+        } else if (attr.getCategory() == DialogTypeSelection.class) {
+            DialogTypeSelection dts = (DialogTypeSelection)attr;
+            return dts == DialogTypeSelection.COMMON;
         }
         return true;
     }
--- a/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java	Mon Jun 11 09:29:44 2018 +0200
@@ -79,6 +79,7 @@
 import javax.print.attribute.standard.SheetCollate;
 import javax.print.attribute.standard.Copies;
 import javax.print.attribute.standard.Destination;
+import javax.print.attribute.standard.DialogOwner;
 import javax.print.attribute.standard.OrientationRequested;
 import javax.print.attribute.standard.Media;
 import javax.print.attribute.standard.MediaSizeName;
@@ -95,7 +96,6 @@
 import sun.print.Win32PrintService;
 import sun.print.PrintServiceLookupProvider;
 import sun.print.ServiceDialog;
-import sun.print.DialogOwner;
 
 import java.awt.Frame;
 import java.io.FilePermission;
--- a/src/java.desktop/windows/classes/sun/awt/windows/WRobotPeer.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/windows/classes/sun/awt/windows/WRobotPeer.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, 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
@@ -25,9 +25,13 @@
 
 package sun.awt.windows;
 
-import java.awt.*;
+import java.awt.GraphicsDevice;
+import java.awt.Point;
+import java.awt.Rectangle;
 import java.awt.peer.RobotPeer;
 
+import sun.java2d.SunGraphicsEnvironment;
+
 final class WRobotPeer extends WObjectPeer implements RobotPeer
 {
     WRobotPeer() {
@@ -48,7 +52,8 @@
     public native void mouseMoveImpl(int x, int y);
     @Override
     public void mouseMove(int x, int y) {
-        mouseMoveImpl(x, y);
+        Point point = SunGraphicsEnvironment.convertToDeviceSpace(x, y);
+        mouseMoveImpl(point.x, point.y);
     }
     @Override
     public native void mousePress(int buttons);
--- a/src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2018, 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
@@ -61,8 +61,8 @@
 import sun.awt.Win32GraphicsConfig;
 import sun.awt.Win32GraphicsDevice;
 import sun.awt.Win32GraphicsEnvironment;
+import sun.java2d.SunGraphicsEnvironment;
 import sun.java2d.pipe.Region;
-import sun.swing.SwingUtilities2;
 import sun.util.logging.PlatformLogger;
 
 public class WWindowPeer extends WPanelPeer implements WindowPeer,
@@ -659,7 +659,8 @@
          int cx = x + width / 2;
          int cy = y + height / 2;
          GraphicsConfiguration current = getGraphicsConfiguration();
-         GraphicsConfiguration other = SwingUtilities2.getGraphicsConfigurationAtPoint(current, cx, cy);
+         GraphicsConfiguration other = SunGraphicsEnvironment
+                 .getGraphicsConfigurationAtPoint(current, cx, cy);
          if (!current.equals(other)) {
              AffineTransform tx = other.getDefaultTransform();
              double otherScaleX = tx.getScaleX();
--- a/src/java.desktop/windows/classes/sun/print/Win32PrintService.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/windows/classes/sun/print/Win32PrintService.java	Mon Jun 11 09:29:44 2018 +0200
@@ -25,6 +25,8 @@
 
 package sun.print;
 
+import java.awt.GraphicsEnvironment;
+import java.awt.Toolkit;
 import java.awt.Window;
 import java.awt.print.PrinterJob;
 import java.io.File;
@@ -54,6 +56,8 @@
 import javax.print.attribute.standard.Copies;
 import javax.print.attribute.standard.CopiesSupported;
 import javax.print.attribute.standard.Destination;
+import javax.print.attribute.standard.DialogOwner;
+import javax.print.attribute.standard.DialogTypeSelection;
 import javax.print.attribute.standard.Fidelity;
 import javax.print.attribute.standard.Media;
 import javax.print.attribute.standard.MediaSizeName;
@@ -1042,6 +1046,10 @@
             categList.add(PrinterResolution.class);
         }
 
+        if (GraphicsEnvironment.isHeadless() == false) {
+            categList.add(DialogOwner.class);
+            categList.add(DialogTypeSelection.class);
+        }
         return categList.toArray(new Class<?>[categList.size()]);
     }
 
@@ -1585,6 +1593,23 @@
                 (isColorSup && (attr == ColorSupported.NOT_SUPPORTED))) {
                 return false;
             }
+        } else if (category == DialogTypeSelection.class) {
+            return true; // isHeadless was checked by category support
+        } else if (category == DialogOwner.class) {
+            DialogOwner owner = (DialogOwner)attr;
+            DialogTypeSelection dts = (attributes == null) ? null :
+                (DialogTypeSelection)attributes.get(DialogTypeSelection.class);
+            if (dts == DialogTypeSelection.NATIVE) {
+                return DialogOwnerAccessor.getID(owner) != 0;
+            } else {
+               if (DialogOwnerAccessor.getID(owner) != 0) {
+                  return false;
+               } else if (owner.getOwner() != null) {
+                   return true;
+               } else {
+                   return Toolkit.getDefaultToolkit().isAlwaysOnTopSupported();
+               }
+            }
         }
         return true;
     }
--- a/src/java.desktop/windows/native/libawt/java2d/windows/GDIRenderer.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/windows/native/libawt/java2d/windows/GDIRenderer.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, 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
@@ -85,7 +85,11 @@
         *pNpoints = outpoints;
     }
     if (outpoints > POLYTEMPSIZE) {
-        pPoints = (POINT *) SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(POINT), outpoints);
+        try {
+            pPoints = (POINT *) SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(POINT), outpoints);
+        } catch (const std::bad_alloc&) {
+            return NULL;
+        }
     }
     BOOL isempty = fixend;
     for (int i = 0; i < npoints; i++) {
--- a/src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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
@@ -873,7 +873,13 @@
       int numSizes = ::DeviceCapabilities(printerName, printerPort,
                                           DC_PAPERS, NULL, NULL);
       if (numSizes > 0) {
-          LPTSTR papers = (LPTSTR)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, numSizes, sizeof(WORD));
+          LPTSTR papers;
+          try {
+              papers = (LPTSTR)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, numSizes, sizeof(WORD));
+          } catch (const std::bad_alloc&) {
+              papers = NULL;
+          }
+
           if (papers != NULL &&
               ::DeviceCapabilities(printerName, printerPort,
                                    DC_PAPERS, papers, NULL) != -1) {
--- a/src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, 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
@@ -43,62 +43,20 @@
 {
 }
 
-#ifndef SPI_GETMOUSESPEED
-#define SPI_GETMOUSESPEED 112
-#endif
-
-#ifndef SPI_SETMOUSESPEED
-#define SPI_SETMOUSESPEED 113
-#endif
+static int signum(int i) {
+  // special version of signum which returns 1 when value is 0
+  return i >= 0 ? 1 : -1;
+}
 
 void AwtRobot::MouseMove( jint x, jint y)
 {
-    // Fix for Bug 4288230. See Q193003 from MSDN.
-      int oldAccel[3], newAccel[3];
-      INT_PTR oldSpeed, newSpeed;
-      BOOL bResult;
-
-   // The following values set mouse ballistics to 1 mickey/pixel.
-      newAccel[0] = 0;
-      newAccel[1] = 0;
-      newAccel[2] = 0;
-      newSpeed = 10;
-
-      // Save the Current Mouse Acceleration Constants
-      bResult = SystemParametersInfo(SPI_GETMOUSE,0,oldAccel,0);
-      bResult = SystemParametersInfo(SPI_GETMOUSESPEED, 0, &oldSpeed,0);
-      // Set the new Mouse Acceleration Constants (Disabled).
-      bResult = SystemParametersInfo(SPI_SETMOUSE,0,newAccel,SPIF_SENDCHANGE);
-      bResult = SystemParametersInfo(SPI_SETMOUSESPEED, 0,
-                // 4504963: Though the third argument to SystemParameterInfo is
-                // declared as a PVOID, as of Windows 2000 it is apparently
-                // interpreted as an int.  (The MSDN docs for SPI_SETMOUSESPEED
-                // say that it's an integer between 1 and 20, the default being
-                // 10).  Instead of passing the @ of the desired value, the
-                // value itself is now passed, cast as a PVOID so as to
-                // compile.  -bchristi 10/02/2001
-                                     (PVOID)newSpeed,
-                                     SPIF_SENDCHANGE);
-
-      int primaryIndex = AwtWin32GraphicsDevice::GetDefaultDeviceIndex();
-      Devices::InstanceAccess devices;
-      AwtWin32GraphicsDevice *device = devices->GetDevice(primaryIndex);
-
-      x = (device == NULL) ? x : device->ScaleUpX(x);
-      y = (device == NULL) ? y : device->ScaleUpY(y);
-
-      POINT curPos;
-      ::GetCursorPos(&curPos);
-      x -= curPos.x;
-      y -= curPos.y;
-
-      mouse_event(MOUSEEVENTF_MOVE,x,y,0,0);
-      // Move the cursor to the desired coordinates.
-
-      // Restore the old Mouse Acceleration Constants.
-      bResult = SystemParametersInfo(SPI_SETMOUSE,0, oldAccel, SPIF_SENDCHANGE);
-      bResult = SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)oldSpeed,
-                                     SPIF_SENDCHANGE);
+    INPUT mouseInput = {0};
+    mouseInput.type = INPUT_MOUSE;
+    mouseInput.mi.time = 0;
+    mouseInput.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
+    mouseInput.mi.dx = (x * 65536 /::GetSystemMetrics(SM_CXSCREEN)) + signum(x);
+    mouseInput.mi.dy = (y * 65536 /::GetSystemMetrics(SM_CYSCREEN)) + signum(y);
+    ::SendInput(1, &mouseInput, sizeof(mouseInput));
 }
 
 void AwtRobot::MousePress( jint buttonMask )
--- a/src/java.prefs/macosx/native/libprefs/MacOSXPreferencesFile.m	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.prefs/macosx/native/libprefs/MacOSXPreferencesFile.m	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, 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
@@ -63,6 +63,7 @@
 #include "jni_util.h"
 #include "jlong.h"
 #include "jvm.h"
+#include "java_util_prefs_MacOSXPreferencesFile.h"
 
 /*
  * Declare library specific JNI_Onload entry if static build
--- a/src/java.prefs/unix/native/libprefs/FileSystemPreferences.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.prefs/unix/native/libprefs/FileSystemPreferences.c	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, 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
@@ -34,6 +34,7 @@
 #include <errno.h>
 #include <utime.h>
 #include "jni_util.h"
+#include "java_util_prefs_FileSystemPreferences.h"
 
 /*
  * Declare library specific JNI_Onload entry if static build
--- a/src/java.prefs/windows/native/libprefs/WindowsPreferences.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.prefs/windows/native/libprefs/WindowsPreferences.c	Mon Jun 11 09:29:44 2018 +0200
@@ -28,6 +28,8 @@
 #include "jni.h"
 #include "jni_util.h"
 #include "jvm.h"
+#include "java_util_prefs_WindowsPreferences.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
--- a/src/java.security.jgss/windows/native/libw2k_lsa_auth/NativeCreds.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.security.jgss/windows/native/libw2k_lsa_auth/NativeCreds.c	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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
@@ -44,6 +44,7 @@
 #include <jni.h>
 #include "jni_util.h"
 #include <winsock.h>
+#include "sun_security_krb5_Credentials.h"
 
 #undef LSA_SUCCESS
 #define LSA_SUCCESS(Status) ((Status) >= 0)
--- a/src/java.security.jgss/windows/native/libw2k_lsa_auth/WindowsDirectory.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/java.security.jgss/windows/native/libw2k_lsa_auth/WindowsDirectory.c	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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
@@ -27,6 +27,7 @@
 #include <jni.h>
 #include <windows.h>
 #include <stdlib.h>
+#include "sun_security_krb5_Config.h"
 
 /*
  * Class:     sun_security_krb5_Config
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/package-info.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,286 @@
+/*
+ * Copyright (c)  2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Standard interfaces and base classes for JDBC <code>RowSet</code>
+ * implementations. This package contains interfaces and classes
+ * that a standard <code>RowSet</code> implementation either implements or extends.
+ *
+ * <h2>Table of Contents</h2>
+ * <ul>
+ * <li><a href="#pkgspec">1.0 Package Specification</a>
+ * <li><a href="#stdrowset">2.0 Standard RowSet Definitions</a>
+ * <li><a href="#impl">3.0 Implementer's Guide</a>
+ * <li><a href="#relspec">4.0 Related Specifications</a>
+ * <li><a href="#reldocs">5.0 Related Documentation</a>
+ * </ul>
+ *
+ * <h3><a id="pkgspec">1.0 Package Specification</a></h3>
+ * This package specifies five standard JDBC <code>RowSet</code> interfaces.
+ * All five extend the
+ * <a href="{@docRoot}/java.sql/javax/sql/RowSet.html">RowSet</a> interface described in the JDBC 3.0
+ * specification.  It is anticipated that additional definitions
+ * of more specialized JDBC <code>RowSet</code> types will emerge as this technology
+ * matures. Future definitions <i>should</i> be specified as subinterfaces using
+ * inheritance similar to the way it is used in this specification.
+ * <p>
+ * <i>Note:</i> The interface definitions provided in this package form the basis for
+ * all compliant JDBC <code>RowSet</code> implementations. Vendors and more advanced
+ * developers who intend to provide their own compliant <code>RowSet</code> implementations
+ * should pay particular attention to the assertions detailed in specification
+ * interfaces.
+ *
+ * <h3><a id="stdrowset">2.0 Standard RowSet Definitions</a></h3>
+ * <ul>
+ * <li><a href="JdbcRowSet.html"><b><code>JdbcRowSet</code></b></a> - A wrapper around
+ * a <code>ResultSet</code> object that makes it possible to use the result set as a
+ * JavaBeans&trade; component. Thus,
+ * a <code>JdbcRowSet</code> object can be a Bean that any tool
+ * makes available for assembling an application as part of a component based
+ * architecture. A <code>JdbcRowSet</code> object is a connected <code>RowSet</code>
+ * object, that is, it
+ * <b>must</b> continually maintain its connection to its data source using a JDBC
+ * technology-enabled driver ("JDBC driver"). In addition, a <code>JdbcRowSet</code>
+ * object provides a fully updatable and scrollable tabular
+ * data structure as defined in the JDBC 3.0 specification.
+ *
+ * <li><a href="CachedRowSet.html">
+ * <b><code>CachedRowSet</code>&trade;</b></a>
+ *  - A <code>CachedRowSet</code> object is a JavaBeans&trade;
+ * component that is scrollable, updatable, serializable, and generally disconnected from
+ * the source of its data. A <code>CachedRowSet</code> object
+ * typically contains rows from a result set, but it can also contain rows from any
+ * file with a tabular format, such as a spreadsheet. <code>CachedRowSet</code> implementations
+ * <b>must</b> use the <code>SyncFactory</code> to manage and obtain pluggable
+ * <code>SyncProvider</code> objects to provide synchronization between the
+ * disconnected <code>RowSet</code> object and the originating data source.
+ * Typically a <code>SyncProvider</code> implementation relies upon a JDBC
+ * driver to obtain connectivity to a particular data source.
+ * Further details on this mechanism are discussed in the <a
+ * href="spi/package-summary.html"><code>javax.sql.rowset.spi</code></a> package
+ * specification.
+ *
+ * <li><a href="WebRowSet.html"><b><code>WebRowSet</code></b></a> - A
+ * <code>WebRowSet</code> object is an extension of <code>CachedRowSet</code>
+ * that can read and write a <code>RowSet</code> object in a well formed XML format.
+ * This class calls an <a href="spi/XmlReader.html"><code>XmlReader</code></a> object
+ * (an extension of the <a href="{@docRoot}/java.sql/javax/sql/RowSetReader.html"><code>RowSetReader</code></a>
+ * interface) to read a rowset in XML format. It calls an
+ * <a href="spi/XmlWriter.html"><code>XmlWriter</code></a> object (an extension of the
+ * <a href="{@docRoot}/java.sql/javax/sql/RowSetWriter.html"><code>RowSetWriter</code></a> interface)
+ * to write a rowset in XML format. The reader and writer required by
+ * <code>WebRowSet</code> objects are provided by the
+ * <code>SyncFactory</code> in the form of <code>SyncProvider</code>
+ * implementations. In order to ensure well formed XML usage, a standard generic XML
+ * Schema is defined and published at
+ * <a href="http://java.sun.com/xml/ns/jdbc/webrowset.xsd">
+ * <code>http://java.sun.com/xml/ns/jdbc/webrowset.xsd</code></a>.
+ *
+ * <li><a href="FilteredRowSet.html"><b><code>FilteredRowSet</code></b></a> - A
+ * <code>FilteredRowSet</code> object provides filtering functionality in a programmatic
+ * and extensible way. There are many instances when a <code>RowSet</code> <code>object</code>
+ * has a need to provide filtering in its contents without sacrificing the disconnected
+ * environment, thus saving the expense of having to create a connection to the data source.
+ * Solutions to this need vary from providing heavyweight full scale
+ * SQL query abilities, to portable components, to more lightweight
+ * approaches. A <code>FilteredRowSet</code> object consumes
+ * an implementation of the <a href="Predicate.html"><code>Predicate</code></a>
+ * interface, which <b>may</b> define a filter at run time. In turn, a
+ * <code>FilteredRowSet</code> object is tasked with enforcing the set filter for both
+ * inbound and outbound read and write operations. That is, all filters can be
+ * considered as bi-directional. No standard filters are defined;
+ * however, sufficient mechanics are specified to permit any required filter to be
+ * implemented.
+ *
+ * <li><a href="JoinRowSet.html"><b><code>JoinRowSet</code></b></a> - The <code>JoinRowSet</code>
+ * interface  describes a mechanism by which relationships can be established between
+ * two or more standard <code>RowSet</code> implementations. Any number of <code>RowSet</code>
+ * objects can be added to a <code>JoinRowSet</code> object provided  the <code>RowSet</code>objects
+ * can be related  in a SQL <code>JOIN</code> like fashion. By definition, the SQL <code>JOIN</code>
+ * statement  is used to combine the data contained in two (<i>or more</i>) relational
+ * database tables based upon a common attribute. By establishing and then enforcing
+ * column matches, a <code>JoinRowSet</code> object establishes relationships between
+ * <code>RowSet</code> instances without the need to touch the originating data source.
+ * </ul>
+ *
+ * <h3><a id="impl">3.0 Implementer's Guide</a></h3>
+ * Compliant implementations of JDBC <code>RowSet</code> Implementations
+ * <b>must</b> follow the assertions described in this specification. In accordance
+ * with the terms of the <a href="http://www.jcp.org">Java Community Process</a>, a
+ * Test Compatibility Kit (TCK) can be licensed to ensure compatibility with the
+ * specification. The following paragraphs outline a number of starting points for
+ * implementers of the standard JDBC <code>RowSet</code> definitions. Implementers
+ * should also consult the <i>Implementer's Guide</i> in the <a
+ * href="spi/package-summary.html">javax.sql.rowset.spi</a> package for guidelines
+ * on <a href="spi/SyncProvider.html"><code>SyncProvider</code></a> implementations.
+ *
+ * <ul>
+ * <li><b>3.1 Constructor</b>
+ * <p>
+ *   All <code>RowSet</code> implementations <strong>must</strong> provide a
+ * no-argument constructor.
+ * </li>
+ * <li><b>3.2 Role of the <code>BaseRowSet</code> Class</b>
+ * <p>
+ * A compliant JDBC <code>RowSet</code> implementation <b>must</b> implement one or more
+ * standard interfaces specified in this package and <b>may</b> extend the
+ * <a href="BaseRowSet.html"><code>BaseRowSet</code></a> abstract class. For example, a
+ * <code>CachedRowSet</code> implementation must implement the <code>CachedRowSet</code>
+ * interface and extend the <code>BaseRowSet</code> abstract class. The
+ * <code>BaseRowSet</code> class provides the standard architecture on which all
+ * <code>RowSet</code> implementations should be built, regardless of whether the
+ * <code>RowSet</code> objects exist in a connected or disconnected environment.
+ * The <code>BaseRowSet</code> abstract class provides any <code>RowSet</code> implementation
+ * with its base functionality, including property manipulation and event notification
+ * that is fully compliant with <a href="http://java.sun.com/products/javabeans">JavaBeans</a>
+ * component requirements. As an example, all implementations provided in the
+ * reference implementations (contained in the <code>com.sun.rowset</code> package) use
+ * the <code>BaseRowSet</code> class as a basis for their implementations.
+ * <P>
+ * The following table illustrates the features that the <code>BaseRowSet</code>
+ * abstract class provides.
+ * <blockquote>
+ *   <table class="striped" style="vertical-align:top; width:75%">
+ *     <caption>Features in <code>BaseRowSet</code></caption>
+ *         <thead>
+ *           <tr>
+ *             <th scope="col">Feature</th>
+ *             <th scope="col">Details</th>
+ *           </tr>
+ *         </thead>
+ *         <tbody>
+ *           <tr>
+ *             <th scope="row">Properties</th>
+ *             <td>Provides standard JavaBeans property manipulation
+ * mechanisms to allow applications to get and set <code>RowSet</code> command and
+ * property  values. Refer to the   documentation of the <code>javax.sql.RowSet</code>
+ * interface  (available in the JDBC 3.0 specification) for more details on
+ * the standard  <code>RowSet</code> properties.</td>
+ *           </tr>
+ *           <tr>
+ *             <th scope="row">Event notification</th>
+ *             <td>Provides standard JavaBeans event notifications
+ * to registered event listeners. Refer to the documentation of <code>javax.sql.RowSetEvent</code>
+ * interface (available in the JDBC 3.0 specification) for
+ * more details on how  to register and handle standard RowSet events generated
+ * by  compliant implementations.</td>
+ *           </tr>
+ *           <tr>
+ *             <th scope="row">Setters for a RowSet object's command</th>
+ *             <td>Provides a complete set of setter methods
+ *                for setting RowSet command parameters.</td>
+ *           </tr>
+ *           <tr>
+ *             <th scope="row">Streams</th>
+ *             <td>Provides fields for storing of stream instances
+ * in addition to providing a set of constants for stream type designation.</td>
+ *           </tr>
+ *     </tbody>
+ *   </table>
+ *   </blockquote>
+ *
+ * <li><b>3.3 Connected RowSet Requirements</b>
+ * <p>
+ * The <code>JdbcRowSet</code> describes a <code>RowSet</code> object that <b>must</b> always
+ * be connected to the originating data source. Implementations of the <code>JdbcRowSet</code>
+ * should ensure that this connection is provided solely by a JDBC driver.
+ * Furthermore, <code>RowSet</code> objects that are implementations of the
+ * <code>JdbcRowSet</code> interface and are therefore operating in a connected environment
+ * do not use the <code>SyncFactory</code> to obtain a <code>RowSetReader</code> object
+ * or a <code>RowSetWriter</code> object. They can safely rely on the JDBC driver to
+ * supply their needs by virtue of the presence of an underlying updatable and scrollable
+ * <code>ResultSet</code> implementation.
+ *
+ * <li>
+ * <b>3.4 Disconnected RowSet Requirements</b>
+ * <p>
+ * A disconnected <code>RowSet</code> object, such as a <code>CachedRowSet</code> object,
+ * <b>should</b> delegate
+ * connection management to a <code>SyncProvider</code> object provided by the
+ * <code>SyncFactory</code>. To ensure fully disconnected semantics, all
+ * disconnected <code>RowSet</code> objects <b>must</b> ensure
+ * that the original connection made to the data source to populate the <code>RowSet</code>
+ * object is closed to permit the garbage collector to recover and release resources. The
+ * <code>SyncProvider</code> object ensures that the critical JDBC properties are
+ * maintained in order to re-establish a connection to the data source when a
+ * synchronization is required. A disconnected <code>RowSet</code> object should
+ * therefore ensure that no
+ * extraneous references remain on the <code>Connection</code> object.
+ *
+ * <li><b>3.5 Role of RowSetMetaDataImpl</b>
+ * <p>
+ * The <code>RowsetMetaDataImpl</code> class is a utility class that provides an implementation of the
+ * <a href="{@docRoot}/java.sql/javax/sql/RowSetMetaData.html">RowSetMetaData</a> interface, supplying standard setter
+ * method implementations for metadata for both connected and disconnected
+ * <code>RowSet</code> objects. All implementations are free to use this standard
+ * implementation but are not required to do so.
+ *
+ * <li><b>3.6 RowSetWarning Class</b>
+ * <p>
+ * The <code>RowSetWarning</code> class provides warnings that can be set
+ * on <code>RowSet</code> implementations.
+ * Similar to <a href="{@docRoot}/java.sql/java/sql/SQLWarning.html">SQLWarning</a> objects,
+ * <code>RowSetWarning</code>  objects are silently chained to the object whose method
+ * caused the warning to be thrown. All <code>RowSet</code> implementations <b>should</b>
+ * ensure that this chaining occurs if a warning is generated and also ensure that the
+ * warnings are available via the <code>getRowSetWarnings</code> method defined in either
+ * the <code>JdbcRowSet</code> interface or the <code>CachedRowSet</code> interface.
+ * After a warning has been retrieved with one of the
+ * <code>getRowSetWarnings</code> methods, the <code>RowSetWarning</code> method
+ * <code>getNextWarning</code> can be called on it to retrieve any warnings that might
+ * be chained on it.  If a warning is returned, <code>getNextWarning</code> can be called
+ * on it, and so on until there are no more warnings.
+ *
+ * <li><b>3.7 The Joinable Interface</b>
+ * <P>
+ * The <code>Joinable</code> interface provides both connected and disconnected
+ * <code>RowSet</code> objects with the capability to be added to a
+ * <code>JoinRowSet</code> object in an SQL <code>JOIN</code> operation.
+ * A <code>RowSet</code> object that has  implemented the <code>Joinable</code>
+ * interface can set a match column, retrieve a match column, or unset a match column.
+ * A <code>JoinRowSet</code> object can then use the <code>RowSet</code> object's
+ * match column as a basis for adding the <code>RowSet</code> object.
+ * </li>
+ *
+ * <li><b>3.8 The RowSetFactory Interface</b>
+ *   <p>
+ *       A <code>RowSetFactory</code> implementation <strong>must</strong>
+ *       be provided.
+ * </li>
+ * </ul>
+ *
+ * <h3><a id="relspec">4.0 Related Specifications</a></h3>
+ * <ul>
+ * <li><a href="https://jcp.org/en/jsr/detail?id=221">JDBC 4.3 Specification</a>
+ * <li><a href="http://www.w3.org/XML/Schema">XML Schema</a>
+ * </ul>
+ *
+ * <h3><a id="reldocs">5.0 Related Documentation</a></h3>
+ * <ul>
+ * <li><a href="http://docs.oracle.com/javase/tutorial/jdbc/basics/rowset.html">
+ * JDBC RowSet Tutorial</a>
+ *</ul>
+ */
+package javax.sql.rowset;
--- a/src/java.sql.rowset/share/classes/javax/sql/rowset/package.html	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,297 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
-
-  <meta http-equiv="Content-Type"
- content="text/html; charset=iso-8859-1">
-<!--
-Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
-
--->
-  <title>javax.sql.rowset Package</title>
-</head>
-  <body>
-
-<!-- Description clause -->
-Standard interfaces and base classes for JDBC <code>RowSet</code>
-implementations. This package contains interfaces and classes 
-that a standard <code>RowSet</code> implementation either implements or extends.
-
-
-<h2>Table of Contents</h2>
-<ul>
-<li><a href="#pkgspec">1.0 Package Specification</a>
-<li><a href="#stdrowset">2.0 Standard RowSet Definitions</a>
-<li><a href="#impl">3.0 Implementer's Guide</a>
-<li><a href="#relspec">4.0 Related Specifications</a>
-<li><a href="#reldocs">5.0 Related Documentation</a>
-</ul>
-
-<h3><a id="pkgspec">1.0 Package Specification</a></h3>
-This package specifies five standard JDBC <code>RowSet</code> interfaces.
- All five extend the 
-<a href="../RowSet.html">RowSet</a> interface described in the JDBC 3.0
-specification.  It is anticipated that additional definitions
-of more specialized JDBC <code>RowSet</code> types will emerge as this technology
-matures. Future definitions <i>should</i> be specified as subinterfaces using
-inheritance similar to the way it is used in this specification.
-<p>
-<i>Note:</i> The interface definitions provided in this package form the basis for
-all compliant JDBC <code>RowSet</code> implementations. Vendors and more advanced
-developers who intend to provide their own compliant <code>RowSet</code> implementations
-should pay particular attention to the assertions detailed in specification
-interfaces. 
-
-<h3><a id="stdrowset">2.0 Standard RowSet Definitions</a></h3>
-<ul>
-<li><a href="JdbcRowSet.html"><b><code>JdbcRowSet</code></b></a> - A wrapper around
-a <code>ResultSet</code> object that makes it possible to use the result set as a
-JavaBeans&trade; component. Thus,
-a <code>JdbcRowSet</code> object can be a Bean that any tool
-makes available for assembling an application as part of a component based
-architecture. A <code>JdbcRowSet</code> object is a connected <code>RowSet</code>
-object, that is, it 
-<b>must</b> continually maintain its connection to its data source using a JDBC
-technology-enabled driver ("JDBC driver"). In addition, a <code>JdbcRowSet</code>
-object provides a fully updatable and scrollable tabular
-data structure as defined in the JDBC 3.0 specification.
-
-<li><a href="CachedRowSet.html">
-<b><code>CachedRowSet</code>&trade;</b></a>
- - A <code>CachedRowSet</code> object is a JavaBeans&trade;
- component that is scrollable, updatable, serializable, and generally disconnected from
- the source of its data. A <code>CachedRowSet</code> object
-typically contains rows from a result set, but it can also contain rows from any
-file with a tabular format, such as a spreadsheet. <code>CachedRowSet</code> implementations
-<b>must</b> use the <code>SyncFactory</code> to manage and obtain pluggable
-<code>SyncProvider</code> objects to provide synchronization between the
-disconnected <code>RowSet</code> object and the originating data source.
-Typically a <code>SyncProvider</code> implementation relies upon a JDBC
-driver to obtain connectivity to a particular data source.
-Further details on this mechanism are discussed in the <a
-href="spi/package-summary.html"><code>javax.sql.rowset.spi</code></a> package
-specification.
-
-<li><a href="WebRowSet.html"><b><code>WebRowSet</code></b></a> - A 
-<code>WebRowSet</code> object is an extension of <code>CachedRowSet</code>
-that can read and write a <code>RowSet</code> object in a well formed XML format.
-This class calls an <a href="spi/XmlReader.html"><code>XmlReader</code></a> object
-(an extension of the <a href="../RowSetReader.html"><code>RowSetReader</code></a>
-interface) to read a rowset in XML format. It calls an 
-<a href="spi/XmlWriter.html"><code>XmlWriter</code></a> object (an extension of the
-<a href="../RowSetWriter.html"><code>RowSetWriter</code></a> interface)
-to write a rowset in XML format. The reader and writer required by
-<code>WebRowSet</code> objects are provided by the
-<code>SyncFactory</code> in the form of <code>SyncProvider</code>
-implementations. In order to ensure well formed XML usage, a standard generic XML
-Schema is defined and published at
-<a href="http://java.sun.com/xml/ns/jdbc/webrowset.xsd">
-<code>http://java.sun.com/xml/ns/jdbc/webrowset.xsd</code></a>.
-
-<li><a href="FilteredRowSet.html"><b><code>FilteredRowSet</code></b></a> - A
-<code>FilteredRowSet</code> object provides filtering functionality in a programmatic
-and extensible way. There are many instances when a <code>RowSet</code> <code>object</code>
-has a need to provide filtering in its contents without sacrificing the disconnected
-environment, thus saving the expense of having to create a connection to the data source.
-Solutions to this need vary from providing heavyweight full scale 
-SQL query abilities, to portable components, to more lightweight 
-approaches. A <code>FilteredRowSet</code> object consumes
-an implementation of the <a href="Predicate.html"><code>Predicate</code></a>
-interface, which <b>may</b> define a filter at run time. In turn, a
-<code>FilteredRowSet</code> object is tasked with enforcing the set filter for both
-inbound and outbound read and write operations. That is, all filters can be
-considered as bi-directional. No standard filters are defined;
-however, sufficient mechanics are specified to permit any required filter to be
-implemented.
-
-<li><a href="JoinRowSet.html"><b><code>JoinRowSet</code></b></a> - The <code>JoinRowSet</code>
-interface  describes a mechanism by which relationships can be established between
-two or more standard <code>RowSet</code> implementations. Any number of <code>RowSet</code>
- objects can be added to a <code>JoinRowSet</code> object provided  the <code>RowSet</code>objects
-can be related  in a SQL <code>JOIN</code> like fashion. By definition, the SQL <code>JOIN</code>
-statement  is used to combine the data contained in two (<i>or more</i>) relational
-database tables based upon a common attribute. By establishing and then enforcing
-column matches, a <code>JoinRowSet</code> object establishes relationships between
-<code>RowSet</code> instances without the need to touch the originating data source.
-</ul>
-
-<h3><a id="impl">3.0 Implementer's Guide</a></h3>
-Compliant implementations of JDBC <code>RowSet</code> Implementations
-<b>must</b> follow the assertions described in this specification. In accordance
-with the terms of the <a href="http://www.jcp.org">Java Community Process</a>, a
-Test Compatibility Kit (TCK) can be licensed to ensure compatibility with the
-specification. The following paragraphs outline a number of starting points for
-implementers of the standard JDBC <code>RowSet</code> definitions. Implementers
-should also consult the <i>Implementer's Guide</i> in the <a
-href="spi/package-summary.html">javax.sql.rowset.spi</a> package for guidelines
-on <a href="spi/SyncProvider.html"><code>SyncProvider</code></a> implementations.
-
-<ul>
-<li><b>3.1 Constructor</b>
-<p>
-    All <code>RowSet</code> implementations <strong>must</strong> provide a
-no-argument constructor.
-</li>
-<li><b>3.2 Role of the <code>BaseRowSet</code> Class</b>
-<p>
-A compliant JDBC <code>RowSet</code> implementation <b>must</b> implement one or more
-standard interfaces specified in this package and <b>may</b> extend the
-<a href="BaseRowSet.html"><code>BaseRowSet</code></a> abstract class. For example, a
-<code>CachedRowSet</code> implementation must implement the <code>CachedRowSet</code>
-interface and extend the <code>BaseRowSet</code> abstract class. The
-<code>BaseRowSet</code> class provides the standard architecture on which all
-<code>RowSet</code> implementations should be built, regardless of whether the
-<code>RowSet</code> objects exist in a connected or disconnected environment.
-The <code>BaseRowSet</code> abstract class provides any <code>RowSet</code> implementation
-with its base functionality, including property manipulation and event notification
-that is fully compliant with <a href="http://java.sun.com/products/javabeans">JavaBeans</a>
-component requirements. As an example, all implementations provided in the
-reference implementations (contained in the <code>com.sun.rowset</code> package) use
-the <code>BaseRowSet</code> class as a basis for their implementations.
-<P>
-The following table illustrates the features that the <code>BaseRowSet</code>
-abstract class provides.
-  <blockquote>
-    <table class="striped" style="vertical-align:top; width:75%">
-	<caption>Features in <code>BaseRowSet</code></caption>
-          <thead>
-            <tr>
-              <th scope="col">Feature</th>
-              <th scope="col">Details</th>
-            </tr>
-          </thead>
-          <tbody>
-            <tr>
-              <th scope="row">Properties</th>
-              <td>Provides standard JavaBeans property manipulation
-mechanisms to allow applications to get and set <code>RowSet</code> command and
-property  values. Refer to the   documentation of the <code>javax.sql.RowSet</code>
-interface  (available in the JDBC 3.0 specification) for more details on
-the standard  <code>RowSet</code> properties.</td>
-            </tr>
-            <tr>
-              <th scope="row">Event notification</th>
-              <td>Provides standard JavaBeans event notifications
-to registered event listeners. Refer to the documentation of <code>javax.sql.RowSetEvent</code>
-interface (available in the JDBC 3.0 specification) for
-more details on how  to register and handle standard RowSet events generated
-by  compliant implementations.</td>
-            </tr>
-            <tr>
-              <th scope="row">Setters for a RowSet object's command</th>
-              <td>Provides a complete set of setter methods
-                 for setting RowSet command parameters.</td>
-            </tr>
-            <tr>
-              <th scope="row">Streams</th>
-              <td>Provides fields for storing of stream instances
-  in addition to providing a set of constants for stream type designation.</td>
-            </tr>
-      </tbody>
-    </table>
-    </blockquote>
-
-<li><b>3.3 Connected RowSet Requirements</b>
-<p>
-The <code>JdbcRowSet</code> describes a <code>RowSet</code> object that <b>must</b> always
-be connected to the originating data source. Implementations of the <code>JdbcRowSet</code>
-should ensure that this connection is provided solely by a JDBC driver.
-Furthermore, <code>RowSet</code> objects that are implementations of the
-<code>JdbcRowSet</code> interface and are therefore operating in a connected environment
-do not use the <code>SyncFactory</code> to obtain a <code>RowSetReader</code> object
-or a <code>RowSetWriter</code> object. They can safely rely on the JDBC driver to
-supply their needs by virtue of the presence of an underlying updatable and scrollable
-<code>ResultSet</code> implementation.
-
-<li>
-<b>3.4 Disconnected RowSet Requirements</b>
-<p> 
-A disconnected <code>RowSet</code> object, such as a <code>CachedRowSet</code> object,
-<b>should</b> delegate  
-connection management to a <code>SyncProvider</code> object provided by the
-<code>SyncFactory</code>. To ensure fully disconnected semantics, all
-disconnected <code>RowSet</code> objects <b>must</b> ensure
-that the original connection made to the data source to populate the <code>RowSet</code>
-object is closed to permit the garbage collector to recover and release resources. The
-<code>SyncProvider</code> object ensures that the critical JDBC properties are
-maintained in order to re-establish a connection to the data source when a
-synchronization is required. A disconnected <code>RowSet</code> object should
-therefore ensure that no
-extraneous references remain on the <code>Connection</code> object.
-
-<li><b>3.5 Role of RowSetMetaDataImpl</b>
-<p>
-The <code>RowsetMetaDataImpl</code> class is a utility class that provides an implementation of the
-<a href="../RowSetMetaData.html">RowSetMetaData</a> interface, supplying standard setter
-method implementations for metadata for both connected and disconnected
-<code>RowSet</code> objects. All implementations are free to use this standard
-implementation but are not required to do so.
-
-<li><b>3.6 RowSetWarning Class</b>
-<p>
-The <code>RowSetWarning</code> class provides warnings that can be set
-on <code>RowSet</code> implementations.
-Similar to <a href="../../../java/sql/SQLWarning.html">SQLWarning</a> objects,
-<code>RowSetWarning</code>  objects are silently chained to the object whose method
-caused the warning to be thrown. All <code>RowSet</code> implementations <b>should</b>
-ensure that this chaining occurs if a warning is generated and also ensure that the
-warnings are available via the <code>getRowSetWarnings</code> method defined in either
-the <code>JdbcRowSet</code> interface or the <code>CachedRowSet</code> interface.
-After a warning has been retrieved with one of the
-<code>getRowSetWarnings</code> methods, the <code>RowSetWarning</code> method
-<code>getNextWarning</code> can be called on it to retrieve any warnings that might
-be chained on it.  If a warning is returned, <code>getNextWarning</code> can be called
-on it, and so on until there are no more warnings.
-
-<li><b>3.7 The Joinable Interface</b>
-<P>
-The <code>Joinable</code> interface provides both connected and disconnected
-<code>RowSet</code> objects with the capability to be added to a
-<code>JoinRowSet</code> object in an SQL <code>JOIN</code> operation.
-A <code>RowSet</code> object that has  implemented the <code>Joinable</code>
-interface can set a match column, retrieve a match column, or unset a match column.
-A <code>JoinRowSet</code> object can then use the <code>RowSet</code> object's
-match column as a basis for adding the <code>RowSet</code> object.
-</li>
-
-<li><b>3.8 The RowSetFactory Interface</b>
-    <p>
-        A <code>RowSetFactory</code> implementation <strong>must</strong>
-        be provided.
-</li>
-</ul>
-
-<h3><a id="relspec">4.0 Related Specifications</a></h3>
-<ul>
-<li><a href="https://jcp.org/en/jsr/detail?id=221">JDBC 4.3 Specification</a>
-<li><a href="http://www.w3.org/XML/Schema">XML Schema</a>
-</ul>
-
-<h3><a id="reldocs">5.0 Related Documentation</a></h3>
-<ul>
-<li><a href="http://docs.oracle.com/javase/tutorial/jdbc/basics/rowset.html">
-JDBC RowSet Tutorial</a>
-</ul>
-</body>
-</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package-info.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,480 @@
+/*
+ * Copyright (c)  2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * The standard classes and interfaces that a third party vendor has to
+ * use in its implementation of a synchronization provider. These classes and
+ * interfaces are referred to as the Service Provider Interface (SPI).  To make it possible
+ * for a <code>RowSet</code> object to use an implementation, the vendor must register
+ * it with the <code>SyncFactory</code> singleton. (See the class comment for
+ * <code>SyncProvider</code> for a full explanation of the registration process and
+ * the naming convention to be used.)
+ *
+ * <h2>Table of Contents</h2>
+ * <ul>
+ * <li><a href="#pkgspec">1.0 Package Specification</a>
+ * <li><a href="#arch">2.0 Service Provider Architecture</a>
+ * <li><a href="#impl">3.0 Implementer's Guide</a>
+ * <li><a href="#resolving">4.0 Resolving Synchronization Conflicts</a>
+ * <li><a href="#relspec">5.0 Related Specifications</a>
+ * <li><a href="#reldocs">6.0 Related Documentation</a>
+ * </ul>
+ *
+ * <h3><a id="pkgspec">1.0 Package Specification</a></h3>
+ * <P>
+ * The following classes and interfaces make up the <code>javax.sql.rowset.spi</code>
+ * package:
+ * <UL>
+ *  <LI><code>SyncFactory</code>
+ *  <LI><code>SyncProvider</code>
+ *  <LI><code>SyncFactoryException</code>
+ *  <LI><code>SyncProviderException</code>
+ *  <LI><code>SyncResolver</code>
+ *  <LI><code>XmlReader</code>
+ *  <LI><code>XmlWriter</code>
+ *  <LI><code>TransactionalWriter</code>
+ * </UL>
+ * The following interfaces, in the <code>javax.sql</code> package, are also part of the SPI:
+ * <UL>
+ *  <LI><code>RowSetReader</code>
+ *  <LI><code>RowSetWriter</code>
+ * </UL>
+ * <P>
+ * A <code>SyncProvider</code> implementation provides a disconnected <code>RowSet</code>
+ * object with the mechanisms for reading data into it and for writing data that has been
+ * modified in it
+ * back to the underlying data source.  A <i>reader</i>, a <code>RowSetReader</code> or
+ * <code>XMLReader</code> object, reads data into a <code>RowSet</code> object when the
+ * <code>CachedRowSet</code> methods <code>execute</code> or <code>populate</code>
+ * are called.  A <i>writer</i>, a <code>RowSetWriter</code> or <code>XMLWriter</code>
+ * object, writes changes back to the underlying data source when the
+ * <code>CachedRowSet</code> method <code>acceptChanges</code> is called.
+ * <P>
+ * The process of writing changes in a <code>RowSet</code> object to its data source
+ * is known as <i>synchronization</i>.  The <code>SyncProvider</code> implementation that a
+ * <code>RowSet</code> object is using determines the level of synchronization that the
+ * <code>RowSet</code> object's writer uses. The various levels of synchronization are
+ * referred to as <i>grades</i>.
+ * <P>
+ * The lower grades of synchronization are
+ * known as <i>optimistic</i> concurrency levels because they optimistically
+ * assume that there will be no conflicts or very few conflicts.  A conflict exists when
+ * the same data modified in the <code>RowSet</code> object has also been modified
+ * in the data source. Using the optimistic concurrency model means that if there
+ * is a conflict, modifications to either the data source or the <code>RowSet</code>
+ * object will be lost.
+ * <P>
+ * Higher grades of synchronization are called <i>pessimistic</i> because they assume
+ * that others will be accessing the data source and making modifications.  These
+ * grades set varying levels of locks to increase the chances that no conflicts
+ * occur.
+ * <P>
+ * The lowest level of synchronization is simply writing any changes made to the
+ * <code>RowSet</code> object to its underlying data source.  The writer does
+ * nothing to check for conflicts.
+ * If there is a conflict and the data
+ * source values are overwritten, the changes other parties have made by to the data
+ * source are lost.
+ * <P>
+ * The <code>RIXMLProvider</code> implementation uses the lowest level
+ * of synchronization and just writes <code>RowSet</code> changes to the data source.
+ *
+ * <P>
+ * For the next level up, the
+ * writer checks to see if there are any conflicts, and if there are,
+ * it does not write anything to the data source.  The problem with this concurrency
+ * level is that if another party has modified the corresponding data in the data source
+ * since the <code>RowSet</code> object got its data,
+ * the changes made to the <code>RowSet</code> object are lost. The
+ * <code>RIOptimisticProvider</code> implementation uses this level of synchronization.
+ * <P>
+ * At higher levels of synchronization, referred to as pessimistic concurrency,
+ * the writer take steps to avoid conflicts by setting locks. Setting locks
+ * can vary from setting a lock on a single row to setting a lock on a table
+ * or the entire data source. The level of synchronization is therefore a tradeoff
+ * between the ability of users to access the data source concurrently and the  ability
+ * of the writer to keep the data in the <code>RowSet</code> object and its data source
+ * synchronized.
+ * <P>
+ * It is a requirement that all disconnected <code>RowSet</code> objects
+ * (<code>CachedRowSet</code>, <code>FilteredRowSet</code>, <code>JoinRowSet</code>,
+ * and <code>WebRowSet</code> objects) obtain their <code>SyncProvider</code> objects
+ * from the <code>SyncFactory</code> mechanism.
+ * <P>
+ * The reference implementation (RI) provides two synchronization providers.
+ *    <UL>
+ *       <LI><b><code>RIOptimisticProvider</code></b> <br>
+ *            The default provider that the <code>SyncFactory</code> instance will
+ *            supply to a disconnected <code>RowSet</code> object when no provider
+ *            implementation is specified.<BR>
+ *            This synchronization provider uses an optimistic concurrency model,
+ *            assuming that there will be few conflicts among users
+ *            who are accessing the same data in a database.  It avoids
+ *            using locks; rather, it checks to see if there is a conflict
+ *            before trying to synchronize the <code>RowSet</code> object and the
+ *            data source. If there is a conflict, it does nothing, meaning that
+ *            changes to the <code>RowSet</code> object are not persisted to the data
+ *            source.
+ *        <LI><B><code>RIXMLProvider</code></B> <BR>
+ *             A synchronization provider that can be used with a
+ *             <code>WebRowSet</code> object, which is a rowset that can be written
+ *             in XML format or read from XML format. The
+ *             <code>RIXMLProvider</code> implementation does no checking at all for
+ *             conflicts and simply writes any updated data in the
+ *             <code>WebRowSet</code> object to the underlying data source.
+ *             <code>WebRowSet</code> objects use this provider when they are
+ *             dealing with XML data.
+ *     </UL>
+ *
+ *  These <code>SyncProvider</code> implementations
+ *  are bundled with the reference implementation, which makes them always available to
+ *  <code>RowSet</code> implementations.
+ *  <code>SyncProvider</code> implementations make themselves available by being
+ *  registered with the <code>SyncFactory</code> singleton.  When a <code>RowSet</code>
+ *  object requests a provider, by specifying it in the constructor or as an argument to the
+ *  <code>CachedRowSet</code> method <code>setSyncProvider</code>,
+ *  the <code>SyncFactory</code> singleton
+ *  checks to see if the requested provider has been registered with it.
+ *  If it has, the <code>SyncFactory</code> creates an instance of it and passes it to the
+ *  requesting <code>RowSet</code> object.
+ *  If the <code>SyncProvider</code> implementation that is specified has not been registered,
+ *  the <code>SyncFactory</code> singleton causes a <code>SyncFactoryException</code> object
+ *  to be thrown.  If no provider is specified,
+ *  the <code>SyncFactory</code> singleton will create an instance of the default
+ *  provider implementation, <code>RIOptimisticProvider</code>,
+ *  and pass it to the requesting <code>RowSet</code> object.
+ *
+ * <P>
+ * If a <code>WebRowSet</code> object does not specify a provider in its constructor, the
+ * <code>SyncFactory</code> will give it an instance of <code>RIOptimisticProvider</code>.
+ * However, the constructor for <code>WebRowSet</code> is implemented to set the provider
+ * to the <code>RIXMLProvider</code>, which reads and writes a <code>RowSet</code> object
+ *  in XML format.
+ *  <P>
+ * See the <a href="SyncProvider.html">SyncProvider</a> class
+ *  specification for further details.
+ * <p>
+ * Vendors may develop a <code>SyncProvider</code> implementation with any one of the possible
+ * levels of synchronization, thus giving <code>RowSet</code> objects a choice of
+ * synchronization mechanisms.
+ *
+ * <h3><a id="arch">2.0 Service Provider Interface Architecture</a></h3>
+ * <b>2.1 Overview</b>
+ * <p>
+ * The Service Provider Interface provides a pluggable mechanism by which
+ * <code>SyncProvider</code> implementations can be registered and then generated when
+ * required. The lazy reference mechanism employed by the <code>SyncFactory</code> limits
+ * unnecessary resource consumption by not creating an instance until it is
+ * required by a disconnected
+ * <code>RowSet</code> object. The <code>SyncFactory</code> class also provides
+ * a standard API to configure logging options and streams that <b>may</b> be provided
+ * by a particular <code>SyncProvider</code> implementation.
+ * <p>
+ * <b>2.2 Registering with the <code>SyncFactory</code></b>
+ * <p>
+ * A third party <code>SyncProvider</code> implementation must be registered with the
+ * <code>SyncFactory</code> in order for a disconnected <code>RowSet</code> object
+ * to obtain it and thereby use its <code>javax.sql.RowSetReader</code> and
+ * <code>javax.sql.RowSetWriter</code>
+ * implementations. The following registration mechanisms are available to all
+ * <code>SyncProvider</code> implementations:
+ * <ul>
+ * <li><b>System properties</b> - Properties set at the command line. These
+ * properties are set at run time and apply system-wide per invocation of the Java
+ * application. See the section <a href="#reldocs">"Related Documentation"</a>
+ * further related information.
+ *
+ * <li><b>Property Files</b> - Properties specified in a standard property file.
+ * This can be specified using a System Property or by modifying a standard
+ * property file located in the platform run-time. The
+ * reference implementation of this technology includes a standard property
+ * file than can be edited to add additional <code>SyncProvider</code> objects.
+ *
+ * <li><b>JNDI Context</b> - Available providers can be registered on a JNDI
+ * context. The <code>SyncFactory</code> will attempt to load <code>SyncProvider</code>
+ * objects bound to the context and register them with the factory. This
+ * context must be supplied to the <code>SyncFactory</code> for the mechanism to
+ * function correctly.
+ * </ul>
+ * <p>
+ * Details on how to specify the system properties or properties in a property file
+ * and how to configure the JNDI Context are explained in detail in the
+ * <a href="SyncFactory.html"><code>SyncFactory</code></a> class description.
+ * <p>
+ * <b>2.3 SyncFactory Provider Instance Generation Policies</b>
+ * <p>
+ * The <code>SyncFactory</code> generates a requested <code>SyncProvider</code>
+ * object if the provider has been correctly registered.  The
+ * following policies are adhered to when either a disconnected <code>RowSet</code> object
+ * is instantiated with a specified <code>SyncProvider</code> implementation or is
+ * reconfigured at runtime with an alternative <code>SyncProvider</code> object.
+ * <ul>
+ * <li> If a <code>SyncProvider</code> object is specified and the <code>SyncFactory</code>
+ * contains <i>no</i> reference to the provider, a <code>SyncFactoryException</code> is
+ * thrown.
+ *
+ * <li> If a <code>SyncProvider</code> object is specified and the <code>SyncFactory</code>
+ * contains a reference to the provider, the requested provider is supplied.
+ *
+ * <li> If no <code>SyncProvider</code> object is specified, the reference
+ * implementation provider <code>RIOptimisticProvider</code> is supplied.
+ * </ul>
+ * <p>
+ * These policies are explored in more detail in the <a href="SyncFactory.html">
+ * <code>SyncFactory</code></a> class.
+ *
+ * <h3><a id="impl">3.0 SyncProvider Implementer's Guide</a></h3>
+ *
+ * <b>3.1 Requirements</b>
+ * <p>
+ * A compliant <code>SyncProvider</code> implementation that is fully pluggable
+ * into the <code>SyncFactory</code> <b>must</b> extend and implement all
+ * abstract methods in the <a href="SyncProvider.html"><code>SyncProvider</code></a>
+ * class. In addition, an implementation <b>must</b> determine the
+ * grade, locking and updatable view capabilities defined in the
+ * <code>SyncProvider</code> class definition. One or more of the
+ * <code>SyncProvider</code> description criteria <b>must</b> be supported. It
+ * is expected that vendor implementations will offer a range of grade, locking, and
+ * updatable view capabilities.
+ * <p>
+ * Furthermore, the <code>SyncProvider</code> naming convention <b>must</b> be followed as
+ * detailed in the <a href="SyncProvider.html"><code>SyncProvider</code></a> class
+ * description.
+ * <p>
+ * <b>3.2 Grades</b>
+ * <p>
+ * JSR 114 defines a set of grades to describe the quality of synchronization
+ * a <code>SyncProvider</code> object can offer a disconnected <code>RowSet</code>
+ * object. These grades are listed from the lowest quality of service to the highest.
+ * <ul>
+ * <li><b>GRADE_NONE</b> - No synchronization with the originating data source is
+ * provided. A <code>SyncProvider</code> implementation returning this grade will simply
+ * attempt to write any data that has changed in the <code>RowSet</code> object to the
+ *underlying data source, overwriting whatever is there. No attempt is made to compare
+ * original values with current values to see if there is a conflict. The
+ * <code>RIXMLProvider</code> is implemented with this grade.
+ *
+ * <li><b>GRADE_CHECK_MODIFIED_AT_COMMIT</b> - A low grade of optimistic synchronization.
+ * A <code>SyncProvider</code> implementation returning this grade
+ * will check for conflicts in rows that have changed between the last synchronization
+ * and the current synchronization under way. Any changes in the originating data source
+ * that have been modified will not be reflected in the disconnected <code>RowSet</code>
+ * object. If there are no conflicts, changes in the <code>RowSet</code> object will be
+ * written to the data source. If there are conflicts, no changes are written.
+ * The <code>RIOptimisticProvider</code> implementation uses this grade.
+ *
+ * <li><b>GRADE_CHECK_ALL_AT_COMMIT</b> - A high grade of optimistic synchronization.
+ * A <code>SyncProvider</code> implementation   returning this grade
+ * will check all rows, including rows that have not changed in the disconnected
+ * <code>RowSet</code> object. In this way, any changes to rows in the underlying
+ * data source will be reflected in the disconnected <code>RowSet</code> object
+ * when the synchronization finishes successfully.
+ *
+ * <li><b>GRADE_LOCK_WHEN_MODIFIED</b> - A pessimistic grade of synchronization.
+ * <code>SyncProvider</code> implementations returning this grade will lock
+ * the row in the originating  data source that corresponds to the row being changed
+ * in the <code>RowSet</code> object to reduce the possibility of other
+ * processes modifying the same data in the data source.
+ *
+ * <li><b>GRADE_LOCK_WHEN_LOADED</b> - A higher pessimistic synchronization grade.
+ * A <code>SyncProvider</code> implementation returning this grade will lock
+ * the entire view and/or  table affected by the original query used to
+ * populate a <code>RowSet</code> object.
+ * </ul>
+ * <p>
+ * <b>3.3 Locks</b>
+ * <p>
+ * JSR 114 defines a set of constants that specify whether any locks have been
+ * placed on a <code>RowSet</code> object's underlying data source and, if so,
+ * on which constructs the locks are placed.  These locks will remain on the data
+ * source while the <code>RowSet</code> object is disconnected from the data source.
+ * <P>
+ * These constants <b>should</b> be considered complementary to the
+ * grade constants. The default setting for the majority of grade settings requires
+ * that no data source locks remain when a <code>RowSet</code> object is disconnected
+ * from its data source.
+ * The grades <code>GRADE_LOCK_WHEN_MODIFIED</code> and
+ * <code>GRADE_LOCK_WHEN_LOADED</code> allow a disconnected <code>RowSet</code> object
+ * to have a fine-grained control over the degree of locking.
+ * <ul>
+ * <li><b>DATASOURCE_NO_LOCK</b> - No locks remain on the originating data source.
+ * This is the default lock setting for all <code>SyncProvider</code> implementations
+ * unless otherwise directed by a <code>RowSet</code> object.
+ *
+ * <li><b>DATASOURCE_ROW_LOCK</b> - A lock is placed on the rows that are touched by
+ * the original SQL query used to populate the <code>RowSet</code> object.
+ *
+ * <li><b>DATASOURCE_TABLE_LOCK</b> - A lock is placed on all tables that are touched
+ * by the query that was used to populate the <code>RowSet</code> object.
+ *
+ * <li><b>DATASOURCE_DB_LOCK</b>
+ * A lock is placed on the entire data source that is used by the <code>RowSet</code>
+ * object.
+ * </ul>
+ * <p>
+ * <b>3.4 Updatable Views</b>
+ * <p>
+ * A <code>RowSet</code> object may be populated with data from an SQL <code>VIEW</code>.
+ * The following constants indicate whether a <code>SyncProvider</code> object can
+ * update data in the table or tables from which the <code>VIEW</code> was derived.
+ * <ul>
+ * <li><b>UPDATABLE_VIEW_SYNC</b>
+ * Indicates that a <code>SyncProvider</code> implementation  supports synchronization
+ * to the table or tables from which the SQL <code>VIEW</code> used to populate
+ * a <code>RowSet</code> object is derived.
+ *
+ * <li><b>NONUPDATABLE_VIEW_SYNC</b>
+ * Indicates that a <code>SyncProvider</code> implementation  does <b>not</b> support
+ * synchronization to the table or tables from which the SQL <code>VIEW</code>
+ * used to populate  a <code>RowSet</code> object is derived.
+ * </ul>
+ * <p>
+ * <b>3.5 Usage of <code>SyncProvider</code> Grading and Locking</b>
+ * <p>
+ * In the example below, the reference <code>CachedRowSetImpl</code> implementation
+ * reconfigures its current <code>SyncProvider</code> object by calling the
+ * <code>setSyncProvider</code> method.<br>
+ *
+ * <PRE>
+ *   CachedRowSetImpl crs = new CachedRowSetImpl();
+ *   crs.setSyncProvider("com.foo.bar.HASyncProvider");
+ * </PRE>
+ *   An application can retrieve the <code>SyncProvider</code> object currently in use
+ * by a disconnected <code>RowSet</code> object. It can also retrieve the
+ * grade of synchronization with which the provider was implemented and the degree of
+ * locking currently in use.  In addition, an application has the flexibility to set
+ * the degree of locking to be used, which can increase the possibilities for successful
+ * synchronization.  These operation are shown in the following code fragment.
+ * <PRE>
+ *   SyncProvider sync = crs.getSyncProvider();
+ *
+ *   switch (sync.getProviderGrade()) {
+ *   case: SyncProvider.GRADE_CHECK_ALL_AT_COMMIT
+ *         //A high grade of optimistic synchronization
+ *    break;
+ *    case: SyncProvider.GRADE_CHECK_MODIFIED_AT_COMMIT
+ *         //A low grade of optimistic synchronization
+ *    break;
+ *    case: SyncProvider.GRADE_LOCK_WHEN_LOADED
+ *         // A pessimistic synchronization grade
+ *    break;
+ *    case: SyncProvider.GRADE_LOCK_WHEN_MODIFIED
+ *         // A pessimistic synchronization grade
+ *    break;
+ *    case: SyncProvider.GRADE_NONE
+ *      // No synchronization with the originating data source provided
+ *    break;
+ *    }
+ *
+ *    switch (sync.getDataSourcLock() {
+ *      case: SyncProvider.DATASOURCE_DB_LOCK
+ *       // A lock is placed on the entire datasource that is used by the
+ *       // <code>RowSet</code> object
+ *       break;
+ *
+ *      case: SyncProvider.DATASOURCE_NO_LOCK
+ *       // No locks remain on the  originating data source.
+ *      break;
+ *
+ *      case: SyncProvider.DATASOURCE_ROW_LOCK
+ *       // A lock is placed on the rows that are  touched by the original
+ *       // SQL statement used to populate
+ *       // the RowSet object that is using the SyncProvider
+ *       break;
+ *
+ *      case: DATASOURCE_TABLE_LOCK
+ *       // A lock is placed on  all tables that are touched by the original
+ *       // SQL statement used to populated
+ *       // the RowSet object that is using the SyncProvider
+ *      break;
+ *
+ * </PRE>
+ *    It is also possible using the static utility method in the
+ * <code>SyncFactory</code> class to determine the list of <code>SyncProvider</code>
+ * implementations currently registered with the <code>SyncFactory</code>.
+ *
+ * <pre>
+ *       Enumeration e = SyncFactory.getRegisteredProviders();
+ * </pre>
+ *
+ *
+ * <h3><a id="resolving">4.0 Resolving Synchronization Conflicts</a></h3>
+ *
+ * The interface <code>SyncResolver</code> provides a way for an application to
+ * decide manually what to do when a conflict occurs. When the <code>CachedRowSet</code>
+ * method <code>acceptChanges</code> finishes and has detected one or more conflicts,
+ * it throws a <code>SyncProviderException</code> object.  An application can
+ * catch the exception and
+ * have it retrieve a <code>SyncResolver</code> object by calling the method
+ * <code>SyncProviderException.getSyncResolver()</code>.
+ * <P>
+ * A <code>SyncResolver</code> object, which is a special kind of
+ * <code>CachedRowSet</code> object or
+ * a <code>JdbcRowSet</code> object that has implemented the <code>SyncResolver</code>
+ * interface,  examines the conflicts row by row. It is a duplicate of the
+ * <code>RowSet</code> object being synchronized except that it contains only the data
+ * from the data source this is causing a conflict. All of the other column values are
+ * set to <code>null</code>. To navigate from one conflict value to another, a
+ * <code>SyncResolver</code> object provides the methods <code>nextConflict</code> and
+ * <code>previousConflict</code>.
+ * <P>
+ * The <code>SyncResolver</code> interface also
+ * provides methods for doing the following:
+ * <UL>
+ *  <LI>finding out whether the conflict involved an update, a delete, or an insert
+ *  <LI>getting the value in the data source that caused the conflict
+ *  <LI>setting the value that should be in the data source if it needs to be changed
+ *      or setting the value that should be in the <code>RowSet</code> object if it needs
+ *      to be changed
+ * </UL>
+ * <P>
+ * When the <code>CachedRowSet</code> method <code>acceptChanges</code> is called, it
+ * delegates to the <code>RowSet</code> object's  <code>SyncProvider</code> object.
+ * How the writer provided by that <code>SyncProvider</code> object is implemented
+ * determines what level (grade) of checking for conflicts will be done.  After all
+ * checking for conflicts is completed and one or more conflicts has been found, the method
+ * <code>acceptChanges</code> throws a <code>SyncProviderException</code> object. The
+ * application can catch the exception and use it to obtain a <code>SyncResolver</code> object.
+ * <P>
+ * The application can then use <code>SyncResolver</code> methods to get information
+ * about each conflict and decide what to do.  If the application logic or the user
+ * decides that a value in the <code>RowSet</code> object should be the one to
+ * persist, the application or user can overwrite the data source value with it.
+ * <P>
+ * The comment for the <code>SyncResolver</code> interface has more detail.
+ *
+ * <h3><a id="relspec">5.0 Related Specifications</a></h3>
+ * <ul>
+ * <li><a href="http://docs.oracle.com/javase/jndi/tutorial/index.html">JNDI</a>
+ * <li><a href="{@docRoot}/java.logging/java/util/logging/package-summary.html">Java Logging
+ * APIs</a>
+ * </ul>
+ * <h3><a id="reldocs">6.0 Related Documentation</a></h3>
+ * <ul>
+ * <li><a href="http://docs.oracle.com/javase/tutorial/jdbc/">DataSource for JDBC
+ * Connections</a>
+ * </ul>
+ */
+package javax.sql.rowset.spi;
--- a/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package.html	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,493 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
-
-  <meta http-equiv="Content-Type"
- content="text/html; charset=iso-8859-1">
-
-  <meta name="GENERATOR"
- content="Mozilla/4.79 [en] (Windows NT 5.0; U) [Netscape]">
-<!--
-Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-  <title>javax.sql.rowset.spi</title>
-
-</head>
-  <body>
-
-The standard classes and interfaces that a third party vendor has to
-use in its implementation of a synchronization provider. These classes and
-interfaces are referred to as the Service Provider Interface (SPI).  To make it possible
-for a <code>RowSet</code> object to use an implementation, the vendor must register
-it with the <code>SyncFactory</code> singleton. (See the class comment for
-<code>SyncProvider</code> for a full explanation of the registration process and
-the naming convention to be used.)
-
-<h2>Table of Contents</h2>
-<ul>
-<li><a href="#pkgspec">1.0 Package Specification</a>
-<li><a href="#arch">2.0 Service Provider Architecture</a>
-<li><a href="#impl">3.0 Implementer's Guide</a>
-<li><a href="#resolving">4.0 Resolving Synchronization Conflicts</a>
-<li><a href="#relspec">5.0 Related Specifications</a>
-<li><a href="#reldocs">6.0 Related Documentation</a>
-</ul>
-
-<h3><a id="pkgspec">1.0 Package Specification</a></h3>
-<P>
-The following classes and interfaces make up the <code>javax.sql.rowset.spi</code>
-package:
-<UL>
-  <LI><code>SyncFactory</code>
-  <LI><code>SyncProvider</code>
-  <LI><code>SyncFactoryException</code>
-  <LI><code>SyncProviderException</code>
-  <LI><code>SyncResolver</code>
-  <LI><code>XmlReader</code>
-  <LI><code>XmlWriter</code>
-  <LI><code>TransactionalWriter</code>
-</UL>
-The following interfaces, in the <code>javax.sql</code> package, are also part of the SPI:
-<UL>
-  <LI><code>RowSetReader</code>
-  <LI><code>RowSetWriter</code>
-</UL>
-<P>
-A <code>SyncProvider</code> implementation provides a disconnected <code>RowSet</code>
-object with the mechanisms for reading data into it and for writing data that has been
-modified in it
-back to the underlying data source.  A <i>reader</i>, a <code>RowSetReader</code> or
-<code>XMLReader</code> object, reads data into a <code>RowSet</code> object when the
-<code>CachedRowSet</code> methods <code>execute</code> or <code>populate</code>
-are called.  A <i>writer</i>, a <code>RowSetWriter</code> or <code>XMLWriter</code>
-object, writes changes back to the underlying data source when the
-<code>CachedRowSet</code> method <code>acceptChanges</code> is called.
-<P>
-The process of writing changes in a <code>RowSet</code> object to its data source
-is known as <i>synchronization</i>.  The <code>SyncProvider</code> implementation that a
-<code>RowSet</code> object is using determines the level of synchronization that the
-<code>RowSet</code> object's writer uses. The various levels of synchronization are
-referred to as <i>grades</i>.
-<P>
-The lower grades of synchronization are
-known as <i>optimistic</i> concurrency levels because they optimistically
-assume that there will be no conflicts or very few conflicts.  A conflict exists when
-the same data modified in the <code>RowSet</code> object has also been modified
-in the data source. Using the optimistic concurrency model means that if there
-is a conflict, modifications to either the data source or the <code>RowSet</code>
-object will be lost.
-<P>
-Higher grades of synchronization are called <i>pessimistic</i> because they assume
-that others will be accessing the data source and making modifications.  These
-grades set varying levels of locks to increase the chances that no conflicts
-occur.
-<P>
-The lowest level of synchronization is simply writing any changes made to the
-<code>RowSet</code> object to its underlying data source.  The writer does
-nothing to check for conflicts.
-If there is a conflict and the data
-source values are overwritten, the changes other parties have made by to the data
-source are lost.
-<P>
-The <code>RIXMLProvider</code> implementation uses the lowest level
-of synchronization and just writes <code>RowSet</code> changes to the data source.
-
-<P>
-For the next level up, the
-writer checks to see if there are any conflicts, and if there are,
-it does not write anything to the data source.  The problem with this concurrency
-level is that if another party has modified the corresponding data in the data source
-since the <code>RowSet</code> object got its data,
-the changes made to the <code>RowSet</code> object are lost. The
-<code>RIOptimisticProvider</code> implementation uses this level of synchronization.
-<P>
-At higher levels of synchronization, referred to as pessimistic concurrency,
-the writer take steps to avoid conflicts by setting locks. Setting locks
-can vary from setting a lock on a single row to setting a lock on a table
-or the entire data source. The level of synchronization is therefore a tradeoff
-between the ability of users to access the data source concurrently and the  ability
-of the writer to keep the data in the <code>RowSet</code> object and its data source
-synchronized.
-<P>
-It is a requirement that all disconnected <code>RowSet</code> objects
-(<code>CachedRowSet</code>, <code>FilteredRowSet</code>, <code>JoinRowSet</code>,
-and <code>WebRowSet</code> objects) obtain their <code>SyncProvider</code> objects
-from the <code>SyncFactory</code> mechanism.
-<P>
-The reference implementation (RI) provides two synchronization providers.
-    <UL>
-       <LI><b><code>RIOptimisticProvider</code></b> <br>
-           The default provider that the <code>SyncFactory</code> instance will
-           supply to a disconnected <code>RowSet</code> object when no provider
-           implementation is specified.<BR>
-           This synchronization provider uses an optimistic concurrency model,
-           assuming that there will be few conflicts among users
-           who are accessing the same data in a database.  It avoids
-           using locks; rather, it checks to see if there is a conflict
-           before trying to synchronize the <code>RowSet</code> object and the
-           data source. If there is a conflict, it does nothing, meaning that
-           changes to the <code>RowSet</code> object are not persisted to the data
-           source.
-       <LI><B><code>RIXMLProvider</code></B> <BR>
-            A synchronization provider that can be used with a
-            <code>WebRowSet</code> object, which is a rowset that can be written
-            in XML format or read from XML format. The
-            <code>RIXMLProvider</code> implementation does no checking at all for
-            conflicts and simply writes any updated data in the
-            <code>WebRowSet</code> object to the underlying data source.
-            <code>WebRowSet</code> objects use this provider when they are
-            dealing with XML data.
-    </UL>
-
-These <code>SyncProvider</code> implementations
-are bundled with the reference implementation, which makes them always available to
-<code>RowSet</code> implementations.
-<code>SyncProvider</code> implementations make themselves available by being
-registered with the <code>SyncFactory</code> singleton.  When a <code>RowSet</code>
-object requests a provider, by specifying it in the constructor or as an argument to the
-<code>CachedRowSet</code> method <code>setSyncProvider</code>,
-the <code>SyncFactory</code> singleton
-checks to see if the requested provider has been registered with it.
-If it has, the <code>SyncFactory</code> creates an instance of it and passes it to the
-requesting <code>RowSet</code> object.
-If the <code>SyncProvider</code> implementation that is specified has not been registered,
-the <code>SyncFactory</code> singleton causes a <code>SyncFactoryException</code> object
-to be thrown.  If no provider is specified,
-the <code>SyncFactory</code> singleton will create an instance of the default
-provider implementation, <code>RIOptimisticProvider</code>,
-and pass it to the requesting <code>RowSet</code> object.
-
-<P>
-If a <code>WebRowSet</code> object does not specify a provider in its constructor, the
-<code>SyncFactory</code> will give it an instance of <code>RIOptimisticProvider</code>.
-However, the constructor for <code>WebRowSet</code> is implemented to set the provider
-to the <code>RIXMLProvider</code>, which reads and writes a <code>RowSet</code> object
-in XML format.
-<P>
-See the <a href="SyncProvider.html">SyncProvider</a> class
-specification for further details.
-<p>
-Vendors may develop a <code>SyncProvider</code> implementation with any one of the possible
-levels of synchronization, thus giving <code>RowSet</code> objects a choice of
-synchronization mechanisms.
-
-<h3><a id="arch">2.0 Service Provider Interface Architecture</a></h3>
-<b>2.1 Overview</b>
-<p>
-The Service Provider Interface provides a pluggable mechanism by which
-<code>SyncProvider</code> implementations can be registered and then generated when
-required. The lazy reference mechanism employed by the <code>SyncFactory</code> limits
-unnecessary resource consumption by not creating an instance until it is
-required by a disconnected
-<code>RowSet</code> object. The <code>SyncFactory</code> class also provides
-a standard API to configure logging options and streams that <b>may</b> be provided
-by a particular <code>SyncProvider</code> implementation.
-<p>
-<b>2.2 Registering with the <code>SyncFactory</code></b>
-<p>
-A third party <code>SyncProvider</code> implementation must be registered with the
-<code>SyncFactory</code> in order for a disconnected <code>RowSet</code> object
-to obtain it and thereby use its <code>javax.sql.RowSetReader</code> and
-<code>javax.sql.RowSetWriter</code>
-implementations. The following registration mechanisms are available to all
-<code>SyncProvider</code> implementations:
-<ul>
-<li><b>System properties</b> - Properties set at the command line. These
-properties are set at run time and apply system-wide per invocation of the Java
-application. See the section <a href="#reldocs">"Related Documentation"</a>
-further related information.
-
-<li><b>Property Files</b> - Properties specified in a standard property file.
-This can be specified using a System Property or by modifying a standard
-property file located in the platform run-time. The
-reference implementation of this technology includes a standard property
-file than can be edited to add additional <code>SyncProvider</code> objects.
-
-<li><b>JNDI Context</b> - Available providers can be registered on a JNDI
-context. The <code>SyncFactory</code> will attempt to load <code>SyncProvider</code>
-objects bound to the context and register them with the factory. This
-context must be supplied to the <code>SyncFactory</code> for the mechanism to
-function correctly.
-</ul>
-<p>
-Details on how to specify the system properties or properties in a property file
-and how to configure the JNDI Context are explained in detail in the
-<a href="SyncFactory.html"><code>SyncFactory</code></a> class description.
-<p>
-<b>2.3 SyncFactory Provider Instance Generation Policies</b>
-<p>
-The <code>SyncFactory</code> generates a requested <code>SyncProvider</code>
-object if the provider has been correctly registered.  The
-following policies are adhered to when either a disconnected <code>RowSet</code> object
-is instantiated with a specified <code>SyncProvider</code> implementation or is
-reconfigured at runtime with an alternative <code>SyncProvider</code> object.
-<ul>
-<li> If a <code>SyncProvider</code> object is specified and the <code>SyncFactory</code>
-contains <i>no</i> reference to the provider, a <code>SyncFactoryException</code> is
-thrown.
-
-<li> If a <code>SyncProvider</code> object is specified and the <code>SyncFactory</code>
-contains a reference to the provider, the requested provider is supplied.
-
-<li> If no <code>SyncProvider</code> object is specified, the reference
-implementation provider <code>RIOptimisticProvider</code> is supplied.
-</ul>
-<p>
-These policies are explored in more detail in the <a href="SyncFactory.html">
-<code>SyncFactory</code></a> class.
-
-<h3><a id="impl">3.0 SyncProvider Implementer's Guide</a></h3>
-
-<b>3.1 Requirements</b>
-<p>
-A compliant <code>SyncProvider</code> implementation that is fully pluggable
-into the <code>SyncFactory</code> <b>must</b> extend and implement all
-abstract methods in the <a href="SyncProvider.html"><code>SyncProvider</code></a>
-class. In addition, an implementation <b>must</b> determine the
-grade, locking and updatable view capabilities defined in the
-<code>SyncProvider</code> class definition. One or more of the
-<code>SyncProvider</code> description criteria <b>must</b> be supported. It
-is expected that vendor implementations will offer a range of grade, locking, and
-updatable view capabilities.
-<p>
-Furthermore, the <code>SyncProvider</code> naming convention <b>must</b> be followed as
-detailed in the <a href="SyncProvider.html"><code>SyncProvider</code></a> class
-description.
-<p>
-<b>3.2 Grades</b>
-<p>
-JSR 114 defines a set of grades to describe the quality of synchronization
-a <code>SyncProvider</code> object can offer a disconnected <code>RowSet</code>
-object. These grades are listed from the lowest quality of service to the highest.
-<ul>
-<li><b>GRADE_NONE</b> - No synchronization with the originating data source is
-provided. A <code>SyncProvider</code> implementation returning this grade will simply
-attempt to write any data that has changed in the <code>RowSet</code> object to the
-underlying data source, overwriting whatever is there. No attempt is made to compare
-original values with current values to see if there is a conflict. The
-<code>RIXMLProvider</code> is implemented with this grade.
-
-<li><b>GRADE_CHECK_MODIFIED_AT_COMMIT</b> - A low grade of optimistic synchronization.
-A <code>SyncProvider</code> implementation returning this grade
-will check for conflicts in rows that have changed between the last synchronization
-and the current synchronization under way. Any changes in the originating data source
-that have been modified will not be reflected in the disconnected <code>RowSet</code>
-object. If there are no conflicts, changes in the <code>RowSet</code> object will be
-written to the data source. If there are conflicts, no changes are written.
-The <code>RIOptimisticProvider</code> implementation uses this grade.
-
-<li><b>GRADE_CHECK_ALL_AT_COMMIT</b> - A high grade of optimistic synchronization.
-A <code>SyncProvider</code> implementation   returning this grade
-will check all rows, including rows that have not changed in the disconnected
-<code>RowSet</code> object. In this way, any changes to rows in the underlying
-data source will be reflected in the disconnected <code>RowSet</code> object
-when the synchronization finishes successfully.
-
-<li><b>GRADE_LOCK_WHEN_MODIFIED</b> - A pessimistic grade of synchronization.
-<code>SyncProvider</code> implementations returning this grade will lock
-the row in the originating  data source that corresponds to the row being changed
-in the <code>RowSet</code> object to reduce the possibility of other
-processes modifying the same data in the data source.
-
-<li><b>GRADE_LOCK_WHEN_LOADED</b> - A higher pessimistic synchronization grade.
-A <code>SyncProvider</code> implementation returning this grade will lock
-the entire view and/or  table affected by the original query used to
-populate a <code>RowSet</code> object.
-</ul>
-<p>
-<b>3.3 Locks</b>
-<p>
-JSR 114 defines a set of constants that specify whether any locks have been
-placed on a <code>RowSet</code> object's underlying data source and, if so,
-on which constructs the locks are placed.  These locks will remain on the data
-source while the <code>RowSet</code> object is disconnected from the data source.
-<P>
-These constants <b>should</b> be considered complementary to the
-grade constants. The default setting for the majority of grade settings requires
-that no data source locks remain when a <code>RowSet</code> object is disconnected
-from its data source.
-The grades <code>GRADE_LOCK_WHEN_MODIFIED</code> and
-<code>GRADE_LOCK_WHEN_LOADED</code> allow a disconnected <code>RowSet</code> object
-to have a fine-grained control over the degree of locking.
-<ul>
-<li><b>DATASOURCE_NO_LOCK</b> - No locks remain on the originating data source.
-This is the default lock setting for all <code>SyncProvider</code> implementations
-unless otherwise directed by a <code>RowSet</code> object.
-
-<li><b>DATASOURCE_ROW_LOCK</b> - A lock is placed on the rows that are touched by
-the original SQL query used to populate the <code>RowSet</code> object.
-
-<li><b>DATASOURCE_TABLE_LOCK</b> - A lock is placed on all tables that are touched
-by the query that was used to populate the <code>RowSet</code> object.
-
-<li><b>DATASOURCE_DB_LOCK</b>
-A lock is placed on the entire data source that is used by the <code>RowSet</code>
-object.
-</ul>
-<p>
-<b>3.4 Updatable Views</b>
-<p>
-A <code>RowSet</code> object may be populated with data from an SQL <code>VIEW</code>.
-The following constants indicate whether a <code>SyncProvider</code> object can
-update data in the table or tables from which the <code>VIEW</code> was derived.
-<ul>
-<li><b>UPDATABLE_VIEW_SYNC</b>
-Indicates that a <code>SyncProvider</code> implementation  supports synchronization
-to the table or tables from which the SQL <code>VIEW</code> used to populate
-a <code>RowSet</code> object is derived.
-
-<li><b>NONUPDATABLE_VIEW_SYNC</b>
-Indicates that a <code>SyncProvider</code> implementation  does <b>not</b> support
-synchronization to the table or tables from which the SQL <code>VIEW</code>
-used to populate  a <code>RowSet</code> object is derived.
-</ul>
-<p>
-<b>3.5 Usage of <code>SyncProvider</code> Grading and Locking</b>
-<p>
-In the example below, the reference <code>CachedRowSetImpl</code> implementation
-reconfigures its current <code>SyncProvider</code> object by calling the
-<code>setSyncProvider</code> method.<br>
-
-<PRE>
-    CachedRowSetImpl crs = new CachedRowSetImpl();
-    crs.setSyncProvider("com.foo.bar.HASyncProvider");
-</PRE>
-    An application can retrieve the <code>SyncProvider</code> object currently in use
-by a disconnected <code>RowSet</code> object. It can also retrieve the
-grade of synchronization with which the provider was implemented and the degree of
-locking currently in use.  In addition, an application has the flexibility to set
-the degree of locking to be used, which can increase the possibilities for successful
-synchronization.  These operation are shown in the following code fragment.
-<PRE>
-    SyncProvider sync = crs.getSyncProvider();
-
-    switch (sync.getProviderGrade()) {
-    case: SyncProvider.GRADE_CHECK_ALL_AT_COMMIT
-         //A high grade of optimistic synchronization
-    break;
-    case: SyncProvider.GRADE_CHECK_MODIFIED_AT_COMMIT
-         //A low grade of optimistic synchronization
-    break;
-    case: SyncProvider.GRADE_LOCK_WHEN_LOADED
-         // A pessimistic synchronization grade
-    break;
-    case: SyncProvider.GRADE_LOCK_WHEN_MODIFIED
-         // A pessimistic synchronization grade
-    break;
-    case: SyncProvider.GRADE_NONE
-      // No synchronization with the originating data source provided
-    break;
-    }
-
-    switch (sync.getDataSourcLock() {
-      case: SyncProvider.DATASOURCE_DB_LOCK
-       // A lock is placed on the entire datasource that is used by the
-       // <code>RowSet</code> object
-       break;
-
-      case: SyncProvider.DATASOURCE_NO_LOCK
-       // No locks remain on the  originating data source.
-      break;
-
-      case: SyncProvider.DATASOURCE_ROW_LOCK
-       // A lock is placed on the rows that are  touched by the original
-       // SQL statement used to populate
-       // the RowSet object that is using the SyncProvider
-       break;
-
-      case: DATASOURCE_TABLE_LOCK
-       // A lock is placed on  all tables that are touched by the original
-       // SQL statement used to populated
-       // the RowSet object that is using the SyncProvider
-       break;
-
-</PRE>
-    It is also possible using the static utility method in the
-<code>SyncFactory</code> class to determine the list of <code>SyncProvider</code>
-implementations currently registered with the <code>SyncFactory</code>.
-
-<pre>
-       Enumeration e = SyncFactory.getRegisteredProviders();
-</pre>
-
-
-<h3><a id="resolving">4.0 Resolving Synchronization Conflicts</a></h3>
-
-The interface <code>SyncResolver</code> provides a way for an application to
-decide manually what to do when a conflict occurs. When the <code>CachedRowSet</code>
-method <code>acceptChanges</code> finishes and has detected one or more conflicts,
-it throws a <code>SyncProviderException</code> object.  An application can
-catch the exception and
-have it retrieve a <code>SyncResolver</code> object by calling the method
-<code>SyncProviderException.getSyncResolver()</code>.
-<P>
-A <code>SyncResolver</code> object, which is a special kind of
-<code>CachedRowSet</code> object or
-a <code>JdbcRowSet</code> object that has implemented the <code>SyncResolver</code>
-interface,  examines the conflicts row by row. It is a duplicate of the
-<code>RowSet</code> object being synchronized except that it contains only the data
-from the data source this is causing a conflict. All of the other column values are
-set to <code>null</code>. To navigate from one conflict value to another, a
-<code>SyncResolver</code> object provides the methods <code>nextConflict</code> and
-<code>previousConflict</code>.
-<P>
-The <code>SyncResolver</code> interface also
-provides methods for doing the following:
-<UL>
- <LI>finding out whether the conflict involved an update, a delete, or an insert
- <LI>getting the value in the data source that caused the conflict
- <LI>setting the value that should be in the data source if it needs to be changed
-     or setting the value that should be in the <code>RowSet</code> object if it needs
-     to be changed
-</UL>
-<P>
-When the <code>CachedRowSet</code> method <code>acceptChanges</code> is called, it
-delegates to the <code>RowSet</code> object's  <code>SyncProvider</code> object.
-How the writer provided by that <code>SyncProvider</code> object is implemented
-determines what level (grade) of checking for conflicts will be done.  After all
-checking for conflicts is completed and one or more conflicts has been found, the method
-<code>acceptChanges</code> throws a <code>SyncProviderException</code> object. The
-application can catch the exception and use it to obtain a <code>SyncResolver</code> object.
-<P>
-The application can then use <code>SyncResolver</code> methods to get information
-about each conflict and decide what to do.  If the application logic or the user
-decides that a value in the <code>RowSet</code> object should be the one to
-persist, the application or user can overwrite the data source value with it.
-<P>
-The comment for the <code>SyncResolver</code> interface has more detail.
-
-<h3><a id="relspec">5.0 Related Specifications</a></h3>
-<ul>
-<li><a href="http://docs.oracle.com/javase/jndi/tutorial/index.html">JNDI</a>
-<li><a href="{@docRoot}/java/util/logging/package-summary.html">Java Logging
-APIs</a>
-</ul>
-<h3><a id="reldocs">6.0 Related Documentation</a></h3>
-<ul>
-<li><a href="http://docs.oracle.com/javase/tutorial/jdbc/">DataSource for JDBC
-Connections</a>
-</ul>
-
-</body>
-</html>
--- a/src/jdk.accessibility/windows/native/libwindowsaccessbridge/WinAccessBridge.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.accessibility/windows/native/libwindowsaccessbridge/WinAccessBridge.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -452,7 +452,7 @@
  */
 BOOL
 WinAccessBridge::receiveAQueuedPackage() {
-    AccessBridgeQueueElement *element;
+    AccessBridgeQueueElement *element = NULL;
 
     PrintDebugString("in WinAccessBridge::receiveAQueuedPackage()");
 
@@ -464,15 +464,6 @@
 
         QueueReturns result = messageQueue->remove(&element);
 
-        PrintDebugString("   'element->buffer' contains:");
-        DEBUG_CODE(PackageType *type = (PackageType *) element->buffer);
-        DEBUG_CODE(FocusGainedPackageTag *pkg = (FocusGainedPackageTag *) (((char *) element->buffer) + sizeof(PackageType)));
-        DEBUG_CODE(PrintDebugString("     PackageType = %X", *type));
-#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
-        DEBUG_CODE(PrintDebugString("     EventPackage: vmID = %X, event = %p, source = %p", pkg->vmID, pkg->Event, pkg->AccessibleContextSource));
-#else // JOBJECT64 is jlong (64 bit)
-        DEBUG_CODE(PrintDebugString("     EventPackage: vmID = %X, event = %016I64X, source = %016I64X", pkg->vmID, pkg->Event, pkg->AccessibleContextSource));
-#endif
         switch (result) {
 
         case cQueueBroken:
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Mon Jun 11 09:29:44 2018 +0200
@@ -291,7 +291,7 @@
             ((v.flags() & HASINIT) != 0
              ||
              !((base == null ||
-               (base.hasTag(IDENT) && TreeInfo.name(base) == names._this)) &&
+               TreeInfo.isThisQualifier(base)) &&
                isAssignableAsBlankFinal(v, env)))) {
             if (v.isResourceVariable()) { //TWR resource
                 log.error(pos, Errors.TryResourceMayNotBeAssigned(v));
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java	Mon Jun 11 09:29:44 2018 +0200
@@ -2391,31 +2391,18 @@
         }
 
         public void visitAssign(JCAssign tree) {
-            JCTree lhs = TreeInfo.skipParens(tree.lhs);
-            if (!isIdentOrThisDotIdent(lhs))
-                scanExpr(lhs);
+            if (!TreeInfo.isIdentOrThisDotIdent(tree.lhs))
+                scanExpr(tree.lhs);
             scanExpr(tree.rhs);
-            letInit(lhs);
-        }
-        private boolean isIdentOrThisDotIdent(JCTree lhs) {
-            if (lhs.hasTag(IDENT))
-                return true;
-            if (!lhs.hasTag(SELECT))
-                return false;
-
-            JCFieldAccess fa = (JCFieldAccess)lhs;
-            return fa.selected.hasTag(IDENT) &&
-                   ((JCIdent)fa.selected).name == names._this;
+            letInit(tree.lhs);
         }
 
         // check fields accessed through this.<field> are definitely
         // assigned before reading their value
         public void visitSelect(JCFieldAccess tree) {
             super.visitSelect(tree);
-            JCTree sel = TreeInfo.skipParens(tree.selected);
             if (enforceThisDotInit &&
-                    sel.hasTag(IDENT) &&
-                    ((JCIdent)sel).name == names._this &&
+                    TreeInfo.isThisQualifier(tree.selected) &&
                     tree.sym.kind == VAR) {
                 checkInit(tree.pos(), (VarSymbol)tree.sym);
             }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/StringConcat.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/StringConcat.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -261,18 +261,20 @@
         public Item makeConcat(JCTree.JCAssignOp tree) {
             List<JCTree> args = collectAll(tree.lhs, tree.rhs);
             Item l = gen.genExpr(tree.lhs, tree.lhs.type);
-            emit(args, tree.type, tree.pos());
+            l.duplicate();
+            l.load();
+            emit(tree.pos(), args, false, tree.type);
             return l;
         }
 
         @Override
         public Item makeConcat(JCTree.JCBinary tree) {
             List<JCTree> args = collectAll(tree.lhs, tree.rhs);
-            emit(args, tree.type, tree.pos());
+            emit(tree.pos(), args, true, tree.type);
             return gen.getItems().makeStackItem(syms.stringType);
         }
 
-        protected abstract void emit(List<JCTree> args, Type type, JCDiagnostic.DiagnosticPosition pos);
+        protected abstract void emit(JCDiagnostic.DiagnosticPosition pos, List<JCTree> args, boolean generateFirstArg, Type type);
 
         /** Peel the argument list into smaller chunks. */
         protected List<List<JCTree>> split(List<JCTree> args) {
@@ -318,9 +320,10 @@
         }
 
         /** Emit the indy concat for all these arguments, possibly peeling along the way */
-        protected void emit(List<JCTree> args, Type type, JCDiagnostic.DiagnosticPosition pos) {
+        protected void emit(JCDiagnostic.DiagnosticPosition pos, List<JCTree> args, boolean generateFirstArg, Type type) {
             List<List<JCTree>> split = split(args);
 
+            boolean first = true;
             for (List<JCTree> t : split) {
                 Assert.check(!t.isEmpty(), "Arguments list is empty");
 
@@ -333,9 +336,11 @@
                     } else {
                         dynamicArgs.add(sharpestAccessible(arg.type));
                     }
-                    gen.genExpr(arg, arg.type).load();
+                    if (!first || generateFirstArg) {
+                        gen.genExpr(arg, arg.type).load();
+                    }
+                    first = false;
                 }
-
                 doCall(type, pos, dynamicArgs.toList());
             }
 
@@ -402,9 +407,10 @@
         }
 
         @Override
-        protected void emit(List<JCTree> args, Type type, JCDiagnostic.DiagnosticPosition pos) {
+        protected void emit(JCDiagnostic.DiagnosticPosition pos, List<JCTree> args, boolean generateFirstArg, Type type) {
             List<List<JCTree>> split = split(args);
 
+            boolean first = true;
             for (List<JCTree> t : split) {
                 Assert.check(!t.isEmpty(), "Arguments list is empty");
 
@@ -433,7 +439,10 @@
                         // Ordinary arguments come through the dynamic arguments.
                         recipe.append(TAG_ARG);
                         dynamicArgs.add(sharpestAccessible(arg.type));
-                        gen.genExpr(arg, arg.type).load();
+                        if (!first || generateFirstArg) {
+                            gen.genExpr(arg, arg.type).load();
+                        }
+                        first = false;
                     }
                 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/Main.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,550 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.javac.launcher;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.net.URI;
+import java.nio.charset.Charset;
+import java.nio.file.Files;
+import java.nio.file.InvalidPathException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import javax.lang.model.SourceVersion;
+import javax.lang.model.element.NestingKind;
+import javax.lang.model.element.TypeElement;
+import javax.tools.FileObject;
+import javax.tools.ForwardingJavaFileManager;
+import javax.tools.JavaFileManager;
+import javax.tools.JavaFileManager.Location;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
+
+import com.sun.source.util.JavacTask;
+import com.sun.source.util.TaskEvent;
+import com.sun.source.util.TaskListener;
+import com.sun.tools.javac.api.JavacTool;
+import com.sun.tools.javac.code.Source;
+import com.sun.tools.javac.resources.LauncherProperties.Errors;
+import com.sun.tools.javac.util.JCDiagnostic.Error;
+
+import jdk.internal.misc.VM;
+
+import static javax.tools.JavaFileObject.Kind.SOURCE;
+
+/**
+ * Compiles a source file, and executes the main method it contains.
+ *
+ * <p><b>This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own
+ * risk.  This code and its internal interfaces are subject to change
+ * or deletion without notice.</b></p>
+ */
+public class Main {
+    /**
+     * An exception used to report errors.
+     */
+    public class Fault extends Exception {
+        private static final long serialVersionUID = 1L;
+        Fault(Error error) {
+            super(Main.this.getMessage(error));
+        }
+    }
+
+    /**
+     * Compiles a source file, and executes the main method it contains.
+     *
+     * <p>This is normally invoked from the Java launcher, either when
+     * the {@code --source} option is used, or when the first argument
+     * that is not part of a runtime option ends in {@code .java}.
+     *
+     * <p>The first entry in the {@code args} array is the source file
+     * to be compiled and run; all subsequent entries are passed as
+     * arguments to the main method of the first class found in the file.
+     *
+     * <p>If any problem occurs before executing the main class, it will
+     * be reported to the standard error stream, and the the JVM will be
+     * terminated by calling {@code System.exit} with a non-zero return code.
+     *
+     * @param args the arguments
+     * @throws Throwable if the main method throws an exception
+     */
+    public static void main(String... args) throws Throwable {
+        try {
+            new Main(System.err).run(VM.getRuntimeArguments(), args);
+        } catch (Fault f) {
+            System.err.println(f.getMessage());
+            System.exit(1);
+        } catch (InvocationTargetException e) {
+            // leave VM to handle the stacktrace, in the standard manner
+            throw e.getTargetException();
+        }
+    }
+
+    /** Stream for reporting errors, such as compilation errors. */
+    private PrintWriter out;
+
+    /**
+     * Creates an instance of this class, providing a stream to which to report
+     * any errors.
+     *
+     * @param out the stream
+     */
+    public Main(PrintStream out) {
+        this(new PrintWriter(new OutputStreamWriter(out), true));
+    }
+
+    /**
+     * Creates an instance of this class, providing a stream to which to report
+     * any errors.
+     *
+     * @param out the stream
+     */
+    public Main(PrintWriter out) {
+        this.out = out;
+    }
+
+    /**
+     * Compiles a source file, and executes the main method it contains.
+     *
+     * <p>The first entry in the {@code args} array is the source file
+     * to be compiled and run; all subsequent entries are passed as
+     * arguments to the main method of the first class found in the file.
+     *
+     * <p>Options for {@code javac} are obtained by filtering the runtime arguments.
+     *
+     * <p>If the main method throws an exception, it will be propagated in an
+     * {@code InvocationTargetException}. In that case, the stack trace of the
+     * target exception will be truncated such that the main method will be the
+     * last entry on the stack. In other words, the stack frames leading up to the
+     * invocation of the main method will be removed.
+     *
+     * @param runtimeArgs the runtime arguments
+     * @param args the arguments
+     * @throws Fault if a problem is detected before the main method can be executed
+     * @throws InvocationTargetException if the main method throws an exception
+     */
+    public void run(String[] runtimeArgs, String[] args) throws Fault, InvocationTargetException {
+        Path file = getFile(args);
+
+        Context context = new Context();
+        String mainClassName = compile(file, getJavacOpts(runtimeArgs), context);
+
+        String[] appArgs = Arrays.copyOfRange(args, 1, args.length);
+        execute(mainClassName, appArgs, context);
+    }
+
+    /**
+     * Returns the path for the filename found in the first of an array of arguments.
+     *
+     * @param args the array
+     * @return the path
+     * @throws Fault if there is a problem determining the path, or if the file does not exist
+     */
+    private Path getFile(String[] args) throws Fault {
+        if (args.length == 0) {
+            // should not happen when invoked from launcher
+            throw new Fault(Errors.NoArgs);
+        }
+        Path file;
+        try {
+            file = Paths.get(args[0]);
+        } catch (InvalidPathException e) {
+            throw new Fault(Errors.InvalidFilename(args[0]));
+        }
+        if (!Files.exists(file)) {
+            // should not happen when invoked from launcher
+            throw new Fault(Errors.FileNotFound(file));
+        }
+        return file;
+    }
+
+    /**
+     * Reads a source file, ignoring the first line if it is not a Java source file and
+     * it begins with {@code #!}.
+     *
+     * <p>If it is not a Java source file, and if the first two bytes are {@code #!},
+     * indicating a "magic number" of an executable text file, the rest of the first line
+     * up to but not including the newline is ignored. All characters after the first two are
+     * read in the {@link Charset#defaultCharset default platform encoding}.
+     *
+     * @param file the file
+     * @return a file object containing the content of the file
+     * @throws Fault if an error occurs while reading the file
+     */
+    private JavaFileObject readFile(Path file) throws Fault {
+        // use a BufferedInputStream to guarantee that we can use mark and reset.
+        try (BufferedInputStream in = new BufferedInputStream(Files.newInputStream(file))) {
+            boolean ignoreFirstLine;
+            if (file.getFileName().toString().endsWith(".java")) {
+                ignoreFirstLine = false;
+            } else {
+                in.mark(2);
+                ignoreFirstLine = (in.read() == '#') && (in.read() == '!');
+                if (!ignoreFirstLine) {
+                    in.reset();
+                }
+            }
+            try (BufferedReader r = new BufferedReader(new InputStreamReader(in, Charset.defaultCharset()))) {
+                StringBuilder sb = new StringBuilder();
+                if (ignoreFirstLine) {
+                    r.readLine();
+                    sb.append("\n"); // preserve line numbers
+                }
+                char[] buf = new char[1024];
+                int n;
+                while ((n = r.read(buf, 0, buf.length)) != -1)  {
+                    sb.append(buf, 0, n);
+                }
+                return new SimpleJavaFileObject(file.toUri(), SOURCE) {
+                    @Override
+                    public String getName() {
+                        return file.toString();
+                    }
+                    @Override
+                    public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+                        return sb;
+                    }
+                    @Override
+                    public boolean isNameCompatible(String simpleName, JavaFileObject.Kind kind) {
+                        // reject package-info and module-info; accept other names
+                        return (kind == JavaFileObject.Kind.SOURCE)
+                                && SourceVersion.isIdentifier(simpleName);
+                    }
+                    @Override
+                    public String toString() {
+                        return "JavacSourceLauncher[" + file + "]";
+                    }
+                };
+            }
+        } catch (IOException e) {
+            throw new Fault(Errors.CantReadFile(file, e));
+        }
+    }
+
+    /**
+     * Returns the subset of the runtime arguments that are relevant to {@code javac}.
+     * Generally, the relevant options are those for setting paths and for configuring the
+     * module system.
+     *
+     * @param runtimeArgs the runtime arguments
+     * @return the subset of the runtime arguments
+     **/
+    private List<String> getJavacOpts(String... runtimeArgs) throws Fault {
+        List<String> javacOpts = new ArrayList<>();
+
+        String sourceOpt = System.getProperty("jdk.internal.javac.source");
+        if (sourceOpt != null) {
+            Source source = Source.lookup(sourceOpt);
+            if (source == null) {
+                throw new Fault(Errors.InvalidValueForSource(sourceOpt));
+            }
+            javacOpts.addAll(List.of("--release", sourceOpt));
+        }
+
+        for (int i = 0; i < runtimeArgs.length; i++) {
+            String arg = runtimeArgs[i];
+            String opt = arg, value = null;
+            if (arg.startsWith("--")) {
+                int eq = arg.indexOf('=');
+                if (eq > 0) {
+                    opt = arg.substring(0, eq);
+                    value = arg.substring(eq + 1);
+                }
+            }
+            switch (opt) {
+                // The following options all expect a value, either in the following
+                // position, or after '=', for options beginning "--".
+                case "--class-path": case "-classpath": case "-cp":
+                case "--module-path": case "-p":
+                case "--add-exports":
+                case "--add-modules":
+                case "--limit-modules":
+                case "--patch-module":
+                case "--upgrade-module-path":
+                    if (value == null) {
+                        if (i== runtimeArgs.length - 1) {
+                            // should not happen when invoked from launcher
+                            throw new Fault(Errors.NoValueForOption(opt));
+                        }
+                        value = runtimeArgs[++i];
+                    }
+                    if (opt.equals("--add-modules") && value.equals("ALL-DEFAULT")) {
+                        // this option is only supported at run time;
+                        // it is not required or supported at compile time
+                        break;
+                    }
+                    javacOpts.add(opt);
+                    javacOpts.add(value);
+                    break;
+                case "--enable-preview":
+                    javacOpts.add(opt);
+                    if (sourceOpt == null) {
+                        throw new Fault(Errors.EnablePreviewRequiresSource);
+                    }
+                    break;
+                default:
+                    // ignore all other runtime args
+            }
+        }
+
+        // add implicit options
+        javacOpts.add("-proc:none");
+
+        return javacOpts;
+    }
+
+    /**
+     * Compiles a source file, placing the class files in a map in memory.
+     * Any messages generated during compilation will be written to the stream
+     * provided when this object was created.
+     *
+     * @param file the source file
+     * @param javacOpts compilation options for {@code javac}
+     * @param context the context for the compilation
+     * @return the name of the first class found in the source file
+     * @throws Fault if any compilation errors occur, or if no class was found
+     */
+    private String compile(Path file, List<String> javacOpts, Context context) throws Fault {
+        JavaFileObject fo = readFile(file);
+
+        JavacTool javaCompiler = JavacTool.create();
+        StandardJavaFileManager stdFileMgr = javaCompiler.getStandardFileManager(null, null, null);
+        try {
+            stdFileMgr.setLocation(StandardLocation.SOURCE_PATH, Collections.emptyList());
+        } catch (IOException e) {
+            throw new java.lang.Error("unexpected exception from file manager", e);
+        }
+        JavaFileManager fm = context.getFileManager(stdFileMgr);
+        JavacTask t = javaCompiler.getTask(out, fm, null, javacOpts, null, List.of(fo));
+        MainClassListener l = new MainClassListener(t);
+        Boolean ok = t.call();
+        if (!ok) {
+            throw new Fault(Errors.CompilationFailed);
+        }
+        if (l.mainClass == null) {
+            throw new Fault(Errors.NoClass);
+        }
+        String mainClassName = l.mainClass.getQualifiedName().toString();
+        return mainClassName;
+    }
+
+    /**
+     * Invokes the {@code main} method of a specified class, using a class loader that
+     * will load recently compiled classes from memory.
+     *
+     * @param mainClassName the class to be executed
+     * @param appArgs the arguments for the {@code main} method
+     * @param context the context for the class to be executed
+     * @throws Fault if there is a problem finding or invoking the {@code main} method
+     * @throws InvocationTargetException if the {@code main} method throws an exception
+     */
+    private void execute(String mainClassName, String[] appArgs, Context context)
+            throws Fault, InvocationTargetException {
+        ClassLoader cl = context.getClassLoader(ClassLoader.getSystemClassLoader());
+        try {
+            Class<?> appClass = Class.forName(mainClassName, true, cl);
+            if (appClass.getClassLoader() != cl) {
+                throw new Fault(Errors.UnexpectedClass(mainClassName));
+            }
+            Method main = appClass.getDeclaredMethod("main", String[].class);
+            int PUBLIC_STATIC = Modifier.PUBLIC | Modifier.STATIC;
+            if ((main.getModifiers() & PUBLIC_STATIC) != PUBLIC_STATIC) {
+                throw new Fault(Errors.MainNotPublicStatic);
+            }
+            if (!main.getReturnType().equals(void.class)) {
+                throw new Fault(Errors.MainNotVoid);
+            }
+            main.setAccessible(true);
+            main.invoke(0, (Object) appArgs);
+        } catch (ClassNotFoundException e) {
+            throw new Fault(Errors.CantFindClass(mainClassName));
+        } catch (NoSuchMethodException e) {
+            throw new Fault(Errors.CantFindMainMethod(mainClassName));
+        } catch (IllegalAccessException e) {
+            throw new Fault(Errors.CantAccessMainMethod(mainClassName));
+        } catch (InvocationTargetException e) {
+            // remove stack frames for source launcher
+            int invocationFrames = e.getStackTrace().length;
+            Throwable target = e.getTargetException();
+            StackTraceElement[] targetTrace = target.getStackTrace();
+            target.setStackTrace(Arrays.copyOfRange(targetTrace, 0, targetTrace.length - invocationFrames));
+            throw e;
+        }
+    }
+
+    private static final String bundleName = "com.sun.tools.javac.resources.launcher";
+    private ResourceBundle resourceBundle = null;
+    private String errorPrefix;
+
+    /**
+     * Returns a localized string from a resource bundle.
+     *
+     * @param error the error for which to get the localized text
+     * @return the localized string
+     */
+    private String getMessage(Error error) {
+        String key = error.key();
+        Object[] args = error.getArgs();
+        try {
+            if (resourceBundle == null) {
+                resourceBundle = ResourceBundle.getBundle(bundleName);
+                errorPrefix = resourceBundle.getString("launcher.error");
+            }
+            String resource = resourceBundle.getString(key);
+            String message = MessageFormat.format(resource, args);
+            return errorPrefix + message;
+        } catch (MissingResourceException e) {
+            return "Cannot access resource; " + key + Arrays.toString(args);
+        }
+    }
+
+    /**
+     * A listener to detect the first class found in a compilation.
+     */
+    static class MainClassListener implements TaskListener {
+        TypeElement mainClass;
+
+        MainClassListener(JavacTask t) {
+            t.addTaskListener(this);
+        }
+
+        @Override
+        public void started(TaskEvent ev) {
+            if (ev.getKind() == TaskEvent.Kind.ANALYZE && mainClass == null) {
+                TypeElement te = ev.getTypeElement();
+                if (te.getNestingKind() == NestingKind.TOP_LEVEL) {
+                    mainClass = te;
+                }
+            }
+        }
+    }
+
+    /**
+     * An object to encapulate the set of in-memory classes, such that
+     * they can be written by a file manager and subsequently used by
+     * a class loader.
+     */
+    private static class Context {
+        private Map<String, byte[]> inMemoryClasses = new HashMap<>();
+
+        JavaFileManager getFileManager(StandardJavaFileManager delegate) {
+            return new MemoryFileManager(inMemoryClasses, delegate);
+        }
+
+        ClassLoader getClassLoader(ClassLoader parent) {
+            return new MemoryClassLoader(inMemoryClasses, parent);
+        }
+    }
+
+    /**
+     * An in-memory file manager.
+     *
+     * <p>Class files (of kind {@link JavaFileObject.Kind#CLASS CLASS} written to
+     * {@link StandardLocation#CLASS_OUTPUT} will be written to an in-memory cache.
+     * All other file manager operations will be delegated to a specified file manager.
+     */
+    private static class MemoryFileManager extends ForwardingJavaFileManager<JavaFileManager> {
+        private final Map<String, byte[]> map;
+
+        MemoryFileManager(Map<String, byte[]> map, JavaFileManager delegate) {
+            super(delegate);
+            this.map = map;
+        }
+
+        @Override
+        public JavaFileObject getJavaFileForOutput(Location location, String className,
+                JavaFileObject.Kind kind, FileObject sibling) throws IOException {
+            if (location == StandardLocation.CLASS_OUTPUT && kind == JavaFileObject.Kind.CLASS) {
+                return createInMemoryClassFile(className);
+            } else {
+                return super.getJavaFileForOutput(location, className, kind, sibling);
+            }
+        }
+
+        private JavaFileObject createInMemoryClassFile(String className) {
+            URI uri = URI.create("memory:///" + className.replace('.', '/') + ".class");
+            return new SimpleJavaFileObject(uri, JavaFileObject.Kind.CLASS) {
+                @Override
+                public OutputStream openOutputStream() {
+                    return new ByteArrayOutputStream() {
+                        @Override
+                        public void close() throws IOException {
+                            super.close();
+                            map.put(className, toByteArray());
+                        }
+                    };
+                }
+            };
+        }
+    }
+
+    /**
+     * An in-memory classloader, that uses an in-memory cache written by {@link MemoryFileManager}.
+     *
+     * <p>The classloader uses the standard parent-delegation model, just providing
+     * {@code findClass} to find classes in the in-memory cache.
+     */
+    private static class MemoryClassLoader extends ClassLoader {
+        private final Map<String, byte[]> map;
+
+        MemoryClassLoader(Map<String, byte[]> map, ClassLoader parent) {
+            super(parent);
+            this.map = map;
+        }
+
+        @Override
+        protected Class<?> findClass(String name) throws ClassNotFoundException {
+            byte[] bytes = map.get(name);
+            if (bytes == null) {
+                throw new ClassNotFoundException(name);
+            }
+            return defineClass(name, bytes, 0, bytes.length);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/launcher.properties	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,136 @@
+#
+# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# Messages in this file which use "placeholders" for values (e.g. {0}, {1})
+# are preceded by a stylized comment describing the type of the corresponding
+# values.
+# The simple types currently in use are:
+#
+# annotation        annotation compound
+# boolean           true or false
+# diagnostic        a sub-message; see compiler.misc.*
+# fragment          similar to 'message segment', but with more specific type
+# modifier          a Java modifier; e.g. public, private, protected
+# file              a file URL
+# file object       a file URL - similar to 'file' but typically used for source/class files, hence more specific
+# flag              a Flags.Flag instance
+# name              a name, typically a Java identifier
+# number            an integer
+# option name       the name of a command line option
+# source version    a source version number, such as 1.5, 1.6, 1.7
+# string            a general string
+# symbol            the name of a declared type
+# symbol kind       the kind of a symbol (i.e. method, variable)
+# kind name         an informative description of the kind of a declaration; see compiler.misc.kindname.*
+# token             the name of a non-terminal in source code; see compiler.misc.token.*
+# type              a Java type; e.g. int, X, X<T>
+# object            a Java object (unspecified)
+# unused            the value is not used in this message
+#
+# The following compound types are also used:
+#
+# collection of X   a comma-separated collection of items; e.g. collection of type
+# list of X         a comma-separated list of items; e.g. list of type
+# set of X          a comma-separated set of items; e.g. set of modifier
+#
+# These may be composed:
+#
+# list of type or message segment
+#
+# The following type aliases are supported:
+#
+# message segment --> diagnostic or fragment
+# file name --> file, path or file object
+#
+# Custom comments are supported in parenthesis i.e.
+#
+# number (classfile major version)
+#
+# These comments are used internally in order to generate an enum-like class declaration containing
+# a method/field for each of the diagnostic keys listed here. Those methods/fields can then be used
+# by javac code to build diagnostics in a type-safe fashion.
+#
+# In addition, these comments are verified by the jtreg test test/tools/javac/diags/MessageInfo,
+# using info derived from the collected set of examples in test/tools/javac/diags/examples.
+# MessageInfo can also be run as a standalone utility providing more facilities
+# for manipulating this file. For more details, see MessageInfo.java.
+
+## All errors are preceded by this string.
+launcher.error=\
+    error:\u0020
+
+launcher.err.no.args=\
+    no filename
+
+# 0: string
+launcher.err.invalid.filename=\
+    invalid filename: {0}
+
+# 0: path
+launcher.err.file.not.found=\
+    file not found: {0}
+
+launcher.err.compilation.failed=\
+    compilation failed
+
+launcher.err.no.class=\
+    no class declared in file
+
+launcher.err.main.not.public.static=\
+    ''main'' method is not declared ''public static''
+
+launcher.err.main.not.void=\
+    ''main'' method is not declared with a return type of ''void''
+
+# 0: string
+launcher.err.cant.find.class=\
+    can''t find class: {0}
+
+# 0: string
+launcher.err.unexpected.class=\
+    class found on application class path: {0}
+
+# 0: string
+launcher.err.cant.find.main.method=\
+    can''t find main(String[]) method in class: {0}
+
+# 0: string
+launcher.err.cant.access.main.method=\
+    can''t access main method in class: {0}
+
+# 0: path, 1: object
+launcher.err.cant.read.file=\
+    error reading file {0}: {1}
+
+# 0: string
+launcher.err.no.value.for.option=\
+    no value given for option: {0}
+
+# 0: string
+launcher.err.invalid.value.for.source=\
+    invalid value for --source option: {0}
+
+launcher.err.enable.preview.requires.source=\
+    --enable-preview must be used with --source
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Mon Jun 11 09:29:44 2018 +0200
@@ -148,6 +148,36 @@
         }
     }
 
+    /** Is this tree a 'this' identifier?
+     */
+    public static boolean isThisQualifier(JCTree tree) {
+        switch (tree.getTag()) {
+            case PARENS:
+                return isThisQualifier(skipParens(tree));
+            case IDENT: {
+                JCIdent id = (JCIdent)tree;
+                return id.name == id.name.table.names._this;
+            }
+            default:
+                return false;
+        }
+    }
+
+    /** Is this tree an identifier, possibly qualified by 'this'?
+     */
+    public static boolean isIdentOrThisDotIdent(JCTree tree) {
+        switch (tree.getTag()) {
+            case PARENS:
+                return isIdentOrThisDotIdent(skipParens(tree));
+            case IDENT:
+                return true;
+            case SELECT:
+                return isThisQualifier(((JCFieldAccess)tree).selected);
+            default:
+                return false;
+        }
+    }
+
     /** Is this a call to super?
      */
     public static boolean isSuperCall(JCTree tree) {
--- a/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, 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
@@ -26,6 +26,9 @@
 #include <jni.h>
 #include "jni_util.h"
 #include "impl/ecc_impl.h"
+#include "sun_security_ec_ECDHKeyAgreement.h"
+#include "sun_security_ec_ECKeyPairGenerator.h"
+#include "sun_security_ec_ECDSASignature.h"
 
 #define ILLEGAL_STATE_EXCEPTION "java/lang/IllegalStateException"
 #define INVALID_ALGORITHM_PARAMETER_EXCEPTION \
--- a/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -37,7 +37,13 @@
 #include <wincrypt.h>
 #include <stdio.h>
 #include <memory>
-
+#include "sun_security_mscapi_Key.h"
+#include "sun_security_mscapi_KeyStore.h"
+#include "sun_security_mscapi_PRNG.h"
+#include "sun_security_mscapi_RSACipher.h"
+#include "sun_security_mscapi_RSAKeyPairGenerator.h"
+#include "sun_security_mscapi_RSAPublicKey.h"
+#include "sun_security_mscapi_RSASignature.h"
 
 #define OID_EKU_ANY         "2.5.29.37.0"
 
@@ -1313,7 +1319,7 @@
  * Signature: (Ljava/lang/String;)V
  */
 JNIEXPORT void JNICALL Java_sun_security_mscapi_KeyStore_destroyKeyContainer
-  (JNIEnv *env, jclass clazz, jstring keyContainerName)
+  (JNIEnv *env, jobject clazz, jstring keyContainerName)
 {
     HCRYPTPROV hCryptProv = NULL;
     const char* pszKeyContainerName = NULL;
@@ -1435,7 +1441,7 @@
  * Signature: (J)[B
  */
 JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_RSAPublicKey_getPublicKeyBlob
-    (JNIEnv *env, jclass clazz, jlong hCryptKey) {
+    (JNIEnv *env, jobject clazz, jlong hCryptKey) {
 
     jbyteArray blob = NULL;
     DWORD dwBlobLen;
@@ -1486,7 +1492,7 @@
  * Signature: ([B)[B
  */
 JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_RSAPublicKey_getExponent
-    (JNIEnv *env, jclass clazz, jbyteArray jKeyBlob) {
+    (JNIEnv *env, jobject clazz, jbyteArray jKeyBlob) {
 
     jbyteArray exponent = NULL;
     jbyte*     exponentBytes = NULL;
@@ -1542,7 +1548,7 @@
  * Signature: ([B)[B
  */
 JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_RSAPublicKey_getModulus
-    (JNIEnv *env, jclass clazz, jbyteArray jKeyBlob) {
+    (JNIEnv *env, jobject clazz, jbyteArray jKeyBlob) {
 
     jbyteArray modulus = NULL;
     jbyte*     modulusBytes = NULL;
@@ -1815,7 +1821,7 @@
  * Signature: (I[B[B[B[B[B[B[B[B)[B
  */
 JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_KeyStore_generatePrivateKeyBlob
-    (JNIEnv *env, jclass clazz,
+    (JNIEnv *env, jobject clazz,
         jint jKeyBitLength,
         jbyteArray jModulus,
         jbyteArray jPublicExponent,
@@ -1852,7 +1858,7 @@
  * Signature: ([BLjava/lang/String;I)Lsun/security/mscapi/RSAPrivateKey;
  */
 JNIEXPORT jobject JNICALL Java_sun_security_mscapi_KeyStore_storePrivateKey
-    (JNIEnv *env, jclass clazz, jbyteArray keyBlob, jstring keyContainerName,
+    (JNIEnv *env, jobject clazz, jbyteArray keyBlob, jstring keyContainerName,
      jint keySize)
 {
     HCRYPTPROV hCryptProv = NULL;
--- a/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeCrypto.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeCrypto.c	Mon Jun 11 09:29:44 2018 +0200
@@ -30,6 +30,13 @@
 #include "jni_util.h"
 #include "nativeCrypto.h"
 #include "nativeFunc.h"
+#include "com_oracle_security_ucrypto_NativeCipher.h"
+#include "com_oracle_security_ucrypto_NativeDigest.h"
+#include "com_oracle_security_ucrypto_NativeKey.h"
+#include "com_oracle_security_ucrypto_NativeKey.h"
+#include "com_oracle_security_ucrypto_NativeRSACipher.h"
+#include "com_oracle_security_ucrypto_NativeRSASignature.h"
+#include "com_oracle_security_ucrypto_UcryptoProvider.h"
 
 /*
  * Dumps out byte array in hex with and name and length info
--- a/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeCryptoMD.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeCryptoMD.c	Mon Jun 11 09:29:44 2018 +0200
@@ -30,7 +30,7 @@
 #include "jni_util.h"
 #include "nativeCrypto.h"
 #include "nativeFunc.h"
-
+#include "com_oracle_security_ucrypto_NativeDigestMD.h"
 
 extern void throwOutOfMemoryError(JNIEnv *env, const char *msg);
 extern jbyte* getBytes(JNIEnv *env, jbyteArray bytes, int offset, int len);
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java	Mon Jun 11 09:29:44 2018 +0200
@@ -49,6 +49,7 @@
 import sun.jvm.hotspot.debugger.Address;
 import sun.jvm.hotspot.debugger.OopHandle;
 import sun.jvm.hotspot.classfile.ClassLoaderDataGraph;
+import sun.jvm.hotspot.memory.FileMapInfo;
 import sun.jvm.hotspot.memory.SymbolTable;
 import sun.jvm.hotspot.memory.SystemDictionary;
 import sun.jvm.hotspot.memory.Universe;
@@ -89,6 +90,7 @@
 import sun.jvm.hotspot.ui.tree.SimpleTreeNode;
 import sun.jvm.hotspot.utilities.AddressOps;
 import sun.jvm.hotspot.utilities.Assert;
+import sun.jvm.hotspot.utilities.CompactHashTable;
 import sun.jvm.hotspot.utilities.HeapProgressThunk;
 import sun.jvm.hotspot.utilities.LivenessPathElement;
 import sun.jvm.hotspot.utilities.MethodArray;
@@ -637,12 +639,22 @@
         },
         new Command("symboldump", "symboldump", false) {
             public void doit(Tokens t) {
-                SymbolTable.getTheTable().symbolsDo(new SymbolTable.SymbolVisitor() {
+                SymbolTable theTable = SymbolTable.getTheTable();
+                theTable.symbolsDo(new SymbolTable.SymbolVisitor() {
                         public void visit(Symbol sym) {
                             sym.printValueOn(out);
                             out.println();
                         }
                     });
+                CompactHashTable sharedTable = theTable.getSharedTable();
+                if (sharedTable != null) {
+                    sharedTable.symbolsDo(new CompactHashTable.SymbolVisitor() {
+                            public void visit(Symbol sym) {
+                                sym.printValueOn(out);
+                                out.println();
+                            }
+                        });
+                }
             }
         },
         new Command("flags", "flags [ flag | -nd ]", false) {
@@ -1048,6 +1060,15 @@
                     }
                     if (node == null) {
                         Type type = VM.getVM().getTypeDataBase().guessTypeForAddress(a);
+                        if (type == null && VM.getVM().isSharingEnabled()) {
+                            // Check if the value falls in the _md_region
+                            Address loc1 = a.getAddressAt(0);
+                            FileMapInfo cdsFileMapInfo = VM.getVM().getFileMapInfo();
+                            if (cdsFileMapInfo.inCopiedVtableSpace(loc1)) {
+                               type = cdsFileMapInfo.getTypeForVptrAddress(loc1);
+                            }
+
+                        }
                         if (type != null) {
                             out.println("Type is " + type.getName() + " (size of " + type.getSize() + ")");
                             node = new CTypeTreeNodeAdapter(a, type, null);
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/StringTable.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.memory;
-
-import java.io.*;
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.oops.*;
-import sun.jvm.hotspot.types.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.utilities.*;
-
-public class StringTable extends sun.jvm.hotspot.utilities.Hashtable {
-  static {
-    VM.registerVMInitializedObserver(new Observer() {
-        public void update(Observable o, Object data) {
-          initialize(VM.getVM().getTypeDataBase());
-        }
-      });
-  }
-
-  private static synchronized void initialize(TypeDataBase db) {
-    Type type = db.lookupType("StringTable");
-    theTableField  = type.getAddressField("_the_table");
-  }
-
-  // Fields
-  private static AddressField theTableField;
-
-  // Accessors
-  public static StringTable getTheTable() {
-    Address tmp = theTableField.getValue();
-    return (StringTable) VMObjectFactory.newObject(StringTable.class, tmp);
-  }
-
-  public StringTable(Address addr) {
-    super(addr);
-  }
-
-  public interface StringVisitor {
-    public void visit(Instance string);
-  }
-
-  public void stringsDo(StringVisitor visitor) {
-    ObjectHeap oh = VM.getVM().getObjectHeap();
-    int numBuckets = tableSize();
-    for (int i = 0; i < numBuckets; i++) {
-      for (HashtableEntry e = (HashtableEntry) bucket(i); e != null;
-           e = (HashtableEntry) e.next()) {
-        Instance s = (Instance)oh.newOop(e.literalValue().addOffsetToAsOopHandle(0));
-        visitor.visit(s);
-      }
-    }
-  }
-}
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/SymbolTable.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/SymbolTable.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, 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
@@ -65,6 +65,10 @@
     return table;
   }
 
+  public CompactHashTable getSharedTable() {
+      return sharedTable;
+  }
+
   public static long getSeed() {
       return (long) seedField.getValue();
   }
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java	Mon Jun 11 09:29:44 2018 +0200
@@ -79,7 +79,6 @@
   private Universe     universe;
   private ObjectHeap   heap;
   private SymbolTable  symbols;
-  private StringTable  strings;
   private SystemDictionary dict;
   private ClassLoaderDataGraph cldGraph;
   private Threads      threads;
@@ -655,13 +654,6 @@
     return symbols;
   }
 
-  public StringTable getStringTable() {
-    if (strings == null) {
-      strings = StringTable.getTheTable();
-    }
-    return strings;
-  }
-
   public SystemDictionary getSystemDictionary() {
     if (dict == null) {
       dict = new SystemDictionary();
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java	Mon Jun 11 09:29:44 2018 +0200
@@ -133,7 +133,6 @@
       }
 
       System.out.println();
-      printInternStringStatistics();
    }
 
    // Helper methods
@@ -268,41 +267,4 @@
          return -1;
       }
    }
-
-   private void printInternStringStatistics() {
-      class StringStat implements StringTable.StringVisitor {
-         private int count;
-         private long size;
-         private OopField stringValueField;
-
-         StringStat() {
-            VM vm = VM.getVM();
-            SystemDictionary sysDict = vm.getSystemDictionary();
-            InstanceKlass strKlass = sysDict.getStringKlass();
-            // String has a field named 'value' of type 'byte[]'.
-            stringValueField = (OopField) strKlass.findField("value", "[B");
-         }
-
-         private long stringSize(Instance instance) {
-            // We include String content in size calculation.
-            return instance.getObjectSize() +
-                   stringValueField.getValue(instance).getObjectSize();
-         }
-
-         public void visit(Instance str) {
-            count++;
-            size += stringSize(str);
-         }
-
-         public void print() {
-            System.out.println(count +
-                  " interned Strings occupying " + size + " bytes.");
-         }
-      }
-
-      StringStat stat = new StringStat();
-      StringTable strTable = VM.getVM().getStringTable();
-      strTable.stringsDo(stat);
-      stat.print();
-   }
 }
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -119,4 +119,39 @@
     }
     return null;
   }
+
+  public interface SymbolVisitor {
+    public void visit(Symbol sym);
+  }
+
+  public void symbolsDo(SymbolVisitor visitor) {
+    long    symOffset;
+    Symbol  sym;
+    Address baseAddress = baseAddressField.getValue(addr);
+    Address bucket = bucketsField.getValue(addr);
+    for (long index = 0; index < bucketCount(); index++) {
+      int bucketInfo = (int)bucket.getCIntegerAt(index * uintSize, uintSize, true);
+      int bucketOffset = bucketOffset(bucketInfo);
+      int nextBucketInfo = (int)bucket.getCIntegerAt((index+1) * uintSize, uintSize, true);
+      int nextBucketOffset = bucketOffset(nextBucketInfo);
+
+      Address entry = entriesField.getValue(addr).addOffsetTo(bucketOffset * uintSize);
+
+      if (isValueOnlyBucket(bucketInfo)) {
+        symOffset = entry.getCIntegerAt(0, uintSize, true);
+        sym = Symbol.create(baseAddress.addOffsetTo(symOffset));
+        visitor.visit(sym);
+      } else {
+        Address entryMax = entriesField.getValue(addr).addOffsetTo(nextBucketOffset * uintSize);
+        while (entry.lessThan(entryMax)) {
+          symOffset = entry.getCIntegerAt(uintSize, uintSize, true);
+          Address symAddr = baseAddress.addOffsetTo(symOffset);
+          sym = Symbol.create(symAddr);
+          visitor.visit(sym);
+          entry = entry.addOffsetTo(2 * uintSize);
+        }
+      }
+    }
+  }
 }
+
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/AbstractOptionSpec.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/AbstractOptionSpec.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -56,7 +56,6 @@
 package jdk.internal.joptsimple;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.List;
 
 import static java.util.Collections.*;
@@ -70,22 +69,22 @@
  * @param <V> represents the type of the arguments this option accepts
  * @author <a href="mailto:pholser@alumni.rice.edu">Paul Holser</a>
  */
-abstract class AbstractOptionSpec<V> implements OptionSpec<V>, OptionDescriptor {
-    private final List<String> options = new ArrayList<String>();
+public abstract class AbstractOptionSpec<V> implements OptionSpec<V>, OptionDescriptor {
+    private final List<String> options = new ArrayList<>();
     private final String description;
     private boolean forHelp;
 
-    protected AbstractOptionSpec( String option ) {
+    AbstractOptionSpec( String option ) {
         this( singletonList( option ), EMPTY );
     }
 
-    protected AbstractOptionSpec( Collection<String> options, String description ) {
+    AbstractOptionSpec( List<String> options, String description ) {
         arrangeOptions( options );
 
         this.description = description;
     }
 
-    public final Collection<String> options() {
+    public final List<String> options() {
         return unmodifiableList( options );
     }
 
@@ -119,12 +118,8 @@
     protected V convertWith( ValueConverter<V> converter, String argument ) {
         try {
             return Reflection.convertWith( converter, argument );
-        }
-        catch ( ReflectionException ex ) {
-            throw new OptionArgumentConversionException( options(), argument, ex );
-        }
-        catch ( ValueConversionException ex ) {
-            throw new OptionArgumentConversionException( options(), argument, ex );
+        } catch ( ReflectionException | ValueConversionException ex ) {
+            throw new OptionArgumentConversionException( this, argument, ex );
         }
     }
 
@@ -139,14 +134,14 @@
     abstract void handleOption( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions,
         String detectedArgument );
 
-    private void arrangeOptions( Collection<String> unarranged ) {
+    private void arrangeOptions( List<String> unarranged ) {
         if ( unarranged.size() == 1 ) {
             options.addAll( unarranged );
             return;
         }
 
-        List<String> shortOptions = new ArrayList<String>();
-        List<String> longOptions = new ArrayList<String>();
+        List<String> shortOptions = new ArrayList<>();
+        List<String> longOptions = new ArrayList<>();
 
         for ( String each : unarranged ) {
             if ( each.length() == 1 )
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/AlternativeLongOptionSpec.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/AlternativeLongOptionSpec.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -55,26 +55,40 @@
 
 package jdk.internal.joptsimple;
 
+import jdk.internal.joptsimple.internal.Messages;
+
+import java.util.Locale;
+
 import static java.util.Collections.*;
 
 import static jdk.internal.joptsimple.ParserRules.*;
 
 /**
- * Represents the <kbd>"-W"</kbd> form of long option specification.
+ * Represents the {@code "-W"} form of long option specification.
  *
  * @author <a href="mailto:pholser@alumni.rice.edu">Paul Holser</a>
  */
 class AlternativeLongOptionSpec extends ArgumentAcceptingOptionSpec<String> {
     AlternativeLongOptionSpec() {
-        super( singletonList( RESERVED_FOR_EXTENSIONS ), true, "Alternative form of long options" );
+        super( singletonList( RESERVED_FOR_EXTENSIONS ),
+            true,
+            Messages.message(
+                Locale.getDefault(),
+                "jdk.internal.joptsimple.HelpFormatterMessages",
+                AlternativeLongOptionSpec.class,
+                "description" ) );
 
-        describedAs( "opt=value" );
+        describedAs( Messages.message(
+            Locale.getDefault(),
+            "jdk.internal.joptsimple.HelpFormatterMessages",
+            AlternativeLongOptionSpec.class,
+            "arg.description" ) );
     }
 
     @Override
     protected void detectOptionArgument( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions ) {
         if ( !arguments.hasMore() )
-            throw new OptionMissingRequiredArgumentException( options() );
+            throw new OptionMissingRequiredArgumentException( this );
 
         arguments.treatNextAsLongOption();
     }
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/ArgumentAcceptingOptionSpec.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/ArgumentAcceptingOptionSpec.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -56,13 +56,12 @@
 package jdk.internal.joptsimple;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.List;
 import java.util.StringTokenizer;
 
 import static java.util.Collections.*;
+import static java.util.Objects.*;
 
-import static jdk.internal.joptsimple.internal.Objects.*;
 import static jdk.internal.joptsimple.internal.Reflection.*;
 import static jdk.internal.joptsimple.internal.Strings.*;
 
@@ -88,12 +87,13 @@
 public abstract class ArgumentAcceptingOptionSpec<V> extends AbstractOptionSpec<V> {
     private static final char NIL_VALUE_SEPARATOR = '\u0000';
 
+    private final boolean argumentRequired;
+    private final List<V> defaultValues = new ArrayList<>();
+
     private boolean optionRequired;
-    private final boolean argumentRequired;
     private ValueConverter<V> converter;
     private String argumentDescription = "";
     private String valueSeparator = String.valueOf( NIL_VALUE_SEPARATOR );
-    private final List<V> defaultValues = new ArrayList<V>();
 
     ArgumentAcceptingOptionSpec( String option, boolean argumentRequired ) {
         super( option );
@@ -101,7 +101,7 @@
         this.argumentRequired = argumentRequired;
     }
 
-    ArgumentAcceptingOptionSpec( Collection<String> options, boolean argumentRequired, String description ) {
+    ArgumentAcceptingOptionSpec( List<String> options, boolean argumentRequired, String description ) {
         super( options, description );
 
         this.argumentRequired = argumentRequired;
@@ -182,7 +182,7 @@
      *   </code>
      * </pre>
      *
-     * <p>Then {@code options.valuesOf( "z" )} would yield the list {@code [foo, bar, baz, fizz, buzz]}.</p>
+     * <p>Then <code>options.valuesOf( "z" )</code> would yield the list {@code [foo, bar, baz, fizz, buzz]}.</p>
      *
      * <p>You cannot use Unicode U+0000 as the separator.</p>
      *
@@ -211,7 +211,7 @@
      *   </code>
      * </pre>
      *
-     * <p>Then {@code options.valuesOf( "z" )} would yield the list {@code [foo, bar, baz, fizz, buzz]}.</p>
+     * <p>Then <code>options.valuesOf( "z" )</code> would yield the list {@code [foo, bar, baz, fizz, buzz]}.</p>
      *
      * <p>You cannot use Unicode U+0000 in the separator.</p>
      *
@@ -236,8 +236,9 @@
      * @throws NullPointerException if {@code value}, {@code values}, or any elements of {@code values} are
      * {@code null}
      */
-    @SuppressWarnings("unchecked")
-    public ArgumentAcceptingOptionSpec<V> defaultsTo( V value, V... values ) {
+    @SafeVarargs
+    @SuppressWarnings("varargs")
+    public final ArgumentAcceptingOptionSpec<V> defaultsTo( V value, V... values ) {
         addDefaultValue( value );
         defaultsTo( values );
 
@@ -275,7 +276,7 @@
     }
 
     private void addDefaultValue( V value ) {
-        ensureNotNull( value );
+        requireNonNull( value );
         defaultValues.add( value );
     }
 
@@ -283,7 +284,7 @@
     final void handleOption( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions,
         String detectedArgument ) {
 
-        if ( isNullOrEmpty( detectedArgument ) )
+        if ( detectedArgument == null )
             detectOptionArgument( parser, arguments, detectedOptions );
         else
             addArguments( detectedOptions, detectedArgument );
@@ -314,8 +315,7 @@
             while ( lexer.hasMoreTokens() )
                 convert( lexer.nextToken() );
             return true;
-        }
-        catch ( OptionException ignored ) {
+        } catch ( OptionException ignored ) {
             return false;
         }
     }
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/ArgumentList.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/ArgumentList.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/BuiltinHelpFormatter.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/BuiltinHelpFormatter.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -55,14 +55,9 @@
 
 package jdk.internal.joptsimple;
 
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
+import java.util.*;
 
+import jdk.internal.joptsimple.internal.Messages;
 import jdk.internal.joptsimple.internal.Rows;
 import jdk.internal.joptsimple.internal.Strings;
 
@@ -73,10 +68,17 @@
 /**
  * <p>A help formatter that allows configuration of overall row width and column separator width.</p>
  *
- * <p>The formatter produces a two-column output. The left column is for the options, and the right column for their
+ * <p>The formatter produces output in two sections: one for the options, and one for non-option arguments.</p>
+ *
+ * <p>The options section has two columns: the left column for the options, and the right column for their
  * descriptions. The formatter will allow as much space as possible for the descriptions, by minimizing the option
  * column's width, no greater than slightly less than half the overall desired width.</p>
  *
+ * <p>The non-option arguments section is one column, occupying as much width as it can.</p>
+ *
+ * <p>Subclasses are free to override bits of this implementation as they see fit. Inspect the code
+ * carefully to understand the flow of control that this implementation guarantees.</p>
+ *
  * @author <a href="mailto:pholser@alumni.rice.edu">Paul Holser</a>
  */
 public class BuiltinHelpFormatter implements HelpFormatter {
@@ -102,7 +104,20 @@
         optionRows = new Rows( desiredOverallWidth, desiredColumnSeparatorWidth );
     }
 
+    /**
+     * {@inheritDoc}
+     *
+     * <p>This implementation:</p>
+     * <ul>
+     *     <li>Sorts the given descriptors by their first elements of {@link OptionDescriptor#options()}</li>
+     *     <li>Passes the resulting sorted set to {@link #addRows(java.util.Collection)}</li>
+     *     <li>Returns the result of {@link #formattedHelpOutput()}</li>
+     * </ul>
+     */
     public String format( Map<String, ? extends OptionDescriptor> options ) {
+        optionRows.reset();
+        nonOptionRows.reset();
+
         Comparator<OptionDescriptor> comparator =
             new Comparator<OptionDescriptor>() {
                 public int compare( OptionDescriptor first, OptionDescriptor second ) {
@@ -110,7 +125,7 @@
                 }
             };
 
-        Set<OptionDescriptor> sorted = new TreeSet<OptionDescriptor>( comparator );
+        Set<OptionDescriptor> sorted = new TreeSet<>( comparator );
         sorted.addAll( options.values() );
 
         addRows( sorted );
@@ -118,21 +133,102 @@
         return formattedHelpOutput();
     }
 
-    private String formattedHelpOutput() {
+    /**
+     * Adds a row of option help output in the left column, with empty space in the right column.
+     *
+     * @param single text to put in the left column
+     */
+    protected void addOptionRow( String single ) {
+        addOptionRow( single, "" );
+    }
+
+    /**
+     * Adds a row of option help output in the left and right columns.
+     *
+     * @param left text to put in the left column
+     * @param right text to put in the right column
+     */
+    protected void addOptionRow( String left, String right ) {
+        optionRows.add( left, right );
+    }
+
+    /**
+     * Adds a single row of non-option argument help.
+     *
+     * @param single single row of non-option argument help text
+     */
+    protected void addNonOptionRow( String single ) {
+        nonOptionRows.add( single, "" );
+    }
+
+    /**
+     * Resizes the columns of all the rows to be no wider than the widest element in that column.
+     */
+    protected void fitRowsToWidth() {
+        nonOptionRows.fitToWidth();
+        optionRows.fitToWidth();
+    }
+
+    /**
+     * Produces non-option argument help.
+     *
+     * @return non-option argument help
+     */
+    protected String nonOptionOutput() {
+        return nonOptionRows.render();
+    }
+
+    /**
+     * Produces help for options and their descriptions.
+     *
+     * @return option help
+     */
+    protected String optionOutput() {
+        return optionRows.render();
+    }
+
+    /**
+     * <p>Produces help output for an entire set of options and non-option arguments.</p>
+     *
+     * <p>This implementation concatenates:</p>
+     * <ul>
+     *     <li>the result of {@link #nonOptionOutput()}</li>
+     *     <li>if there is non-option output, a line separator</li>
+     *     <li>the result of {@link #optionOutput()}</li>
+     * </ul>
+     *
+     * @return help output for entire set of options and non-option arguments
+     */
+    protected String formattedHelpOutput() {
         StringBuilder formatted = new StringBuilder();
-        String nonOptionDisplay = nonOptionRows.render();
+        String nonOptionDisplay = nonOptionOutput();
         if ( !Strings.isNullOrEmpty( nonOptionDisplay ) )
             formatted.append( nonOptionDisplay ).append( LINE_SEPARATOR );
-        formatted.append( optionRows.render() );
+        formatted.append( optionOutput() );
 
         return formatted.toString();
     }
 
-    private void addRows( Collection<? extends OptionDescriptor> options ) {
+    /**
+     * <p>Adds rows of help output for the given options.</p>
+     *
+     * <p>This implementation:</p>
+     * <ul>
+     *     <li>Calls {@link #addNonOptionsDescription(java.util.Collection)} with the options as the argument</li>
+ *         <li>If there are no options, calls {@link #addOptionRow(String)} with an argument that indicates
+ *         that no options are specified.</li>
+ *         <li>Otherwise, calls {@link #addHeaders(java.util.Collection)} with the options as the argument,
+ *         followed by {@link #addOptions(java.util.Collection)} with the options as the argument.</li>
+     *     <li>Calls {@link #fitRowsToWidth()}.</li>
+     * </ul>
+     *
+     * @param options descriptors for the configured options of a parser
+     */
+    protected void addRows( Collection<? extends OptionDescriptor> options ) {
         addNonOptionsDescription( options );
 
         if ( options.isEmpty() )
-            optionRows.add( "No options specified", "" );
+            addOptionRow( message( "no.options.specified" ) );
         else {
             addHeaders( options );
             addOptions( options );
@@ -141,34 +237,87 @@
         fitRowsToWidth();
     }
 
-    private void addNonOptionsDescription( Collection<? extends OptionDescriptor> options ) {
+    /**
+     * <p>Adds non-option arguments descriptions to the help output.</p>
+     *
+     * <p>This implementation:</p>
+     * <ul>
+     *     <li>{@linkplain #findAndRemoveNonOptionsSpec(java.util.Collection) Finds and removes the non-option
+     *     arguments descriptor}</li>
+     *     <li>{@linkplain #shouldShowNonOptionArgumentDisplay(OptionDescriptor) Decides whether there is
+     *     anything to show for non-option arguments}</li>
+     *     <li>If there is, {@linkplain #addNonOptionRow(String) adds a header row} and
+     *     {@linkplain #addNonOptionRow(String) adds a}
+     *     {@linkplain #createNonOptionArgumentsDisplay(OptionDescriptor) non-option arguments description} </li>
+     * </ul>
+     *
+     * @param options descriptors for the configured options of a parser
+     */
+    protected void addNonOptionsDescription( Collection<? extends OptionDescriptor> options ) {
         OptionDescriptor nonOptions = findAndRemoveNonOptionsSpec( options );
         if ( shouldShowNonOptionArgumentDisplay( nonOptions ) ) {
-            nonOptionRows.add( "Non-option arguments:", "" );
-            nonOptionRows.add(createNonOptionArgumentsDisplay(nonOptions), "");
+            addNonOptionRow( message( "non.option.arguments.header" ) );
+            addNonOptionRow( createNonOptionArgumentsDisplay( nonOptions ) );
         }
     }
 
-    private boolean shouldShowNonOptionArgumentDisplay( OptionDescriptor nonOptions ) {
-        return !Strings.isNullOrEmpty( nonOptions.description() )
-            || !Strings.isNullOrEmpty( nonOptions.argumentTypeIndicator() )
-            || !Strings.isNullOrEmpty( nonOptions.argumentDescription() );
+    /**
+     * <p>Decides whether or not to show a non-option arguments help.</p>
+     *
+     * <p>This implementation responds with {@code true} if the non-option descriptor has a non-{@code null},
+     * non-empty value for any of {@link OptionDescriptor#description()},
+     * {@link OptionDescriptor#argumentTypeIndicator()}, or {@link OptionDescriptor#argumentDescription()}.</p>
+     *
+     * @param nonOptionDescriptor non-option argument descriptor
+     * @return {@code true} if non-options argument help should be shown
+     */
+    protected boolean shouldShowNonOptionArgumentDisplay( OptionDescriptor nonOptionDescriptor ) {
+        return !Strings.isNullOrEmpty( nonOptionDescriptor.description() )
+            || !Strings.isNullOrEmpty( nonOptionDescriptor.argumentTypeIndicator() )
+            || !Strings.isNullOrEmpty( nonOptionDescriptor.argumentDescription() );
     }
 
-    private String createNonOptionArgumentsDisplay(OptionDescriptor nonOptions) {
+    /**
+     * <p>Creates a non-options argument help string.</p>
+     *
+     * <p>This implementation creates an empty string buffer and calls
+     * {@link #maybeAppendOptionInfo(StringBuilder, OptionDescriptor)}
+     * and {@link #maybeAppendNonOptionsDescription(StringBuilder, OptionDescriptor)}, passing them the
+     * buffer and the non-option arguments descriptor.</p>
+     *
+     * @param nonOptionDescriptor non-option argument descriptor
+     * @return help string for non-options
+     */
+    protected String createNonOptionArgumentsDisplay( OptionDescriptor nonOptionDescriptor ) {
         StringBuilder buffer = new StringBuilder();
-        maybeAppendOptionInfo( buffer, nonOptions );
-        maybeAppendNonOptionsDescription( buffer, nonOptions );
+        maybeAppendOptionInfo( buffer, nonOptionDescriptor );
+        maybeAppendNonOptionsDescription( buffer, nonOptionDescriptor );
 
         return buffer.toString();
     }
 
-    private void maybeAppendNonOptionsDescription( StringBuilder buffer, OptionDescriptor nonOptions ) {
+    /**
+     * <p>Appends help for the given non-option arguments descriptor to the given buffer.</p>
+     *
+     * <p>This implementation appends {@code " -- "} if the buffer has text in it and the non-option arguments
+     * descriptor has a {@link OptionDescriptor#description()}; followed by the
+     * {@link OptionDescriptor#description()}.</p>
+     *
+     * @param buffer string buffer
+     * @param nonOptions non-option arguments descriptor
+     */
+    protected void maybeAppendNonOptionsDescription( StringBuilder buffer, OptionDescriptor nonOptions ) {
         buffer.append( buffer.length() > 0 && !Strings.isNullOrEmpty( nonOptions.description() ) ? " -- " : "" )
             .append( nonOptions.description() );
     }
 
-    private OptionDescriptor findAndRemoveNonOptionsSpec( Collection<? extends OptionDescriptor> options ) {
+    /**
+     * Finds the non-option arguments descriptor in the given collection, removes it, and returns it.
+     *
+     * @param options descriptors for the configured options of a parser
+     * @return the non-option arguments descriptor
+     */
+    protected OptionDescriptor findAndRemoveNonOptionsSpec( Collection<? extends OptionDescriptor> options ) {
         for ( Iterator<? extends OptionDescriptor> it = options.iterator(); it.hasNext(); ) {
             OptionDescriptor next = it.next();
             if ( next.representsNonOptions() ) {
@@ -180,17 +329,32 @@
         throw new AssertionError( "no non-options argument spec" );
     }
 
-    private void addHeaders( Collection<? extends OptionDescriptor> options ) {
+    /**
+     * <p>Adds help row headers for option help columns.</p>
+     *
+     * <p>This implementation uses the headers {@code "Option"} and {@code "Description"}. If the options contain
+     * a "required" option, the {@code "Option"} header looks like {@code "Option (* = required)}. Both headers
+     * are "underlined" using {@code "-"}.</p>
+     *
+     * @param options descriptors for the configured options of a parser
+     */
+    protected void addHeaders( Collection<? extends OptionDescriptor> options ) {
         if ( hasRequiredOption( options ) ) {
-            optionRows.add("Option (* = required)", "Description");
-            optionRows.add("---------------------", "-----------");
+            addOptionRow( message( "option.header.with.required.indicator" ), message( "description.header" ) );
+            addOptionRow( message( "option.divider.with.required.indicator" ), message( "description.divider" ) );
         } else {
-            optionRows.add("Option", "Description");
-            optionRows.add("------", "-----------");
+            addOptionRow( message( "option.header" ), message( "description.header" ) );
+            addOptionRow( message( "option.divider" ), message( "description.divider" ) );
         }
     }
 
-    private boolean hasRequiredOption( Collection<? extends OptionDescriptor> options ) {
+    /**
+     * Tells whether the given option descriptors contain a "required" option.
+     *
+     * @param options descriptors for the configured options of a parser
+     * @return {@code true} if at least one of the options is "required"
+     */
+    protected final boolean hasRequiredOption( Collection<? extends OptionDescriptor> options ) {
         for ( OptionDescriptor each : options ) {
             if ( each.isRequired() )
                 return true;
@@ -199,19 +363,46 @@
         return false;
     }
 
-    private void addOptions( Collection<? extends OptionDescriptor> options ) {
+    /**
+     * <p>Adds help rows for the given options.</p>
+     *
+     * <p>This implementation loops over the given options, and for each, calls {@link #addOptionRow(String, String)}
+     * using the results of {@link #createOptionDisplay(OptionDescriptor)} and
+     * {@link #createDescriptionDisplay(OptionDescriptor)}, respectively, as arguments.</p>
+     *
+     * @param options descriptors for the configured options of a parser
+     */
+    protected void addOptions( Collection<? extends OptionDescriptor> options ) {
         for ( OptionDescriptor each : options ) {
             if ( !each.representsNonOptions() )
-                optionRows.add( createOptionDisplay( each ), createDescriptionDisplay( each ) );
+                addOptionRow( createOptionDisplay( each ), createDescriptionDisplay( each ) );
         }
     }
 
-    private String createOptionDisplay( OptionDescriptor descriptor ) {
+    /**
+     * <p>Creates a string for how the given option descriptor is to be represented in help.</p>
+     *
+     * <p>This implementation gives a string consisting of the concatenation of:</p>
+     * <ul>
+     *     <li>{@code "* "} for "required" options, otherwise {@code ""}</li>
+     *     <li>For each of the {@link OptionDescriptor#options()} of the descriptor, separated by {@code ", "}:
+     *         <ul>
+     *             <li>{@link #optionLeader(String)} of the option</li>
+     *             <li>the option</li>
+     *         </ul>
+     *     </li>
+     *     <li>the result of {@link #maybeAppendOptionInfo(StringBuilder, OptionDescriptor)}</li>
+     * </ul>
+     *
+     * @param descriptor a descriptor for a configured option of a parser
+     * @return help string
+     */
+    protected String createOptionDisplay( OptionDescriptor descriptor ) {
         StringBuilder buffer = new StringBuilder( descriptor.isRequired() ? "* " : "" );
 
         for ( Iterator<String> i = descriptor.options().iterator(); i.hasNext(); ) {
             String option = i.next();
-            buffer.append( option.length() > 1 ? DOUBLE_HYPHEN : HYPHEN );
+            buffer.append( optionLeader( option ) );
             buffer.append( option );
 
             if ( i.hasNext() )
@@ -223,31 +414,105 @@
         return buffer.toString();
     }
 
-    private void maybeAppendOptionInfo( StringBuilder buffer, OptionDescriptor descriptor ) {
+    /**
+     * <p>Gives a string that represents the given option's "option leader" in help.</p>
+     *
+     * <p>This implementation answers with {@code "--"} for options of length greater than one; otherwise answers
+     * with {@code "-"}.</p>
+     *
+     * @param option a string option
+     * @return an "option leader" string
+     */
+    protected String optionLeader( String option ) {
+        return option.length() > 1 ? DOUBLE_HYPHEN : HYPHEN;
+    }
+
+    /**
+     * <p>Appends additional info about the given option to the given buffer.</p>
+     *
+     * <p>This implementation:</p>
+     * <ul>
+     *     <li>calls {@link #extractTypeIndicator(OptionDescriptor)} for the descriptor</li>
+     *     <li>calls {@link jdk.internal.joptsimple.OptionDescriptor#argumentDescription()} for the descriptor</li>
+     *     <li>if either of the above is present, calls
+     *     {@link #appendOptionHelp(StringBuilder, String, String, boolean)}</li>
+     * </ul>
+     *
+     * @param buffer string buffer
+     * @param descriptor a descriptor for a configured option of a parser
+     */
+    protected void maybeAppendOptionInfo( StringBuilder buffer, OptionDescriptor descriptor ) {
         String indicator = extractTypeIndicator( descriptor );
         String description = descriptor.argumentDescription();
-        if ( indicator != null || !isNullOrEmpty( description ) )
+        if ( descriptor.acceptsArguments()
+            || !isNullOrEmpty( description )
+            || descriptor.representsNonOptions() ) {
+
             appendOptionHelp( buffer, indicator, description, descriptor.requiresArgument() );
+        }
     }
 
-    private String extractTypeIndicator( OptionDescriptor descriptor ) {
+    /**
+     * <p>Gives an indicator of the type of arguments of the option described by the given descriptor,
+     * for use in help.</p>
+     *
+     * <p>This implementation asks for the {@link OptionDescriptor#argumentTypeIndicator()} of the given
+     * descriptor, and if it is present and not {@code "java.lang.String"}, parses it as a fully qualified
+     * class name and returns the base name of that class; otherwise returns {@code "String"}.</p>
+     *
+     * @param descriptor a descriptor for a configured option of a parser
+     * @return type indicator text
+     */
+    protected String extractTypeIndicator( OptionDescriptor descriptor ) {
         String indicator = descriptor.argumentTypeIndicator();
 
         if ( !isNullOrEmpty( indicator ) && !String.class.getName().equals( indicator ) )
             return shortNameOf( indicator );
 
-        return null;
+        return "String";
     }
 
-    private void appendOptionHelp( StringBuilder buffer, String typeIndicator, String description, boolean required ) {
+    /**
+     * <p>Appends info about an option's argument to the given buffer.</p>
+     *
+     * <p>This implementation calls {@link #appendTypeIndicator(StringBuilder, String, String, char, char)} with
+     * the surrounding characters {@code '<'} and {@code '>'} for options with {@code required} arguments, and
+     * with the surrounding characters {@code '['} and {@code ']'} for options with optional arguments.</p>
+     *
+     * @param buffer string buffer
+     * @param typeIndicator type indicator
+     * @param description type description
+     * @param required indicator of "required"-ness of the argument of the option
+     */
+    protected void appendOptionHelp( StringBuilder buffer, String typeIndicator, String description,
+                                     boolean required ) {
         if ( required )
             appendTypeIndicator( buffer, typeIndicator, description, '<', '>' );
         else
             appendTypeIndicator( buffer, typeIndicator, description, '[', ']' );
     }
 
-    private void appendTypeIndicator( StringBuilder buffer, String typeIndicator, String description,
-                                      char start, char end ) {
+    /**
+     * <p>Appends a type indicator for an option's argument to the given buffer.</p>
+     *
+     * <p>This implementation appends, in order:</p>
+     * <ul>
+     *     <li>{@code ' '}</li>
+     *     <li>{@code start}</li>
+     *     <li>the type indicator, if not {@code null}</li>
+     *     <li>if the description is present, then {@code ": "} plus the description if the type indicator is
+     *     present; otherwise the description only</li>
+     *     <li>{@code end}</li>
+     * </ul>
+     *
+     * @param buffer string buffer
+     * @param typeIndicator type indicator
+     * @param description type description
+     * @param start starting character
+     * @param end ending character
+     */
+    protected void appendTypeIndicator( StringBuilder buffer, String typeIndicator, String description,
+                                        char start, char end ) {
         buffer.append( ' ' ).append( start );
         if ( typeIndicator != null )
             buffer.append( typeIndicator );
@@ -262,21 +527,69 @@
         buffer.append( end );
     }
 
-    private String createDescriptionDisplay( OptionDescriptor descriptor ) {
+    /**
+     * <p>Gives a string representing a description of the option with the given descriptor.</p>
+     *
+     * <p>This implementation:</p>
+     * <ul>
+     *     <li>Asks for the descriptor's {@link OptionDescriptor#defaultValues()}</li>
+     *     <li>If they're not present, answers the descriptor's {@link OptionDescriptor#description()}.</li>
+     *     <li>If they are present, concatenates and returns:
+     *         <ul>
+     *             <li>the descriptor's {@link OptionDescriptor#description()}</li>
+     *             <li>{@code ' '}</li>
+     *             <li>{@code "default: "} plus the result of {@link #createDefaultValuesDisplay(java.util.List)},
+     *             surrounded by parentheses</li>
+     *         </ul>
+     *     </li>
+     * </ul>
+     *
+     * @param descriptor a descriptor for a configured option of a parser
+     * @return display text for the option's description
+     */
+    protected String createDescriptionDisplay( OptionDescriptor descriptor ) {
         List<?> defaultValues = descriptor.defaultValues();
         if ( defaultValues.isEmpty() )
             return descriptor.description();
 
         String defaultValuesDisplay = createDefaultValuesDisplay( defaultValues );
-        return ( descriptor.description() + ' ' + surround( "default: " + defaultValuesDisplay, '(', ')' ) ).trim();
+        return ( descriptor.description()
+            + ' '
+            + surround( message( "default.value.header" ) + ' ' + defaultValuesDisplay, '(', ')' )
+        ).trim();
     }
 
-    private String createDefaultValuesDisplay( List<?> defaultValues ) {
+    /**
+     * <p>Gives a display string for the default values of an option's argument.</p>
+     *
+     * <p>This implementation gives the {@link Object#toString()} of the first value if there is only one value,
+     * otherwise gives the {@link Object#toString()} of the whole list.</p>
+     *
+     * @param defaultValues some default values for a given option's argument
+     * @return a display string for those default values
+     */
+    protected String createDefaultValuesDisplay( List<?> defaultValues ) {
         return defaultValues.size() == 1 ? defaultValues.get( 0 ).toString() : defaultValues.toString();
     }
 
-    private void fitRowsToWidth() {
-        nonOptionRows.fitToWidth();
-        optionRows.fitToWidth();
+    /**
+     * <p>Looks up and gives a resource bundle message.</p>
+     *
+     * <p>This implementation looks in the bundle {@code "jdk.internal.joptsimple.HelpFormatterMessages"} in the default
+     * locale, using a key that is the concatenation of this class's fully qualified name, {@code '.'},
+     * and the given key suffix, formats the corresponding value using the given arguments, and returns
+     * the result.</p>
+     *
+     * @param keySuffix suffix to use when looking up the bundle message
+     * @param args arguments to fill in the message template with
+     * @return a formatted localized message
+     */
+    protected String message( String keySuffix, Object... args ) {
+        return Messages.message(
+            Locale.getDefault(),
+            "jdk.internal.joptsimple.HelpFormatterMessages",
+            BuiltinHelpFormatter.class,
+            keySuffix,
+            args );
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/ExceptionMessages.properties	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,44 @@
+#
+# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+jdk.internal.joptsimple.IllegalOptionSpecificationException.message = {0} is not a legal option character
+jdk.internal.joptsimple.MissingRequiredOptionsException.message = Missing required option(s) {0}
+jdk.internal.joptsimple.MultipleArgumentsForOptionException.message = Found multiple arguments for option {0}, but you asked for only one
+jdk.internal.joptsimple.OptionArgumentConversionException.message = Cannot parse argument ''{0}'' of option {1}
+jdk.internal.joptsimple.OptionMissingRequiredArgumentException.message = Option {0} requires an argument
+jdk.internal.joptsimple.UnavailableOptionException.message = Option(s) {0} are unavailable given other options on the command line
+jdk.internal.joptsimple.UnconfiguredOptionException.message = Option(s) {0} not configured on this parser
+jdk.internal.joptsimple.UnrecognizedOptionException.message = {0} is not a recognized option
+jdk.internal.joptsimple.util.DateConverter.without.pattern.message = Value [{0}] does not match date/time pattern
+jdk.internal.joptsimple.util.DateConverter.with.pattern.message = Value [{0}] does not match date/time pattern [{1}]
+jdk.internal.joptsimple.util.RegexMatcher.message = Value [{0}] did not match regex [{1}]
+jdk.internal.joptsimple.util.EnumConverter.message = Value [{0}] is not one of [{1}]
+jdk.internal.joptsimple.util.PathConverter.file.existing.message = File [{0}] does not exist
+jdk.internal.joptsimple.util.PathConverter.directory.existing.message = Directory [{0}] does not exist
+jdk.internal.joptsimple.util.PathConverter.file.not.existing.message = File [{0}] does already exist
+jdk.internal.joptsimple.util.PathConverter.file.overwritable.message = File [{0}] is not overwritable
+jdk.internal.joptsimple.util.PathConverter.file.readable.message = File [{0}] is not readable
+jdk.internal.joptsimple.util.PathConverter.file.writable.message = File [{0}] is not writable
+jdk.internal.joptsimple.util.InetAddressConverter.message = Cannot convert value [{0}] into an InetAddress
\ No newline at end of file
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/HelpFormatter.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/HelpFormatter.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/HelpFormatterMessages.properties	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,36 @@
+#
+# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+jdk.internal.joptsimple.BuiltinHelpFormatter.no.options.specified = No options specified
+jdk.internal.joptsimple.BuiltinHelpFormatter.non.option.arguments.header = Non-option arguments:
+jdk.internal.joptsimple.BuiltinHelpFormatter.option.header.with.required.indicator = Option (* = required)
+jdk.internal.joptsimple.BuiltinHelpFormatter.option.divider.with.required.indicator = ---------------------
+jdk.internal.joptsimple.BuiltinHelpFormatter.option.header = Option
+jdk.internal.joptsimple.BuiltinHelpFormatter.option.divider = ------
+jdk.internal.joptsimple.BuiltinHelpFormatter.description.header = Description
+jdk.internal.joptsimple.BuiltinHelpFormatter.description.divider = -----------
+jdk.internal.joptsimple.BuiltinHelpFormatter.default.value.header = default:
+jdk.internal.joptsimple.AlternativeLongOptionSpec.description = Alternative form of long options
+jdk.internal.joptsimple.AlternativeLongOptionSpec.arg.description = opt=value
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/IllegalOptionSpecificationException.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/IllegalOptionSpecificationException.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -70,7 +70,7 @@
     }
 
     @Override
-    public String getMessage() {
-        return singleOptionMessage() + " is not a legal option character";
+    Object[] messageArguments() {
+        return new Object[] { singleOptionString() };
     }
 }
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/MissingRequiredOptionException.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file:
- *
- * The MIT License
- *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-package jdk.internal.joptsimple;
-
-import java.util.Collection;
-
-/**
- * Thrown when an option is marked as required, but not specified on the command line.
- *
- * @author <a href="https://github.com/TC1">Emils Solmanis</a>
- */
-class MissingRequiredOptionException extends OptionException {
-    private static final long serialVersionUID = -1L;
-
-    protected MissingRequiredOptionException( Collection<String> options ) {
-        super( options );
-    }
-
-    @Override
-    public String getMessage() {
-        return "Missing required option(s) " + multipleOptionMessage();
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/MissingRequiredOptionsException.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * The MIT License
+ *
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+package jdk.internal.joptsimple;
+
+import java.util.List;
+
+/**
+ * Thrown when options marked as required are not specified on the command line.
+ *
+ * @author <a href="https://github.com/TC1">Emils Solmanis</a>
+ */
+class MissingRequiredOptionsException extends OptionException {
+    private static final long serialVersionUID = -1L;
+
+    protected MissingRequiredOptionsException( List<? extends OptionSpec<?>> missingRequiredOptions ) {
+        super( missingRequiredOptions );
+    }
+
+    @Override
+    Object[] messageArguments() {
+        return new Object[] { multipleOptionString() };
+    }
+}
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/MultipleArgumentsForOptionException.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/MultipleArgumentsForOptionException.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -55,7 +55,7 @@
 
 package jdk.internal.joptsimple;
 
-import java.util.Collection;
+import static java.util.Collections.*;
 
 /**
  * Thrown when asking an {@link OptionSet} for a single argument of an option when many have been specified.
@@ -65,12 +65,12 @@
 class MultipleArgumentsForOptionException extends OptionException {
     private static final long serialVersionUID = -1L;
 
-    MultipleArgumentsForOptionException( Collection<String> options ) {
-        super( options );
+    MultipleArgumentsForOptionException( OptionSpec<?> options ) {
+        super( singleton( options ) );
     }
 
     @Override
-    public String getMessage() {
-        return "Found multiple arguments for option " + multipleOptionMessage() + ", but you asked for only one";
+    Object[] messageArguments() {
+        return new Object[] { singleOptionString() };
     }
 }
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/NoArgumentOptionSpec.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/NoArgumentOptionSpec.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -55,7 +55,6 @@
 
 package jdk.internal.joptsimple;
 
-import java.util.Collection;
 import java.util.List;
 
 import static java.util.Collections.*;
@@ -70,7 +69,7 @@
         this( singletonList( option ), "" );
     }
 
-    NoArgumentOptionSpec( Collection<String> options, String description ) {
+    NoArgumentOptionSpec( List<String> options, String description ) {
         super( options, description );
     }
 
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/NonOptionArgumentSpec.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/NonOptionArgumentSpec.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -87,7 +87,7 @@
     private String argumentDescription = "";
 
     NonOptionArgumentSpec() {
-        this("");
+        this( "" );
     }
 
     NonOptionArgumentSpec( String description ) {
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionArgumentConversionException.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionArgumentConversionException.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -55,7 +55,7 @@
 
 package jdk.internal.joptsimple;
 
-import java.util.Collection;
+import static java.util.Collections.*;
 
 /**
  * Thrown when a problem occurs converting an argument of an option from {@link String} to another type.
@@ -67,14 +67,14 @@
 
     private final String argument;
 
-    OptionArgumentConversionException( Collection<String> options, String argument, Throwable cause ) {
-        super( options, cause );
+    OptionArgumentConversionException( OptionSpec<?> options, String argument, Throwable cause ) {
+        super( singleton( options ), cause );
 
         this.argument = argument;
     }
 
     @Override
-    public String getMessage() {
-        return "Cannot parse argument '" + argument + "' of option " + multipleOptionMessage();
+    Object[] messageArguments() {
+        return new Object[] { argument, singleOptionString() };
     }
 }
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionDeclarer.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionDeclarer.java	Mon Jun 11 09:29:44 2018 +0200
@@ -25,14 +25,20 @@
 
 package jdk.internal.joptsimple;
 
-import java.util.Collection;
+import java.util.List;
 
 /**
- * Trains the option parser. This interface aids integration with other code which may expose declaration of options but
- * not actual command-line parsing.
+ * Trains the option parser. This interface aids integration that disposes declaration of options but not actual
+ * command-line parsing.
+ *
+ * Typical use is for another class to implement {@code OptionDeclarer} as a facade, forwarding calls to an
+ * {@code OptionParser} instance.
+ *
+ * Note that although this is an interface, the returned values of calls are concrete jopt-simple classes.
  *
  * @author <a href="mailto:pholser@alumni.rice.edu">Paul Holser</a>
  * @see OptionParser
+ * @since 4.6
  */
 public interface OptionDeclarer {
     /**
@@ -78,12 +84,12 @@
      * @throws OptionException if any of the options contain illegal characters
      * @throws NullPointerException if the option list or any of its elements are {@code null}
      */
-    OptionSpecBuilder acceptsAll( Collection<String> options );
+    OptionSpecBuilder acceptsAll( List<String> options );
 
     /**
      * Tells the parser to recognize the given options, and treat them as synonymous.
      *
-     * @see #acceptsAll(Collection)
+     * @see #acceptsAll(List)
      * @param options the options to recognize and treat as synonymous
      * @param description a string that describes the purpose of the option.  This is used when generating help
      * information about the parser.
@@ -92,7 +98,7 @@
      * @throws NullPointerException if the option list or any of its elements are {@code null}
      * @throws IllegalArgumentException if the option list is empty
      */
-    OptionSpecBuilder acceptsAll( Collection<String> options, String description );
+    OptionSpecBuilder acceptsAll( List<String> options, String description );
 
     /**
      * Gives an object that represents an access point for non-option arguments on a command line.
@@ -127,7 +133,7 @@
     void allowsUnrecognizedOptions();
 
     /**
-     * Tells the parser either to recognize or ignore <kbd>"-W"</kbd>-style long options.
+     * Tells the parser either to recognize or ignore {@code -W}-style long options.
      *
      * @param recognize {@code true} if the parser is to recognize the special style of long options
      */
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionDescriptor.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionDescriptor.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -55,7 +55,6 @@
 
 package jdk.internal.joptsimple;
 
-import java.util.Collection;
 import java.util.List;
 
 /**
@@ -70,7 +69,7 @@
      *
      * @return synonymous options
      */
-    Collection<String> options();
+    List<String> options();
 
     /**
      * Description of this option's purpose.
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionException.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionException.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -58,11 +58,15 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
+import java.util.LinkedHashSet;
 import java.util.List;
+import java.util.Locale;
+import java.util.Set;
+
+import jdk.internal.joptsimple.internal.Strings;
 
 import static java.util.Collections.*;
-
-import static jdk.internal.joptsimple.internal.Strings.*;
+import static jdk.internal.joptsimple.internal.Messages.*;
 
 /**
  * Thrown when a problem occurs during option parsing.
@@ -72,16 +76,30 @@
 public abstract class OptionException extends RuntimeException {
     private static final long serialVersionUID = -1L;
 
-    private final List<String> options = new ArrayList<String>();
+    private final List<String> options = new ArrayList<>();
 
-    protected OptionException( Collection<String> options ) {
+    protected OptionException( List<String> options ) {
         this.options.addAll( options );
     }
 
-    protected OptionException( Collection<String> options, Throwable cause ) {
+    protected OptionException( Collection<? extends OptionSpec<?>> options ) {
+        this.options.addAll( specsToStrings( options ) );
+    }
+
+    protected OptionException( Collection<? extends OptionSpec<?>> options, Throwable cause ) {
         super( cause );
+        this.options.addAll( specsToStrings( options ) );
+    }
 
-        this.options.addAll( options );
+    private List<String> specsToStrings( Collection<? extends OptionSpec<?>> options ) {
+        List<String> strings = new ArrayList<>();
+        for ( OptionSpec<?> each : options )
+            strings.add( specToString( each ) );
+        return strings;
+    }
+
+    private String specToString( OptionSpec<?> option ) {
+        return Strings.join( new ArrayList<>( option.options() ), "/" );
     }
 
     /**
@@ -89,23 +107,24 @@
      *
      * @return the option being considered when the exception was created
      */
-    public Collection<String> options() {
-        return unmodifiableCollection( options );
+    public List<String> options() {
+        return unmodifiableList( options );
     }
 
-    protected final String singleOptionMessage() {
-        return singleOptionMessage( options.get( 0 ) );
+    protected final String singleOptionString() {
+        return singleOptionString( options.get( 0 ) );
     }
 
-    protected final String singleOptionMessage( String option ) {
-        return SINGLE_QUOTE + option + SINGLE_QUOTE;
+    protected final String singleOptionString( String option ) {
+        return option;
     }
 
-    protected final String multipleOptionMessage() {
+    protected final String multipleOptionString() {
         StringBuilder buffer = new StringBuilder( "[" );
 
-        for ( Iterator<String> iter = options.iterator(); iter.hasNext(); ) {
-            buffer.append( singleOptionMessage( iter.next() ) );
+        Set<String> asSet = new LinkedHashSet<String>( options );
+        for ( Iterator<String> iter = asSet.iterator(); iter.hasNext(); ) {
+            buffer.append( singleOptionString(iter.next()) );
             if ( iter.hasNext() )
                 buffer.append( ", " );
         }
@@ -118,4 +137,19 @@
     static OptionException unrecognizedOption( String option ) {
         return new UnrecognizedOptionException( option );
     }
+
+    @Override
+    public final String getMessage() {
+        return localizedMessage( Locale.getDefault() );
+    }
+
+    final String localizedMessage( Locale locale ) {
+        return formattedMessage( locale );
+    }
+
+    private String formattedMessage( Locale locale ) {
+        return message( locale, "jdk.internal.joptsimple.ExceptionMessages", getClass(), "message", messageArguments() );
+    }
+
+    abstract Object[] messageArguments();
 }
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionMissingRequiredArgumentException.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionMissingRequiredArgumentException.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -55,22 +55,22 @@
 
 package jdk.internal.joptsimple;
 
-import java.util.Collection;
+import static java.util.Arrays.*;
 
 /**
- * Thrown when the option parser discovers an option that requires an argument, but that argument is missing.
+ * Thrown when the option parser discovers options that require an argument, but are missing an argument.
  *
  * @author <a href="mailto:pholser@alumni.rice.edu">Paul Holser</a>
  */
 class OptionMissingRequiredArgumentException extends OptionException {
     private static final long serialVersionUID = -1L;
 
-    OptionMissingRequiredArgumentException( Collection<String> options ) {
-        super( options );
+    OptionMissingRequiredArgumentException( OptionSpec<?> option ) {
+        super( asList( option ) );
     }
 
     @Override
-    public String getMessage() {
-        return "Option " + multipleOptionMessage() + " requires an argument";
+    Object[] messageArguments() {
+        return new Object[] { singleOptionString() };
     }
 }
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionParser.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionParser.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -55,18 +55,16 @@
 
 package jdk.internal.joptsimple;
 
-import jdk.internal.joptsimple.internal.AbbreviationMap;
-import jdk.internal.joptsimple.util.KeyValuePair;
-
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 import java.io.Writer;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
+
+import jdk.internal.joptsimple.internal.AbbreviationMap;
+import jdk.internal.joptsimple.internal.SimpleOptionNameMap;
+import jdk.internal.joptsimple.internal.OptionNameMap;
+import jdk.internal.joptsimple.util.KeyValuePair;
 
 import static java.util.Collections.*;
 import static jdk.internal.joptsimple.OptionException.*;
@@ -80,57 +78,58 @@
  * <p>This parser supports short options and long options.</p>
  *
  * <ul>
- *   <li><dfn>Short options</dfn> begin with a single hyphen ("<kbd>-</kbd>") followed by a single letter or digit,
- *   or question mark ("<kbd>?</kbd>"), or dot ("<kbd>.</kbd>").</li>
+ *   <li><dfn>Short options</dfn> begin with a single hyphen ("{@code -}") followed by a single letter or digit,
+ *   or question mark ("{@code ?}"), or dot ("{@code .}"), or underscore ("{@code _}").</li>
  *
  *   <li>Short options can accept single arguments. The argument can be made required or optional. The option's
  *   argument can occur:
  *     <ul>
- *       <li>in the slot after the option, as in <kbd>-d /tmp</kbd></li>
- *       <li>right up against the option, as in <kbd>-d/tmp</kbd></li>
- *       <li>right up against the option separated by an equals sign (<kbd>"="</kbd>), as in <kbd>-d=/tmp</kbd></li>
+ *       <li>in the slot after the option, as in {@code -d /tmp}</li>
+ *       <li>right up against the option, as in {@code -d/tmp}</li>
+ *       <li>right up against the option separated by an equals sign ({@code "="}), as in {@code -d=/tmp}</li>
  *     </ul>
  *   To specify <em>n</em> arguments for an option, specify the option <em>n</em> times, once for each argument,
- *   as in <kbd>-d /tmp -d /var -d /opt</kbd>; or, when using the
+ *   as in {@code -d /tmp -d /var -d /opt}; or, when using the
  *   {@linkplain ArgumentAcceptingOptionSpec#withValuesSeparatedBy(char) "separated values"} clause of the "fluent
  *   interface" (see below), give multiple values separated by a given character as a single argument to the
  *   option.</li>
  *
- *   <li>Short options can be clustered, so that <kbd>-abc</kbd> is treated as <kbd>-a -b -c</kbd>. If a short option
+ *   <li>Short options can be clustered, so that {@code -abc} is treated as {@code -a -b -c}. If a short option
  *   in the cluster can accept an argument, the remaining characters are interpreted as the argument for that
  *   option.</li>
  *
- *   <li>An argument consisting only of two hyphens (<kbd>"--"</kbd>) signals that the remaining arguments are to be
+ *   <li>An argument consisting only of two hyphens ({@code "--"}) signals that the remaining arguments are to be
  *   treated as non-options.</li>
  *
  *   <li>An argument consisting only of a single hyphen is considered a non-option argument (though it can be an
  *   argument of an option). Many Unix programs treat single hyphens as stand-ins for the standard input or standard
  *   output streams.</li>
  *
- *   <li><dfn>Long options</dfn> begin with two hyphens (<kbd>"--"</kbd>), followed by multiple letters, digits,
+ *   <li><dfn>Long options</dfn> begin with two hyphens ({@code "--"}), followed by multiple letters, digits,
  *   hyphens, question marks, or dots. A hyphen cannot be the first character of a long option specification when
  *   configuring the parser.</li>
  *
- *   <li>You can abbreviate long options, so long as the abbreviation is unique.</li>
+ *   <li>You can abbreviate long options, so long as the abbreviation is unique. Suppress this behavior if
+ *   you wish using {@linkplain OptionParser#OptionParser(boolean) this constructor}.</li>
  *
  *   <li>Long options can accept single arguments.  The argument can be made required or optional.  The option's
  *   argument can occur:
  *     <ul>
- *       <li>in the slot after the option, as in <kbd>--directory /tmp</kbd></li>
- *       <li>right up against the option separated by an equals sign (<kbd>"="</kbd>), as in
- *       <kbd>--directory=/tmp</kbd>
+ *       <li>in the slot after the option, as in {@code --directory /tmp}</li>
+ *       <li>right up against the option separated by an equals sign ({@code "="}), as in
+ *       {@code --directory=/tmp}
  *     </ul>
  *   Specify multiple arguments for a long option in the same manner as for short options (see above).</li>
  *
- *   <li>You can use a single hyphen (<kbd>"-"</kbd>) instead of a double hyphen (<kbd>"--"</kbd>) for a long
+ *   <li>You can use a single hyphen ({@code "-"}) instead of a double hyphen ({@code "--"}) for a long
  *   option.</li>
  *
- *   <li>The option <kbd>-W</kbd> is reserved.  If you tell the parser to {@linkplain
+ *   <li>The option {@code -W} is reserved.  If you tell the parser to {@linkplain
  *   #recognizeAlternativeLongOptions(boolean) recognize alternative long options}, then it will treat, for example,
- *   <kbd>-W foo=bar</kbd> as the long option <kbd>foo</kbd> with argument <kbd>bar</kbd>, as though you had written
- *   <kbd>--foo=bar</kbd>.</li>
+ *   {@code -W foo=bar} as the long option {@code foo} with argument {@code bar}, as though you had written
+ *   {@code --foo=bar}.</li>
  *
- *   <li>You can specify <kbd>-W</kbd> as a valid short option, or use it as an abbreviation for a long option, but
+ *   <li>You can specify {@code -W} as a valid short option, or use it as an abbreviation for a long option, but
  *   {@linkplain #recognizeAlternativeLongOptions(boolean) recognizing alternative long options} will always supersede
  *   this behavior.</li>
  *
@@ -148,15 +147,15 @@
  *     parser.accepts( "2" );
  *     OptionSet options = parser.parse( "-a", "-2" );
  *   </code></pre>
- *   In this case, the option set contains <kbd>"a"</kbd> with argument <kbd>-2</kbd>, not both <kbd>"a"</kbd> and
- *   <kbd>"2"</kbd>. Swapping the elements in the <em>args</em> array gives the latter.</li>
+ *   In this case, the option set contains {@code "a"} with argument {@code -2}, not both {@code "a"} and
+ *   {@code "2"}. Swapping the elements in the <em>args</em> array gives the latter.</li>
  * </ul>
  *
  * <p>There are two ways to tell the parser what options to recognize:</p>
  *
  * <ol>
  *   <li>A "fluent interface"-style API for specifying options, available since version 2. Sentences in this fluent
- *   interface language begin with a call to {@link #accepts(String) accepts} or {@link #acceptsAll(Collection)
+ *   interface language begin with a call to {@link #accepts(String) accepts} or {@link #acceptsAll(List)
  *   acceptsAll} methods; calls on the ensuing chain of objects describe whether the options can take an argument,
  *   whether the argument is required or optional, to what type arguments of the options should be converted if any,
  *   etc. Since version 3, these calls return an instance of {@link OptionSpec}, which can subsequently be used to
@@ -169,28 +168,28 @@
  *     <ul>
  *       <li>Any letter or digit is treated as an option character.</li>
  *
- *       <li>An option character can be immediately followed by an asterisk (*) to indicate that the option is a
- *       "help" option.</li>
+ *       <li>An option character can be immediately followed by an asterisk ({@code *)} to indicate that
+ *       the option is a "help" option.</li>
  *
- *       <li>If an option character (with possible trailing asterisk) is followed by a single colon (<kbd>":"</kbd>),
+ *       <li>If an option character (with possible trailing asterisk) is followed by a single colon ({@code ":"}),
  *       then the option requires an argument.</li>
  *
- *       <li>If an option character (with possible trailing asterisk) is followed by two colons (<kbd>"::"</kbd>),
+ *       <li>If an option character (with possible trailing asterisk) is followed by two colons ({@code "::"}),
  *       then the option accepts an optional argument.</li>
  *
  *       <li>Otherwise, the option character accepts no argument.</li>
  *
- *       <li>If the option specification string begins with a plus sign (<kbd>"+"</kbd>), the parser will behave
+ *       <li>If the option specification string begins with a plus sign ({@code "+" }), the parser will behave
  *       "POSIX-ly correct".</li>
  *
- *       <li>If the option specification string contains the sequence <kbd>"W;"</kbd> (capital W followed by a
+ *       <li>If the option specification string contains the sequence {@code "W;"} (capital W followed by a
  *       semicolon), the parser will recognize the alternative form of long options.</li>
  *     </ul>
  *   </li>
  * </ol>
  *
- * <p>Each of the options in a list of options given to {@link #acceptsAll(Collection) acceptsAll} is treated as a
- * synonym of the others.  For example:
+ * <p>Each of the options in a list of options given to {@link #acceptsAll(List) acceptsAll} is treated as a
+ * synonym of the others.  For example:</p>
  *   <pre>
  *     <code>
  *     OptionParser parser = new OptionParser();
@@ -198,14 +197,14 @@
  *     OptionSet options = parser.parse( "-w" );
  *     </code>
  *   </pre>
- * In this case, <code>options.{@link OptionSet#has(String) has}</code> would answer {@code true} when given arguments
- * <kbd>"w"</kbd>, <kbd>"interactive"</kbd>, and <kbd>"confirmation"</kbd>. The {@link OptionSet} would give the same
+ * <p>In this case, <code>options.{@link OptionSet#has(String) has}</code> would answer {@code true} when given arguments
+ * {@code "w"}, {@code "interactive"}, and {@code "confirmation"}. The {@link OptionSet} would give the same
  * responses to these arguments for its other methods as well.</p>
  *
  * <p>By default, as with GNU {@code getopt()}, the parser allows intermixing of options and non-options. If, however,
  * the parser has been created to be "POSIX-ly correct", then the first argument that does not look lexically like an
  * option, and is not a required argument of a preceding option, signals the end of options. You can still bind
- * optional arguments to their options using the abutting (for short options) or <kbd>=</kbd> syntax.</p>
+ * optional arguments to their options using the abutting (for short options) or {@code =} syntax.</p>
  *
  * <p>Unlike GNU {@code getopt()}, this parser does not honor the environment variable {@code POSIXLY_CORRECT}.
  * "POSIX-ly correct" parsers are configured by either:</p>
@@ -214,16 +213,20 @@
  *   <li>using the method {@link #posixlyCorrect(boolean)}, or</li>
  *
  *   <li>using the {@linkplain #OptionParser(String) constructor} with an argument whose first character is a plus sign
- *   (<kbd>"+"</kbd>)</li>
+ *   ({@code "+"})</li>
  * </ol>
  *
  * @author <a href="mailto:pholser@alumni.rice.edu">Paul Holser</a>
  * @see <a href="http://www.gnu.org/software/libc/manual">The GNU C Library</a>
  */
 public class OptionParser implements OptionDeclarer {
-    private final AbbreviationMap<AbstractOptionSpec<?>> recognizedOptions;
-    private final Map<Collection<String>, Set<OptionSpec<?>>> requiredIf;
-    private final Map<Collection<String>, Set<OptionSpec<?>>> requiredUnless;
+    private final OptionNameMap<AbstractOptionSpec<?>> recognizedOptions;
+    private final ArrayList<AbstractOptionSpec<?>> trainingOrder;
+    private final Map<List<String>, Set<OptionSpec<?>>> requiredIf;
+    private final Map<List<String>, Set<OptionSpec<?>>> requiredUnless;
+    private final Map<List<String>, Set<OptionSpec<?>>> availableIf;
+    private final Map<List<String>, Set<OptionSpec<?>>> availableUnless;
+
     private OptionParserState state;
     private boolean posixlyCorrect;
     private boolean allowsUnrecognizedOptions;
@@ -234,11 +237,28 @@
      * behavior.
      */
     public OptionParser() {
-        recognizedOptions = new AbbreviationMap<AbstractOptionSpec<?>>();
-        requiredIf = new HashMap<Collection<String>, Set<OptionSpec<?>>>();
-        requiredUnless = new HashMap<Collection<String>, Set<OptionSpec<?>>>();
+        this(true);
+    }
+
+    /**
+     * Creates an option parser that initially recognizes no options, and does not exhibit "POSIX-ly correct"
+     * behavior.
+     *
+     * @param allowAbbreviations whether unambiguous abbreviations of long options should be recognized
+     * by the parser
+     */
+    public OptionParser( boolean allowAbbreviations ) {
+        trainingOrder = new ArrayList<>();
+        requiredIf = new HashMap<>();
+        requiredUnless = new HashMap<>();
+        availableIf = new HashMap<>();
+        availableUnless = new HashMap<>();
         state = moreOptions( false );
 
+        recognizedOptions = allowAbbreviations
+            ? new AbbreviationMap<AbstractOptionSpec<?>>()
+            : new SimpleOptionNameMap<AbstractOptionSpec<?>>();
+
         recognize( new NonOptionArgumentSpec<String>() );
     }
 
@@ -266,11 +286,11 @@
         return acceptsAll( singletonList( option ), description );
     }
 
-    public OptionSpecBuilder acceptsAll( Collection<String> options ) {
+    public OptionSpecBuilder acceptsAll( List<String> options ) {
         return acceptsAll( options, "" );
     }
 
-    public OptionSpecBuilder acceptsAll( Collection<String> options, String description ) {
+    public OptionSpecBuilder acceptsAll( List<String> options, String description ) {
         if ( options.isEmpty() )
             throw new IllegalArgumentException( "need at least one option" );
 
@@ -280,7 +300,7 @@
     }
 
     public NonOptionArgumentSpec<String> nonOptions() {
-        NonOptionArgumentSpec<String> spec = new NonOptionArgumentSpec<String>();
+        NonOptionArgumentSpec<String> spec = new NonOptionArgumentSpec<>();
 
         recognize( spec );
 
@@ -288,7 +308,7 @@
     }
 
     public NonOptionArgumentSpec<String> nonOptions( String description ) {
-        NonOptionArgumentSpec<String> spec = new NonOptionArgumentSpec<String>( description );
+        NonOptionArgumentSpec<String> spec = new NonOptionArgumentSpec<>( description );
 
         recognize( spec );
 
@@ -321,6 +341,7 @@
 
     void recognize( AbstractOptionSpec<?> spec ) {
         recognizedOptions.putAll( spec.options(), spec );
+        trainingOrder.add( spec );
     }
 
     /**
@@ -348,7 +369,7 @@
      * @see #printHelpOn(OutputStream)
      */
     public void printHelpOn( Writer sink ) throws IOException {
-        sink.write( helpFormatter.format( recognizedOptions.toJavaUtilMap() ) );
+        sink.write( helpFormatter.format( _recognizedOptions() ) );
         sink.flush();
     }
 
@@ -366,15 +387,29 @@
     }
 
     /**
-     * Retrieves all the options which have been configured for the parser.
+     * Retrieves all options-spec pairings which have been configured for the parser in the same order as declared
+     * during training. Option flags for specs are alphabetized by {@link OptionSpec#options()}; only the order of the
+     * specs is preserved.
      *
-     * @return a {@link Map} containing all the configured options and their corresponding {@link OptionSpec}
+     * (Note: prior to 4.7 the order was alphabetical across all options regardless of spec.)
+     *
+     * @return a map containing all the configured options and their corresponding {@link OptionSpec}
+     * @since 4.6
      */
     public Map<String, OptionSpec<?>> recognizedOptions() {
-        return new HashMap<String, OptionSpec<?>>( recognizedOptions.toJavaUtilMap() );
+        return new LinkedHashMap<String, OptionSpec<?>>( _recognizedOptions() );
     }
 
-    /**
+    private Map<String, AbstractOptionSpec<?>> _recognizedOptions() {
+        Map<String, AbstractOptionSpec<?>> options = new LinkedHashMap<>();
+        for ( AbstractOptionSpec<?> spec : trainingOrder ) {
+            for ( String option : spec.options() )
+                options.put( option, spec );
+        }
+        return options;
+    }
+
+   /**
      * Parses the given command line arguments according to the option specifications given to the parser.
      *
      * @param arguments arguments to parse
@@ -393,43 +428,87 @@
         reset();
 
         ensureRequiredOptions( detected );
+        ensureAllowedOptions( detected );
 
         return detected;
     }
 
+    /**
+     * Mandates mutual exclusiveness for the options built by the specified builders.
+     *
+     * @param specs descriptors for options that should be mutually exclusive on a command line.
+     * @throws NullPointerException if {@code specs} is {@code null}
+     */
+    public void mutuallyExclusive( OptionSpecBuilder... specs ) {
+        for ( int i = 0; i < specs.length; i++ ) {
+            for ( int j = 0; j < specs.length; j++ ) {
+                if ( i != j )
+                    specs[i].availableUnless( specs[j] );
+            }
+        }
+    }
+
     private void ensureRequiredOptions( OptionSet options ) {
-        Collection<String> missingRequiredOptions = missingRequiredOptions( options );
+        List<AbstractOptionSpec<?>> missingRequiredOptions = missingRequiredOptions(options);
         boolean helpOptionPresent = isHelpOptionPresent( options );
 
         if ( !missingRequiredOptions.isEmpty() && !helpOptionPresent )
-            throw new MissingRequiredOptionException( missingRequiredOptions );
+            throw new MissingRequiredOptionsException( missingRequiredOptions );
     }
 
-    private Collection<String> missingRequiredOptions( OptionSet options ) {
-        Collection<String> missingRequiredOptions = new HashSet<String>();
+    private void ensureAllowedOptions( OptionSet options ) {
+        List<AbstractOptionSpec<?>> forbiddenOptions = unavailableOptions( options );
+        boolean helpOptionPresent = isHelpOptionPresent( options );
+
+        if ( !forbiddenOptions.isEmpty() && !helpOptionPresent )
+            throw new UnavailableOptionException( forbiddenOptions );
+    }
+
+    private List<AbstractOptionSpec<?>> missingRequiredOptions( OptionSet options ) {
+        List<AbstractOptionSpec<?>> missingRequiredOptions = new ArrayList<>();
 
         for ( AbstractOptionSpec<?> each : recognizedOptions.toJavaUtilMap().values() ) {
             if ( each.isRequired() && !options.has( each ) )
-                missingRequiredOptions.addAll( each.options() );
+                missingRequiredOptions.add(each);
+        }
+
+        for ( Map.Entry<List<String>, Set<OptionSpec<?>>> each : requiredIf.entrySet() ) {
+            AbstractOptionSpec<?> required = specFor( each.getKey().iterator().next() );
+
+            if ( optionsHasAnyOf( options, each.getValue() ) && !options.has( required ) )
+                missingRequiredOptions.add( required );
         }
 
-        for ( Map.Entry<Collection<String>, Set<OptionSpec<?>>> eachEntry : requiredIf.entrySet() ) {
-            AbstractOptionSpec<?> required = specFor( eachEntry.getKey().iterator().next() );
+        for ( Map.Entry<List<String>, Set<OptionSpec<?>>> each : requiredUnless.entrySet() ) {
+            AbstractOptionSpec<?> required = specFor(each.getKey().iterator().next());
+
+            if ( !optionsHasAnyOf( options, each.getValue() ) && !options.has( required ) )
+                missingRequiredOptions.add( required );
+        }
 
-            if ( optionsHasAnyOf( options, eachEntry.getValue() ) && !options.has( required ) ) {
-                missingRequiredOptions.addAll( required.options() );
+        return missingRequiredOptions;
+    }
+
+    private List<AbstractOptionSpec<?>> unavailableOptions(OptionSet options) {
+        List<AbstractOptionSpec<?>> unavailableOptions = new ArrayList<>();
+
+        for ( Map.Entry<List<String>, Set<OptionSpec<?>>> eachEntry : availableIf.entrySet() ) {
+            AbstractOptionSpec<?> forbidden = specFor( eachEntry.getKey().iterator().next() );
+
+            if ( !optionsHasAnyOf( options, eachEntry.getValue() ) && options.has( forbidden ) ) {
+                unavailableOptions.add(forbidden);
             }
         }
 
-        for ( Map.Entry<Collection<String>, Set<OptionSpec<?>>> eachEntry : requiredUnless.entrySet() ) {
-            AbstractOptionSpec<?> required = specFor( eachEntry.getKey().iterator().next() );
+        for ( Map.Entry<List<String>, Set<OptionSpec<?>>> eachEntry : availableUnless.entrySet() ) {
+            AbstractOptionSpec<?> forbidden = specFor( eachEntry.getKey().iterator().next() );
 
-            if ( !optionsHasAnyOf( options, eachEntry.getValue() ) && !options.has( required ) ) {
-                missingRequiredOptions.addAll( required.options() );
+            if ( optionsHasAnyOf( options, eachEntry.getValue() ) && options.has( forbidden ) ) {
+                unavailableOptions.add(forbidden);
             }
         }
 
-        return missingRequiredOptions;
+        return unavailableOptions;
     }
 
     private boolean optionsHasAnyOf( OptionSet options, Collection<OptionSpec<?>> specs ) {
@@ -443,12 +522,14 @@
 
     private boolean isHelpOptionPresent( OptionSet options ) {
         boolean helpOptionPresent = false;
+
         for ( AbstractOptionSpec<?> each : recognizedOptions.toJavaUtilMap().values() ) {
             if ( each.isForHelp() && options.has( each ) ) {
                 helpOptionPresent = true;
                 break;
             }
         }
+
         return helpOptionPresent;
     }
 
@@ -505,24 +586,40 @@
         return recognizedOptions.contains( option );
     }
 
-    void requiredIf( Collection<String> precedentSynonyms, String required ) {
+    void requiredIf( List<String> precedentSynonyms, String required ) {
         requiredIf( precedentSynonyms, specFor( required ) );
     }
 
-    void requiredIf( Collection<String> precedentSynonyms, OptionSpec<?> required ) {
-        putRequiredOption( precedentSynonyms, required, requiredIf );
+    void requiredIf( List<String> precedentSynonyms, OptionSpec<?> required ) {
+        putDependentOption( precedentSynonyms, required, requiredIf );
     }
 
-    void requiredUnless( Collection<String> precedentSynonyms, String required ) {
+    void requiredUnless( List<String> precedentSynonyms, String required ) {
         requiredUnless( precedentSynonyms, specFor( required ) );
     }
 
-    void requiredUnless( Collection<String> precedentSynonyms, OptionSpec<?> required ) {
-        putRequiredOption( precedentSynonyms, required, requiredUnless );
+    void requiredUnless( List<String> precedentSynonyms, OptionSpec<?> required ) {
+        putDependentOption( precedentSynonyms, required, requiredUnless );
+    }
+
+    void availableIf( List<String> precedentSynonyms, String available ) {
+        availableIf( precedentSynonyms, specFor( available ) );
     }
 
-    private void putRequiredOption( Collection<String> precedentSynonyms, OptionSpec<?> required,
-        Map<Collection<String>, Set<OptionSpec<?>>> target ) {
+    void availableIf( List<String> precedentSynonyms, OptionSpec<?> available) {
+        putDependentOption( precedentSynonyms, available, availableIf );
+    }
+
+    void availableUnless( List<String> precedentSynonyms, String available ) {
+        availableUnless( precedentSynonyms, specFor( available ) );
+    }
+
+    void availableUnless( List<String> precedentSynonyms, OptionSpec<?> available ) {
+        putDependentOption( precedentSynonyms, available, availableUnless );
+    }
+
+    private void putDependentOption( List<String> precedentSynonyms, OptionSpec<?> required,
+        Map<List<String>, Set<OptionSpec<?>>> target ) {
 
         for ( String each : precedentSynonyms ) {
             AbstractOptionSpec<?> spec = specFor( each );
@@ -532,7 +629,7 @@
 
         Set<OptionSpec<?>> associated = target.get( precedentSynonyms );
         if ( associated == null ) {
-            associated = new HashSet<OptionSpec<?>>();
+            associated = new HashSet<>();
             target.put( precedentSynonyms, associated );
         }
 
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionParserState.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionParserState.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionSet.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionSet.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -55,11 +55,14 @@
 
 package jdk.internal.joptsimple;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.IdentityHashMap;
+import java.util.List;
+import java.util.Map;
 
 import static java.util.Collections.*;
-
-import static jdk.internal.joptsimple.internal.Objects.*;
+import static java.util.Objects.*;
 
 /**
  * Representation of a group of detected command line options, their arguments, and non-option arguments.
@@ -77,9 +80,9 @@
      * Package-private because clients don't create these.
      */
     OptionSet( Map<String, AbstractOptionSpec<?>> recognizedSpecs ) {
-        detectedSpecs = new ArrayList<OptionSpec<?>>();
-        detectedOptions = new HashMap<String, AbstractOptionSpec<?>>();
-        optionsToArguments = new IdentityHashMap<AbstractOptionSpec<?>, List<String>>();
+        detectedSpecs = new ArrayList<>();
+        detectedOptions = new HashMap<>();
+        optionsToArguments = new IdentityHashMap<>();
         defaultValues = defaultValues( recognizedSpecs );
         this.recognizedSpecs = recognizedSpecs;
     }
@@ -90,7 +93,7 @@
      * @return {@code true} if any options were detected
      */
     public boolean hasOptions() {
-        return !detectedOptions.isEmpty();
+        return !( detectedOptions.size() == 1 && detectedOptions.values().iterator().next().representsNonOptions() );
     }
 
     /**
@@ -148,7 +151,7 @@
      * @see #hasArgument(String)
      */
     public boolean hasArgument( OptionSpec<?> option ) {
-        ensureNotNull( option );
+        requireNonNull( option );
 
         List<String> values = optionsToArguments.get( option );
         return values != null && !values.isEmpty();
@@ -169,7 +172,7 @@
      * @throws OptionException if more than one argument was detected for the option
      */
     public Object valueOf( String option ) {
-        ensureNotNull( option );
+        requireNonNull( option );
 
         AbstractOptionSpec<?> spec = detectedOptions.get( option );
         if ( spec == null ) {
@@ -194,7 +197,7 @@
      * @throws ClassCastException if the arguments of this option are not of the expected type
      */
     public <V> V valueOf( OptionSpec<V> option ) {
-        ensureNotNull( option );
+        requireNonNull( option );
 
         List<V> values = valuesOf( option );
         switch ( values.size() ) {
@@ -203,7 +206,7 @@
             case 1:
                 return values.get( 0 );
             default:
-                throw new MultipleArgumentsForOptionException( option.options() );
+                throw new MultipleArgumentsForOptionException( option );
         }
     }
 
@@ -217,7 +220,7 @@
      * @throws NullPointerException if {@code option} is {@code null}
      */
     public List<?> valuesOf( String option ) {
-        ensureNotNull( option );
+        requireNonNull( option );
 
         AbstractOptionSpec<?> spec = detectedOptions.get( option );
         return spec == null ? defaultValuesFor( option ) : valuesOf( spec );
@@ -238,14 +241,14 @@
      * example, if the type does not implement a correct conversion constructor or method
      */
     public <V> List<V> valuesOf( OptionSpec<V> option ) {
-        ensureNotNull( option );
+        requireNonNull( option );
 
         List<String> values = optionsToArguments.get( option );
         if ( values == null || values.isEmpty() )
             return defaultValueFor( option );
 
         AbstractOptionSpec<V> spec = (AbstractOptionSpec<V>) option;
-        List<V> convertedValues = new ArrayList<V>();
+        List<V> convertedValues = new ArrayList<>();
         for ( String each : values )
             convertedValues.add( spec.convert( each ) );
 
@@ -260,7 +263,7 @@
      */
     public List<OptionSpec<?>> specs() {
         List<OptionSpec<?>> specs = detectedSpecs;
-        specs.remove( detectedOptions.get( NonOptionArgumentSpec.NAME ) );
+        specs.removeAll( singletonList( detectedOptions.get( NonOptionArgumentSpec.NAME ) ) );
 
         return unmodifiableList( specs );
     }
@@ -271,10 +274,13 @@
      * @return the declared options as a map
      */
     public Map<OptionSpec<?>, List<?>> asMap() {
-        Map<OptionSpec<?>, List<?>> map = new HashMap<OptionSpec<?>, List<?>>();
-        for ( AbstractOptionSpec<?> spec : recognizedSpecs.values() )
+        Map<OptionSpec<?>, List<?>> map = new HashMap<>();
+
+        for ( AbstractOptionSpec<?> spec : recognizedSpecs.values() ) {
             if ( !spec.representsNonOptions() )
                 map.put( spec, valuesOf( spec ) );
+        }
+
         return unmodifiableMap( map );
     }
 
@@ -282,7 +288,8 @@
      * @return the detected non-option arguments
      */
     public List<?> nonOptionArguments() {
-        return unmodifiableList( valuesOf( detectedOptions.get( NonOptionArgumentSpec.NAME ) ) );
+        AbstractOptionSpec<?> spec = detectedOptions.get( NonOptionArgumentSpec.NAME );
+        return valuesOf( spec );
     }
 
     void add( AbstractOptionSpec<?> spec ) {
@@ -298,7 +305,7 @@
         List<String> optionArguments = optionsToArguments.get( spec );
 
         if ( optionArguments == null ) {
-            optionArguments = new ArrayList<String>();
+            optionArguments = new ArrayList<>();
             optionsToArguments.put( spec, optionArguments );
         }
 
@@ -315,25 +322,22 @@
             return false;
 
         OptionSet other = (OptionSet) that;
-        Map<AbstractOptionSpec<?>, List<String>> thisOptionsToArguments =
-            new HashMap<AbstractOptionSpec<?>, List<String>>( optionsToArguments );
-        Map<AbstractOptionSpec<?>, List<String>> otherOptionsToArguments =
-            new HashMap<AbstractOptionSpec<?>, List<String>>( other.optionsToArguments );
+        Map<AbstractOptionSpec<?>, List<String>> thisOptionsToArguments = new HashMap<>( optionsToArguments );
+        Map<AbstractOptionSpec<?>, List<String>> otherOptionsToArguments = new HashMap<>( other.optionsToArguments );
         return detectedOptions.equals( other.detectedOptions )
             && thisOptionsToArguments.equals( otherOptionsToArguments );
     }
 
     @Override
     public int hashCode() {
-        Map<AbstractOptionSpec<?>, List<String>> thisOptionsToArguments =
-            new HashMap<AbstractOptionSpec<?>, List<String>>( optionsToArguments );
+        Map<AbstractOptionSpec<?>, List<String>> thisOptionsToArguments = new HashMap<>( optionsToArguments );
         return detectedOptions.hashCode() ^ thisOptionsToArguments.hashCode();
     }
 
     @SuppressWarnings( "unchecked" )
     private <V> List<V> defaultValuesFor( String option ) {
         if ( defaultValues.containsKey( option ) )
-            return (List<V>) defaultValues.get( option );
+            return unmodifiableList( (List<V>) defaultValues.get( option ) );
 
         return emptyList();
     }
@@ -343,7 +347,7 @@
     }
 
     private static Map<String, List<?>> defaultValues( Map<String, AbstractOptionSpec<?>> recognizedSpecs ) {
-        Map<String, List<?>> defaults = new HashMap<String, List<?>>();
+        Map<String, List<?>> defaults = new HashMap<>();
         for ( Map.Entry<String, AbstractOptionSpec<?>> each : recognizedSpecs.entrySet() )
             defaults.put( each.getKey(), each.getValue().defaultValues() );
         return defaults;
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionSpec.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionSpec.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -55,7 +55,6 @@
 
 package jdk.internal.joptsimple;
 
-import java.util.Collection;
 import java.util.List;
 
 /**
@@ -116,7 +115,7 @@
     /**
      * @return the string representations of this option
      */
-    Collection<String> options();
+    List<String> options();
 
     /**
      * Tells whether this option is designated as a "help" option. The presence of a "help" option on a command line
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionSpecBuilder.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionSpecBuilder.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -56,7 +56,6 @@
 package jdk.internal.joptsimple;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 
@@ -90,7 +89,7 @@
 public class OptionSpecBuilder extends NoArgumentOptionSpec {
     private final OptionParser parser;
 
-    OptionSpecBuilder( OptionParser parser, Collection<String> options, String description ) {
+    OptionSpecBuilder( OptionParser parser, List<String> options, String description ) {
         super( options, description );
 
         this.parser = parser;
@@ -107,8 +106,7 @@
      * @return a specification for the option
      */
     public ArgumentAcceptingOptionSpec<String> withRequiredArg() {
-        ArgumentAcceptingOptionSpec<String> newSpec =
-            new RequiredArgumentOptionSpec<String>( options(), description() );
+        ArgumentAcceptingOptionSpec<String> newSpec = new RequiredArgumentOptionSpec<>( options(), description() );
         parser.recognize( newSpec );
 
         return newSpec;
@@ -121,7 +119,7 @@
      */
     public ArgumentAcceptingOptionSpec<String> withOptionalArg() {
         ArgumentAcceptingOptionSpec<String> newSpec =
-            new OptionalArgumentOptionSpec<String>( options(), description() );
+            new OptionalArgumentOptionSpec<>( options(), description() );
         parser.recognize( newSpec );
 
         return newSpec;
@@ -141,9 +139,8 @@
      */
     public OptionSpecBuilder requiredIf( String dependent, String... otherDependents ) {
         List<String> dependents = validatedDependents( dependent, otherDependents );
-        for ( String each : dependents ) {
+        for ( String each : dependents )
             parser.requiredIf( options(), each );
-        }
 
         return this;
     }
@@ -210,8 +207,91 @@
         return this;
     }
 
+    /**
+     * <p>Informs an option parser that this builder's option is allowed if the given option is present on the command
+     * line.</p>
+     *
+     * <p>For a given option, you <em>should not</em> mix this with {@link #availableUnless(String, String...)
+     * availableUnless} to avoid conflicts.</p>
+     *
+     * @param dependent an option whose presence on a command line makes this builder's option allowed
+     * @param otherDependents other options whose presence on a command line makes this builder's option allowed
+     * @return self, so that the caller can add clauses to the fluent interface sentence
+     * @throws OptionException if any of the dependent options haven't been configured in the parser yet
+     */
+    public OptionSpecBuilder availableIf( String dependent, String... otherDependents ) {
+        List<String> dependents = validatedDependents( dependent, otherDependents );
+        for ( String each : dependents )
+            parser.availableIf( options(), each );
+
+        return this;
+    }
+
+    /**
+     * <p>Informs an option parser that this builder's option is allowed if the given option is present on the command
+     * line.</p>
+     *
+     * <p>For a given option, you <em>should not</em> mix this with {@link #availableUnless(OptionSpec, OptionSpec[])
+     * requiredUnless} to avoid conflicts.</p>
+     *
+     * <p>This method recognizes only instances of options returned from the fluent interface methods.</p>
+     *
+     * @param dependent the option whose presence on a command line makes this builder's option allowed
+     * @param otherDependents other options whose presence on a command line makes this builder's option allowed
+     * @return self, so that the caller can add clauses to the fluent interface sentence
+     */
+    public OptionSpecBuilder availableIf( OptionSpec<?> dependent, OptionSpec<?>... otherDependents ) {
+        parser.availableIf( options(), dependent );
+
+        for ( OptionSpec<?> each : otherDependents )
+            parser.availableIf( options(), each );
+
+        return this;
+    }
+
+    /**
+     * <p>Informs an option parser that this builder's option is allowed if the given option is absent on the command
+     * line.</p>
+     *
+     * <p>For a given option, you <em>should not</em> mix this with {@link #availableIf(OptionSpec, OptionSpec[])
+     * requiredIf} to avoid conflicts.</p>
+     *
+     * @param dependent an option whose absence on a command line makes this builder's option allowed
+     * @param otherDependents other options whose absence on a command line makes this builder's option allowed
+     * @return self, so that the caller can add clauses to the fluent interface sentence
+     * @throws OptionException if any of the dependent options haven't been configured in the parser yet
+     */
+    public OptionSpecBuilder availableUnless( String dependent, String... otherDependents ) {
+        List<String> dependents = validatedDependents( dependent, otherDependents );
+        for ( String each : dependents )
+            parser.availableUnless( options(), each );
+
+        return this;
+    }
+
+    /**
+     * <p>Informs an option parser that this builder's option is allowed if the given option is absent on the command
+     * line.</p>
+     *
+     * <p>For a given option, you <em>should not</em> mix this with {@link #availableIf(OptionSpec, OptionSpec[])
+     * requiredIf} to avoid conflicts.</p>
+     *
+     * <p>This method recognizes only instances of options returned from the fluent interface methods.</p>
+     *
+     * @param dependent the option whose absence on a command line makes this builder's option allowed
+     * @param otherDependents other options whose absence on a command line makes this builder's option allowed
+     * @return self, so that the caller can add clauses to the fluent interface sentence
+     */
+    public OptionSpecBuilder availableUnless( OptionSpec<?> dependent, OptionSpec<?>... otherDependents ) {
+        parser.availableUnless( options(), dependent );
+        for ( OptionSpec<?> each : otherDependents )
+            parser.availableUnless(options(), each);
+
+        return this;
+    }
+
     private List<String> validatedDependents( String dependent, String... otherDependents ) {
-        List<String> dependents = new ArrayList<String>();
+        List<String> dependents = new ArrayList<>();
         dependents.add( dependent );
         Collections.addAll( dependents, otherDependents );
 
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionSpecTokenizer.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionSpecTokenizer.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionalArgumentOptionSpec.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionalArgumentOptionSpec.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -55,7 +55,7 @@
 
 package jdk.internal.joptsimple;
 
-import java.util.Collection;
+import java.util.List;
 
 /**
  * Specification of an option that accepts an optional argument.
@@ -68,7 +68,7 @@
         super( option, false );
     }
 
-    OptionalArgumentOptionSpec( Collection<String> options, String description ) {
+    OptionalArgumentOptionSpec( List<String> options, String description ) {
         super( options, false, description );
     }
 
@@ -77,7 +77,7 @@
         if ( arguments.hasMore() ) {
             String nextArgument = arguments.peek();
 
-            if ( !parser.looksLikeAnOption( nextArgument ) )
+            if ( !parser.looksLikeAnOption( nextArgument ) && canConvertArgument( nextArgument ) )
                 handleOptionArgument( parser, detectedOptions, arguments );
             else if ( isArgumentOfNumberType() && canConvertArgument( nextArgument ) )
                 addArguments( detectedOptions, arguments.next() );
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/ParserRules.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/ParserRules.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -55,7 +55,7 @@
 
 package jdk.internal.joptsimple;
 
-import java.util.Collection;
+import java.util.List;
 
 import static java.lang.Character.*;
 
@@ -97,7 +97,7 @@
             ensureLegalOptionCharacter( option.charAt( i ) );
     }
 
-    static void ensureLegalOptions( Collection<String> options ) {
+    static void ensureLegalOptions( List<String> options ) {
         for ( String each : options )
             ensureLegalOption( each );
     }
@@ -108,7 +108,7 @@
     }
 
     private static boolean isAllowedPunctuation( char option ) {
-        String allowedPunctuation = "?." + HYPHEN_CHAR;
+        String allowedPunctuation = "?._" + HYPHEN_CHAR;
         return allowedPunctuation.indexOf( option ) != -1;
     }
 }
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/README	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/README	Mon Jun 11 09:29:44 2018 +0200
@@ -1,3 +1,3 @@
-JOpt Simple, Version 4.6
+JOpt Simple, Version 5.0.4
 https://pholser.github.io/jopt-simple/
 
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/RequiredArgumentOptionSpec.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/RequiredArgumentOptionSpec.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -55,7 +55,7 @@
 
 package jdk.internal.joptsimple;
 
-import java.util.Collection;
+import java.util.List;
 
 /**
  * Specification of an option that accepts a required argument.
@@ -68,14 +68,14 @@
         super( option, true );
     }
 
-    RequiredArgumentOptionSpec( Collection<String> options, String description ) {
+    RequiredArgumentOptionSpec( List<String> options, String description ) {
         super( options, true, description );
     }
 
     @Override
     protected void detectOptionArgument( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions ) {
         if ( !arguments.hasMore() )
-            throw new OptionMissingRequiredArgumentException( options() );
+            throw new OptionMissingRequiredArgumentException( this );
 
         addArguments( detectedOptions, arguments.next() );
     }
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/UnacceptableNumberOfNonOptionsException.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file:
- *
- * The MIT License
- *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-package jdk.internal.joptsimple;
-
-import static java.util.Collections.*;
-
-/**
- * Thrown when the option parser detects an unacceptable number of {@code linkplain NonOptionArgumentSpec
- * non-option arguments}.
- *
- * @author <a href="mailto:pholser@alumni.rice.edu">Paul Holser</a>
- */
-class UnacceptableNumberOfNonOptionsException extends OptionException {
-    private static final long serialVersionUID = -1L;
-    private final int minimum;
-    private final int maximum;
-    private final int actual;
-
-    UnacceptableNumberOfNonOptionsException( int minimum, int maximum, int actual ) {
-        super( singletonList( NonOptionArgumentSpec.NAME ) );
-
-        this.minimum = minimum;
-        this.maximum = maximum;
-        this.actual = actual;
-    }
-
-    @Override
-    public String getMessage() {
-        return String.format( "actual = %d, minimum = %d, maximum = %d", actual, minimum, maximum );
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/UnavailableOptionException.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * The MIT License
+ *
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+package jdk.internal.joptsimple;
+
+import java.util.List;
+
+/**
+ * Thrown when options marked as allowed are specified on the command line, but the options they depend upon are
+ * present/not present.
+ */
+class UnavailableOptionException extends OptionException {
+    private static final long serialVersionUID = -1L;
+
+    UnavailableOptionException( List<? extends OptionSpec<?>> forbiddenOptions ) {
+        super( forbiddenOptions );
+    }
+
+    @Override
+    Object[] messageArguments() {
+        return new Object[] { multipleOptionString() };
+    }
+}
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/UnconfiguredOptionException.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/UnconfiguredOptionException.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -55,7 +55,7 @@
 
 package jdk.internal.joptsimple;
 
-import java.util.Collection;
+import java.util.List;
 
 import static java.util.Collections.*;
 
@@ -71,12 +71,12 @@
         this( singletonList( option ) );
     }
 
-    UnconfiguredOptionException( Collection<String> options ) {
+    UnconfiguredOptionException( List<String> options ) {
         super( options );
     }
 
     @Override
-    public String getMessage() {
-        return "Option " + multipleOptionMessage() + " has not been configured on this parser";
+    Object[] messageArguments() {
+        return new Object[] { multipleOptionString() };
     }
 }
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/UnrecognizedOptionException.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/UnrecognizedOptionException.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -70,7 +70,7 @@
     }
 
     @Override
-    public String getMessage() {
-        return singleOptionMessage() + " is not a recognized option";
+    Object[] messageArguments() {
+        return new Object[] { singleOptionString() };
     }
 }
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/ValueConversionException.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/ValueConversionException.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/ValueConverter.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/ValueConverter.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -76,7 +76,7 @@
      *
      * @return the target class for conversion
      */
-    Class<V> valueType();
+    Class<? extends V> valueType();
 
     /**
      * Gives a string that describes the pattern of the values this converter expects, if any.  For example, a date
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/AbbreviationMap.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/AbbreviationMap.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -84,37 +84,41 @@
  *
  * @param <V> a constraint on the types of the values in the map
  * @author <a href="mailto:pholser@alumni.rice.edu">Paul Holser</a>
- * @see <a href="http://www.perldoc.com/perl5.8.0/lib/Text/Abbrev.html">Perl's Text::Abbrev module</a>
+ * @see <a href="http://perldoc.perl.org/Text/Abbrev.html">Perl's Text::Abbrev module</a>
+ * @see <a href="https://en.wikipedia.org/wiki/Radix_tree">Radix tree</a>
  */
-public class AbbreviationMap<V> {
+public class AbbreviationMap<V> implements OptionNameMap<V> {
+    private final Map<Character, AbbreviationMap<V>> children = new TreeMap<>();
+
     private String key;
     private V value;
-    private final Map<Character, AbbreviationMap<V>> children = new TreeMap<Character, AbbreviationMap<V>>();
     private int keysBeyond;
 
     /**
      * <p>Tells whether the given key is in the map, or whether the given key is a unique
      * abbreviation of a key that is in the map.</p>
      *
-     * @param aKey key to look up
+     * @param key key to look up
      * @return {@code true} if {@code key} is present in the map
      * @throws NullPointerException if {@code key} is {@code null}
      */
-    public boolean contains( String aKey ) {
-        return get( aKey ) != null;
+    @Override
+    public boolean contains(String key) {
+        return get(key) != null;
     }
 
     /**
      * <p>Answers the value associated with the given key.  The key can be a unique
      * abbreviation of a key that is in the map. </p>
      *
-     * @param aKey key to look up
+     * @param key key to look up
      * @return the value associated with {@code aKey}; or {@code null} if there is no
      * such value or {@code aKey} is not a unique abbreviation of a key in the map
      * @throws NullPointerException if {@code aKey} is {@code null}
      */
-    public V get( String aKey ) {
-        char[] chars = charsOf( aKey );
+    @Override
+    public V get( String key ) {
+        char[] chars = charsOf( key );
 
         AbbreviationMap<V> child = this;
         for ( char each : chars ) {
@@ -130,18 +134,19 @@
      * <p>Associates a given value with a given key.  If there was a previous
      * association, the old value is replaced with the new one.</p>
      *
-     * @param aKey key to create in the map
+     * @param key key to create in the map
      * @param newValue value to associate with the key
      * @throws NullPointerException if {@code aKey} or {@code newValue} is {@code null}
      * @throws IllegalArgumentException if {@code aKey} is a zero-length string
      */
-    public void put( String aKey, V newValue ) {
+    @Override
+    public void put( String key, V newValue ) {
         if ( newValue == null )
             throw new NullPointerException();
-        if ( aKey.length() == 0 )
+        if ( key.length() == 0 )
             throw new IllegalArgumentException();
 
-        char[] chars = charsOf( aKey );
+        char[] chars = charsOf(key);
         add( chars, newValue, 0, chars.length );
     }
 
@@ -154,6 +159,7 @@
      * @throws NullPointerException if {@code keys} or {@code newValue} is {@code null}
      * @throws IllegalArgumentException if any of {@code keys} is a zero-length string
      */
+    @Override
     public void putAll( Iterable<String> keys, V newValue ) {
         for ( String each : keys )
             put( each, newValue );
@@ -170,7 +176,7 @@
         char nextChar = chars[ offset ];
         AbbreviationMap<V> child = children.get( nextChar );
         if ( child == null ) {
-            child = new AbbreviationMap<V>();
+            child = new AbbreviationMap<>();
             children.put( nextChar, child );
         }
 
@@ -188,15 +194,16 @@
     /**
      * <p>If the map contains the given key, dissociates the key from its value.</p>
      *
-     * @param aKey key to remove
+     * @param key key to remove
      * @throws NullPointerException if {@code aKey} is {@code null}
      * @throws IllegalArgumentException if {@code aKey} is a zero-length string
      */
-    public void remove( String aKey ) {
-        if ( aKey.length() == 0 )
+    @Override
+    public void remove( String key ) {
+        if ( key.length() == 0 )
             throw new IllegalArgumentException();
 
-        char[] keyChars = charsOf( aKey );
+        char[] keyChars = charsOf(key);
         remove( keyChars, 0, keyChars.length );
     }
 
@@ -242,8 +249,9 @@
      *
      * @return a Java map corresponding to this abbreviation map
      */
+    @Override
     public Map<String, V> toJavaUtilMap() {
-        Map<String, V> mappings = new TreeMap<String, V>();
+        Map<String, V> mappings = new TreeMap<>();
         addToMappings( mappings );
         return mappings;
     }
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/Classes.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/Classes.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -62,7 +62,7 @@
  * @author <a href="mailto:pholser@alumni.rice.edu">Paul Holser</a>
  */
 public final class Classes {
-    private static final Map<Class<?>, Class<?>> WRAPPERS = new HashMap<Class<?>, Class<?>>( 13 );
+    private static final Map<Class<?>, Class<?>> WRAPPERS = new HashMap<>( 13 );
 
     static {
         WRAPPERS.put( boolean.class, Boolean.class );
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/Columns.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/Columns.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -58,7 +58,6 @@
 import java.text.BreakIterator;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Locale;
 
 import static java.text.BreakIterator.*;
 
@@ -82,7 +81,7 @@
         List<String> options = piecesOf( row.option, optionWidth );
         List<String> descriptions = piecesOf( row.description, descriptionWidth );
 
-        List<Row> rows = new ArrayList<Row>();
+        List<Row> rows = new ArrayList<>();
         for ( int i = 0; i < Math.max( options.size(), descriptions.size() ); ++i )
             rows.add( new Row( itemOrEmpty( options, i ), itemOrEmpty( descriptions, i ) ) );
 
@@ -94,7 +93,7 @@
     }
 
     private List<String> piecesOf( String raw, int width ) {
-        List<String> pieces = new ArrayList<String>();
+        List<String> pieces = new ArrayList<>();
 
         for ( String each : raw.trim().split( LINE_SEPARATOR ) )
             pieces.addAll( piecesOfEmbeddedLine( each, width ) );
@@ -103,9 +102,9 @@
     }
 
     private List<String> piecesOfEmbeddedLine( String line, int width ) {
-        List<String> pieces = new ArrayList<String>();
+        List<String> pieces = new ArrayList<>();
 
-        BreakIterator words = BreakIterator.getLineInstance( Locale.US );
+        BreakIterator words = BreakIterator.getLineInstance();
         words.setText( line );
 
         StringBuilder nextPiece = new StringBuilder();
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/ConstructorInvokingValueConverter.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/ConstructorInvokingValueConverter.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/Messages.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * The MIT License
+ *
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+package jdk.internal.joptsimple.internal;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * @author <a href="mailto:pholser@alumni.rice.edu">Paul Holser</a>
+ */
+public class Messages {
+    private Messages() {
+        throw new UnsupportedOperationException();
+    }
+
+    public static String message( Locale locale, String bundleName, Class<?> type, String key, Object... args ) {
+        ResourceBundle bundle = ResourceBundle.getBundle( bundleName, locale );
+        String template = bundle.getString( type.getName() + '.' + key );
+        MessageFormat format = new MessageFormat( template );
+        format.setLocale( locale );
+        return format.format( args );
+    }
+}
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/MethodInvokingValueConverter.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/MethodInvokingValueConverter.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/Objects.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file:
- *
- * The MIT License
- *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-package jdk.internal.joptsimple.internal;
-
-/**
- * @author <a href="mailto:pholser@alumni.rice.edu">Paul Holser</a>
- */
-public final class Objects {
-    private Objects() {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * Rejects {@code null} references.
-     *
-     * @param target reference to check
-     * @throws NullPointerException if {@code target} is {@code null}
-     */
-    public static void ensureNotNull( Object target ) {
-        if ( target == null )
-            throw new NullPointerException();
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/OptionNameMap.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * The MIT License
+ *
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+package jdk.internal.joptsimple.internal;
+
+import java.util.Map;
+
+/**
+ * Map-like interface for storing String-value pairs.
+ *
+ * @param <V> type of values stored in the map
+ */
+public interface OptionNameMap<V> {
+    boolean contains( String key );
+
+    V get( String key );
+
+    void put( String key, V newValue );
+
+    void putAll( Iterable<String> keys, V newValue );
+
+    void remove( String key );
+
+    Map<String, V> toJavaUtilMap();
+}
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/Reflection.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/Reflection.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -98,22 +98,20 @@
 
     private static <V> ValueConverter<V> valueOfConverter( Class<V> clazz ) {
         try {
-            Method valueOf = clazz.getDeclaredMethod( "valueOf", String.class );
+            Method valueOf = clazz.getMethod( "valueOf", String.class );
             if ( meetsConverterRequirements( valueOf, clazz ) )
-                return new MethodInvokingValueConverter<V>( valueOf, clazz );
+                return new MethodInvokingValueConverter<>( valueOf, clazz );
 
             return null;
-        }
-        catch ( NoSuchMethodException ignored ) {
+        } catch ( NoSuchMethodException ignored ) {
             return null;
         }
     }
 
     private static <V> ValueConverter<V> constructorConverter( Class<V> clazz ) {
         try {
-            return new ConstructorInvokingValueConverter<V>( clazz.getConstructor( String.class ) );
-        }
-        catch ( NoSuchMethodException ignored ) {
+            return new ConstructorInvokingValueConverter<>( clazz.getConstructor( String.class ) );
+        } catch ( NoSuchMethodException ignored ) {
             return null;
         }
     }
@@ -130,8 +128,7 @@
     public static <T> T instantiate( Constructor<T> constructor, Object... args ) {
         try {
             return constructor.newInstance( args );
-        }
-        catch ( Exception ex ) {
+        } catch ( Exception ex ) {
             throw reflectionException( ex );
         }
     }
@@ -147,8 +144,7 @@
     public static Object invoke( Method method, Object... args ) {
         try {
             return method.invoke( null, args );
-        }
-        catch ( Exception ex ) {
+        } catch ( Exception ex ) {
             throw reflectionException( ex );
         }
     }
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/ReflectionException.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/ReflectionException.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/Row.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/Row.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/Rows.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/Rows.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -55,8 +55,8 @@
 
 package jdk.internal.joptsimple.internal;
 
-import java.util.LinkedHashSet;
-import java.util.Set;
+import java.util.ArrayList;
+import java.util.List;
 
 import static java.lang.Math.*;
 
@@ -68,7 +68,8 @@
 public class Rows {
     private final int overallWidth;
     private final int columnSeparatorWidth;
-    private final Set<Row> rows = new LinkedHashSet<Row>();
+    private final List<Row> rows = new ArrayList<>();
+
     private int widthOfWidestOption;
     private int widthOfWidestDescription;
 
@@ -87,7 +88,7 @@
         widthOfWidestDescription = max( widthOfWidestDescription, row.description.length() );
     }
 
-    private void reset() {
+    public void reset() {
         rows.clear();
         widthOfWidestOption = 0;
         widthOfWidestDescription = 0;
@@ -96,7 +97,7 @@
     public void fitToWidth() {
         Columns columns = new Columns( optionWidth(), descriptionWidth() );
 
-        Set<Row> fitted = new LinkedHashSet<Row>();
+        List<Row> fitted = new ArrayList<>();
         for ( Row each : rows )
             fitted.addAll( columns.fit( each ) );
 
@@ -122,7 +123,7 @@
     }
 
     private int descriptionWidth() {
-        return min( ( overallWidth - columnSeparatorWidth ) / 2, widthOfWidestDescription );
+        return min( overallWidth - optionWidth() - columnSeparatorWidth, widthOfWidestDescription );
     }
 
     private StringBuilder pad( StringBuilder buffer, String s, int length ) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/SimpleOptionNameMap.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * The MIT License
+ *
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+package jdk.internal.joptsimple.internal;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * <p>An {@code OptionNameMap} which wraps and behaves like {@code HashMap}.</p>
+ */
+public class SimpleOptionNameMap<V> implements OptionNameMap<V> {
+    private final Map<String, V> map = new HashMap<>();
+
+    @Override
+    public boolean contains( String key ) {
+        return map.containsKey( key );
+    }
+
+    @Override
+    public V get( String key ) {
+        return map.get( key );
+    }
+
+    @Override
+    public void put( String key, V newValue ) {
+        map.put( key, newValue );
+    }
+
+    @Override
+    public void putAll( Iterable<String> keys, V newValue ) {
+        for ( String each : keys )
+            map.put( each, newValue );
+    }
+
+    @Override
+    public void remove( String key ) {
+        map.remove( key );
+    }
+
+    @Override
+    public Map<String, V> toJavaUtilMap() {
+        return new HashMap<>( map );
+    }
+}
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/Strings.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/internal/Strings.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -56,7 +56,6 @@
 package jdk.internal.joptsimple.internal;
 
 import java.util.Iterator;
-import java.util.List;
 
 import static java.lang.System.*;
 import static java.util.Arrays.*;
@@ -66,7 +65,6 @@
  */
 public final class Strings {
     public static final String EMPTY = "";
-    public static final String SINGLE_QUOTE = "'";
     public static final String LINE_SEPARATOR = getProperty( "line.separator" );
 
     private Strings() {
@@ -96,7 +94,7 @@
      * @return {@code true} if the target string is null or empty
      */
     public static boolean isNullOrEmpty( String target ) {
-        return target == null || EMPTY.equals( target );
+        return target == null || target.isEmpty();
     }
 
 
@@ -132,7 +130,7 @@
      * @param separator the separator
      * @return the joined string
      */
-    public static String join( List<String> pieces, String separator ) {
+    public static String join( Iterable<String> pieces, String separator ) {
         StringBuilder buffer = new StringBuilder();
 
         for ( Iterator<String> iter = pieces.iterator(); iter.hasNext(); ) {
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/util/DateConverter.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/util/DateConverter.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -59,9 +59,11 @@
 import java.text.ParsePosition;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Locale;
 
 import jdk.internal.joptsimple.ValueConversionException;
 import jdk.internal.joptsimple.ValueConverter;
+import jdk.internal.joptsimple.internal.Messages;
 
 /**
  * Converts values to {@link Date}s using a {@link DateFormat} object.
@@ -121,10 +123,22 @@
     }
 
     private String message( String value ) {
-        String message = "Value [" + value + "] does not match date/time pattern";
-        if ( formatter instanceof SimpleDateFormat )
-            message += " [" + ( (SimpleDateFormat) formatter ).toPattern() + ']';
+        String key;
+        Object[] arguments;
 
-        return message;
+        if ( formatter instanceof SimpleDateFormat ) {
+            key = "with.pattern.message";
+            arguments = new Object[] { value, ( (SimpleDateFormat) formatter ).toPattern() };
+        } else {
+            key = "without.pattern.message";
+            arguments = new Object[] { value };
+        }
+
+        return Messages.message(
+            Locale.getDefault(),
+            "jdk.internal.joptsimple.ExceptionMessages",
+            DateConverter.class,
+            key,
+            arguments );
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/util/EnumConverter.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * The MIT License
+ *
+ * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+package jdk.internal.joptsimple.util;
+
+import java.text.MessageFormat;
+import java.util.EnumSet;
+import java.util.Iterator;
+import java.util.ResourceBundle;
+
+import jdk.internal.joptsimple.ValueConversionException;
+import jdk.internal.joptsimple.ValueConverter;
+
+/**
+ * Converts values to {@link java.lang.Enum}s.
+ *
+ * @author <a href="mailto:christian.ohr@gmail.com">Christian Ohr</a>
+ */
+public abstract class EnumConverter<E extends Enum<E>> implements ValueConverter<E> {
+    private final Class<E> clazz;
+
+    private String delimiters = "[,]";
+
+    /**
+     * This constructor must be called by subclasses, providing the enum class as the parameter.
+     *
+     * @param clazz enum class
+     */
+    protected EnumConverter( Class<E> clazz ) {
+        this.clazz = clazz;
+    }
+
+    @Override
+    public E convert( String value ) {
+        for ( E each : valueType().getEnumConstants() ) {
+            if ( each.name().equalsIgnoreCase( value ) ) {
+                return each;
+            }
+        }
+
+        throw new ValueConversionException( message( value ) );
+    }
+
+    @Override
+    public Class<E> valueType() {
+        return clazz;
+    }
+
+    /**
+     * Sets the delimiters for the message string. Must be a 3-letter string,
+     * where the first character is the prefix, the second character is the
+     * delimiter between the values, and the 3rd character is the suffix.
+     *
+     * @param delimiters delimiters for message string. Default is [,]
+     */
+    public void setDelimiters( String delimiters ) {
+        this.delimiters = delimiters;
+    }
+
+    @Override
+    public String valuePattern() {
+        EnumSet<E> values = EnumSet.allOf( valueType() );
+
+        StringBuilder builder = new StringBuilder();
+        builder.append( delimiters.charAt(0) );
+        for ( Iterator<E> i = values.iterator(); i.hasNext(); ) {
+            builder.append( i.next().toString() );
+            if ( i.hasNext() )
+                builder.append( delimiters.charAt( 1 ) );
+        }
+        builder.append( delimiters.charAt( 2 ) );
+
+        return builder.toString();
+    }
+
+    private String message( String value ) {
+        ResourceBundle bundle = ResourceBundle.getBundle( "jdk.internal.joptsimple.ExceptionMessages" );
+        Object[] arguments = new Object[] { value, valuePattern() };
+        String template = bundle.getString( EnumConverter.class.getName() + ".message" );
+        return new MessageFormat( template ).format( arguments );
+    }
+}
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/util/InetAddressConverter.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/util/InetAddressConverter.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -57,9 +57,11 @@
 
 import java.net.InetAddress;
 import java.net.UnknownHostException;
+import java.util.Locale;
 
 import jdk.internal.joptsimple.ValueConversionException;
 import jdk.internal.joptsimple.ValueConverter;
+import jdk.internal.joptsimple.internal.Messages;
 
 /**
  * Converts values to {@link java.net.InetAddress} using {@link InetAddress#getByName(String) getByName}.
@@ -70,8 +72,9 @@
     public InetAddress convert( String value ) {
         try {
             return InetAddress.getByName( value );
-        } catch ( UnknownHostException e ) {
-            throw new ValueConversionException( "Cannot convert value [" + value + " into an InetAddress", e );
+        }
+        catch ( UnknownHostException e ) {
+            throw new ValueConversionException( message( value ) );
         }
     }
 
@@ -82,4 +85,13 @@
     public String valuePattern() {
         return null;
     }
+
+    private String message( String value ) {
+        return Messages.message(
+            Locale.getDefault(),
+            "jdk.internal.joptsimple.ExceptionMessages",
+            InetAddressConverter.class,
+            "message",
+            value );
+    }
 }
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/util/KeyValuePair.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/util/KeyValuePair.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -60,7 +60,7 @@
 /**
  * <p>A simple string key/string value pair.</p>
  *
- * <p>This is useful as an argument type for options whose values take on the form <kbd>key=value</kbd>, such as JVM
+ * <p>This is useful as an argument type for options whose values take on the form {@code key=value}, such as JVM
  * command line system properties.</p>
  *
  * @author <a href="mailto:pholser@alumni.rice.edu">Paul Holser</a>
@@ -75,7 +75,7 @@
     }
 
     /**
-     * Parses a string assumed to be of the form <kbd>key=value</kbd> into its parts.
+     * Parses a string assumed to be of the form {@code key=value} into its parts.
      *
      * @param asString key-value string
      * @return a key-value pair
@@ -84,7 +84,7 @@
     public static KeyValuePair valueOf( String asString ) {
         int equalsIndex = asString.indexOf( '=' );
         if ( equalsIndex == -1 )
-            return new KeyValuePair( asString, EMPTY );
+            return new KeyValuePair( asString, null );
 
         String aKey = asString.substring( 0, equalsIndex );
         String aValue = equalsIndex == asString.length() - 1 ? EMPTY : asString.substring( equalsIndex + 1 );
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/util/PathConverter.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.internal.joptsimple.util;
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+
+import jdk.internal.joptsimple.ValueConversionException;
+import jdk.internal.joptsimple.ValueConverter;
+
+/**
+ * Converts command line options to {@link Path} objects and checks the status of the underlying file.
+ */
+public class PathConverter implements ValueConverter<Path> {
+    private final PathProperties[] pathProperties;
+
+    public PathConverter( PathProperties... pathProperties ) {
+        this.pathProperties = pathProperties;
+    }
+
+    @Override
+    public Path convert( String value ) {
+        Path path = Paths.get(value);
+
+        if ( pathProperties != null ) {
+            for ( PathProperties each : pathProperties ) {
+                if ( !each.accept( path ) )
+                    throw new ValueConversionException( message( each.getMessageKey(), path.toString() ) );
+            }
+        }
+
+        return path;
+    }
+
+    @Override
+    public Class<Path> valueType() {
+        return Path.class;
+    }
+
+    @Override
+    public String valuePattern() {
+        return null;
+    }
+
+    private String message( String errorKey, String value ) {
+        ResourceBundle bundle = ResourceBundle.getBundle( "jdk.internal.joptsimple.ExceptionMessages" );
+        Object[] arguments = new Object[] { value, valuePattern() };
+        String template = bundle.getString( PathConverter.class.getName() + "." + errorKey + ".message" );
+        return new MessageFormat( template ).format( arguments );
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/util/PathProperties.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.internal.joptsimple.util;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+
+/**
+ * Enum for checking common conditions of files and directories.
+ *
+ * @see jdk.internal.joptsimple.util.PathConverter
+ */
+public enum PathProperties {
+    FILE_EXISTING( "file.existing" ) {
+        @Override
+        boolean accept( Path path ) {
+            return Files.isRegularFile( path );
+        }
+    },
+    DIRECTORY_EXISTING( "directory.existing" ) {
+        @Override
+        boolean accept( Path path ) {
+            return Files.isDirectory( path );
+        }
+    },
+    NOT_EXISTING( "file.not.existing" ) {
+        @Override
+        boolean accept( Path path ) {
+            return Files.notExists( path );
+        }
+    },
+    FILE_OVERWRITABLE( "file.overwritable" ) {
+        @Override
+        boolean accept( Path path ) {
+            return FILE_EXISTING.accept( path ) && WRITABLE.accept( path );
+        }
+    },
+    READABLE( "file.readable" ) {
+        @Override
+        boolean accept( Path path ) {
+            return Files.isReadable( path );
+        }
+    },
+    WRITABLE( "file.writable" ) {
+        @Override
+        boolean accept( Path path ) {
+            return Files.isWritable( path );
+        }
+    };
+
+    private final String messageKey;
+
+    private PathProperties( String messageKey ) {
+        this.messageKey = messageKey;
+    }
+
+    abstract boolean accept( Path path );
+
+    String getMessageKey() {
+        return messageKey;
+    }
+}
--- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/util/RegexMatcher.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/util/RegexMatcher.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,7 +31,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2004-2014 Paul R. Holser, Jr.
+ * Copyright (c) 2004-2015 Paul R. Holser, Jr.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -55,9 +55,11 @@
 
 package jdk.internal.joptsimple.util;
 
+import java.util.Locale;
 import java.util.regex.Pattern;
 
 import static java.util.regex.Pattern.*;
+import static jdk.internal.joptsimple.internal.Messages.message;
 
 import jdk.internal.joptsimple.ValueConversionException;
 import jdk.internal.joptsimple.ValueConverter;
@@ -96,8 +98,7 @@
 
     public String convert( String value ) {
         if ( !pattern.matcher( value ).matches() ) {
-            throw new ValueConversionException(
-                "Value [" + value + "] did not match regex [" + pattern.pattern() + ']' );
+            raiseValueConversionFailure( value );
         }
 
         return value;
@@ -110,4 +111,15 @@
     public String valuePattern() {
         return pattern.pattern();
     }
+
+    private void raiseValueConversionFailure( String value ) {
+        String message = message(
+            Locale.getDefault(),
+            "jdk.internal.joptsimple.ExceptionMessages",
+            RegexMatcher.class,
+            "message",
+            value,
+            pattern.pattern() );
+        throw new ValueConversionException( message );
+    }
 }
--- a/src/jdk.internal.opt/share/legal/jopt-simple.md	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.opt/share/legal/jopt-simple.md	Mon Jun 11 09:29:44 2018 +0200
@@ -1,4 +1,4 @@
-## jopt-simple v4.6
+## jopt-simple v5.0.4
 
 ### MIT License
 <pre>
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/UnsafeCompareAndExchangeNode.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/UnsafeCompareAndExchangeNode.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, 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
@@ -23,6 +23,7 @@
 package org.graalvm.compiler.nodes.java;
 
 import jdk.vm.ci.meta.JavaKind;
+import org.graalvm.compiler.core.common.type.Stamp;
 import org.graalvm.compiler.graph.NodeClass;
 import org.graalvm.compiler.nodeinfo.NodeInfo;
 import org.graalvm.compiler.nodes.NodeView;
@@ -55,8 +56,7 @@
     private final LocationIdentity locationIdentity;
 
     public UnsafeCompareAndExchangeNode(ValueNode object, ValueNode offset, ValueNode expected, ValueNode newValue, JavaKind valueKind, LocationIdentity locationIdentity) {
-        super(TYPE, expected.stamp(NodeView.DEFAULT).meet(newValue.stamp(NodeView.DEFAULT)));
-        assert expected.stamp(NodeView.DEFAULT).isCompatible(newValue.stamp(NodeView.DEFAULT));
+        super(TYPE, meetInputs(expected.stamp(NodeView.DEFAULT), newValue.stamp(NodeView.DEFAULT)));
         this.object = object;
         this.offset = offset;
         this.expected = expected;
@@ -65,6 +65,11 @@
         this.locationIdentity = locationIdentity;
     }
 
+    private static Stamp meetInputs(Stamp expected, Stamp newValue) {
+        assert expected.isCompatible(newValue);
+        return expected.unrestricted().meet(newValue.unrestricted());
+    }
+
     public ValueNode object() {
         return object;
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.jdk9.test/src/org/graalvm/compiler/replacements/jdk9/UnsafeReplacementsTest.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.jdk9.test/src/org/graalvm/compiler/replacements/jdk9/UnsafeReplacementsTest.java	Mon Jun 11 09:29:44 2018 +0200
@@ -26,11 +26,15 @@
 import jdk.vm.ci.code.TargetDescription;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 import org.graalvm.compiler.api.test.Graal;
+import org.graalvm.compiler.core.phases.HighTier;
+import org.graalvm.compiler.options.OptionValues;
 import org.graalvm.compiler.replacements.test.MethodSubstitutionTest;
 import org.graalvm.compiler.runtime.RuntimeProvider;
 import org.graalvm.compiler.test.AddExports;
 import org.junit.Test;
 
+import java.lang.reflect.Field;
+
 @AddExports("java.base/jdk.internal.misc")
 public class UnsafeReplacementsTest extends MethodSubstitutionTest {
 
@@ -310,4 +314,200 @@
         test("unsafeGetAndSetLong");
         test("unsafeGetAndSetObject");
     }
+
+    public static void fieldInstance() {
+        JdkInternalMiscUnsafeAccessTestBoolean.testFieldInstance();
+    }
+
+    @Test
+    public void testFieldInstance() {
+        test(new OptionValues(getInitialOptions(), HighTier.Options.Inline, false), "fieldInstance");
+    }
+
+    public static void array() {
+        JdkInternalMiscUnsafeAccessTestBoolean.testArray();
+    }
+
+    @Test
+    public void testArray() {
+        test(new OptionValues(getInitialOptions(), HighTier.Options.Inline, false), "array");
+    }
+
+    public static void fieldStatic() {
+        JdkInternalMiscUnsafeAccessTestBoolean.testFieldStatic();
+    }
+
+    @Test
+    public void testFieldStatic() {
+        test(new OptionValues(getInitialOptions(), HighTier.Options.Inline, false), "fieldStatic");
+    }
+
+    public static class JdkInternalMiscUnsafeAccessTestBoolean {
+        static final int ITERATIONS = 100000;
+
+        static final int WEAK_ATTEMPTS = 10;
+
+        static final long V_OFFSET;
+
+        static final Object STATIC_V_BASE;
+
+        static final long STATIC_V_OFFSET;
+
+        static final int ARRAY_OFFSET;
+
+        static final int ARRAY_SHIFT;
+
+        static {
+            try {
+                Field staticVField = UnsafeReplacementsTest.JdkInternalMiscUnsafeAccessTestBoolean.class.getDeclaredField("staticV");
+                STATIC_V_BASE = unsafe.staticFieldBase(staticVField);
+                STATIC_V_OFFSET = unsafe.staticFieldOffset(staticVField);
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+
+            try {
+                Field vField = UnsafeReplacementsTest.JdkInternalMiscUnsafeAccessTestBoolean.class.getDeclaredField("v");
+                V_OFFSET = unsafe.objectFieldOffset(vField);
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+
+            ARRAY_OFFSET = unsafe.arrayBaseOffset(boolean[].class);
+            int ascale = unsafe.arrayIndexScale(boolean[].class);
+            ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale);
+        }
+
+        static boolean staticV;
+
+        boolean v;
+
+        @BytecodeParserForceInline
+        public static void testFieldInstance() {
+            JdkInternalMiscUnsafeAccessTestBoolean t = new JdkInternalMiscUnsafeAccessTestBoolean();
+            for (int c = 0; c < ITERATIONS; c++) {
+                testAccess(t, V_OFFSET);
+            }
+        }
+
+        public static void testFieldStatic() {
+            for (int c = 0; c < ITERATIONS; c++) {
+                testAccess(STATIC_V_BASE, STATIC_V_OFFSET);
+            }
+        }
+
+        public static void testArray() {
+            boolean[] array = new boolean[10];
+            for (int c = 0; c < ITERATIONS; c++) {
+                for (int i = 0; i < array.length; i++) {
+                    testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET);
+                }
+            }
+        }
+
+        public static void assertEquals(Object seen, Object expected, String message) {
+            if (seen != expected) {
+                throw new AssertionError(message + " - seen: " + seen + ", expected: " + expected);
+            }
+        }
+
+        // Checkstyle: stop
+        @BytecodeParserForceInline
+        public static void testAccess(Object base, long offset) {
+            // Advanced compare
+            {
+                boolean r = unsafe.compareAndExchangeBoolean(base, offset, false, true);
+                assertEquals(r, false, "success compareAndExchange boolean");
+                boolean x = unsafe.getBoolean(base, offset);
+                assertEquals(x, true, "success compareAndExchange boolean value");
+            }
+
+            {
+                boolean r = unsafe.compareAndExchangeBoolean(base, offset, false, false);
+                assertEquals(r, true, "failing compareAndExchange boolean");
+                boolean x = unsafe.getBoolean(base, offset);
+                assertEquals(x, true, "failing compareAndExchange boolean value");
+            }
+
+            {
+                boolean r = unsafe.compareAndExchangeBooleanAcquire(base, offset, true, false);
+                assertEquals(r, true, "success compareAndExchangeAcquire boolean");
+                boolean x = unsafe.getBoolean(base, offset);
+                assertEquals(x, false, "success compareAndExchangeAcquire boolean value");
+            }
+
+            {
+                boolean r = unsafe.compareAndExchangeBooleanAcquire(base, offset, true, false);
+                assertEquals(r, false, "failing compareAndExchangeAcquire boolean");
+                boolean x = unsafe.getBoolean(base, offset);
+                assertEquals(x, false, "failing compareAndExchangeAcquire boolean value");
+            }
+
+            {
+                boolean r = unsafe.compareAndExchangeBooleanRelease(base, offset, false, true);
+                assertEquals(r, false, "success compareAndExchangeRelease boolean");
+                boolean x = unsafe.getBoolean(base, offset);
+                assertEquals(x, true, "success compareAndExchangeRelease boolean value");
+            }
+
+            {
+                boolean r = unsafe.compareAndExchangeBooleanRelease(base, offset, false, false);
+                assertEquals(r, true, "failing compareAndExchangeRelease boolean");
+                boolean x = unsafe.getBoolean(base, offset);
+                assertEquals(x, true, "failing compareAndExchangeRelease boolean value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = unsafe.weakCompareAndSetBooleanPlain(base, offset, true, false);
+                }
+                assertEquals(success, true, "weakCompareAndSetPlain boolean");
+                boolean x = unsafe.getBoolean(base, offset);
+                assertEquals(x, false, "weakCompareAndSetPlain boolean value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = unsafe.weakCompareAndSetBooleanAcquire(base, offset, false, true);
+                }
+                assertEquals(success, true, "weakCompareAndSetAcquire boolean");
+                boolean x = unsafe.getBoolean(base, offset);
+                assertEquals(x, true, "weakCompareAndSetAcquire boolean");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = unsafe.weakCompareAndSetBooleanRelease(base, offset, true, false);
+                }
+                assertEquals(success, true, "weakCompareAndSetRelease boolean");
+                boolean x = unsafe.getBoolean(base, offset);
+                assertEquals(x, false, "weakCompareAndSetRelease boolean");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = unsafe.weakCompareAndSetBoolean(base, offset, false, true);
+                }
+                assertEquals(success, true, "weakCompareAndSet boolean");
+                boolean x = unsafe.getBoolean(base, offset);
+                assertEquals(x, true, "weakCompareAndSet boolean");
+            }
+
+            unsafe.putBoolean(base, offset, false);
+
+            // Compare set and get
+            {
+                boolean o = unsafe.getAndSetBoolean(base, offset, true);
+                assertEquals(o, false, "getAndSet boolean");
+                boolean x = unsafe.getBoolean(base, offset);
+                assertEquals(x, true, "getAndSet boolean value");
+            }
+
+        }
+        // Checkstyle: resume
+    }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java	Mon Jun 11 09:29:44 2018 +0200
@@ -172,8 +172,12 @@
             }
         }
 
-        if (!configuration.frames && !configuration.createoverview) {
-            IndexRedirectWriter.generate(configuration);
+        if (!configuration.frames) {
+            if (configuration.createoverview) {
+                IndexRedirectWriter.generate(configuration, DocPaths.OVERVIEW_SUMMARY, DocPaths.INDEX);
+            } else {
+                IndexRedirectWriter.generate(configuration);
+            }
         }
 
         if (configuration.helpfile.isEmpty() && !configuration.nohelp) {
@@ -201,7 +205,7 @@
         }
     }
 
-    protected void copyJqueryFiles() throws DocletException {
+    private void copyJqueryFiles() throws DocletException {
         List<String> files = Arrays.asList(
                 "jquery-1.12.4.js",
                 "jquery-ui.js",
@@ -245,7 +249,6 @@
     protected void generateClassFiles(SortedSet<TypeElement> arr, ClassTree classtree)
             throws DocletException {
         List<TypeElement> list = new ArrayList<>(arr);
-        ListIterator<TypeElement> iterator = list.listIterator();
         for (TypeElement klass : list) {
             if (utils.hasHiddenTag(klass) ||
                     !(configuration.isGeneratedDoc(klass) && utils.isIncluded(klass))) {
@@ -274,7 +277,6 @@
                 ModuleIndexFrameWriter.generate(configuration);
             }
             List<ModuleElement> mdles = new ArrayList<>(configuration.modulePackages.keySet());
-            int i = 0;
             for (ModuleElement mdle : mdles) {
                 if (configuration.frames && configuration.modules.size() > 1) {
                     ModulePackageIndexFrameWriter.generate(configuration, mdle);
@@ -283,21 +285,10 @@
                 AbstractBuilder moduleSummaryBuilder =
                         configuration.getBuilderFactory().getModuleSummaryBuilder(mdle);
                 moduleSummaryBuilder.build();
-                i++;
             }
         }
     }
 
-    PackageElement getNamedPackage(List<PackageElement> list, int idx) {
-        if (idx < list.size()) {
-            PackageElement pkg = list.get(idx);
-            if (pkg != null && !pkg.isUnnamed()) {
-                return pkg;
-            }
-        }
-        return null;
-    }
-
     /**
      * {@inheritDoc}
      */
@@ -308,11 +299,10 @@
             PackageIndexFrameWriter.generate(configuration);
         }
         List<PackageElement> pList = new ArrayList<>(packages);
-        for (int i = 0 ; i < pList.size() ; i++) {
+        for (PackageElement pkg : pList) {
             // if -nodeprecated option is set and the package is marked as
             // deprecated, do not generate the package-summary.html, package-frame.html
             // and package-tree.html pages for that package.
-            PackageElement pkg = pList.get(i);
             if (!(configuration.nodeprecated && utils.isDeprecated(pkg))) {
                 if (configuration.frames) {
                     PackageFrameWriter.generate(configuration, pkg);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -41,8 +41,8 @@
 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
 
 /**
- * Writes an index.html file that tries to redirect to an alternate page.
- * The redirect uses JavaSCript, if enabled, falling back on
+ * Writes a file that tries to redirect to an alternate page.
+ * The redirect uses JavaScript, if enabled, falling back on
  * {@code <meta http-eqiv=refresh content="0,<uri>">}.
  * If neither are supported/enabled in a browser, the page displays the
  * standard "JavaScipt not enabled" message, and a link to the alternate page.
@@ -51,21 +51,27 @@
 
     public static void generate(HtmlConfiguration configuration)
             throws DocFileIOException {
-        IndexRedirectWriter indexRedirect;
-        DocPath filename = DocPaths.INDEX;
-            indexRedirect = new IndexRedirectWriter(configuration, filename);
-            indexRedirect.generateIndexFile();
+        generate(configuration, DocPaths.INDEX, configuration.topFile);
     }
 
-    IndexRedirectWriter(HtmlConfiguration configuration, DocPath filename) {
+    public static void generate(HtmlConfiguration configuration, DocPath fileName, DocPath target)
+            throws DocFileIOException {
+        IndexRedirectWriter indexRedirect = new IndexRedirectWriter(configuration, fileName, target);
+        indexRedirect.generateIndexFile();
+    }
+
+    private DocPath target;
+
+    private IndexRedirectWriter(HtmlConfiguration configuration, DocPath filename, DocPath target) {
         super(configuration, filename);
+        this.target = target;
     }
 
     /**
      * Generate an index file that redirects to an alternate file.
      * @throws DocFileIOException if there is a problem generating the file
      */
-    void generateIndexFile() throws DocFileIOException {
+    private void generateIndexFile() throws DocFileIOException {
         DocType htmlDocType = DocType.forVersion(configuration.htmlVersion);
         Content htmlComment = contents.newPage;
         Head head = new Head(path, configuration.htmlVersion, configuration.docletVersion)
@@ -77,15 +83,16 @@
                 : resources.getText("doclet.Generated_Docs_Untitled");
 
         head.setTitle(title)
-                .setCharset(configuration.charset);
+                .setCharset(configuration.charset)
+                .setCanonicalLink(target);
 
-        String topFilePath = configuration.topFile.getPath();
+        String targetPath = target.getPath();
         Script script = new Script("window.location.replace(")
-                .appendStringLiteral(topFilePath, '\'')
+                .appendStringLiteral(targetPath, '\'')
                 .append(")");
         HtmlTree metaRefresh = new HtmlTree(HtmlTag.META)
                 .addAttr(HtmlAttr.HTTP_EQUIV, "Refresh")
-                .addAttr(HtmlAttr.CONTENT, "0;" + topFilePath);
+                .addAttr(HtmlAttr.CONTENT, "0;" + targetPath);
         head.addContent(
                 script.asContent(),
                 configuration.isOutputHtml5() ? HtmlTree.NOSCRIPT(metaRefresh) : metaRefresh);
@@ -94,7 +101,7 @@
         bodyContent.addContent(HtmlTree.NOSCRIPT(
                 HtmlTree.P(contents.getContent("doclet.No_Script_Message"))));
 
-        bodyContent.addContent(HtmlTree.P(HtmlTree.A(topFilePath, new StringContent(topFilePath))));
+        bodyContent.addContent(HtmlTree.P(HtmlTree.A(targetPath, new StringContent(targetPath))));
 
         Content body = new HtmlTree(HtmlTag.BODY);
         if (configuration.allowTag(HtmlTag.MAIN)) {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -67,7 +67,8 @@
     private Script mainBodyScript;
     private final List<Script> scripts;
     private final List<Content> extraContent;
-    boolean addDefaultScript = true;
+    private boolean addDefaultScript = true;
+    private DocPath canonicalLink;
 
     private static final Calendar calendar = new GregorianCalendar(TimeZone.getDefault());
 
@@ -228,6 +229,16 @@
     }
 
     /**
+     * Specifies a value for a
+     * <a href="https://en.wikipedia.org/wiki/Canonical_link_element">canonical link</a>
+     * in the {@code <head>} element.
+     * @param link
+     */
+    public void setCanonicalLink(DocPath link) {
+        this.canonicalLink = link;
+    }
+
+    /**
      * Adds additional content to be included in the HEAD element.
      *
      * @param contents the content
@@ -271,6 +282,13 @@
             tree.addContent(c);
         }
 
+        if (canonicalLink != null) {
+            HtmlTree link = new HtmlTree(HtmlTag.LINK);
+            link.addAttr(HtmlAttr.REL, "canonical");
+            link.addAttr(HtmlAttr.HREF, canonicalLink.getPath());
+            tree.addContent(link);
+        }
+
         addStylesheets(tree);
         addScripts(tree);
 
--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleDotGraph.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleDotGraph.java	Mon Jun 11 09:29:44 2018 +0200
@@ -44,6 +44,7 @@
 import java.util.Deque;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
@@ -329,7 +330,7 @@
 
                 out.format("digraph \"%s\" {%n", name);
                 out.format("  nodesep=.5;%n");
-                out.format("  ranksep=%f;%n", attributes.rankSep());
+                out.format((Locale)null, "  ranksep=%f;%n", attributes.rankSep());
                 out.format("  pencolor=transparent;%n");
                 out.format("  node [shape=plaintext, fontcolor=\"%s\", fontname=\"%s\","
                                 + " fontsize=%d, margin=\".2,.2\"];%n",
--- a/src/jdk.jdi/share/classes/com/sun/tools/jdi/TargetVM.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.jdi/share/classes/com/sun/tools/jdi/TargetVM.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, 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
@@ -53,7 +53,7 @@
      * TO DO: The limit numbers below are somewhat arbitrary and should
      * be configurable in the future.
      */
-    static private final int OVERLOADED_QUEUE = 2000;
+    static private final int OVERLOADED_QUEUE = 10000;
     static private final int UNDERLOADED_QUEUE = 100;
 
     TargetVM(VirtualMachineImpl vm, Connection connection) {
--- a/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1224,7 +1224,7 @@
 
             all.put(CMD_FILENAME, new OptionDescriptor() {
                 @Override
-                public Collection<String> options() {
+                public List<String> options() {
                     List<String> ret = new ArrayList<>();
                     ret.add(CMD_FILENAME);
                     return ret;
@@ -1314,7 +1314,7 @@
                         .withValuesConvertedBy(new PatternConverter());
 
         OptionSpec<Void> help
-                = parser.acceptsAll(Set.of("h", "help", "?"), getMessage("main.opt.help"))
+                = parser.acceptsAll(List.of("h", "help", "?"), getMessage("main.opt.help"))
                         .forHelp();
 
         OptionSpec<Void> helpExtra
@@ -1347,7 +1347,7 @@
                         .withValuesConvertedBy(DirPathConverter.INSTANCE);
 
         OptionSpec<List<Path>> modulePath
-                = parser.acceptsAll(Set.of("p", "module-path"),
+                = parser.acceptsAll(List.of("p", "module-path"),
                                     getMessage("main.opt.module-path"))
                         .withRequiredArg()
                         .withValuesConvertedBy(DirPathConverter.INSTANCE);
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_ja.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_ja.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2018, 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
@@ -91,6 +91,7 @@
             "\u5927\u6b63", // Taisho
             "\u662d\u548c", // Showa
             "\u5e73\u6210", // Heisei
+            "\u65b0\u5143\u53f7", // NewEra
         };
         final String[] rocEras = {
             "\u6c11\u56fd\u524d",
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_ja.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_ja.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -154,6 +154,7 @@
             "\u5927\u6b63",
             "\u662d\u548c",
             "\u5e73\u6210",
+            "\u65b0\u5143\u53f7", // NewEra
         };
 
         final String[] sharedJavaTimeShortEras = {
--- a/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -31,6 +31,7 @@
 #include <netinet/tcp.h>
 #include <netinet/in.h>
 #include "jni_util.h"
+#include "jdk_net_LinuxSocketOptions.h"
 
 /*
  * Class:     jdk_net_LinuxSocketOptions
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java	Mon Jun 11 09:29:44 2018 +0200
@@ -541,7 +541,6 @@
             sprev = s;
             s++;
         }
-        sprev = sbegin; // break;
     }
 
     private void opAnyCharMLStar() {
@@ -550,7 +549,6 @@
             sprev = s;
             s++;
         }
-        sprev = sbegin; // break;
     }
 
     private void opAnyCharStarPeekNext() {
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/Config.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/Config.java	Mon Jun 11 09:29:44 2018 +0200
@@ -45,6 +45,7 @@
 
     final int NREGION                   = 10;
     final int MAX_BACKREF_NUM           = 1000;
+    final int MAX_CAPTURE_GROUP_NUM     = 0x8000;
     final int MAX_REPEAT_NUM            = 100000;
     final int MAX_MULTI_BYTE_RANGES_NUM = 10000;
 
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/ScanEnvironment.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/ScanEnvironment.java	Mon Jun 11 09:29:44 2018 +0200
@@ -62,6 +62,9 @@
     }
 
     public int addMemEntry() {
+        if (numMem >= Config.MAX_CAPTURE_GROUP_NUM) {
+            throw new InternalException(ErrorMessages.ERR_TOO_MANY_CAPTURE_GROUPS);
+        }
         if (numMem++ == 0) {
             memNodes = new Node[SCANENV_MEMNODES_SIZE];
         } else if (numMem >= memNodes.length) {
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/exception/ErrorMessages.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/exception/ErrorMessages.java	Mon Jun 11 09:29:44 2018 +0200
@@ -31,6 +31,7 @@
     final String ERR_PARSER_BUG = "internal parser error (bug)";
     final String ERR_UNDEFINED_BYTECODE = "undefined bytecode (bug)";
     final String ERR_UNEXPECTED_BYTECODE = "unexpected bytecode (bug)";
+    final String ERR_TOO_MANY_CAPTURE_GROUPS = "too many capture groups";
 
     /* syntax error */
     final String ERR_END_PATTERN_AT_LEFT_BRACE = "end pattern at left brace";
--- a/test/hotspot/gtest/utilities/test_concurrentHashtable.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/gtest/utilities/test_concurrentHashtable.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -265,6 +265,40 @@
   delete cht;
 }
 
+struct ChtCountScan {
+  size_t _count;
+  ChtCountScan() : _count(0) {}
+  bool operator()(uintptr_t* val) {
+    _count++;
+    return true; /* continue scan */
+  }
+};
+
+static void cht_move_to(Thread* thr) {
+  uintptr_t val1 = 0x2;
+  uintptr_t val2 = 0xe0000002;
+  uintptr_t val3 = 0x3;
+  SimpleTestLookup stl1(val1), stl2(val2), stl3(val3);
+  SimpleTestTable* from_cht = new SimpleTestTable();
+  EXPECT_TRUE(from_cht->insert(thr, stl1, val1)) << "Insert unique value failed.";
+  EXPECT_TRUE(from_cht->insert(thr, stl2, val2)) << "Insert unique value failed.";
+  EXPECT_TRUE(from_cht->insert(thr, stl3, val3)) << "Insert unique value failed.";
+
+  SimpleTestTable* to_cht = new SimpleTestTable();
+  EXPECT_TRUE(from_cht->try_move_nodes_to(thr, to_cht)) << "Moving nodes to new table failed";
+
+  ChtCountScan scan_old;
+  EXPECT_TRUE(from_cht->try_scan(thr, scan_old)) << "Scanning table should work.";
+  EXPECT_EQ(scan_old._count, (size_t)0) << "All items should be moved";
+
+  ChtCountScan scan_new;
+  EXPECT_TRUE(to_cht->try_scan(thr, scan_new)) << "Scanning table should work.";
+  EXPECT_EQ(scan_new._count, (size_t)3) << "All items should be moved";
+  EXPECT_TRUE(to_cht->get_copy(thr, stl1) == val1) << "Getting an inserted value should work.";
+  EXPECT_TRUE(to_cht->get_copy(thr, stl2) == val2) << "Getting an inserted value should work.";
+  EXPECT_TRUE(to_cht->get_copy(thr, stl3) == val3) << "Getting an inserted value should work.";
+}
+
 static void cht_grow(Thread* thr) {
   uintptr_t val = 0x2;
   uintptr_t val2 = 0x22;
@@ -371,6 +405,10 @@
   nomt_test_doer(cht_scan);
 }
 
+TEST_VM(ConcurrentHashTable, basic_move_to) {
+  nomt_test_doer(cht_move_to);
+}
+
 TEST_VM(ConcurrentHashTable, basic_grow) {
   nomt_test_doer(cht_grow);
 }
--- a/test/hotspot/gtest/utilities/test_globalCounter.cpp	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/gtest/utilities/test_globalCounter.cpp	Mon Jun 11 09:29:44 2018 +0200
@@ -23,7 +23,7 @@
 
 #include "precompiled.hpp"
 #include "runtime/atomic.hpp"
-#include "runtime/orderAccess.inline.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/os.hpp"
 #include "utilities/globalCounter.hpp"
 #include "utilities/globalCounter.inline.hpp"
--- a/test/hotspot/jtreg/ProblemList-graal.txt	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/ProblemList-graal.txt	Mon Jun 11 09:29:44 2018 +0200
@@ -95,49 +95,8 @@
 vmTestbase/nsk/jvmti/scenarios/sampling/SP07/sp07t002/TestDescription.java                         8191047   generic-all
 vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn009/forceEarlyReturn009.java   8191047   generic-all
 
-vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod012/TestDescription.java                     8195600   generic-all
-vmTestbase/nsk/jdi/ClassType/setValue/setvalue006/TestDescription.java                             8195600   generic-all
-vmTestbase/nsk/jdi/ListeningConnector/listennosuspend/listennosuspend001/TestDescription.java      8195600   generic-all
-vmTestbase/nsk/jdi/Location/lineNumber_s/lineNumber_s002/lineNumber_s002.java                      8195600   generic-all
-vmTestbase/nsk/jdi/Location/sourcePath_s/sourcePath_s002/sourcePath_s002.java                      8195600   generic-all
-vmTestbase/nsk/jdi/Method/allLineLocations_ss/allLineLocations_ss003/allLineLocations_ss003.java   8195600   generic-all
-vmTestbase/nsk/jdi/Method/locationsOfLine_ssi/locationsOfLine_ssi003/locationsOfLine_ssi003.java   8195600   generic-all
-vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod011/TestDescription.java               8195600   generic-all
-vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod012/TestDescription.java               8195600   generic-all
-vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects001/referringObjects001.java   8195600   generic-all
-vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002.java   8195600   generic-all
-vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects004/referringObjects004.java   8195600   generic-all
-vmTestbase/nsk/jdi/ObjectReference/setValue/setvalue005/TestDescription.java                       8195600   generic-all
 vmTestbase/nsk/jdi/ReferenceType/instances/instances001/instances001.java                          8195600   generic-all
-vmTestbase/nsk/jdi/ReferenceType/instances/instances002/instances002.java                          8195600   generic-all
-vmTestbase/nsk/jdi/ReferenceType/instances/instances005/instances005.java                          8195600   generic-all
 vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn007/TestDescription.java       8195600   generic-all
-vmTestbase/nsk/jdi/ThreadReference/ownedMonitorsAndFrames/ownedMonitorsAndFrames001/ownedMonitorsAndFrames001.java 8195600   generic-all
-vmTestbase/nsk/jdi/VMOutOfMemoryException/VMOutOfMemoryException001/VMOutOfMemoryException001.java 8195600   generic-all
-vmTestbase/nsk/jdi/VirtualMachine/instanceCounts/instancecounts003/instancecounts003.java          8195600   generic-all
-vmTestbase/nsk/jdi/stress/serial/ownedMonitorsAndFrames002/TestDescription.java                    8195600   generic-all
-vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn003/forceEarlyReturn003.java   8195600   generic-all
-vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn004/forceEarlyReturn004.java   8195600   generic-all
-
-vmTestbase/nsk/jdi/Location/sourceName_s/sourceName_s002/sourceName_s002.java                            8200387  generic-all
-vmTestbase/nsk/jdi/Method/allLineLocations_ss/allLineLocations_ss002/allLineLocations_ss002.java         8200387  generic-all
-vmTestbase/nsk/jdi/Method/locationsOfLine_ssi/locationsOfLine_ssi002/locationsOfLine_ssi002.java         8200387  generic-all
-vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects003/referringObjects003.java         8200387  generic-all
-vmTestbase/nsk/jdi/ReferenceType/allLineLocations_ss/allLineLocations_ss003/allLineLocations_ss003.java  8200387  generic-all
-vmTestbase/nsk/jdi/ReferenceType/allLineLocations_ss/allLineLocations_ss004/allLineLocations_ss004.java  8200387  generic-all
-vmTestbase/nsk/jdi/ReferenceType/availableStrata/availableStrata002/availableStrata002.java              8200387  generic-all
-vmTestbase/nsk/jdi/ReferenceType/defaultStratum/defaultStratum002/defaultStratum002.java                 8200387  generic-all
-vmTestbase/nsk/jdi/ReferenceType/locationsOfLine_ssi/locationsOfLine_ssi003/locationsOfLine_ssi003.java  8200387  generic-all
-vmTestbase/nsk/jdi/ReferenceType/locationsOfLine_ssi/locationsOfLine_ssi004/locationsOfLine_ssi004.java  8200387  generic-all
-vmTestbase/nsk/jdi/ReferenceType/sourceNames/sourceNames003/sourceNames003.java                          8200387  generic-all
-vmTestbase/nsk/jdi/ReferenceType/sourcePaths/sourcePaths003/sourcePaths003.java                          8200387  generic-all
-vmTestbase/nsk/jdi/StackFrame/getArgumentValues/getArgumentValues002/getArgumentValues002.java           8200387  generic-all
-vmTestbase/nsk/jdi/StackFrame/getArgumentValues/getArgumentValues003/getArgumentValues003.java           8200387  generic-all
-vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java                                     8200387  generic-all
-vmTestbase/nsk/jdi/ThreadReference/ownedMonitorsAndFrames/ownedMonitorsAndFrames004/ownedMonitorsAndFrames004.java  8200387  generic-all
-vmTestbase/nsk/jdi/VirtualMachine/instanceCounts/instancecounts001/instancecounts001.java                8200387  generic-all
-vmTestbase/nsk/jdi/VirtualMachine/instanceCounts/instancecounts002/TestDescription.java                  8200387  generic-all
-vmTestbase/nsk/jdi/VirtualMachine/setDefaultStratum/setDefaultStratum002/setDefaultStratum002.java       8200387  generic-all
 
 vmTestbase/nsk/jdi/ArrayType/newInstance/newinstance001/TestDescription.java                              8203174   generic-all
 vmTestbase/nsk/jdi/ArrayType/newInstance/newinstance002/TestDescription.java                              8203174   generic-all
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/c2/TestUnsignedByteCompare.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2018, Red Hat Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8204479
+ * @summary Bitwise AND on byte value sometimes produces wrong result
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
+ *      -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -Xcomp -XX:-Inline
+ *      compiler.c2.TestUnsignedByteCompare
+ */
+
+package compiler.c2;
+
+public class TestUnsignedByteCompare {
+
+    static int p, n;
+
+    static void report(byte[] ba, int i, boolean failed) {
+        // Enable for debugging:
+        // System.out.println((failed ? "Failed" : "Passed") + " with: " + ba[i] + " at " + i);
+    }
+
+    static void m1(byte[] ba) {
+        for (int i = 0; i < ba.length; i++) {
+            if ((ba[i] & 0xFF) < 0x10) {
+               p++;
+               report(ba, i, true);
+            } else {
+               n++;
+               report(ba, i, false);
+            }
+        }
+    }
+
+    static void m2(byte[] ba) {
+        for (int i = 0; i < ba.length; i++) {
+            if (((ba[i] & 0xFF) & 0x80) < 0) {
+               p++;
+               report(ba, i, true);
+            } else {
+               n++;
+               report(ba, i, false);
+            }
+        }
+    }
+
+    static public void main(String[] args) {
+        final int tries = 1_000;
+        final int count = 1_000;
+
+        byte[] ba = new byte[count];
+
+        for (int i = 0; i < count; i++) {
+            int v = -(i % 126 + 1);
+            ba[i] = (byte)v;
+        }
+
+        for (int t = 0; t < tries; t++) {
+            m1(ba);
+            if (p != 0) {
+                throw new IllegalStateException("m1 error: p = " + p + ", n = " + n);
+            }
+        }
+
+        for (int t = 0; t < tries; t++) {
+            m2(ba);
+            if (p != 0) {
+                throw new IllegalStateException("m2 error: p = " + p + ", n = " + n);
+            }
+        }
+    }
+}
--- a/test/hotspot/jtreg/compiler/jsr292/NonInlinedCall/InvokeTest.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/compiler/jsr292/NonInlinedCall/InvokeTest.java	Mon Jun 11 09:29:44 2018 +0200
@@ -52,10 +52,12 @@
 public class InvokeTest {
     static MethodHandles.Lookup LOOKUP = MethodHandleHelper.IMPL_LOOKUP;
 
-    static final MethodHandle virtualMH;  // invokevirtual   T.f1
-    static final MethodHandle staticMH;   // invokestatic    T.f2
-    static final MethodHandle intfMH;     // invokeinterface I.f1
-    static final MethodHandle specialMH;  // invokespecial   T.f4 T
+    static final MethodHandle virtualMH; // invokevirtual   T.f1
+    static final MethodHandle staticMH;  // invokestatic    T.f2
+    static final MethodHandle intfMH;    // invokeinterface I.f3
+    static final MethodHandle defaultMH; // invokevirtual   T.f3
+    static final MethodHandle specialMH; // invokespecial   T.f4 T
+    static final MethodHandle privateMH; // invokespecial   I.f4 T
     static final MethodHandle basicMH;
 
     static final WhiteBox WB = WhiteBox.getWhiteBox();
@@ -69,7 +71,9 @@
             virtualMH  = LOOKUP.findVirtual(T.class, "f1", mtype);
             staticMH   = LOOKUP.findStatic (T.class, "f2", mtype);
             intfMH     = LOOKUP.findVirtual(I.class, "f3", mtype);
+            defaultMH  = LOOKUP.findVirtual(T.class, "f3", mtype);
             specialMH  = LOOKUP.findSpecial(T.class, "f4", mtype, T.class);
+            privateMH  = LOOKUP.findSpecial(I.class, "f4", mtype, I.class);
             basicMH    = NonInlinedReinvoker.make(staticMH);
         } catch (Exception e) {
             throw new Error(e);
@@ -92,24 +96,51 @@
         @DontInline public Class<?> f3() { if (doDeopt) WB.deoptimizeAll(); return P2.class; }
     }
 
-    static interface I {
+    interface I {
         @DontInline default Class<?> f3() { if (doDeopt) WB.deoptimizeAll(); return I.class; }
+        @DontInline private Class<?> f4() { if (doDeopt) WB.deoptimizeAll(); return I.class; }
     }
 
+    interface J1 extends I {
+        @DontInline default Class<?> f3() { if (doDeopt) WB.deoptimizeAll(); return J1.class; }
+    }
+
+    interface J2 extends I {
+        @DontInline default Class<?> f3() { if (doDeopt) WB.deoptimizeAll(); return J2.class; }
+    }
+
+    interface J3 extends I {
+        @DontInline default Class<?> f3() { if (doDeopt) WB.deoptimizeAll(); return J3.class; }
+    }
+
+    static class Q1 extends T implements J1 {}
+    static class Q2 extends T implements J2 {}
+    static class Q3 extends T implements J3 {}
+
     @DontInline
-    static void linkToVirtual(Object obj, Class<?> extecpted) {
+    static void linkToVirtual(T recv, Class<?> expected) {
         try {
-            Class<?> cls = (Class<?>)virtualMH.invokeExact((T)obj);
-            assertEquals(cls, obj.getClass());
+            Class<?> cls = (Class<?>)virtualMH.invokeExact(recv);
+            assertEquals(cls, expected);
         } catch (Throwable e) {
             throw new Error(e);
         }
     }
 
     @DontInline
-    static void linkToInterface(Object obj, Class<?> expected) {
+    static void linkToVirtualDefault(T recv, Class<?> expected) {
         try {
-            Class<?> cls = (Class<?>)intfMH.invokeExact((I)obj);
+            Class<?> cls = (Class<?>)defaultMH.invokeExact(recv);
+            assertEquals(cls, expected);
+        } catch (Throwable e) {
+            throw new Error(e);
+        }
+    }
+
+    @DontInline
+    static void linkToInterface(I recv, Class<?> expected) {
+        try {
+            Class<?> cls = (Class<?>)intfMH.invokeExact(recv);
             assertEquals(cls, expected);
         } catch (Throwable e) {
             throw new Error(e);
@@ -127,9 +158,9 @@
     }
 
     @DontInline
-    static void linkToSpecial(Object obj, Class<?> expected) {
+    static void linkToSpecial(T recv, Class<?> expected) {
         try {
-            Class<?> cls = (Class<?>)specialMH.invokeExact((T)obj);
+            Class<?> cls = (Class<?>)specialMH.invokeExact(recv);
             assertEquals(cls, expected);
         } catch (Throwable e) {
             throw new Error(e);
@@ -137,6 +168,17 @@
     }
 
     @DontInline
+    static void linkToSpecialIntf(I recv, Class<?> expected) {
+        try {
+            Class<?> cls = (Class<?>)privateMH.invokeExact(recv);
+            assertEquals(cls, expected);
+        } catch (Throwable e) {
+            throw new Error(e);
+        }
+    }
+
+
+    @DontInline
     static void invokeBasic() {
         try {
             Class<?> cls = (Class<?>)MethodHandleHelper.invokeBasicL(basicMH);
@@ -171,13 +213,33 @@
 
         // Monomorphic case (optimized virtual call)
         run(() -> linkToVirtual(new T(), T.class));
+        run(() -> linkToVirtualDefault(new T(), I.class));
 
-        // Megamorphic case (virtual call)
-        Object[] recv = new Object[] { new T(), new P1(), new P2() };
+        // Megamorphic case (optimized virtual call)
+        run(() -> {
+            linkToVirtual(new T() {}, T.class);
+            linkToVirtual(new T() {}, T.class);
+            linkToVirtual(new T() {}, T.class);
+        });
+
         run(() -> {
-            for (Object r : recv) {
-                linkToVirtual(r, r.getClass());
-            }});
+            linkToVirtualDefault(new T(){}, I.class);
+            linkToVirtualDefault(new T(){}, I.class);
+            linkToVirtualDefault(new T(){}, I.class);
+        });
+
+        // Megamorphic case (virtual call), multiple implementations
+        run(() -> {
+            linkToVirtual(new T(),  T.class);
+            linkToVirtual(new P1(), P1.class);
+            linkToVirtual(new P2(), P2.class);
+        });
+
+        run(() -> {
+            linkToVirtualDefault(new Q1(), J1.class);
+            linkToVirtualDefault(new Q2(), J2.class);
+            linkToVirtualDefault(new Q3(), J3.class);
+        });
     }
 
     static void testInterface() {
@@ -190,17 +252,18 @@
         run(() -> linkToInterface(new T(), I.class));
 
         // Megamorphic case (virtual call)
-        Object[][] recv = new Object[][] {{new T(), I.class}, {new P1(), P1.class}, {new P2(), P2.class}};
         run(() -> {
-            for (Object[] r : recv) {
-                linkToInterface(r[0], (Class<?>)r[1]);
-            }});
+            linkToInterface(new T(),  I.class);
+            linkToInterface(new P1(), P1.class);
+            linkToInterface(new P2(), P2.class);
+        });
     }
 
     static void testSpecial() {
         System.out.println("linkToSpecial");
         // Monomorphic case (optimized virtual call)
         run(() -> linkToSpecial(new T(), T.class));
+        run(() -> linkToSpecialIntf(new T(), I.class));
     }
 
     static void testStatic() {
--- a/test/hotspot/jtreg/gc/TestAgeOutput.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/TestAgeOutput.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -32,8 +32,20 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -XX:+UseSerialGC TestAgeOutput UseSerialGC
+ * @run main/othervm -XX:+UseG1GC TestAgeOutput UseG1GC
+ */
+
+/*
+ * @test TestAgeOutputCMS
+ * @bug 8164936
+ * @key gc
+ * @comment Graal does not support CMS
+ * @requires vm.gc=="null" & !vm.graal.enabled
+ * @modules java.base/jdk.internal.misc
+ * @library /test/lib
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -XX:+UseConcMarkSweepGC TestAgeOutput UseConcMarkSweepGC
- * @run main/othervm -XX:+UseG1GC TestAgeOutput UseG1GC
  */
 
 import sun.hotspot.WhiteBox;
--- a/test/hotspot/jtreg/gc/TestGenerationPerfCounter.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/TestGenerationPerfCounter.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -38,8 +38,21 @@
  * @run main/othervm -XX:+UsePerfData -XX:+UseSerialGC TestGenerationPerfCounter
  * @run main/othervm -XX:+UsePerfData -XX:+UseParallelGC TestGenerationPerfCounter
  * @run main/othervm -XX:+UsePerfData -XX:+UseG1GC TestGenerationPerfCounter
+ */
+
+/* @test TestGenerationPerfCounterCMS
+ * @bug 8080345
+ * @comment Graal does not support CMS
+ * @requires vm.gc=="null" & !vm.graal.enabled
+ * @library /test/lib /
+ * @summary Tests that the sun.gc.policy.generations returns 2 for all GCs.
+ * @modules java.base/jdk.internal.misc
+ *          java.compiler
+ *          java.management/sun.management
+ *          jdk.internal.jvmstat/sun.jvmstat.monitor
  * @run main/othervm -XX:+UsePerfData -XX:+UseConcMarkSweepGC TestGenerationPerfCounter
  */
+
 public class TestGenerationPerfCounter {
     public static void main(String[] args) throws Exception {
         long numGenerations =
--- a/test/hotspot/jtreg/gc/TestMemoryInitializationWithCMS.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/TestMemoryInitializationWithCMS.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,6 +1,5 @@
-
 /*
- * Copyright (c) 2002, 2017 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018 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
@@ -26,7 +25,7 @@
  * @test TestMemoryInitializationWithCMS
  * @key gc
  * @bug 4668531
- * @requires vm.debug & vm.gc.ConcMarkSweep
+ * @requires vm.debug & vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @summary Simple test for -XX:+CheckMemoryInitialization doesn't crash VM
  * @run main/othervm -XX:+UseConcMarkSweepGC -XX:+CheckMemoryInitialization TestMemoryInitializationWithCMS
  */
--- a/test/hotspot/jtreg/gc/TestMemoryMXBeansAndPoolsPresence.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/TestMemoryMXBeansAndPoolsPresence.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -35,11 +35,20 @@
  *          java.management
  * @requires vm.gc == null
  * @run main/othervm -XX:+UseG1GC TestMemoryMXBeansAndPoolsPresence G1
- * @run main/othervm -XX:+UseConcMarkSweepGC TestMemoryMXBeansAndPoolsPresence CMS
  * @run main/othervm -XX:+UseParallelGC TestMemoryMXBeansAndPoolsPresence Parallel
  * @run main/othervm -XX:+UseSerialGC TestMemoryMXBeansAndPoolsPresence Serial
  */
 
+/* @test TestMemoryMXBeansAndPoolsPresenceCMS
+ * @bug 8191564
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ * @comment Graal does not support CMS
+ * @requires vm.gc == null & !vm.graal.enabled
+ * @run main/othervm -XX:+UseConcMarkSweepGC TestMemoryMXBeansAndPoolsPresence CMS
+ */
+
 class GCBeanDescription {
     public String name;
     public String[] poolNames;
--- a/test/hotspot/jtreg/gc/TestNumWorkerOutput.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/TestNumWorkerOutput.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -31,8 +31,20 @@
  * @library /test/lib
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -XX:+UseG1GC TestNumWorkerOutput UseG1GC
+ */
+
+/*
+ * @test TestNumWorkerOutputCMS
+ * @bug 8165292
+ * @key gc
+ * @comment Graal does not support CMS
+ * @requires vm.gc=="null" & !vm.graal.enabled
+ * @modules java.base/jdk.internal.misc
+ * @library /test/lib
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -XX:+UseConcMarkSweepGC TestNumWorkerOutput UseConcMarkSweepGC
- * @run main/othervm -XX:+UseG1GC TestNumWorkerOutput UseG1GC
  */
 
 import sun.hotspot.WhiteBox;
--- a/test/hotspot/jtreg/gc/TestSystemGC.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/TestSystemGC.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -30,14 +30,21 @@
  * @run main/othervm -XX:+UseSerialGC TestSystemGC
  * @run main/othervm -XX:+UseParallelGC TestSystemGC
  * @run main/othervm -XX:+UseParallelGC -XX:-UseParallelOldGC TestSystemGC
- * @run main/othervm -XX:+UseConcMarkSweepGC TestSystemGC
- * @run main/othervm -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent TestSystemGC
  * @run main/othervm -XX:+UseG1GC TestSystemGC
  * @run main/othervm -XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent TestSystemGC
  * @run main/othervm -XX:+UseLargePages TestSystemGC
  * @run main/othervm -XX:+UseLargePages -XX:+UseLargePagesInMetaspace TestSystemGC
  */
 
+/*
+ * @test TestSystemGCCMS
+ * @key gc
+ * @comment Graal does not support CMS
+ * @requires vm.gc=="null" & !vm.graal.enabled
+ * @run main/othervm -XX:+UseConcMarkSweepGC TestSystemGC
+ * @run main/othervm -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent TestSystemGC
+ */
+
 public class TestSystemGC {
   public static void main(String args[]) throws Exception {
     System.gc();
--- a/test/hotspot/jtreg/gc/arguments/TestAlignmentToUseLargePages.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/arguments/TestAlignmentToUseLargePages.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -34,10 +34,18 @@
  * @run main/othervm -Xms71M -Xmx91M -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:-UseLargePages TestAlignmentToUseLargePages
  * @run main/othervm -Xms71M -Xmx91M -XX:+UseSerialGC -XX:+UseLargePages TestAlignmentToUseLargePages
  * @run main/othervm -Xms71M -Xmx91M -XX:+UseSerialGC -XX:-UseLargePages TestAlignmentToUseLargePages
+ * @run main/othervm -Xms71M -Xmx91M -XX:+UseG1GC -XX:+UseLargePages TestAlignmentToUseLargePages
+ * @run main/othervm -Xms71M -Xmx91M -XX:+UseG1GC -XX:-UseLargePages TestAlignmentToUseLargePages
+ */
+
+/**
+ * @test TestAlignmentToUseLargePagesCMS
+ * @key gc regression
+ * @bug 8024396
+ * @comment Graal does not support CMS
+ * @requires vm.gc=="null" & !vm.graal.enabled
  * @run main/othervm -Xms71M -Xmx91M -XX:+UseConcMarkSweepGC -XX:+UseLargePages TestAlignmentToUseLargePages
  * @run main/othervm -Xms71M -Xmx91M -XX:+UseConcMarkSweepGC -XX:-UseLargePages TestAlignmentToUseLargePages
- * @run main/othervm -Xms71M -Xmx91M -XX:+UseG1GC -XX:+UseLargePages TestAlignmentToUseLargePages
- * @run main/othervm -Xms71M -Xmx91M -XX:+UseG1GC -XX:-UseLargePages TestAlignmentToUseLargePages
  */
 
 public class TestAlignmentToUseLargePages {
--- a/test/hotspot/jtreg/gc/arguments/TestCMSHeapSizeFlags.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/arguments/TestCMSHeapSizeFlags.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -25,7 +25,7 @@
  * @test TestCMSHeapSizeFlags
  * @key gc
  * @bug 8006088
- * @requires vm.gc.ConcMarkSweep
+ * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @summary Tests argument processing for initial and maximum heap size for the CMS collector
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
--- a/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -27,16 +27,28 @@
  * @bug 7057939
  * @summary Make sure that MaxNewSize always has a useful value after argument
  * processing.
+ * @requires vm.gc=="null"
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
  * @run main TestMaxNewSize -XX:+UseSerialGC
  * @run main TestMaxNewSize -XX:+UseParallelGC
- * @run main TestMaxNewSize -XX:+UseConcMarkSweepGC
  * @run main TestMaxNewSize -XX:+UseG1GC
  * @author thomas.schatzl@oracle.com, jesper.wilhelmsson@oracle.com
  */
 
+/*
+ * @test TestMaxNewSizeCMS
+ * @key gc
+ * @bug 7057939
+ * @comment Graal does not support CMS
+ * @requires vm.gc=="null" & !vm.graal.enabled
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ * @run main TestMaxNewSize -XX:+UseConcMarkSweepGC
+ */
+
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
--- a/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsErgo.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsErgo.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -26,6 +26,7 @@
  * @key gc
  * @bug 8010722
  * @summary Tests ergonomics for UseCompressedOops.
+ * @requires vm.gc=="null"
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management/sun.management
@@ -35,8 +36,22 @@
  * @run main/othervm TestUseCompressedOopsErgo -XX:+UseG1GC
  * @run main/othervm TestUseCompressedOopsErgo -XX:+UseParallelGC
  * @run main/othervm TestUseCompressedOopsErgo -XX:+UseParallelGC -XX:-UseParallelOldGC
+ * @run main/othervm TestUseCompressedOopsErgo -XX:+UseSerialGC
+ */
+
+/*
+ * @test TestUseCompressedOopsErgoCMS
+ * @key gc
+ * @bug 8010722
+ * @comment Graal does not support CMS
+ * @requires vm.gc=="null" & !vm.graal.enabled
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ *          java.management/sun.management
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm TestUseCompressedOopsErgo -XX:+UseConcMarkSweepGC
- * @run main/othervm TestUseCompressedOopsErgo -XX:+UseSerialGC
  */
 
 public class TestUseCompressedOopsErgo {
--- a/test/hotspot/jtreg/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, 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
@@ -25,6 +25,7 @@
  * @test
  * @key gc
  * @bug 8049831
+ * @requires !vm.graal.enabled
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
--- a/test/hotspot/jtreg/gc/class_unloading/TestClassUnloadingDisabled.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/class_unloading/TestClassUnloadingDisabled.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -44,6 +44,22 @@
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:-ClassUnloading -XX:+UseParallelGC TestClassUnloadingDisabled
  *
+ */
+
+/*
+ * @test
+ * @key gc
+ * @bug 8114823
+ * @comment Graal does not support CMS
+ * @requires vm.gc=="null" & !vm.graal.enabled
+ * @requires vm.opt.ExplicitGCInvokesConcurrent != true
+ * @requires vm.opt.ClassUnloading != true
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:-ClassUnloading -XX:+UseConcMarkSweepGC TestClassUnloadingDisabled
  */
--- a/test/hotspot/jtreg/gc/cms/DisableResizePLAB.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/cms/DisableResizePLAB.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, 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
@@ -26,7 +26,7 @@
  * @key gc
  * @bug 8060467
  * @author filipp.zhinkin@oracle.com, john.coomes@oracle.com
- * @requires vm.gc.ConcMarkSweep
+ * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @summary Run CMS with PLAB resizing disabled and a small OldPLABSize
  * @run main/othervm -XX:+UseConcMarkSweepGC -XX:-ResizePLAB -XX:OldPLABSize=1k -Xmx256m -Xlog:gc=debug DisableResizePLAB
  */
--- a/test/hotspot/jtreg/gc/cms/GuardShrinkWarning.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/cms/GuardShrinkWarning.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -26,6 +26,7 @@
  * @key gc regression
  * @summary Remove warning about CMS generation shrinking.
  * @bug 8012111
+ * @requires !vm.graal.enabled
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
--- a/test/hotspot/jtreg/gc/cms/TestBubbleUpRef.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/cms/TestBubbleUpRef.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, 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
@@ -28,7 +28,7 @@
 
 /*
  * @test
- * @requires vm.gc.ConcMarkSweep
+ * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @key cte_test
  * @bug 4950157
  * @summary Stress the behavior of ergonomics when the heap is nearly full and
--- a/test/hotspot/jtreg/gc/cms/TestCMSScavengeBeforeRemark.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/cms/TestCMSScavengeBeforeRemark.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -25,7 +25,7 @@
  * @test TestCMSScavengeBeforeRemark
  * @key gc
  * @bug 8139868
- * @requires vm.gc.ConcMarkSweep
+ * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @summary Run CMS with CMSScavengeBeforeRemark
  * @run main/othervm -XX:+UseConcMarkSweepGC -XX:+CMSScavengeBeforeRemark -XX:+ExplicitGCInvokesConcurrent -Xmx256m -Xlog:gc=debug TestCMSScavengeBeforeRemark
  */
--- a/test/hotspot/jtreg/gc/cms/TestMBeanCMS.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/cms/TestMBeanCMS.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, 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,7 @@
 /*
  * @test TestMBeanCMS.java
  * @bug 6581734
- * @requires vm.gc.ConcMarkSweep
+ * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @summary CMS Old Gen's collection usage is zero after GC which is incorrect
  * @modules java.management
  * @run main/othervm -Xmx512m -verbose:gc -XX:+UseConcMarkSweepGC TestMBeanCMS
--- a/test/hotspot/jtreg/gc/concurrent_phase_control/TestConcurrentPhaseControlCMS.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/concurrent_phase_control/TestConcurrentPhaseControlCMS.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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,7 @@
 /*
  * @test TestConcurrentPhaseControlCMS
  * @bug 8169517
- * @requires vm.gc.ConcMarkSweep
+ * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @summary Verify CMS GC doesn't support WhiteBox concurrent phase control.
  * @key gc
  * @modules java.base
--- a/test/hotspot/jtreg/gc/metaspace/TestMetaspaceCMSCancel.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/metaspace/TestMetaspaceCMSCancel.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -28,6 +28,7 @@
 /* @test TestMetaspaceCMSCancel
  * @bug 8026752
  * @summary Tests cancel of CMS concurrent cycle for Metaspace after a full GC
+ * @requires !vm.graal.enabled
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  * @build sun.hotspot.WhiteBox
--- a/test/hotspot/jtreg/gc/startup_warnings/TestCMS.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/startup_warnings/TestCMS.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -22,14 +22,15 @@
  */
 
 /*
-* @test TestCMS
-* @key gc
-* @bug 8006398 8155948 8179013
-* @summary Test that CMS prints a warning message
-* @library /test/lib
-* @modules java.base/jdk.internal.misc
-*          java.management
-*/
+ * @test TestCMS
+ * @key gc
+ * @bug 8006398 8155948 8179013
+ * @summary Test that CMS prints a warning message
+ * @requires !vm.graal.enabled
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ */
 
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java	Mon Jun 11 09:29:44 2018 +0200
@@ -25,8 +25,7 @@
  * @test TestReclaimStringsLeaksMemory
  * @bug 8180048
  * @summary Ensure that during a Full GC interned string memory is reclaimed completely.
- * @requires vm.gc=="null"
- * @requires !vm.debug
+ * @requires vm.gc=="null" & !vm.graal.enabled & !vm.debug
  * @key gc
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
--- a/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasherWithCMS.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasherWithCMS.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -28,7 +28,7 @@
  * @test TestGCBasherWithCMS
  * @key gc stress
  * @requires vm.gc.ConcMarkSweep
- * @requires vm.flavor == "server" & !vm.emulatedClient
+ * @requires vm.flavor == "server" & !vm.emulatedClient & !vm.graal.enabled
  * @summary Stress the CMS GC by trying to make old objects more likely to be garbage than young objects.
  * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx256m -server -XX:+UseConcMarkSweepGC TestGCBasherWithCMS 120000
  */
--- a/test/hotspot/jtreg/gc/stress/gclocker/TestGCLockerWithCMS.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/stress/gclocker/TestGCLockerWithCMS.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -25,7 +25,7 @@
 /*
  * @test TestGCLockerWithCMS
  * @key gc
- * @requires vm.gc.ConcMarkSweep
+ * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @summary Stress CMS' GC locker by calling GetPrimitiveArrayCritical while concurrently filling up old gen.
  * @run main/native/othervm/timeout=200 -Xlog:gc*=info -Xms1500m -Xmx1500m -XX:+UseConcMarkSweepGC TestGCLockerWithCMS
  */
--- a/test/hotspot/jtreg/gc/stress/gcold/TestGCOldWithCMS.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/stress/gcold/TestGCOldWithCMS.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -25,7 +25,7 @@
 /*
  * @test TestGCOldWithCMS
  * @key gc
- * @requires vm.gc.ConcMarkSweep
+ * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @summary Stress the CMS GC by trying to make old objects more likely to be garbage than young objects.
  * @run main/othervm -Xmx384M -XX:+UseConcMarkSweepGC TestGCOldWithCMS 50 1 20 10 10000
  */
--- a/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithCMS.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithCMS.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -26,7 +26,7 @@
  * @test TestSystemGCWithCMS
  * @key gc stress
  * @bug 8190703
- * @requires vm.gc.ConcMarkSweep
+ * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @summary Stress the CMS GC full GC by allocating objects of different lifetimes concurrently with System.gc().
  * @run main/othervm/timeout=300 -Xlog:gc*=info -Xmx512m -XX:+UseConcMarkSweepGC TestSystemGCWithCMS 270
  */
--- a/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, 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
@@ -28,7 +28,9 @@
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main UseCompressedOops
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. UseCompressedOops
  */
 import java.util.ArrayList;
 import java.util.Collections;
@@ -36,6 +38,8 @@
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
 
+import sun.hotspot.code.Compiler;
+
 public class UseCompressedOops {
 
     public static void main(String[] args) throws Exception {
@@ -51,7 +55,9 @@
         testCompressedOopsModes(args);
         // Test GCs.
         testCompressedOopsModes(args, "-XX:+UseG1GC");
-        testCompressedOopsModes(args, "-XX:+UseConcMarkSweepGC");
+        if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
+            testCompressedOopsModes(args, "-XX:+UseConcMarkSweepGC");
+        }
         testCompressedOopsModes(args, "-XX:+UseSerialGC");
         testCompressedOopsModes(args, "-XX:+UseParallelGC");
         testCompressedOopsModes(args, "-XX:+UseParallelOldGC");
--- a/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java	Mon Jun 11 09:29:44 2018 +0200
@@ -26,13 +26,17 @@
  * @bug 8174749
  * @summary MemberNameTable should reuse entries
  * @library /test/lib
- * @run main MemberNameLeak
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. MemberNameLeak
  */
 
 import java.lang.invoke.*;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 
+import sun.hotspot.code.Compiler;
+
 public class MemberNameLeak {
     static class Leak {
       public void callMe() {
@@ -69,6 +73,8 @@
         test("-XX:+UseG1GC");
         test("-XX:+UseParallelGC");
         test("-XX:+UseSerialGC");
-        test("-XX:+UseConcMarkSweepGC");
+        if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
+            test("-XX:+UseConcMarkSweepGC");
+        }
     }
 }
--- a/test/hotspot/jtreg/runtime/appcds/CommandLineFlagCombo.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/CommandLineFlagCombo.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, 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
@@ -32,14 +32,18 @@
  * @modules java.base/jdk.internal.misc
  *          java.management
  *          jdk.jartool/sun.tools.jar
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  * @compile test-classes/Hello.java
- * @run main/timeout=240 CommandLineFlagCombo
+ * @run main/othervm/timeout=240 -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. CommandLineFlagCombo
  */
 
 import jdk.test.lib.BuildHelper;
 import jdk.test.lib.Platform;
 import jdk.test.lib.process.OutputAnalyzer;
 
+import sun.hotspot.code.Compiler;
+
 public class CommandLineFlagCombo {
 
     // shared base address test table
@@ -122,6 +126,11 @@
             System.out.println("Test case not applicable on non-commercial builds");
             return true;
         }
+        if (Compiler.isGraalEnabled() && testEntry.equals("-XX:+UseConcMarkSweepGC"))
+        {
+            System.out.println("Graal does not support CMS");
+            return true;
+        }
 
         return false;
     }
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java	Mon Jun 11 09:29:44 2018 +0200
@@ -32,13 +32,17 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.management
  *          jdk.jartool/sun.tools.jar
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  * @build HelloString
- * @run main IncompatibleOptions
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions
  */
 
 import jdk.test.lib.Asserts;
 import jdk.test.lib.process.OutputAnalyzer;
 
+import sun.hotspot.code.Compiler;
+
 public class IncompatibleOptions {
     static final String COOPS_DUMP_WARNING =
         "Cannot dump shared archive when UseCompressedOops or UseCompressedClassPointers is off";
@@ -62,7 +66,9 @@
         // incompatible GCs
         testDump(2, "-XX:+UseParallelGC", "", GC_WARNING, false);
         testDump(3, "-XX:+UseSerialGC", "", GC_WARNING, false);
-        testDump(4, "-XX:+UseConcMarkSweepGC", "", GC_WARNING, false);
+        if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
+            testDump(4, "-XX:+UseConcMarkSweepGC", "", GC_WARNING, false);
+        }
 
         // ======= archive with compressed oops, run w/o
         testDump(5, "-XX:+UseG1GC", "-XX:+UseCompressedOops", null, false);
@@ -73,7 +79,9 @@
         // Still run, to ensure no crash or exception
         testExec(6, "-XX:+UseParallelGC", "", "", false);
         testExec(7, "-XX:+UseSerialGC", "", "", false);
-        testExec(8, "-XX:+UseConcMarkSweepGC", "", "", false);
+        if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
+            testExec(8, "-XX:+UseConcMarkSweepGC", "", "", false);
+        }
 
         // Test various oops encodings, by varying ObjectAlignmentInBytes and heap sizes
         testDump(9, "-XX:+UseG1GC", "-XX:ObjectAlignmentInBytes=8", null, false);
--- a/test/hotspot/jtreg/runtime/signal/TestSigalrm.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigalrm.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigalrm01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigbus.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigbus.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigbus01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigcld.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigcld.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigcld01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigcont.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigcont.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigcont01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigemt.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigemt.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigemt01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigfpe.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigfpe.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigfpe01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigfreeze.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigfreeze.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigfreeze01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSighup.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSighup.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sighup01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigill.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigill.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigill01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigint.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigint.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigint01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigiot.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigiot.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigiot01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSiglost.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSiglost.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/siglost01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSiglwp.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSiglwp.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/siglwp01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigpipe.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigpipe.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigpipe01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigpoll.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigpoll.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigpoll01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigprof.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigprof.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigprof01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigpwr.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigpwr.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigpwr01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigquit.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigquit.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigquit01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigsegv.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigsegv.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigsegv01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigstop.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigstop.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigstop01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigsys.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigsys.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigsys01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigterm.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigterm.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigterm01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigthaw.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigthaw.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigthaw01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigtrap.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigtrap.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigtrap01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigtstp.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigtstp.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigtstp01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigttin.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigttin.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigttin01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigttou.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigttou.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigttou01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigurg.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigurg.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigurg01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigusr1.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigusr1.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigusr101.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigusr2.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigusr2.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigusr201.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigvtalrm.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigvtalrm.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigvtalrm01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigwinch.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigwinch.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigwinch01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigxcpu.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigxcpu.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigxcpu01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigxfsz.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigxfsz.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigxfsz01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- a/test/hotspot/jtreg/runtime/signal/TestSigxres.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/runtime/signal/TestSigxres.java	Mon Jun 11 09:29:44 2018 +0200
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @requires os.family != "windows"
+ * @requires os.family != "windows" & os.family != "aix"
  *
  * @summary converted from VM testbase runtime/signal/sigxres01.
  * VM testbase keywords: [signal, runtime, linux, solaris, macosx]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/serviceability/dcmd/vm/ClassLoaderHierarchyTest.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, SAP SE. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary Test of diagnostic command VM.classloaders
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.internal.jvmstat/sun.jvmstat.monitor
+ * @run testng ClassLoaderHierarchyTest
+ */
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+
+public class ClassLoaderHierarchyTest {
+
+//+-- <bootstrap>
+//      |
+//      +-- "platform", jdk.internal.loader.ClassLoaders$PlatformClassLoader
+//      |     |
+//      |     +-- "app", jdk.internal.loader.ClassLoaders$AppClassLoader
+//      |
+//      +-- jdk.internal.reflect.DelegatingClassLoader
+//      |
+//      +-- "Kevin", ClassLoaderHierarchyTest$TestClassLoader
+//      |
+//      +-- ClassLoaderHierarchyTest$TestClassLoader
+//            |
+//            +-- "Bill", ClassLoaderHierarchyTest$TestClassLoader
+
+    public void run(CommandExecutor executor) throws ClassNotFoundException {
+
+        ClassLoader unnamed_cl = new TestClassLoader(null, null);
+        Class<?> c1 = Class.forName("TestClass2", true, unnamed_cl);
+        if (c1.getClassLoader() != unnamed_cl) {
+            Assert.fail("TestClass defined by wrong classloader: " + c1.getClassLoader());
+        }
+
+        ClassLoader named_cl = new TestClassLoader("Kevin", null);
+        Class<?> c2 = Class.forName("TestClass2", true, named_cl);
+        if (c2.getClassLoader() != named_cl) {
+            Assert.fail("TestClass defined by wrong classloader: " + c2.getClassLoader());
+        }
+
+        ClassLoader named_child_cl = new TestClassLoader("Bill", unnamed_cl);
+        Class<?> c3 = Class.forName("TestClass2", true, named_child_cl);
+        if (c3.getClassLoader() != named_child_cl) {
+            Assert.fail("TestClass defined by wrong classloader: " + c3.getClassLoader());
+        }
+
+        // First test: simple output, no classes displayed
+        OutputAnalyzer output = executor.execute("VM.classloaders");
+        output.shouldContain("<bootstrap>");
+        output.shouldMatch(".*TestClassLoader");
+        output.shouldMatch("Kevin.*TestClassLoader");
+        output.shouldMatch("Bill.*TestClassLoader");
+
+        // Second test: print with classes.
+        output = executor.execute("VM.classloaders show-classes");
+        output.shouldContain("<bootstrap>");
+        output.shouldContain("java.lang.Object");
+        output.shouldMatch(".*TestClassLoader");
+        output.shouldMatch("Kevin.*TestClassLoader");
+        output.shouldMatch("Bill.*TestClassLoader");
+        output.shouldContain("TestClass2");
+    }
+
+    static class TestClassLoader extends ClassLoader {
+
+        public TestClassLoader() {
+            super();
+        }
+
+        public TestClassLoader(String name, ClassLoader parent) {
+            super(name, parent);
+        }
+
+        public static final String CLASS_NAME = "TestClass2";
+
+        static ByteBuffer readClassFile(String name)
+        {
+            File f = new File(System.getProperty("test.classes", "."),
+                              name);
+            try (FileInputStream fin = new FileInputStream(f);
+                 FileChannel fc = fin.getChannel())
+            {
+                return fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size());
+            } catch (IOException e) {
+                Assert.fail("Can't open file: " + name, e);
+            }
+
+            /* Will not reach here as Assert.fail() throws exception */
+            return null;
+        }
+
+        protected Class<?> loadClass(String name, boolean resolve)
+            throws ClassNotFoundException
+        {
+            Class<?> c;
+            if (!CLASS_NAME.equals(name)) {
+                c = super.loadClass(name, resolve);
+            } else {
+                // should not delegate to the system class loader
+                c = findClass(name);
+                if (resolve) {
+                    resolveClass(c);
+                }
+            }
+            return c;
+        }
+
+        protected Class<?> findClass(String name)
+            throws ClassNotFoundException
+        {
+            if (!CLASS_NAME.equals(name)) {
+                throw new ClassNotFoundException("Unexpected class: " + name);
+            }
+            return defineClass(name, readClassFile(name + ".class"), null);
+        }
+
+    }
+
+    @Test
+    public void jmx() throws ClassNotFoundException {
+        run(new JMXExecutor());
+    }
+
+}
+
+class TestClass2 {
+    static {
+        Runnable r = () -> System.out.println("Hello");
+        r.run();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/serviceability/jvmti/GetSystemProperty/JvmtiGetSystemPropertyTest.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8203329
+ * @summary Verifies the JVMTI GetSystemProperty API returns the updated java.vm.info value
+ * @library /test/lib
+ * @run main/othervm/native -agentlib:JvmtiGetSystemPropertyTest JvmtiGetSystemPropertyTest
+ *
+ */
+
+public class JvmtiGetSystemPropertyTest {
+    private static native String getSystemProperty();
+
+    public static void main(String[] args) throws Exception {
+        String vm_info = System.getProperty("java.vm.info");
+        String vm_info_jvmti = getSystemProperty();
+        System.out.println("java.vm.info from java:  " + vm_info);
+        System.out.println("java.vm.info from jvmti: " + vm_info_jvmti);
+        if (!vm_info.equals(vm_info_jvmti)) {
+            throw new RuntimeException("java.vm.info poperties not equal: \"" +
+                                       vm_info + "\" != \"" + vm_info_jvmti + "\"");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/serviceability/jvmti/GetSystemProperty/libJvmtiGetSystemPropertyTest.c	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <jvmti.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static jvmtiEnv *jvmti = NULL;
+
+JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
+  int err = (*jvm)->GetEnv(jvm, (void**) &jvmti, JVMTI_VERSION_9);
+  if (err != JNI_OK) {
+    return JNI_ERR;
+  }
+  return JNI_OK;
+}
+
+JNIEXPORT jstring JNICALL
+Java_JvmtiGetSystemPropertyTest_getSystemProperty(JNIEnv *env, jclass cls) {
+  jvmtiError err;
+  char* prop_value;
+
+  err = (*jvmti)->GetSystemProperty(jvmti, "java.vm.info", &prop_value);
+  if (err != JVMTI_ERROR_NONE) {
+    return NULL;
+  }
+
+  return (*env)->NewStringUTF(env, prop_value);
+}
+
+#ifdef __cplusplus
+}
+#endif
--- a/test/hotspot/jtreg/serviceability/sa/TestUniverse.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/serviceability/sa/TestUniverse.java	Mon Jun 11 09:29:44 2018 +0200
@@ -21,6 +21,8 @@
  * questions.
  */
 
+import sun.hotspot.code.Compiler;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.io.IOException;
@@ -37,7 +39,9 @@
  * @bug 8190307
  * @library /test/lib
  * @build jdk.test.lib.apps.*
- * @run main/othervm TestUniverse
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. TestUniverse
  */
 
 public class TestUniverse {
@@ -138,7 +142,9 @@
             test("-XX:+UseG1GC");
             test("-XX:+UseParallelGC");
             test("-XX:+UseSerialGC");
-            test("-XX:+UseConcMarkSweepGC");
+            if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
+              test("-XX:+UseConcMarkSweepGC");
+            }
             test("-XX:+UseEpsilonGC");
         } catch (Exception e) {
             throw new Error("Test failed with " + e);
--- a/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/TestsGenerator.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/TestsGenerator.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -37,6 +37,7 @@
 import jdk.test.lib.jittester.utils.PseudoRandom;
 
 public abstract class TestsGenerator implements BiConsumer<IRNode, IRNode> {
+    private static final int DEFAULT_JTREG_TIMEOUT = 120;
     protected static final String JAVA_BIN = getJavaPath();
     protected static final String JAVAC = Paths.get(JAVA_BIN, "javac").toString();
     protected static final String JAVA = Paths.get(JAVA_BIN, "java").toString();
@@ -73,15 +74,17 @@
         pb.redirectError(new File(name + ".err"));
         pb.redirectOutput(new File(name + ".out"));
         Process process = pb.start();
-        if (process.waitFor(Automatic.MINUTES_TO_WAIT, TimeUnit.MINUTES)) {
-            try (FileWriter file = new FileWriter(name + ".exit")) {
-                file.write(Integer.toString(process.exitValue()));
+        try {
+            if (process.waitFor(DEFAULT_JTREG_TIMEOUT, TimeUnit.SECONDS)) {
+                try (FileWriter file = new FileWriter(name + ".exit")) {
+                    file.write(Integer.toString(process.exitValue()));
+                }
+                return process.exitValue();
             }
-            return process.exitValue();
-        } else {
+        } finally {
             process.destroyForcibly();
-            return -1;
         }
+        return -1;
     }
 
     protected static void compilePrinter() {
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic002.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic002.java	Mon Jun 11 09:29:44 2018 +0200
@@ -33,55 +33,16 @@
 import java.io.*;
 
 public class issynthetic002 {
-    final static String METHOD_NAME[] = {
-        "<init>",
-        "Mv",
-        "Mz", "Mz1", "Mz2",
-        "Mb", "Mb1", "Mb2",
-        "Mc", "Mc1", "Mc2",
-        "Md", "Md1", "Md2",
-        "Mf", "Mf1", "Mf2",
-        "Mi", "Mi1", "Mi2",
-        "Ml", "Ml1", "Ml2",
-        "Mr", "Mr1", "Mr2",
 
-        "MvF", "MlF", "MlF1", "MlF2",
-        "MvN", "MlN", "MlN1", "MlN2",
-        "MvS", "MlS", "MlS1", "MlS2",
-        "MvI", "MlI", "MlI1", "MlI2",
-        "MvY", "MlY", "MlY1", "MlY2",
-        "MvU", "MlU", "MlU1", "MlU2",
-        "MvR", "MlR", "MlR1", "MlR2",
-        "MvP", "MlP", "MlP1", "MlP2",
 
-        "MX", "MX1", "MX2",
-        "MO", "MO1", "MO2",
-
-        "MLF", "MLF1", "MLF2",
-        "MLN", "MLN1", "MLN2",
-        "MLS", "MLS1", "MLS2",
-        "MLI", "MLI1", "MLI2",
-        "MLY", "MLY1", "MLY2",
-        "MLU", "MLU1", "MLU2",
-        "MLR", "MLR1", "MLR2",
-        "MLP", "MLP1", "MLP2",
-
-        "ME", "ME1", "ME2",
-        "MEF", "MEF1", "MEF2",
-        "MEN", "MEN1", "MEN2",
-        "MES", "ME1S", "ME2S",
-        "MEI", "MEI1", "MEI2",
-        "MEY", "MEY1", "MEY2",
-        "MEU", "MEU1", "MEU2",
-        "MER", "MER1", "MER2",
-        "MEP", "MEP1", "MEP2"
-    };
+    final static String SYNTHETIC_METHOD_NAME = "test";
+    final static String SYNTHETIC_METHOD_SIGNATURE = "(Ljava/lang/Object;)Ljava/lang/Object;";
 
     private static Log log;
     private final static String prefix = "nsk.jdi.TypeComponent.isSynthetic.";
     private final static String className = "issynthetic002";
-    private final static String debugerName = prefix + className;
-    private final static String debugeeName = debugerName + "a";
+    private final static String debuggerName = prefix + className;
+    private final static String debuggeeName = debuggerName + "a";
     private final static String classToCheckName = prefix + "issynthetic002aClassToCheck";
 
     public static void main(String argv[]) {
@@ -92,38 +53,38 @@
         ArgumentHandler argHandler = new ArgumentHandler(argv);
         log = new Log(out, argHandler);
         Binder binder = new Binder(argHandler, log);
-        Debugee debugee = binder.bindToDebugee(debugeeName
+        Debugee debuggee = binder.bindToDebugee(debuggeeName
                               + (argHandler.verbose() ? " -verbose" : ""));
-        VirtualMachine vm = debugee.VM();
+        VirtualMachine vm = debuggee.VM();
         boolean canGetSynthetic = vm.canGetSyntheticAttribute();
-        IOPipe pipe = new IOPipe(debugee);
+        IOPipe pipe = new IOPipe(debuggee);
         boolean testFailed = false;
         List methods;
         int totalSyntheticMethods = 0;
 
-        log.display("debuger> Value of canGetSyntheticAttribute in current "
+        log.display("debugger> Value of canGetSyntheticAttribute in current "
                   + "VM is " + canGetSynthetic);
 
-        // Connect with debugee and resume it
-        debugee.redirectStderr(out);
-        debugee.resume();
+        // Connect with debuggee and resume it
+        debuggee.redirectStderr(out);
+        debuggee.resume();
         String line = pipe.readln();
         if (line == null) {
-            log.complain("debuger FAILURE> UNEXPECTED debugee's signal - null");
+            log.complain("debugger FAILURE> UNEXPECTED debuggee's signal - null");
             return 2;
         }
         if (!line.equals("ready")) {
-            log.complain("debuger FAILURE> UNEXPECTED debugee's signal - "
+            log.complain("debugger FAILURE> UNEXPECTED debuggee's signal - "
                       + line);
             return 2;
         }
         else {
-            log.display("debuger> debugee's \"ready\" signal recieved.");
+            log.display("debugger> debuggee's \"ready\" signal received.");
         }
 
-        ReferenceType refType = debugee.classByName(classToCheckName);
+        ReferenceType refType = debuggee.classByName(classToCheckName);
         if (refType == null) {
-            log.complain("debuger FAILURE> Class " + classToCheckName
+            log.complain("debugger FAILURE> Class " + classToCheckName
                        + " not found.");
             return 2;
         }
@@ -132,51 +93,50 @@
         try {
             methods = refType.methods();
         } catch (Exception e) {
-            log.complain("debuger FAILURE> Can't get methods from "
+            log.complain("debugger FAILURE> Can't get methods from "
                        + classToCheckName);
-            log.complain("debuger FAILURE> Exception: " + e);
+            log.complain("debugger FAILURE> Exception: " + e);
             return 2;
         }
         int totalMethods = methods.size();
         if (totalMethods < 1) {
-            log.complain("debuger FAILURE> Total number of methods in debuggee "
+            log.complain("debugger FAILURE> Total number of methods in debuggee "
                        + "read " + totalMethods);
             return 2;
         }
-        log.display("debuger> Total methods in debuggee read: "
-                  + totalMethods + " total methods in debuger: "
-                  + METHOD_NAME.length);
+        log.display("debugger> Total methods in debuggee read: "
+                  + totalMethods);
         for (int i = 0; i < totalMethods; i++) {
             Method method = (Method)methods.get(i);
             String name = method.name();
+            String signature = method.signature();
             boolean isSynthetic;
-            boolean isRealSynthetic = true;
 
             try {
                 isSynthetic = method.isSynthetic();
 
                 if (!canGetSynthetic) {
-                    log.complain("debuger FAILURE 1> Value of "
+                    log.complain("debugger FAILURE 1> Value of "
                                + "canGetSyntheticAttribute in current VM is "
                                + "false, so UnsupportedOperationException was "
                                + "expected for " + i + " method " + name);
                     testFailed = true;
                     continue;
                 } else {
-                    log.display("debuger> " + i + " method " + name + " with "
+                    log.display("debugger> " + i + " method " + name + " with "
                               + "synthetic value " + isSynthetic + " read "
                               + "without UnsupportedOperationException");
                 }
             } catch (UnsupportedOperationException e) {
                 if (canGetSynthetic) {
-                    log.complain("debuger FAILURE 2> Value of "
+                    log.complain("debugger FAILURE 2> Value of "
                                + "canGetSyntheticAttribute in current VM is "
                                + "true, but cannot get synthetic for method "
                                + "name.");
-                    log.complain("debuger FAILURE 2> Exception: " + e);
+                    log.complain("debugger FAILURE 2> Exception: " + e);
                     testFailed = true;
                 } else {
-                    log.display("debuger> UnsupportedOperationException was "
+                    log.display("debugger> UnsupportedOperationException was "
                               + "thrown while getting isSynthetic for " + i
                               + " method " + name + " because value "
                               + "canGetSynthetic is false.");
@@ -184,49 +144,39 @@
                 continue;
             }
 
-            // Find out if method exists in list of methods
-            for (int j = 0; j < METHOD_NAME.length; j++) {
-                String nameFromList = METHOD_NAME[j];
-
-                if (nameFromList.equals(name)) {
-                    // Method found in list - is not synthetic
-
-                    isRealSynthetic = false;
-                    break;
-                }
-            }
-
-            if (isRealSynthetic != isSynthetic) {
-                log.complain("debuger FAILURE 3> Method's " + name
-                           + " synthetic is " + isSynthetic + ", but expected "
-                           + "is " + isRealSynthetic);
-                testFailed = true;
-                continue;
-            }
 
             if (isSynthetic) {
-                totalSyntheticMethods++;
+                if (SYNTHETIC_METHOD_NAME.equals(name) && SYNTHETIC_METHOD_SIGNATURE.equals(signature)) {
+                    totalSyntheticMethods++;
+                } else {
+                    testFailed = true;
+                    log.complain("debugger FAILURE 3> Found unexpected synthetic method " + name
+                            + signature);
+                }
             }
         }
 
         if (totalSyntheticMethods == 0) {
-            log.complain("debuger FAILURE 4> Synthetic methods not found.");
+            log.complain("debugger FAILURE 4> Synthetic methods not found.");
+            testFailed = true;
+        } else if (totalSyntheticMethods > 1 ) {
+            log.complain("debugger FAILURE 5> More than one Synthetic method is found.");
             testFailed = true;
         }
 
         pipe.println("quit");
-        debugee.waitFor();
-        int status = debugee.getStatus();
+        debuggee.waitFor();
+        int status = debuggee.getStatus();
         if (testFailed) {
-            log.complain("debuger FAILURE> TEST FAILED");
+            log.complain("debugger FAILURE> TEST FAILED");
             return 2;
         } else {
             if (status == 95) {
-                log.display("debuger> expected Debugee's exit "
+                log.display("debugger> expected Debuggee's exit "
                           + "status - " + status);
                 return 0;
             } else {
-                log.complain("debuger FAILURE> UNEXPECTED Debugee's exit "
+                log.complain("debugger FAILURE> UNEXPECTED Debuggee's exit "
                            + "status (not 95) - " + status);
                 return 2;
             }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic002a.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic002a.java	Mon Jun 11 09:29:44 2018 +0200
@@ -51,7 +51,11 @@
     }
 }
 
-class issynthetic002aClassToCheck {
+interface issynthetic002aClassToCheckIntf<T> {
+    T test(T t);
+}
+
+class issynthetic002aClassToCheck implements issynthetic002aClassToCheckIntf<String> {
     // Not-synthetic methods
 
     // User class and interface
@@ -178,26 +182,13 @@
     private      Inter[]   MEP1(Inter[] E)   { return E; };
     private      Inter[][] MEP2(Inter[][] E) { return E; };
 
-    // Synthetic methods
-
-    private int i;
-    private String s;
-
-    class NestedClass {
-        boolean MS(String str) {
-            // Method uses private variable s from ClassToCheck,
-            // so two synthetic methods must appear in ClassToCheck
 
-            s = s + "NestedClass";
-            return s.equals(str);
-        };
+   // The implementation of the parametrized interface issynthetic002aClassToCheckIntf
+   // triggers the compiler to create the synthetic bridge method
+   // "test(Ljava/lang/Object;)Ljava/lang/Object;".
+    public String test(String s) {
+        return s;
+    }
 
-        boolean Mi(int j) {
-            // Method uses private variable i from ClassToCheck,
-            // so two synthetic methods must appear in ClassToCheck
 
-            i = i + 1;
-            return (i == j);
-        };
-    }
 }
--- a/test/jdk/ProblemList-graal.txt	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/ProblemList-graal.txt	Mon Jun 11 09:29:44 2018 +0200
@@ -68,3 +68,9 @@
 java/lang/ref/OOMEInReferenceHandler.java                               8196611   generic-all
 java/lang/Runtime/exec/LotsOfOutput.java                                8196611   generic-all
 java/util/concurrent/ScheduledThreadPoolExecutor/BasicCancelTest.java   8196611   generic-all
+
+# Next JFR tests fail with Graal. Assuming 8193210.
+jdk/jfr/event/compiler/TestCodeSweeper.java              8193210   generic-all
+jdk/jfr/event/compiler/TestCompilerInlining.java         8193210   generic-all
+jdk/jfr/event/compiler/TestCompilerPhase.java            8193210   generic-all
+
--- a/test/jdk/ProblemList.txt	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/ProblemList.txt	Mon Jun 11 09:29:44 2018 +0200
@@ -545,7 +545,6 @@
 
 com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java 8030957 aix-all
 com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java  8030957 aix-all
-sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java    8174734 generic-all
 
 ############################################################################
 
--- a/test/jdk/TEST.ROOT	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/TEST.ROOT	Mon Jun 11 09:29:44 2018 +0200
@@ -18,7 +18,7 @@
 
 # Tests that must run in othervm mode
 othervm.dirs=java/awt java/beans javax/accessibility javax/imageio javax/sound javax/swing javax/print \
-sun/applet com/apple/laf com/sun/java/accessibility com/sun/java/swing sanity/client demo/jfc \
+com/apple/laf com/sun/java/accessibility com/sun/java/swing sanity/client demo/jfc \
 javax/management com/sun/awt sun/awt sun/java2d javax/xml/jaxp/testng/validation java/lang/ProcessHandle
 
 # Tests that cannot run concurrently
--- a/test/jdk/TEST.groups	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/TEST.groups	Mon Jun 11 09:29:44 2018 +0200
@@ -30,7 +30,7 @@
     :tier1_part1 \
     :tier1_part2 \
     :tier1_part3
-    
+
 tier1_part1 = \
     :jdk_lang
 
@@ -74,7 +74,7 @@
 
 tier2_part3 = \
     :jdk_net
-   
+
 tier3 = \
     :jdk_rmi \
     :jdk_beans \
@@ -354,8 +354,7 @@
     com/sun/awt \
     com/apple/eawt \
     com/apple/laf \
-    sun/awt \
-    sun/applet
+    sun/awt
 
 jdk_2d = \
     javax/print \
--- a/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -25,6 +25,8 @@
  * @test
  * @bug 8028994
  * @author Staffan Larsen
+ * @comment Graal does not support CMS
+ * @requires !vm.graal.enabled
  * @library /lib/testlibrary
  * @modules jdk.attach/sun.tools.attach
  *          jdk.management
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/Desktop/DesktopEventsExceptions/DesktopEventsExceptions.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Desktop;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
+import java.awt.desktop.AboutEvent;
+import java.awt.desktop.AppForegroundEvent;
+import java.awt.desktop.AppHiddenEvent;
+import java.awt.desktop.AppReopenedEvent;
+import java.awt.desktop.OpenFilesEvent;
+import java.awt.desktop.OpenURIEvent;
+import java.awt.desktop.PreferencesEvent;
+import java.awt.desktop.PrintFilesEvent;
+import java.awt.desktop.QuitEvent;
+import java.awt.desktop.ScreenSleepEvent;
+import java.awt.desktop.SystemSleepEvent;
+import java.awt.desktop.UserSessionEvent;
+import java.awt.desktop.UserSessionEvent.Reason;
+import java.io.File;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @test
+ * @bug 8203224
+ * @summary tests that the correct exceptions are thrown by the events classes
+ *          in {code java.awt.desktop} package
+ * @run main/othervm DesktopEventsExceptions
+ * @run main/othervm -Djava.awt.headless=true DesktopEventsExceptions
+ */
+public final class DesktopEventsExceptions {
+
+    public static void main(final String[] args) {
+        // Each element of the list will creates one object to test
+        final List<Runnable> constructors = List.of(
+                AboutEvent::new,
+                AppForegroundEvent::new,
+                AppHiddenEvent::new,
+                AppReopenedEvent::new,
+                QuitEvent::new,
+                ScreenSleepEvent::new,
+                SystemSleepEvent::new,
+                PreferencesEvent::new,
+                () -> new PrintFilesEvent(Collections.emptyList()),
+                () -> new UserSessionEvent(Reason.UNSPECIFIED),
+                () -> new OpenFilesEvent(Collections.emptyList(), ""),
+                () -> new OpenURIEvent(new File("").toURI())
+        );
+
+        for (final Runnable test : constructors) {
+            try {
+                test.run();
+                checkHeadless(true);
+                checkSupported(true);
+            } catch (HeadlessException ex) {
+                checkHeadless(false);
+            } catch (UnsupportedOperationException ex) {
+                checkSupported(false);
+            }
+        }
+    }
+
+    private static void checkSupported(final boolean isSupported) {
+        if (isSupported != Desktop.isDesktopSupported()) {
+            throw new RuntimeException();
+        }
+    }
+
+    private static void checkHeadless(final boolean isHeadless) {
+        if (isHeadless == GraphicsEnvironment.isHeadless()) {
+            throw new RuntimeException();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/Robot/MouseLocationOnScreen/MouseLocationOnScreen.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.AWTException;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.MouseInfo;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Robot;
+
+/**
+ * @test
+ * @key headful
+ * @bug 8196030
+ * @summary checks that Robot and MouseInfo use the same coordinates
+ */
+public final class MouseLocationOnScreen {
+
+    public static void main(final String[] args) throws AWTException {
+        GraphicsEnvironment lge =
+                GraphicsEnvironment.getLocalGraphicsEnvironment();
+
+        for (final GraphicsDevice device : lge.getScreenDevices()) {
+            GraphicsConfiguration dc = device.getDefaultConfiguration();
+            Robot robot = new Robot(device);
+
+            Rectangle bounds = dc.getBounds();
+            int x1 = bounds.x;
+            int x2 = x1 + bounds.width - 1;
+            int y1 = bounds.y;
+            int y2 = y1 + bounds.height - 1;
+
+            // We'll check all edge (two pixels in a width) of the each screen
+            edge(robot, device, x1, y1, x2, y1);         // top
+            edge(robot, device, x1, y1 + 1, x2, y1 + 1); // top
+
+            edge(robot, device, x2, y1, x2, y2);         // right
+            edge(robot, device, x2 - 1, y1, x2 - 1, y2); // right
+
+            edge(robot, device, x1, y1, x1, y2);         // left
+            edge(robot, device, x1 + 1, y1, x1 + 1, y2); // left
+
+            edge(robot, device, x1, y2, x2, y2);         // bottom
+            edge(robot, device, x1, y2 - 1, x2, y2 - 1); // bottom
+
+            // We'll check crossing of diagonals of each screen
+            cross(robot, device, x1, y1, x2, y2); // cross left-bottom
+            cross(robot, device, x1, y2, x2, y1); // cross left-top
+        }
+    }
+
+    /**
+     * This method checks the coordinates which were passed to robot and
+     * returned by MouseInfo. Note that this method will be called for each
+     * pixel and for performance reasons we try will try to skip waitForIdle()
+     * a few times.
+     */
+    static void validate(Robot robot, GraphicsDevice device, int x, int y) {
+        int attempt = 0;
+        while (true) {
+            attempt++;
+            Point actLoc = MouseInfo.getPointerInfo().getLocation();
+            GraphicsDevice actDevice = MouseInfo.getPointerInfo().getDevice();
+
+            if (actLoc.x != x || actLoc.y != y || actDevice != device) {
+                if (attempt <= 10) {
+                    if (attempt >= 8) {
+                        robot.waitForIdle();
+                    }
+                    continue;
+                }
+                System.err.println("Expected device: " + device);
+                System.err.println("Actual device: " + actDevice);
+                System.err.println("Expected X: " + x);
+                System.err.println("Actual X: " + actLoc.x);
+                System.err.println("Expected Y: " + y);
+                System.err.println("Actual Y: " + actLoc.y);
+                throw new RuntimeException();
+            }
+            return;
+        }
+    }
+
+    private static void edge(Robot robot, GraphicsDevice device,
+                             int x1, int y1, int x2, int y2) {
+        for (int x = x1; x <= x2; x++) {
+            for (int y = y1; y <= y2; y++) {
+                robot.mouseMove(x, y);
+                validate(robot, device, x, y);
+            }
+        }
+    }
+
+    private static void cross(Robot robot, GraphicsDevice device,
+                              int x0, int y0, int x1, int y1) {
+        float dmax = (float) Math.max(Math.abs(x1 - x0), Math.abs(y1 - y0));
+        float dx = (x1 - x0) / dmax;
+        float dy = (y1 - y0) / dmax;
+
+        robot.mouseMove(x0, y0);
+        validate(robot, device, x0, y0);
+        for (int i = 1; i <= dmax; i++) {
+            int x = (int) (x0 + dx * i);
+            int y = (int) (y0 + dy * i);
+            robot.mouseMove(x, y);
+            validate(robot, device, x, y);
+        }
+    }
+}
--- a/test/jdk/java/awt/font/MonospacedGlyphWidth/MonospacedGlyphWidthTest.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/awt/font/MonospacedGlyphWidth/MonospacedGlyphWidthTest.java	Mon Jun 11 09:29:44 2018 +0200
@@ -22,10 +22,11 @@
  */
 
 /* @test
- * @bug 8073400 8198412
+ * @bug 8073400 8198412 8204126
  * @summary Some Monospaced logical fonts have a different width
  * @author Dmitry Markov
  * @run main MonospacedGlyphWidthTest
+ * @requires (os.family == "windows" | os.family == "mac")
  */
 import java.awt.Font;
 import java.awt.GraphicsEnvironment;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/print/Dialog/DialogOwnerTest.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,289 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+   @bug 8203796
+   @run main/manual DialogOwnerTest
+   @summary Test DialogOwner API
+*/
+
+import java.util.ArrayList;
+import java.util.List;
+import java.awt.GraphicsConfiguration;
+import java.awt.GridLayout;
+import java.awt.Window;
+import java.awt.event.ActionEvent;
+import java.awt.print.PrinterJob;
+import javax.print.PrintService;
+import javax.print.PrintServiceLookup;
+import javax.print.ServiceUI;
+import javax.print.attribute.HashPrintRequestAttributeSet;
+import javax.print.attribute.PrintRequestAttributeSet;
+import javax.print.attribute.standard.DialogOwner;
+import javax.print.attribute.standard.DialogTypeSelection;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JTextArea;
+import javax.swing.SwingUtilities;
+
+public class DialogOwnerTest extends JPanel {
+
+    static final int NONE      =     0x0;
+    static final int PRINT     =     0x1;
+    static final int PAGE      =     0x2;
+    static final int SWING2D   =     0x4;
+    static final int NATIVE2D  =     0x8;
+    static final int SERVICEUI =    0x10;
+
+    static final int ONTOP      =   0x20;
+    static final int OWNED      =   0x40;
+
+    static PrintService[] services =
+        PrintServiceLookup.lookupPrintServices(null, null);
+
+    public static void main(String[] args) {
+        if (services.length == 0) {
+            System.out.println("No printers, exiting");
+            return;
+        } else {
+           service = PrinterJob.getPrinterJob().getPrintService();
+        }
+        SwingUtilities.invokeLater(() -> {
+            createUI();
+        });
+        while (!testFinished) {
+           try {
+                Thread.sleep(1000);
+           } catch (InterruptedException e){
+           }
+        }
+        if (!testPassed) {
+            throw new RuntimeException("TEST FAILED.");
+        }
+    }
+
+
+    static final String otherText =
+       "This window is used to test on top behaviour\n" +
+       "For tests that are 'Owned' or 'On Top' the dialog\n" +
+       "must always stay above this window. Verify this\n " +
+       "by moving the dialog so that it partially obscures\n" +
+       "this window and then trying to raise this window.";
+
+    static final String instructions =
+       " Instructions\n" +
+       "This tests that a print dialog stays on top of either another\n" +
+       "window, or on top of all windows.\n" +
+       "For Owned tests the window titled 'Owner Window' should always \n" +
+       "stay behind the print dialog.\n" +
+       "For On Top tests all windows should stay behind the owner window.\n" +
+       "This test tracks if you have checked all the scenarios and will\n" +
+       "not allow the test to pass unless you have visited them all.\n";
+
+    static PrintService service;
+
+    public DialogOwnerTest() {
+       super();
+       //setLayout(new GridLayout(24, 1));
+    }
+
+    static boolean isNative(int flags) {
+        return (flags & NATIVE2D) != 0;
+    }
+
+    static boolean isCommon(int flags) {
+        return (flags & SWING2D) != 0;
+    }
+
+    static boolean is2D(int flags) {
+        return (flags & SWING2D|NATIVE2D) != 0;
+    }
+
+    static boolean isPage(int flags) {
+        return (flags & PAGE ) != 0;
+    }
+
+    static JFrame frame;
+    static JFrame other;
+    static JButton pass;
+    static ArrayList<JPanel> panelList = new ArrayList<JPanel>();
+    static volatile boolean testPassed, testFinished;
+
+    int testCount = 0;
+    List<String> testList = new ArrayList<String>();
+
+    static void createUI() {
+        other = new JFrame("Owner Window");
+        JTextArea otherTextArea = new JTextArea(otherText, 10, 40);
+        other.add(otherTextArea);
+        other.pack();
+        other.setVisible(true);
+        other.setLocation(800, 100);
+
+        frame = new JFrame("Test Dialog Owner");
+        frame.pack();
+        JTextArea instructionsPanel = new JTextArea(instructions, 10, 50);
+        instructionsPanel.setEditable(false);
+        frame.add("North", instructionsPanel);
+        DialogOwnerTest test = new DialogOwnerTest();
+
+        test.addTest("Owned Swing Print", OWNED, frame, PRINT|SWING2D);
+        test.addTest("On Top Swing Print", ONTOP, null, PRINT|SWING2D);
+
+        test.addTest("Owned Swing Page", OWNED, frame, PAGE|SWING2D);
+        test.addTest("On Top Swing Page", ONTOP, null, PAGE|SWING2D);
+
+        test.addTest("Owned javax.print", OWNED, frame, PRINT|SERVICEUI);
+        test.addTest("On Top javax.print", OWNED, null, PRINT|SERVICEUI);
+
+        test.addTest("Owned Native Print", OWNED, frame, PRINT|NATIVE2D);
+        test.addTest("On Top Native Print", OWNED, null, PRINT|NATIVE2D);
+
+        test.addTest("Owned Native Page", OWNED, frame, PAGE|NATIVE2D);
+        test.addTest("On Top Native Page", OWNED, null, PAGE|NATIVE2D);
+
+        test.setLayout(new GridLayout(panelList.size()+2, 1));
+
+        pass = new JButton("Pass");
+        pass.setEnabled(false);
+        pass.addActionListener((ActionEvent e) -> {
+            if (test.testList.size() > 0) {
+                return;
+            }
+            frame.dispose();
+            other.dispose();
+            System.out.println("User says test passed.");
+            testPassed = true;
+            testFinished = true;
+        });
+
+        JButton fail = new JButton("Fail");
+        fail.addActionListener((ActionEvent e) -> {
+            frame.dispose();
+            other.dispose();
+            System.out.println("User says test failed.");
+            testPassed = false;
+            testFinished = true;
+        });
+
+        JPanel p = new JPanel();
+        p.add(pass);
+        p.add(fail);
+        test.add(p);
+
+
+        for (JPanel panel : panelList) {
+            test.add(panel);
+        }
+
+        frame.add("Center", test);
+        frame.pack();
+        frame.setLocation(0,0);
+        frame.setVisible(true);
+     }
+
+   boolean isSupported(PrintRequestAttributeSet aset,
+                     int ownerFlags, Window owner, int dlgFlags) {
+
+       boolean supported = true;
+       DialogOwner ownerAttr = null;
+       if (ownerFlags != NONE) {
+           if (ownerFlags == ONTOP) {
+               ownerAttr = new DialogOwner();
+           } else if (ownerFlags == OWNED) {
+               ownerAttr = new DialogOwner(owner);
+           }
+           aset.add(ownerAttr);
+        }
+        if (is2D(dlgFlags)) {
+           DialogTypeSelection dst = null;
+           if (isNative(dlgFlags)) {
+               dst = DialogTypeSelection.NATIVE;
+           } else if (isCommon(dlgFlags)) {
+               dst = DialogTypeSelection.COMMON;
+           }
+           if (dst != null &&
+               !service.isAttributeValueSupported(dst, null, aset)) {
+               //System.out.println("This DialogType not supported");
+               supported = false;
+           }
+           if (dst != null) {
+               aset.add(dst);
+           }
+           if (ownerAttr != null &&
+               !service.isAttributeValueSupported(ownerAttr, null, aset)) {
+               //System.out.println("This DialogOwner not supported");
+               supported = false;
+           }
+        }
+        return supported;
+   }
+
+   void addTest(String title, int ownerFlags, Window owner, int dlgFlags) {
+
+        PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
+        if (!isSupported(aset, ownerFlags, owner, dlgFlags)) {
+            return;
+        }
+
+        // if we are here then this is supportable and worth testing
+        // and the attribute set is configured.
+
+        String label = title + " Dialog";
+        JButton button = new JButton(label);
+        JCheckBox tested = new JCheckBox("Tested");
+        tested.setEnabled(false);
+        JPanel panel = new JPanel();
+        panel.add(tested);
+        panel.add(button);
+        panelList.add(panel);
+        //add(panel);
+        testList.add(title);
+        if (++testCount != testList.size()) {
+            throw new RuntimeException("Test titles must be unique");
+        }
+
+        button.addActionListener((ActionEvent e) -> {
+            tested.setSelected(true);
+            testList.remove(title);
+            if (testList.isEmpty()) {
+              pass.setEnabled(true);
+            }
+
+            if (is2D(dlgFlags)) {
+               PrinterJob job = PrinterJob.getPrinterJob();
+               if (isPage(dlgFlags)) {
+                   job.pageDialog(aset);
+               } else {
+                   job.printDialog(aset);
+               }
+            } else {
+               GraphicsConfiguration gc = null;
+               int x = 0, y = 0;
+               ServiceUI.printDialog(gc, x, y, services, services[0], null,aset);
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/lang/String/concat/ImplicitStringConcatAssignLHS.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,232 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @summary "+=" applied to String operands can provoke side effects
+ * @bug 8204322
+ *
+ * @compile ImplicitStringConcatAssignLHS.java
+ * @run main/othervm -Xverify:all ImplicitStringConcatAssignLHS
+ *
+ * @compile -XDstringConcat=inline ImplicitStringConcatAssignLHS.java
+ * @run main/othervm -Xverify:all ImplicitStringConcatAssignLHS
+ *
+ * @compile -XDstringConcat=indy ImplicitStringConcatAssignLHS.java
+ *
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                                                              ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED                                                        ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED                                                        ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT                                                  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT                                                  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT                                              ImplicitStringConcatAssignLHS
+ *
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                  -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT  -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatAssignLHS
+ *
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                                                              -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED                                                        -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED                                                        -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT                                                  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT                                                  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT                                              -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                  -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT  -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ *
+ * @compile -XDstringConcat=indyWithConstants ImplicitStringConcatAssignLHS.java
+ *
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                                                              ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED                                                        ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED                                                        ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT                                                  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT                                                  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT                                              ImplicitStringConcatAssignLHS
+ *
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                  -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT  -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatAssignLHS
+ *
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                                                              -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED                                                        -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED                                                        -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT                                                  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT                                                  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT                                              -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ *
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                  -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+ * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT  -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatAssignLHS
+*/
+import java.lang.StringBuilder;
+
+public class ImplicitStringConcatAssignLHS {
+
+    static final int ARR_SIZE = 10; // enough padding to capture ill offsets
+
+    static int x;
+
+    public static void main(String[] args) throws Exception {
+        {
+          x = 0;
+            Object[] arr = new Object[ARR_SIZE];
+            arr[x++] += "foo";
+            check(1, "plain-plain Object[]");
+        }
+
+        {
+          x = 0;
+            getObjArray()[x++] += "foo";
+            check(2, "method-plain Object[]");
+        }
+
+        {
+          x = 0;
+            getObjArray()[getIndex()] += "foo";
+            check(2, "method-method Object[]");
+        }
+
+        {
+            x = 0;
+            String[] arr = new String[ARR_SIZE];
+            arr[x++] += "foo";
+            check(1, "plain-plain String[]");
+    }
+
+        {
+            x = 0;
+            getStringArray()[x++] += "foo";
+            check(2, "method-plain String[]");
+        }
+
+        {
+            x = 0;
+            getStringArray()[getIndex()] += "foo";
+            check(2, "method-method String[]");
+        }
+
+        {
+            x = 0;
+            CharSequence[] arr = new CharSequence[ARR_SIZE];
+            arr[x++] += "foo";
+            check(1, "plain-plain CharSequence[]");
+        }
+
+        {
+            x = 0;
+            getCharSequenceArray()[x++] += "foo";
+            check(2, "method-plain CharSequence[]");
+        }
+
+        {
+            x = 0;
+            getCharSequenceArray()[getIndex()] += "foo";
+            check(2, "method-method CharSequence[]");
+        }
+
+        {
+            x = 0;
+            new MyClass().s += "foo";
+            check(1, "MyClass::new (String)");
+        }
+
+        {
+            x = 0;
+            getMyClass().s += "foo";
+            check(1, "method MyClass::new (String)");
+        }
+
+        {
+            x = 0;
+            new MyClass().o += "foo";
+            check(1, "MyClass::new (object)");
+        }
+
+        {
+            x = 0;
+            getMyClass().o += "foo";
+            check(1, "method MyClass::new (object)");
+        }
+    }
+
+    public static void check(int expected, String label) {
+        if (x != expected) {
+           StringBuilder sb = new StringBuilder();
+           sb.append(label);
+           sb.append(": ");
+           sb.append("Expected = ");
+           sb.append(expected);
+           sb.append("actual = ");
+           sb.append(x);
+           throw new IllegalStateException(sb.toString());
+        }
+    }
+
+    public static int getIndex() {
+       return x++;
+    }
+
+    public static class MyClass {
+        Object o;
+        String s;
+
+        public MyClass() {
+       x++;
+        }
+    }
+
+    public static MyClass getMyClass() {
+        return new MyClass();
+}
+
+    public static Object[] getObjArray() {
+        x++;
+        return new Object[ARR_SIZE];
+    }
+
+    public static String[] getStringArray() {
+        x++;
+        return new String[ARR_SIZE];
+    }
+
+    public static CharSequence[] getCharSequenceArray() {
+        x++;
+        return new String[ARR_SIZE];
+    }
+
+}
+
--- a/test/jdk/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -30,11 +30,13 @@
  *
  * @author  Mandy Chung
  *
- * @library /lib/testlibrary/
+ * @library /lib/testlibrary/ /test/lib
  * @modules jdk.management
  * @build jdk.testlibrary.* CollectionUsageThreshold MemoryUtil RunUtil
  * @requires vm.opt.ExplicitGCInvokesConcurrent == "false" | vm.opt.ExplicitGCInvokesConcurrent == "null"
- * @run main/timeout=300 CollectionUsageThreshold
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm/timeout=300 -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. CollectionUsageThreshold
  */
 
 import java.util.*;
@@ -46,6 +48,8 @@
 import static java.lang.management.MemoryNotificationInfo.*;;
 import static java.lang.management.ManagementFactory.*;
 
+import sun.hotspot.code.Compiler;
+
 public class CollectionUsageThreshold {
     private static final MemoryMXBean mm = getMemoryMXBean();
     private static final Map<String, PoolRecord> result = new HashMap<>();
@@ -72,7 +76,9 @@
         RunUtil.runTestClearGcOpts(main, "-XX:+UseSerialGC");
         RunUtil.runTestClearGcOpts(main, "-XX:+UseParallelGC");
         RunUtil.runTestClearGcOpts(main, "-XX:+UseG1GC");
-        RunUtil.runTestClearGcOpts(main, "-XX:+UseConcMarkSweepGC");
+        if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
+            RunUtil.runTestClearGcOpts(main, "-XX:+UseConcMarkSweepGC");
+        }
     }
 
     static class PoolRecord {
--- a/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -32,10 +32,12 @@
  * @requires vm.gc == "null"
  * @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
  * @requires vm.opt.DisableExplicitGC != "true"
- * @library /lib/testlibrary/
+ * @library /lib/testlibrary/ /test/lib
  *
  * @build jdk.testlibrary.* LowMemoryTest MemoryUtil RunUtil
- * @run main/timeout=600 LowMemoryTest
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm/timeout=600 -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. LowMemoryTest
  */
 
 import java.lang.management.*;
@@ -47,6 +49,8 @@
 import jdk.testlibrary.JDKToolFinder;
 import jdk.testlibrary.Utils;
 
+import sun.hotspot.code.Compiler;
+
 public class LowMemoryTest {
     private static final MemoryMXBean mm = ManagementFactory.getMemoryMXBean();
     private static final List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
@@ -80,7 +84,9 @@
         traceTest(classMain + ", -XX:+UseSerialGC", nmFlag, lpFlag, "-XX:+UseSerialGC");
         traceTest(classMain + ", -XX:+UseParallelGC", nmFlag, lpFlag, "-XX:+UseParallelGC");
         traceTest(classMain + ", -XX:+UseG1GC", nmFlag, lpFlag, "-XX:+UseG1GC", g1Flag);
-        traceTest(classMain + ", -XX:+UseConcMarkSweepGC", nmFlag, lpFlag, "-XX:+UseConcMarkSweepGC");
+        if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
+            traceTest(classMain + ", -XX:+UseConcMarkSweepGC", nmFlag, lpFlag, "-XX:+UseConcMarkSweepGC");
+        }
     }
 
     /*
--- a/test/jdk/java/lang/management/MemoryMXBean/MemoryManagementConcMarkSweepGC.sh	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/lang/management/MemoryMXBean/MemoryManagementConcMarkSweepGC.sh	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2018, 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
@@ -27,7 +27,7 @@
 # @summary Run MemoryManagement test with concurrent mark sweep GC
 # @author  Mandy Chung
 #
-# @requires vm.gc=="ConcMarkSweep" | vm.gc=="null"
+# @requires (vm.gc=="ConcMarkSweep" | vm.gc=="null") & !vm.graal.enabled
 #
 # @run build MemoryManagement
 # @run shell/timeout=600 MemoryManagementConcMarkSweepGC.sh
--- a/test/jdk/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -34,17 +34,21 @@
  *
  * @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
  * @requires vm.opt.DisableExplicitGC != "true"
- * @library /lib/testlibrary/
+ * @library /lib/testlibrary/ /test/lib
  * @modules jdk.management
  *
  * @build jdk.testlibrary.* ResetPeakMemoryUsage MemoryUtil RunUtil
- * @run main ResetPeakMemoryUsage
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. ResetPeakMemoryUsage
  */
 
 import java.lang.management.*;
 import java.lang.ref.WeakReference;
 import java.util.*;
 
+import sun.hotspot.code.Compiler;
+
 public class ResetPeakMemoryUsage {
     private static MemoryMXBean mbean = ManagementFactory.getMemoryMXBean();
     // make public so that it can't be optimized away easily
@@ -59,7 +63,9 @@
         final String main = "ResetPeakMemoryUsage$TestMain";
         final String ms = "-Xms256m";
         final String mn = "-Xmn8m";
-        RunUtil.runTestClearGcOpts(main, ms, mn, "-XX:+UseConcMarkSweepGC");
+        if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
+            RunUtil.runTestClearGcOpts(main, ms, mn, "-XX:+UseConcMarkSweepGC");
+        }
         RunUtil.runTestClearGcOpts(main, ms, mn, "-XX:+UseParallelGC");
         RunUtil.runTestClearGcOpts(main, ms, mn, "-XX:+UseG1GC", "-XX:G1HeapRegionSize=1m");
         RunUtil.runTestClearGcOpts(main, ms, mn, "-XX:+UseSerialGC",
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/net/Socket/ReadAfterReset.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @requires (os.family == "linux" | os.family == "mac")
+ * @bug 8203937
+ * @summary Test reading bytes from a socket after the connection has been
+ *          reset by the peer
+ */
+
+import java.io.IOException;
+import java.io.PrintStream;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+
+/**
+ * This test exercises platform specific and unspecified behavior. It exists
+ * only to ensure that the behavior doesn't change between JDK releases.
+ */
+
+public class ReadAfterReset {
+    private static final PrintStream out = System.out;
+
+    // number of bytes to write before the connection reset
+    private static final int NUM_BYTES_TO_WRITE = 1000;
+
+    public static void main(String[] args) throws IOException {
+        try (ServerSocket ss = new ServerSocket()) {
+            ss.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0));
+
+            /**
+             * Connect to the server which will write some bytes and reset the
+             * connection. The client then attempts to read the bytes sent by
+             * the server before it closed the connection.
+             */
+            out.println("Test connection ...");
+            try (Socket s = new Socket()) {
+                s.connect(ss.getLocalSocketAddress());
+                int nwrote = acceptAndResetConnection(ss);
+                int nread = readUntilIOException(s);
+                if (nread != nwrote) {
+                    throw new RuntimeException("Client read " + nread + ", expected " + nwrote);
+                }
+            }
+
+            /**
+             * Connect to the server which will write some bytes and reset the
+             * connection. The client then writes to its end of the connection,
+             * failing as the connection is reset. It then attempts to read the
+             * bytes sent by the server before it closed the connection.
+             */
+            out.println();
+            out.println("Test connection ...");
+            try (Socket s = new Socket()) {
+                s.connect(ss.getLocalSocketAddress());
+                int nwrote = acceptAndResetConnection(ss);
+                writeUntilIOException(s);
+                int nread = readUntilIOException(s);
+                if (nread != nwrote) {
+                    throw new RuntimeException("Client read " + nread + ", expected " + nwrote);
+                }
+            }
+        }
+    }
+
+    /**
+     * Accept a connection, write bytes, and then reset the connection
+     */
+    static int acceptAndResetConnection(ServerSocket ss) throws IOException {
+        int count = NUM_BYTES_TO_WRITE;
+        try (Socket peer = ss.accept()) {
+            peer.getOutputStream().write(new byte[count]);
+            peer.setSoLinger(true, 0);
+            out.format("Server wrote %d bytes and reset connection%n", count);
+        }
+        return count;
+    }
+
+    /**
+     * Write bytes to a socket until I/O exception is thrown
+     */
+    static void writeUntilIOException(Socket s) {
+        try {
+            byte[] bytes = new byte[100];
+            while (true) {
+                s.getOutputStream().write(bytes);
+                out.format("Client wrote %d bytes%n", bytes.length);
+            }
+        } catch (IOException ioe) {
+            out.format("Client write failed: %s (expected)%n", ioe);
+        }
+    }
+
+    /**
+     * Read bytes from a socket until I/O exception is thrown.
+     *
+     * @return the number of bytes read before the I/O exception was thrown
+     */
+    static int readUntilIOException(Socket s) {
+        int nread = 0;
+        try {
+            byte[] bytes = new byte[100];
+            while (true) {
+                int n = s.getInputStream().read(bytes);
+                if (n < 0) {
+                    out.println("Client read EOF");
+                    break;
+                } else {
+                    out.format("Client read %s bytes%n", n);
+                    nread += n;
+                }
+            }
+        } catch (IOException ioe) {
+            out.format("Client read failed: %s (expected)%n", ioe);
+        }
+        return nread;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/nio/channels/SelectionKey/AtomicUpdates.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 6350055
+ * @run testng AtomicUpdates
+ * @summary Unit test for SelectionKey interestOpsOr and interestOpsAnd
+ */
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.nio.channels.CancelledKeyException;
+import java.nio.channels.SelectableChannel;
+import java.nio.channels.SelectionKey;
+import java.nio.channels.Selector;
+import java.nio.channels.ServerSocketChannel;
+import java.nio.channels.SocketChannel;
+import org.testng.annotations.Test;
+
+import static java.nio.channels.SelectionKey.OP_READ;
+import static java.nio.channels.SelectionKey.OP_WRITE;
+import static java.nio.channels.SelectionKey.OP_CONNECT;
+import static java.nio.channels.SelectionKey.OP_ACCEPT;
+import static org.testng.Assert.*;
+
+@Test
+public class AtomicUpdates {
+
+    private SelectionKey keyFor(SocketChannel sc) {
+        return new SelectionKey() {
+            private int ops;
+            private boolean invalid;
+            private void ensureValid() {
+                if (!isValid())
+                    throw new CancelledKeyException();
+            }
+            @Override
+            public SelectableChannel channel() {
+                return sc;
+            }
+            @Override
+            public Selector selector() {
+                throw new RuntimeException();
+            }
+            @Override
+            public boolean isValid() {
+                return !invalid;
+            }
+            @Override
+            public void cancel() {
+                invalid = true;
+            }
+            @Override
+            public int interestOps() {
+                ensureValid();
+                return ops;
+            }
+            @Override
+            public SelectionKey interestOps(int ops) {
+                ensureValid();
+                if ((ops & ~channel().validOps()) != 0)
+                    throw new IllegalArgumentException();
+                this.ops = ops;
+                return this;
+            }
+            @Override
+            public int readyOps() {
+                ensureValid();
+                return 0;
+            }
+        };
+    }
+
+    private void test(SelectionKey key) {
+        assertTrue(key.channel() instanceof SocketChannel);
+        key.interestOps(0);
+
+        // 0 -> 0
+        int previous = key.interestOpsOr(0);
+        assertTrue(previous == 0);
+        assertTrue(key.interestOps() == 0);
+
+        // 0 -> OP_CONNECT
+        previous = key.interestOpsOr(OP_CONNECT);
+        assertTrue(previous == 0);
+        assertTrue(key.interestOps() == OP_CONNECT);
+
+        // OP_CONNECT -> OP_CONNECT
+        previous = key.interestOpsOr(0);
+        assertTrue(previous == OP_CONNECT);
+        assertTrue(key.interestOps() == OP_CONNECT);
+
+        // OP_CONNECT -> OP_CONNECT | OP_READ | OP_WRITE
+        previous = key.interestOpsOr(OP_READ | OP_WRITE);
+        assertTrue(previous == OP_CONNECT);
+        assertTrue(key.interestOps() == (OP_CONNECT | OP_READ | OP_WRITE));
+
+        // OP_CONNECT | OP_READ | OP_WRITE -> OP_CONNECT
+        previous = key.interestOpsAnd(~(OP_READ | OP_WRITE));
+        assertTrue(previous == (OP_CONNECT | OP_READ | OP_WRITE));
+        assertTrue(key.interestOps() == OP_CONNECT);
+
+        // OP_CONNECT -> 0
+        previous = key.interestOpsAnd(~OP_CONNECT);
+        assertTrue(previous == OP_CONNECT);
+        assertTrue(key.interestOps() == 0);
+
+        // OP_READ | OP_WRITE -> OP_READ | OP_WRITE
+        key.interestOps(OP_READ | OP_WRITE);
+        previous = key.interestOpsAnd(~OP_ACCEPT);
+        assertTrue(previous == (OP_READ | OP_WRITE));
+        assertTrue(key.interestOps() == (OP_READ | OP_WRITE));
+
+        // OP_READ | OP_WRITE -> 0
+        previous = key.interestOpsAnd(0);
+        assertTrue(previous == (OP_READ | OP_WRITE));
+        assertTrue(key.interestOps() == 0);
+
+        // 0 -> 0
+        previous = key.interestOpsAnd(0);
+        assertTrue(previous == 0);
+        assertTrue(key.interestOps() == 0);
+
+        try {
+            key.interestOpsOr(OP_ACCEPT);
+            fail("IllegalArgumentException expected");
+        } catch (IllegalArgumentException expected) { }
+
+        key.cancel();
+        try {
+            key.interestOpsOr(OP_READ);
+            fail("CancelledKeyException expected");
+        } catch (CancelledKeyException expected) { }
+        try {
+            key.interestOpsAnd(~OP_READ);
+            fail("CancelledKeyException expected");
+        } catch (CancelledKeyException expected) { }
+    }
+
+    /**
+     * Test default implementation of interestOpsOr/interestOpsAnd
+     */
+    public void testDefaultImplementation() throws Exception {
+        try (SocketChannel sc = SocketChannel.open()) {
+            SelectionKey key = keyFor(sc);
+            test(key);
+        }
+    }
+
+    /**
+     * Test the default provider implementation of SelectionKey.
+     */
+    public void testNioImplementation() throws Exception {
+        try (SocketChannel sc = SocketChannel.open();
+             Selector sel = Selector.open()) {
+            sc.configureBlocking(false);
+            SelectionKey key = sc.register(sel, 0);
+            test(key);
+        }
+    }
+}
+
--- a/test/jdk/java/nio/file/Files/CopyAndMove.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/nio/file/Files/CopyAndMove.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, 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
@@ -22,24 +22,25 @@
  */
 
 /* @test
- * @bug 4313887 6838333 6917021 7006126 6950237 8006645
+ * @bug 4313887 6838333 6917021 7006126 6950237 8006645 8201407
  * @summary Unit test for java.nio.file.Files copy and move methods (use -Dseed=X to set PRNG seed)
  * @library .. /test/lib
- * @build jdk.test.lib.RandomFactory
+ * @build jdk.test.lib.Platform jdk.test.lib.RandomFactory
  *        CopyAndMove PassThroughFileSystem
  * @run main/othervm CopyAndMove
  * @key randomness
  */
 
+import java.io.*;
 import java.nio.ByteBuffer;
 import java.nio.file.*;
 import static java.nio.file.Files.*;
 import static java.nio.file.StandardCopyOption.*;
 import static java.nio.file.LinkOption.*;
 import java.nio.file.attribute.*;
-import java.io.*;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
+import jdk.test.lib.Platform;
 import jdk.test.lib.RandomFactory;
 
 public class CopyAndMove {
@@ -169,8 +170,7 @@
         Map<String,ByteBuffer> namedAttributes = null;
 
         // get file attributes of source file
-        String os = System.getProperty("os.name");
-        if (os.startsWith("Windows")) {
+        if (Platform.isWindows()) {
             dosAttributes = readAttributes(source, DosFileAttributes.class, NOFOLLOW_LINKS);
             basicAttributes = dosAttributes;
         } else {
@@ -448,6 +448,10 @@
                 moveAndVerify(source, target);
                 throw new RuntimeException("IOException expected");
             } catch (IOException x) {
+                if (!(x instanceof DirectoryNotEmptyException)) {
+                    throw new RuntimeException
+                        ("DirectoryNotEmptyException expected", x);
+                }
             }
             delete(source.resolve("foo"));
             delete(source);
@@ -653,17 +657,14 @@
             if (source.getFileSystem().provider() == target.getFileSystem().provider()) {
 
                 // check POSIX attributes are copied
-                String os = System.getProperty("os.name");
-                if ((os.equals("SunOS") || os.equals("Linux")) &&
-                    testPosixAttributes)
-                {
+                if (!Platform.isWindows() && testPosixAttributes) {
                     checkPosixAttributes(
                         readAttributes(source, PosixFileAttributes.class, linkOptions),
                         readAttributes(target, PosixFileAttributes.class, linkOptions));
                 }
 
                 // check DOS attributes are copied
-                if (os.startsWith("Windows")) {
+                if (Platform.isWindows()) {
                     checkDosAttributes(
                         readAttributes(source, DosFileAttributes.class, linkOptions),
                         readAttributes(target, DosFileAttributes.class, linkOptions));
@@ -921,9 +922,7 @@
         /**
          * Test: Copy link to UNC (Windows only)
          */
-        if (supportsLinks &&
-            System.getProperty("os.name").startsWith("Windows"))
-        {
+        if (supportsLinks && Platform.isWindows()) {
             Path unc = Paths.get("\\\\rialto\\share\\file");
             link = dir1.resolve("link");
             createSymbolicLink(link, unc);
@@ -1156,12 +1155,14 @@
 
     // "randomize" the file attributes of the given file.
     static void randomizeAttributes(Path file) throws IOException {
-        String os = System.getProperty("os.name");
-        boolean isWindows = os.startsWith("Windows");
-        boolean isUnix = os.equals("SunOS") || os.equals("Linux");
         boolean isDirectory = isDirectory(file, NOFOLLOW_LINKS);
 
-        if (isUnix) {
+        if (Platform.isWindows()) {
+            DosFileAttributeView view =
+                getFileAttributeView(file, DosFileAttributeView.class, NOFOLLOW_LINKS);
+            // only set or unset the hidden attribute
+            view.setHidden(heads());
+        } else {
             Set<PosixFilePermission> perms =
                 getPosixFilePermissions(file, NOFOLLOW_LINKS);
             PosixFilePermission[] toChange = {
@@ -1182,18 +1183,12 @@
             setPosixFilePermissions(file, perms);
         }
 
-        if (isWindows) {
-            DosFileAttributeView view =
-                getFileAttributeView(file, DosFileAttributeView.class, NOFOLLOW_LINKS);
-            // only set or unset the hidden attribute
-            view.setHidden(heads());
-        }
-
         boolean addUserDefinedFileAttributes = heads() &&
             getFileStore(file).supportsFileAttributeView("xattr");
 
         // remove this when copying a direcory copies its named streams
-        if (isWindows && isDirectory) addUserDefinedFileAttributes = false;
+        if (Platform.isWindows() && isDirectory)
+            addUserDefinedFileAttributes = false;
 
         if (addUserDefinedFileAttributes) {
             UserDefinedFileAttributeView view =
--- a/test/jdk/java/text/Format/DateFormat/WeekDateTest.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/text/Format/DateFormat/WeekDateTest.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, 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
@@ -137,20 +137,28 @@
         Calendar jcal = Calendar.getInstance(TimeZone.getTimeZone("GMT"),
                                              new Locale("ja", "JP", "JP"));
 
+        String format = "2-W01-2"; // 2019-12-31 == N1-12-31
+        int expectedYear = 2019;
+        // Check the current era, Heisei or NewEra
+        if (System.currentTimeMillis() < 1556668800000L) {
+            format = "21-W01-3"; // 2008-12-31 == H20-12-31
+            expectedYear = 2008;
+        }
         jcal.setFirstDayOfWeek(MONDAY);
         jcal.setMinimalDaysInFirstWeek(4);
         SimpleDateFormat sdf = new SimpleDateFormat("Y-'W'ww-u");
         sdf.setCalendar(jcal);
-        Date d = sdf.parse("21-W01-3"); // 2008-12-31 == H20-12-31
+        Date d = sdf.parse(format);
         GregorianCalendar gcal = newCalendar();
         gcal.setTime(d);
-        if (gcal.get(YEAR) != 2008
+        if (gcal.get(YEAR) != expectedYear
             || gcal.get(MONTH) != DECEMBER
             || gcal.get(DAY_OF_MONTH) != 31) {
-            String s = String.format("noWeekDateSupport: got %04d-%02d-%02d, expected 2008-12-31%n",
+            String s = String.format("noWeekDateSupport: got %04d-%02d-%02d, expected %4d-12-31%n",
                                      gcal.get(YEAR),
                                      gcal.get(MONTH)+1,
-                                     gcal.get(DAY_OF_MONTH));
+                                     gcal.get(DAY_OF_MONTH),
+                                     expectedYear);
             throw new RuntimeException(s);
         }
     }
--- a/test/jdk/java/time/tck/java/time/chrono/TCKJapaneseChronology.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/time/tck/java/time/chrono/TCKJapaneseChronology.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ o Copyright (c) 2012, 2018, 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
@@ -111,6 +111,7 @@
  */
 @Test
 public class TCKJapaneseChronology {
+    private static final int YDIFF_NEWERA = 2018;
     private static final int YDIFF_HEISEI = 1988;
     private static final int YDIFF_MEIJI = 1867;
     private static final int YDIFF_SHOWA = 1925;
@@ -173,6 +174,7 @@
     @DataProvider(name="createByEra")
     Object[][] data_createByEra() {
         return new Object[][] {
+                {JapaneseEra.of(3), 2020 - YDIFF_NEWERA, 2, 29, 60, LocalDate.of(2020, 2, 29)}, // NEWERA
                 {JapaneseEra.HEISEI, 1996 - YDIFF_HEISEI, 2, 29, 60, LocalDate.of(1996, 2, 29)},
                 {JapaneseEra.HEISEI, 2000 - YDIFF_HEISEI, 2, 29, 60, LocalDate.of(2000, 2, 29)},
                 {JapaneseEra.MEIJI, 1874 - YDIFF_MEIJI, 2, 28, 59, LocalDate.of(1874, 2, 28)},
@@ -365,8 +367,11 @@
     @DataProvider(name="prolepticYear")
     Object[][] data_prolepticYear() {
         return new Object[][] {
+                {3, JapaneseEra.of(3), 1, 1 + YDIFF_NEWERA, false}, // NEWERA
+                {3, JapaneseEra.of(3), 102, 102 + YDIFF_NEWERA, true}, // NEWERA
+
                 {2, JapaneseEra.HEISEI, 1, 1 + YDIFF_HEISEI, false},
-                {2, JapaneseEra.HEISEI, 100, 100 + YDIFF_HEISEI, true},
+                {2, JapaneseEra.HEISEI, 4, 4 + YDIFF_HEISEI, true},
 
                 {-1, JapaneseEra.MEIJI, 9, 9 + YDIFF_MEIJI, true},
                 {-1, JapaneseEra.MEIJI, 10, 10 + YDIFF_MEIJI, false},
@@ -548,6 +553,7 @@
             { JapaneseEra.TAISHO, 0, "Taisho"},
             { JapaneseEra.SHOWA, 1, "Showa"},
             { JapaneseEra.HEISEI, 2, "Heisei"},
+            { JapaneseEra.of(3), 3, "NewEra"}, // NEWERA
         };
     }
 
@@ -562,7 +568,7 @@
 
     @Test
     public void test_Japanese_badEras() {
-        int badEras[] = {-1000, -998, -997, -2, 3, 4, 1000};
+        int badEras[] = {-1000, -998, -997, -2, 4, 5, 1000};
         for (int badEra : badEras) {
             try {
                 Era era = JapaneseChronology.INSTANCE.eraOf(badEra);
@@ -683,6 +689,7 @@
             {JapaneseChronology.INSTANCE.date(1989,  1,  7), "Japanese Showa 64-01-07"},
             {JapaneseChronology.INSTANCE.date(1989,  1,  8), "Japanese Heisei 1-01-08"},
             {JapaneseChronology.INSTANCE.date(2012, 12,  6), "Japanese Heisei 24-12-06"},
+            {JapaneseChronology.INSTANCE.date(2020,  1,  6), "Japanese NewEra 2-01-06"},
         };
     }
 
--- a/test/jdk/java/time/tck/java/time/chrono/TCKJapaneseEra.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/time/tck/java/time/chrono/TCKJapaneseEra.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -79,6 +79,7 @@
     @DataProvider(name = "JapaneseEras")
     Object[][] data_of_eras() {
         return new Object[][] {
+                    {JapaneseEra.of(3), "NewEra", 3}, // NEWERA
                     {JapaneseEra.HEISEI, "Heisei", 2},
                     {JapaneseEra.SHOWA, "Showa", 1},
                     {JapaneseEra.TAISHO, "Taisho", 0},
@@ -91,7 +92,7 @@
         return new Object[][] {
                 {-2},
                 {-3},
-                {3},
+                {4},
                 {Integer.MIN_VALUE},
                 {Integer.MAX_VALUE},
         };
--- a/test/jdk/java/time/test/java/time/chrono/TestJapaneseChronology.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/time/test/java/time/chrono/TestJapaneseChronology.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -58,6 +58,8 @@
             { JapaneseEra.SHOWA,      1, 12, 25, 1926 },
             { JapaneseEra.SHOWA,     64,  1,  7, 1989 },
             { JapaneseEra.HEISEI,     1,  1,  8, 1989 },
+            { JapaneseEra.HEISEI,    31,  4, 30, 2019 },
+            { JapaneseEra.of(3),      1,  5,  1, 2019 }, // NEWERA
         };
     }
 
@@ -74,6 +76,8 @@
             { JapaneseEra.SHOWA,  64,    7,  1,  7 },
             { JapaneseEra.HEISEI,  1,    1,  1,  8 },
             { JapaneseEra.HEISEI,  2,    8,  1,  8 },
+            { JapaneseEra.HEISEI, 31,  120,  4, 30 },
+            { JapaneseEra.of(3),   1,    1,  5,  1 }, // NEWERA
         };
     }
 
@@ -81,8 +85,8 @@
     Object[][] rangeData() {
         return new Object[][] {
             // field, minSmallest, minLargest, maxSmallest, maxLargest
-            { ChronoField.ERA,         -1, -1, 2, 2},
-            { ChronoField.YEAR_OF_ERA, 1, 1, 15, 999999999-1989 }, // depends on the current era
+            { ChronoField.ERA,         -1, -1, 3, 3},
+            { ChronoField.YEAR_OF_ERA, 1, 1, 15, 999999999-2019}, // depends on the current era
             { ChronoField.DAY_OF_YEAR, 1, 1, 7, 366},
             { ChronoField.YEAR, 1873, 1873, 999999999, 999999999},
         };
@@ -105,7 +109,9 @@
             { JapaneseEra.SHOWA,     65,  1,  1 },
             { JapaneseEra.HEISEI,     1,  1,  7 },
             { JapaneseEra.HEISEI,     1,  2, 29 },
-            { JapaneseEra.HEISEI, Year.MAX_VALUE,  12, 31 },
+            { JapaneseEra.HEISEI,    31,  5,  1 },
+            { JapaneseEra.of(3),      1,  4, 30 }, // NEWERA
+            { JapaneseEra.of(3), Year.MAX_VALUE,  12, 31 }, // NEWERA
         };
     }
 
@@ -124,7 +130,10 @@
             { JapaneseEra.SHOWA,     65 },
             { JapaneseEra.HEISEI,    -1 },
             { JapaneseEra.HEISEI,     0 },
-            { JapaneseEra.HEISEI, Year.MAX_VALUE },
+            { JapaneseEra.HEISEI,    32 },
+            { JapaneseEra.of(3),     -1 }, // NEWERA
+            { JapaneseEra.of(3),      0 }, // NEWERA
+            { JapaneseEra.of(3), Year.MAX_VALUE }, // NEWERA
         };
     }
 
@@ -141,6 +150,9 @@
             { JapaneseEra.SHOWA,  64,   8 },
             { JapaneseEra.HEISEI,  1, 360 },
             { JapaneseEra.HEISEI,  2, 366 },
+            { JapaneseEra.HEISEI, 31, 121 },
+            { JapaneseEra.of(3),   1, 246 }, // NEWERA
+            { JapaneseEra.of(3),   2, 367 }, // NEWERA
         };
     }
 
--- a/test/jdk/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -775,8 +775,10 @@
             {HijrahDate.of(1350,5,15), "Japanese Showa 6-09-28"},
             {HijrahDate.of(1434,5,1), "Japanese Heisei 25-03-13"},
             {HijrahDate.of(1436,1,1), "Japanese Heisei 26-10-25"},
-            {HijrahDate.of(1500,6,12), "Japanese Heisei 89-05-05"},
-            {HijrahDate.of(1550,3,11), "Japanese Heisei 137-08-11"},
+            {HijrahDate.of(1440,8,25), "Japanese Heisei 31-04-30"},
+            {HijrahDate.of(1440,8,26), "Japanese NewEra 1-05-01"},
+            {HijrahDate.of(1500,6,12), "Japanese NewEra 59-05-05"},
+            {HijrahDate.of(1550,3,11), "Japanese NewEra 107-08-11"},
         };
     }
 
--- a/test/jdk/java/util/Calendar/Bug8007038.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Calendar/Bug8007038.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -46,7 +46,7 @@
     private static final int[][] eraMinMax = {
         {GregorianCalendar.BC, GregorianCalendar.AD},
         {0, 1},
-        {0, 4},
+        {0, 5},
         {0, 1},
         {0, 1},
         {0, 1},
--- a/test/jdk/java/util/Calendar/Builder/BuilderTest.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Calendar/Builder/BuilderTest.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -27,6 +27,7 @@
  * @summary Unit test for Calendar.Builder.
  */
 
+import java.time.LocalDateTime;
 import java.util.*;
 import static java.util.Calendar.*;
 
@@ -132,7 +133,11 @@
                 .setFields(YEAR, 1, DAY_OF_YEAR, 1).build();
             expected = Calendar.getInstance(jaJPJP);
             expected.clear();
-            expected.set(1, JANUARY, 8);
+            if (LocalDateTime.now().isBefore(LocalDateTime.of(2019, 5, 1, 0, 0))) {
+                expected.set(1, JANUARY, 8);
+            } else {
+                expected.set(1, MAY, 1);
+            }
             check(cal, expected);
             // setLocale
             calb = builder();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Calendar/JapaneseEraNameTest.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8202088
+ * @summary Test the localized Japanese new era name (May 1st. 2019-)
+ *      is retrieved no matter CLDR provider contains the name or not.
+ * @modules jdk.localedata
+ * @run testng/othervm JapaneseEraNameTest
+ * @run testng/othervm -Djava.locale.providers=CLDR JapaneseEraNameTest
+ */
+
+import static java.util.Calendar.*;
+import static java.util.Locale.*;
+import java.util.Calendar;
+import java.util.Locale;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import static org.testng.Assert.assertEquals;
+
+@Test
+public class JapaneseEraNameTest {
+    static final Calendar c = new Calendar.Builder()
+            .setCalendarType("japanese")
+            .setFields(ERA, 5, YEAR, 1, MONTH, MAY, DAY_OF_MONTH, 1)
+            .build();
+
+    @DataProvider(name="names")
+    Object[][] names() {
+        return new Object[][] {
+            // type,    locale,  name
+            { LONG,     JAPAN,   "\u65b0\u5143\u53f7" }, // NewEra
+            { LONG,     US,      "NewEra" },
+            { SHORT,    JAPAN,   "N" },
+            { SHORT,    US,      "N" },
+        };
+    }
+
+    @Test(dataProvider="names")
+    public void testJapaneseNewEraName(int type, Locale locale, String expected) {
+        assertEquals(c.getDisplayName(ERA, type, locale), expected);
+    }
+}
--- a/test/jdk/java/util/Calendar/NarrowNamesTest.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Calendar/NarrowNamesTest.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -21,6 +21,7 @@
  * questions.
  */
 
+import java.time.LocalDateTime;
 import java.util.*;
 import static java.util.GregorianCalendar.*;
 
@@ -49,7 +50,9 @@
              HOUR_OF_DAY, 10);
         test(US, AM_PM, "p",
              HOUR_OF_DAY, 23);
-        test(JAJPJP, DAY_OF_WEEK, "\u65e5",
+        test(JAJPJP, DAY_OF_WEEK,
+             LocalDateTime.now().isBefore(LocalDateTime.of(2019, 5, 1, 0, 0)) ?
+                "\u65e5" : "\u706b", // "Sun" for HEISEI, "Tue" for NEWERA
              YEAR, 24, MONTH, DECEMBER, DAY_OF_MONTH, 23);
         test(THTH, MONTH, NARROW_STANDALONE, "\u0e18.\u0e04.",
              YEAR, 2555, MONTH, DECEMBER, DAY_OF_MONTH, 5);
--- a/test/jdk/java/util/Calendar/SupplementalJapaneseEraTest.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Calendar/SupplementalJapaneseEraTest.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, 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
@@ -50,8 +50,8 @@
 
 public class SupplementalJapaneseEraTest {
     private static final Locale WAREKI_LOCALE = Locale.forLanguageTag("ja-JP-u-ca-japanese");
-    private static final String NEW_ERA_NAME = "NewEra";
-    private static final String NEW_ERA_ABBR = "N.E.";
+    private static final String SUP_ERA_NAME = "SupEra";
+    private static final String SUP_ERA_ABBR = "S.E.";
     private static int errors = 0;
 
     public static void main(String[] args) {
@@ -62,6 +62,7 @@
             Calendar cal = new Calendar.Builder()
                 .setCalendarType("japanese")
                 .setTimeZone(TimeZone.getTimeZone("GMT"))
+                .setFields(ERA, 5)
                 .setDate(200, FEBRUARY, 11)
                 .build();
             System.out.println(cal.getTimeInMillis());
@@ -95,10 +96,9 @@
     private static void testProperty() {
         Calendar jcal = new Calendar.Builder()
             .setCalendarType("japanese")
-            .setFields(YEAR, 1, DAY_OF_YEAR, 1)
+            .setFields(ERA, 6, YEAR, 1, DAY_OF_YEAR, 1)
             .build();
         Date firstDayOfEra = jcal.getTime();
-
         jcal.set(ERA, jcal.get(ERA) - 1); // previous era
         jcal.set(YEAR, 1);
         jcal.set(DAY_OF_YEAR, 1);
@@ -113,7 +113,7 @@
         // test long era name
         sdf = new SimpleDateFormat("GGGG y-MM-dd", WAREKI_LOCALE);
         got = sdf.format(firstDayOfEra);
-        expected = NEW_ERA_NAME + " 1-02-11";
+        expected = SUP_ERA_NAME + " 1-02-11";
         if (!expected.equals(got)) {
             System.err.printf("GGGG y-MM-dd: got=\"%s\", expected=\"%s\"%n", got, expected);
             errors++;
@@ -122,7 +122,7 @@
         // test era abbreviation
         sdf = new SimpleDateFormat("G y-MM-dd", WAREKI_LOCALE);
         got = sdf.format(firstDayOfEra);
-        expected = NEW_ERA_ABBR+" 1-02-11";
+        expected = SUP_ERA_ABBR + " 1-02-11";
         if (!expected.equals(got)) {
             System.err.printf("G y-MM-dd: got=\"%s\", expected=\"%s\"%n", got, expected);
             errors++;
@@ -139,30 +139,30 @@
         // test java.time.chrono.JapaneseEra
         JapaneseDate jdate = JapaneseDate.of(year, 2, 11);
         got = jdate.toString();
-        expected = "Japanese " + NEW_ERA_NAME + " 1-02-11";
+        expected = "Japanese " + SUP_ERA_NAME + " 1-02-11";
         if (!expected.equals(got)) {
             System.err.printf("JapaneseDate: got=\"%s\", expected=\"%s\"%n", got, expected);
             errors++;
         }
         JapaneseEra jera = jdate.getEra();
         got = jera.getDisplayName(TextStyle.FULL, Locale.US);
-        if (!NEW_ERA_NAME.equals(got)) {
-            System.err.printf("JapaneseEra (FULL): got=\"%s\", expected=\"%s\"%n", got, NEW_ERA_NAME);
+        if (!SUP_ERA_NAME.equals(got)) {
+            System.err.printf("JapaneseEra (FULL): got=\"%s\", expected=\"%s\"%n", got, SUP_ERA_NAME);
             errors++;
         }
         got = jera.getDisplayName(TextStyle.SHORT, Locale.US);
-        if (!NEW_ERA_NAME.equals(got)) {
-            System.err.printf("JapaneseEra (SHORT): got=\"%s\", expected=\"%s\"%n", got, NEW_ERA_NAME);
+        if (!SUP_ERA_NAME.equals(got)) {
+            System.err.printf("JapaneseEra (SHORT): got=\"%s\", expected=\"%s\"%n", got, SUP_ERA_NAME);
             errors++;
         }
         got = jera.getDisplayName(TextStyle.NARROW, Locale.US);
-        if (!NEW_ERA_ABBR.equals(got)) {
-            System.err.printf("JapaneseEra (NARROW): got=\"%s\", expected=\"%s\"%n", got, NEW_ERA_ABBR);
+        if (!SUP_ERA_ABBR.equals(got)) {
+            System.err.printf("JapaneseEra (NARROW): got=\"%s\", expected=\"%s\"%n", got, SUP_ERA_ABBR);
             errors++;
         }
         got = jera.getDisplayName(TextStyle.NARROW_STANDALONE, Locale.US);
-        if (!NEW_ERA_ABBR.equals(got)) {
-            System.err.printf("JapaneseEra (NARROW_STANDALONE): got=\"%s\", expected=\"%s\"%n", got, NEW_ERA_ABBR);
+        if (!SUP_ERA_ABBR.equals(got)) {
+            System.err.printf("JapaneseEra (NARROW_STANDALONE): got=\"%s\", expected=\"%s\"%n", got, SUP_ERA_ABBR);
             errors++;
         }
 
@@ -172,7 +172,7 @@
             .withLocale(Locale.US)
             .withChronology(JapaneseChronology.INSTANCE)
             .format(jdate);
-        expected = NEW_ERA_NAME + " " + NEW_ERA_NAME + " " + NEW_ERA_ABBR;
+        expected = SUP_ERA_NAME + " " + SUP_ERA_NAME + " " + SUP_ERA_ABBR;
         if (!expected.equals(got)) {
             System.err.printf("java.time formatter full/short/narrow names: got=\"%s\", expected=\"%s\"%n", got, expected);
             errors++;
--- a/test/jdk/java/util/Calendar/SupplementalJapaneseEraTest.sh	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Calendar/SupplementalJapaneseEraTest.sh	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2018, 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
@@ -34,8 +34,8 @@
 SINCE=`${TESTJAVA}/bin/java -cp "${TESTCLASSES}" SupplementalJapaneseEraTest -s`
 
 echo "Tests with valid property values..."
-for P in "name=NewEra,abbr=N.E.,since=$SINCE" \
-         "name = NewEra, abbr = N.E., since = $SINCE"
+for P in "name=SupEra,abbr=S.E.,since=$SINCE" \
+         "name = SupEra, abbr = S.E., since = $SINCE"
 do
     if ${TESTJAVA}/bin/java ${TESTVMOPTS} -cp "${TESTCLASSES}" \
            -D$PROPERTY="$P" SupplementalJapaneseEraTest -t; then
@@ -51,17 +51,17 @@
 ERA=`${TESTJAVA}/bin/java -cp "${TESTCLASSES}" SupplementalJapaneseEraTest -e`
 
 echo "Tests with invalid property values..."
-for P in "foo=Bar,name=NewEra,abbr=N.E.,since=$SINCE" \
-         "=NewEra,abbr=N.E.,since=$SINCE" \
-         "=,abbr=N.E.,since=$SINCE" \
-         "name,abbr=N.E.,since=$SINCE" \
-         "abbr=N.E.,since=$SINCE" \
-         "name=NewEra,since=$SINCE" \
-         "name=,abbr=N.E.,since=$SINCE" \
-         "name=NewEra,abbr=,since=$SINCE" \
-         "name=NewEra,abbr=N.E." \
-         "name=NewEra,abbr=N.E.,since=0" \
-         "name=NewEra,abbr=N.E.,since=9223372036854775808" # Long.MAX_VALUE+1
+for P in "foo=Bar,name=SupEra,abbr=S.E.,since=$SINCE" \
+         "=SupEra,abbr=S.E.,since=$SINCE" \
+         "=,abbr=S.E.,since=$SINCE" \
+         "name,abbr=S.E.,since=$SINCE" \
+         "abbr=S.E.,since=$SINCE" \
+         "name=SupEra,since=$SINCE" \
+         "name=,abbr=S.E.,since=$SINCE" \
+         "name=SupEra,abbr=,since=$SINCE" \
+         "name=SupEra,abbr=S.E." \
+         "name=SupEra,abbr=S.E.,since=0" \
+         "name=SupEra,abbr=S.E.,since=9223372036854775808" # Long.MAX_VALUE+1
 do
     if ${TESTJAVA}/bin/java ${TESTVMOPTS} -cp "${TESTCLASSES}" \
            -D$PROPERTY="$P" SupplementalJapaneseEraTest -b "$ERA"; then
--- a/test/jdk/java/util/Calendar/ZoneOffsets.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Calendar/ZoneOffsets.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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
@@ -192,6 +192,7 @@
         cal2.setTimeZone(tz2);
         cal2.clear();
         cal2.set(2005, MARCH, 11);
+        adjustJapaneseEra(cal2);
         // test5: set only ZONE_OFFSET in non-lenient
         cal2.set(ZONE_OFFSET, gmtOffset);
         if (t1 != cal2.getTime().getTime() || dst != cal2.get(DST_OFFSET)) {
@@ -201,6 +202,7 @@
         cal2.setTimeZone(tz3);
         cal2.clear();
         cal2.set(2005, MARCH, 11);
+        adjustJapaneseEra(cal2);
         // test6: set only DST_OFFSET in non-lenient
         cal2.set(DST_OFFSET, dstOffset);
         if (t1 != cal2.getTime().getTime() || gmt != cal2.get(ZONE_OFFSET)) {
@@ -210,6 +212,7 @@
         cal2.setTimeZone(tz2);
         cal2.clear();
         cal2.set(2005, MARCH, 11);
+        adjustJapaneseEra(cal2);
         // test7: set both ZONE_OFFSET and DST_OFFSET in non-lenient
         cal2.set(ZONE_OFFSET, gmtOffset);
         cal2.set(DST_OFFSET, dstOffset);
@@ -220,6 +223,7 @@
         cal2.setTimeZone(tz3);
         cal2.clear();
         cal2.set(2005, MARCH, 11);
+        adjustJapaneseEra(cal2);
         // test8: set both ZONE_OFFSET and DST_OFFSET in non-lenient
         cal2.set(ZONE_OFFSET, gmtOffset);
         cal2.set(DST_OFFSET, dstOffset);
@@ -234,4 +238,16 @@
                 + ", gmtOffset=" + gmtOffset + ", dstOffset=" + dstOffset
                 + ", cal1 time=" + t1 + ", cal2 time=" + cal2.getTime().getTime());
     }
+
+    private static void adjustJapaneseEra(Calendar cal) {
+        // In case of Japanese calendar, explicitly set the last era; NEWERA so that
+        // year 2005 won't throw exception
+        if (!cal.isLenient() &&
+                cal.getCalendarType().equals("japanese") &&
+                System.currentTimeMillis() < 1556668800000L) { // Current time not in NEWERA
+            cal.set(Calendar.ERA, 5);
+            cal.add(Calendar.YEAR, -30); // -30: Subtract year-length of HEISEI era
+        }
+        return;
+    }
 }
--- a/test/jdk/java/util/Formatter/Basic-X.java.template	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/Basic-X.java.template	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/Basic.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/Basic.java	Mon Jun 11 09:29:44 2018 +0200
@@ -26,7 +26,7 @@
  * @bug 4906370 4962433 4973103 4989961 5005818 5031150 4970931 4989491 5002937
  *      5005104 5007745 5061412 5055180 5066788 5088703 6317248 6318369 6320122
  *      6344623 6369500 6534606 6282094 6286592 6476425 5063507 6469160 6476168
- *      8059175
+ *      8059175 8204229
  *
  * @modules java.base
  * @run shell/timeout=240 Basic.sh
--- a/test/jdk/java/util/Formatter/BasicBigDecimal.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicBigDecimal.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/BasicBigInteger.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicBigInteger.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/BasicBoolean.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicBoolean.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/BasicBooleanObject.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicBooleanObject.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/BasicByte.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicByte.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/BasicByteObject.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicByteObject.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/BasicChar.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicChar.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/BasicCharObject.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicCharObject.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/BasicDateTime.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicDateTime.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/BasicDouble.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicDouble.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/BasicDoubleObject.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicDoubleObject.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/BasicFloat.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicFloat.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/BasicFloatObject.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicFloatObject.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/BasicInt.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicInt.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/BasicIntObject.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicIntObject.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/BasicLong.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicLong.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/BasicLongObject.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicLongObject.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/BasicShort.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicShort.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/BasicShortObject.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/BasicShortObject.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1792,6 +1792,15 @@
         //---------------------------------------------------------------------
         test("%%", "%", (Object)null);
         test("%%", "%", "");
+
+        test("%5%", "    %", (Object)null);
+        test("%5%", "    %", "");
+        test("%-5%", "%    ", (Object)null);
+        test("%-5%", "%    ", "");
+
+        tryCatch("%.5%", IllegalFormatPrecisionException.class);
+        tryCatch("%5.5%", IllegalFormatPrecisionException.class);
+
         tryCatch("%%%", UnknownFormatConversionException.class);
         // perhaps an IllegalFormatArgumentIndexException should be defined?
         tryCatch("%<%", IllegalFormatFlagsException.class);
--- a/test/jdk/java/util/Formatter/genBasic.sh	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Formatter/genBasic.sh	Mon Jun 11 09:29:44 2018 +0200
@@ -23,7 +23,7 @@
 # questions.
 #
 
-javac -d . ../../../../make/src/classes/build/tools/spp/Spp.java
+javac -d . ../../../../../make/jdk/src/classes/build/tools/spp/Spp.java
 
 gen() {
 #  if [ $3 = "true" ]
--- a/test/jdk/java/util/Locale/Bug8040211.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/Locale/Bug8040211.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -23,9 +23,9 @@
 
 /*
  * @test
- * @bug 8040211 8191404
- * @summary Checks the IANA language subtag registry data updation
- *          (LSR Revision: 2017-08-15) with Locale and Locale.LanguageRange
+ * @bug 8040211 8191404 8203872
+ * @summary Checks the IANA language subtag registry data update
+ *          (LSR Revision: 2018-04-23) with Locale and Locale.LanguageRange
  *          class methods.
  * @run main Bug8040211
  */
@@ -67,8 +67,8 @@
     private static void test_parse() {
         boolean error = false;
         String str = "Accept-Language: aam, adp, aue, bcg, cqu, ema,"
-                + " en-gb-oed, gti, koj, kwq, kxe, lii, lmm, mtm, ngv,"
-                + " oyb, phr, pub, suj, taj;q=0.9, yug;q=0.5, gfx;q=0.4";
+                + " en-gb-oed, gti, kdz, koj, kwq, kxe, lii, lmm, mtm, ngv,"
+                + " oyb, phr, pub, suj, taj;q=0.9, ar-hyw;q=0.8, yug;q=0.5, gfx;q=0.4";
         ArrayList<LanguageRange> expected = new ArrayList<>();
         expected.add(new LanguageRange("aam", 1.0));
         expected.add(new LanguageRange("aas", 1.0));
@@ -86,6 +86,8 @@
         expected.add(new LanguageRange("en-gb-oxendict", 1.0));
         expected.add(new LanguageRange("gti", 1.0));
         expected.add(new LanguageRange("nyc", 1.0));
+        expected.add(new LanguageRange("kdz", 1.0));
+        expected.add(new LanguageRange("ncp", 1.0));
         expected.add(new LanguageRange("koj", 1.0));
         expected.add(new LanguageRange("kwv", 1.0));
         expected.add(new LanguageRange("kwq", 1.0));
@@ -112,6 +114,8 @@
         expected.add(new LanguageRange("xsj", 1.0));
         expected.add(new LanguageRange("taj", 0.9));
         expected.add(new LanguageRange("tsf", 0.9));
+        expected.add(new LanguageRange("ar-hyw", 0.8));
+        expected.add(new LanguageRange("ar-arevmda", 0.8));
         expected.add(new LanguageRange("yug", 0.5));
         expected.add(new LanguageRange("yuu", 0.5));
         expected.add(new LanguageRange("gfx", 0.4));
@@ -176,15 +180,15 @@
     private static void test_filter() {
         boolean error = false;
 
-        String ranges = "mtm-RU, en-gb-oed, coy";
-        String tags = "de-DE, en, mtm-RU, ymt-RU, en-gb-oxendict, ja-JP, pij, nts";
+        String ranges = "mtm-RU, en-gb-oed, coy, ar-HY";
+        String tags = "de-DE, en, mtm-RU, ymt-RU, en-gb-oxendict, ja-JP, pij, nts, ar-arevela";
         FilteringMode mode = EXTENDED_FILTERING;
 
         List<LanguageRange> priorityList = LanguageRange.parse(ranges);
         List<Locale> tagList = generateLocales(tags);
         String actualLocales
                 = showLocales(Locale.filter(priorityList, tagList, mode));
-        String expectedLocales = "mtm-RU, ymt-RU, en-GB-oxendict, nts, pij";
+        String expectedLocales = "mtm-RU, ymt-RU, en-GB-oxendict, nts, pij, ar-arevela";
 
         if (!expectedLocales.equals(actualLocales)) {
             error = true;
--- a/test/jdk/java/util/concurrent/tck/TimeUnit8Test.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/java/util/concurrent/tck/TimeUnit8Test.java	Mon Jun 11 09:29:44 2018 +0200
@@ -40,8 +40,12 @@
 import static java.util.concurrent.TimeUnit.NANOSECONDS;
 import static java.util.concurrent.TimeUnit.SECONDS;
 
+import java.time.Duration;
 import java.time.temporal.ChronoUnit;
+import java.util.Arrays;
+import java.util.concurrent.ThreadLocalRandom;
 import java.util.concurrent.TimeUnit;
+import java.util.stream.LongStream;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -100,4 +104,85 @@
         }
     }
 
+    /**
+     * convert(Duration) roundtrips with Duration.ofXXXX and Duration.of(long, ChronoUnit)
+     */
+    public void testConvertDuration_roundtripDurationOf() {
+        long n = ThreadLocalRandom.current().nextLong();
+
+        assertEquals(n, NANOSECONDS.convert(Duration.ofNanos(n)));
+        assertEquals(n, NANOSECONDS.convert(Duration.of(n, ChronoUnit.NANOS)));
+        assertEquals(n, MILLISECONDS.convert(Duration.ofMillis(n)));
+        assertEquals(n, MILLISECONDS.convert(Duration.of(n, ChronoUnit.MILLIS)));
+        assertEquals(n, SECONDS.convert(Duration.ofSeconds(n)));
+        assertEquals(n, SECONDS.convert(Duration.of(n, ChronoUnit.SECONDS)));
+        n /= 60;
+        assertEquals(n, MINUTES.convert(Duration.ofMinutes(n)));
+        assertEquals(n, MINUTES.convert(Duration.of(n, ChronoUnit.MINUTES)));
+        n /= 60;
+        assertEquals(n, HOURS.convert(Duration.ofHours(n)));
+        assertEquals(n, HOURS.convert(Duration.of(n, ChronoUnit.HOURS)));
+        n /= 24;
+        assertEquals(n, DAYS.convert(Duration.ofDays(n)));
+        assertEquals(n, DAYS.convert(Duration.of(n, ChronoUnit.DAYS)));
+    }
+
+    /**
+     * convert(Duration.ofNanos(n)) agrees with convert(n, NANOSECONDS)
+     */
+    public void testConvertDuration_roundtripDurationOfNanos() {
+        // Test values near unit transitions and near overflow.
+        LongStream.concat(
+                Arrays.stream(TimeUnit.values()).mapToLong(u -> u.toNanos(1)),
+                LongStream.of(Long.MAX_VALUE, Long.MIN_VALUE))
+            .flatMap(n -> LongStream.of(n, n + 1, n - 1))
+            .flatMap(n -> LongStream.of(n, n + 1_000_000_000, n - 1_000_000_000))
+            .flatMap(n -> LongStream.of(n, -n))
+            // .peek(System.err::println)
+            .forEach(n -> Arrays.stream(TimeUnit.values()).forEach(
+                u -> assertEquals(u.convert(n, NANOSECONDS),
+                                  u.convert(Duration.ofNanos(n)))));
+    }
+
+    /**
+     * convert(Duration) doesn't misbehave near Long.MAX_VALUE and Long.MIN_VALUE.
+     */
+    public void testConvertDuration_nearOverflow() {
+        ChronoUnit NANOS = ChronoUnit.NANOS;
+        Duration maxDuration = Duration.ofSeconds(Long.MAX_VALUE, 999_999_999);
+        Duration minDuration = Duration.ofSeconds(Long.MIN_VALUE, 0);
+
+        for (TimeUnit u : TimeUnit.values()) {
+            ChronoUnit cu = u.toChronoUnit();
+            long r;
+            if (u.toNanos(1) > SECONDS.toNanos(1)) {
+                r = u.toNanos(1) / SECONDS.toNanos(1);
+
+                assertThrows(ArithmeticException.class,
+                             () -> Duration.of(Long.MAX_VALUE, cu),
+                             () -> Duration.of(Long.MIN_VALUE, cu));
+            } else {
+                r = 1;
+
+                Duration max = Duration.of(Long.MAX_VALUE, cu);
+                Duration min = Duration.of(Long.MIN_VALUE, cu);
+                assertEquals(Long.MAX_VALUE, u.convert(max));
+                assertEquals(Long.MAX_VALUE - 1, u.convert(max.minus(1, NANOS)));
+                assertEquals(Long.MAX_VALUE - 1, u.convert(max.minus(1, cu)));
+                assertEquals(Long.MIN_VALUE, u.convert(min));
+                assertEquals(Long.MIN_VALUE + 1, u.convert(min.plus(1, NANOS)));
+                assertEquals(Long.MIN_VALUE + 1, u.convert(min.plus(1, cu)));
+                assertEquals(Long.MAX_VALUE, u.convert(max.plus(1, NANOS)));
+                if (u != SECONDS) {
+                    assertEquals(Long.MAX_VALUE, u.convert(max.plus(1, cu)));
+                    assertEquals(Long.MIN_VALUE, u.convert(min.minus(1, NANOS)));
+                    assertEquals(Long.MIN_VALUE, u.convert(min.minus(1, cu)));
+                }
+            }
+
+            assertEquals(Long.MAX_VALUE / r, u.convert(maxDuration));
+            assertEquals(Long.MIN_VALUE / r, u.convert(minDuration));
+        }
+    }
+
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javax/imageio/plugins/jpeg/TestWriteARGBJPEG.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug     8204187
+ * @run     main TestWriteARGBJPEG
+ * @summary verify JPEG Alpha support is as reported.
+ */
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.io.ByteArrayOutputStream;
+import java.awt.image.BufferedImage;
+import javax.imageio.ImageIO;
+import javax.imageio.ImageWriter;
+import javax.imageio.ImageTypeSpecifier;
+import javax.imageio.spi.ImageWriterSpi;
+import javax.imageio.stream.MemoryCacheImageOutputStream;
+
+public class TestWriteARGBJPEG {
+    public static void main(String args[]) throws IOException {
+
+        BufferedImage bi =
+            new BufferedImage(10,10,BufferedImage.TYPE_INT_ARGB);
+    ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+    // There should be no exception from the next line
+    // which internally should be relying on the canEncodeImage
+    // method which we'll also test directly.
+    boolean ret = ImageIO.write(bi, "jpeg", baos);
+    System.out.println("ImageIO.write(..) returned " + ret);
+
+    ImageTypeSpecifier its = new ImageTypeSpecifier(bi);
+    Iterator<ImageWriter> writers = ImageIO.getImageWriters(its, "jpeg");
+    boolean hasWriter = writers.hasNext();
+    // If this can't write it, an exception will be thrown.
+    if (writers.hasNext()) {
+        System.out.println("A writer was found.");
+        ImageWriter iw = writers.next();
+        MemoryCacheImageOutputStream mos =
+            new MemoryCacheImageOutputStream(baos);
+        iw.setOutput(mos);
+        iw.write(bi);
+    }
+
+    // Now Let's also ask the default JPEG writer's SPI if it
+    // can write an ARGB image.
+    ImageWriter iw = ImageIO.getImageWritersByFormatName("jpeg").next();
+    ImageWriterSpi iwSpi = iw.getOriginatingProvider();
+    boolean canEncode = iwSpi.canEncodeImage(bi);
+    System.out.println("SPI canEncodeImage returned " + canEncode);
+
+    // Now let's see if it is telling the truth.
+    try {
+        MemoryCacheImageOutputStream mos =
+            new MemoryCacheImageOutputStream(baos);
+        iw.setOutput(mos);
+        iw.write(bi);
+    } catch (IOException e) {
+         if (canEncode) {
+           throw e;
+         }
+    }
+  }
+}
--- a/test/jdk/javax/imageio/plugins/shared/BitDepth.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/javax/imageio/plugins/shared/BitDepth.java	Mon Jun 11 09:29:44 2018 +0200
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug     4413109 4418221 6607198 8147448
+ * @bug     4413109 4418221 6607198 8147448 8204187
  * @run     main BitDepth
  * @summary Checks that ImageIO writers for standard formats can handle
  *          various BufferedImage RGB types. An optional list of arguments
@@ -197,6 +197,7 @@
         if (!writers.hasNext()) {
             System.out.println("\tNo writers available for type " + biTypeNames[type]
                                + " BufferedImage!");
+            return null;
         } else {
             ImageWriter writer = writers.next();
             try (ImageOutputStream out = ImageIO.createImageOutputStream(file)) {
@@ -205,7 +206,7 @@
             } catch (Exception e) {
                 System.out.println("\tCan't write a type " +  biTypeNames[type]
                            + " BufferedImage!");
-                return null;
+                throw new RuntimeException(e);
             }
         }
 
--- a/test/jdk/javax/swing/JLayer/8041982/bug8041982.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/javax/swing/JLayer/8041982/bug8041982.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, 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
@@ -53,7 +53,7 @@
 
     private class BusyLayer extends LayerUI<JComponent> {
         private volatile boolean animated = true;
-        private Icon icon = new ImageIcon(bug8041982.class.getResource("cupanim.gif"));
+        private Icon icon = new ImageIcon(bug8041982.class.getResource("duke.gif"));
         private int imageUpdateCount;
 
         @Override
Binary file test/jdk/javax/swing/JLayer/8041982/cupanim.gif has changed
Binary file test/jdk/javax/swing/JLayer/8041982/duke.gif has changed
--- a/test/jdk/javax/swing/JSlider/4987336/bug4987336.html	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/javax/swing/JSlider/4987336/bug4987336.html	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 <!--
- Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2007, 2018, 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,7 @@
 <html>
 <body>
 <applet  code="bug4987336.class" width=600 height=400></applet>
-There are four Sliders. Each of them has a label with animated gif (a cup of coffee)
+There are four Sliders. Each of them has a label with animated gif (a waving duke)
 and a label with static image.
 
 Check that for every LAF animation works for all Sliders. 
--- a/test/jdk/javax/swing/JSlider/4987336/bug4987336.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/javax/swing/JSlider/4987336/bug4987336.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2018, 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
@@ -37,7 +37,7 @@
 public class bug4987336 extends JApplet {
     private static final String IMAGE_RES = "box.gif";
 
-    private static final String ANIM_IMAGE_RES = "cupanim.gif";
+    private static final String ANIM_IMAGE_RES = "duke.gif";
 
     public void init() {
         JPanel pnLafs = new JPanel();
Binary file test/jdk/javax/swing/JSlider/4987336/cupanim.gif has changed
Binary file test/jdk/javax/swing/JSlider/4987336/duke.gif has changed
--- a/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSConcurrent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSConcurrent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -29,7 +29,7 @@
 /*
  * @test
  * @key jfr
- * @requires vm.gc == "ConcMarkSweep" | vm.gc == null
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  * @requires vm.opt.ExplicitGCInvokesConcurrent != false
  * @library /test/lib /test/jdk
  * @run driver jdk.jfr.event.gc.collection.TestGCCauseWithCMSConcurrent
--- a/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSMarkSweep.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSMarkSweep.java	Mon Jun 11 09:29:44 2018 +0200
@@ -30,7 +30,7 @@
  * @test
  * @key jfr
  *
- * @requires vm.gc == "ConcMarkSweep" | vm.gc == null
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  * @requires vm.opt.ExplicitGCInvokesConcurrent != true
  * @library /test/lib /test/jdk
  * @run driver jdk.jfr.event.gc.collection.TestGCCauseWithCMSMarkSweep
--- a/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSConcurrent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSConcurrent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -29,7 +29,7 @@
  * @test
  * @key jfr
  *
- * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null)
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  *           & vm.opt.ExplicitGCInvokesConcurrent != false
  * @library /test/lib /test/jdk
  *
--- a/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSMarkSweep.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSMarkSweep.java	Mon Jun 11 09:29:44 2018 +0200
@@ -29,7 +29,7 @@
  * @test
  * @key jfr
  *
- * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null)
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  *           & vm.opt.ExplicitGCInvokesConcurrent != true
  * @library /test/lib /test/jdk
  *
--- a/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithParNew.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithParNew.java	Mon Jun 11 09:29:44 2018 +0200
@@ -29,7 +29,7 @@
  * @test
  * @key jfr
  *
- * @requires vm.gc == "ConcMarkSweep" | vm.gc == null
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  * @library /test/lib /test/jdk
  * @run main/othervm -Xmx32m -Xmn8m -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:+UseConcMarkSweepGC jdk.jfr.event.gc.collection.TestGCEventMixedWithParNew
  * good debug flags: -Xlog:gc*=debug
--- a/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithParNew.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithParNew.java	Mon Jun 11 09:29:44 2018 +0200
@@ -28,7 +28,7 @@
 /*
  * @test
  * @key jfr
- * @requires vm.gc == "ConcMarkSweep" | vm.gc == null
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  * @library /test/lib /test/jdk
  * @run main/othervm -Xmx50m -Xmn2m -XX:+UseConcMarkSweepGC -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -Xlog:gc+heap=trace,gc*=debug jdk.jfr.event.gc.collection.TestYoungGarbageCollectionEventWithParNew
  */
--- a/test/jdk/jdk/jfr/event/gc/detailed/TestCMSConcurrentModeFailureEvent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/detailed/TestCMSConcurrentModeFailureEvent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -42,7 +42,7 @@
  * @test
  * @key jfr
  *
- * @requires vm.gc == "ConcMarkSweep" | vm.gc == null
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  * @library /test/lib /test/jdk
  *
  * @run main jdk.jfr.event.gc.detailed.TestCMSConcurrentModeFailureEvent
--- a/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithParNew.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithParNew.java	Mon Jun 11 09:29:44 2018 +0200
@@ -27,7 +27,7 @@
 /*
  * @test
  * @key jfr
- * @requires vm.gc == "ConcMarkSweep" | vm.gc == null
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  * @library /test/lib /test/jdk
  * @run main/othervm  jdk.jfr.event.gc.detailed.TestPromotionFailedEventWithParNew
  */
--- a/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithCMS.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithCMS.java	Mon Jun 11 09:29:44 2018 +0200
@@ -26,7 +26,7 @@
 
 /*
  * @test
- * @requires vm.gc == "null" | vm.gc == "ConcMarkSweep"
+ * @requires (vm.gc == "null" | vm.gc == "ConcMarkSweep") & !vm.graal.enabled
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UseConcMarkSweepGC -Xmx64m jdk.jfr.event.gc.detailed.TestStressAllocationGCEventsWithCMS
  */
--- a/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithParNew.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithParNew.java	Mon Jun 11 09:29:44 2018 +0200
@@ -26,7 +26,7 @@
 
 /*
  * @test
- * @requires vm.gc == "null"
+ * @requires vm.gc == "null" & !vm.graal.enabled
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UseConcMarkSweepGC -Xmx64m jdk.jfr.event.gc.detailed.TestStressAllocationGCEventsWithParNew
  */
--- a/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithCMS.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithCMS.java	Mon Jun 11 09:29:44 2018 +0200
@@ -26,7 +26,7 @@
 
 /*
  * @test
- * @requires vm.gc == "null" | vm.gc == "ConcMarkSweep"
+ * @requires (vm.gc == "null" | vm.gc == "ConcMarkSweep") & !vm.graal.enabled
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UseConcMarkSweepGC -Xmx256m jdk.jfr.event.gc.detailed.TestStressBigAllocationGCEventsWithCMS 1048576
  */
--- a/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithParNew.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithParNew.java	Mon Jun 11 09:29:44 2018 +0200
@@ -26,7 +26,7 @@
 
 /*
  * @test
- * @requires vm.gc == "null"
+ * @requires vm.gc == "null" & !vm.graal.enabled
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UseConcMarkSweepGC -Xmx256m jdk.jfr.event.gc.detailed.TestStressBigAllocationGCEventsWithParNew 1048576
  */
--- a/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventConcurrentCMS.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventConcurrentCMS.java	Mon Jun 11 09:29:44 2018 +0200
@@ -38,7 +38,7 @@
 /*
  * @test
  * @key jfr
- * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null)
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  *           & vm.opt.ExplicitGCInvokesConcurrent != false
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent jdk.jfr.event.gc.heapsummary.TestHeapSummaryEventConcurrentCMS
--- a/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventParNewCMS.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventParNewCMS.java	Mon Jun 11 09:29:44 2018 +0200
@@ -29,7 +29,7 @@
 /*
  * @test
  * @key jfr
- * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null)
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  *           & vm.opt.ExplicitGCInvokesConcurrent != true
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:+UseConcMarkSweepGC jdk.jfr.event.gc.heapsummary.TestHeapSummaryEventParNewCMS
--- a/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSConcurrent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSConcurrent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -29,7 +29,7 @@
 /*
  * @test
  * @key jfr
- * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null)
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  *           & vm.opt.ExplicitGCInvokesConcurrent != false
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent -XX:MarkSweepDeadRatio=0 -XX:-UseCompressedOops -XX:+IgnoreUnrecognizedVMOptions jdk.jfr.event.gc.objectcount.TestObjectCountAfterGCEventWithCMSConcurrent
--- a/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSMarkSweep.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSMarkSweep.java	Mon Jun 11 09:29:44 2018 +0200
@@ -29,7 +29,7 @@
 /*
  * @test
  * @key jfr
- * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null)
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  *           & vm.opt.ExplicitGCInvokesConcurrent != true
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:+UseConcMarkSweepGC -XX:MarkSweepDeadRatio=0 -XX:-UseCompressedOops -XX:+IgnoreUnrecognizedVMOptions jdk.jfr.event.gc.objectcount.TestObjectCountAfterGCEventWithCMSMarkSweep
--- a/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSConcurrent.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSConcurrent.java	Mon Jun 11 09:29:44 2018 +0200
@@ -29,7 +29,7 @@
 /*
  * @test
  * @key jfr
- * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null)
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  *           & vm.opt.ExplicitGCInvokesConcurrent != false
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -Xlog:gc+heap=trace,gc*=debug -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent jdk.jfr.event.gc.refstat.TestRefStatEventWithCMSConcurrent
--- a/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSMarkSweep.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSMarkSweep.java	Mon Jun 11 09:29:44 2018 +0200
@@ -29,7 +29,7 @@
 /*
  * @test
  * @key jfr
- * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null)
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  *           & vm.opt.ExplicitGCInvokesConcurrent != true
  * @library /test/lib /test/jdk
  * @run main/othervm  -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -Xlog:gc+heap=trace,gc*=debug -XX:+UseConcMarkSweepGC jdk.jfr.event.gc.refstat.TestRefStatEventWithCMSMarkSweep
--- a/test/jdk/jdk/jfr/event/gc/stacktrace/TestConcMarkSweepAllocationPendingStackTrace.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/stacktrace/TestConcMarkSweepAllocationPendingStackTrace.java	Mon Jun 11 09:29:44 2018 +0200
@@ -28,7 +28,7 @@
  * @test
  * @key jfr
  *
- * @requires vm.gc == "null" | vm.gc == "ConcMarkSweep"
+ * @requires (vm.gc == "null" | vm.gc == "ConcMarkSweep") & !vm.graal.enabled
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:MaxNewSize=10M -Xmx64M -XX:+UseConcMarkSweepGC -Xlog:gc* jdk.jfr.event.gc.stacktrace.TestConcMarkSweepAllocationPendingStackTrace
  */
--- a/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceConcMarkSweepGCAllocationPendingStackTrace.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceConcMarkSweepGCAllocationPendingStackTrace.java	Mon Jun 11 09:29:44 2018 +0200
@@ -28,7 +28,7 @@
  * @test
  * @key jfr
  *
- * @requires vm.gc == "null" | vm.gc == "ConcMarkSweep"
+ * @requires (vm.gc == "null" | vm.gc == "ConcMarkSweep") & !vm.graal.enabled
  * @requires !(vm.compMode == "Xcomp" & os.arch == "aarch64")
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UseConcMarkSweepGC -XX:MaxMetaspaceSize=64M -Xlog:gc* jdk.jfr.event.gc.stacktrace.TestMetaspaceConcMarkSweepGCAllocationPendingStackTrace
--- a/test/jdk/jdk/jfr/event/gc/stacktrace/TestParNewAllocationPendingStackTrace.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/gc/stacktrace/TestParNewAllocationPendingStackTrace.java	Mon Jun 11 09:29:44 2018 +0200
@@ -28,7 +28,7 @@
  * @test
  * @key jfr
  *
- * @requires vm.gc == "null" | vm.gc == "ConcMarkSweep"
+ * @requires (vm.gc == "null" | vm.gc == "ConcMarkSweep") & !vm.graal.enabled
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UseConcMarkSweepGC -Xlog:gc* -XX:+FlightRecorder jdk.jfr.event.gc.stacktrace.TestParNewAllocationPendingStackTrace
  */
--- a/test/jdk/jdk/jfr/event/oldobject/TestCMS.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/oldobject/TestCMS.java	Mon Jun 11 09:29:44 2018 +0200
@@ -37,7 +37,7 @@
 /*
  * @test
  * @key jfr
- * @requires vm.gc == "null"
+ * @requires vm.gc == "null" & !vm.graal.enabled
  * @summary Test leak profiler with CMS GC
  * @library /test/lib /test/jdk
  * @modules jdk.jfr/jdk.jfr.internal.test
--- a/test/jdk/jdk/jfr/event/runtime/TestModuleEvents.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/jdk/jfr/event/runtime/TestModuleEvents.java	Mon Jun 11 09:29:44 2018 +0200
@@ -40,6 +40,7 @@
  * @test
  * @summary Tests the JFR events related to modules
  * @key jfr
+ * @requires !vm.graal.enabled
  * @library /test/lib
  * @run main/othervm --limit-modules java.base,jdk.jfr jdk.jfr.event.runtime.TestModuleEvents
  */
--- a/test/jdk/sun/applet/DeprecatedAppletViewer/DeprecatedAppletViewer.java	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-
-/**
- * @test
- * @bug 8074165
- * @modules java.desktop/sun.applet
- * @run main/othervm -Duser.language=en DeprecatedAppletViewer
- */
-public final class DeprecatedAppletViewer {
-
-    private static final String TEXT
-            = "Warning: Applet API and AppletViewer are deprecated.";
-
-    public static void main(final String[] args) {
-        final PrintStream old = System.err;
-        final ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
-        final PrintStream ps = new PrintStream(baos);
-        try {
-            System.setErr(ps);
-            sun.applet.Main.main(new String[]{});
-        } finally {
-            System.setErr(old);
-        }
-
-        final String text = new String(baos.toByteArray());
-        if (!text.contains(TEXT)) {
-            System.err.println("The text should contain: \"" + TEXT + "\"");
-            System.err.println("But the current text is: ");
-            System.err.println(text);
-            throw new RuntimeException("Error");
-        }
-    }
-}
--- a/test/jdk/sun/applet/TEST.properties	Wed Jun 06 10:32:59 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-modules=java.desktop
-
--- a/test/jdk/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java	Mon Jun 11 09:29:44 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug     4858522
+ * @bug     4858522 8174734
  * @summary Basic unit test of HotspotRuntimeMBean.getSafepointSyncTime()
  * @author  Steve Bohne
  *
@@ -43,50 +43,71 @@
 
     private static final long NUM_THREAD_DUMPS = 300;
 
-    // Careful with these values.
-    private static final long MIN_VALUE_FOR_PASS = 1;
-    private static final long MAX_VALUE_FOR_PASS = Long.MAX_VALUE;
+    static void checkPositive(long value, String label) {
+        if (value < 0)
+            throw new RuntimeException(label + " had a negative value of "
+                                       + value);
+    }
+
+    static void validate(long count1, long count2, long time1, long time2,
+                         String label) {
+        checkPositive(count1, label + ":count1");
+        checkPositive(count2, label + ":count2");
+        checkPositive(time1, label + ":time1");
+        checkPositive(time2, label + ":time2");
+
+        long countDiff = count2 - count1;
+        long timeDiff = time2 - time1;
+
+        if (countDiff < NUM_THREAD_DUMPS) {
+            throw new RuntimeException(label +
+                                       ": Expected at least " + NUM_THREAD_DUMPS +
+                                       " safepoints but only got " + countDiff);
+        }
+
+        // getSafepointSyncTime is the accumulated time spent getting to a
+        // safepoint, so each safepoint will add a little to this, but the
+        // resolution is only milliseconds so we may not see it.
+        if (timeDiff < 0) {
+            throw new RuntimeException(label + ": Safepoint sync time " +
+                                       "decreased unexpectedly " +
+                                       "(time1 = " + time1 + "; " +
+                                       "time2 = " + time2 + ")");
+        }
+
+        System.out.format("%s: Safepoint count=%d (diff=%d), sync time=%d ms (diff=%d)%n",
+                          label, count2, countDiff, time2, timeDiff);
+
+    }
 
     public static void main(String args[]) throws Exception {
         long count = mbean.getSafepointCount();
-        long value = mbean.getSafepointSyncTime();
+        long time = mbean.getSafepointSyncTime();
 
-        // Thread.getAllStackTraces() should cause safepoints.
-        // If this test is failing because it doesn't,
-        // MIN_VALUE_FOR_PASS should be reset to 0
+        checkPositive(count, "count");
+        checkPositive(time, "time");
+
+        // Thread.getAllStackTraces() should cause a safepoint.
+
         for (int i = 0; i < NUM_THREAD_DUMPS; i++) {
             Thread.getAllStackTraces();
         }
 
         long count1 = mbean.getSafepointCount();
-        long value1 = mbean.getSafepointSyncTime();
-
-        System.out.format("Safepoint count=%d (diff=%d), sync time=%d ms (diff=%d)%n",
-                          count1, count1-count, value1, value1-value);
+        long time1 = mbean.getSafepointSyncTime();
 
-        if (value1 < MIN_VALUE_FOR_PASS || value1 > MAX_VALUE_FOR_PASS) {
-            throw new RuntimeException("Safepoint sync time " +
-                                       "illegal value: " + value1 + " ms " +
-                                       "(MIN = " + MIN_VALUE_FOR_PASS + "; " +
-                                       "MAX = " + MAX_VALUE_FOR_PASS + ")");
-        }
+        validate(count, count1, time, time1, "Pass 1");
+
+        // repeat the experiment
 
         for (int i = 0; i < NUM_THREAD_DUMPS; i++) {
             Thread.getAllStackTraces();
         }
 
         long count2 = mbean.getSafepointCount();
-        long value2 = mbean.getSafepointSyncTime();
-
-        System.out.format("Safepoint count=%d (diff=%d), sync time=%d ms (diff=%d)%n",
-                          count2, count2-count1, value2, value2-value1);
+        long time2 = mbean.getSafepointSyncTime();
 
-        if (value2 <= value1) {
-            throw new RuntimeException("Safepoint sync time " +
-                                       "did not increase " +
-                                       "(value1 = " + value1 + "; " +
-                                       "value2 = " + value2 + ")");
-        }
+        validate(count1, count2, time1, time2, "Pass 2");
 
         System.out.println("Test passed.");
     }
--- a/test/jdk/tools/jmod/JmodNegativeTest.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/tools/jmod/JmodNegativeTest.java	Mon Jun 11 09:29:44 2018 +0200
@@ -100,7 +100,7 @@
         jmod("--badOption")
             .assertFailure()
             .resultChecker(r ->
-                assertContains(r.output, "Error: 'badOption' is not a recognized option")
+                assertContains(r.output, "Error: badOption is not a recognized option")
             );
     }
 
--- a/test/jdk/tools/jmod/JmodTest.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jdk/tools/jmod/JmodTest.java	Mon Jun 11 09:29:44 2018 +0200
@@ -111,7 +111,7 @@
 
         Path jmod = MODS_DIR.resolve("apa.jmod");
         jmod("create",
-             "--libs=", libDir.toString(),
+             "--libs=" + libDir.toString(),
              "--class-path", classesDir.toString(),
              jmod.toString())
             .assertSuccess();
@@ -310,7 +310,7 @@
         Path lp = EXPLODED_DIR.resolve("foo").resolve("lib");
 
         jmod("create",
-             "--libs=", lp.toString(),
+             "--libs=" + lp.toString(),
              "--class-path", cp.toString(),
              jmod.toString())
             .assertSuccess()
@@ -335,8 +335,8 @@
 
         jmod("create",
              "--conf", cf.toString(),
-             "--cmds=", bp.toString(),
-             "--libs=", lp.toString(),
+             "--cmds=" + bp.toString(),
+             "--libs=" + lp.toString(),
              "--class-path", cp.toString(),
              jmod.toString())
             .assertSuccess()
@@ -361,7 +361,7 @@
         Path lp = EXPLODED_DIR.resolve("foo").resolve("lib");
 
         jmod("create",
-             "--libs=", lp.toString(),
+             "--libs=" + lp.toString(),
              "--class-path", cp.toString(),
              "--exclude", "**internal**",
              "--exclude", "first.so",
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/launcher/SourceMode.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,405 @@
+/*
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8192920 8204588
+ * @summary Test source mode
+ * @modules jdk.compiler
+ * @run main SourceMode
+ */
+
+
+import java.io.IOException;
+import java.io.PrintStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.attribute.PosixFilePermission;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+public class SourceMode extends TestHelper {
+
+    public static void main(String... args) throws Exception {
+        new SourceMode().run(args);
+    }
+
+    // to reduce the chance of creating shebang lines that are too long,
+    // we use a relative path to the java command if that is shorter
+    private final Path shortJavaCmd;
+
+    private final PrintStream log;
+
+    private final boolean skipShebangTest;
+
+    SourceMode() {
+        Path cwd = Paths.get(System.getProperty("user.dir"));
+        Path cmd = Paths.get(javaCmd);
+
+        if (isWindows) {
+            // Skip shebang tests on Windows, because that requires Cygwin.
+            shortJavaCmd = cmd;
+            skipShebangTest = true;
+        } else {
+            // Skip shebang tests if the path to the Java launcher is too long,
+            // because that will cause tests to overflow the mostly undocumented
+            // limit of 120 characters for a shebang line.
+            Path p = cwd.relativize(cmd);
+            shortJavaCmd = (p.toString().length() < cmd.toString().length()) ? p : cmd;
+            // skipShebangTest = shortJavaCmd.toString().length() > 100;
+            skipShebangTest = true;
+        }
+
+        log = System.err;
+    }
+
+    // java Simple.java 1 2 3
+    @Test
+    void testSimpleJava() throws IOException {
+        starting("testSimpleJava");
+        Path file = getSimpleFile("Simple.java", false);
+        TestResult tr = doExec(javaCmd, file.toString(), "1", "2", "3");
+        if (!tr.isOK())
+            error(tr, "Bad exit code: " + tr.exitValue);
+        if (!tr.contains("[1, 2, 3]"))
+            error(tr, "Expected output not found");
+        show(tr);
+    }
+
+    // java --source 10 simple 1 2 3
+    @Test
+    void testSimple() throws IOException {
+        starting("testSimple");
+        Path file = getSimpleFile("simple", false);
+        TestResult tr = doExec(javaCmd, "--source", "10", file.toString(), "1", "2", "3");
+        if (!tr.isOK())
+            error(tr, "Bad exit code: " + tr.exitValue);
+        if (!tr.contains("[1, 2, 3]"))
+            error(tr, "Expected output not found");
+        show(tr);
+    }
+
+    // execSimple 1 2 3
+    @Test
+    void testExecSimple() throws IOException {
+        starting("testExecSimple");
+        if (skipShebangTest) {
+            log.println("SKIPPED");
+            return;
+        }
+        Path file = setExecutable(getSimpleFile("execSimple", true));
+        TestResult tr = doExec(file.toAbsolutePath().toString(), "1", "2", "3");
+        if (!tr.isOK())
+            error(tr, "Bad exit code: " + tr.exitValue);
+        if (!tr.contains("[1, 2, 3]"))
+            error(tr, "Expected output not found");
+        show(tr);
+    }
+
+    // java @simpleJava.at  (contains Simple.java 1 2 3)
+    @Test
+    void testSimpleJavaAtFile() throws IOException {
+        starting("testSimpleJavaAtFile");
+        Path file = getSimpleFile("Simple.java", false);
+        Path atFile = Paths.get("simpleJava.at");
+        createFile(atFile, List.of(file + " 1 2 3"));
+        TestResult tr = doExec(javaCmd, "@" + atFile);
+        if (!tr.isOK())
+            error(tr, "Bad exit code: " + tr.exitValue);
+        if (!tr.contains("[1, 2, 3]"))
+            error(tr, "Expected output not found");
+        show(tr);
+    }
+
+    // java @simple.at  (contains --source 10 simple 1 2 3)
+    @Test
+    void testSimpleAtFile() throws IOException {
+        starting("testSimpleAtFile");
+        Path file = getSimpleFile("simple", false);
+        Path atFile = Paths.get("simple.at");
+        createFile(atFile, List.of("--source 10 " + file + " 1 2 3"));
+        TestResult tr = doExec(javaCmd, "@" + atFile);
+        if (!tr.isOK())
+            error(tr, "Bad exit code: " + tr.exitValue);
+        if (!tr.contains("[1, 2, 3]"))
+            error(tr, "Expected output not found");
+        show(tr);
+    }
+
+    // java -cp classes Main.java 1 2 3
+    @Test
+    void testClasspath() throws IOException {
+        starting("testClasspath");
+        Path base = Files.createDirectories(Paths.get("testClasspath"));
+        Path otherJava = base.resolve("Other.java");
+        createFile(otherJava, List.of(
+            "public class Other {",
+            "  public static String join(String[] args) {",
+            "    return String.join(\"-\", args);",
+            "  }",
+            "}"
+        ));
+        Path classes = Files.createDirectories(base.resolve("classes"));
+        Path mainJava = base.resolve("Main.java");
+        createFile(mainJava, List.of(
+            "class Main {",
+            "  public static void main(String[] args) {",
+            "    System.out.println(Other.join(args));",
+            "  }}"
+        ));
+        compile("-d", classes.toString(), otherJava.toString());
+        TestResult tr = doExec(javaCmd, "-cp", classes.toString(),
+                mainJava.toString(), "1", "2", "3");
+        if (!tr.isOK())
+            error(tr, "Bad exit code: " + tr.exitValue);
+        if (!tr.contains("1-2-3"))
+            error(tr, "Expected output not found");
+        show(tr);
+    }
+
+    // java --add-exports=... Export.java --help
+    @Test
+    void testAddExports() throws IOException {
+        starting("testAddExports");
+        Path exportJava = Paths.get("Export.java");
+        createFile(exportJava, List.of(
+            "public class Export {",
+            "  public static void main(String[] args) {",
+            "    new com.sun.tools.javac.main.Main(\"demo\").compile(args);",
+            "  }",
+            "}"
+        ));
+        // verify access fails without --add-exports
+        TestResult tr1 = doExec(javaCmd, exportJava.toString(), "--help");
+        if (tr1.isOK())
+            error(tr1, "Compilation succeeded unexpectedly");
+        show(tr1);
+        // verify access succeeds with --add-exports
+        TestResult tr2 = doExec(javaCmd,
+            "--add-exports", "jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED",
+            exportJava.toString(), "--help");
+        if (!tr2.isOK())
+            error(tr2, "Bad exit code: " + tr2.exitValue);
+        if (!(tr2.contains("demo") && tr2.contains("Usage")))
+            error(tr2, "Expected output not found");
+        show(tr2);
+    }
+
+    // java -cp ... HelloWorld.java  (for a class "java" in package "HelloWorld")
+    @Test
+    void testClassNamedJava() throws IOException {
+        starting("testClassNamedJava");
+        Path base = Files.createDirectories(Paths.get("testClassNamedJava"));
+        Path src = Files.createDirectories(base.resolve("src"));
+        Path srcfile = src.resolve("java.java");
+        createFile(srcfile, List.of(
+                "package HelloWorld;",
+                "class java {",
+                "    public static void main(String... args) {",
+                "        System.out.println(HelloWorld.java.class.getName());",
+                "    }",
+                "}"
+        ));
+        Path classes = base.resolve("classes");
+        compile("-d", classes.toString(), srcfile.toString());
+        TestResult tr =
+            doExec(javaCmd, "-cp", classes.toString(), "HelloWorld.java");
+        if (!tr.isOK())
+            error(tr, "Command failed");
+        if (!tr.contains("HelloWorld.java"))
+            error(tr, "Expected output not found");
+        show(tr);
+    }
+
+    // java --source
+    @Test
+    void testSourceNoArg() throws IOException {
+        starting("testSourceNoArg");
+        TestResult tr = doExec(javaCmd, "--source");
+        if (tr.isOK())
+            error(tr, "Command succeeded unexpectedly");
+        if (!tr.contains("--source requires source version"))
+            error(tr, "Expected output not found");
+        show(tr);
+    }
+
+    // java --source 10 -jar simple.jar
+    @Test
+    void testSourceJarConflict() throws IOException {
+        starting("testSourceJarConflict");
+        Path base = Files.createDirectories(Paths.get("testSourceJarConflict"));
+        Path file = getSimpleFile("Simple.java", false);
+        Path classes = Files.createDirectories(base.resolve("classes"));
+        compile("-d", classes.toString(), file.toString());
+        Path simpleJar = base.resolve("simple.jar");
+        createJar("cf", simpleJar.toString(), "-C", classes.toString(), ".");
+        TestResult tr =
+            doExec(javaCmd, "--source", "10", "-jar", simpleJar.toString());
+        if (tr.isOK())
+            error(tr, "Command succeeded unexpectedly");
+        if (!tr.contains("Option -jar is not allowed with --source"))
+            error(tr, "Expected output not found");
+        show(tr);
+    }
+
+    // java --source 10 -m jdk.compiler
+    @Test
+    void testSourceModuleConflict() throws IOException {
+        starting("testSourceModuleConflict");
+        TestResult tr = doExec(javaCmd, "--source", "10", "-m", "jdk.compiler");
+        if (tr.isOK())
+            error(tr, "Command succeeded unexpectedly");
+        if (!tr.contains("Option -m is not allowed with --source"))
+            error(tr, "Expected output not found");
+        show(tr);
+    }
+
+    // #!.../java --source 10 -version
+    @Test
+    void testTerminalOptionInShebang() throws IOException {
+        starting("testTerminalOptionInShebang");
+        if (skipShebangTest) {
+            log.println("SKIPPED");
+            return;
+        }
+        Path base = Files.createDirectories(
+            Paths.get("testTerminalOptionInShebang"));
+        Path bad = base.resolve("bad");
+        createFile(bad, List.of(
+            "#!" + shortJavaCmd + " --source 10 -version"));
+        setExecutable(bad);
+        TestResult tr = doExec(bad.toString());
+        if (!tr.contains("Option -version is not allowed in this context"))
+            error(tr, "Expected output not found");
+        show(tr);
+    }
+
+    // #!.../java --source 10 @bad.at  (contains -version)
+    @Test
+    void testTerminalOptionInShebangAtFile() throws IOException {
+        starting("testTerminalOptionInShebangAtFile");
+        if (skipShebangTest) {
+            log.println("SKIPPED");
+            return;
+        }
+        // Use a short directory name, to avoid line length limitations
+        Path base = Files.createDirectories(Paths.get("testBadAtFile"));
+        Path bad_at = base.resolve("bad.at");
+        createFile(bad_at, List.of("-version"));
+        Path bad = base.resolve("bad");
+        createFile(bad, List.of(
+            "#!" + shortJavaCmd + " --source 10 @" + bad_at));
+        setExecutable(bad);
+        TestResult tr = doExec(bad.toString());
+        if (!tr.contains("Option -version in @testBadAtFile/bad.at is "
+                + "not allowed in this context"))
+            error(tr, "Expected output not found");
+        show(tr);
+    }
+
+    // #!.../java --source 10 HelloWorld
+    @Test
+    void testMainClassInShebang() throws IOException {
+        starting("testMainClassInShebang");
+        if (skipShebangTest) {
+            log.println("SKIPPED");
+            return;
+        }
+        Path base = Files.createDirectories(Paths.get("testMainClassInShebang"));
+        Path bad = base.resolve("bad");
+        createFile(bad, List.of(
+            "#!" + shortJavaCmd + " --source 10 HelloWorld"));
+        setExecutable(bad);
+        TestResult tr = doExec(bad.toString());
+        if (!tr.contains("Cannot specify main class in this context"))
+            error(tr, "Expected output not found");
+        show(tr);
+    }
+
+    //--------------------------------------------------------------------------
+
+    private void starting(String label) {
+        System.out.println();
+        System.out.println("*** Starting: " + label + " (stdout)");
+
+        System.err.println();
+        System.err.println("*** Starting: " + label + " (stderr)");
+    }
+
+    private void show(TestResult tr) {
+        log.println("*** Test Output:");
+        for (String line: tr.testOutput) {
+            log.println(line);
+        }
+        log.println("*** End Of Test Output:");
+    }
+
+    private Map<String,String> getLauncherDebugEnv() {
+        return Map.of("_JAVA_LAUNCHER_DEBUG", "1");
+    }
+
+    private Path getSimpleFile(String name, boolean shebang) throws IOException {
+        Path file = Paths.get(name);
+        if (!Files.exists(file)) {
+            createFile(file, List.of(
+                (shebang ? "#!" + shortJavaCmd + " --source 10" : ""),
+                "public class Simple {",
+                "  public static void main(String[] args) {",
+                "    System.out.println(java.util.Arrays.toString(args));",
+                "  }}"));
+        }
+        return file;
+    }
+
+    private void createFile(Path file, List<String> lines) throws IOException {
+        lines.stream()
+            .filter(line -> line.length() > 128)
+            .forEach(line -> {
+                    log.println("*** Warning: long line ("
+                                        + line.length()
+                                        + " chars) in file " + file);
+                    log.println("*** " + line);
+                });
+        log.println("*** File: " + file);
+        lines.stream().forEach(log::println);
+        log.println("*** End Of File");
+        createFile(file.toFile(), lines);
+    }
+
+    private Path setExecutable(Path file) throws IOException {
+        Set<PosixFilePermission> perms = Files.getPosixFilePermissions(file);
+        perms.add(PosixFilePermission.OWNER_EXECUTE);
+        Files.setPosixFilePermissions(file, perms);
+        return file;
+    }
+
+    private void error(TestResult tr, String message) {
+        show(tr);
+        throw new RuntimeException(message);
+    }
+}
--- a/test/jtreg-ext/requires/VMProps.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/jtreg-ext/requires/VMProps.java	Mon Jun 11 09:29:44 2018 +0200
@@ -36,6 +36,7 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import sun.hotspot.code.Compiler;
 import sun.hotspot.cpuinfo.CPUInfo;
 import sun.hotspot.gc.GC;
 import sun.hotspot.WhiteBox;
@@ -344,33 +345,7 @@
      * @return true if Graal is used as JIT compiler.
      */
     protected String isGraalEnabled() {
-        // Graal is enabled if following conditions are true:
-        // - we are not in Interpreter mode
-        // - UseJVMCICompiler flag is true
-        // - jvmci.Compiler variable is equal to 'graal'
-        // - TieredCompilation is not used or TieredStopAtLevel is greater than 3
-
-        Boolean useCompiler = WB.getBooleanVMFlag("UseCompiler");
-        if (useCompiler == null || !useCompiler)
-            return "false";
-
-        Boolean useJvmciComp = WB.getBooleanVMFlag("UseJVMCICompiler");
-        if (useJvmciComp == null || !useJvmciComp)
-            return "false";
-
-        // This check might be redundant but let's keep it for now.
-        String jvmciCompiler = System.getProperty("jvmci.Compiler");
-        if (jvmciCompiler == null || !jvmciCompiler.equals("graal")) {
-            return "false";
-        }
-
-        Boolean tieredCompilation = WB.getBooleanVMFlag("TieredCompilation");
-        Long compLevel = WB.getIntxVMFlag("TieredStopAtLevel");
-        // if TieredCompilation is enabled and compilation level is <= 3 then no Graal is used
-        if (tieredCompilation != null && tieredCompilation && compLevel != null && compLevel <= 3)
-            return "false";
-
-        return "true";
+        return Compiler.isGraalEnabled() ? "true" : "false";
     }
 
 
--- a/test/langtools/jdk/javadoc/doclet/testFramesNoFrames/TestFramesNoFrames.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/langtools/jdk/javadoc/doclet/testFramesNoFrames/TestFramesNoFrames.java	Mon Jun 11 09:29:44 2018 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8162353 8164747 8173707 8196202
+ * @bug 8162353 8164747 8173707 8196202 8204303
  * @summary javadoc should provide a way to disable use of frames
  * @library /tools/lib ../lib
  * @modules
@@ -269,6 +269,9 @@
                     break;
             }
 
+            out.println("Checker: " + fKind + " " + oKind + " " + hKind
+                + ": frames:" + frames + " overview:" + overview);
+
             checkAllClassesFiles();
             checkFrameFiles();
             checkOverviewSummary();
@@ -380,10 +383,19 @@
         }
 
         private void checkOverviewSummary() {
-            // the overview-summary.html file only appears if
-            // in frames mode and (overview requested or multiple packages)
-            checkFiles(frames && overview,
+            // To accommodate the historical behavior of generating
+            // overview-summary.html in frames mode, the file
+            // will still be generated in no-frames mode,
+            // but will be a redirect to index.html
+            checkFiles(overview,
                     "overview-summary.html");
+            if (overview) {
+                checkOutput("overview-summary.html",  !frames,
+                        "<link rel=\"canonical\" href=\"index.html\">",
+                        "<script type=\"text/javascript\">window.location.replace('index.html')</script>",
+                        "<meta http-equiv=\"Refresh\" content=\"0;index.html\">",
+                        "<p><a href=\"index.html\">index.html</a></p>");
+            }
         }
 
         private void checkWarning() {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/DefiniteAssignment/T8204610.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8204610
+ * @summary Compiler confused by parenthesized "this" in final fields assignments
+ * @library /tools/javac/lib
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.code
+ *          jdk.compiler/com.sun.tools.javac.comp
+ *          jdk.compiler/com.sun.tools.javac.main
+ *          jdk.compiler/com.sun.tools.javac.tree
+ *          jdk.compiler/com.sun.tools.javac.util
+ * @build combo.ComboTestHelper
+
+ * @run main T8204610
+ */
+
+import combo.ComboInstance;
+import combo.ComboParameter;
+import combo.ComboTask.Result;
+import combo.ComboTestHelper;
+
+public class T8204610 extends ComboInstance<T8204610> {
+
+    enum ParenKind implements ComboParameter {
+        NONE(""),
+        ONE("#P"),
+        TWO("#P#P"),
+        THREE("#P#P#P");
+
+        String parensTemplate;
+
+        ParenKind(String parensTemplate) {
+            this.parensTemplate = parensTemplate;
+        }
+
+        @Override
+        public String expand(String optParameter) {
+            return parensTemplate.replaceAll("#P", optParameter.equals("OPEN") ? "(" : ")");
+        }
+    }
+
+    public static void main(String... args) {
+        new ComboTestHelper<T8204610>()
+                .withArrayDimension("PAREN", (x, pk, idx) -> x.parenKinds[idx] = pk, 3, ParenKind.values())
+                .run(T8204610::new);
+    }
+
+    ParenKind[] parenKinds = new ParenKind[3];
+
+    @Override
+    public void doWork() {
+        newCompilationTask()
+                .withSourceFromTemplate(bodyTemplate)
+                .analyze(this::check);
+    }
+
+    String bodyTemplate = "class Test {\n" +
+                          "   final int x;\n" +
+                          "   Test() {\n" +
+                          "      #{PAREN[0].OPEN} #{PAREN[1].OPEN} this #{PAREN[1].CLOSE} . #{PAREN[2].OPEN} x #{PAREN[2].CLOSE} #{PAREN[0].CLOSE} = 1;\n" +
+                          "   } }";
+
+    void check(Result<?> res) {
+        boolean expectedFail = parenKinds[2] != ParenKind.NONE;
+        if (expectedFail != res.hasErrors()) {
+            fail("unexpected compilation result for source:\n" +
+                res.compilationInfo());
+        }
+    }
+}
--- a/test/langtools/tools/javac/diags/CheckResourceKeys.java	Wed Jun 06 10:32:59 2018 +0200
+++ b/test/langtools/tools/javac/diags/CheckResourceKeys.java	Mon Jun 11 09:29:44 2018 +0200
@@ -118,7 +118,8 @@
     void findDeadKeys(Set<String> codeStrings, Set<String> resourceKeys) {
         String[] prefixes = {
             "compiler.err.", "compiler.warn.", "compiler.note.", "compiler.misc.",
-            "javac."
+            "javac.",
+            "launcher.err."
         };
         for (String rk: resourceKeys) {
             // some keys are used directly, without a prefix.
@@ -395,7 +396,7 @@
     Set<String> getResourceKeys() {
         Module jdk_compiler = ModuleLayer.boot().findModule("jdk.compiler").get();
         Set<String> results = new TreeSet<String>();
-        for (String name : new String[]{"javac", "compiler"}) {
+        for (String name : new String[]{"javac", "compiler", "launcher"}) {
             ResourceBundle b =
                     ResourceBundle.getBundle("com.sun.tools.javac.resources." + name, jdk_compiler);
             results.addAll(b.keySet());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/launcher/SourceLauncherTest.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,544 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8192920 8204588
+ * @summary Test source launcher
+ * @library /tools/lib
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.launcher
+ *          jdk.compiler/com.sun.tools.javac.main
+ * @build toolbox.JavaTask toolbox.JavacTask toolbox.TestRunner toolbox.ToolBox
+ * @run main SourceLauncherTest
+ */
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.reflect.InvocationTargetException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+
+import com.sun.tools.javac.launcher.Main;
+
+import toolbox.JavaTask;
+import toolbox.JavacTask;
+import toolbox.Task;
+import toolbox.TestRunner;
+import toolbox.TestRunner;
+import toolbox.ToolBox;
+
+public class SourceLauncherTest extends TestRunner {
+    public static void main(String... args) throws Exception {
+        SourceLauncherTest t = new SourceLauncherTest();
+        t.runTests(m -> new Object[] { Paths.get(m.getName()) });
+    }
+
+    SourceLauncherTest() {
+        super(System.err);
+        tb = new ToolBox();
+        System.err.println("version: " + thisVersion);
+    }
+
+    private final ToolBox tb;
+    private static final String thisVersion = System.getProperty("java.specification.version");
+
+    /*
+     * Positive tests.
+     */
+
+    @Test
+    public void testHelloWorld(Path base) throws IOException {
+        tb.writeJavaFiles(base,
+            "import java.util.Arrays;\n" +
+            "class HelloWorld {\n" +
+            "    public static void main(String... args) {\n" +
+            "        System.out.println(\"Hello World! \" + Arrays.toString(args));\n" +
+            "    }\n" +
+            "}");
+        testSuccess(base.resolve("HelloWorld.java"), "Hello World! [1, 2, 3]\n");
+    }
+
+    @Test
+    public void testHelloWorldInPackage(Path base) throws IOException {
+        tb.writeJavaFiles(base,
+            "package hello;\n" +
+            "import java.util.Arrays;\n" +
+            "class World {\n" +
+            "    public static void main(String... args) {\n" +
+            "        System.out.println(\"Hello World! \" + Arrays.toString(args));\n" +
+            "    }\n" +
+            "}");
+        testSuccess(base.resolve("hello").resolve("World.java"), "Hello World! [1, 2, 3]\n");
+    }
+
+    @Test
+    public void testHelloWorldWithAux(Path base) throws IOException {
+        tb.writeJavaFiles(base,
+            "import java.util.Arrays;\n" +
+            "class HelloWorld {\n" +
+            "    public static void main(String... args) {\n" +
+            "        Aux.write(args);\n" +
+            "    }\n" +
+            "}\n" +
+            "class Aux {\n" +
+            "    static void write(String... args) {\n" +
+            "        System.out.println(\"Hello World! \" + Arrays.toString(args));\n" +
+            "    }\n" +
+            "}");
+        testSuccess(base.resolve("HelloWorld.java"), "Hello World! [1, 2, 3]\n");
+    }
+
+    @Test
+    public void testHelloWorldWithShebang(Path base) throws IOException {
+        tb.writeJavaFiles(base,
+            "#!/usr/bin/java --source 11\n" +
+            "import java.util.Arrays;\n" +
+            "class HelloWorld {\n" +
+            "    public static void main(String... args) {\n" +
+            "        System.out.println(\"Hello World! \" + Arrays.toString(args));\n" +
+            "    }\n" +
+            "}");
+        Files.copy(base.resolve("HelloWorld.java"), base.resolve("HelloWorld"));
+        testSuccess(base.resolve("HelloWorld"), "Hello World! [1, 2, 3]\n");
+    }
+
+    @Test
+    public void testNoAnnoProcessing(Path base) throws IOException {
+        Path annoSrc = base.resolve("annoSrc");
+        tb.writeJavaFiles(annoSrc,
+            "import java.util.*;\n" +
+            "import javax.annotation.processing.*;\n" +
+            "import javax.lang.model.element.*;\n" +
+            "@SupportedAnnotationTypes(\"*\")\n" +
+            "public class AnnoProc extends AbstractProcessor {\n" +
+            "    public boolean process(Set<? extends TypeElement> annos, RoundEnvironment rEnv) {\n" +
+            "        throw new Error(\"Annotation processor should not be invoked\");\n" +
+            "    }\n" +
+            "}\n");
+        Path annoClasses = Files.createDirectories(base.resolve("classes"));
+        new JavacTask(tb)
+                .outdir(annoClasses)
+                .files(annoSrc.resolve("AnnoProc.java").toString())
+                .run();
+        Path serviceFile = annoClasses.resolve("META-INF").resolve("services")
+                .resolve("javax.annotation.processing.Processor");
+        tb.writeFile(serviceFile, "AnnoProc");
+
+        Path mainSrc = base.resolve("mainSrc");
+        tb.writeJavaFiles(mainSrc,
+            "import java.util.Arrays;\n" +
+            "class HelloWorld {\n" +
+            "    public static void main(String... args) {\n" +
+            "        System.out.println(\"Hello World! \" + Arrays.toString(args));\n" +
+            "    }\n" +
+            "}");
+
+        List<String> javacArgs = List.of("-classpath", annoClasses.toString());
+        List<String> classArgs = List.of("1", "2", "3");
+        String expect = "Hello World! [1, 2, 3]\n";
+        Result r = run(mainSrc.resolve("HelloWorld.java"), javacArgs, classArgs);
+        checkEqual("stdout", r.stdOut, expect);
+        checkEmpty("stderr", r.stdErr);
+        checkNull("exception", r.exception);
+    }
+
+    @Test
+    public void testEnablePreview(Path base) throws IOException {
+        tb.writeJavaFiles(base,
+            "import java.util.Arrays;\n" +
+            "class HelloWorld {\n" +
+            "    public static void main(String... args) {\n" +
+            "        System.out.println(\"Hello World! \" + Arrays.toString(args));\n" +
+            "    }\n" +
+            "}");
+
+        String log = new JavaTask(tb)
+                .vmOptions("--enable-preview", "--source", thisVersion)
+                .className(base.resolve("HelloWorld.java").toString())
+                .classArgs("1", "2", "3")
+                .run(Task.Expect.SUCCESS)
+                .getOutput(Task.OutputKind.STDOUT);
+        checkEqual("stdout", log.trim(), "Hello World! [1, 2, 3]");
+    }
+
+    void testSuccess(Path file, String expect) throws IOException {
+        Result r = run(file, Collections.emptyList(), List.of("1", "2", "3"));
+        checkEqual("stdout", r.stdOut, expect);
+        checkEmpty("stderr", r.stdErr);
+        checkNull("exception", r.exception);
+    }
+
+    /*
+     * Negative tests: such as cannot find or execute main method.
+     */
+
+    @Test
+    public void testHelloWorldWithShebangJava(Path base) throws IOException {
+        tb.writeJavaFiles(base,
+            "#!/usr/bin/java --source 11\n" +
+            "import java.util.Arrays;\n" +
+            "class HelloWorld {\n" +
+            "    public static void main(String... args) {\n" +
+            "        System.out.println(\"Hello World! \" + Arrays.toString(args));\n" +
+            "    }\n" +
+            "}");
+        Path file = base.resolve("HelloWorld.java");
+        testError(file,
+            file + ":1: error: illegal character: '#'\n" +
+            "#!/usr/bin/java --source 11\n" +
+            "^\n" +
+            file + ":1: error: class, interface, or enum expected\n" +
+            "#!/usr/bin/java --source 11\n" +
+            "  ^\n" +
+            "2 errors\n",
+            "error: compilation failed");
+    }
+
+    @Test
+    public void testNoClass(Path base) throws IOException {
+        Files.createDirectories(base);
+        Path file = base.resolve("NoClass.java");
+        Files.write(file, List.of("package p;"));
+        testError(file, "", "error: no class declared in file");
+    }
+
+    @Test
+    public void testWrongClass(Path base) throws IOException {
+        Path src = base.resolve("src");
+        Path file = src.resolve("WrongClass.java");
+        tb.writeJavaFiles(src, "class WrongClass { }");
+        Path classes = Files.createDirectories(base.resolve("classes"));
+        new JavacTask(tb)
+                .outdir(classes)
+                .files(file)
+                .run();
+        String log = new JavaTask(tb)
+                .classpath(classes.toString())
+                .className(file.toString())
+                .run(Task.Expect.FAIL)
+                .getOutput(Task.OutputKind.STDERR);
+        checkEqual("stderr", log.trim(),
+                "error: class found on application class path: WrongClass");
+    }
+
+    @Test
+    public void testSyntaxErr(Path base) throws IOException {
+        tb.writeJavaFiles(base, "class SyntaxErr {");
+        Path file = base.resolve("SyntaxErr.java");
+        testError(file,
+                file + ":1: error: reached end of file while parsing\n" +
+                "class SyntaxErr {\n" +
+                "                 ^\n" +
+                "1 error\n",
+                "error: compilation failed");
+    }
+
+    @Test
+    public void testNoSourceOnClassPath(Path base) throws IOException {
+        Path auxSrc = base.resolve("auxSrc");
+        tb.writeJavaFiles(auxSrc,
+            "public class Aux {\n" +
+            "    static final String MESSAGE = \"Hello World\";\n" +
+            "}\n");
+
+        Path mainSrc = base.resolve("mainSrc");
+        tb.writeJavaFiles(mainSrc,
+            "import java.util.Arrays;\n" +
+            "class HelloWorld {\n" +
+            "    public static void main(String... args) {\n" +
+            "        System.out.println(Aux.MESSAGE + Arrays.toString(args));\n" +
+            "    }\n" +
+            "}");
+
+        List<String> javacArgs = List.of("-classpath", auxSrc.toString());
+        List<String> classArgs = List.of("1", "2", "3");
+        String FS = File.separator;
+        String expectStdErr =
+            "testNoSourceOnClassPath" + FS + "mainSrc" + FS + "HelloWorld.java:4: error: cannot find symbol\n" +
+            "        System.out.println(Aux.MESSAGE + Arrays.toString(args));\n" +
+            "                           ^\n" +
+            "  symbol:   variable Aux\n" +
+            "  location: class HelloWorld\n" +
+            "1 error\n";
+        Result r = run(mainSrc.resolve("HelloWorld.java"), javacArgs, classArgs);
+        checkEmpty("stdout", r.stdOut);
+        checkEqual("stderr", r.stdErr, expectStdErr);
+        checkFault("exception", r.exception, "error: compilation failed");
+
+    }
+
+    // For any source file that is invoked through the OS shebang mechanism, invalid shebang
+    // lines will be caught and handled by the OS, before the launcher is even invoked.
+    // However, if such a file is passed directly to the launcher, perhaps using the --source
+    // option, a well-formed shebang line will be removed but a badly-formed one will be not be
+    // removed and will cause compilation errors.
+    @Test
+    public void testBadShebang(Path base) throws IOException {
+        tb.writeJavaFiles(base,
+            "#/usr/bin/java --source 11\n" +
+            "import java.util.Arrays;\n" +
+            "class HelloWorld {\n" +
+            "    public static void main(String... args) {\n" +
+            "        System.out.println(\"Hello World! \" + Arrays.toString(args));\n" +
+            "    }\n" +
+            "}");
+        Path file = base.resolve("HelloWorld.java");
+        testError(file,
+            file + ":1: error: illegal character: '#'\n" +
+            "#/usr/bin/java --source 11\n" +
+            "^\n" +
+            file + ":1: error: class, interface, or enum expected\n" +
+            "#/usr/bin/java --source 11\n" +
+            "  ^\n" +
+            "2 errors\n",
+            "error: compilation failed");
+    }
+
+    @Test
+    public void testBadSourceOpt(Path base) throws IOException {
+        Files.createDirectories(base);
+        Path file = base.resolve("DummyClass.java");
+        Files.write(file, List.of("class DummyClass { }"));
+        Properties sysProps = System.getProperties();
+        Properties p = new Properties(sysProps);
+        p.setProperty("jdk.internal.javac.source", "<BAD>");
+        System.setProperties(p);
+        try {
+            testError(file, "", "error: invalid value for --source option: <BAD>");
+        } finally {
+            System.setProperties(sysProps);
+        }
+    }
+
+    @Test
+    public void testEnablePreviewNoSource(Path base) throws IOException {
+        tb.writeJavaFiles(base,
+            "import java.util.Arrays;\n" +
+            "class HelloWorld {\n" +
+            "    public static void main(String... args) {\n" +
+            "        System.out.println(\"Hello World! \" + Arrays.toString(args));\n" +
+            "    }\n" +
+            "}");
+
+        String log = new JavaTask(tb)
+                .vmOptions("--enable-preview")
+                .className(base.resolve("HelloWorld.java").toString())
+                .run(Task.Expect.FAIL)
+                .getOutput(Task.OutputKind.STDERR);
+        checkEqual("stderr", log.trim(),
+                "error: --enable-preview must be used with --source");
+    }
+
+    @Test
+    public void testNoMain(Path base) throws IOException {
+        tb.writeJavaFiles(base, "class NoMain { }");
+        testError(base.resolve("NoMain.java"), "",
+                "error: can't find main(String[]) method in class: NoMain");
+    }
+
+    @Test
+    public void testMainBadParams(Path base) throws IOException {
+        tb.writeJavaFiles(base,
+                "class BadParams { public static void main() { } }");
+        testError(base.resolve("BadParams.java"), "",
+                "error: can't find main(String[]) method in class: BadParams");
+    }
+
+    @Test
+    public void testMainNotPublic(Path base) throws IOException {
+        tb.writeJavaFiles(base,
+                "class NotPublic { static void main(String... args) { } }");
+        testError(base.resolve("NotPublic.java"), "",
+                "error: 'main' method is not declared 'public static'");
+    }
+
+    @Test
+    public void testMainNotStatic(Path base) throws IOException {
+        tb.writeJavaFiles(base,
+                "class NotStatic { public void main(String... args) { } }");
+        testError(base.resolve("NotStatic.java"), "",
+                "error: 'main' method is not declared 'public static'");
+    }
+
+    @Test
+    public void testMainNotVoid(Path base) throws IOException {
+        tb.writeJavaFiles(base,
+                "class NotVoid { public static int main(String... args) { return 0; } }");
+        testError(base.resolve("NotVoid.java"), "",
+                "error: 'main' method is not declared with a return type of 'void'");
+    }
+
+    @Test
+    public void testClassInModule(Path base) throws IOException {
+        tb.writeJavaFiles(base, "package java.net; class InModule { }");
+        Path file = base.resolve("java").resolve("net").resolve("InModule.java");
+        testError(file,
+                file + ":1: error: package exists in another module: java.base\n" +
+                "package java.net; class InModule { }\n" +
+                "^\n" +
+                "1 error\n",
+                "error: compilation failed");
+    }
+
+    void testError(Path file, String expectStdErr, String expectFault) throws IOException {
+        Result r = run(file, Collections.emptyList(), List.of("1", "2", "3"));
+        checkEmpty("stdout", r.stdOut);
+        checkEqual("stderr", r.stdErr, expectStdErr);
+        checkFault("exception", r.exception, expectFault);
+    }
+
+    /*
+     * Tests in which main throws an exception.
+     */
+    @Test
+    public void testTargetException1(Path base) throws IOException {
+        tb.writeJavaFiles(base,
+            "import java.util.Arrays;\n" +
+            "class Thrower {\n" +
+            "    public static void main(String... args) {\n" +
+            "        throwWhenZero(Integer.parseInt(args[0]));\n" +
+            "    }\n" +
+            "    static void throwWhenZero(int arg) {\n" +
+            "        if (arg == 0) throw new Error(\"zero!\");\n" +
+            "        throwWhenZero(arg - 1);\n" +
+            "    }\n" +
+            "}");
+        Path file = base.resolve("Thrower.java");
+        Result r = run(file, Collections.emptyList(), List.of("3"));
+        checkEmpty("stdout", r.stdOut);
+        checkEmpty("stderr", r.stdErr);
+        checkTrace("exception", r.exception,
+                "java.lang.Error: zero!",
+                "at Thrower.throwWhenZero(Thrower.java:7)",
+                "at Thrower.throwWhenZero(Thrower.java:8)",
+                "at Thrower.throwWhenZero(Thrower.java:8)",
+                "at Thrower.throwWhenZero(Thrower.java:8)",
+                "at Thrower.main(Thrower.java:4)");
+    }
+
+    Result run(Path file, List<String> runtimeArgs, List<String> appArgs) {
+        List<String> args = new ArrayList<>();
+        args.add(file.toString());
+        args.addAll(appArgs);
+
+        PrintStream prev = System.out;
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        try (PrintStream out = new PrintStream(baos, true)) {
+            System.setOut(out);
+            StringWriter sw = new StringWriter();
+            try (PrintWriter err = new PrintWriter(sw, true)) {
+                Main m = new Main(err);
+                m.run(toArray(runtimeArgs), toArray(args));
+                return new Result(baos.toString(), sw.toString(), null);
+            } catch (Throwable t) {
+                return new Result(baos.toString(), sw.toString(), t);
+            }
+        } finally {
+            System.setOut(prev);
+        }
+    }
+
+    void checkEqual(String name, String found, String expect) {
+        expect = expect.replace("\n", tb.lineSeparator);
+        out.println(name + ": " + found);
+        out.println(name + ": " + found);
+        if (!expect.equals(found)) {
+            error("Unexpected output; expected: " + expect);
+        }
+    }
+
+    void checkEmpty(String name, String found) {
+        out.println(name + ": " + found);
+        if (!found.isEmpty()) {
+            error("Unexpected output; expected empty string");
+        }
+    }
+
+    void checkNull(String name, Throwable found) {
+        out.println(name + ": " + found);
+        if (found != null) {
+            error("Unexpected exception; expected null");
+        }
+    }
+
+    void checkFault(String name, Throwable found, String expect) {
+        expect = expect.replace("\n", tb.lineSeparator);
+        out.println(name + ": " + found);
+        if (found == null) {
+            error("No exception thrown; expected Main.Fault");
+        } else {
+            if (!(found instanceof Main.Fault)) {
+                error("Unexpected exception; expected Main.Fault");
+            }
+            if (!(found.getMessage().equals(expect))) {
+                error("Unexpected detail message; expected: " + expect);
+            }
+        }
+    }
+
+    void checkTrace(String name, Throwable found, String... expect) {
+        if (!(found instanceof InvocationTargetException)) {
+            error("Unexpected exception; expected InvocationTargetException");
+            out.println("Found:");
+            found.printStackTrace(out);
+        }
+        StringWriter sw = new StringWriter();
+        try (PrintWriter pw = new PrintWriter(sw)) {
+            ((InvocationTargetException) found).getTargetException().printStackTrace(pw);
+        }
+        String trace = sw.toString();
+        out.println(name + ":\n" + trace);
+        String[] traceLines = trace.trim().split("[\r\n]+\\s+");
+        try {
+            tb.checkEqual(List.of(traceLines), List.of(expect));
+        } catch (Error e) {
+            error(e.getMessage());
+        }
+    }
+
+    String[] toArray(List<String> list) {
+        return list.toArray(new String[list.size()]);
+    }
+
+    class Result {
+        private final String stdOut;
+        private final String stdErr;
+        private final Throwable exception;
+
+        Result(String stdOut, String stdErr, Throwable exception) {
+            this.stdOut = stdOut;
+            this.stdErr = stdErr;
+            this.exception = exception;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/sun/hotspot/code/Compiler.java	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.hotspot.code;
+
+import sun.hotspot.WhiteBox;
+
+/**
+ * API to obtain information about enabled JIT compilers
+ * retrieved from the VM with the WhiteBox API.
+ */
+public class Compiler {
+
+    private static final WhiteBox WB = WhiteBox.getWhiteBox();
+
+    /**
+     * Check if Graal is used as JIT compiler.
+     *
+     * Graal is enabled if following conditions are true:
+     * - we are not in Interpreter mode
+     * - UseJVMCICompiler flag is true
+     * - jvmci.Compiler variable is equal to 'graal'
+     * - TieredCompilation is not used or TieredStopAtLevel is greater than 3
+     * No need to check client mode because it set UseJVMCICompiler to false.
+     *
+     * @return true if Graal is used as JIT compiler.
+     */
+    public static boolean isGraalEnabled() {
+        Boolean useCompiler = WB.getBooleanVMFlag("UseCompiler");
+        if (useCompiler == null || !useCompiler) {
+            return false;
+        }
+        Boolean useJvmciComp = WB.getBooleanVMFlag("UseJVMCICompiler");
+        if (useJvmciComp == null || !useJvmciComp) {
+            return false;
+        }
+        // This check might be redundant but let's keep it for now.
+        String jvmciCompiler = System.getProperty("jvmci.Compiler");
+        if (jvmciCompiler == null || !jvmciCompiler.equals("graal")) {
+            return false;
+        }
+
+        Boolean tieredCompilation = WB.getBooleanVMFlag("TieredCompilation");
+        Long compLevel = WB.getIntxVMFlag("TieredStopAtLevel");
+        // if TieredCompilation is enabled and compilation level is <= 3 then no Graal is used
+        if (tieredCompilation != null && tieredCompilation &&
+            compLevel != null && compLevel <= 3) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Check if C2 is used as JIT compiler.
+     *
+     * C2 is enabled if following conditions are true:
+     * - we are not in Interpreter mode
+     * - we are in Server compilation mode
+     * - TieredCompilation is not used or TieredStopAtLevel is greater than 3
+     * - Graal is not used
+     *
+     * @return true if C2 is used as JIT compiler.
+     */
+    public static boolean isC2Enabled() {
+        Boolean useCompiler = WB.getBooleanVMFlag("UseCompiler");
+        if (useCompiler == null || !useCompiler) {
+            return false;
+        }
+        Boolean serverMode = WB.getBooleanVMFlag("ProfileInterpreter");
+        if (serverMode == null || !serverMode) {
+            return false;
+        }
+
+        Boolean tieredCompilation = WB.getBooleanVMFlag("TieredCompilation");
+        Long compLevel = WB.getIntxVMFlag("TieredStopAtLevel");
+        // if TieredCompilation is enabled and compilation level is <= 3 then no Graal is used
+        if (tieredCompilation != null && tieredCompilation &&
+            compLevel != null && compLevel <= 3) {
+            return false;
+        }
+
+        if (isGraalEnabled()) {
+            return false;
+        }
+
+        return true;
+    }
+
+    /*
+     * Check if C1 is used as JIT compiler.
+     *
+     * C1 is enabled if following conditions are true:
+     * - we are not in Interpreter mode
+     * - we are not in Server compilation mode
+     * - TieredCompilation is used in Server mode
+     *
+     * @return true if C1 is used as JIT compiler.
+     */
+    public static boolean isC1Enabled() {
+        Boolean useCompiler = WB.getBooleanVMFlag("UseCompiler");
+        if (useCompiler == null || !useCompiler) {
+            return false;
+        }
+        Boolean serverMode = WB.getBooleanVMFlag("ProfileInterpreter");
+        if (serverMode == null || !serverMode) {
+            return true; // Client mode
+        }
+
+        Boolean tieredCompilation = WB.getBooleanVMFlag("TieredCompilation");
+        // C1 is not used in server mode if TieredCompilation is off.
+        if (tieredCompilation != null && !tieredCompilation) {
+            return false;
+        }
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/nashorn/script/basic/JDK-8204288.js	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8204288: Matching the end of a string followed by an empty greedy regex and a word boundary fails
+ *
+ * @test
+ * @run
+ */
+
+
+Assert.assertEquals(new RegExp("c.*\\b").exec("abc")[0], "c");
+Assert.assertEquals(new RegExp("abc.*\\b").exec("abc")[0], "abc");
+Assert.assertEquals(new RegExp("\\b.*abc.*\\b").exec("abc")[0], "abc");
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/nashorn/script/basic/JDK-8204290.js	Mon Jun 11 09:29:44 2018 +0200
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8204290: Add check to limit number of capture groups
+ *
+ * @test
+ * @run
+ */
+
+try {
+    new RegExp("()".repeat(0x8001));
+    fail("Expected exception");
+} catch (e) {
+    Assert.assertTrue(e instanceof SyntaxError);
+    Assert.assertEquals(e.message, "too many capture groups");
+}
+