Merge
authoriveresov
Thu, 25 May 2017 22:33:25 +0000
changeset 46498 13d1ef8398c3
parent 46497 666f3f01515b (current diff)
parent 46496 76ed99d51a67 (diff)
child 46500 182d2a50464a
Merge
hotspot/make/templates/gpl-cp-header
hotspot/make/templates/gpl-header
jdk/src/java.base/share/classes/sun/security/ssl/RecordType.java
jdk/src/java.base/share/specs/serialization/changelog.md
jdk/src/java.base/share/specs/serialization/images/class.gif
jdk/test/java/nio/channels/DatagramChannel/NetworkConfiguration.java
jdk/test/lib/testlibrary/ModuleInfoMaker.java
jdk/test/lib/testlibrary/jdk/testlibrary/FilterClassLoader.java
jdk/test/lib/testlibrary/jdk/testlibrary/IOUtils.java
jdk/test/lib/testlibrary/jdk/testlibrary/LockFreeLogManager.java
jdk/test/lib/testlibrary/jdk/testlibrary/NetworkConfiguration.java
jdk/test/lib/testlibrary/jdk/testlibrary/ParentLastURLClassLoader.java
jdk/test/lib/testlibrary/jdk/testlibrary/SerializationUtils.java
jdk/test/lib/testlibrary/jdk/testlibrary/management/InputArguments.java
jdk/test/lib/testlibrary/jdk/testlibrary/management/ThreadMXBeanTool.java
make/Javadoc.gmk
test/lib/jdk/test/lib/DynamicVMOption.java
test/lib/jdk/test/lib/InMemoryJavaCompiler.java
--- a/.hgtags	Thu May 25 15:27:40 2017 -0700
+++ b/.hgtags	Thu May 25 22:33:25 2017 +0000
@@ -1,3 +1,4 @@
+898cbe31fbdae2d25d141384fac746cc244a730c jdk-9+170
 c7efde2b60fc1ec04630be769d9ad60efb39c39c jdk-9+169
 8fd0a4569191f33c98ee90c2709174a342fefb0d jdk-9+167
 fcabc74bd44e56c7419d111d59b95669ecb33c55 jdk-9+168
@@ -420,3 +421,4 @@
 f113ce12fe24fbd24acf02711372d9f1e1c12426 jdk-10+5
 1407b19a2ddf6baae162f5a1a5b96af473f4d7d1 jdk-10+6
 30e75693ae99fd8e47fd2f5116527aff1b59aff9 jdk-10+7
+c42dc7b58b4d4301ea676a76326fd9bbd403d595 jdk-10+8
--- a/.hgtags-top-repo	Thu May 25 15:27:40 2017 -0700
+++ b/.hgtags-top-repo	Thu May 25 22:33:25 2017 +0000
@@ -419,4 +419,7 @@
 111e2e7d00f45c983cdbc9c59ae40552152fcc23 jdk-10+5
 03fe61bb7670644cf6e46b5cfafb6b27c0e0157e jdk-10+6
 b25838a28195f4b6dab34668411eedd2d366a16c jdk-9+169
+4d163ec59d989a9261ed7f848bc6303f90869af5 jdk-9+170
 
+aa3c97810d7c484c93a2fd75d3c76ff574deb6d8 jdk-10+7
+df33ef1dc163f994177fd97d4d0e73a1e3cb5d85 jdk-10+8
--- a/common/autoconf/generated-configure.sh	Thu May 25 15:27:40 2017 -0700
+++ b/common/autoconf/generated-configure.sh	Thu May 25 22:33:25 2017 +0000
@@ -5186,7 +5186,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1494615666
+DATE_WHEN_GENERATED=1494858828
 
 ###############################################################################
 #
@@ -48811,173 +48811,63 @@
 # Check whether --with-jtreg was given.
 if test "${with_jtreg+set}" = set; then :
   withval=$with_jtreg;
-else
-  with_jtreg=no
 fi
 
 
   if test "x$with_jtreg" = xno; then
     # jtreg disabled
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jtreg" >&5
-$as_echo_n "checking for jtreg... " >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-  else
-    if test "x$with_jtreg" != xyes; then
-      # with path specified.
-      JT_HOME="$with_jtreg"
-    fi
-
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jtreg test harness" >&5
+$as_echo_n "checking for jtreg test harness... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, disabled" >&5
+$as_echo "no, disabled" >&6; }
+  elif test "x$with_jtreg" != xyes && test "x$with_jtreg" != x; then
+    # An explicit path is specified, use it.
+    JT_HOME="$with_jtreg"
+    if test ! -d "$JT_HOME"; then
+      as_fn_error $? "jtreg home directory from --with-jtreg=$with_jtreg does not exist" "$LINENO" 5
+    fi
+
+    if test ! -e "$JT_HOME/lib/jtreg.jar"; then
+      as_fn_error $? "jtreg home directory from --with-jtreg=$with_jtreg is not a valid jtreg home" "$LINENO" 5
+    fi
+
+    JTREGEXE="$JT_HOME/bin/jtreg"
+    if test ! -x "$JTREGEXE"; then
+      as_fn_error $? "jtreg home directory from --with-jtreg=$with_jtreg does not contain valid jtreg executable" "$LINENO" 5
+    fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jtreg test harness" >&5
+$as_echo_n "checking for jtreg test harness... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JT_HOME" >&5
+$as_echo "$JT_HOME" >&6; }
+  else
+    # Try to locate jtreg
     if test "x$JT_HOME" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jtreg" >&5
-$as_echo_n "checking for jtreg... " >&6; }
-
-      # use JT_HOME enviroment var.
-
-  # Only process if variable expands to non-empty
-
-  if test "x$JT_HOME" != x; then
-    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
-
-  # Input might be given as Windows format, start by converting to
-  # unix format.
-  path="$JT_HOME"
-  new_path=`$CYGPATH -u "$path"`
-
-  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
-  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
-  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
-  # "foo.exe" is OK but "foo" is an error.
-  #
-  # This test is therefore slightly more accurate than "test -f" to check for file precense.
-  # It is also a way to make sure we got the proper file name for the real test later on.
-  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
-  if test "x$test_shortpath" = x; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of JT_HOME" "$LINENO" 5
-  fi
-
-  # Call helper function which possibly converts this using DOS-style short mode.
-  # If so, the updated path is stored in $new_path.
-
-  input_path="$new_path"
-  # Check if we need to convert this using DOS-style short mode. If the path
-  # contains just simple characters, use it. Otherwise (spaces, weird characters),
-  # take no chances and rewrite it.
-  # Note: m4 eats our [], so we need to use [ and ] instead.
-  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
-  if test "x$has_forbidden_chars" != x; then
-    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
-    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
-    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
-    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
-      # Going to short mode and back again did indeed matter. Since short mode is
-      # case insensitive, let's make it lowercase to improve readability.
-      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-      # Now convert it back to Unix-style (cygpath)
-      input_path=`$CYGPATH -u "$shortmode_path"`
-      new_path="$input_path"
-    fi
-  fi
-
-  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
-  if test "x$test_cygdrive_prefix" = x; then
-    # As a simple fix, exclude /usr/bin since it's not a real path.
-    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
-      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
-      # a path prefixed by /cygdrive for fixpath to work.
-      new_path="$CYGWIN_ROOT_PATH$input_path"
-    fi
-  fi
-
-
-  if test "x$path" != "x$new_path"; then
-    JT_HOME="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JT_HOME to \"$new_path\"" >&5
-$as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;}
-  fi
-
-    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
-
-  path="$JT_HOME"
-  has_colon=`$ECHO $path | $GREP ^.:`
-  new_path="$path"
-  if test "x$has_colon" = x; then
-    # Not in mixed or Windows style, start by that.
-    new_path=`cmd //c echo $path`
-  fi
-
-
-  input_path="$new_path"
-  # Check if we need to convert this using DOS-style short mode. If the path
-  # contains just simple characters, use it. Otherwise (spaces, weird characters),
-  # take no chances and rewrite it.
-  # Note: m4 eats our [], so we need to use [ and ] instead.
-  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
-  if test "x$has_forbidden_chars" != x; then
-    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
-    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-  fi
-
-
-  windows_path="$new_path"
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
-    unix_path=`$CYGPATH -u "$windows_path"`
-    new_path="$unix_path"
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
-    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
-    new_path="$unix_path"
-  fi
-
-  if test "x$path" != "x$new_path"; then
-    JT_HOME="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JT_HOME to \"$new_path\"" >&5
-$as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;}
-  fi
-
-  # Save the first 10 bytes of this path to the storage, so fixpath can work.
-  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
-
-    else
-      # We're on a unix platform. Hooray! :)
-      path="$JT_HOME"
-      has_space=`$ECHO "$path" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." >&6;}
-        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-      fi
-
-      # Use eval to expand a potential ~
-      eval path="$path"
-      if test ! -f "$path" && test ! -d "$path"; then
-        as_fn_error $? "The path of JT_HOME, which resolves as \"$path\", is not found." "$LINENO" 5
-      fi
-
-      if test -d "$path"; then
-        JT_HOME="`cd "$path"; $THEPWDCMD -L`"
-      else
-        dir="`$DIRNAME "$path"`"
-        base="`$BASENAME "$path"`"
-        JT_HOME="`cd "$dir"; $THEPWDCMD -L`/$base"
-      fi
-    fi
-  fi
-
-
-      # jtreg win32 script works for everybody
-      JTREGEXE="$JT_HOME/bin/jtreg"
-
-      if test ! -f "$JTREGEXE"; then
-        as_fn_error $? "JTReg executable does not exist: $JTREGEXE" "$LINENO" 5
-      fi
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JTREGEXE" >&5
-$as_echo "$JTREGEXE" >&6; }
-    else
-      # try to find jtreg on path
-
+      # JT_HOME set in environment, use it
+      if test ! -d "$JT_HOME"; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring JT_HOME pointing to invalid directory: $JT_HOME" >&5
+$as_echo "$as_me: WARNING: Ignoring JT_HOME pointing to invalid directory: $JT_HOME" >&2;}
+        JT_HOME=
+      else
+        if test ! -e "$JT_HOME/lib/jtreg.jar"; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring JT_HOME which is not a valid jtreg home: $JT_HOME" >&5
+$as_echo "$as_me: WARNING: Ignoring JT_HOME which is not a valid jtreg home: $JT_HOME" >&2;}
+          JT_HOME=
+        elif test ! -x "$JT_HOME/bin/jtreg"; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring JT_HOME which does not contain valid jtreg executable: $JT_HOME" >&5
+$as_echo "$as_me: WARNING: Ignoring JT_HOME which does not contain valid jtreg executable: $JT_HOME" >&2;}
+          JT_HOME=
+        else
+          JTREGEXE="$JT_HOME/bin/jtreg"
+          { $as_echo "$as_me:${as_lineno-$LINENO}: Located jtreg using JT_HOME from environment" >&5
+$as_echo "$as_me: Located jtreg using JT_HOME from environment" >&6;}
+        fi
+      fi
+    fi
+
+    if test "x$JT_HOME" = x; then
+      # JT_HOME is not set in environment, or was deemed invalid.
+      # Try to find jtreg on path
 
 
   # Publish this variable in the help.
@@ -49175,13 +49065,451 @@
   fi
 
 
-
-  if test "x$JTREGEXE" = x; then
-    as_fn_error $? "Could not find required tool for JTREGEXE" "$LINENO" 5
-  fi
-
-
-      JT_HOME="`$DIRNAME $JTREGEXE`"
+      if test "x$JTREGEXE" != x; then
+        # That's good, now try to derive JT_HOME
+        JT_HOME=`(cd $($DIRNAME $JTREGEXE)/.. && pwd)`
+        if test ! -e "$JT_HOME/lib/jtreg.jar"; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring jtreg from path since a valid jtreg home cannot be found" >&5
+$as_echo "$as_me: WARNING: Ignoring jtreg from path since a valid jtreg home cannot be found" >&2;}
+          JT_HOME=
+          JTREGEXE=
+        else
+          { $as_echo "$as_me:${as_lineno-$LINENO}: Located jtreg using jtreg executable in path" >&5
+$as_echo "$as_me: Located jtreg using jtreg executable in path" >&6;}
+        fi
+      fi
+    fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jtreg test harness" >&5
+$as_echo_n "checking for jtreg test harness... " >&6; }
+    if test "x$JT_HOME" != x; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JT_HOME" >&5
+$as_echo "$JT_HOME" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, not found" >&5
+$as_echo "no, not found" >&6; }
+
+      if test "x$with_jtreg" = xyes; then
+        as_fn_error $? "--with-jtreg was specified, but no jtreg found." "$LINENO" 5
+      fi
+    fi
+  fi
+
+
+  # Only process if variable expands to non-empty
+
+  if test "x$JTREGEXE" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+
+  # First separate the path from the arguments. This will split at the first
+  # space.
+  complete="$JTREGEXE"
+  path="${complete%% *}"
+  tmp="$complete EOL"
+  arguments="${tmp#* }"
+
+  # Input might be given as Windows format, start by converting to
+  # unix format.
+  new_path=`$CYGPATH -u "$path"`
+
+  # Now try to locate executable using which
+  new_path=`$WHICH "$new_path" 2> /dev/null`
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+      && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+      && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+        && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+        && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JTREGEXE, which resolves as \"$complete\", is not found." >&5
+$as_echo "$as_me: The path of JTREGEXE, which resolves as \"$complete\", is not found." >&6;}
+      has_space=`$ECHO "$complete" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      as_fn_error $? "Cannot locate the the path of JTREGEXE" "$LINENO" 5
+    fi
+  fi
+
+  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
+  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
+  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
+  # "foo.exe" is OK but "foo" is an error.
+  #
+  # This test is therefore slightly more accurate than "test -f" to check for file presence.
+  # It is also a way to make sure we got the proper file name for the real test later on.
+  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
+  if test "x$test_shortpath" = x; then
+    # Short path failed, file does not exist as specified.
+    # Try adding .exe or .cmd
+    if test -f "${new_path}.exe"; then
+      input_to_shortpath="${new_path}.exe"
+    elif test -f "${new_path}.cmd"; then
+      input_to_shortpath="${new_path}.cmd"
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JTREGEXE, which resolves as \"$new_path\", is invalid." >&5
+$as_echo "$as_me: The path of JTREGEXE, which resolves as \"$new_path\", is invalid." >&6;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
+      as_fn_error $? "Cannot locate the the path of JTREGEXE" "$LINENO" 5
+    fi
+  else
+    input_to_shortpath="$new_path"
+  fi
+
+  # Call helper function which possibly converts this using DOS-style short mode.
+  # If so, the updated path is stored in $new_path.
+  new_path="$input_to_shortpath"
+
+  input_path="$input_to_shortpath"
+  # Check if we need to convert this using DOS-style short mode. If the path
+  # contains just simple characters, use it. Otherwise (spaces, weird characters),
+  # take no chances and rewrite it.
+  # Note: m4 eats our [], so we need to use [ and ] instead.
+  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
+  if test "x$has_forbidden_chars" != x; then
+    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
+    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
+    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
+      # Going to short mode and back again did indeed matter. Since short mode is
+      # case insensitive, let's make it lowercase to improve readability.
+      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+      # Now convert it back to Unix-style (cygpath)
+      input_path=`$CYGPATH -u "$shortmode_path"`
+      new_path="$input_path"
+    fi
+  fi
+
+  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
+  if test "x$test_cygdrive_prefix" = x; then
+    # As a simple fix, exclude /usr/bin since it's not a real path.
+    if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then
+      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
+      # a path prefixed by /cygdrive for fixpath to work.
+      new_path="$CYGWIN_ROOT_PATH$input_path"
+    fi
+  fi
+
+  # remove trailing .exe if any
+  new_path="${new_path/%.exe/}"
+
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+
+  # First separate the path from the arguments. This will split at the first
+  # space.
+  complete="$JTREGEXE"
+  path="${complete%% *}"
+  tmp="$complete EOL"
+  arguments="${tmp#* }"
+
+  # Input might be given as Windows format, start by converting to
+  # unix format.
+  new_path="$path"
+
+  windows_path="$new_path"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    new_path="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    new_path="$unix_path"
+  fi
+
+
+  # Now try to locate executable using which
+  new_path=`$WHICH "$new_path" 2> /dev/null`
+
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path="$path"
+
+  windows_path="$new_path"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    new_path="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    new_path="$unix_path"
+  fi
+
+
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in MSYS causing which
+    # to not find them
+    if test "x$new_path" = x \
+        && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+        && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path="$path"
+
+  windows_path="$new_path"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    new_path="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    new_path="$unix_path"
+  fi
+
+    fi
+
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JTREGEXE, which resolves as \"$complete\", is not found." >&5
+$as_echo "$as_me: The path of JTREGEXE, which resolves as \"$complete\", is not found." >&6;}
+      has_space=`$ECHO "$complete" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      as_fn_error $? "Cannot locate the the path of JTREGEXE" "$LINENO" 5
+    fi
+  fi
+
+  # Now new_path has a complete unix path to the binary
+  if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then
+    # Keep paths in /bin as-is, but remove trailing .exe if any
+    new_path="${new_path/%.exe/}"
+    # Do not save /bin paths to all_fixpath_prefixes!
+  else
+    # Not in mixed or Windows style, start by that.
+    new_path=`cmd //c echo $new_path`
+
+  input_path="$new_path"
+  # Check if we need to convert this using DOS-style short mode. If the path
+  # contains just simple characters, use it. Otherwise (spaces, weird characters),
+  # take no chances and rewrite it.
+  # Note: m4 eats our [], so we need to use [ and ] instead.
+  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
+  if test "x$has_forbidden_chars" != x; then
+    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+  fi
+
+    # Output is in $new_path
+
+  windows_path="$new_path"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    new_path="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    new_path="$unix_path"
+  fi
+
+    # remove trailing .exe if any
+    new_path="${new_path/%.exe/}"
+
+    # Save the first 10 bytes of this path to the storage, so fixpath can work.
+    all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
+  fi
+
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$JTREGEXE"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JTREGEXE, which resolves as \"$complete\", is not found." >&5
+$as_echo "$as_me: The path of JTREGEXE, which resolves as \"$complete\", is not found." >&6;}
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
+        fi
+        as_fn_error $? "Cannot locate the the path of JTREGEXE" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      JTREGEXE="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JTREGEXE to \"$new_complete\"" >&5
+$as_echo "$as_me: Rewriting JTREGEXE to \"$new_complete\"" >&6;}
+    fi
+  fi
+
+
+  # Only process if variable expands to non-empty
+
+  if test "x$JT_HOME" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+
+  # Input might be given as Windows format, start by converting to
+  # unix format.
+  path="$JT_HOME"
+  new_path=`$CYGPATH -u "$path"`
+
+  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
+  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
+  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
+  # "foo.exe" is OK but "foo" is an error.
+  #
+  # This test is therefore slightly more accurate than "test -f" to check for file precense.
+  # It is also a way to make sure we got the proper file name for the real test later on.
+  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
+  if test "x$test_shortpath" = x; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." >&6;}
+    as_fn_error $? "Cannot locate the the path of JT_HOME" "$LINENO" 5
+  fi
+
+  # Call helper function which possibly converts this using DOS-style short mode.
+  # If so, the updated path is stored in $new_path.
+
+  input_path="$new_path"
+  # Check if we need to convert this using DOS-style short mode. If the path
+  # contains just simple characters, use it. Otherwise (spaces, weird characters),
+  # take no chances and rewrite it.
+  # Note: m4 eats our [], so we need to use [ and ] instead.
+  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
+  if test "x$has_forbidden_chars" != x; then
+    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
+    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
+    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
+      # Going to short mode and back again did indeed matter. Since short mode is
+      # case insensitive, let's make it lowercase to improve readability.
+      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+      # Now convert it back to Unix-style (cygpath)
+      input_path=`$CYGPATH -u "$shortmode_path"`
+      new_path="$input_path"
+    fi
+  fi
+
+  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
+  if test "x$test_cygdrive_prefix" = x; then
+    # As a simple fix, exclude /usr/bin since it's not a real path.
+    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
+      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
+      # a path prefixed by /cygdrive for fixpath to work.
+      new_path="$CYGWIN_ROOT_PATH$input_path"
+    fi
+  fi
+
+
+  if test "x$path" != "x$new_path"; then
+    JT_HOME="$new_path"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JT_HOME to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;}
+  fi
+
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+
+  path="$JT_HOME"
+  has_colon=`$ECHO $path | $GREP ^.:`
+  new_path="$path"
+  if test "x$has_colon" = x; then
+    # Not in mixed or Windows style, start by that.
+    new_path=`cmd //c echo $path`
+  fi
+
+
+  input_path="$new_path"
+  # Check if we need to convert this using DOS-style short mode. If the path
+  # contains just simple characters, use it. Otherwise (spaces, weird characters),
+  # take no chances and rewrite it.
+  # Note: m4 eats our [], so we need to use [ and ] instead.
+  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
+  if test "x$has_forbidden_chars" != x; then
+    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+  fi
+
+
+  windows_path="$new_path"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    new_path="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    new_path="$unix_path"
+  fi
+
+  if test "x$path" != "x$new_path"; then
+    JT_HOME="$new_path"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JT_HOME to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;}
+  fi
+
+  # Save the first 10 bytes of this path to the storage, so fixpath can work.
+  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
+
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$JT_HOME"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." >&6;}
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of JT_HOME, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      if test -d "$path"; then
+        JT_HOME="`cd "$path"; $THEPWDCMD -L`"
+      else
+        dir="`$DIRNAME "$path"`"
+        base="`$BASENAME "$path"`"
+        JT_HOME="`cd "$dir"; $THEPWDCMD -L`/$base"
+      fi
     fi
   fi
 
--- a/common/autoconf/spec.gmk.in	Thu May 25 15:27:40 2017 -0700
+++ b/common/autoconf/spec.gmk.in	Thu May 25 22:33:25 2017 +0000
@@ -271,9 +271,6 @@
 TESTMAKE_OUTPUTDIR=$(BUILD_OUTPUT)/test-make
 MAKESUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/make-support
 
-# By default, output javadoc directly into image
-JAVADOC_OUTPUTDIR = $(DOCS_IMAGE_DIR)
-
 # This does not get overridden in a bootcycle build
 CONFIGURESUPPORT_OUTPUTDIR:=@CONFIGURESUPPORT_OUTPUTDIR@
 BUILDJDK_OUTPUTDIR=$(BUILD_OUTPUT)/buildjdk
@@ -819,6 +816,8 @@
 # Docs image
 DOCS_IMAGE_SUBDIR := docs
 DOCS_IMAGE_DIR = $(IMAGES_OUTPUTDIR)/$(DOCS_IMAGE_SUBDIR)
+# Output docs directly into image
+DOCS_OUTPUTDIR := $(DOCS_IMAGE_DIR)
 
 # Macosx bundles directory definitions
 JDK_MACOSX_BUNDLE_SUBDIR=jdk-bundle
--- a/common/autoconf/toolchain.m4	Thu May 25 15:27:40 2017 -0700
+++ b/common/autoconf/toolchain.m4	Thu May 25 22:33:25 2017 +0000
@@ -926,41 +926,82 @@
 AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
 [
   AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg],
-      [Regression Test Harness @<:@probed@:>@])],
-      [],
-      [with_jtreg=no])
+      [Regression Test Harness @<:@probed@:>@])])
 
   if test "x$with_jtreg" = xno; then
     # jtreg disabled
-    AC_MSG_CHECKING([for jtreg])
-    AC_MSG_RESULT(no)
-  else
-    if test "x$with_jtreg" != xyes; then
-      # with path specified.
-      JT_HOME="$with_jtreg"
+    AC_MSG_CHECKING([for jtreg test harness])
+    AC_MSG_RESULT([no, disabled])
+  elif test "x$with_jtreg" != xyes && test "x$with_jtreg" != x; then
+    # An explicit path is specified, use it.
+    JT_HOME="$with_jtreg"
+    if test ! -d "$JT_HOME"; then
+      AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg does not exist])
+    fi
+
+    if test ! -e "$JT_HOME/lib/jtreg.jar"; then
+      AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg is not a valid jtreg home])
+    fi
+
+    JTREGEXE="$JT_HOME/bin/jtreg"
+    if test ! -x "$JTREGEXE"; then
+      AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg does not contain valid jtreg executable])
     fi
 
+    AC_MSG_CHECKING([for jtreg test harness])
+    AC_MSG_RESULT([$JT_HOME])
+  else
+    # Try to locate jtreg
     if test "x$JT_HOME" != x; then
-      AC_MSG_CHECKING([for jtreg])
-
-      # use JT_HOME enviroment var.
-      BASIC_FIXUP_PATH([JT_HOME])
-
-      # jtreg win32 script works for everybody
-      JTREGEXE="$JT_HOME/bin/jtreg"
+      # JT_HOME set in environment, use it
+      if test ! -d "$JT_HOME"; then
+        AC_MSG_WARN([Ignoring JT_HOME pointing to invalid directory: $JT_HOME])
+        JT_HOME=
+      else
+        if test ! -e "$JT_HOME/lib/jtreg.jar"; then
+          AC_MSG_WARN([Ignoring JT_HOME which is not a valid jtreg home: $JT_HOME])
+          JT_HOME=
+        elif test ! -x "$JT_HOME/bin/jtreg"; then
+          AC_MSG_WARN([Ignoring JT_HOME which does not contain valid jtreg executable: $JT_HOME])
+          JT_HOME=
+        else
+          JTREGEXE="$JT_HOME/bin/jtreg"
+          AC_MSG_NOTICE([Located jtreg using JT_HOME from environment])
+        fi
+      fi
+    fi
 
-      if test ! -f "$JTREGEXE"; then
-        AC_MSG_ERROR([JTReg executable does not exist: $JTREGEXE])
+    if test "x$JT_HOME" = x; then
+      # JT_HOME is not set in environment, or was deemed invalid.
+      # Try to find jtreg on path
+      BASIC_PATH_PROGS(JTREGEXE, jtreg)
+      if test "x$JTREGEXE" != x; then
+        # That's good, now try to derive JT_HOME
+        JT_HOME=`(cd $($DIRNAME $JTREGEXE)/.. && pwd)`
+        if test ! -e "$JT_HOME/lib/jtreg.jar"; then
+          AC_MSG_WARN([Ignoring jtreg from path since a valid jtreg home cannot be found])
+          JT_HOME=
+          JTREGEXE=
+        else
+          AC_MSG_NOTICE([Located jtreg using jtreg executable in path])
+        fi
       fi
+    fi
 
-      AC_MSG_RESULT($JTREGEXE)
+    AC_MSG_CHECKING([for jtreg test harness])
+    if test "x$JT_HOME" != x; then
+      AC_MSG_RESULT([$JT_HOME])
     else
-      # try to find jtreg on path
-      BASIC_REQUIRE_PROGS(JTREGEXE, jtreg)
-      JT_HOME="`$DIRNAME $JTREGEXE`"
+      AC_MSG_RESULT([no, not found])
+
+      if test "x$with_jtreg" = xyes; then
+        AC_MSG_ERROR([--with-jtreg was specified, but no jtreg found.])
+      fi
     fi
   fi
 
+  BASIC_FIXUP_EXECUTABLE(JTREGEXE)
+  BASIC_FIXUP_PATH(JT_HOME)
   AC_SUBST(JT_HOME)
   AC_SUBST(JTREGEXE)
 ])
--- a/common/bin/hgforest.sh	Thu May 25 15:27:40 2017 -0700
+++ b/common/bin/hgforest.sh	Thu May 25 22:33:25 2017 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 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
@@ -183,7 +183,7 @@
 
 subrepos="corba jaxp jaxws langtools jdk hotspot nashorn"
 jdk_subrepos_extra="closed jdk/src/closed jdk/make/closed jdk/test/closed hotspot/make/closed hotspot/src/closed hotspot/test/closed"
-subrepos_extra="$jdk_subrepos_extra deploy install sponsors pubs"
+subrepos_extra="$jdk_subrepos_extra deploy install sponsors"
 
 # Only look in specific locations for possible forests (avoids long searches)
 pull_default=""
--- a/common/conf/jib-profiles.js	Thu May 25 15:27:40 2017 -0700
+++ b/common/conf/jib-profiles.js	Thu May 25 22:33:25 2017 +0000
@@ -997,7 +997,8 @@
             ext: "tar.gz",
             revision: "2.38.0-1+1.1",
             module: "graphviz-" + input.target_platform,
-            configure_args: "DOT=" + input.get("graphviz", "install_path") + "/dot"
+            configure_args: "DOT=" + input.get("graphviz", "install_path") + "/dot",
+            environment_path: input.get("graphviz", "install_path")
         },
 
         pandoc: {
@@ -1005,7 +1006,8 @@
             ext: "tar.gz",
             revision: "1.17.2+1.0",
             module: "pandoc-" + input.target_platform,
-            configure_args: "PANDOC=" + input.get("pandoc", "install_path") + "/pandoc/pandoc"
+            configure_args: "PANDOC=" + input.get("pandoc", "install_path") + "/pandoc/pandoc",
+            environment_path: input.get("pandoc", "install_path") + "/pandoc"
         },
     };
 
--- a/common/doc/building.html	Thu May 25 15:27:40 2017 -0700
+++ b/common/doc/building.html	Thu May 25 22:33:25 2017 +0000
@@ -6,6 +6,7 @@
   <meta name="generator" content="pandoc" />
   <title>OpenJDK Build README</title>
   <style type="text/css">code{white-space: pre;}</style>
+  <link rel="stylesheet" href=" ../../jdk/make/data/docs-resources/specs/resources/jdk-default.css" type="text/css" />
 </head>
 <body>
 <div id="header">
--- a/common/doc/testing.html	Thu May 25 15:27:40 2017 -0700
+++ b/common/doc/testing.html	Thu May 25 22:33:25 2017 +0000
@@ -6,9 +6,8 @@
   <meta name="generator" content="pandoc" />
   <title>Testing OpenJDK</title>
   <style type="text/css">code{white-space: pre;}</style>
-  <link rel="stylesheet" href="http://openjdk.java.net/page.css" type="text/css" />
+  <link rel="stylesheet" href=" ../../jdk/make/data/docs-resources/specs/resources/jdk-default.css" type="text/css" />
   <style type="text/css">pre, code, tt { color: #1d6ae5; }</style>
-  <style type="text/css">pre { font-size: 10pt; }</style>
 </head>
 <body>
 <div id="header">
--- a/corba/.hgtags	Thu May 25 15:27:40 2017 -0700
+++ b/corba/.hgtags	Thu May 25 22:33:25 2017 +0000
@@ -419,3 +419,6 @@
 43de67f51801b9e16507865fcb7e8344f4ca4aa9 jdk-9+167
 03a2cc9c8a1e8f87924c9863e917bc8b91770d5f jdk-9+168
 b2218d41edef02ee8f94bb438f885b2ba79bfa08 jdk-9+169
+8a4ab3b0ab9a86df73d9a1e337134f2dbe006725 jdk-9+170
+aed5a4edc8275c1c50195503756ff92bfe0197f5 jdk-10+7
+648b0a00824eb29e71936bc3258d309a25e3b8c0 jdk-10+8
--- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/package.html	Thu May 25 15:27:40 2017 -0700
+++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/package.html	Thu May 25 22:33:25 2017 +0000
@@ -1,4 +1,4 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<!doctype html>
 <html>
 <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
@@ -6,7 +6,7 @@
    <title>package</title>
 <!--
  
-Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+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
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/Any.java	Thu May 25 15:27:40 2017 -0700
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/Any.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -52,7 +52,7 @@
  * </OL>
  *
  * <P>
- * <a name="anyOps"></a>
+ * <a id="anyOps"></a>
  * A large part of the <code>Any</code> class consists of pairs of methods
  * for inserting values into and extracting values from an
  * <code>Any</code> object.
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java	Thu May 25 15:27:40 2017 -0700
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -85,13 +85,17 @@
  * three {@code init} methods.  Two of the three methods use the properties
  * (associations of a name with a value) shown in the
  * table below.<BR>
- * <TABLE BORDER=1 SUMMARY="Standard Java CORBA Properties">
+ * <TABLE class="plain">
+ * <CAPTION>Standard Java CORBA Properties:</CAPTION>
+ * <thead>
  * <TR><TH>Property Name</TH>   <TH>Property Value</TH></TR>
- * <CAPTION>Standard Java CORBA Properties:</CAPTION>
+ * </thead>
+ * <tbody>
  *     <TR><TD>org.omg.CORBA.ORBClass</TD>
  *     <TD>class name of an ORB implementation</TD></TR>
  *     <TR><TD>org.omg.CORBA.ORBSingletonClass</TD>
  *     <TD>class name of the ORB returned by {@code init()}</TD></TR>
+ * </tbody>
  * </TABLE>
  * <P>
  * These properties allow a different vendor's {@code ORB}
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/doc-files/compliance.html	Thu May 25 15:27:40 2017 -0700
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/doc-files/compliance.html	Thu May 25 22:33:25 2017 +0000
@@ -1,4 +1,4 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<!doctype html>
 <html>
 <head>
    <meta http-equiv="Content-Type" content="text/html">
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/doc-files/generatedfiles.html	Thu May 25 15:27:40 2017 -0700
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/doc-files/generatedfiles.html	Thu May 25 22:33:25 2017 +0000
@@ -1,4 +1,4 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<!doctype html>
 <html>
 <head>
    <meta http-equiv="Content-Type" content="text/html">
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/package.html	Thu May 25 15:27:40 2017 -0700
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/package.html	Thu May 25 22:33:25 2017 +0000
@@ -1,3 +1,4 @@
+<!doctype html>
 <HTML>
 <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
@@ -6,7 +7,7 @@
    <TITLE>package</TITLE>
 <!--
 /*
-* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 1998, 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
@@ -31,9 +32,8 @@
 */  
 -->
 </HEAD>
-<BODY BGCOLOR="#FFFFFF">
-Provides the mapping of the OMG CORBA APIs to the Java<SUP><FONT 
-SIZE=-2>TM</FONT></SUP>
+<BODY>
+Provides the mapping of the OMG CORBA APIs to the Java&trade;
 programming language, including the class <code>ORB</code>, which is implemented
 so that a programmer can use it as a fully-functional Object Request Broker
 (ORB).
@@ -427,7 +427,7 @@
 in this case, <code>Account</code> objects.
 
 
-<a name="narrow"></a>
+<a id="narrow"></a>
 <h3>The <code>narrow</code> Method</h3>
 When an object is the return value for a method, it is returned in the
 form of a generic object, either an <code>org.omg.CORBA.Object</code> object
@@ -465,7 +465,7 @@
         helloImpl = HelloHelper.narrow(ncRef.resolve_str(name));
 </PRE>
 
-<a name="basic"></a>
+<a id="basic"></a>
 <h3>Example of a Basic Helper Class</h3>
 A basic helper class, for purposes of this explanation, is one with
 the methods that are provided by every helper class, plus a <code>narrow</code>
@@ -671,7 +671,7 @@
 &nbsp;&nbsp;&nbsp;&nbsp; WStringSeqHelper
 &nbsp;&nbsp;&nbsp;&nbsp; WStringValueHelper
 </code></PRE>
-<a name="adv"></a>
+<a id="adv"></a>
 <H1>
 Other Classes</H1>
 The other classes and interfaces in the <code>CORBA</code> package, which are
@@ -868,17 +868,17 @@
 
 
 
-<P><A NAME="unimpl"></A>
+<P><A id="unimpl"></A>
 <H1>
 CORBA Features Not Implemented in Java IDL</H1>
 
 <P>Some of the API included in <code>org.omg</code> subpackages is provided for
 conformance with the current OMG CORBA specification but is not implemented
-in Sun's release of the JDK<SUP><FONT SIZE=-2>TM</FONT></SUP>. This enables
+in Sun's release of the JDK&trade;. This enables
 other JDK licensees to provide implementations of this API in standard
 extensions and products.
 
-<P><A NAME="NO_IMPLEMENT"></A>
+<P><A id="NO_IMPLEMENT"></A>
 <h2>Features That Throw NO_IMPLEMENT</h2>
 
 <P>Some of the API included in <code>org.omg</code> subpackages throw
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/portable/package.html	Thu May 25 15:27:40 2017 -0700
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/portable/package.html	Thu May 25 22:33:25 2017 +0000
@@ -1,8 +1,8 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!doctype html>
 <html>
 <head>
 <!--
-Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 1998, 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
@@ -26,7 +26,7 @@
 questions.
 -->
 </head>
-<body bgcolor="white">
+<body>
 
 Provides a portability layer, that is, a set of ORB APIs
 that makes it possible for code generated
@@ -38,7 +38,7 @@
 
 
 <p>
-<a name="unimpl"></a>
+<a id="unimpl"></a>
 <hr>
 <h1>CORBA Features Throwing NO_IMPLEMENT() Exceptions</h1>
 <hr>
--- a/corba/src/java.corba/share/classes/org/omg/CORBA_2_3/package.html	Thu May 25 15:27:40 2017 -0700
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA_2_3/package.html	Thu May 25 22:33:25 2017 +0000
@@ -1,4 +1,4 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<!doctype html>
 <html>
 <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
@@ -6,7 +6,7 @@
    <title>package</title>
 <!--
 /*
-* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 1999, 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
@@ -31,7 +31,7 @@
 */ 
 -->
 </head>
-<body bgcolor="#FFFFFF">
+<body>
 The CORBA_2_3 package defines additions to existing CORBA interfaces
 in the Java[tm] Standard Edition 6.&nbsp;&nbsp; These changes occurred in recent
 revisions to the CORBA API defined by the OMG.&nbsp; The new methods were
@@ -46,7 +46,7 @@
 HREF="../CORBA/doc-files/compliance.html">Official Specifications for CORBA
 support in Java[tm] SE 6</A>.
 <P>
-<a name="unimpl"></a>
+<a id="unimpl"></a>
 The following methods in the abstract class 
 <code>org.omg.CORBA_2_3.ORB</code> are unimplemented:
 <UL>
--- a/corba/src/java.corba/share/classes/org/omg/PortableInterceptor/IOP.idl	Thu May 25 15:27:40 2017 -0700
+++ b/corba/src/java.corba/share/classes/org/omg/PortableInterceptor/IOP.idl	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -425,7 +425,7 @@
      * encoded using GIOP 1.2 with a TCS-W of UTF-16.  This service context
      * may be sent on Reply messages with a reply_status of SYSTEM_EXCEPTION
      * or USER_EXCEPTION. The usage of this service context is defined
-     * by language mappings. <br/> <br/>
+     * by language mappings. <br> <br>
      *
      * IDL/Java: ptc/02-01-22: 1.15.2: 
      * When a System Exception is marshaled, its GIOP Reply message shall
--- a/corba/src/java.corba/share/classes/org/omg/PortableInterceptor/Interceptors.idl	Thu May 25 15:27:40 2017 -0700
+++ b/corba/src/java.corba/share/classes/org/omg/PortableInterceptor/Interceptors.idl	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -580,7 +580,8 @@
    * to access it will result in a <code>BAD_INV_ORDER</code> being thrown
    * with a standard minor code of 14.
    *
-   * <table border=1 summary="Shows the validity of each attribute or operation">
+   * <table class="plain">
+   * <caption style="display:none">Shows the validity of each attribute or operation</caption>
    *  <thead>
    *    <tr>
    *      <th>&nbsp;</th>
@@ -597,42 +598,42 @@
    *     <td id="ri" colspan=6><i>Inherited from RequestInfo:</i></td>
    *  </tr>
    * 
-   *  <tr><th id="req_id"><p align="left">request_id</p></th>
+   *  <tr><th id="req_id"><p style="text-align:left">request_id</p></th>
    *  <td headers="ri req_id send_req">yes</td> 
    *  <td headers="ri req_id send_poll">yes</td> 
    *  <td headers="ri req_id rec_reply">yes</td> 
    *  <td headers="ri req_id rec_ex">yes</td> 
    *  <td headers="ri req_id rec_oth">yes</td></tr>
    * 
-   *  <tr><th id="op"><p align="left">operation</p></th>
+   *  <tr><th id="op"><p style="text-align:left">operation</p></th>
    *  <td headers="ri op send_req">yes</td> 
    *  <td headers="ri op send_poll">yes</td> 
    *  <td headers="ri op rec_reply">yes</td> 
    *  <td headers="ri op rec_ex">yes</td> 
    *  <td headers="ri op rec_oth">yes</td></tr>
    *
-   *  <tr><th id="arg"><p align="left">arguments</p></th>
+   *  <tr><th id="arg"><p style="text-align:left">arguments</p></th>
    *  <td headers="ri arg send_req">yes<sub>1</sub></td>
    *  <td headers="ri arg send_poll">no </td> 
    *  <td headers="ri arg rec_reply">yes</td> 
    *  <td headers="ri arg rec_ex">no </td> 
    *  <td headers="ri arg rec_oth">no </td></tr>
    *
-   *  <tr><th id="exc"><p align="left">exceptions</p></th>
+   *  <tr><th id="exc"><p style="text-align:left">exceptions</p></th>
    *  <td headers="ri exc send_req">yes</td> 
    *  <td headers="ri exc send_poll">no </td> 
    *  <td headers="ri exc rec_reply">yes</td> 
    *  <td headers="ri exc rec_ex">yes</td> 
    *  <td headers="ri exc rec_oth">yes</td></tr>
    *
-   *  <tr><th id="con"><p align="left">contexts</p></th>
+   *  <tr><th id="con"><p style="text-align:left">contexts</p></th>
    *  <td headers="ri con send_req">yes</td> 
    *  <td headers="ri con send_poll">no </td> 
    *  <td headers="ri con rec_reply">yes</td> 
    *  <td headers="ri con rec_ex">yes</td> 
    *  <td headers="ri con rec_oth">yes</td></tr>
    *
-   *  <tr><th id="op_con"><p align="left">operation_context</p></th>
+   *  <tr><th id="op_con"><p style="text-align:left">operation_context</p></th>
    *  <td headers="ri op_con send_req">yes</td> 
    *  <td headers="ri op_con send_poll">no </td> 
    *  <td headers="ri op_con rec_reply">yes</td> 
@@ -640,7 +641,7 @@
    *  <td headers="ri op_con rec_oth">yes</td>
    *  </tr>
    *
-   *  <tr><th id="result"><p align="left">result</p></th>
+   *  <tr><th id="result"><p style="text-align:left">result</p></th>
    *  <td headers="ri result send_req">no </td> 
    *  <td headers="ri result send_poll">no </td> 
    *  <td headers="ri result rec_reply">yes</td> 
@@ -648,14 +649,14 @@
    *  <td headers="ri result rec_oth">no </td>
    *  </tr>
    *
-   *  <tr><th id="res_exp"><p align="left">response_expected</p></th>
+   *  <tr><th id="res_exp"><p style="text-align:left">response_expected</p></th>
    *  <td headers="ri res_exp send_req">yes</td> 
    *  <td headers="ri res_exp send_poll">yes</td> 
    *  <td headers="ri res_exp rec_reply">yes</td> 
    *  <td headers="ri res_exp rec_ex">yes</td> 
    *  <td headers="ri res_exp rec_oth">yes</td></tr>
    *
-   *  <tr><th id="sync_sco"><p align="left">sync_scope</p></th>
+   *  <tr><th id="sync_sco"><p style="text-align:left">sync_scope</p></th>
    *  <td headers="ri sync_sco send_req">yes</td> 
    *  <td headers="ri sync_sco send_poll">no </td> 
    *  <td headers="ri sync_sco rec_reply">yes</td> 
@@ -663,14 +664,14 @@
    *  <td headers="ri sync_sco rec_oth">yes</td>
    *  </tr>
    *
-   *  <tr><th id="rep_stat"><p align="left">reply_status</p></th>
+   *  <tr><th id="rep_stat"><p style="text-align:left">reply_status</p></th>
    *  <td headers="ri rep_stat send_req">no </td> 
    *  <td headers="ri rep_stat send_poll">no </td> 
    *  <td headers="ri rep_stat rec_reply">yes</td> 
    *  <td headers="ri rep_stat rec_ex">yes</td> 
    *  <td headers="ri rep_stat rec_oth">yes</td></tr>
    *
-   *  <tr><th id="for_ref"><p align="left">forward_reference</p></th>
+   *  <tr><th id="for_ref"><p style="text-align:left">forward_reference</p></th>
    *  <td headers="ri for_ref send_req">no </td>
    *  <td headers="ri for_ref send_poll">no </td> 
    *  <td headers="ri for_ref rec_reply">no </td> 
@@ -678,21 +679,21 @@
    *  <td headers="ri for_ref rec_oth">yes<sub>2</sub>
    *  </td></tr>
    *
-   *  <tr><th id="get_slot"><p align="left">get_slot</p></th>
+   *  <tr><th id="get_slot"><p style="text-align:left">get_slot</p></th>
    *  <td headers="ri get_slot send_req">yes</td> 
    *  <td headers="ri get_slot send_poll">yes</td> 
    *  <td headers="ri get_slot rec_reply">yes</td> 
    *  <td headers="ri get_slot rec_ex">yes</td> 
    *  <td headers="ri get_slot rec_oth">yes</td></tr>
    *
-   *  <tr><th id="grsc"><p align="left">get_request_service_context</p></th>
+   *  <tr><th id="grsc"><p style="text-align:left">get_request_service_context</p></th>
    *  <td headers="ri grsc send_req">yes</td> 
    *  <td headers="ri grsc send_poll">no </td> 
    *  <td headers="ri grsc rec_reply">yes</td> 
    *  <td headers="ri grsc rec_ex">yes</td> 
    *  <td headers="ri grsc rec_oth">yes</td></tr>
    *
-   *  <tr><th id="gpsc"><p align="left">get_reply_service_context</p></th>
+   *  <tr><th id="gpsc"><p style="text-align:left">get_reply_service_context</p></th>
    *  <td headers="ri gpsc send_req">no </td> 
    *  <td headers="ri gpsc send_poll">no </td> 
    *  <td headers="ri gpsc rec_reply">yes</td> 
@@ -704,14 +705,14 @@
    *    <td id="cri" colspan=6><i>ClientRequestInfo-specific:</i></td>
    *  </tr>
    *
-   *  <tr><th id="target"><p align="left">target</p></th>
+   *  <tr><th id="target"><p style="text-align:left">target</p></th>
    *  <td headers="cri target send_req">yes</td> 
    *  <td headers="cri target send_poll">yes</td> 
    *  <td headers="cri target rec_reply">yes</td> 
    *  <td headers="cri target rec_ex">yes</td> 
    *  <td headers="cri target rec_oth">yes</td></tr>
    *
-   *  <tr><th id="eftarget"><p align="left">effective_target</p></th>
+   *  <tr><th id="eftarget"><p style="text-align:left">effective_target</p></th>
    *  <td headers="cri eftarget send_req">yes</td> 
    *  <td headers="cri eftarget send_poll">yes</td> 
    *  <td headers="cri eftarget rec_reply">yes</td> 
@@ -719,49 +720,49 @@
    *  <td headers="cri eftarget rec_oth">yes</td>
    *  </tr>
    *
-   *  <tr><th id="efprof"><p align="left">effective_profile</p></th>
+   *  <tr><th id="efprof"><p style="text-align:left">effective_profile</p></th>
    *  <td headers="cri efprof send_req">yes</td> 
    *  <td headers="cri efprof send_poll">yes</td> 
    *  <td headers="cri efprof rec_reply">yes</td> 
    *  <td headers="cri efprof rec_ex">yes</td> 
    *  <td headers="cri efprof rec_oth">yes</td></tr>
    *
-   *  <tr><th id="rxp"><p align="left">received_exception</p></th>
+   *  <tr><th id="rxp"><p style="text-align:left">received_exception</p></th>
    *  <td headers="cri rxp send_req">no </td> 
    *  <td headers="cri rxp send_poll">no </td> 
    *  <td headers="cri rxp rec_reply">no </td> 
    *  <td headers="cri rxp rec_ex">yes</td> 
    *  <td headers="cri rxp rec_oth">no </td></tr>
    *
-   *  <tr><th id="rei"><p align="left">received_exception_id</p></th>
+   *  <tr><th id="rei"><p style="text-align:left">received_exception_id</p></th>
    *  <td headers="cri rei send_req">no </td> 
    *  <td headers="cri rei send_poll">no </td> 
    *  <td headers="cri rei rec_reply">no </td> 
    *  <td headers="cri rei rec_ex">yes</td> 
    *  <td headers="cri rei rec_oth">no </td></tr>
    *
-   *  <tr><th id="gec"><p align="left">get_effective_component</p></th>
+   *  <tr><th id="gec"><p style="text-align:left">get_effective_component</p></th>
    *  <td headers="cri gec send_req">yes</td> 
    *  <td headers="cri gec send_poll">no </td> 
    *  <td headers="cri gec rec_reply">yes</td> 
    *  <td headers="cri gec rec_ex">yes</td> 
    *  <td headers="cri gec rec_oth">yes</td></tr>
    *
-   *  <tr><th id="gecs"><p align="left">get_effective_components</p></th>
+   *  <tr><th id="gecs"><p style="text-align:left">get_effective_components</p></th>
    *  <td headers="cri gecs send_req">yes</td> 
    *  <td headers="cri gecs send_poll">no </td> 
    *  <td headers="cri gecs rec_reply">yes</td> 
    *  <td headers="cri gecs rec_ex">yes</td> 
    *  <td headers="cri gecs rec_oth">yes</td></tr>
    *
-   *  <tr><th id="grpcy"><p align="left">get_request_policy</p></th>
+   *  <tr><th id="grpcy"><p style="text-align:left">get_request_policy</p></th>
    *  <td headers="cri grpcy send_req">yes</td>
    *  <td headers="cri grpcy send_poll">no </td> 
    *  <td headers="cri grpcy rec_reply">yes</td> 
    *  <td headers="cri grpcy rec_ex">yes</td> 
    *  <td headers="cri grpcy rec_oth">yes</td></tr>
    *
-   *  <tr><th id="arsc"><p align="left">add_request_service_context</p></th>
+   *  <tr><th id="arsc"><p style="text-align:left">add_request_service_context</p></th>
    *    <td headers="cri arsc send_req">yes</td> 
    *    <td headers="cri arsc send_poll">no </td> 
    *    <td headers="cri arsc rec_reply">no </td> 
@@ -935,7 +936,8 @@
    * standard minor code of 14.
    *
    *
-   * <table border=1 summary="Shows the validity of each attribute or operation">
+   * <table class="plain">
+   *   <caption style="display:none">Shows the validity of each attribute or operation</caption>
    *   <thead>
    *     <tr>
    *       <th>&nbsp;</th>
@@ -953,21 +955,21 @@
    *   <td id="ri" colspan=6><i>Inherited from RequestInfo:</i></td>
    * </tr>
    *
-   * <tr><th id="req_id"><p align="left">request_id</p></th>
+   * <tr><th id="req_id"><p style="text-align:left">request_id</p></th>
    * <td headers="ri req_id rec_req_ser_con">yes</td> 
    * <td headers="ri req_id rec_req">yes</td> 
    * <td headers="ri req_id send_rep">yes</td> 
    * <td headers="ri req_id send_exc">yes</td> 
    * <td headers="ri req_id send_oth">yes</td></tr>
    *
-   * <tr><th id="op"><p align="left">operation</p></th>
+   * <tr><th id="op"><p style="text-align:left">operation</p></th>
    * <td headers="ri op rec_req_ser_con">yes</td> 
    * <td headers="ri op rec_req">yes</td> 
    * <td headers="ri op send_rep">yes</td> 
    * <td headers="ri op send_exc">yes</td> 
    * <td headers="ri op send_oth">yes</td></tr>
    *
-   * <tr><th id="args"><p align="left">arguments</p></th>
+   * <tr><th id="args"><p style="text-align:left">arguments</p></th>
    * <td headers="ri args rec_req_ser_con">no </td> 
    * <td headers="ri args rec_req">yes<sub>1</sub></td>
    * <td headers="ri args send_rep">yes</td> 
@@ -975,21 +977,21 @@
    * <td headers="ri args send_oth">no<sub>2</sub>
    * </td></tr>
    *
-   * <tr><th id="exps"><p align="left">exceptions</p></th>
+   * <tr><th id="exps"><p style="text-align:left">exceptions</p></th>
    * <td headers="ri exps rec_req_ser_con">no </td> 
    * <td headers="ri exps rec_req">yes</td> 
    * <td headers="ri exps send_rep">yes</td> 
    * <td headers="ri exps send_exc">yes</td> 
    * <td headers="ri exps send_oth">yes</td></tr>
    *
-   * <tr><th id="contexts"><p align="left">contexts</p></th>
+   * <tr><th id="contexts"><p style="text-align:left">contexts</p></th>
    * <td headers="ri contexts rec_req_ser_con">no </td> 
    * <td headers="ri contexts rec_req">yes</td> 
    * <td headers="ri contexts send_rep">yes</td> 
    * <td headers="ri contexts send_exc">yes</td> 
    * <td headers="ri contexts send_oth">yes</td></tr>
    *
-   * <tr><th id="op_con"><p align="left">operation_context</p></th>
+   * <tr><th id="op_con"><p style="text-align:left">operation_context</p></th>
    * <td headers="ri op_con rec_req_ser_con">no </td> 
    * <td headers="ri op_con rec_req">yes</td> 
    * <td headers="ri op_con send_rep">yes</td> 
@@ -997,7 +999,7 @@
    * <td headers="ri op_con send_oth">no </td>
    * </tr>
    * 
-   * <tr><th id="result"><p align="left">result</p></th>
+   * <tr><th id="result"><p style="text-align:left">result</p></th>
    * <td headers="ri result rec_req_ser_con">no </td> 
    * <td headers="ri result rec_req">no </td> 
    * <td headers="ri result send_rep">yes</td> 
@@ -1005,14 +1007,14 @@
    * <td headers="ri result send_oth">no </td>
    * </tr>
    *
-   * <tr><th id="res_ex"><p align="left">response_expected</p></th>
+   * <tr><th id="res_ex"><p style="text-align:left">response_expected</p></th>
    * <td headers="ri res_ex rec_req_ser_con">yes</td> 
    * <td headers="ri res_ex rec_req">yes</td> 
    * <td headers="ri res_ex send_rep">yes</td> 
    * <td headers="ri res_ex send_exc">yes</td> 
    * <td headers="ri res_ex send_oth">yes</td></tr>
    *
-   * <tr><th id="syn_scp"><p align="left">sync_scope</p></th>
+   * <tr><th id="syn_scp"><p style="text-align:left">sync_scope</p></th>
    * <td headers="ri syn_scp rec_req_ser_con">yes</td> 
    * <td headers="ri syn_scp rec_req">yes</td> 
    * <td headers="ri syn_scp send_rep">yes</td> 
--- a/corba/src/java.corba/share/classes/org/omg/PortableInterceptor/package.html	Thu May 25 15:27:40 2017 -0700
+++ b/corba/src/java.corba/share/classes/org/omg/PortableInterceptor/package.html	Thu May 25 22:33:25 2017 +0000
@@ -1,9 +1,9 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!doctype html>
 <html>
 <head>
 <!--
 
-Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2000, 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
@@ -29,7 +29,7 @@
 -->
 
 </head>
-<body bgcolor="white">
+<body>
 
 Provides a mechanism to register ORB hooks through which ORB services
 can intercept the normal flow of execution of the ORB.
@@ -52,7 +52,7 @@
 {@link org.omg.PortableInterceptor.ORBInitializer ORBInitializer}</code> 
 for how to go about registering interceptors.
 
-<a name="unimpl"></a>
+<a id="unimpl"></a>
 <h2>Known limitations / unimplemented methods in package 
 <code>org.omg.PortableInterceptor</code></h2>
 
--- a/corba/src/java.corba/share/classes/org/omg/PortableServer/package.html	Thu May 25 15:27:40 2017 -0700
+++ b/corba/src/java.corba/share/classes/org/omg/PortableServer/package.html	Thu May 25 22:33:25 2017 +0000
@@ -1,9 +1,9 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!doctype html>
 <html>
 <head>
 <!--
 
- Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 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
@@ -30,7 +30,7 @@
 -->
 
 </head>
-<body bgcolor="white">
+<body>
 Provides classes and interfaces for making the server side of your applications 
 portable across multivendor ORBs.
 
@@ -160,7 +160,7 @@
 <A HREF="../../../../technotes/guides/idl/index.html">Java IDL home page</A>.
 
 <H2>Example Code</H2>
-<a name="sampleserver"></a>
+<a id="sampleserver"></a>
 <H3>Example Server Code</H3>
 <PRE>
 import javax.naming.InitialContext;
--- a/hotspot/.hgtags	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/.hgtags	Thu May 25 22:33:25 2017 +0000
@@ -579,3 +579,6 @@
 1ca7ed1b17b5776930d641d1379834f3140a74e4 jdk-9+167
 fbb9c802649585d19f6d7e81b4a519d44806225a jdk-9+168
 16d692be099c5c38eb48cc9aca78b0c900910d5b jdk-9+169
+38a240fd58a287acb1963920b92ed4d9c2fd39e3 jdk-9+170
+9d4746eca95aec3e5a344bf2520745dcc1d17eed jdk-10+7
+f5ded0cf954c770deeecb80f2ba1ba6a05cd979b jdk-10+8
--- a/hotspot/make/templates/gpl-cp-header	Thu May 25 15:27:40 2017 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-Copyright (c) %YEARS%, 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.
--- a/hotspot/make/templates/gpl-header	Thu May 25 15:27:40 2017 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-Copyright (c) %YEARS%, 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.
--- a/hotspot/src/cpu/ppc/vm/globals_ppc.hpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/cpu/ppc/vm/globals_ppc.hpp	Thu May 25 22:33:25 2017 +0000
@@ -164,7 +164,7 @@
   product(bool, ZapMemory, false, "Write 0x0101... to empty memory."        \
           " Use this to ease debugging.")                                   \
                                                                             \
-  /* Use Restricted Transactional Memory for lock eliding */                \
+  /* Use Restricted Transactional Memory for lock elision */                \
   product(bool, UseRTMLocking, false,                                       \
           "Enable RTM lock eliding for inflated locks in compiled code")    \
                                                                             \
@@ -174,24 +174,30 @@
   product(bool, UseRTMDeopt, false,                                         \
           "Perform deopt and recompilation based on RTM abort ratio")       \
                                                                             \
-  product(uintx, RTMRetryCount, 5,                                          \
+  product(int, RTMRetryCount, 5,                                            \
           "Number of RTM retries on lock abort or busy")                    \
+          range(0, max_jint)                                                \
                                                                             \
-  experimental(intx, RTMSpinLoopCount, 100,                                 \
+  experimental(int, RTMSpinLoopCount, 100,                                  \
           "Spin count for lock to become free before RTM retry")            \
+          range(0, 32767) /* immediate operand limit on ppc */              \
                                                                             \
-  experimental(intx, RTMAbortThreshold, 1000,                               \
+  experimental(int, RTMAbortThreshold, 1000,                                \
           "Calculate abort ratio after this number of aborts")              \
+          range(0, max_jint)                                                \
                                                                             \
-  experimental(intx, RTMLockingThreshold, 10000,                            \
+  experimental(int, RTMLockingThreshold, 10000,                             \
           "Lock count at which to do RTM lock eliding without "             \
           "abort ratio calculation")                                        \
+          range(0, max_jint)                                                \
                                                                             \
-  experimental(intx, RTMAbortRatio, 50,                                     \
+  experimental(int, RTMAbortRatio, 50,                                      \
           "Lock abort ratio at which to stop use RTM lock eliding")         \
+          range(0, 100) /* natural range, checked in vm_version_ppc.cpp */  \
                                                                             \
-  experimental(intx, RTMTotalCountIncrRate, 64,                             \
+  experimental(int, RTMTotalCountIncrRate, 64,                              \
           "Increment total RTM attempted lock count once every n times")    \
+          range(1, 32767) /* immediate operand limit on ppc */              \
                                                                             \
   experimental(intx, RTMLockingCalculationDelay, 0,                         \
           "Number of milliseconds to wait before start calculating aborts " \
--- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp	Thu May 25 22:33:25 2017 +0000
@@ -2498,14 +2498,20 @@
   //   All transactions = total_count *  RTMTotalCountIncrRate
   //   Set no_rtm bit if (Aborted transactions >= All transactions * RTMAbortRatio)
   ld(R0, RTMLockingCounters::abort_count_offset(), rtm_counters_Reg);
-  cmpdi(CCR0, R0, RTMAbortThreshold);
-  blt(CCR0, L_check_always_rtm2);
+  if (is_simm(RTMAbortThreshold, 16)) {   // cmpdi can handle 16bit immediate only.
+    cmpdi(CCR0, R0, RTMAbortThreshold);
+    blt(CCR0, L_check_always_rtm2);  // reload of rtm_counters_Reg not necessary
+  } else {
+    load_const_optimized(rtm_counters_Reg, RTMAbortThreshold);
+    cmpd(CCR0, R0, rtm_counters_Reg);
+    blt(CCR0, L_check_always_rtm1);  // reload of rtm_counters_Reg required
+  }
   mulli(R0, R0, 100);
 
   const Register tmpReg = rtm_counters_Reg;
   ld(tmpReg, RTMLockingCounters::total_count_offset(), rtm_counters_Reg);
-  mulli(tmpReg, tmpReg, RTMTotalCountIncrRate);
-  mulli(tmpReg, tmpReg, RTMAbortRatio);
+  mulli(tmpReg, tmpReg, RTMTotalCountIncrRate); // allowable range: int16
+  mulli(tmpReg, tmpReg, RTMAbortRatio);         // allowable range: int16
   cmpd(CCR0, R0, tmpReg);
   blt(CCR0, L_check_always_rtm1); // jump to reload
   if (method_data != NULL) {
@@ -2521,7 +2527,13 @@
   load_const_optimized(rtm_counters_Reg, (address)rtm_counters, R0); // reload
   bind(L_check_always_rtm2);
   ld(tmpReg, RTMLockingCounters::total_count_offset(), rtm_counters_Reg);
-  cmpdi(CCR0, tmpReg, RTMLockingThreshold / RTMTotalCountIncrRate);
+  int64_t thresholdValue = RTMLockingThreshold / RTMTotalCountIncrRate;
+  if (is_simm(thresholdValue, 16)) {   // cmpdi can handle 16bit immediate only.
+    cmpdi(CCR0, tmpReg, thresholdValue);
+  } else {
+    load_const_optimized(R0, thresholdValue);
+    cmpd(CCR0, tmpReg, R0);
+  }
   blt(CCR0, L_done);
   if (method_data != NULL) {
     // Set rtm_state to "always rtm" in MDO.
@@ -2620,7 +2632,7 @@
   if (PrintPreciseRTMLockingStatistics || profile_rtm) {
     Label L_noincrement;
     if (RTMTotalCountIncrRate > 1) {
-      branch_on_random_using_tb(tmp, (int)RTMTotalCountIncrRate, L_noincrement);
+      branch_on_random_using_tb(tmp, RTMTotalCountIncrRate, L_noincrement);
     }
     assert(stack_rtm_counters != NULL, "should not be NULL when profiling RTM");
     load_const_optimized(tmp, (address)stack_rtm_counters->total_count_addr(), R0);
@@ -2687,7 +2699,7 @@
   if (PrintPreciseRTMLockingStatistics || profile_rtm) {
     Label L_noincrement;
     if (RTMTotalCountIncrRate > 1) {
-      branch_on_random_using_tb(R0, (int)RTMTotalCountIncrRate, L_noincrement);
+      branch_on_random_using_tb(R0, RTMTotalCountIncrRate, L_noincrement);
     }
     assert(rtm_counters != NULL, "should not be NULL when profiling RTM");
     load_const(R0, (address)rtm_counters->total_count_addr(), tmpReg);
--- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp	Thu May 25 22:33:25 2017 +0000
@@ -3720,7 +3720,7 @@
       __ bge(CCR0, Lslow_case);
 
       // Increment waste limit to prevent getting stuck on this slow path.
-      __ addi(RtlabWasteLimitValue, RtlabWasteLimitValue, (int)ThreadLocalAllocBuffer::refill_waste_limit_increment());
+      __ add_const_optimized(RtlabWasteLimitValue, RtlabWasteLimitValue, ThreadLocalAllocBuffer::refill_waste_limit_increment());
       __ std(RtlabWasteLimitValue, in_bytes(JavaThread::tlab_refill_waste_limit_offset()), R16_thread);
     }
     // else: No allocation in the shared eden. // fallthru: __ b(Lslow_case);
--- a/hotspot/src/cpu/x86/vm/globals_x86.hpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp	Thu May 25 22:33:25 2017 +0000
@@ -160,25 +160,30 @@
   product(bool, UseRTMDeopt, false,                                         \
           "Perform deopt and recompilation based on RTM abort ratio")       \
                                                                             \
-  product(uintx, RTMRetryCount, 5,                                          \
+  product(int, RTMRetryCount, 5,                                            \
           "Number of RTM retries on lock abort or busy")                    \
-          range(0, max_uintx)                                               \
+          range(0, max_jint)                                                \
                                                                             \
-  experimental(intx, RTMSpinLoopCount, 100,                                 \
+  experimental(int, RTMSpinLoopCount, 100,                                  \
           "Spin count for lock to become free before RTM retry")            \
+          range(0, max_jint)                                                \
                                                                             \
-  experimental(intx, RTMAbortThreshold, 1000,                               \
+  experimental(int, RTMAbortThreshold, 1000,                                \
           "Calculate abort ratio after this number of aborts")              \
+          range(0, max_jint)                                                \
                                                                             \
-  experimental(intx, RTMLockingThreshold, 10000,                            \
+  experimental(int, RTMLockingThreshold, 10000,                             \
           "Lock count at which to do RTM lock eliding without "             \
           "abort ratio calculation")                                        \
+          range(0, max_jint)                                                \
                                                                             \
-  experimental(intx, RTMAbortRatio, 50,                                     \
+  experimental(int, RTMAbortRatio, 50,                                      \
           "Lock abort ratio at which to stop use RTM lock eliding")         \
+          range(0, 100) /* natural range, checked in vm_version_x86.cpp */  \
                                                                             \
-  experimental(intx, RTMTotalCountIncrRate, 64,                             \
+  experimental(int, RTMTotalCountIncrRate, 64,                              \
           "Increment total RTM attempted lock count once every n times")    \
+          range(1, max_jint)                                                \
                                                                             \
   experimental(intx, RTMLockingCalculationDelay, 0,                         \
           "Number of milliseconds to wait before start calculating aborts " \
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Thu May 25 22:33:25 2017 +0000
@@ -1492,7 +1492,7 @@
     Label L_noincrement;
     if (RTMTotalCountIncrRate > 1) {
       // tmpReg, scrReg and flags are killed
-      branch_on_random_using_rdtsc(tmpReg, scrReg, (int)RTMTotalCountIncrRate, L_noincrement);
+      branch_on_random_using_rdtsc(tmpReg, scrReg, RTMTotalCountIncrRate, L_noincrement);
     }
     assert(stack_rtm_counters != NULL, "should not be NULL when profiling RTM");
     atomic_incptr(ExternalAddress((address)stack_rtm_counters->total_count_addr()), scrReg);
@@ -1553,7 +1553,7 @@
     Label L_noincrement;
     if (RTMTotalCountIncrRate > 1) {
       // tmpReg, scrReg and flags are killed
-      branch_on_random_using_rdtsc(tmpReg, scrReg, (int)RTMTotalCountIncrRate, L_noincrement);
+      branch_on_random_using_rdtsc(tmpReg, scrReg, RTMTotalCountIncrRate, L_noincrement);
     }
     assert(rtm_counters != NULL, "should not be NULL when profiling RTM");
     atomic_incptr(ExternalAddress((address)rtm_counters->total_count_addr()), scrReg);
--- a/hotspot/src/share/vm/classfile/classLoader.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp	Thu May 25 22:33:25 2017 +0000
@@ -1945,7 +1945,7 @@
             if (can_be_compiled(m, comp_level)) {
               if (++_codecache_sweep_counter == CompileTheWorldSafepointInterval) {
                 // Give sweeper a chance to keep up with CTW
-                VM_ForceSafepoint op;
+                VM_CTWThreshold op;
                 VMThread::execute(&op);
                 _codecache_sweep_counter = 0;
               }
--- a/hotspot/src/share/vm/classfile/stringTable.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/classfile/stringTable.cpp	Thu May 25 22:33:25 2017 +0000
@@ -315,7 +315,11 @@
 }
 
 void StringTable::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int* processed, int* removed) {
-  buckets_unlink_or_oops_do(is_alive, f, 0, the_table()->table_size(), processed, 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) {
@@ -324,6 +328,7 @@
   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;
@@ -333,8 +338,11 @@
     }
 
     int end_idx = MIN2(limit, start_idx + ClaimChunkSize);
-    buckets_unlink_or_oops_do(is_alive, f, start_idx, end_idx, processed, removed);
+    buckets_unlink_or_oops_do(is_alive, f, start_idx, end_idx, &context);
   }
+  _the_table->bulk_free_entries(&context);
+  *processed = context._num_processed;
+  *removed = context._num_removed;
 }
 
 void StringTable::buckets_oops_do(OopClosure* f, int start_idx, int end_idx) {
@@ -360,7 +368,7 @@
   }
 }
 
-void StringTable::buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, int* processed, int* removed) {
+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,
@@ -384,10 +392,9 @@
         p = entry->next_addr();
       } else {
         *p = entry->next();
-        the_table()->free_entry(entry);
-        (*removed)++;
+        context->free_entry(entry);
       }
-      (*processed)++;
+      context->_num_processed++;
       entry = *p;
     }
   }
--- a/hotspot/src/share/vm/classfile/stringTable.hpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/classfile/stringTable.hpp	Thu May 25 22:33:25 2017 +0000
@@ -61,9 +61,13 @@
   // 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);
+
+  typedef StringTable::BucketUnlinkContext BucketUnlinkContext;
   // Unlink or apply the give oop closure to the entries to the buckets
-  // in the range [start_idx, end_idx).
-  static void buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, int* processed, int* removed);
+  // 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);
 
   // Hashing algorithm, used as the hash value used by the
   //     StringTable for bucket selection and comparison (stored in the
--- a/hotspot/src/share/vm/classfile/symbolTable.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/classfile/symbolTable.cpp	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -98,7 +98,7 @@
 int SymbolTable::_symbols_counted = 0;
 volatile int SymbolTable::_parallel_claimed_idx = 0;
 
-void SymbolTable::buckets_unlink(int start_idx, int end_idx, int* processed, int* removed) {
+void SymbolTable::buckets_unlink(int start_idx, int end_idx, BucketUnlinkContext* context) {
   for (int i = start_idx; i < end_idx; ++i) {
     HashtableEntry<Symbol*, mtSymbol>** p = the_table()->bucket_addr(i);
     HashtableEntry<Symbol*, mtSymbol>* entry = the_table()->bucket(i);
@@ -111,15 +111,14 @@
         break;
       }
       Symbol* s = entry->literal();
-      (*processed)++;
+      context->_num_processed++;
       assert(s != NULL, "just checking");
       // If reference count is zero, remove.
       if (s->refcount() == 0) {
         assert(!entry->is_shared(), "shared entries should be kept live");
         delete s;
-        (*removed)++;
         *p = entry->next();
-        the_table()->free_entry(entry);
+        context->free_entry(entry);
       } else {
         p = entry->next_addr();
       }
@@ -132,17 +131,20 @@
 // Remove unreferenced symbols from the symbol table
 // This is done late during GC.
 void SymbolTable::unlink(int* processed, int* removed) {
-  size_t memory_total = 0;
-  buckets_unlink(0, the_table()->table_size(), processed, removed);
-  _symbols_removed += *removed;
-  _symbols_counted += *processed;
+  BucketUnlinkContext context;
+  buckets_unlink(0, the_table()->table_size(), &context);
+  _the_table->bulk_free_entries(&context);
+  *processed = context._num_processed;
+  *removed = context._num_removed;
+
+  _symbols_removed = context._num_removed;
+  _symbols_counted = context._num_processed;
 }
 
 void SymbolTable::possibly_parallel_unlink(int* processed, int* removed) {
   const int limit = the_table()->table_size();
 
-  size_t memory_total = 0;
-
+  BucketUnlinkContext context;
   for (;;) {
     // Grab next set of buckets to scan
     int start_idx = Atomic::add(ClaimChunkSize, &_parallel_claimed_idx) - ClaimChunkSize;
@@ -152,10 +154,15 @@
     }
 
     int end_idx = MIN2(limit, start_idx + ClaimChunkSize);
-    buckets_unlink(start_idx, end_idx, processed, removed);
+    buckets_unlink(start_idx, end_idx, &context);
   }
-  Atomic::add(*processed, &_symbols_counted);
-  Atomic::add(*removed, &_symbols_removed);
+
+  _the_table->bulk_free_entries(&context);
+  *processed = context._num_processed;
+  *removed = context._num_removed;
+
+  Atomic::add(context._num_processed, &_symbols_counted);
+  Atomic::add(context._num_removed, &_symbols_removed);
 }
 
 // Create a new table and using alternate hash code, populate the new table
--- a/hotspot/src/share/vm/classfile/symbolTable.hpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/classfile/symbolTable.hpp	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -154,8 +154,11 @@
 
   static volatile int _parallel_claimed_idx;
 
-  // Release any dead symbols
-  static void buckets_unlink(int start_idx, int end_idx, int* processed, int* removed);
+  typedef SymbolTable::BucketUnlinkContext BucketUnlinkContext;
+  // Release any dead symbols. 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(int start_idx, int end_idx, BucketUnlinkContext* context);
 public:
   enum {
     symbol_alloc_batch_size = 8,
--- a/hotspot/src/share/vm/code/icBuffer.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/code/icBuffer.cpp	Thu May 25 22:33:25 2017 +0000
@@ -126,8 +126,8 @@
     // We do this by forcing a safepoint
     EXCEPTION_MARK;
 
-    VM_ForceSafepoint vfs;
-    VMThread::execute(&vfs);
+    VM_ICBufferFull ibf;
+    VMThread::execute(&ibf);
     // We could potential get an async. exception at this point.
     // In that case we will rethrow it to ourselvs.
     if (HAS_PENDING_EXCEPTION) {
--- a/hotspot/src/share/vm/oops/symbol.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/oops/symbol.cpp	Thu May 25 22:33:25 2017 +0000
@@ -66,22 +66,6 @@
 }
 
 // ------------------------------------------------------------------
-// Symbol::equals
-//
-// Compares the symbol with a string of the given length.
-bool Symbol::equals(const char* str, int len) const {
-  int l = utf8_length();
-  if (l != len) return false;
-  while (l-- > 0) {
-    if (str[l] != (char) byte_at(l))
-      return false;
-  }
-  assert(l == -1, "we should be at the beginning");
-  return true;
-}
-
-
-// ------------------------------------------------------------------
 // Symbol::starts_with
 //
 // Tests if the symbol starts with the specified prefix of the given
--- a/hotspot/src/share/vm/oops/symbol.hpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/oops/symbol.hpp	Thu May 25 22:33:25 2017 +0000
@@ -175,7 +175,16 @@
   int utf8_length() const { return _length; }
 
   // Compares the symbol with a string.
-  bool equals(const char* str, int len) const;
+  bool equals(const char* str, int len) const {
+    int l = utf8_length();
+    if (l != len) return false;
+    while (l-- > 0) {
+      if (str[l] != (char) byte_at(l))
+        return false;
+    }
+    assert(l == -1, "we should be at the beginning");
+    return true;
+  }
   bool equals(const char* str) const { return equals(str, (int) strlen(str)); }
 
   // Tests if the symbol starts with the given prefix.
--- a/hotspot/src/share/vm/opto/c2_globals.hpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/opto/c2_globals.hpp	Thu May 25 22:33:25 2017 +0000
@@ -420,37 +420,38 @@
   develop(bool, InlineWarmCalls, false,                                     \
           "Use a heat-based priority queue to govern inlining")             \
                                                                             \
+  /* Max values must not exceed WarmCallInfo::MAX_VALUE(). */               \
   develop(intx, HotCallCountThreshold, 999999,                              \
           "large numbers of calls (per method invocation) force hotness")   \
-          range(0, max_intx)                                                \
+          range(0, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10))))      \
                                                                             \
   develop(intx, HotCallProfitThreshold, 999999,                             \
           "highly profitable inlining opportunities force hotness")         \
-          range(0, max_intx)                                                \
+          range(0, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10))))      \
                                                                             \
   develop(intx, HotCallTrivialWork, -1,                                     \
           "trivial execution time (no larger than this) forces hotness")    \
-          range(-1, max_intx)                                               \
+          range(-1, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10))))     \
                                                                             \
   develop(intx, HotCallTrivialSize, -1,                                     \
           "trivial methods (no larger than this) force calls to be hot")    \
-          range(-1, max_intx)                                               \
+          range(-1, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10))))     \
                                                                             \
   develop(intx, WarmCallMinCount, -1,                                       \
           "number of calls (per method invocation) to enable inlining")     \
-          range(-1, max_intx)                                               \
+          range(-1, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10))))     \
                                                                             \
   develop(intx, WarmCallMinProfit, -1,                                      \
           "number of calls (per method invocation) to enable inlining")     \
-          range(-1, max_intx)                                               \
+          range(-1, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10))))     \
                                                                             \
   develop(intx, WarmCallMaxWork, 999999,                                    \
           "execution time of the largest inlinable method")                 \
-          range(0, max_intx)                                                \
+          range(0, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10))))      \
                                                                             \
   develop(intx, WarmCallMaxSize, 999999,                                    \
           "size of the largest inlinable method")                           \
-          range(0, max_intx)                                                \
+          range(0, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10))))      \
                                                                             \
   product(intx, MaxNodeLimit, 80000,                                        \
           "Maximum number of nodes")                                        \
--- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Thu May 25 22:33:25 2017 +0000
@@ -985,8 +985,8 @@
     results[i] = JVMTI_ERROR_NONE;  // indicate successful suspend
   }
   if (needSafepoint > 0) {
-    VM_ForceSafepoint vfs;
-    VMThread::execute(&vfs);
+    VM_ThreadsSuspendJVMTI tsj;
+    VMThread::execute(&tsj);
   }
   // per-thread suspend results returned via results parameter
   return JVMTI_ERROR_NONE;
--- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp	Thu May 25 22:33:25 2017 +0000
@@ -276,14 +276,15 @@
     return Flag::VIOLATES_CONSTRAINT;
   }
 
-#ifdef SPARC
+  // Relevant on ppc, s390, sparc. Will be optimized where
+  // addr_unit() == 1.
   if (OptoLoopAlignment % relocInfo::addr_unit() != 0) {
     CommandLineError::print(verbose,
                             "OptoLoopAlignment (" INTX_FORMAT ") must be "
-                            "multiple of NOP size\n");
+                            "multiple of NOP size (%d)\n",
+                            value, relocInfo::addr_unit());
     return Flag::VIOLATES_CONSTRAINT;
   }
-#endif
 
   return Flag::SUCCESS;
 }
--- a/hotspot/src/share/vm/runtime/safepoint.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/runtime/safepoint.cpp	Thu May 25 22:33:25 2017 +0000
@@ -396,9 +396,7 @@
   GCLocker::set_jni_lock_count(_current_jni_active_count);
 
   if (log_is_enabled(Debug, safepoint)) {
-    VM_Operation *op = VMThread::vm_operation();
-    log_debug(safepoint)("Entering safepoint region: %s",
-                         (op != NULL) ? op->name() : "no vm operation");
+    log_debug(safepoint)("Entering safepoint region: %s", VMThread::vm_safepoint_description());
   }
 
   RuntimeService::record_safepoint_synchronized();
@@ -845,10 +843,8 @@
   // To debug the long safepoint, specify both DieOnSafepointTimeout &
   // ShowMessageBoxOnError.
   if (DieOnSafepointTimeout) {
-    VM_Operation *op = VMThread::vm_operation();
     fatal("Safepoint sync time longer than " INTX_FORMAT "ms detected when executing %s.",
-          SafepointTimeoutDelay,
-          op != NULL ? op->name() : "no vm operation");
+          SafepointTimeoutDelay, VMThread::vm_safepoint_description());
   }
 }
 
--- a/hotspot/src/share/vm/runtime/synchronizer.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/runtime/synchronizer.cpp	Thu May 25 22:33:25 2017 +0000
@@ -1063,7 +1063,7 @@
     // Must VM_Operation instance be heap allocated as the op will be enqueue and posted
     // to the VMthread and have a lifespan longer than that of this activation record.
     // The VMThread will delete the op when completed.
-    VMThread::execute(new VM_ForceAsyncSafepoint());
+    VMThread::execute(new VM_ScavengeMonitors());
 
     if (ObjectMonitor::Knob_Verbose) {
       tty->print_cr("INFO: Monitor scavenge - STW posted @%s (%d)",
--- a/hotspot/src/share/vm/runtime/thread.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Thu May 25 22:33:25 2017 +0000
@@ -2275,7 +2275,7 @@
     }
   }
 
-  VM_ForceSafepoint vm_suspend;
+  VM_ThreadSuspend vm_suspend;
   VMThread::execute(&vm_suspend);
 }
 
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp	Thu May 25 22:33:25 2017 +0000
@@ -676,7 +676,7 @@
                                                                                                                                      \
   nonstatic_field(BasicHashtable<mtInternal>,  _table_size,                                   int)                                   \
   nonstatic_field(BasicHashtable<mtInternal>,  _buckets,                                      HashtableBucket<mtInternal>*)          \
-  nonstatic_field(BasicHashtable<mtInternal>,  _free_list,                                    BasicHashtableEntry<mtInternal>*)      \
+  volatile_nonstatic_field(BasicHashtable<mtInternal>,  _free_list,                           BasicHashtableEntry<mtInternal>*)      \
   nonstatic_field(BasicHashtable<mtInternal>,  _first_free_entry,                             char*)                                 \
   nonstatic_field(BasicHashtable<mtInternal>,  _end_block,                                    char*)                                 \
   nonstatic_field(BasicHashtable<mtInternal>,  _entry_size,                                   int)                                   \
--- a/hotspot/src/share/vm/runtime/vmThread.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/runtime/vmThread.cpp	Thu May 25 22:33:25 2017 +0000
@@ -204,6 +204,7 @@
 VM_Operation*     VMThread::_cur_vm_operation   = NULL;
 VMOperationQueue* VMThread::_vm_queue           = NULL;
 PerfCounter*      VMThread::_perf_accumulated_vm_operation_time = NULL;
+const char*       VMThread::_no_op_reason       = NULL;
 
 
 void VMThread::create() {
@@ -273,6 +274,7 @@
   }
 
   // 4526887 let VM thread exit at Safepoint
+  _no_op_reason = "Halt";
   SafepointSynchronize::begin();
 
   if (VerifyBeforeExit) {
@@ -380,6 +382,25 @@
   }
 }
 
+bool VMThread::no_op_safepoint_needed(bool check_time) {
+  if (SafepointALot) {
+    _no_op_reason = "SafepointALot";
+    return true;
+  }
+  if (!SafepointSynchronize::is_cleanup_needed()) {
+    return false;
+  }
+  if (check_time) {
+    long interval = SafepointSynchronize::last_non_safepoint_interval();
+    bool max_time_exceeded = GuaranteedSafepointInterval != 0 &&
+                             (interval > GuaranteedSafepointInterval);
+    if (!max_time_exceeded) {
+      return false;
+    }
+  }
+  _no_op_reason = "Cleanup";
+  return true;
+}
 
 void VMThread::loop() {
   assert(_cur_vm_operation == NULL, "no current one should be executing");
@@ -418,8 +439,7 @@
           exit(-1);
         }
 
-        if (timedout && (SafepointALot ||
-                         SafepointSynchronize::is_cleanup_needed())) {
+        if (timedout && VMThread::no_op_safepoint_needed(false)) {
           MutexUnlockerEx mul(VMOperationQueue_lock,
                               Mutex::_no_safepoint_check_flag);
           // Force a safepoint since we have not had one for at least
@@ -542,14 +562,10 @@
     //
     // We want to make sure that we get to a safepoint regularly.
     //
-    if (SafepointALot || SafepointSynchronize::is_cleanup_needed()) {
-      long interval          = SafepointSynchronize::last_non_safepoint_interval();
-      bool max_time_exceeded = GuaranteedSafepointInterval != 0 && (interval > GuaranteedSafepointInterval);
-      if (SafepointALot || max_time_exceeded) {
-        HandleMark hm(VMThread::vm_thread());
-        SafepointSynchronize::begin();
-        SafepointSynchronize::end();
-      }
+    if (VMThread::no_op_safepoint_needed(true)) {
+      HandleMark hm(VMThread::vm_thread());
+      SafepointSynchronize::begin();
+      SafepointSynchronize::end();
     }
   }
 }
--- a/hotspot/src/share/vm/runtime/vmThread.hpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/runtime/vmThread.hpp	Thu May 25 22:33:25 2017 +0000
@@ -99,7 +99,12 @@
   static Monitor * _terminate_lock;
   static PerfCounter* _perf_accumulated_vm_operation_time;
 
+  static const char* _no_op_reason;
+
+  static bool no_op_safepoint_needed(bool check_time);
+
   void evaluate_operation(VM_Operation* op);
+
  public:
   // Constructor
   VMThread();
@@ -126,7 +131,10 @@
   static void execute(VM_Operation* op);
 
   // Returns the current vm operation if any.
-  static VM_Operation* vm_operation()             { return _cur_vm_operation;   }
+  static VM_Operation* vm_operation()             { return _cur_vm_operation; }
+
+  // Returns the current vm operation name or set reason
+  static const char* vm_safepoint_description()   { return _cur_vm_operation != NULL ? _cur_vm_operation->name() : _no_op_reason; };
 
   // Returns the single instance of VMThread.
   static VMThread* vm_thread()                    { return _vm_thread; }
--- a/hotspot/src/share/vm/runtime/vm_operations.hpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/runtime/vm_operations.hpp	Thu May 25 22:33:25 2017 +0000
@@ -106,6 +106,11 @@
   template(MarkActiveNMethods)                    \
   template(PrintCompileQueue)                     \
   template(PrintClassHierarchy)                   \
+  template(ThreadSuspend)                         \
+  template(CTWThreshold)                          \
+  template(ThreadsSuspendJVMTI)                   \
+  template(ICBufferFull)                          \
+  template(ScavengeMonitors)                      \
 
 class VM_Operation: public CHeapObj<mtInternal> {
  public:
@@ -238,20 +243,41 @@
   VMOp_Type type() const { return VMOp_ClearICs; }
 };
 
-// dummy vm op, evaluated just to force a safepoint
+// empty vm op, evaluated just to force a safepoint
 class VM_ForceSafepoint: public VM_Operation {
  public:
-  VM_ForceSafepoint() {}
   void doit()         {}
   VMOp_Type type() const { return VMOp_ForceSafepoint; }
 };
 
-// dummy vm op, evaluated just to force a safepoint
-class VM_ForceAsyncSafepoint: public VM_Operation {
+// empty vm op, when forcing a safepoint to suspend a thread
+class VM_ThreadSuspend: public VM_ForceSafepoint {
+ public:
+  VMOp_Type type() const { return VMOp_ThreadSuspend; }
+};
+
+// empty vm op, when forcing a safepoint due to ctw threshold is reached for the sweeper
+class VM_CTWThreshold: public VM_ForceSafepoint {
  public:
-  VM_ForceAsyncSafepoint() {}
-  void doit()              {}
-  VMOp_Type type() const                         { return VMOp_ForceAsyncSafepoint; }
+  VMOp_Type type() const { return VMOp_CTWThreshold; }
+};
+
+// empty vm op, when forcing a safepoint to suspend threads from jvmti
+class VM_ThreadsSuspendJVMTI: public VM_ForceSafepoint {
+ public:
+  VMOp_Type type() const { return VMOp_ThreadsSuspendJVMTI; }
+};
+
+// empty vm op, when forcing a safepoint due to inline cache buffers being full
+class VM_ICBufferFull: public VM_ForceSafepoint {
+ public:
+  VMOp_Type type() const { return VMOp_ICBufferFull; }
+};
+
+// empty asynchronous vm op, when forcing a safepoint to scavenge monitors
+class VM_ScavengeMonitors: public VM_ForceSafepoint {
+ public:
+  VMOp_Type type() const                         { return VMOp_ScavengeMonitors; }
   Mode evaluation_mode() const                   { return _async_safepoint; }
   bool is_cheap_allocated() const                { return true; }
 };
--- a/hotspot/src/share/vm/services/mallocSiteTable.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/services/mallocSiteTable.cpp	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -97,7 +97,7 @@
 
   // Instantiate hash entry for hashtable entry allocation callsite
   MallocSiteHashtableEntry* entry = ::new ((void*)_hash_entry_allocation_site)
-    MallocSiteHashtableEntry(*stack);
+    MallocSiteHashtableEntry(*stack, mtNMT);
 
   // Add the allocation site to hashtable.
   int index = hash_to_index(stack->hash());
@@ -134,14 +134,15 @@
  *  Under any of above circumstances, caller should handle the situation.
  */
 MallocSite* MallocSiteTable::lookup_or_add(const NativeCallStack& key, size_t* bucket_idx,
-  size_t* pos_idx) {
+  size_t* pos_idx, MEMFLAGS flags) {
+  assert(flags != mtNone, "Should have a real memory type");
   unsigned int index = hash_to_index(key.hash());
   *bucket_idx = (size_t)index;
   *pos_idx = 0;
 
   // First entry for this hash bucket
   if (_table[index] == NULL) {
-    MallocSiteHashtableEntry* entry = new_entry(key);
+    MallocSiteHashtableEntry* entry = new_entry(key, flags);
     // OOM check
     if (entry == NULL) return NULL;
 
@@ -156,13 +157,12 @@
   MallocSiteHashtableEntry* head = _table[index];
   while (head != NULL && (*pos_idx) <= MAX_BUCKET_LENGTH) {
     MallocSite* site = head->data();
-    if (site->equals(key)) {
-      // found matched entry
+    if (site->flags() == flags && site->equals(key)) {
       return head->data();
     }
 
     if (head->next() == NULL && (*pos_idx) < MAX_BUCKET_LENGTH) {
-      MallocSiteHashtableEntry* entry = new_entry(key);
+      MallocSiteHashtableEntry* entry = new_entry(key, flags);
       // OOM check
       if (entry == NULL) return NULL;
       if (head->atomic_insert(entry)) {
@@ -191,10 +191,10 @@
 // Allocates MallocSiteHashtableEntry object. Special call stack
 // (pre-installed allocation site) has to be used to avoid infinite
 // recursion.
-MallocSiteHashtableEntry* MallocSiteTable::new_entry(const NativeCallStack& key) {
+MallocSiteHashtableEntry* MallocSiteTable::new_entry(const NativeCallStack& key, MEMFLAGS flags) {
   void* p = AllocateHeap(sizeof(MallocSiteHashtableEntry), mtNMT,
     *hash_entry_allocation_stack(), AllocFailStrategy::RETURN_NULL);
-  return ::new (p) MallocSiteHashtableEntry(key);
+  return ::new (p) MallocSiteHashtableEntry(key, flags);
 }
 
 void MallocSiteTable::reset() {
--- a/hotspot/src/share/vm/services/mallocSiteTable.hpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/services/mallocSiteTable.hpp	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -37,12 +37,16 @@
 // MallocSite represents a code path that eventually calls
 // os::malloc() to allocate memory
 class MallocSite : public AllocationSite<MemoryCounter> {
+ private:
+  MEMFLAGS _flags;
+
  public:
   MallocSite() :
-    AllocationSite<MemoryCounter>(NativeCallStack::EMPTY_STACK) { }
+    AllocationSite<MemoryCounter>(NativeCallStack::EMPTY_STACK), _flags(mtNone) {}
 
-  MallocSite(const NativeCallStack& stack) :
-    AllocationSite<MemoryCounter>(stack) { }
+  MallocSite(const NativeCallStack& stack, MEMFLAGS flags) :
+    AllocationSite<MemoryCounter>(stack), _flags(flags) {}
+
 
   void allocate(size_t size)      { data()->allocate(size);   }
   void deallocate(size_t size)    { data()->deallocate(size); }
@@ -51,6 +55,7 @@
   size_t size()  const { return peek()->size(); }
   // The number of calls were made
   size_t count() const { return peek()->count(); }
+  MEMFLAGS flags() const  { return (MEMFLAGS)_flags; }
 };
 
 // Malloc site hashtable entry
@@ -62,8 +67,10 @@
  public:
   MallocSiteHashtableEntry() : _next(NULL) { }
 
-  MallocSiteHashtableEntry(const NativeCallStack& stack):
-    _malloc_site(stack), _next(NULL) { }
+  MallocSiteHashtableEntry(NativeCallStack stack, MEMFLAGS flags):
+    _malloc_site(stack, flags), _next(NULL) {
+    assert(flags != mtNone, "Expect a real memory type");
+  }
 
   inline const MallocSiteHashtableEntry* next() const {
     return _next;
@@ -198,11 +205,11 @@
   //  1. out of memory
   //  2. overflow hash bucket
   static inline bool allocation_at(const NativeCallStack& stack, size_t size,
-    size_t* bucket_idx, size_t* pos_idx) {
+    size_t* bucket_idx, size_t* pos_idx, MEMFLAGS flags) {
     AccessLock locker(&_access_count);
     if (locker.sharedLock()) {
       NOT_PRODUCT(_peak_count = MAX2(_peak_count, _access_count);)
-      MallocSite* site = lookup_or_add(stack, bucket_idx, pos_idx);
+      MallocSite* site = lookup_or_add(stack, bucket_idx, pos_idx, flags);
       if (site != NULL) site->allocate(size);
       return site != NULL;
     }
@@ -228,13 +235,13 @@
   static bool walk_malloc_site(MallocSiteWalker* walker);
 
  private:
-  static MallocSiteHashtableEntry* new_entry(const NativeCallStack& key);
+  static MallocSiteHashtableEntry* new_entry(const NativeCallStack& key, MEMFLAGS flags);
   static void reset();
 
   // Delete a bucket linked list
   static void delete_linked_list(MallocSiteHashtableEntry* head);
 
-  static MallocSite* lookup_or_add(const NativeCallStack& key, size_t* bucket_idx, size_t* pos_idx);
+  static MallocSite* lookup_or_add(const NativeCallStack& key, size_t* bucket_idx, size_t* pos_idx, MEMFLAGS flags);
   static MallocSite* malloc_site(size_t bucket_idx, size_t pos_idx);
   static bool walk(MallocSiteWalker* walker);
 
--- a/hotspot/src/share/vm/services/mallocTracker.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/services/mallocTracker.cpp	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -77,8 +77,8 @@
 }
 
 bool MallocHeader::record_malloc_site(const NativeCallStack& stack, size_t size,
-  size_t* bucket_idx, size_t* pos_idx) const {
-  bool ret =  MallocSiteTable::allocation_at(stack, size, bucket_idx, pos_idx);
+  size_t* bucket_idx, size_t* pos_idx, MEMFLAGS flags) const {
+  bool ret = MallocSiteTable::allocation_at(stack, size, bucket_idx, pos_idx, flags);
 
   // Something went wrong, could be OOM or overflow malloc site table.
   // We want to keep tracking data under OOM circumstance, so transition to
--- a/hotspot/src/share/vm/services/mallocTracker.hpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/services/mallocTracker.hpp	Thu May 25 22:33:25 2017 +0000
@@ -275,7 +275,7 @@
     if (level == NMT_detail) {
       size_t bucket_idx;
       size_t pos_idx;
-      if (record_malloc_site(stack, size, &bucket_idx, &pos_idx)) {
+      if (record_malloc_site(stack, size, &bucket_idx, &pos_idx, flags)) {
         assert(bucket_idx <= MAX_MALLOCSITE_TABLE_SIZE, "Overflow bucket index");
         assert(pos_idx <= MAX_BUCKET_LENGTH, "Overflow bucket position index");
         _bucket_idx = bucket_idx;
@@ -299,7 +299,7 @@
     _size = size;
   }
   bool record_malloc_site(const NativeCallStack& stack, size_t size,
-    size_t* bucket_idx, size_t* pos_idx) const;
+    size_t* bucket_idx, size_t* pos_idx, MEMFLAGS flags) const;
 };
 
 
--- a/hotspot/src/share/vm/services/memReporter.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/services/memReporter.cpp	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -43,11 +43,16 @@
     amount_in_current_scale(reserved), scale, amount_in_current_scale(committed), scale);
 }
 
-void MemReporterBase::print_malloc(size_t amount, size_t count) const {
+void MemReporterBase::print_malloc(size_t amount, size_t count, MEMFLAGS flag) const {
   const char* scale = current_scale();
   outputStream* out = output();
-  out->print("(malloc=" SIZE_FORMAT "%s",
-    amount_in_current_scale(amount), scale);
+  if (flag != mtNone) {
+    out->print("(malloc=" SIZE_FORMAT "%s type=%s",
+      amount_in_current_scale(amount), scale, NMTUtil::flag_to_name(flag));
+  } else {
+    out->print("(malloc=" SIZE_FORMAT "%s",
+      amount_in_current_scale(amount), scale);
+  }
 
   if (count > 0) {
     out->print(" #" SIZE_FORMAT "", count);
@@ -200,7 +205,10 @@
     const NativeCallStack* stack = malloc_site->call_stack();
     stack->print_on(out);
     out->print("%29s", " ");
-    print_malloc(malloc_site->size(), malloc_site->count());
+    MEMFLAGS flag = malloc_site->flags();
+    assert((flag >= 0 && flag < (int)mt_number_of_types) && flag != mtNone,
+      "Must have a valid memory type");
+    print_malloc(malloc_site->size(), malloc_site->count(),flag);
     out->print_cr("\n");
   }
 }
--- a/hotspot/src/share/vm/services/memReporter.hpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/services/memReporter.hpp	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -76,7 +76,7 @@
 
   // Print summary total, malloc and virtual memory
   void print_total(size_t reserved, size_t committed) const;
-  void print_malloc(size_t amount, size_t count) const;
+  void print_malloc(size_t amount, size_t count, MEMFLAGS flag = mtNone) const;
   void print_virtual_memory(size_t reserved, size_t committed) const;
 
   void print_malloc_line(size_t amount, size_t count) const;
--- a/hotspot/src/share/vm/utilities/hashtable.cpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/utilities/hashtable.cpp	Thu May 25 22:33:25 2017 +0000
@@ -159,6 +159,35 @@
   }
 }
 
+template <MEMFLAGS F> void BasicHashtable<F>::BucketUnlinkContext::free_entry(BasicHashtableEntry<F>* entry) {
+  entry->set_next(_removed_head);
+  _removed_head = entry;
+  if (_removed_tail == NULL) {
+    _removed_tail = entry;
+  }
+  _num_removed++;
+}
+
+template <MEMFLAGS F> void BasicHashtable<F>::bulk_free_entries(BucketUnlinkContext* context) {
+  if (context->_num_removed == 0) {
+    assert(context->_removed_head == NULL && context->_removed_tail == NULL,
+           "Zero entries in the unlink context, but elements linked from " PTR_FORMAT " to " PTR_FORMAT,
+           p2i(context->_removed_head), p2i(context->_removed_tail));
+    return;
+  }
+
+  // MT-safe add of the list of BasicHashTableEntrys from the context to the free list.
+  BasicHashtableEntry<F>* current = _free_list;
+  while (true) {
+    context->_removed_tail->set_next(current);
+    BasicHashtableEntry<F>* old = (BasicHashtableEntry<F>*)Atomic::cmpxchg_ptr(context->_removed_head, &_free_list, current);
+    if (old == current) {
+      break;
+    }
+    current = old;
+  }
+  Atomic::add(-context->_num_removed, &_number_of_entries);
+}
 
 // Copy the table to the shared space.
 
@@ -192,7 +221,6 @@
   }
 }
 
-
 template <class T, MEMFLAGS F> int RehashableHashtable<T, F>::literal_size(Symbol *symbol) {
   return symbol->size() * HeapWordSize;
 }
--- a/hotspot/src/share/vm/utilities/hashtable.hpp	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/src/share/vm/utilities/hashtable.hpp	Thu May 25 22:33:25 2017 +0000
@@ -162,11 +162,11 @@
   // Instance variables
   int               _table_size;
   HashtableBucket<F>*     _buckets;
-  BasicHashtableEntry<F>* _free_list;
+  BasicHashtableEntry<F>* volatile _free_list;
   char*             _first_free_entry;
   char*             _end_block;
   int               _entry_size;
-  int               _number_of_entries;
+  volatile int      _number_of_entries;
 
 protected:
 
@@ -211,6 +211,24 @@
   // Free the buckets in this hashtable
   void free_buckets();
 
+  // Helper data structure containing context for the bucket entry unlink process,
+  // storing the unlinked buckets in a linked list.
+  // Also avoids the need to pass around these four members as parameters everywhere.
+  struct BucketUnlinkContext {
+    int _num_processed;
+    int _num_removed;
+    // Head and tail pointers for the linked list of removed entries.
+    BasicHashtableEntry<F>* _removed_head;
+    BasicHashtableEntry<F>* _removed_tail;
+
+    BucketUnlinkContext() : _num_processed(0), _num_removed(0), _removed_head(NULL), _removed_tail(NULL) {
+    }
+
+    void free_entry(BasicHashtableEntry<F>* entry);
+  };
+  // Add of bucket entries linked together in the given context to the global free list. This method
+  // is mt-safe wrt. to other calls of this method.
+  void bulk_free_entries(BucketUnlinkContext* context);
 public:
   int table_size() { return _table_size; }
   void set_entry(int index, BasicHashtableEntry<F>* entry);
--- a/hotspot/test/gc/arguments/TestDynMaxHeapFreeRatio.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/gc/arguments/TestDynMaxHeapFreeRatio.java	Thu May 25 22:33:25 2017 +0000
@@ -24,7 +24,7 @@
 import static jdk.test.lib.Asserts.assertEQ;
 import static jdk.test.lib.Asserts.assertFalse;
 import static jdk.test.lib.Asserts.assertTrue;
-import jdk.test.lib.DynamicVMOption;
+import jdk.test.lib.management.DynamicVMOption;
 
 /**
  * @test TestDynMaxHeapFreeRatio
--- a/hotspot/test/gc/arguments/TestDynMinHeapFreeRatio.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/gc/arguments/TestDynMinHeapFreeRatio.java	Thu May 25 22:33:25 2017 +0000
@@ -38,7 +38,7 @@
 import static jdk.test.lib.Asserts.assertEQ;
 import static jdk.test.lib.Asserts.assertFalse;
 import static jdk.test.lib.Asserts.assertTrue;
-import jdk.test.lib.DynamicVMOption;
+import jdk.test.lib.management.DynamicVMOption;
 
 public class TestDynMinHeapFreeRatio {
 
--- a/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java	Thu May 25 22:33:25 2017 +0000
@@ -26,7 +26,7 @@
 import java.util.ArrayList;
 
 import jdk.test.lib.ByteCodeLoader;
-import jdk.test.lib.InMemoryJavaCompiler;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.test.lib.Platform;
 
 import sun.management.ManagementFactoryHelper;
--- a/hotspot/test/gc/parallel/TestDynShrinkHeap.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/gc/parallel/TestDynShrinkHeap.java	Thu May 25 22:33:25 2017 +0000
@@ -31,7 +31,7 @@
  * @library /test/lib /
  * @run main/othervm -XX:+UseAdaptiveSizePolicyWithSystemGC -XX:+UseParallelGC -XX:MinHeapFreeRatio=0 -XX:MaxHeapFreeRatio=100 -Xmx1g -verbose:gc TestDynShrinkHeap
  */
-import jdk.test.lib.DynamicVMOption;
+import jdk.test.lib.management.DynamicVMOption;
 import java.lang.management.ManagementFactory;
 import java.lang.management.MemoryUsage;
 import java.util.ArrayList;
--- a/hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java	Thu May 25 22:33:25 2017 +0000
@@ -31,7 +31,7 @@
  * @run main BootstrapRedefine
  */
 
-import jdk.test.lib.InMemoryJavaCompiler;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
 
--- a/hotspot/test/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java	Thu May 25 22:33:25 2017 +0000
@@ -34,7 +34,7 @@
  */
 
 import jdk.test.lib.Asserts;
-import jdk.test.lib.DynamicVMOption;
+import jdk.test.lib.management.DynamicVMOption;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.dcmd.PidJcmdExecutor;
--- a/hotspot/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java	Thu May 25 22:33:25 2017 +0000
@@ -29,7 +29,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import jdk.test.lib.DynamicVMOption;
+import jdk.test.lib.management.DynamicVMOption;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.dcmd.CommandExecutor;
@@ -383,7 +383,11 @@
             runJava.add(VMType);
         }
 
-        if (GCType != null) {
+        if (GCType != null &&
+            !(prepend.contains("-XX:+UseConcMarkSweepGC") ||
+              prepend.contains("-XX:+UseSerialGC") ||
+              prepend.contains("-XX:+UseParallelGC") ||
+              prepend.contains("-XX:+UseG1GC"))) {
             runJava.add(GCType);
         }
 
--- a/hotspot/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java	Thu May 25 22:33:25 2017 +0000
@@ -242,6 +242,9 @@
                 option.addPrepend("-XX:SharedArchiveFile=TestOptionsWithRanges.jsa");
                 option.addPrepend("-Xshare:dump");
                 break;
+            case "TLABWasteIncrement":
+                option.addPrepend("-XX:+UseParallelGC");
+                break;
             default:
                 /* Do nothing */
                 break;
--- a/hotspot/test/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java	Thu May 25 22:33:25 2017 +0000
@@ -51,7 +51,7 @@
 import java.util.Properties;
 import java.util.Set;
 import jdk.test.lib.Asserts;
-import jdk.test.lib.DynamicVMOption;
+import jdk.test.lib.management.DynamicVMOption;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 
--- a/hotspot/test/runtime/RedefineTests/ModifyAnonymous.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/RedefineTests/ModifyAnonymous.java	Thu May 25 22:33:25 2017 +0000
@@ -34,15 +34,14 @@
 
 import java.io.FileNotFoundException;
 import java.io.PrintWriter;
-import java.lang.NoSuchFieldException;
-import java.lang.NoSuchMethodException;
 import java.lang.RuntimeException;
 import java.lang.instrument.ClassDefinition;
 import java.lang.instrument.ClassFileTransformer;
 import java.lang.instrument.IllegalClassFormatException;
 import java.lang.instrument.Instrumentation;
 import java.security.ProtectionDomain;
-import jdk.test.lib.*;
+
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 
 public class ModifyAnonymous {
 
--- a/hotspot/test/runtime/SharedArchiveFile/DumpSymbolAndStringTable.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/SharedArchiveFile/DumpSymbolAndStringTable.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -30,7 +30,7 @@
  *          java.management
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions DumpSymbolAndStringTable
  */
-
+import jdk.test.lib.cds.CDSTestUtils;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.JDKToolFinder;
@@ -42,7 +42,7 @@
 
         ProcessBuilder pb = new ProcessBuilder();
         pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), pid, "VM.symboltable", "-verbose"});
-        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        OutputAnalyzer output = CDSTestUtils.executeAndLog(pb, "jcmd-symboltable");
         try {
             output.shouldContain("24 2: DumpSymbolAndStringTable\n");
         } catch (RuntimeException e) {
@@ -50,7 +50,7 @@
         }
 
         pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), pid, "VM.stringtable", "-verbose"});
-        output = new OutputAnalyzer(pb.start());
+        output = CDSTestUtils.executeAndLog(pb, "jcmd-stringtable");
         try {
             output.shouldContain("16: java.lang.String\n");
         } catch (RuntimeException e) {
--- a/hotspot/test/runtime/SharedArchiveFile/LargeSharedSpace.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/SharedArchiveFile/LargeSharedSpace.java	Thu May 25 22:33:25 2017 +0000
@@ -40,7 +40,6 @@
 
 public class LargeSharedSpace {
     public static void main(String[] args) throws Exception {
-       ProcessBuilder pb;
        OutputAnalyzer output;
 
        // Test case 1: -XX:SharedMiscCodeSize=1066924031
--- a/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -31,6 +31,7 @@
  * @run main LimitSharedSizes
  */
 
+import jdk.test.lib.cds.CDSTestUtils;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.Platform;
@@ -150,7 +151,7 @@
                option,
                "-Xshare:dump");
 
-            OutputAnalyzer output = new OutputAnalyzer(pb.start());
+            OutputAnalyzer output = CDSTestUtils.executeAndLog(pb, "dump" + counter);
 
             switch (td.getResult()) {
                 case VALID:
@@ -167,22 +168,14 @@
                          "-XX:+PrintSharedArchiveAndExit",
                          "-version");
 
-                      try {
-                          output = new OutputAnalyzer(pb.start());
-                          output.shouldContain("archive is valid");
-                      } catch (RuntimeException e) {
-                          // if sharing failed due to ASLR or similar reasons,
-                          // check whether sharing was attempted at all (UseSharedSpaces)
-                          if ((output.getOutput().contains("Unable to use shared archive") ||
-                               output.getOutput().contains("Unable to map ReadOnly shared space at required address.") ||
-                               output.getOutput().contains("Unable to map ReadWrite shared space at required address.") ||
-                               output.getOutput().contains("Unable to reserve shared space at required address")) &&
-                               output.getExitValue() == 1) {
-                               System.out.println("Unable to use shared archive: test not executed; assumed passed");
-                               continue;
-                          }
+                      output = CDSTestUtils.executeAndLog(pb, "use" + counter);
+                      if(CDSTestUtils.isUnableToMap(output)) {
+                          System.out.println("Unable to use shared archive: " +
+                                             "test not executed; assumed passed");
+                          continue;
+                      } else {
+                          output.shouldHaveExitValue(0);
                       }
-                      output.shouldHaveExitValue(0);
                   }
                 }
                 break;
--- a/hotspot/test/runtime/SharedArchiveFile/MaxMetaspaceSize.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/SharedArchiveFile/MaxMetaspaceSize.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -30,15 +30,16 @@
  *          java.management
  */
 
+import jdk.test.lib.cds.CDSTestUtils;
 import jdk.test.lib.process.ProcessTools;
-import jdk.test.lib.process.OutputAnalyzer;
 
 public class MaxMetaspaceSize {
   public static void main(String[] args) throws Exception {
+      String msg = "is not large enough.\n" +
+          "Either don't specify the -XX:MaxMetaspaceSize=<size>\n" +
+          "or increase the size to at least";
     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
         "-XX:MaxMetaspaceSize=10m", "-Xshare:dump");
-    OutputAnalyzer output = new OutputAnalyzer(pb.start());
-      output.shouldContain("is not large enough.\nEither don't specify the -XX:MaxMetaspaceSize=<size>\nor increase the size to at least");
-      output.shouldHaveExitValue(2);
+    CDSTestUtils.executeAndLog(pb, "dump").shouldContain(msg).shouldHaveExitValue(2);
   }
 }
--- a/hotspot/test/runtime/SharedArchiveFile/SASymbolTableTest.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/SharedArchiveFile/SASymbolTableTest.java	Thu May 25 22:33:25 2017 +0000
@@ -95,17 +95,11 @@
                     "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.tools=ALL-UNNAMED",
                     "SASymbolTableTestAgent",
                     Long.toString(pid));
-            OutputAnalyzer output = ProcessTools.executeProcess(tool);
-            System.out.println("STDOUT[");
-            System.out.println(output.getOutput());
+            OutputAnalyzer output = CDSTestUtils.executeAndLog(tool, "tool");
             if (output.getStdout().contains("connected too early")) {
                 System.out.println("SymbolTable not created by VM - test skipped");
                 return;
             }
-            System.out.println("]");
-            System.out.println("STDERR[");
-            System.out.print(output.getStderr());
-            System.out.println("]");
             output.shouldHaveExitValue(0);
         } catch (Exception ex) {
             throw new RuntimeException("Test ERROR " + ex, ex);
--- a/hotspot/test/runtime/Unsafe/DefineClass.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/Unsafe/DefineClass.java	Thu May 25 22:33:25 2017 +0000
@@ -32,8 +32,8 @@
  */
 
 import java.security.ProtectionDomain;
-import java.io.InputStream;
-import jdk.test.lib.InMemoryJavaCompiler;
+
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.internal.misc.Unsafe;
 import static jdk.test.lib.Asserts.*;
 
--- a/hotspot/test/runtime/Unsafe/NestedUnsafe.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/Unsafe/NestedUnsafe.java	Thu May 25 22:33:25 2017 +0000
@@ -31,12 +31,9 @@
  * @run main NestedUnsafe
  */
 
-import java.security.ProtectionDomain;
-import java.io.InputStream;
 import java.lang.*;
-import jdk.test.lib.InMemoryJavaCompiler;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.internal.misc.Unsafe;
-import static jdk.test.lib.Asserts.*;
 
 // package p;
 
--- a/hotspot/test/runtime/defineAnonClass/NestedUnsafe.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/defineAnonClass/NestedUnsafe.java	Thu May 25 22:33:25 2017 +0000
@@ -34,11 +34,10 @@
 
 package p;
 
-import java.security.ProtectionDomain;
-import java.io.InputStream;
 import java.lang.*;
-import jdk.test.lib.*;
+
 import jdk.internal.misc.Unsafe;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 
 
 // Test that an anonymous class in package 'p' cannot define its own anonymous class
--- a/hotspot/test/runtime/defineAnonClass/NestedUnsafe2.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/defineAnonClass/NestedUnsafe2.java	Thu May 25 22:33:25 2017 +0000
@@ -34,11 +34,10 @@
 
 package p;
 
-import java.security.ProtectionDomain;
-import java.io.InputStream;
 import java.lang.*;
-import jdk.test.lib.*;
+
 import jdk.internal.misc.Unsafe;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 
 
 // Test that an anonymous class that gets put in its host's package cannot define
--- a/hotspot/test/runtime/getSysPackage/GetSysPkgTest.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/getSysPackage/GetSysPkgTest.java	Thu May 25 22:33:25 2017 +0000
@@ -33,7 +33,7 @@
 import java.io.File;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import jdk.test.lib.InMemoryJavaCompiler;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
 
--- a/hotspot/test/runtime/modules/ModuleStress/ModuleStress.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/modules/ModuleStress/ModuleStress.java	Thu May 25 22:33:25 2017 +0000
@@ -38,8 +38,7 @@
 
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
-import jdk.test.lib.InMemoryJavaCompiler;
-import java.io.File;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 
 public class ModuleStress {
 
--- a/hotspot/test/runtime/modules/PatchModule/PatchModule2Dirs.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/modules/PatchModule/PatchModule2Dirs.java	Thu May 25 22:33:25 2017 +0000
@@ -30,10 +30,9 @@
  * @run main PatchModule2Dirs
  */
 
-import jdk.test.lib.InMemoryJavaCompiler;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
-import java.io.File;
 
 public class PatchModule2Dirs {
 
--- a/hotspot/test/runtime/modules/PatchModule/PatchModuleCDS.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleCDS.java	Thu May 25 22:33:25 2017 +0000
@@ -31,8 +31,7 @@
  * @run main PatchModuleCDS
  */
 
-import java.io.File;
-import jdk.test.lib.InMemoryJavaCompiler;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 
--- a/hotspot/test/runtime/modules/PatchModule/PatchModuleClassList.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleClassList.java	Thu May 25 22:33:25 2017 +0000
@@ -33,7 +33,7 @@
 
 import java.nio.file.Files;
 import java.nio.file.Paths;
-import jdk.test.lib.InMemoryJavaCompiler;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 
--- a/hotspot/test/runtime/modules/PatchModule/PatchModuleJavaBase.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleJavaBase.java	Thu May 25 22:33:25 2017 +0000
@@ -31,7 +31,7 @@
  * @run main PatchModuleJavaBase
  */
 
-import jdk.test.lib.InMemoryJavaCompiler;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 
--- a/hotspot/test/runtime/modules/PatchModule/PatchModuleTest.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleTest.java	Thu May 25 22:33:25 2017 +0000
@@ -31,7 +31,7 @@
  * @run main PatchModuleTest
  */
 
-import jdk.test.lib.InMemoryJavaCompiler;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 
--- a/hotspot/test/runtime/modules/PatchModule/PatchModuleTestJar.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleTestJar.java	Thu May 25 22:33:25 2017 +0000
@@ -31,7 +31,7 @@
  * @run main PatchModuleTestJar
  */
 
-import jdk.test.lib.InMemoryJavaCompiler;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 
--- a/hotspot/test/runtime/modules/PatchModule/PatchModuleTestJarDir.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleTestJarDir.java	Thu May 25 22:33:25 2017 +0000
@@ -32,8 +32,8 @@
  */
 
 import java.io.File;
-import java.nio.file.Files;
-import jdk.test.lib.InMemoryJavaCompiler;
+
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 
--- a/hotspot/test/runtime/modules/PatchModule/PatchModuleTraceCL.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleTraceCL.java	Thu May 25 22:33:25 2017 +0000
@@ -32,8 +32,7 @@
  * @run main PatchModuleTraceCL
  */
 
-import java.io.File;
-import jdk.test.lib.InMemoryJavaCompiler;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 
--- a/hotspot/test/runtime/modules/Visibility/PatchModuleVisibility.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/modules/Visibility/PatchModuleVisibility.java	Thu May 25 22:33:25 2017 +0000
@@ -36,7 +36,7 @@
 import java.nio.file.Files;
 import java.nio.file.Paths;
 
-import jdk.test.lib.InMemoryJavaCompiler;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 
--- a/hotspot/test/runtime/modules/Visibility/XbootcpNoVisibility.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/modules/Visibility/XbootcpNoVisibility.java	Thu May 25 22:33:25 2017 +0000
@@ -31,7 +31,7 @@
  * @run main/othervm XbootcpNoVisibility
  */
 
-import jdk.test.lib.InMemoryJavaCompiler;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
 
--- a/hotspot/test/runtime/modules/Visibility/XbootcpVisibility.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/modules/Visibility/XbootcpVisibility.java	Thu May 25 22:33:25 2017 +0000
@@ -36,7 +36,7 @@
 import java.nio.file.Files;
 import java.nio.file.Paths;
 
-import jdk.test.lib.InMemoryJavaCompiler;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 
--- a/hotspot/test/runtime/noClassDefFoundMsg/NoClassDefFoundMsg.java	Thu May 25 15:27:40 2017 -0700
+++ b/hotspot/test/runtime/noClassDefFoundMsg/NoClassDefFoundMsg.java	Thu May 25 22:33:25 2017 +0000
@@ -31,7 +31,7 @@
  * @run main/native NoClassDefFoundMsg
  */
 
-import jdk.test.lib.InMemoryJavaCompiler;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.internal.misc.Unsafe;
 
 public class NoClassDefFoundMsg {
--- a/jaxp/.hgtags	Thu May 25 15:27:40 2017 -0700
+++ b/jaxp/.hgtags	Thu May 25 22:33:25 2017 +0000
@@ -419,3 +419,6 @@
 646567dcfa64b9a39b33d71330427737d1c1a0d5 jdk-9+167
 23a87f409371fb8ce7b764cccb3a74c3f6b29900 jdk-9+168
 5d9d2a65fb26aa183019346c11d9314819621665 jdk-9+169
+6e78f902f477a093afca85a1042f97410d01eb69 jdk-9+170
+09cae4c36242734f5450de739b8264523a030809 jdk-10+7
+856998840907b67b7e1fc49259f785ac085a189b jdk-10+8
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/FeatureState.java	Thu May 25 15:27:40 2017 -0700
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/FeatureState.java	Thu May 25 22:33:25 2017 +0000
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2010, 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 +23,6 @@
  * questions.
  */
 
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-/*
- * $Id: FeatureState.java 3024 2011-03-01 03:46:13Z joehw $
- */
-
 package com.sun.org.apache.xerces.internal.util;
 
 public class FeatureState {
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/ParserConfigurationSettings.java	Thu May 25 15:27:40 2017 -0700
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/ParserConfigurationSettings.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/PropertyState.java	Thu May 25 15:27:40 2017 -0700
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/PropertyState.java	Thu May 25 22:33:25 2017 +0000
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2010, 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,13 +23,6 @@
  * questions.
  */
 
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-/*
- * $Id: PropertyState.java 3024 2011-03-01 03:46:13Z joehw $
- */
 package com.sun.org.apache.xerces.internal.util;
 
 public class PropertyState {
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/Status.java	Thu May 25 15:27:40 2017 -0700
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/Status.java	Thu May 25 22:33:25 2017 +0000
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2010, 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,13 +23,6 @@
  * questions.
  */
 
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-/*
- * $Id: Status.java 3024 2011-03-01 03:46:13Z joehw $
- */
 package com.sun.org.apache.xerces.internal.util;
 
 public enum Status {
--- a/jaxp/src/java.xml/share/classes/com/sun/xml/internal/stream/dtd/nonvalidating/XMLSimpleType.java	Thu May 25 15:27:40 2017 -0700
+++ b/jaxp/src/java.xml/share/classes/com/sun/xml/internal/stream/dtd/nonvalidating/XMLSimpleType.java	Thu May 25 22:33:25 2017 +0000
@@ -1,32 +1,21 @@
 /*
  * Copyright (c) 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).
+ */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * 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.
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
- * 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 WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- */
-
-/*
- * Copyright 2005 The Apache Software Foundation.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package com.sun.xml.internal.stream.dtd.nonvalidating;
--- a/jaxp/src/java.xml/share/classes/javax/xml/transform/stax/package.html	Thu May 25 15:27:40 2017 -0700
+++ b/jaxp/src/java.xml/share/classes/javax/xml/transform/stax/package.html	Thu May 25 22:33:25 2017 +0000
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-
-Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2005, 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
@@ -23,48 +22,45 @@
 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. 
-
 -->
 
 <!DOCTYPE html
-     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
 <html xmlns="http://www.w3.org/1999/xhtml">
-	<head>
-		<title>javax.xml.transform.stax</title>
-
-		<meta name="CVS"
-			content="$Id: package.html,v 1.2 2005/11/03 19:34:28 jeffsuttor Exp $" />
-		<meta name="AUTHOR"
-			content="Jeff.Suttor@Sun.com" />
-		<meta name="AUTHOR"
-			content="Neeraj.Bajaj@Sun.com" />
-	</head>
-	<body>
-		<p>
-			Provides for StAX-specific transformation APIs.
-			TODO: better description(s).
-		</p>
+    <head>
+        <title>javax.xml.transform.stax</title>
 
-		<h2>Package Specification</h2>
-		<ul>
-			<li><a href="http://jcp.org/en/jsr/detail?id=173">JSR 173: Streaming API for XML</a></li>
-		</ul>
-
-		<h2>Related Documentation</h2>
+        <meta name="CVS"
+              content="$Id: package.html,v 1.2 2005/11/03 19:34:28 jeffsuttor Exp $" />
+        <meta name="AUTHOR"
+              content="Jeff.Suttor@Sun.com" />
+        <meta name="AUTHOR"
+              content="Neeraj.Bajaj@Sun.com" />
+    </head>
+    <body>
+        <p>
+            This package implements StAX-specific transformation APIs. It provides
+            classes which allow input from a StAX reader, that is, 
+            {@link javax.xml.stream.XMLStreamReader} or {@link javax.xml.stream.XMLEventReader}, 
+            and output to a StAX writer, that is, 
+            {@link javax.xml.stream.XMLStreamWriter} or {@link javax.xml.stream.XMLEventWriter}.
+        </p>
+        <p>
+            The {@link javax.xml.transform.stax.StAXSource} class encapsulates a 
+            {@link javax.xml.stream.XMLStreamReader} or {@link javax.xml.stream.XMLEventReader} 
+            and can be used as an input where a {@link javax.xml.transform.Source}
+            object is accepted.
+        </p>
+        <p>
+            The {@link javax.xml.transform.stax.StAXResult} class encapsulates a 
+            {@link javax.xml.stream.XMLStreamWriter} or {@link javax.xml.stream.XMLEventWriter} 
+            and can be used as an output where a {@link javax.xml.transform.Result}
+            object is accepted.
+        </p>
 
-		<p>For overviews, tutorials, examples, guides, and tool documentation, please see:</p>
-		<ul>
-			<li><a href="">TODO: Refer to non-spec documentation</a></li>
-		</ul>
+        @since 1.6
+    </body>
+</html>
 
-		<!-- Put @see and @since tags down here. -->
-		<ul>
-			<li>@see XMLStreamReader</li>
-			<li>@see XMLEventReader</li>
-		</ul>
-		
-		@since 1.6
-	</body>
-</html>
--- a/jaxws/.hgtags	Thu May 25 15:27:40 2017 -0700
+++ b/jaxws/.hgtags	Thu May 25 22:33:25 2017 +0000
@@ -422,3 +422,6 @@
 1c610f1b4097c64cdd722a7fb59f5a4d9cc15ca9 jdk-9+167
 2746716dcc5a8c28ccf41df0c8fb620b1a1e7098 jdk-9+168
 912cf69806d518c5af7fba30b340c4cb5458dd22 jdk-9+169
+e75d3abe579a7b39b762fc0a1a337c49eb072d82 jdk-9+170
+b0efae7df1dfa14926058baebaf999e4268c955c jdk-10+7
+e705867d9989d00e4357f66f18b302c95e13b5e7 jdk-10+8
--- a/jdk/.hgtags	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/.hgtags	Thu May 25 22:33:25 2017 +0000
@@ -419,3 +419,6 @@
 7828aedcb525df40b7c8122bcc3f997c75ebaf7f jdk-9+167
 e78da9db6299b3fcba49300d52e2359e82fdd218 jdk-9+168
 177436a54ca13730ffc725a6e5dbfcd9486f3da3 jdk-9+169
+ef9954f6896bb0b95ac62bf769f68b59a7a56ccd jdk-9+170
+cbd65760a005766610583949b3b5c9ace92e74b3 jdk-10+7
+f0adc10ed8316e6cf316e3208c5ecf6835d22bc4 jdk-10+8
--- a/jdk/make/CompileDemos.gmk	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/make/CompileDemos.gmk	Thu May 25 22:33:25 2017 +0000
@@ -291,9 +291,21 @@
 
 ################################################################################
 
+ifneq ($(filter images, $(MAKECMDGOALS)), )
+  $(eval $(call SetupCopyFiles, COPY_TO_TEST_IMAGE, \
+      SRC := $(SUPPORT_OUTPUTDIR)/demos/image, \
+      DEST := $(TEST_IMAGE_DIR)/jdk/demos, \
+      FILES := $(call DoubleDollar, $(call CacheFind, $(SUPPORT_OUTPUTDIR)/demos/image)), \
+  ))
+
+  IMAGES_TARGETS := $(COPY_TO_TEST_IMAGE)
+endif
+
+################################################################################
 # Hook to include the corresponding custom file, if present.
 $(eval $(call IncludeCustomExtension, jdk, CompileDemos.gmk))
 
 all: $(TARGETS)
+images: $(IMAGES_TARGETS)
 
 .PHONY: all
--- a/jdk/make/CompileModuleTools.gmk	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/make/CompileModuleTools.gmk	Thu May 25 22:33:25 2017 +0000
@@ -23,21 +23,33 @@
 # questions.
 #
 
+default: all
+
 include $(SPEC)
 include MakeBase.gmk
 include JavaCompilation.gmk
 include SetupJavaCompilers.gmk
 
+################################################################################
+
 TOOLS_CLASSES_DIR := $(BUILDTOOLS_OUTPUTDIR)/tools_jigsaw_classes
 
 $(eval $(call SetupJavaCompilation,BUILD_JIGSAW_TOOLS, \
     SETUP := GENERATE_USINGJDKBYTECODE, \
     SRC := $(JDK_TOPDIR)/make/src/classes, \
     INCLUDES := build/tools/deps \
+                build/tools/docs \
                 build/tools/jigsaw, \
+    COPY := .properties .html, \
     BIN := $(TOOLS_CLASSES_DIR), \
     ADD_JAVAC_FLAGS := \
         --add-modules jdk.jdeps \
         --add-exports java.base/jdk.internal.module=ALL-UNNAMED \
         --add-exports jdk.jdeps/com.sun.tools.jdeps=ALL-UNNAMED \
 ))
+
+TARGETS += $(BUILD_JIGSAW_TOOLS)
+
+################################################################################
+
+all: $(TARGETS)
--- a/jdk/make/CompileTools.gmk	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/make/CompileTools.gmk	Thu May 25 22:33:25 2017 +0000
@@ -46,6 +46,7 @@
     SETUP := GENERATE_OLDBYTECODE, \
     SRC := $(BUILD_TOOLS_SRC_DIRS), \
     EXCLUDES := build/tools/deps \
+                build/tools/docs \
                 build/tools/jigsaw, \
     BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes))
 
--- a/jdk/make/ModuleTools.gmk	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/make/ModuleTools.gmk	Thu May 25 22:33:25 2017 +0000
@@ -49,4 +49,7 @@
     --add-exports java.base/jdk.internal.module=ALL-UNNAMED \
     build.tools.jigsaw.AddPackagesAttribute
 
+TOOL_GEN_DOCS_BUNDLE_PAGE := $(BUILD_JAVA) -esa -ea -cp $(TOOLS_CLASSES_DIR) \
+    build.tools.docs.GenDocsBundlePage
+
 endif # _MODULE_TOOLS_GMK
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/src/classes/build/tools/docs/GenDocsBundlePage.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,186 @@
+/*
+ * 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 build.tools.docs;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.lang.module.ModuleFinder;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * Build tool to generate the docs bundle index page.
+ */
+public class GenDocsBundlePage {
+    private static String DOCS_BUNDLE_PAGE = "docs-bundle-page.html";
+    private static String MODULE_GROUPS_PROPS = "docs-module-groups.properties";
+
+    private static String USAGE =
+        "GenDocsBundlePage --output <file path> --title <title>" +
+        "                  [--template <template>]";
+
+    public static void main(String... args) throws IOException {
+        String title = null;
+        Path outputfile = null;
+        Path template = null;
+        for (int i=0; i < args.length; i++) {
+            String option = args[i];
+            if (option.equals("--output")) {
+                outputfile = Paths.get(getArgument(args, option, ++i));
+            } else if (option.equals("--title")) {
+                title = getArgument(args, option, ++i);
+            } else if (option.equals("--template")) {
+                template = Paths.get(getArgument(args, option, ++i));
+            } else if (option.startsWith("-")) {
+                throw new IllegalArgumentException("Invalid option: " + option);
+            }
+        }
+
+        if (outputfile == null) {
+            System.err.println("ERROR: must specify --output option");
+            System.exit(1);
+        }
+        if (title == null) {
+            System.err.println("ERROR: must specify --title option");
+            System.exit(1);
+        }
+
+        try (InputStream is = readTemplate(template);
+             BufferedReader reader = new BufferedReader(new InputStreamReader(is)))
+        {
+            new GenDocsBundlePage(title, outputfile).run(reader);
+        }
+    }
+
+    private static String getArgument(String[] args, String option, int index) {
+        if (index < args.length) {
+            return args[index];
+        }
+        throw new IllegalArgumentException("Argument must be specified for " + option);
+    }
+
+    private static InputStream readTemplate(Path template) throws IOException {
+        if (template != null) {
+            return Files.newInputStream(template);
+        } else {
+            return GenDocsBundlePage.class.getResourceAsStream(DOCS_BUNDLE_PAGE);
+        }
+    }
+
+    private static final String HEADER_TITLE = "@HEADER_TITLE@";
+    final Path outputfile;
+    final String title;
+    final Map<String, String> moduleGroups;
+
+    GenDocsBundlePage(String title, Path outputfile) throws IOException
+    {
+        this.outputfile = outputfile;
+        this.title = title;
+        this.moduleGroups = moduleGroups();
+    }
+
+    static Map<String, String> moduleGroups() throws IOException {
+        ModuleFinder finder = ModuleFinder.ofSystem();
+        Map<String, String> groups = new HashMap<>();
+        try (InputStream in = GenDocsBundlePage.class.getResourceAsStream(MODULE_GROUPS_PROPS)) {
+            Properties props = new Properties();
+            props.load(in);
+            for (String key: props.stringPropertyNames()) {
+                Set<String> mods = Stream.of(props.getProperty(key).split("\\s+"))
+                                         .filter(mn -> finder.find(mn).isPresent())
+                                         .map(String::trim)
+                                         .collect(Collectors.toSet());
+
+                // divide into 3 columns: Java SE, JDK, JavaFX
+                StringBuilder sb = new StringBuilder();
+                sb.append(mods.stream()
+                              .filter(mn -> mn.startsWith("java."))
+                              .sorted()
+                              .map(GenDocsBundlePage::toHRef)
+                              .collect(Collectors.joining("\n")));
+                sb.append("</td>\n<td>")
+                  .append(mods.stream()
+                              .filter(mn -> mn.startsWith("jdk."))
+                              .sorted()
+                              .map(GenDocsBundlePage::toHRef)
+                              .collect(Collectors.joining("\n")));
+                sb.append("</td>\n<td>");
+                if (mods.stream().anyMatch(mn -> mn.startsWith("javafx."))) {
+                    sb.append(mods.stream()
+                                  .filter(mn -> mn.startsWith("javafx."))
+                                  .sorted()
+                                  .map(GenDocsBundlePage::toHRef)
+                                  .collect(Collectors.joining("\n")));
+                }
+                String name = "@" + key.toUpperCase(Locale.ENGLISH) + "@";
+                groups.put(name, sb.toString());
+            }
+        }
+        return groups;
+    }
+
+    static String toHRef(String mn) {
+        return String.format("<a href=\"api/%s-summary.html\">%s</a><br>", mn, mn);
+    }
+
+    void run(BufferedReader reader) throws IOException {
+        if (Files.notExists(outputfile.getParent())) {
+            Files.createDirectories(outputfile.getParent());
+        }
+        try (BufferedWriter bw = Files.newBufferedWriter(outputfile, StandardCharsets.UTF_8);
+             PrintWriter writer = new PrintWriter(bw)) {
+            reader.lines().map(this::genOutputLine)
+                  .forEach(writer::println);
+        }
+    }
+
+    String genOutputLine(String line) {
+        if (line.contains(HEADER_TITLE)) {
+            line = line.replace(HEADER_TITLE, title);
+        }
+        if (line.contains("@")) {
+            for (Map.Entry<String,String> e: moduleGroups.entrySet()) {
+                if (line.contains(e.getKey())) {
+                    line = line.replace(e.getKey(), e.getValue());
+                }
+            }
+        }
+        return line;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/src/classes/build/tools/docs/docs-bundle-page.html	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,146 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta http-equiv="content-type" content="text/html;" charset="utf-8">
+  <style type="text/css">
+table {
+  border-collapse: collapse;
+}
+table {
+  border: 1px solid black;
+}
+th ,td {
+  border: 0px solid black;
+}
+thead th {
+  background-color: #DDD;
+}
+tbody > tr:nth-child(even) {
+    background-color: #EEE
+}
+tbody > tr:nth-child(odd) {
+    background-color: #FFF
+}
+th, td {
+  font-family: sans-serif; /* could eventually be DejaVu */
+  font-size: small;
+  padding: 5px 10px;
+  vertical-align:top;
+}
+td a {
+  text-decoration: none;
+}
+tr th {
+  text-align:left;
+}
+caption {
+  font-size: smaller;
+  font-weight: bold;
+}
+</style>
+<title>@HEADER_TITLE@</title>
+</head>
+<body>
+
+<h1>@HEADER_TITLE@</h1>
+
+<ul>
+<li><a href="api/index.html">JDK API Specification</a></li>
+<li>Java Language Specification</li>
+<li>Java Virtual Machine Specification</li>
+</ul>
+
+<table>
+<caption>Modules</caption>
+<thead>
+<tr>
+  <th scope="col">Group</th>
+  <th scope="col">Java SE</th>
+  <th scope="col">JDK</th>
+  <th scope="col">JavaFX</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+  <th scope="row">Foundation</th>
+  <td>@CORE_MODULES@</td>
+</tr>
+<tr>
+<th scope="row">Security</th>
+  <td>@SECURITY_MODULES@</td>
+</tr>
+<tr>
+<th scope="row">Instrumentation and<br>Management</th>
+  <td>@INSTRUMENT_MGMT_MODULES@</td>
+</tr>
+<tr>
+<th scope="row">Integration</th>
+  <td>@INTEGRATION_MODULES@</td>
+</tr>
+<tr>
+  <th scope="row">User Interface</th>
+  <td>@UI_TOOLKITS_MODULES@</td>
+</tr>
+<tr>
+  <th scope="row">Compiler and Scripting</th>
+  <td>@COMPILER_SCRIPTING_MODULES@</td>
+</tr>
+<tr>
+  <th scope="row">Debugging</th>
+  <td>@DEBUG_MODULES@</td>
+</tr>
+<tr>
+  <th scope="row">Tools and Tool APIs</th>
+  <td>@TOOL_MODULES@</td>
+</tr>
+<tr>
+  <th scope="row">Incubating Features</th>
+  <td>@INCUBATOR_MODULES@</td>
+</tr>
+<tr>
+  <th scope="row">Java EE</th>
+  <td>@JAVA_EE_MODULES@</td>
+</tr>
+<tr>
+  <th scope="row"></th>
+  <th scope="row">Outside Java SE</th>
+  <th scope="row">JDK</th>
+  <th scope="row">JavaFX</th>
+</tr>
+<tr>
+  <th scope="row">Others</th>
+  <td>@OTHER_MODULES@</td>
+</tr>
+</tbody>
+</table>
+
+<p>
+<hr/>
+<a href="legal/cpyr.html">Copyright</a>&copy; 1993, 2017, Oracle and/or its affiliates. All rights reserved.</p>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/src/classes/build/tools/docs/docs-module-groups.properties	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,101 @@
+# Module Grouping for the docs bundle page
+#
+
+core_modules=\
+java.base \
+jdk.charsets \
+jdk.localedata \
+jdk.net \
+jdk.sctp \
+jdk.zipfs
+
+java_ee_modules=\
+java.activation \
+java.corba \
+java.transaction \
+java.xml.bind \
+java.xml.ws \
+java.xml.ws.annotation
+
+security_modules=\
+java.security.jgss \
+java.security.sasl \
+java.xml.crypto \
+jdk.security.auth \
+jdk.security.jgss \
+jdk.crypto.cryptoki \
+jdk.crypto.ec \
+jdk.crypto.mscapi \
+jdk.crypto.ucrypto
+
+instrument_mgmt_modules=\
+java.instrument \
+java.management \
+java.management.rmi \
+jdk.jfr \
+jdk.management \
+jdk.management.agent \
+jdk.management.cmm \
+jdk.management.jfr \
+jdk.management.resource \
+
+integration_modules=\
+java.logging \
+java.naming \
+java.prefs \
+java.rmi \
+java.sql \
+java.sql.rowset \
+java.xml \
+jdk.httpserver \
+jdk.naming.dns \
+jdk.naming.rmi
+
+ui_toolkits_modules=\
+java.datatransfer \
+java.desktop \
+javafx.base \
+javafx.controls \
+javafx.fxml \
+javafx.graphics \
+javafx.media \
+javafx.swing \
+javafx.web \
+jdk.accessibility
+
+other_modules=\
+java.jnlp \
+java.smartcardio \
+jdk.jsobject \
+jdk.xml.dom
+
+debug_modules=\
+jdk.jdi \
+jdk.jdwp.agent
+
+tool_modules=\
+jdk.attach \
+jdk.editpad \
+jdk.jartool \
+jdk.javadoc \
+jdk.jcmd \
+jdk.jconsole \
+jdk.jdeps \
+jdk.jlink \
+jdk.jshell \
+jdk.jstatd \
+jdk.pack \
+jdk.policytool \
+jdk.packager.services \
+jdk.rmic
+
+compiler_scripting_modules=\
+java.compiler \
+java.scripting \
+jdk.compiler \
+jdk.dynalink \
+jdk.scripting.nashorn \
+jdk.scripting.nashorn.shell
+
+incubator_modules=\
+jdk.incubator.httpclient
--- a/jdk/src/java.base/share/classes/java/io/DataInput.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/io/DataInput.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -59,8 +59,9 @@
  * far left-hand column.
  *
  * <blockquote>
- *   <table border="1" cellspacing="0" cellpadding="8"
- *          summary="Bit values and bytes">
+ *   <table class="plain">
+ *     <caption style="display:none">Bit values and bytes</caption>
+ *     <tbody>
  *     <tr>
  *       <th colspan="9"><span style="font-weight:normal">
  *         All characters in the range {@code '\u005Cu0001'} to
@@ -71,7 +72,7 @@
  *       <th colspan="8" id="bit_a">Bit Values</th>
  *     </tr>
  *     <tr>
- *       <th id="byte1_a">Byte 1</th>
+ *       <th id="byte1_a" style="text-align:left">Byte 1</th>
  *       <td style="text-align:center">0
  *       <td colspan="7" style="text-align:center">bits 6-0
  *     </tr>
@@ -86,14 +87,14 @@
  *       <th colspan="8" id="bit_b">Bit Values</th>
  *     </tr>
  *     <tr>
- *       <th id="byte1_b">Byte 1</th>
+ *       <th id="byte1_b" style="text-align:left">Byte 1</th>
  *       <td style="text-align:center">1
  *       <td style="text-align:center">1
  *       <td style="text-align:center">0
  *       <td colspan="5" style="text-align:center">bits 10-6
  *     </tr>
  *     <tr>
- *       <th id="byte2_a">Byte 2</th>
+ *       <th id="byte2_a" style="text-align:left">Byte 2</th>
  *       <td style="text-align:center">1
  *       <td style="text-align:center">0
  *       <td colspan="6" style="text-align:center">bits 5-0
@@ -108,7 +109,7 @@
  *       <th colspan="8"id="bit_c">Bit Values</th>
  *     </tr>
  *     <tr>
- *       <th id="byte1_c">Byte 1</th>
+ *       <th id="byte1_c" style="text-align:left">Byte 1</th>
  *       <td style="text-align:center">1
  *       <td style="text-align:center">1
  *       <td style="text-align:center">1
@@ -116,17 +117,18 @@
  *       <td colspan="4" style="text-align:center">bits 15-12
  *     </tr>
  *     <tr>
- *       <th id="byte2_b">Byte 2</th>
+ *       <th id="byte2_b" style="text-align:left">Byte 2</th>
  *       <td style="text-align:center">1
  *       <td style="text-align:center">0
  *       <td colspan="6" style="text-align:center">bits 11-6
  *     </tr>
  *     <tr>
- *       <th id="byte3">Byte 3</th>
+ *       <th id="byte3" style="text-align:left">Byte 3</th>
  *       <td style="text-align:center">1
  *       <td style="text-align:center">0
  *       <td colspan="6" style="text-align:center">bits 5-0
  *     </tr>
+ *     </tbody>
  *   </table>
  * </blockquote>
  * <p>
--- a/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java	Thu May 25 22:33:25 2017 +0000
@@ -216,7 +216,8 @@
  * @see java.io.DataInput
  * @see java.io.ObjectOutputStream
  * @see java.io.Serializable
- * @see <a href="../../../platform/serialization/spec/input.html"> Object Serialization Specification, Section 3, Object Input Classes</a>
+ * @see <a href="{@docRoot}/../specs/serialization/input.html">
+ *     Object Serialization Specification, Section 3, Object Input Classes</a>
  * @since   1.1
  */
 public class ObjectInputStream
--- a/jdk/src/java.base/share/classes/java/io/ObjectOutputStream.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/io/ObjectOutputStream.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -156,7 +156,8 @@
  * @see java.io.ObjectInputStream
  * @see java.io.Serializable
  * @see java.io.Externalizable
- * @see <a href="../../../platform/serialization/spec/output.html">Object Serialization Specification, Section 2, Object Output Classes</a>
+ * @see <a href="{@docRoot}/../specs/serialization/output.html">
+ *     Object Serialization Specification, Section 2, Object Output Classes</a>
  * @since       1.1
  */
 public class ObjectOutputStream
--- a/jdk/src/java.base/share/classes/java/io/ObjectStreamClass.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/io/ObjectStreamClass.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -62,13 +62,14 @@
  * loaded in this Java VM can be found/created using the lookup method.
  *
  * <p>The algorithm to compute the SerialVersionUID is described in
- * <a href="../../../platform/serialization/spec/class.html#4100">Object
- * Serialization Specification, Section 4.6, Stream Unique Identifiers</a>.
+ * <a href="{@docRoot}/../specs/serialization/class.html#stream-unique-identifiers">
+ *     Object Serialization Specification, Section 4.6, Stream Unique Identifiers</a>.
  *
  * @author      Mike Warres
  * @author      Roger Riggs
  * @see ObjectStreamField
- * @see <a href="../../../platform/serialization/spec/class.html">Object Serialization Specification, Section 4, Class Descriptors</a>
+ * @see <a href="{@docRoot}/../specs/serialization/class.html">
+ *     Object Serialization Specification, Section 4, Class Descriptors</a>
  * @since   1.1
  */
 public class ObjectStreamClass implements Serializable {
--- a/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -136,8 +136,12 @@
      * in which the file is to be opened.  The permitted values and their
      * meanings are:
      *
-     * <table summary="Access mode permitted values and meanings">
+     * <table class="striped">
+     * <caption style="display:none">Access mode permitted values and meanings</caption>
+     * <thead>
      * <tr><th style="text-align:left">Value</th><th style="text-align:left">Meaning</th></tr>
+     * </thead>
+     * <tbody>
      * <tr><td style="vertical-align:top">{@code "r"}</td>
      *     <td> Open for reading only. Invoking any of the {@code write}
      *     methods of the resulting object will cause an
@@ -153,6 +157,7 @@
      *     <td> Open for reading and writing, as with {@code "rw"}, and also
      *     require that every update to the file's content be written
      *     synchronously to the underlying storage device.</td></tr>
+     * </tbody>
      * </table>
      *
      * The {@code "rws"} and {@code "rwd"} modes work much like the {@link
--- a/jdk/src/java.base/share/classes/java/io/SerializablePermission.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/io/SerializablePermission.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -44,12 +44,16 @@
  * and for each provides a description of what the permission allows
  * and a discussion of the risks of granting code the permission.
  *
- * <table border=1 cellpadding=5 summary="Permission target name, what the permission allows, and associated risks">
+ * <table class="striped">
+ * <caption style="display:none">Permission target name, what the permission allows, and associated risks</caption>
+ * <thead>
  * <tr>
  * <th>Permission Target Name</th>
  * <th>What the Permission Allows</th>
  * <th>Risks of Allowing this Permission</th>
  * </tr>
+ * </thead>
+ * <tbody>
  *
  * <tr>
  *   <td>enableSubclassImplementation</td>
@@ -79,7 +83,7 @@
  *   <td>Code could remove a configured filter and remove protections
  *       already established.</td>
  * </tr>
- *
+ * </tbody>
  * </table>
  *
  * @see java.security.BasicPermission
--- a/jdk/src/java.base/share/classes/java/io/package-info.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/io/package-info.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -33,7 +33,8 @@
  *
  * <h2>Package Specification</h2>
  * <ul>
- *   <li><a href="../../../platform/serialization/spec/serialTOC.html"> Java Object Serialization Specification </a>
+ *   <li><a href="{@docRoot}/../specs/serialization/index.html">
+ *       Java Object Serialization Specification </a>
  * </ul>
  *
  * <h2>Related Documentation</h2>
@@ -41,7 +42,8 @@
  * For overviews, tutorials, examples, guides, and tool documentation,
  * please see:
  * <ul>
- *   <li><a href="../../../technotes/guides/serialization">Serialization Enhancements</a>
+ *     <li>{@extLink serialver_tool_reference The serialver tool}</li>
+ *     <li>{@extLink serialization_guide Serialization Documentation}</li>
  * </ul>
  *
  * @since 1.0
--- a/jdk/src/java.base/share/classes/java/lang/CharSequence.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/CharSequence.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -123,7 +123,7 @@
      *
      * <p>The stream binds to this sequence when the terminal stream operation
      * commences (specifically, for mutable sequences the spliterator for the
-     * stream is <a href="../Spliterator.html#binding"><em>late-binding</em></a>).
+     * stream is <a href="../util/Spliterator.html#binding"><em>late-binding</em></a>).
      * If the sequence is modified during that operation then the result is
      * undefined.
      *
@@ -173,7 +173,7 @@
      *
      * <p>The stream binds to this sequence when the terminal stream operation
      * commences (specifically, for mutable sequences the spliterator for the
-     * stream is <a href="../Spliterator.html#binding"><em>late-binding</em></a>).
+     * stream is <a href="../util/Spliterator.html#binding"><em>late-binding</em></a>).
      * If the sequence is modified during that operation then the result is
      * undefined.
      *
--- a/jdk/src/java.base/share/classes/java/lang/Character.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/Character.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -9566,7 +9566,9 @@
      * Determines if the specified character is ISO-LATIN-1 white space.
      * This method returns {@code true} for the following five
      * characters only:
-     * <table summary="truechars">
+     * <table class="borderless">
+     * <caption style="display:none">truechars</caption>
+     * <tbody>
      * <tr><td>{@code '\t'}</td>            <td>{@code U+0009}</td>
      *     <td>{@code HORIZONTAL TABULATION}</td></tr>
      * <tr><td>{@code '\n'}</td>            <td>{@code U+000A}</td>
@@ -9577,6 +9579,7 @@
      *     <td>{@code CARRIAGE RETURN}</td></tr>
      * <tr><td>{@code ' '}</td>  <td>{@code U+0020}</td>
      *     <td>{@code SPACE}</td></tr>
+     * </tbody>
      * </table>
      *
      * @param      ch   the character to be tested.
--- a/jdk/src/java.base/share/classes/java/lang/Class.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/Class.java	Thu May 25 22:33:25 2017 +0000
@@ -724,18 +724,23 @@
      * one or more '{@code [}' characters representing the depth of the array
      * nesting.  The encoding of element type names is as follows:
      *
-     * <blockquote><table summary="Element types and encodings">
-     * <tr><th> Element Type <th> &nbsp;&nbsp;&nbsp; <th> Encoding
-     * <tr><td> boolean      <td> &nbsp;&nbsp;&nbsp; <td style="text-align:center"> Z
-     * <tr><td> byte         <td> &nbsp;&nbsp;&nbsp; <td style="text-align:center"> B
-     * <tr><td> char         <td> &nbsp;&nbsp;&nbsp; <td style="text-align:center"> C
+     * <blockquote><table class="borderless">
+     * <caption style="display:none">Element types and encodings</caption>
+     * <thead>
+     * <tr><th style="padding-right:3em;"> Element Type <th> Encoding
+     * </thead>
+     * <tbody>
+     * <tr><td> boolean      <td style="text-align:center"> Z
+     * <tr><td> byte         <td style="text-align:center"> B
+     * <tr><td> char         <td style="text-align:center"> C
      * <tr><td> class or interface
-     *                       <td> &nbsp;&nbsp;&nbsp; <td style="text-align:center"> L<i>classname</i>;
-     * <tr><td> double       <td> &nbsp;&nbsp;&nbsp; <td style="text-align:center"> D
-     * <tr><td> float        <td> &nbsp;&nbsp;&nbsp; <td style="text-align:center"> F
-     * <tr><td> int          <td> &nbsp;&nbsp;&nbsp; <td style="text-align:center"> I
-     * <tr><td> long         <td> &nbsp;&nbsp;&nbsp; <td style="text-align:center"> J
-     * <tr><td> short        <td> &nbsp;&nbsp;&nbsp; <td style="text-align:center"> S
+     *                       <td style="text-align:center"> L<i>classname</i>;
+     * <tr><td> double       <td style="text-align:center"> D
+     * <tr><td> float        <td style="text-align:center"> F
+     * <tr><td> int          <td style="text-align:center"> I
+     * <tr><td> long         <td style="text-align:center"> J
+     * <tr><td> short        <td style="text-align:center"> S
+     * </tbody>
      * </table></blockquote>
      *
      * <p> The class or interface name <i>classname</i> is the binary name of
--- a/jdk/src/java.base/share/classes/java/lang/Double.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/Double.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -255,9 +255,12 @@
      *
      * </ul>
      *
-     * <table border>
+     * <table class="plain">
      * <caption>Examples</caption>
+     * <thead>
      * <tr><th>Floating-point Value</th><th>Hexadecimal String</th>
+     * </thead>
+     * <tbody>
      * <tr><td>{@code 1.0}</td> <td>{@code 0x1.0p0}</td>
      * <tr><td>{@code -1.0}</td>        <td>{@code -0x1.0p0}</td>
      * <tr><td>{@code 2.0}</td> <td>{@code 0x1.0p1}</td>
@@ -272,6 +275,7 @@
      *     <td>{@code 0x0.fffffffffffffp-1022}</td>
      * <tr><td>{@code Double.MIN_VALUE}</td>
      *     <td>{@code 0x0.0000000000001p-1022}</td>
+     * </tbody>
      * </table>
      * @param   d   the {@code double} to be converted.
      * @return a hex string representation of the argument.
--- a/jdk/src/java.base/share/classes/java/lang/Float.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/Float.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -256,9 +256,12 @@
      *
      * </ul>
      *
-     * <table border>
+     * <table class="plain">
      * <caption>Examples</caption>
+     * <thead>
      * <tr><th>Floating-point Value</th><th>Hexadecimal String</th>
+     * </thead>
+     * <tbody>
      * <tr><td>{@code 1.0}</td> <td>{@code 0x1.0p0}</td>
      * <tr><td>{@code -1.0}</td>        <td>{@code -0x1.0p0}</td>
      * <tr><td>{@code 2.0}</td> <td>{@code 0x1.0p1}</td>
@@ -273,6 +276,7 @@
      *     <td>{@code 0x0.fffffep-126}</td>
      * <tr><td>{@code Float.MIN_VALUE}</td>
      *     <td>{@code 0x0.000002p-126}</td>
+     * </tbody>
      * </table>
      * @param   f   the {@code float} to be converted.
      * @return a hex string representation of the argument.
--- a/jdk/src/java.base/share/classes/java/lang/Iterable.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/Iterable.java	Thu May 25 22:33:25 2017 +0000
@@ -31,16 +31,13 @@
 import java.util.function.Consumer;
 
 /**
- * Implementing this interface allows an object to be the target of
- * the "for-each loop" statement. See
- * <strong>
- * <a href="{@docRoot}/../technotes/guides/language/foreach.html">For-each Loop</a>
- * </strong>
+ * Implementing this interface allows an object to be the target of the enhanced
+ * {@code for} statement (sometimes called the "for-each loop" statement).
  *
  * @param <T> the type of elements returned by the iterator
  *
  * @since 1.5
- * @jls 14.14.2 The enhanced for statement
+ * @jls 14.14.2 The enhanced {@code for} statement
  */
 public interface Iterable<T> {
     /**
--- a/jdk/src/java.base/share/classes/java/lang/ModuleLayer.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/ModuleLayer.java	Thu May 25 22:33:25 2017 +0000
@@ -84,7 +84,7 @@
  * started. The boot layer contains module {@code java.base} and is the only
  * layer in the Java virtual machine with a module named "{@code java.base}".
  * The modules in the boot layer are mapped to the bootstrap class loader and
- * other class loaders that are <a href="../ClassLoader.html#builtinLoaders">
+ * other class loaders that are <a href="ClassLoader.html#builtinLoaders">
  * built-in</a> into the Java virtual machine. The boot layer will often be
  * the {@link #parents() parent} when creating additional layers. </p>
  *
--- a/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java	Thu May 25 22:33:25 2017 +0000
@@ -43,13 +43,17 @@
  * target names, and for each provides a description of what the permission
  * allows and a discussion of the risks of granting code the permission.
  *
- * <table border=1 cellpadding=5 summary="permission target name,
- *  what the target allows,and associated risks">
+ * <table class="striped">
+ * <caption style="display:none">permission target name,
+ *  what the target allows, and associated risks</caption>
+ * <thead>
  * <tr>
  * <th>Permission Target Name</th>
  * <th>What the Permission Allows</th>
  * <th>Risks of Allowing this Permission</th>
  * </tr>
+ * </thead>
+ * <tbody>
  *
  * <tr>
  *   <td>createClassLoader</td>
@@ -383,6 +387,7 @@
  *   {@linkplain ModuleFinder#ofSystem system modules} in the runtime image.</td>
  * </tr>
  *
+ * </tbody>
  * </table>
  *
  * @implNote
--- a/jdk/src/java.base/share/classes/java/lang/String.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/String.java	Thu May 25 22:33:25 2017 +0000
@@ -203,7 +203,7 @@
      * Class String is special cased within the Serialization Stream Protocol.
      *
      * A String instance is written into an ObjectOutputStream according to
-     * <a href="{@docRoot}/../platform/serialization/spec/output.html">
+     * <a href="{@docRoot}/../specs/serialization/protocol.html#stream-elements">
      * Object Serialization Specification, Section 6.2, "Stream Elements"</a>
      */
     private static final ObjectStreamField[] serialPersistentFields =
@@ -335,7 +335,7 @@
      * subarray.
      *
      * <p> Each {@code byte} in the subarray is converted to a {@code char} as
-     * specified in the method above.
+     * specified in the {@link #String(byte[],int) String(byte[],int)} constructor.
      *
      * @deprecated This method does not properly convert bytes into characters.
      * As of JDK&nbsp;1.1, the preferred way to do this is via the
@@ -390,7 +390,7 @@
 
     /**
      * Allocates a new {@code String} containing characters constructed from
-     * an array of 8-bit integer values. Each character <i>c</i>in the
+     * an array of 8-bit integer values. Each character <i>c</i> in the
      * resulting string is constructed from the corresponding component
      * <i>b</i> in the byte array such that:
      *
@@ -2203,12 +2203,16 @@
      * <p> The string {@code "boo:and:foo"}, for example, yields the
      * following results with these parameters:
      *
-     * <blockquote><table cellpadding=1 cellspacing=0 summary="Split example showing regex, limit, and result">
+     * <blockquote><table class="plain">
+     * <caption style="display:none">Split example showing regex, limit, and result</caption>
+     * <thead>
      * <tr>
      *     <th>Regex</th>
      *     <th>Limit</th>
      *     <th>Result</th>
      * </tr>
+     * </thead>
+     * <tbody>
      * <tr><td style="text-align:center">:</td>
      *     <td style="text-align:center">2</td>
      *     <td>{@code { "boo", "and:foo" }}</td></tr>
@@ -2227,6 +2231,7 @@
      * <tr><td style="text-align:center">o</td>
      *     <td style="text-align:center">0</td>
      *     <td>{@code { "b", "", ":and:f" }}</td></tr>
+     * </tbody>
      * </table></blockquote>
      *
      * <p> An invocation of this method of the form
@@ -2326,15 +2331,20 @@
      * <p> The string {@code "boo:and:foo"}, for example, yields the following
      * results with these expressions:
      *
-     * <blockquote><table cellpadding=1 cellspacing=0 summary="Split examples showing regex and result">
+     * <blockquote><table class="plain">
+     * <caption style="display:none">Split examples showing regex and result</caption>
+     * <thead>
      * <tr>
      *  <th>Regex</th>
      *  <th>Result</th>
      * </tr>
+     * </thead>
+     * <tbody>
      * <tr><td style="text-align:center">:</td>
      *     <td>{@code { "boo", "and", "foo" }}</td></tr>
      * <tr><td style="text-align:center">o</td>
      *     <td>{@code { "b", "", ":and:f" }}</td></tr>
+     * </tbody>
      * </table></blockquote>
      *
      *
@@ -2445,13 +2455,17 @@
      * {@code String} may be a different length than the original {@code String}.
      * <p>
      * Examples of lowercase  mappings are in the following table:
-     * <table border="1" summary="Lowercase mapping examples showing language code of locale, upper case, lower case, and description">
+     * <table class="plain">
+     * <caption style="display:none">Lowercase mapping examples showing language code of locale, upper case, lower case, and description</caption>
+     * <thead>
      * <tr>
      *   <th>Language Code of Locale</th>
      *   <th>Upper Case</th>
      *   <th>Lower Case</th>
      *   <th>Description</th>
      * </tr>
+     * </thead>
+     * <tbody>
      * <tr>
      *   <td>tr (Turkish)</td>
      *   <td>&#92;u0130</td>
@@ -2480,6 +2494,7 @@
      *       <img src="doc-files/sigma1.gif" alt="sigma"></td>
      *   <td>lowercased all chars in String</td>
      * </tr>
+     * </tbody>
      * </table>
      *
      * @param locale use the case transformation rules for this locale
@@ -2526,13 +2541,17 @@
      * <p>
      * Examples of locale-sensitive and 1:M case mappings are in the following table.
      *
-     * <table border="1" summary="Examples of locale-sensitive and 1:M case mappings. Shows Language code of locale, lower case, upper case, and description.">
+     * <table class="plain">
+     * <caption style="display:none">Examples of locale-sensitive and 1:M case mappings. Shows Language code of locale, lower case, upper case, and description.</caption>
+     * <thead>
      * <tr>
      *   <th>Language Code of Locale</th>
      *   <th>Lower Case</th>
      *   <th>Upper Case</th>
      *   <th>Description</th>
      * </tr>
+     * </thead>
+     * <tbody>
      * <tr>
      *   <td>tr (Turkish)</td>
      *   <td>&#92;u0069</td>
@@ -2557,6 +2576,7 @@
      *   <td>FAHRVERGN&Uuml;GEN</td>
      *   <td></td>
      * </tr>
+     * </tbody>
      * </table>
      * @param locale use the case transformation rules for this locale
      * @return the {@code String}, converted to uppercase.
--- a/jdk/src/java.base/share/classes/java/lang/System.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/System.java	Thu May 25 22:33:25 2017 +0000
@@ -577,9 +577,13 @@
      * system properties, a set of system properties is first created and
      * initialized. This set of system properties always includes values
      * for the following keys:
-     * <table summary="Shows property keys and associated values">
+     * <table class="striped">
+     * <caption style="display:none">Shows property keys and associated values</caption>
+     * <thead>
      * <tr><th>Key</th>
      *     <th>Description of Associated Value</th></tr>
+     * </thead>
+     * <tbody>
      * <tr><td><code>java.version</code></td>
      *     <td>Java Runtime Environment version which may be interpreted
      *     as a {@link Runtime.Version}</td></tr>
@@ -638,6 +642,7 @@
      *     <td>User's home directory</td></tr>
      * <tr><td><code>user.dir</code></td>
      *     <td>User's current working directory</td></tr>
+     * </tbody>
      * </table>
      * <p>
      * Multiple paths in a system property value are separated by the path
@@ -649,9 +654,13 @@
      *
      * @implNote In addition to the standard system properties, the system
      * properties may include the following keys:
-     * <table summary="Shows property keys and associated values">
+     * <table class="striped">
+     * <caption style="display:none">Shows property keys and associated values</caption>
+     * <thead>
      * <tr><th>Key</th>
      *     <th>Description of Associated Value</th></tr>
+     * </thead>
+     * <tbody>
      * <tr><td>{@code jdk.module.path}</td>
      *     <td>The application module path</td></tr>
      * <tr><td>{@code jdk.module.upgrade.path}</td>
@@ -660,6 +669,7 @@
      *     <td>The module name of the initial/main module</td></tr>
      * <tr><td>{@code jdk.module.main.class}</td>
      *     <td>The main class name of the initial module</td></tr>
+     * </tbody>
      * </table>
      *
      * @return     the system properties
--- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -149,8 +149,12 @@
  * capture argument (corresponding to the receiver) must be non-null.
  *
  * <p>A type Q is considered adaptable to S as follows:
- * <table summary="adaptable types">
+ * <table class="borderless">
+ *   <caption style="display:none">adaptable types</caption>
+ *   <thead>
  *     <tr><th>Q</th><th>S</th><th>Link-time checks</th><th>Invocation-time checks</th></tr>
+ *   </thead>
+ *   <tbody>
  *     <tr>
  *         <td>Primitive</td><td>Primitive</td>
  *         <td>Q can be converted to S via a primitive widening conversion</td>
@@ -176,6 +180,7 @@
  *         <br>for return types: none</td>
  *         <td>Cast from Q to S</td>
  *     </tr>
+ *   </tbody>
  * </table>
  *
  * @apiNote These linkage methods are designed to support the evaluation
@@ -213,7 +218,9 @@
  * methods.
  * @since 1.8
  */
-public class LambdaMetafactory {
+public final class LambdaMetafactory {
+
+    private LambdaMetafactory() {}
 
     /** Flag for alternate metafactories indicating the lambda object
      * must be serializable */
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleInfo.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleInfo.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -81,8 +81,12 @@
  * The <a href="MethodHandles.Lookup.html#lookups">Lookup Factory Methods</a>
  * correspond to all major use cases for methods, constructors, and fields.
  * These use cases may be distinguished using small integers as follows:
- * <table border=1 cellpadding=5 summary="reference kinds">
+ * <table class="striped">
+ * <caption style="display:none">reference kinds</caption>
+ * <thead>
  * <tr><th>reference kind</th><th>descriptive name</th><th>scope</th><th>member</th><th>behavior</th></tr>
+ * </thead>
+ * <tbody>
  * <tr>
  *     <td>{@code 1}</td><td>{@code REF_getField}</td><td>{@code class}</td>
  *     <td>{@code FT f;}</td><td>{@code (T) this.f;}</td>
@@ -119,6 +123,7 @@
  *     <td>{@code 9}</td><td>{@code REF_invokeInterface}</td><td>{@code interface}</td>
  *     <td>{@code T m(A*);}</td><td>{@code (T) this.m(arg*);}</td>
  * </tr>
+ * </tbody>
  * </table>
  * @since 1.8
  */
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Thu May 25 22:33:25 2017 +0000
@@ -278,12 +278,16 @@
      * (Bytecode behaviors are described in section 5.4.3.5 of the Java Virtual Machine Specification.)
      * Here is a summary of the correspondence between these factory methods and
      * the behavior of the resulting method handles:
-     * <table border=1 cellpadding=5 summary="lookup method behaviors">
+     * <table class="striped">
+     * <caption style="display:none">lookup method behaviors</caption>
+     * <thead>
      * <tr>
      *     <th><a id="equiv"></a>lookup expression</th>
      *     <th>member</th>
      *     <th>bytecode behavior</th>
      * </tr>
+     * </thead>
+     * <tbody>
      * <tr>
      *     <td>{@link java.lang.invoke.MethodHandles.Lookup#findGetter lookup.findGetter(C.class,"f",FT.class)}</td>
      *     <td>{@code FT f;}</td><td>{@code (T) this.f;}</td>
@@ -340,6 +344,7 @@
      *     <td>{@link java.lang.invoke.MethodHandles.Lookup#findClass lookup.findClass("C")}</td>
      *     <td>{@code class C { ... }}</td><td>{@code C.class;}</td>
      * </tr>
+     * </tbody>
      * </table>
      *
      * Here, the type {@code C} is the class or interface being searched for a member,
@@ -1670,8 +1675,8 @@
          * to the lookup class.
          * (Unlike {@code bind}, {@code bindTo} does not preserve variable arity.
          * Also, {@code bindTo} may throw a {@code ClassCastException} in instances where {@code bind} would
-         * throw a {@code IllegalAccessException}, as in the case where the member is {@code protected} and
-         * the receiver is restricted by {@code findVirtual} to the lookup class)
+         * throw an {@code IllegalAccessException}, as in the case where the member is {@code protected} and
+         * the receiver is restricted by {@code findVirtual} to the lookup class.)
          * @param receiver the object from which the method is accessed
          * @param name the name of the method
          * @param type the type of the method, with the receiver argument omitted
--- a/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedElement.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedElement.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -105,10 +105,13 @@
  * <p>The table below summarizes which kind of annotation presence
  * different methods in this interface examine.
  *
- * <table border>
+ * <table class="plain">
  * <caption>Overview of kind of presence detected by different AnnotatedElement methods</caption>
+ * <thead>
  * <tr><th colspan=2></th><th colspan=4>Kind of Presence</th>
  * <tr><th colspan=2>Method</th><th>Directly Present</th><th>Indirectly Present</th><th>Present</th><th>Associated</th>
+ * </thead>
+ * <tbody>
  * <tr><td style="text-align:right">{@code T}</td><td>{@link #getAnnotation(Class) getAnnotation(Class&lt;T&gt;)}
  * <td></td><td></td><td>X</td><td></td>
  * </tr>
@@ -127,6 +130,7 @@
  * <tr><td style="text-align:right">{@code T[]}</td><td>{@link #getDeclaredAnnotationsByType(Class) getDeclaredAnnotationsByType(Class&lt;T&gt;)}
  * <td>X</td><td>X</td><td></td><td></td>
  * </tr>
+ * </tbody>
  * </table>
  *
  * <p>For an invocation of {@code get[Declared]AnnotationsByType( Class <
--- a/jdk/src/java.base/share/classes/java/lang/reflect/ReflectPermission.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/ReflectPermission.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -32,12 +32,16 @@
  * provides a summary description of what the permission allows,
  * and discusses the risks of granting code the permission.
  *
- * <table border=1 cellpadding=5 summary="Table shows permission target name, what the permission allows, and associated risks">
+ * <table class="striped">
+ * <caption style="display:none">Table shows permission target name, what the permission allows, and associated risks</caption>
+ * <thead>
  * <tr>
  * <th>Permission Target Name</th>
  * <th>What the Permission Allows</th>
  * <th>Risks of Allowing this Permission</th>
  * </tr>
+ * </thead>
+ * <tbody>
  *
  * <tr>
  *   <td>suppressAccessChecks</td>
@@ -58,6 +62,7 @@
  *       help in its attempt to compromise security in the system.</td>
  * </tr>
  *
+ * </tbody>
  * </table>
  *
  * @see java.security.Permission
--- a/jdk/src/java.base/share/classes/java/math/BigDecimal.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/math/BigDecimal.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -120,15 +120,19 @@
  * preferred scale for representing a result.  The preferred
  * scale for each operation is listed in the table below.
  *
- * <table border>
+ * <table class="plain">
  * <caption><b>Preferred Scales for Results of Arithmetic Operations
  * </b></caption>
+ * <thead>
  * <tr><th>Operation</th><th>Preferred Scale of Result</th></tr>
+ * </thead>
+ * <tbody>
  * <tr><td>Add</td><td>max(addend.scale(), augend.scale())</td>
  * <tr><td>Subtract</td><td>max(minuend.scale(), subtrahend.scale())</td>
  * <tr><td>Multiply</td><td>multiplier.scale() + multiplicand.scale()</td>
  * <tr><td>Divide</td><td>dividend.scale() - divisor.scale()</td>
  * <tr><td>Square root</td><td>radicand.scale()/2</td>
+ * </tbody>
  * </table>
  *
  * These scales are the ones used by the methods which return exact
--- a/jdk/src/java.base/share/classes/java/math/RoundingMode.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/math/RoundingMode.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -51,8 +51,9 @@
  * proper {@code MathContext}.  A summary table showing the results
  * of these rounding operations for all rounding modes appears below.
  *
- *<table border>
+ *<table class="plain">
  * <caption><b>Summary of Rounding Operations Under Different Rounding Modes</b></caption>
+ * <thead>
  * <tr><th></th><th colspan=8>Result of rounding input to one digit with the given
  *                           rounding mode</th>
  * <tr style="vertical-align:top">
@@ -64,6 +65,8 @@
  *                                                                                                   <th>{@code HALF_DOWN}</th>
  *                                                                                                                    <th>{@code HALF_EVEN}</th>
  *                                                                                                                                     <th>{@code UNNECESSARY}</th>
+ * </thead>
+ * <tbody>
  *
  * <tr style="text-align:right"><td>5.5</td>  <td>6</td>  <td>5</td>    <td>6</td>    <td>5</td>  <td>6</td>      <td>5</td>       <td>6</td>       <td>throw {@code ArithmeticException}</td>
  * <tr style="text-align:right"><td>2.5</td>  <td>3</td>  <td>2</td>    <td>3</td>    <td>2</td>  <td>3</td>      <td>2</td>       <td>2</td>       <td>throw {@code ArithmeticException}</td>
@@ -75,7 +78,8 @@
  * <tr style="text-align:right"><td>-1.6</td> <td>-2</td> <td>-1</td>   <td>-1</td>   <td>-2</td> <td>-2</td>     <td>-2</td>      <td>-2</td>      <td>throw {@code ArithmeticException}</td>
  * <tr style="text-align:right"><td>-2.5</td> <td>-3</td> <td>-2</td>   <td>-2</td>   <td>-3</td> <td>-3</td>     <td>-2</td>      <td>-2</td>      <td>throw {@code ArithmeticException}</td>
  * <tr style="text-align:right"><td>-5.5</td> <td>-6</td> <td>-5</td>   <td>-5</td>   <td>-6</td> <td>-6</td>     <td>-5</td>      <td>-6</td>      <td>throw {@code ArithmeticException}</td>
- *</table>
+ * </tbody>
+ * </table>
  *
  *
  * <p>This {@code enum} is intended to replace the integer-based
@@ -100,10 +104,13 @@
          * value.
          *
          *<p>Example:
-         *<table border>
+         *<table class="plain">
          * <caption><b>Rounding mode UP Examples</b></caption>
+         *<thead>
          *<tr style="vertical-align:top"><th>Input Number</th>
          *    <th>Input rounded to one digit<br> with {@code UP} rounding
+         *</thead>
+         *<tbody>
          *<tr style="text-align:right"><td>5.5</td>  <td>6</td>
          *<tr style="text-align:right"><td>2.5</td>  <td>3</td>
          *<tr style="text-align:right"><td>1.6</td>  <td>2</td>
@@ -114,6 +121,7 @@
          *<tr style="text-align:right"><td>-1.6</td> <td>-2</td>
          *<tr style="text-align:right"><td>-2.5</td> <td>-3</td>
          *<tr style="text-align:right"><td>-5.5</td> <td>-6</td>
+         *</tbody>
          *</table>
          */
     UP(BigDecimal.ROUND_UP),
@@ -124,10 +132,13 @@
          * rounding mode never increases the magnitude of the calculated value.
          *
          *<p>Example:
-         *<table border>
+         *<table class="plain">
          * <caption><b>Rounding mode DOWN Examples</b></caption>
+         *<thead>
          *<tr style="vertical-align:top"><th>Input Number</th>
          *    <th>Input rounded to one digit<br> with {@code DOWN} rounding
+         *</thead>
+         *<tbody>
          *<tr style="text-align:right"><td>5.5</td>  <td>5</td>
          *<tr style="text-align:right"><td>2.5</td>  <td>2</td>
          *<tr style="text-align:right"><td>1.6</td>  <td>1</td>
@@ -138,6 +149,7 @@
          *<tr style="text-align:right"><td>-1.6</td> <td>-1</td>
          *<tr style="text-align:right"><td>-2.5</td> <td>-2</td>
          *<tr style="text-align:right"><td>-5.5</td> <td>-5</td>
+         *</tbody>
          *</table>
          */
     DOWN(BigDecimal.ROUND_DOWN),
@@ -149,10 +161,13 @@
          * that this rounding mode never decreases the calculated value.
          *
          *<p>Example:
-         *<table border>
+         *<table class="plain">
          * <caption><b>Rounding mode CEILING Examples</b></caption>
+         *<thead>
          *<tr style="vertical-align:top"><th>Input Number</th>
          *    <th>Input rounded to one digit<br> with {@code CEILING} rounding
+         *</thead>
+         *<tbody>
          *<tr style="text-align:right"><td>5.5</td>  <td>6</td>
          *<tr style="text-align:right"><td>2.5</td>  <td>3</td>
          *<tr style="text-align:right"><td>1.6</td>  <td>2</td>
@@ -163,6 +178,7 @@
          *<tr style="text-align:right"><td>-1.6</td> <td>-1</td>
          *<tr style="text-align:right"><td>-2.5</td> <td>-2</td>
          *<tr style="text-align:right"><td>-5.5</td> <td>-5</td>
+         *</tbody>
          *</table>
          */
     CEILING(BigDecimal.ROUND_CEILING),
@@ -174,10 +190,13 @@
          * this rounding mode never increases the calculated value.
          *
          *<p>Example:
-         *<table border>
+         *<table class="plain">
          * <caption><b>Rounding mode FLOOR Examples</b></caption>
+         *<thead>
          *<tr style="vertical-align:top"><th>Input Number</th>
          *    <th>Input rounded to one digit<br> with {@code FLOOR} rounding
+         *</thead>
+         *<tbody>
          *<tr style="text-align:right"><td>5.5</td>  <td>5</td>
          *<tr style="text-align:right"><td>2.5</td>  <td>2</td>
          *<tr style="text-align:right"><td>1.6</td>  <td>1</td>
@@ -188,6 +207,7 @@
          *<tr style="text-align:right"><td>-1.6</td> <td>-2</td>
          *<tr style="text-align:right"><td>-2.5</td> <td>-3</td>
          *<tr style="text-align:right"><td>-5.5</td> <td>-6</td>
+         *</tbody>
          *</table>
          */
     FLOOR(BigDecimal.ROUND_FLOOR),
@@ -201,10 +221,13 @@
          * mode commonly taught at school.
          *
          *<p>Example:
-         *<table border>
+         *<table class="plain">
          * <caption><b>Rounding mode HALF_UP Examples</b></caption>
+         *<thead>
          *<tr style="vertical-align:top"><th>Input Number</th>
          *    <th>Input rounded to one digit<br> with {@code HALF_UP} rounding
+         *</thead>
+         *<tbody>
          *<tr style="text-align:right"><td>5.5</td>  <td>6</td>
          *<tr style="text-align:right"><td>2.5</td>  <td>3</td>
          *<tr style="text-align:right"><td>1.6</td>  <td>2</td>
@@ -215,6 +238,7 @@
          *<tr style="text-align:right"><td>-1.6</td> <td>-2</td>
          *<tr style="text-align:right"><td>-2.5</td> <td>-3</td>
          *<tr style="text-align:right"><td>-5.5</td> <td>-6</td>
+         *</tbody>
          *</table>
          */
     HALF_UP(BigDecimal.ROUND_HALF_UP),
@@ -227,10 +251,13 @@
          * {@code RoundingMode.DOWN}.
          *
          *<p>Example:
-         *<table border>
+         *<table class="plain">
          * <caption><b>Rounding mode HALF_DOWN Examples</b></caption>
+         *<thead>
          *<tr style="vertical-align:top"><th>Input Number</th>
          *    <th>Input rounded to one digit<br> with {@code HALF_DOWN} rounding
+         *</thead>
+         *<tbody>
          *<tr style="text-align:right"><td>5.5</td>  <td>5</td>
          *<tr style="text-align:right"><td>2.5</td>  <td>2</td>
          *<tr style="text-align:right"><td>1.6</td>  <td>2</td>
@@ -241,6 +268,7 @@
          *<tr style="text-align:right"><td>-1.6</td> <td>-2</td>
          *<tr style="text-align:right"><td>-2.5</td> <td>-2</td>
          *<tr style="text-align:right"><td>-5.5</td> <td>-5</td>
+         *</tbody>
          *</table>
          */
     HALF_DOWN(BigDecimal.ROUND_HALF_DOWN),
@@ -260,10 +288,13 @@
          * arithmetic in Java.
          *
          *<p>Example:
-         *<table border>
+         *<table class="plain">
          * <caption><b>Rounding mode HALF_EVEN Examples</b></caption>
+         *<thead>
          *<tr style="vertical-align:top"><th>Input Number</th>
          *    <th>Input rounded to one digit<br> with {@code HALF_EVEN} rounding
+         *</thead>
+         *<tbody>
          *<tr style="text-align:right"><td>5.5</td>  <td>6</td>
          *<tr style="text-align:right"><td>2.5</td>  <td>2</td>
          *<tr style="text-align:right"><td>1.6</td>  <td>2</td>
@@ -274,6 +305,7 @@
          *<tr style="text-align:right"><td>-1.6</td> <td>-2</td>
          *<tr style="text-align:right"><td>-2.5</td> <td>-2</td>
          *<tr style="text-align:right"><td>-5.5</td> <td>-6</td>
+         *</tbody>
          *</table>
          */
     HALF_EVEN(BigDecimal.ROUND_HALF_EVEN),
@@ -284,10 +316,13 @@
          * specified on an operation that yields an inexact result, an
          * {@code ArithmeticException} is thrown.
          *<p>Example:
-         *<table border>
+         *<table class="plain">
          * <caption><b>Rounding mode UNNECESSARY Examples</b></caption>
+         *<thead>
          *<tr style="vertical-align:top"><th>Input Number</th>
          *    <th>Input rounded to one digit<br> with {@code UNNECESSARY} rounding
+         *</thead>
+         *<tbody>
          *<tr style="text-align:right"><td>5.5</td>  <td>throw {@code ArithmeticException}</td>
          *<tr style="text-align:right"><td>2.5</td>  <td>throw {@code ArithmeticException}</td>
          *<tr style="text-align:right"><td>1.6</td>  <td>throw {@code ArithmeticException}</td>
@@ -298,6 +333,7 @@
          *<tr style="text-align:right"><td>-1.6</td> <td>throw {@code ArithmeticException}</td>
          *<tr style="text-align:right"><td>-2.5</td> <td>throw {@code ArithmeticException}</td>
          *<tr style="text-align:right"><td>-5.5</td> <td>throw {@code ArithmeticException}</td>
+         *</tbody>
          *</table>
          */
     UNNECESSARY(BigDecimal.ROUND_UNNECESSARY);
--- a/jdk/src/java.base/share/classes/java/net/Inet4Address.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/net/Inet4Address.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -41,12 +41,12 @@
  * Textual representation of IPv4 address used as input to methods
  * takes one of the following forms:
  *
- * <blockquote><table cellpadding=0 cellspacing=0 summary="layout">
- * <tr><td>{@code d.d.d.d}</td></tr>
- * <tr><td>{@code d.d.d}</td></tr>
- * <tr><td>{@code d.d}</td></tr>
- * <tr><td>{@code d}</td></tr>
- * </table></blockquote>
+ * <blockquote><ul style="list-style-type:none">
+ * <li>{@code d.d.d.d}</li>
+ * <li>{@code d.d.d}</li>
+ * <li>{@code d.d}</li>
+ * <li>{@code d}</li>
+ * </ul></blockquote>
  *
  * <p> When four parts are specified, each is interpreted as a byte of
  * data and assigned, from left to right, to the four bytes of an IPv4
--- a/jdk/src/java.base/share/classes/java/net/Inet6Address.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/net/Inet6Address.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -49,9 +49,9 @@
  *   the hexadecimal values of the eight 16-bit pieces of the
  *   address. This is the full form.  For example,
  *
- *   <blockquote><table cellpadding=0 cellspacing=0 summary="layout">
- *   <tr><td>{@code 1080:0:0:0:8:800:200C:417A}<td></tr>
- *   </table></blockquote>
+ *   <blockquote><ul style="list-style-type:none">
+ *   <li>{@code 1080:0:0:0:8:800:200C:417A}</li>
+ *   </ul></blockquote>
  *
  *   <p> Note that it is not necessary to write the leading zeros in
  *   an individual field. However, there must be at least one numeral
@@ -66,9 +66,9 @@
  *   The "::" can also be used to compress the leading and/or trailing
  *   zeros in an address. For example,
  *
- *   <blockquote><table cellpadding=0 cellspacing=0 summary="layout">
- *   <tr><td>{@code 1080::8:800:200C:417A}<td></tr>
- *   </table></blockquote>
+ *   <blockquote><ul style="list-style-type:none">
+ *   <li>{@code 1080::8:800:200C:417A}</li>
+ *   </ul></blockquote>
  *
  *   <li><p> An alternative form that is sometimes more convenient
  *   when dealing with a mixed environment of IPv4 and IPv6 nodes is
@@ -77,35 +77,35 @@
  *   are the decimal values of the four low-order 8-bit pieces of the
  *   standard IPv4 representation address, for example,
  *
- *   <blockquote><table cellpadding=0 cellspacing=0 summary="layout">
- *   <tr><td>{@code ::FFFF:129.144.52.38}<td></tr>
- *   <tr><td>{@code ::129.144.52.38}<td></tr>
- *   </table></blockquote>
+ *   <blockquote><ul style="list-style-type:none">
+ *   <li>{@code ::FFFF:129.144.52.38}</li>
+ *   <li>{@code ::129.144.52.38}</li>
+ *   </ul></blockquote>
  *
  *   <p> where "::FFFF:d.d.d.d" and "::d.d.d.d" are, respectively, the
  *   general forms of an IPv4-mapped IPv6 address and an
  *   IPv4-compatible IPv6 address. Note that the IPv4 portion must be
  *   in the "d.d.d.d" form. The following forms are invalid:
  *
- *   <blockquote><table cellpadding=0 cellspacing=0 summary="layout">
- *   <tr><td>{@code ::FFFF:d.d.d}<td></tr>
- *   <tr><td>{@code ::FFFF:d.d}<td></tr>
- *   <tr><td>{@code ::d.d.d}<td></tr>
- *   <tr><td>{@code ::d.d}<td></tr>
- *   </table></blockquote>
+ *   <blockquote><ul style="list-style-type:none">
+ *   <li>{@code ::FFFF:d.d.d}</li>
+ *   <li>{@code ::FFFF:d.d}</li>
+ *   <li>{@code ::d.d.d}</li>
+ *   <li>{@code ::d.d}</li>
+ *   </ul></blockquote>
  *
  *   <p> The following form:
  *
- *   <blockquote><table cellpadding=0 cellspacing=0 summary="layout">
- *   <tr><td>{@code ::FFFF:d}<td></tr>
- *   </table></blockquote>
+ *   <blockquote><ul style="list-style-type:none">
+ *   <li>{@code ::FFFF:d}</li>
+ *   </ul></blockquote>
  *
  *   <p> is valid, however it is an unconventional representation of
  *   the IPv4-compatible IPv6 address,
  *
- *   <blockquote><table cellpadding=0 cellspacing=0 summary="layout">
- *   <tr><td>{@code ::255.255.0.d}<td></tr>
- *   </table></blockquote>
+ *   <blockquote><ul style="list-style-type:none">
+ *   <li>{@code ::255.255.0.d}</li>
+ *   </ul></blockquote>
  *
  *   <p> while "::d" corresponds to the general IPv6 address
  *   "0:0:0:0:0:0:0:d".</li>
@@ -119,9 +119,10 @@
  * <h4> Special IPv6 address </h4>
  *
  * <blockquote>
- * <table cellspacing=2 summary="Description of IPv4-mapped address">
- * <tr><th valign=top><i>IPv4-mapped address</i></th>
- *         <td>Of the form::ffff:w.x.y.z, this IPv6 address is used to
+ * <table class="borderless">
+ * <caption style="display:none">Description of IPv4-mapped address</caption>
+ * <tr><th style="vertical-align:top; padding-right:2px"><i>IPv4-mapped address</i></th>
+ *         <td>Of the form ::ffff:w.x.y.z, this IPv6 address is used to
  *         represent an IPv4 address. It allows the native program to
  *         use the same address data structure and also the same
  *         socket when communicating with both IPv4 and IPv6 nodes.
--- a/jdk/src/java.base/share/classes/java/net/InetAddress.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/net/InetAddress.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -72,7 +72,9 @@
  *
  * <h3> Address types </h3>
  *
- * <blockquote><table cellspacing=2 summary="Description of unicast and multicast address types">
+ * <blockquote><table class="borderless">
+ *   <caption style="display:none">Description of unicast and multicast address types</caption>
+ *   <tbody>
  *   <tr><th valign=top><i>unicast</i></th>
  *       <td>An identifier for a single interface. A packet sent to
  *         a unicast address is delivered to the interface identified by
@@ -96,6 +98,7 @@
  *       <td>An identifier for a set of interfaces (typically belonging
  *         to different nodes). A packet sent to a multicast address is
  *         delivered to all interfaces identified by that address.</td></tr>
+ * </tbody>
  * </table></blockquote>
  *
  * <h4> IP address scope </h4>
--- a/jdk/src/java.base/share/classes/java/net/NetPermission.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/net/NetPermission.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -47,12 +47,16 @@
  * and for each provides a description of what the permission allows
  * and a discussion of the risks of granting code the permission.
  *
- * <table border=1 cellpadding=5 summary="Permission target name, what the permission allows, and associated risks">
+ * <table class="striped">
+ * <caption style="display:none">Permission target name, what the permission allows, and associated risks</caption>
+ * <thead>
  * <tr>
  * <th>Permission Target Name</th>
  * <th>What the Permission Allows</th>
  * <th>Risks of Allowing this Permission</th>
  * </tr>
+ * </thead>
+ * <tbody>
  * <tr>
  *   <td>allowHttpTrace</td>
  *   <td>The ability to use the HTTP TRACE method in HttpURLConnection.</td>
@@ -151,6 +155,7 @@
  *   creating a ProtectionDomain/CodeSource for a class even though
  *   that class really didn't come from that location.</td>
  * </tr>
+   </tbody>
  * </table>
  *
  * @see java.security.BasicPermission
--- a/jdk/src/java.base/share/classes/java/net/URI.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/net/URI.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -83,11 +83,11 @@
  * not begin with a slash character ({@code '/'}).  Opaque URIs are not
  * subject to further parsing.  Some examples of opaque URIs are:
  *
- * <blockquote><table cellpadding=0 cellspacing=0 summary="layout">
- * <tr><td>{@code mailto:java-net@java.sun.com}<td></tr>
- * <tr><td>{@code news:comp.lang.java}<td></tr>
- * <tr><td>{@code urn:isbn:096139210x}</td></tr>
- * </table></blockquote>
+ * <blockquote><ul style="list-style-type:none">
+ * <li>{@code mailto:java-net@java.sun.com}</li>
+ * <li>{@code news:comp.lang.java}</li>
+ * <li>{@code urn:isbn:096139210x}</li>
+ * </ul></blockquote>
  *
  * <p> A <i>hierarchical</i> URI is either an absolute URI whose
  * scheme-specific part begins with a slash character, or a relative URI, that
@@ -132,8 +132,12 @@
  *
  * <p> All told, then, a URI instance has the following nine components:
  *
- * <blockquote><table summary="Describes the components of a URI:scheme,scheme-specific-part,authority,user-info,host,port,path,query,fragment">
+ * <blockquote><table class="borderless">
+ * <caption style="display:none">Describes the components of a URI:scheme,scheme-specific-part,authority,user-info,host,port,path,query,fragment</caption>
+ * <thead>
  * <tr><th><i>Component</i></th><th><i>Type</i></th></tr>
+ * </thead>
+ * <tbody>
  * <tr><td>scheme</td><td>{@code String}</td></tr>
  * <tr><td>scheme-specific-part&nbsp;&nbsp;&nbsp;&nbsp;</td><td>{@code String}</td></tr>
  * <tr><td>authority</td><td>{@code String}</td></tr>
@@ -143,6 +147,7 @@
  * <tr><td>path</td><td>{@code String}</td></tr>
  * <tr><td>query</td><td>{@code String}</td></tr>
  * <tr><td>fragment</td><td>{@code String}</td></tr>
+ * </tbody>
  * </table></blockquote>
  *
  * In a given instance any particular component is either <i>undefined</i> or
@@ -248,7 +253,9 @@
  * which are taken from that specification, are used below to describe these
  * constraints:
  *
- * <blockquote><table cellspacing=2 summary="Describes categories alpha,digit,alphanum,unreserved,punct,reserved,escaped,and other">
+ * <blockquote><table>
+ * <caption style="display:none">Describes categories alpha,digit,alphanum,unreserved,punct,reserved,escaped,and other</caption>
+ *   <tbody>
  *   <tr><th valign=top><i>alpha</i></th>
  *       <td>The US-ASCII alphabetic characters,
  *        {@code 'A'}&nbsp;through&nbsp;{@code 'Z'}
@@ -279,6 +286,7 @@
  *           java.lang.Character#isSpaceChar(char) Character.isSpaceChar}
  *           method)&nbsp;&nbsp;<i>(<b>Deviation from RFC 2396</b>, which is
  *           limited to US-ASCII)</i></td></tr>
+ * </tbody>
  * </table></blockquote>
  *
  * <p><a id="legal-chars"></a> The set of all legal URI characters consists of
--- a/jdk/src/java.base/share/classes/java/net/URLConnection.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/net/URLConnection.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -54,13 +54,18 @@
  * read from and to write to the resource referenced by the URL. In
  * general, creating a connection to a URL is a multistep process:
  *
- * <div style="text-align:center"><table style="margin:0 auto" border=2 summary="Describes the process of creating a connection to a URL: openConnection() and connect() over time.">
+ * <div style="text-align:center"><table class="plain" style="margin:0 auto">
+ * <caption style="display:none">Describes the process of creating a connection to a URL: openConnection() and connect() over time.</caption>
+ * <thead>
  * <tr><th>{@code openConnection()}</th>
  *     <th>{@code connect()}</th></tr>
+ * </thead>
+ * <tbody>
  * <tr><td>Manipulate parameters that affect the connection to the remote
  *         resource.</td>
  *     <td>Interact with the resource; query header fields and
  *         contents.</td></tr>
+ * </tbody>
  * </table>
  * ----------------------------&gt;
  * <br>time</div>
--- a/jdk/src/java.base/share/classes/java/net/URLPermission.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/net/URLPermission.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -72,9 +72,12 @@
  * separated by '/' characters. <i>path</i> may also be empty. The path is specified
  * in a similar way to the path in {@link java.io.FilePermission}. There are
  * three different ways as the following examples show:
- * <table border>
+ * <table class="plain">
  * <caption>URL Examples</caption>
+ * <thead>
  * <tr><th>Example url</th><th>Description</th></tr>
+ * </thead>
+ * <tbody>
  * <tr><td style="white-space:nowrap;">http://www.oracle.com/a/b/c.html</td>
  *   <td>A url which identifies a specific (single) resource</td>
  * </tr>
@@ -90,6 +93,7 @@
  *       example).
  *   </td>
  * </tr>
+ * </tbody>
  * </table>
  * <p>
  * The '*' and '-' may only be specified in the final segment of a path and must be
@@ -246,9 +250,12 @@
      * <li>otherwise, return false</li>
      * </ul>
      * <p>Some examples of how paths are matched are shown below:
-     * <table border>
+     * <table class="plain">
      * <caption>Examples of Path Matching</caption>
+     * <thead>
      * <tr><th>this's path</th><th>p's path</th><th>match</th></tr>
+     * </thead>
+     * <tbody>
      * <tr><td>/a/b</td><td>/a/b</td><td>yes</td></tr>
      * <tr><td>/a/b/*</td><td>/a/b/c</td><td>yes</td></tr>
      * <tr><td>/a/b/*</td><td>/a/b/c/d</td><td>no</td></tr>
@@ -256,6 +263,7 @@
      * <tr><td>/a/b/-</td><td>/a/b/c/d/e</td><td>yes</td></tr>
      * <tr><td>/a/b/-</td><td>/a/b/c/*</td><td>yes</td></tr>
      * <tr><td>/a/b/*</td><td>/a/b/c/-</td><td>no</td></tr>
+     * </tbody>
      * </table>
      */
     public boolean implies(Permission p) {
--- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousChannelGroup.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousChannelGroup.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -60,11 +60,15 @@
  * default group is not configured then the pooled threads of the default group
  * are {@link Thread#isDaemon daemon} threads.
  *
- * <table border summary="System properties">
+ * <table class="striped">
+ * <caption style="display:none:">System properties</caption>
+ *   <thead>
  *   <tr>
  *     <th>System property</th>
  *     <th>Description</th>
  *   </tr>
+ *   </thead>
+ *   <tbody>
  *   <tr>
  *     <td> {@code java.nio.channels.DefaultThreadPool.threadFactory} </td>
  *     <td> The value of this property is taken to be the fully-qualified name
@@ -86,6 +90,7 @@
  *     unspecified error to be thrown during the construction of the default
  *     group. </td>
  *   </tr>
+ *   </tbody>
  * </table>
  *
  * <a id="threading"></a><h2>Threading</h2>
--- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousFileChannel.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousFileChannel.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -133,8 +133,12 @@
      * <p> In addition to {@code READ} and {@code WRITE}, the following options
      * may be present:
      *
-     * <table border=1 cellpadding=5 summary="">
+     * <table class="striped">
+     * <caption style="display:none">additional options</caption>
+     * <thead>
      * <tr> <th>Option</th> <th>Description</th> </tr>
+     * </thead>
+     * <tbody>
      * <tr>
      *   <td> {@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} </td>
      *   <td> When opening an existing file, the file is first truncated to a
@@ -186,6 +190,7 @@
      *   href="../file/package-summary.html#integrity"> Synchronized I/O file
      *   integrity</a>). </td>
      * </tr>
+     * </tbody>
      * </table>
      *
      * <p> An implementation may also support additional options.
--- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -52,11 +52,15 @@
  * <p> Socket options are configured using the {@link #setOption(SocketOption,Object)
  * setOption} method. Channels of this type support the following options:
  * <blockquote>
- * <table border summary="Socket options">
+ * <table class="striped">
+ * <caption style="display:none">Socket options</caption>
+ * <thead>
  *   <tr>
  *     <th>Option Name</th>
  *     <th>Description</th>
  *   </tr>
+ * </thead>
+ * <tbody>
  *   <tr>
  *     <td> {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} </td>
  *     <td> The size of the socket receive buffer </td>
@@ -65,6 +69,7 @@
  *     <td> {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} </td>
  *     <td> Re-use address </td>
  *   </tr>
+ * </tbody>
  * </table>
  * </blockquote>
  * Additional (implementation specific) options may also be supported.
--- a/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/channels/AsynchronousSocketChannel.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -62,11 +62,15 @@
  * <p> Socket options are configured using the {@link #setOption(SocketOption,Object)
  * setOption} method. Asynchronous socket channels support the following options:
  * <blockquote>
- * <table border summary="Socket options">
+ * <table class="striped">
+ * <caption style="display:none">Socket options</caption>
+ * <thead>
  *   <tr>
  *     <th>Option Name</th>
  *     <th>Description</th>
  *   </tr>
+ * </thead>
+ * <tbody>
  *   <tr>
  *     <td> {@link java.net.StandardSocketOptions#SO_SNDBUF SO_SNDBUF} </td>
  *     <td> The size of the socket send buffer </td>
@@ -87,6 +91,7 @@
  *     <td> {@link java.net.StandardSocketOptions#TCP_NODELAY TCP_NODELAY} </td>
  *     <td> Disable the Nagle algorithm </td>
  *   </tr>
+ * </tbody>
  * </table>
  * </blockquote>
  * Additional (implementation specific) options may also be supported.
--- a/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/channels/DatagramChannel.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -57,11 +57,15 @@
  * setOption} method. A datagram channel to an Internet Protocol socket supports
  * the following options:
  * <blockquote>
- * <table border summary="Socket options">
+ * <table class="striped">
+ * <caption style="display:none">Socket options</caption>
+ * <thead>
  *   <tr>
  *     <th>Option Name</th>
  *     <th>Description</th>
  *   </tr>
+ * </thead>
+ * <tbody>
  *   <tr>
  *     <td> {@link java.net.StandardSocketOptions#SO_SNDBUF SO_SNDBUF} </td>
  *     <td> The size of the socket send buffer </td>
@@ -97,6 +101,7 @@
  *       IP_MULTICAST_LOOP} </td>
  *     <td> Loopback for Internet Protocol (IP) multicast datagrams </td>
  *   </tr>
+ * </tbody>
  * </table>
  * </blockquote>
  * Additional (implementation specific) options may also be supported.
--- a/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/channels/FileChannel.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -174,8 +174,12 @@
      * <p> In the addition to {@code READ} and {@code WRITE}, the following
      * options may be present:
      *
-     * <table border=1 cellpadding=5 summary="">
+     * <table class="striped">
+     * <caption style="display:none">additional options</caption>
+     * <thead>
      * <tr> <th>Option</th> <th>Description</th> </tr>
+     * </thead>
+     * <tbody>
      * <tr>
      *   <td> {@link StandardOpenOption#APPEND APPEND} </td>
      *   <td> If this option is present then the file is opened for writing and
@@ -237,6 +241,7 @@
      *   href="../file/package-summary.html#integrity"> Synchronized I/O file
      *   integrity</a>). </td>
      * </tr>
+     * </tbody>
      * </table>
      *
      * <p> An implementation may also support additional options.
--- a/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -46,11 +46,15 @@
  * <p> Socket options are configured using the {@link #setOption(SocketOption,Object)
  * setOption} method. Server-socket channels support the following options:
  * <blockquote>
- * <table border summary="Socket options">
+ * <table class="striped">
+ * <caption style="display:none">Socket options</caption>
+ * <thead>
  *   <tr>
  *     <th>Option Name</th>
  *     <th>Description</th>
  *   </tr>
+ * </thead>
+ * <tbody>
  *   <tr>
  *     <td> {@link java.net.StandardSocketOptions#SO_RCVBUF SO_RCVBUF} </td>
  *     <td> The size of the socket receive buffer </td>
@@ -59,6 +63,7 @@
  *     <td> {@link java.net.StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} </td>
  *     <td> Re-use address </td>
  *   </tr>
+ * </tbody>
  * </table>
  * </blockquote>
  * Additional (implementation specific) options may also be supported.
--- a/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/channels/SocketChannel.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -66,11 +66,15 @@
  * <p> Socket options are configured using the {@link #setOption(SocketOption,Object)
  * setOption} method. Socket channels support the following options:
  * <blockquote>
- * <table border summary="Socket options">
+ * <table class="striped">
+ * <caption style="display:none">Socket options</caption>
+ * <thead>
  *   <tr>
  *     <th>Option Name</th>
  *     <th>Description</th>
  *   </tr>
+ * </thead>
+ * <tbody>
  *   <tr>
  *     <td> {@link java.net.StandardSocketOptions#SO_SNDBUF SO_SNDBUF} </td>
  *     <td> The size of the socket send buffer </td>
@@ -96,6 +100,7 @@
  *     <td> {@link java.net.StandardSocketOptions#TCP_NODELAY TCP_NODELAY} </td>
  *     <td> Disable the Nagle algorithm </td>
  *   </tr>
+ * </tbody>
  * </table>
  * </blockquote>
  * Additional (implementation specific) options may also be supported.
--- a/jdk/src/java.base/share/classes/java/nio/charset/Charset.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/charset/Charset.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -147,8 +147,12 @@
  * implementation to see if any other charsets are supported.  The behavior
  * of such optional charsets may differ between implementations.
  *
- * <blockquote><table style="width:80%" summary="Description of standard charsets">
+ * <blockquote><table class="striped" style="width:80%">
+ * <caption style="display:none">Description of standard charsets</caption>
+ * <thead>
  * <tr><th style="text-align:left">Charset</th><th style="text-align:left">Description</th></tr>
+ * </thead>
+ * <tbody>
  * <tr><td style="vertical-align:top">{@code US-ASCII}</td>
  *     <td>Seven-bit ASCII, a.k.a. {@code ISO646-US},
  *         a.k.a. the Basic Latin block of the Unicode character set</td></tr>
@@ -165,6 +169,7 @@
  * <tr><td style="vertical-align:top">{@code UTF-16}</td>
  *     <td>Sixteen-bit UCS Transformation Format,
  *         byte&nbsp;order identified by an optional byte-order mark</td></tr>
+ * </tbody>
  * </table></blockquote>
  *
  * <p> The {@code UTF-8} charset is specified by <a
--- a/jdk/src/java.base/share/classes/java/nio/file/FileSystem.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/FileSystem.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -315,7 +315,9 @@
      * that resembles regular expressions but with a simpler syntax. For example:
      *
      * <blockquote>
-     * <table border="0" summary="Pattern Language">
+     * <table class="borderless">
+     * <caption style="display:none">Pattern Language</caption>
+     * <tbody>
      * <tr>
      *   <td>{@code *.java}</td>
      *   <td>Matches a path that represents a file name ending in {@code .java}</td>
@@ -348,7 +350,7 @@
      *   platform (note that the backslash is escaped; as a string literal in the
      *   Java Language the pattern would be <code>"C:&#92;&#92;&#92;&#92;*"</code>) </td>
      * </tr>
-     *
+     * </tbody>
      * </table>
      * </blockquote>
      *
--- a/jdk/src/java.base/share/classes/java/nio/file/Files.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/Files.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -233,8 +233,12 @@
      * <p> In the addition to {@code READ} and {@code WRITE}, the following
      * options may be present:
      *
-     * <table border=1 cellpadding=5 summary="Options">
+     * <table class="striped">
+     * <caption style="display:none">Options</caption>
+     * <thead>
      * <tr> <th>Option</th> <th>Description</th> </tr>
+     * </thead>
+     * <tbody>
      * <tr>
      *   <td> {@link StandardOpenOption#APPEND APPEND} </td>
      *   <td> If this option is present then the file is opened for writing and
@@ -294,6 +298,7 @@
      *   href="package-summary.html#integrity"> Synchronized I/O file
      *   integrity</a>). </td>
      * </tr>
+     * </tbody>
      * </table>
      *
      * <p> An implementation may also support additional implementation specific
@@ -1188,8 +1193,12 @@
      *
      * <p> The {@code options} parameter may include any of the following:
      *
-     * <table border=1 cellpadding=5 summary="">
+     * <table class="striped">
+     * <caption style="display:none">Options</caption>
+     * <thead>
      * <tr> <th>Option</th> <th>Description</th> </tr>
+     * </thead>
+     * <tbody>
      * <tr>
      *   <td> {@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} </td>
      *   <td> If the target file exists, then the target file is replaced if it
@@ -1215,6 +1224,7 @@
      *     new link. In other words, the {@code COPY_ATTRIBUTES} option may be
      *     ignored when copying a symbolic link. </td>
      * </tr>
+     * </tbody>
      * </table>
      *
      * <p> An implementation of this interface may support additional
@@ -1306,8 +1316,12 @@
      *
      * <p> The {@code options} parameter may include any of the following:
      *
-     * <table border=1 cellpadding=5 summary="">
+     * <table class="striped">
+     * <caption style="display:none">Options</caption>
+     * <thead>
      * <tr> <th>Option</th> <th>Description</th> </tr>
+     * </thead>
+     * <tbody>
      * <tr>
      *   <td> {@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} </td>
      *   <td> If the target file exists, then the target file is replaced if it
@@ -1326,6 +1340,7 @@
      *     example, when the target location is on a different {@code FileStore}
      *     and would require that the file be copied, or target location is
      *     associated with a different provider to this object. </td>
+     * </tbody>
      * </table>
      *
      * <p> An implementation of this interface may support additional
@@ -1909,7 +1924,9 @@
      * attributes} parameter:
      *
      * <blockquote>
-     * <table border="0" summary="Possible values">
+     * <table class="borderless">
+     * <caption style="display:none">Possible values</caption>
+     * <tbody>
      * <tr>
      *   <td> {@code "*"} </td>
      *   <td> Read all {@link BasicFileAttributes basic-file-attributes}. </td>
@@ -1927,6 +1944,7 @@
      *   <td> {@code "posix:permissions,owner,size"} </td>
      *   <td> Reads the POSIX file permissions, owner, and file size. </td>
      * </tr>
+     * </tbody>
      * </table>
      * </blockquote>
      *
--- a/jdk/src/java.base/share/classes/java/nio/file/LinkPermission.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/LinkPermission.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -33,13 +33,16 @@
  * <p> The following table provides a summary description of what the permission
  * allows, and discusses the risks of granting code the permission.
  *
- * <table border=1 cellpadding=5
- *        summary="Table shows permission target name, what the permission allows, and associated risks">
+ * <table class="striped">
+ * <caption style="display:none">Table shows permission target name, what the permission allows, and associated risks</caption>
+ * <thead>
  * <tr>
  * <th>Permission Target Name</th>
  * <th>What the Permission Allows</th>
  * <th>Risks of Allowing this Permission</th>
  * </tr>
+ * </thead>
+ * <tbody>
  * <tr>
  *   <td>hard</td>
  *   <td> Ability to add an existing file to a directory. This is sometimes
@@ -55,6 +58,7 @@
  *   linking to any file or directory in the file system thus allowing the
  *   attacker to access to all files. </td>
  * </tr>
+ * </tbody>
  * </table>
  *
  * @since 1.7
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/AclFileAttributeView.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -94,11 +94,15 @@
  * <p> Where dynamic access to file attributes is required, the attributes
  * supported by this attribute view are as follows:
  * <blockquote>
- * <table border="1" cellpadding="8" summary="Supported attributes">
+ * <table class="striped">
+ * <caption style="display:none">Supported attributes</caption>
+ * <thead>
  *   <tr>
  *     <th> Name </th>
  *     <th> Type </th>
  *   </tr>
+ * </thead>
+ * <tbody>
  *   <tr>
  *     <td> "acl" </td>
  *     <td> {@link List}&lt;{@link AclEntry}&gt; </td>
@@ -107,6 +111,7 @@
  *     <td> "owner" </td>
  *     <td> {@link UserPrincipal} </td>
  *   </tr>
+ * </tbody>
  * </table>
  * </blockquote>
  *
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/BasicFileAttributeView.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/BasicFileAttributeView.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -41,11 +41,15 @@
  * <p> Where dynamic access to file attributes is required, the attributes
  * supported by this attribute view have the following names and types:
  * <blockquote>
- *  <table border="1" cellpadding="8" summary="Supported attributes">
+ *  <table class="striped">
+ *  <caption style="display:none">Supported attributes</caption>
+ *  <thead>
  *   <tr>
  *     <th> Name </th>
  *     <th> Type </th>
  *   </tr>
+ *  </thead>
+ *  <tbody>
  *  <tr>
  *     <td> "lastModifiedTime" </td>
  *     <td> {@link FileTime} </td>
@@ -82,6 +86,7 @@
  *     <td> "fileKey" </td>
  *     <td> {@link Object} </td>
  *   </tr>
+ * </tbody>
  * </table>
  * </blockquote>
  *
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/DosFileAttributeView.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/DosFileAttributeView.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -41,11 +41,15 @@
  * BasicFileAttributeView}, and in addition, the following attributes are
  * supported:
  * <blockquote>
- * <table border="1" cellpadding="8" summary="Supported attributes">
+ * <table class="striped">
+ * <caption style="display:none">Supported attributes</caption>
+ * <thead>
  *   <tr>
  *     <th> Name </th>
  *     <th> Type </th>
  *   </tr>
+ * </thead>
+ * <tbody>
  *   <tr>
  *     <td> readonly </td>
  *     <td> {@link Boolean} </td>
@@ -62,6 +66,7 @@
  *     <td> archive </td>
  *     <td> {@link Boolean} </td>
  *   </tr>
+ * </tbody>
  * </table>
  * </blockquote>
  *
--- a/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/PosixFileAttributeView.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -74,11 +74,15 @@
  * BasicFileAttributeView} and {@link FileOwnerAttributeView}, and in addition,
  * the following attributes are supported:
  * <blockquote>
- * <table border="1" cellpadding="8" summary="Supported attributes">
+ * <table class="striped">
+ * <caption style="display:none">Supported attributes</caption>
+ * <thead>
  *   <tr>
  *     <th> Name </th>
  *     <th> Type </th>
  *   </tr>
+ * </thead>
+ * <tbody>
  *  <tr>
  *     <td> "permissions" </td>
  *     <td> {@link Set}&lt;{@link PosixFilePermission}&gt; </td>
@@ -87,6 +91,7 @@
  *     <td> "group" </td>
  *     <td> {@link GroupPrincipal} </td>
  *   </tr>
+ * </tbody>
  * </table>
  * </blockquote>
  *
--- a/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -919,8 +919,12 @@
      * according to all of access modes specified in the {@code modes} parameter
      * as follows:
      *
-     * <table border=1 cellpadding=5 summary="">
+     * <table class="striped">
+     * <caption style="display:none">Access Modes</caption>
+     * <thead>
      * <tr> <th>Value</th> <th>Description</th> </tr>
+     * </thead>
+     * <tbody>
      * <tr>
      *   <td> {@link AccessMode#READ READ} </td>
      *   <td> Checks that the file exists and that the Java virtual machine has
@@ -940,6 +944,7 @@
      *     virtual machine has permission to search the directory in order to
      *     access file or subdirectories. </td>
      * </tr>
+     * </tbody>
      * </table>
      *
      * <p> If the {@code modes} parameter is of length zero, then the existence
--- a/jdk/src/java.base/share/classes/java/security/AlgorithmParameterGenerator.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/AlgorithmParameterGenerator.java	Thu May 25 22:33:25 2017 +0000
@@ -75,9 +75,9 @@
  * <li>{@code DSA} (1024, 2048)</li>
  * </ul>
  * These algorithms are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameterGenerator">
+ * "{@docRoot}/../specs/security/standard-names.html#algorithmparametergenerator-algorithms">
  * AlgorithmParameterGenerator section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other algorithms are supported.
  *
@@ -150,8 +150,8 @@
      * @param algorithm the name of the algorithm this
      * parameter generator is associated with.
      * See the AlgorithmParameterGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameterGenerator">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#algorithmparametergenerator-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @return the new {@code AlgorithmParameterGenerator} object
@@ -195,8 +195,8 @@
      * @param algorithm the name of the algorithm this
      * parameter generator is associated with.
      * See the AlgorithmParameterGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameterGenerator">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#algorithmparametergenerator-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the string name of the Provider.
@@ -245,8 +245,8 @@
      * @param algorithm the string name of the algorithm this
      * parameter generator is associated with.
      * See the AlgorithmParameterGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameterGenerator">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#algorithmparametergenerator-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the {@code Provider} object.
--- a/jdk/src/java.base/share/classes/java/security/AlgorithmParameters.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/AlgorithmParameters.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -57,9 +57,9 @@
  * <li>{@code DSA}</li>
  * </ul>
  * These algorithms are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameters">
+ * "{@docRoot}/../specs/security/standard-names.html#algorithmparameters-algorithms">
  * AlgorithmParameters section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other algorithms are supported.
  *
@@ -137,8 +137,8 @@
      *
      * @param algorithm the name of the algorithm requested.
      * See the AlgorithmParameters section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameters">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#algorithmparameters-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @return the new parameter object
@@ -182,8 +182,8 @@
      *
      * @param algorithm the name of the algorithm requested.
      * See the AlgorithmParameters section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameters">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#algorithmparameters-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the name of the provider.
@@ -232,8 +232,8 @@
      *
      * @param algorithm the name of the algorithm requested.
      * See the AlgorithmParameters section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameters">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#algorithmparameters-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the name of the provider.
--- a/jdk/src/java.base/share/classes/java/security/DrbgParameters.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/DrbgParameters.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -188,7 +188,7 @@
  * @implSpec
  * By convention, a provider should name its primary DRBG implementation
  * with the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecureRandom">
+ * "{@docRoot}/../specs/security/standard-names.html#securerandom-number-generation-algorithms">
  * standard {@code SecureRandom} algorithm name</a> "DRBG".
  *
  * @implNote
@@ -263,14 +263,19 @@
      * Capability effective = ((DrbgParametes.Initiate) s.getParameters())
      *         .getCapability();</pre>
      * </blockquote>
-     * <table border=1 summary="requested and effective capabilities">
+     * <table class="plain">
+     * <caption style="display:none">requested and effective capabilities</caption>
+     * <thead>
      * <tr>
      * <th>Requested Value</th>
      * <th>Possible Effective Values</th>
      * </tr>
+     * </thead>
+     * <tbody>
      * <tr><td>NONE</td><td>NONE, RESEED_ONLY, PR_AND_RESEED</td></tr>
      * <tr><td>RESEED_ONLY</td><td>RESEED_ONLY, PR_AND_RESEED</td></tr>
      * <tr><td>PR_AND_RESEED</td><td>PR_AND_RESEED</td></tr>
+     * </tbody>
      * </table>
      * <p>
      * A DRBG implementation supporting prediction resistance must also
--- a/jdk/src/java.base/share/classes/java/security/Key.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/Key.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -82,7 +82,7 @@
  * <p> A Key should use KeyRep as its serialized representation.
  * Note that a serialized Key may contain sensitive information
  * which should not be exposed in untrusted environments.  See the
- * <a href="../../../platform/serialization/spec/security.html">
+ * <a href="{@docRoot}/../specs/serialization/security.html">
  * Security Appendix</a>
  * of the Serialization Specification for more information.
  *
--- a/jdk/src/java.base/share/classes/java/security/KeyFactory.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/KeyFactory.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -75,9 +75,9 @@
  * <li>{@code RSA}</li>
  * </ul>
  * These algorithms are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyFactory">
+ * "{@docRoot}/../specs/security/standard-names.html#keyfactory-algorithms">
  * KeyFactory section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other algorithms are supported.
  *
@@ -163,8 +163,8 @@
      *
      * @param algorithm the name of the requested key algorithm.
      * See the KeyFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyFactory">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keyfactory-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @return the new {@code KeyFactory} object
@@ -197,8 +197,8 @@
      *
      * @param algorithm the name of the requested key algorithm.
      * See the KeyFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyFactory">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keyfactory-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the name of the provider.
@@ -239,8 +239,8 @@
      *
      * @param algorithm the name of the requested key algorithm.
      * See the KeyFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyFactory">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keyfactory-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the provider.
--- a/jdk/src/java.base/share/classes/java/security/KeyPairGenerator.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/KeyPairGenerator.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -114,9 +114,9 @@
  * <li>{@code RSA} (1024, 2048, 4096)</li>
  * </ul>
  * These algorithms are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyPairGenerator">
+ * "{@docRoot}/../specs/security/standard-names.html#keypairgenerator-algorithms">
  * KeyPairGenerator section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other algorithms are supported.
  *
@@ -142,8 +142,8 @@
      *
      * @param algorithm the standard string name of the algorithm.
      * See the KeyPairGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyPairGenerator">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keypairgenerator-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      */
     protected KeyPairGenerator(String algorithm) {
@@ -153,8 +153,8 @@
     /**
      * Returns the standard name of the algorithm for this key pair generator.
      * See the KeyPairGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyPairGenerator">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keypairgenerator-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @return the standard string name of the algorithm.
@@ -205,8 +205,8 @@
      *
      * @param algorithm the standard string name of the algorithm.
      * See the KeyPairGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyPairGenerator">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keypairgenerator-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @return the new {@code KeyPairGenerator} object
@@ -264,8 +264,8 @@
      *
      * @param algorithm the standard string name of the algorithm.
      * See the KeyPairGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyPairGenerator">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keypairgenerator-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the string name of the provider.
@@ -306,8 +306,8 @@
      *
      * @param algorithm the standard string name of the algorithm.
      * See the KeyPairGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyPairGenerator">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keypairgenerator-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the provider.
--- a/jdk/src/java.base/share/classes/java/security/KeyRep.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/KeyRep.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -42,7 +42,7 @@
  *
  * Note that a serialized Key may contain sensitive information
  * which should not be exposed in untrusted environments.  See the
- * <a href="../../../platform/serialization/spec/security.html">
+ * <a href="{@docRoot}/../specs/serialization/security.html">
  * Security Appendix</a>
  * of the Serialization Specification for more information.
  *
--- a/jdk/src/java.base/share/classes/java/security/KeyStore.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/KeyStore.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -176,9 +176,9 @@
  * <li>{@code PKCS12}</li>
  * </ul>
  * This type is described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyStore">
+ * "{@docRoot}/../specs/security/standard-names.html#keystore-types">
  * KeyStore section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other types are supported.
  *
@@ -291,9 +291,8 @@
          * @param protectionAlgorithm the encryption algorithm name, for
          *     example, {@code PBEWithHmacSHA256AndAES_256}.
          *     See the Cipher section in the <a href=
-         * "{@docRoot}/../technotes/guides/security/StandardNames.html#Cipher">
-         * Java Cryptography Architecture Standard Algorithm Name
-         * Documentation</a>
+         * "{@docRoot}/../specs/security/standard-names.html#cipher-algorithm-names">
+         * Java Security Standard Algorithm Names Specification</a>
          *     for information about standard encryption algorithm names.
          * @param protectionParameters the encryption algorithm parameter
          *     specification, which may be {@code null}
@@ -854,8 +853,8 @@
      *
      * @param type the type of keystore.
      * See the KeyStore section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyStore">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keystore-types">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard keystore types.
      *
      * @return a keystore object of the specified type
@@ -895,8 +894,8 @@
      *
      * @param type the type of keystore.
      * See the KeyStore section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyStore">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keystore-types">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard keystore types.
      *
      * @param provider the name of the provider.
@@ -941,8 +940,8 @@
      *
      * @param type the type of keystore.
      * See the KeyStore section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyStore">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keystore-types">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard keystore types.
      *
      * @param provider the provider.
--- a/jdk/src/java.base/share/classes/java/security/MessageDigest.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/MessageDigest.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -89,9 +89,9 @@
  * <li>{@code SHA-256}</li>
  * </ul>
  * These algorithms are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#MessageDigest">
+ * "{@docRoot}/../specs/security/standard-names.html#messagedigest-algorithms">
  * MessageDigest section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other algorithms are supported.
  *
@@ -123,8 +123,8 @@
      *
      * @param algorithm the standard name of the digest algorithm.
      * See the MessageDigest section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#MessageDigest">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#messagedigest-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      */
     protected MessageDigest(String algorithm) {
@@ -154,8 +154,8 @@
      *
      * @param algorithm the name of the algorithm requested.
      * See the MessageDigest section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#MessageDigest">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#messagedigest-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @return a {@code MessageDigest} object that implements the
@@ -209,8 +209,8 @@
      *
      * @param algorithm the name of the algorithm requested.
      * See the MessageDigest section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#MessageDigest">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#messagedigest-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the name of the provider.
@@ -262,8 +262,8 @@
      *
      * @param algorithm the name of the algorithm requested.
      * See the MessageDigest section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#MessageDigest">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#messagedigest-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the provider.
@@ -497,8 +497,8 @@
      * implementation details. The name should be a standard
      * Java Security name (such as "SHA", "MD5", and so on).
      * See the MessageDigest section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#MessageDigest">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#messagedigest-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @return the name of the algorithm
--- a/jdk/src/java.base/share/classes/java/security/Policy.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/Policy.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -365,8 +365,8 @@
      *
      * @param type the specified Policy type.  See the Policy section in the
      *    <a href=
-     *    "{@docRoot}/../technotes/guides/security/StandardNames.html#Policy">
-     *    Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     *    "{@docRoot}/../specs/security/standard-names.html#policy-types">
+     *    Java Security Standard Algorithm Names Specification</a>
      *    for a list of standard Policy types.
      *
      * @param params parameters for the Policy, which may be null.
@@ -419,8 +419,8 @@
      *
      * @param type the specified Policy type.  See the Policy section in the
      *    <a href=
-     *    "{@docRoot}/../technotes/guides/security/StandardNames.html#Policy">
-     *    Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     *    "{@docRoot}/../specs/security/standard-names.html#policy-types">
+     *    Java Security Standard Algorithm Names Specification</a>
      *    for a list of standard Policy types.
      *
      * @param params parameters for the Policy, which may be null.
@@ -485,8 +485,8 @@
      *
      * @param type the specified Policy type.  See the Policy section in the
      *    <a href=
-     *    "{@docRoot}/../technotes/guides/security/StandardNames.html#Policy">
-     *    Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     *    "{@docRoot}/../specs/security/standard-names.html#policy-types">
+     *    Java Security Standard Algorithm Names Specification</a>
      *    for a list of standard Policy types.
      *
      * @param params parameters for the Policy, which may be null.
--- a/jdk/src/java.base/share/classes/java/security/Provider.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/Provider.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -61,17 +61,21 @@
  * security framework. Services of this type cannot be added, removed,
  * or modified by applications.
  * The following attributes are automatically placed in each Provider object:
- * <table cellspacing=4>
+ * <table class="plain">
  * <caption><b>Attributes Automatically Placed in a Provider Object</b></caption>
+ * <thead>
  * <tr><th>Name</th><th>Value</th>
+ * </thead>
+ * <tbody>
  * <tr><td>{@code Provider.id name}</td>
-  *    <td>{@code String.valueOf(provider.getName())}</td>
+ *     <td>{@code String.valueOf(provider.getName())}</td>
  * <tr><td>{@code Provider.id version}</td>
  *     <td>{@code String.valueOf(provider.getVersionStr())}</td>
  * <tr><td>{@code Provider.id info}</td>
-       <td>{@code String.valueOf(provider.getInfo())}</td>
+ *     <td>{@code String.valueOf(provider.getInfo())}</td>
  * <tr><td>{@code Provider.id className}</td>
  *     <td>{@code provider.getClass().getName()}</td>
+ * </tbody>
  * </table>
  *
  * <p>Each provider has a name and a version string. A provider normally
--- a/jdk/src/java.base/share/classes/java/security/SecureRandom.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/SecureRandom.java	Thu May 25 22:33:25 2017 +0000
@@ -126,7 +126,7 @@
  * @implSpec
  * A {@code SecureRandom} service provider can advertise that it is thread-safe
  * by setting the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#Service">service
+ * "{@docRoot}/../specs/security/standard-names.html#service-attributes">service
  * provider attribute</a> "ThreadSafe" to "true" when registering the provider.
  * Otherwise, this class will instead synchronize access to the following
  * methods of the {@code SecureRandomSpi} implementation:
@@ -203,8 +203,8 @@
      * the {@link Security#getProviders() Security.getProviders()} method.
      *
      * <p> See the {@code SecureRandom} section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecureRandom">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#securerandom-number-generation-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard RNG algorithm names.
      */
     public SecureRandom() {
@@ -244,8 +244,8 @@
      * the {@link Security#getProviders() Security.getProviders()} method.
      *
      * <p> See the {@code SecureRandom} section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecureRandom">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#securerandom-number-generation-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard RNG algorithm names.
      *
      * @param seed the seed.
@@ -341,8 +341,8 @@
      *
      * @param algorithm the name of the RNG algorithm.
      * See the {@code SecureRandom} section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecureRandom">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#securerandom-number-generation-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard RNG algorithm names.
      *
      * @return the new {@code SecureRandom} object
@@ -380,8 +380,8 @@
      *
      * @param algorithm the name of the RNG algorithm.
      * See the {@code SecureRandom} section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecureRandom">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#securerandom-number-generation-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard RNG algorithm names.
      *
      * @param provider the name of the provider.
@@ -424,8 +424,8 @@
      *
      * @param algorithm the name of the RNG algorithm.
      * See the {@code SecureRandom} section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecureRandom">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#securerandom-number-generation-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard RNG algorithm names.
      *
      * @param provider the provider.
@@ -478,8 +478,8 @@
      *
      * @param algorithm the name of the RNG algorithm.
      * See the {@code SecureRandom} section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecureRandom">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#securerandom-number-generation-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard RNG algorithm names.
      *
      * @param params the {@code SecureRandomParameters}
@@ -528,8 +528,8 @@
      *
      * @param algorithm the name of the RNG algorithm.
      * See the {@code SecureRandom} section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecureRandom">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#securerandom-number-generation-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard RNG algorithm names.
      *
      * @param params the {@code SecureRandomParameters}
@@ -581,8 +581,8 @@
      *
      * @param algorithm the name of the RNG algorithm.
      * See the {@code SecureRandom} section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecureRandom">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#securerandom-number-generation-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard RNG algorithm names.
      *
      * @param params the {@code SecureRandomParameters}
--- a/jdk/src/java.base/share/classes/java/security/SecureRandomSpi.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/SecureRandomSpi.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -65,7 +65,7 @@
  * will synchronize access to each of the applicable engine methods
  * (see {@link SecureRandom} for the list of methods). However, if a
  * {@code SecureRandomSpi} implementation is thread-safe, the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#Service">
+ * "{@docRoot}/../specs/security/standard-names.html#service-attributes">
  * service provider attribute</a> "ThreadSafe" should be set to "true" during
  * its registration, as follows:
  * <blockquote><pre>
--- a/jdk/src/java.base/share/classes/java/security/Security.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/Security.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -281,8 +281,8 @@
     /**
      * Gets a specified property for an algorithm. The algorithm name
      * should be a standard name. See the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * One possible use is by specialized algorithm parsers, which may map
@@ -511,8 +511,8 @@
      * </ul>
      *
      * <p> See the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard cryptographic service names, standard
      * algorithm names and standard attribute names.
      *
@@ -582,8 +582,8 @@
      * </ul>
      *
      * <p> See the <a href=
-     * "../../../technotes/guides/security/StandardNames.html">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard cryptographic service names, standard
      * algorithm names and standard attribute names.
      *
--- a/jdk/src/java.base/share/classes/java/security/SecurityPermission.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/SecurityPermission.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -45,12 +45,16 @@
  * target names, and for each provides a description of what the permission
  * allows and a discussion of the risks of granting code the permission.
  *
- * <table border=1 cellpadding=5 summary="target name,what the permission allows, and associated risks">
+ * <table class="striped">
+ * <caption style="display:none">target name, what the permission allows, and associated risks</caption>
+ * <thead>
  * <tr>
  * <th>Permission Target Name</th>
  * <th>What the Permission Allows</th>
  * <th>Risks of Allowing this Permission</th>
  * </tr>
+ * </thead>
+ * <tbody>
  *
  * <tr>
  *   <td>authProvider.{provider name}</td>
@@ -196,6 +200,7 @@
  * described under the "removeProvider.{provider name}" permission.</td>
  * </tr>
  *
+ * </tbody>
  * </table>
  *
  * <P>
@@ -204,13 +209,17 @@
  * {@link IdentityScope}, {@link Signer}. Use of them is discouraged. See the
  * applicable classes for more information.
  *
- * <table border=1 cellpadding=5 summary="target name,what the permission allows, and associated risks">
+ * <table class="striped">
+ * <caption style="display:none">target name, what the permission allows, and associated risks</caption>
+ * <thead>
  * <tr>
  * <th>Permission Target Name</th>
  * <th>What the Permission Allows</th>
  * <th>Risks of Allowing this Permission</th>
  * </tr>
+ * </thead>
  *
+ * <tbody>
  * <tr>
  *   <td>insertProvider.{provider name}</td>
  *   <td>Addition of a new provider, with the specified name</td>
@@ -308,6 +317,7 @@
  * data encrypted under that session key.</td>
  * </tr>
  *
+ * </tbody>
  * </table>
  *
  * @implNote
--- a/jdk/src/java.base/share/classes/java/security/Signature.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/Signature.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -106,9 +106,9 @@
  * <li>{@code SHA256withRSA}</li>
  * </ul>
  * These algorithms are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#Signature">
+ * "{@docRoot}/../specs/security/standard-names.html#signature-algorithms">
  * Signature section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other algorithms are supported.
  *
@@ -164,8 +164,8 @@
      *
      * @param algorithm the standard string name of the algorithm.
      * See the Signature section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#Signature">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#signature-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      */
     protected Signature(String algorithm) {
@@ -209,8 +209,8 @@
      *
      * @param algorithm the standard name of the algorithm requested.
      * See the Signature section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#Signature">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#signature-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @return the new {@code Signature} object
@@ -332,8 +332,8 @@
      *
      * @param algorithm the name of the algorithm requested.
      * See the Signature section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#Signature">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#signature-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the name of the provider.
@@ -385,8 +385,8 @@
      *
      * @param algorithm the name of the algorithm requested.
      * See the Signature section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#Signature">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#signature-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the provider.
--- a/jdk/src/java.base/share/classes/java/security/cert/CertPath.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertPath.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -91,9 +91,9 @@
  * <li>{@code PkiPath}</li>
  * </ul>
  * These encodings are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathEncodings">
+ * "{@docRoot}/../specs/security/standard-names.html#certpath-encodings">
  * CertPath Encodings section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other encodings are supported.
  * <p>
--- a/jdk/src/java.base/share/classes/java/security/cert/CertPathBuilder.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertPathBuilder.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -72,9 +72,9 @@
  * <li>{@code PKIX}</li>
  * </ul>
  * This algorithm is described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathBuilder">
+ * "{@docRoot}/../specs/security/standard-names.html#certpathbuilder-algorithms">
  * CertPathBuilder section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other algorithms are supported.
  *
@@ -152,8 +152,8 @@
      *
      * @param algorithm the name of the requested {@code CertPathBuilder}
      *  algorithm.  See the CertPathBuilder section in the <a href=
-     *  "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathBuilder">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     *  "{@docRoot}/../specs/security/standard-names.html#certpathbuilder-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @return a {@code CertPathBuilder} object that implements the
@@ -190,8 +190,8 @@
      *
      * @param algorithm the name of the requested {@code CertPathBuilder}
      *  algorithm.  See the CertPathBuilder section in the <a href=
-     *  "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathBuilder">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     *  "{@docRoot}/../specs/security/standard-names.html#certpathbuilder-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the name of the provider.
@@ -233,8 +233,8 @@
      *
      * @param algorithm the name of the requested {@code CertPathBuilder}
      *  algorithm.  See the CertPathBuilder section in the <a href=
-     *  "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathBuilder">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     *  "{@docRoot}/../specs/security/standard-names.html#certpathbuilder-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the provider.
--- a/jdk/src/java.base/share/classes/java/security/cert/CertPathValidator.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertPathValidator.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -74,9 +74,9 @@
  * <li>{@code PKIX}</li>
  * </ul>
  * This algorithm is described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathValidator">
+ * "{@docRoot}/../specs/security/standard-names.html#certpathvalidator-algorithms">
  * CertPathValidator section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other algorithms are supported.
  *
@@ -152,9 +152,9 @@
      * {@link Security#getProviders() Security.getProviders()}.
      *
      * @param algorithm the name of the requested {@code CertPathValidator}
-     *  algorithm. See the CertPathValidator section in the <a href=
-     *  "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathValidator">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * algorithm. See the CertPathValidator section in the <a href=
+     * "{@docRoot}/../specs/security/standard-names.html#certpathvalidator-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @return a {@code CertPathValidator} object that implements the
@@ -190,9 +190,9 @@
      * the {@link Security#getProviders() Security.getProviders()} method.
      *
      * @param algorithm the name of the requested {@code CertPathValidator}
-     *  algorithm. See the CertPathValidator section in the <a href=
-     *  "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathValidator">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * algorithm. See the CertPathValidator section in the <a href=
+     * "{@docRoot}/../specs/security/standard-names.html#certpathvalidator-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the name of the provider.
@@ -235,8 +235,8 @@
      *
      * @param algorithm the name of the requested {@code CertPathValidator}
      * algorithm. See the CertPathValidator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathValidator">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#certpathvalidator-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the provider.
--- a/jdk/src/java.base/share/classes/java/security/cert/CertStore.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertStore.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -67,9 +67,9 @@
  * <li>{@code Collection}</li>
  * </ul>
  * This type is described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertStore">
+ * "{@docRoot}/../specs/security/standard-names.html#certstore-types">
  * CertStore section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other types are supported.
  *
@@ -212,8 +212,8 @@
      *
      * @param type the name of the requested {@code CertStore} type.
      * See the CertStore section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertStore">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#certstore-types">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard types.
      *
      * @param params the initialization parameters (may be {@code null}).
@@ -276,8 +276,8 @@
      *
      * @param type the requested {@code CertStore} type.
      * See the CertStore section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertStore">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#certstore-types">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard types.
      *
      * @param params the initialization parameters (may be {@code null}).
@@ -337,8 +337,8 @@
      *
      * @param type the requested {@code CertStore} type.
      * See the CertStore section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertStore">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#certstore-types">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard types.
      *
      * @param params the initialization parameters (may be {@code null}).
--- a/jdk/src/java.base/share/classes/java/security/cert/Certificate.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/cert/Certificate.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -74,8 +74,8 @@
      *
      * @param type the standard name of the certificate type.
      * See the CertificateFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertificateFactory">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#certificatefactory-types">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard certificate types.
      */
     protected Certificate(String type) {
--- a/jdk/src/java.base/share/classes/java/security/cert/CertificateFactory.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertificateFactory.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -101,11 +101,11 @@
  * <li>{@code PkiPath}</li>
  * </ul>
  * The type and encodings are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertificateFactory">
+ * "{@docRoot}/../specs/security/standard-names.html#certificatefactory-types">
  * CertificateFactory section</a> and the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathEncodings">
+ * "{@docRoot}/../specs/security/standard-names.html#certpath-encodings">
  * CertPath Encodings section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other types or encodings are supported.
  *
@@ -172,8 +172,8 @@
      *
      * @param type the name of the requested certificate type.
      * See the CertificateFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertificateFactory">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#certificatefactory-types">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard certificate types.
      *
      * @return a certificate factory object for the specified type
@@ -213,8 +213,8 @@
      *
      * @param type the certificate type.
      * See the CertificateFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertificateFactory">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#certificatefactory-types">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard certificate types.
      *
      * @param provider the name of the provider.
@@ -260,8 +260,8 @@
      *
      * @param type the certificate type.
      * See the CertificateFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertificateFactory">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#certificatefactory-types">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard certificate types.
      * @param provider the provider.
      *
@@ -359,8 +359,8 @@
      * Returns an iteration of the {@code CertPath} encodings supported
      * by this certificate factory, with the default encoding first. See
      * the CertPath Encodings section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathEncodings">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#certpath-encodings">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard encoding names and their formats.
      * <p>
      * Attempts to modify the returned {@code Iterator} via its
@@ -399,8 +399,8 @@
      * the data read from the {@code InputStream} inStream. The data
      * is assumed to be in the specified encoding. See
      * the CertPath Encodings section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathEncodings">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#certpath-encodings">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard encoding names and their formats.
      *
      * @param inStream an {@code InputStream} containing the data
--- a/jdk/src/java.base/share/classes/java/security/cert/CertificateFactorySpi.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertificateFactorySpi.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -183,8 +183,8 @@
      * Returns an iteration of the {@code CertPath} encodings supported
      * by this certificate factory, with the default encoding first. See
      * the CertPath Encodings section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertPathEncodings">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#certpath-encodings">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard encoding names.
      * <p>
      * Attempts to modify the returned {@code Iterator} via its
--- a/jdk/src/java.base/share/classes/java/security/cert/X509Extension.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/cert/X509Extension.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -152,10 +152,14 @@
      * by periods.
      *
      * <p>For example:<br>
-     * <table border=groove summary="Examples of OIDs and extension names">
+     * <table class="plain">
+     * <caption style="display:none">Examples of OIDs and extension names</caption>
+     * <thead>
      * <tr>
      * <th>OID <em>(Object Identifier)</em></th>
      * <th>Extension Name</th></tr>
+     * </thead>
+     * <tbody>
      * <tr><td>2.5.29.14</td>
      * <td>SubjectKeyIdentifier</td></tr>
      * <tr><td>2.5.29.15</td>
@@ -176,6 +180,7 @@
      * <td>AuthorityKeyIdentifier</td></tr>
      * <tr><td>2.5.29.36</td>
      * <td>PolicyConstraints</td></tr>
+     * </tbody>
      * </table>
      *
      * @param oid the Object Identifier value for the extension.
--- a/jdk/src/java.base/share/classes/java/security/cert/package-info.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/cert/package-info.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -39,10 +39,9 @@
  *     Certificate Revocation List (CRL) Profile
  *   <li>RFC 2560: X.509 Internet Public Key Infrastructure Online Certificate
  *     Status Protocol - OCSP
- *   <li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html">
- *     <b>Java&trade;
- *     Cryptography Architecture Standard Algorithm Name
- *     Documentation</b></a></li>
+ *   <li><a href="{@docRoot}/../specs/security/standard-names.html">
+ *     <b>Java&trade; Security Standard Algorithm Names Specification
+ *     </b></a></li>
  * </ul>
  *
  * <h2>Related Documentation</h2>
--- a/jdk/src/java.base/share/classes/java/security/package-info.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/package-info.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -53,10 +53,9 @@
  *   <li>PKCS #8: Private-Key Information Syntax Standard, Version 1.2,
  *     November 1993</li>
  *
- *   <li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html">
- *     <b>Java&trade;
- *     Cryptography Architecture Standard Algorithm Name
- *     Documentation</b></a></li>
+ *   <li><a href="{@docRoot}/../specs/security/standard-names.html">
+ *     <b>Java&trade; Security Standard Algorithm Names Specification
+ *     </b></a></li>
  * </ul>
  *
  * <h2>Related Documentation</h2>
--- a/jdk/src/java.base/share/classes/java/security/spec/EncodedKeySpec.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/spec/EncodedKeySpec.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -67,8 +67,8 @@
      * array are copied to protect against subsequent modification.
      * @param algorithm the algorithm name of the encoded key
      * See the KeyFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyFactory">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keyfactory-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      * @throws NullPointerException if {@code encodedKey}
      * or {@code algorithm} is null.
--- a/jdk/src/java.base/share/classes/java/security/spec/PKCS8EncodedKeySpec.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/spec/PKCS8EncodedKeySpec.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -85,8 +85,8 @@
      * the array are copied to protect against subsequent modification.
      * @param algorithm the algorithm name of the encoded private key
      * See the KeyFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyFactory">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keyfactory-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      * @throws NullPointerException if {@code encodedKey}
      * or {@code algorithm} is null.
--- a/jdk/src/java.base/share/classes/java/security/spec/X509EncodedKeySpec.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/security/spec/X509EncodedKeySpec.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -75,8 +75,8 @@
      * array are copied to protect against subsequent modification.
      * @param algorithm the algorithm name of the encoded public key
      * See the KeyFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyFactory">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keyfactory-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      * @throws NullPointerException if {@code encodedKey}
      * or {@code algorithm} is null.
--- a/jdk/src/java.base/share/classes/java/text/DecimalFormat.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/text/DecimalFormat.java	Thu May 25 22:33:25 2017 +0000
@@ -172,19 +172,22 @@
  * are not localized.
  *
  * <blockquote>
- * <table border=0 cellspacing=3 cellpadding=0 summary="Chart showing symbol,
- *  location, localized, and meaning.">
- *     <tr style="background-color: rgb(204, 204, 255);">
+ * <table class="striped">
+ * <caption style="display:none">Chart showing symbol, location, localized, and meaning.</caption>
+ * <thead>
+ *     <tr>
  *          <th style="text-align:left">Symbol
  *          <th style="text-align:left">Location
  *          <th style="text-align:left">Localized?
  *          <th style="text-align:left">Meaning
+ * </thead>
+ * <tbody>
  *     <tr style="vertical-align:top">
  *          <td><code>0</code>
  *          <td>Number
  *          <td>Yes
  *          <td>Digit
- *     <tr style="vertical-align: top; background-color: rgb(238, 238, 255);">
+ *     <tr style="vertical-align: top">
  *          <td><code>#</code>
  *          <td>Number
  *          <td>Yes
@@ -194,7 +197,7 @@
  *          <td>Number
  *          <td>Yes
  *          <td>Decimal separator or monetary decimal separator
- *     <tr style="vertical-align: top; background-color: rgb(238, 238, 255);">
+ *     <tr style="vertical-align: top">
  *          <td><code>-</code>
  *          <td>Number
  *          <td>Yes
@@ -204,7 +207,7 @@
  *          <td>Number
  *          <td>Yes
  *          <td>Grouping separator
- *     <tr style="vertical-align: top; background-color: rgb(238, 238, 255);">
+ *     <tr style="vertical-align: top">
  *          <td><code>E</code>
  *          <td>Number
  *          <td>Yes
@@ -215,7 +218,7 @@
  *          <td>Subpattern boundary
  *          <td>Yes
  *          <td>Separates positive and negative subpatterns
- *     <tr style="vertical-align: top; background-color: rgb(238, 238, 255);">
+ *     <tr style="vertical-align: top">
  *          <td><code>%</code>
  *          <td>Prefix or suffix
  *          <td>Yes
@@ -225,7 +228,7 @@
  *          <td>Prefix or suffix
  *          <td>Yes
  *          <td>Multiply by 1000 and show as per mille value
- *     <tr style="vertical-align: top; background-color: rgb(238, 238, 255);">
+ *     <tr style="vertical-align: top">
  *          <td><code>&#164;</code> (<code>&#92;u00A4</code>)
  *          <td>Prefix or suffix
  *          <td>No
@@ -241,6 +244,7 @@
  *              for example, <code>"'#'#"</code> formats 123 to
  *              <code>"#123"</code>.  To create a single quote
  *              itself, use two in a row: <code>"# o''clock"</code>.
+ * </tbody>
  * </table>
  * </blockquote>
  *
@@ -3197,13 +3201,6 @@
         isCurrencyFormat = false;
         useExponentialNotation = false;
 
-        // Two variables are used to record the subrange of the pattern
-        // occupied by phase 1.  This is used during the processing of the
-        // second pattern (the one representing negative numbers) to ensure
-        // that no deviation exists in phase 1 between the two patterns.
-        int phaseOneStart = 0;
-        int phaseOneLength = 0;
-
         int start = 0;
         for (int j = 1; j >= 0 && start < pattern.length(); --j) {
             boolean inQuote = false;
@@ -3254,9 +3251,6 @@
                             ch == groupingSeparator ||
                             ch == decimalSeparator) {
                             phase = 1;
-                            if (j == 1) {
-                                phaseOneStart = pos;
-                            }
                             --pos; // Reprocess this character
                             continue;
                         } else if (ch == CURRENCY_SIGN) {
@@ -3327,17 +3321,29 @@
                     break;
 
                 case 1:
-                    // Phase one must be identical in the two sub-patterns. We
-                    // enforce this by doing a direct comparison. While
-                    // processing the first sub-pattern, we just record its
-                    // length. While processing the second, we compare
-                    // characters.
-                    if (j == 1) {
-                        ++phaseOneLength;
-                    } else {
-                        if (--phaseOneLength == 0) {
-                            phase = 2;
-                            affix = suffix;
+                    // The negative subpattern (j = 0) serves only to specify the
+                    // negative prefix and suffix, so all the phase 1 characters
+                    // e.g. digits, zeroDigit, groupingSeparator,
+                    // decimalSeparator, exponent are ignored
+                    if (j == 0) {
+                        while (pos < pattern.length()) {
+                            char negPatternChar = pattern.charAt(pos);
+                            if (negPatternChar == digit
+                                    || negPatternChar == zeroDigit
+                                    || negPatternChar == groupingSeparator
+                                    || negPatternChar == decimalSeparator) {
+                                ++pos;
+                            } else if (pattern.regionMatches(pos, exponent,
+                                    0, exponent.length())) {
+                                pos = pos + exponent.length();
+                            } else {
+                                // Not a phase 1 character, consider it as
+                                // suffix and parse it in phase 2
+                                --pos; //process it again in outer loop
+                                phase = 2;
+                                affix = suffix;
+                                break;
+                            }
                         }
                         continue;
                     }
@@ -3391,7 +3397,6 @@
                          while (pos < pattern.length() &&
                                pattern.charAt(pos) == zeroDigit) {
                             ++minExponentDigits;
-                            ++phaseOneLength;
                             ++pos;
                         }
 
@@ -3410,7 +3415,6 @@
                         phase = 2;
                         affix = suffix;
                         --pos;
-                        --phaseOneLength;
                         continue;
                     }
                     break;
--- a/jdk/src/java.base/share/classes/java/text/MessageFormat.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/text/MessageFormat.java	Thu May 25 22:33:25 2017 +0000
@@ -146,11 +146,15 @@
  * shown in the table are illegal. A <i>SubformatPattern</i> must
  * be a valid pattern string for the {@code Format} subclass used.
  *
- * <table border=1 summary="Shows how FormatType and FormatStyle values map to Format instances">
+ * <table class="plain">
+ * <caption style="display:none">Shows how FormatType and FormatStyle values map to Format instances</caption>
+ * <thead>
  *    <tr>
  *       <th id="ft" class="TableHeadingColor">FormatType
  *       <th id="fs" class="TableHeadingColor">FormatStyle
  *       <th id="sc" class="TableHeadingColor">Subformat Created
+ * </thead>
+ * <tbody>
  *    <tr>
  *       <td headers="ft"><i>(none)</i>
  *       <td headers="fs"><i>(none)</i>
@@ -213,6 +217,7 @@
  *       <td headers="ft"><code>choice</code>
  *       <td headers="fs"><i>SubformatPattern</i>
  *       <td headers="sc">{@code new} {@link ChoiceFormat#ChoiceFormat(String) ChoiceFormat}{@code (subformatPattern)}
+ * </tbody>
  * </table>
  *
  * <h4>Usage Information</h4>
@@ -766,11 +771,15 @@
      * argument is <i>unavailable</i> if <code>arguments</code> is
      * <code>null</code> or has fewer than argumentIndex+1 elements.
      *
-     * <table border=1 summary="Examples of subformat,argument,and formatted text">
+     * <table class="plain">
+     * <caption style="display:none">Examples of subformat,argument,and formatted text</caption>
+     * <thead>
      *    <tr>
      *       <th>Subformat
      *       <th>Argument
      *       <th>Formatted Text
+     * </thead>
+     * <tbody>
      *    <tr>
      *       <td><i>any</i>
      *       <td><i>unavailable</i>
@@ -805,6 +814,7 @@
      *       <td><code>null</code>
      *       <td><i>any</i>
      *       <td><code>argument.toString()</code>
+     * </tbody>
      * </table>
      * <p>
      * If <code>pos</code> is non-null, and refers to
--- a/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java	Thu May 25 22:33:25 2017 +0000
@@ -92,18 +92,22 @@
  * <code>'A'</code> to <code>'Z'</code> and from <code>'a'</code> to
  * <code>'z'</code> are reserved):
  * <blockquote>
- * <table border=0 cellspacing=3 cellpadding=0 summary="Chart shows pattern letters, date/time component, presentation, and examples.">
- *     <tr style="background-color: rgb(204, 204, 255);">
+ * <table class="striped">
+ * <caption style="display:none">Chart shows pattern letters, date/time component, presentation, and examples.</caption>
+ * <thead>
+ *     <tr>
  *         <th style="text-align:left">Letter
  *         <th style="text-align:left">Date or Time Component
  *         <th style="text-align:left">Presentation
  *         <th style="text-align:left">Examples
+ * </thead>
+ * <tbody>
  *     <tr>
  *         <td><code>G</code>
  *         <td>Era designator
  *         <td><a href="#text">Text</a>
  *         <td><code>AD</code>
- *     <tr style="background-color: rgb(238, 238, 255);">
+ *     <tr>
  *         <td><code>y</code>
  *         <td>Year
  *         <td><a href="#year">Year</a>
@@ -113,7 +117,7 @@
  *         <td>Week year
  *         <td><a href="#year">Year</a>
  *         <td><code>2009</code>; <code>09</code>
- *     <tr style="background-color: rgb(238, 238, 255);">
+ *     <tr>
  *         <td><code>M</code>
  *         <td>Month in year (context sensitive)
  *         <td><a href="#month">Month</a>
@@ -123,7 +127,7 @@
  *         <td>Month in year (standalone form)
  *         <td><a href="#month">Month</a>
  *         <td><code>July</code>; <code>Jul</code>; <code>07</code>
- *     <tr style="background-color: rgb(238, 238, 255);">
+ *     <tr>
  *         <td><code>w</code>
  *         <td>Week in year
  *         <td><a href="#number">Number</a>
@@ -133,7 +137,7 @@
  *         <td>Week in month
  *         <td><a href="#number">Number</a>
  *         <td><code>2</code>
- *     <tr style="background-color: rgb(238, 238, 255);">
+ *     <tr>
  *         <td><code>D</code>
  *         <td>Day in year
  *         <td><a href="#number">Number</a>
@@ -143,7 +147,7 @@
  *         <td>Day in month
  *         <td><a href="#number">Number</a>
  *         <td><code>10</code>
- *     <tr style="background-color: rgb(238, 238, 255);">
+ *     <tr>
  *         <td><code>F</code>
  *         <td>Day of week in month
  *         <td><a href="#number">Number</a>
@@ -153,7 +157,7 @@
  *         <td>Day name in week
  *         <td><a href="#text">Text</a>
  *         <td><code>Tuesday</code>; <code>Tue</code>
- *     <tr style="background-color: rgb(238, 238, 255);">
+ *     <tr>
  *         <td><code>u</code>
  *         <td>Day number of week (1 = Monday, ..., 7 = Sunday)
  *         <td><a href="#number">Number</a>
@@ -163,7 +167,7 @@
  *         <td>Am/pm marker
  *         <td><a href="#text">Text</a>
  *         <td><code>PM</code>
- *     <tr style="background-color: rgb(238, 238, 255);">
+ *     <tr>
  *         <td><code>H</code>
  *         <td>Hour in day (0-23)
  *         <td><a href="#number">Number</a>
@@ -173,7 +177,7 @@
  *         <td>Hour in day (1-24)
  *         <td><a href="#number">Number</a>
  *         <td><code>24</code>
- *     <tr style="background-color: rgb(238, 238, 255);">
+ *     <tr>
  *         <td><code>K</code>
  *         <td>Hour in am/pm (0-11)
  *         <td><a href="#number">Number</a>
@@ -183,7 +187,7 @@
  *         <td>Hour in am/pm (1-12)
  *         <td><a href="#number">Number</a>
  *         <td><code>12</code>
- *     <tr style="background-color: rgb(238, 238, 255);">
+ *     <tr>
  *         <td><code>m</code>
  *         <td>Minute in hour
  *         <td><a href="#number">Number</a>
@@ -193,7 +197,7 @@
  *         <td>Second in minute
  *         <td><a href="#number">Number</a>
  *         <td><code>55</code>
- *     <tr style="background-color: rgb(238, 238, 255);">
+ *     <tr>
  *         <td><code>S</code>
  *         <td>Millisecond
  *         <td><a href="#number">Number</a>
@@ -203,7 +207,7 @@
  *         <td>Time zone
  *         <td><a href="#timezone">General time zone</a>
  *         <td><code>Pacific Standard Time</code>; <code>PST</code>; <code>GMT-08:00</code>
- *     <tr style="background-color: rgb(238, 238, 255);">
+ *     <tr>
  *         <td><code>Z</code>
  *         <td>Time zone
  *         <td><a href="#rfc822timezone">RFC 822 time zone</a>
@@ -213,6 +217,7 @@
  *         <td>Time zone
  *         <td><a href="#iso8601timezone">ISO 8601 time zone</a>
  *         <td><code>-08</code>; <code>-0800</code>;  <code>-08:00</code>
+ * </tbody>
  * </table>
  * </blockquote>
  * Pattern letters are usually repeated, as their number determines the
@@ -370,43 +375,48 @@
  * the U.S. locale. The given date and time are 2001-07-04 12:08:56 local time
  * in the U.S. Pacific Time time zone.
  * <blockquote>
- * <table border=0 cellspacing=3 cellpadding=0 summary="Examples of date and time patterns interpreted in the U.S. locale">
- *     <tr style="background-color: rgb(204, 204, 255);">
+ * <table class="striped">
+ * <caption style="display:none">Examples of date and time patterns interpreted in the U.S. locale</caption>
+ * <thead>
+ *     <tr>
  *         <th style="text-align:left">Date and Time Pattern
  *         <th style="text-align:left">Result
+ * </thead>
+ * <tbody>
  *     <tr>
  *         <td><code>"yyyy.MM.dd G 'at' HH:mm:ss z"</code>
  *         <td><code>2001.07.04 AD at 12:08:56 PDT</code>
- *     <tr style="background-color: rgb(238, 238, 255);">
+ *     <tr>
  *         <td><code>"EEE, MMM d, ''yy"</code>
  *         <td><code>Wed, Jul 4, '01</code>
  *     <tr>
  *         <td><code>"h:mm a"</code>
  *         <td><code>12:08 PM</code>
- *     <tr style="background-color: rgb(238, 238, 255);">
+ *     <tr>
  *         <td><code>"hh 'o''clock' a, zzzz"</code>
  *         <td><code>12 o'clock PM, Pacific Daylight Time</code>
  *     <tr>
  *         <td><code>"K:mm a, z"</code>
  *         <td><code>0:08 PM, PDT</code>
- *     <tr style="background-color: rgb(238, 238, 255);">
+ *     <tr>
  *         <td><code>"yyyyy.MMMMM.dd GGG hh:mm aaa"</code>
  *         <td><code>02001.July.04 AD 12:08 PM</code>
  *     <tr>
  *         <td><code>"EEE, d MMM yyyy HH:mm:ss Z"</code>
  *         <td><code>Wed, 4 Jul 2001 12:08:56 -0700</code>
- *     <tr style="background-color: rgb(238, 238, 255);">
+ *     <tr>
  *         <td><code>"yyMMddHHmmssZ"</code>
  *         <td><code>010704120856-0700</code>
  *     <tr>
  *         <td><code>"yyyy-MM-dd'T'HH:mm:ss.SSSZ"</code>
  *         <td><code>2001-07-04T12:08:56.235-0700</code>
- *     <tr style="background-color: rgb(238, 238, 255);">
+ *     <tr>
  *         <td><code>"yyyy-MM-dd'T'HH:mm:ss.SSSXXX"</code>
  *         <td><code>2001-07-04T12:08:56.235-07:00</code>
  *     <tr>
  *         <td><code>"YYYY-'W'ww-u"</code>
  *         <td><code>2001-W27-3</code>
+ * </tbody>
  * </table>
  * </blockquote>
  *
--- a/jdk/src/java.base/share/classes/java/time/chrono/HijrahChronology.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/time/chrono/HijrahChronology.java	Thu May 25 22:33:25 2017 +0000
@@ -103,17 +103,18 @@
  *
  * <p>
  * CLDR and LDML identify variants:
- * <table cellpadding="2" summary="Variants of Hijrah Calendars">
+ * <table class="striped">
+ * <caption style="display:none">Variants of Hijrah Calendars</caption>
  * <thead>
- * <tr class="tableSubHeadingColor">
- * <th class="colFirst" style="text-align:left" >Chronology ID</th>
- * <th class="colFirst" style="text-align:left" >Calendar Type</th>
- * <th class="colFirst" style="text-align:left" >Locale extension, see {@link java.util.Locale}</th>
- * <th class="colLast" style="text-align:left" >Description</th>
+ * <tr>
+ * <th style="text-align:left" >Chronology ID</th>
+ * <th style="text-align:left" >Calendar Type</th>
+ * <th style="text-align:left" >Locale extension, see {@link java.util.Locale}</th>
+ * <th style="text-align:left" >Description</th>
  * </tr>
  * </thead>
  * <tbody>
- * <tr class="altColor">
+ * <tr>
  * <td>Hijrah-umalqura</td>
  * <td>islamic-umalqura</td>
  * <td>ca-islamic-umalqura</td>
@@ -147,36 +148,37 @@
  * <p>
  * The Hijrah property resource is a set of properties that describe the calendar.
  * The syntax is defined by {@code java.util.Properties#load(Reader)}.
- * <table cellpadding="2" summary="Configuration of Hijrah Calendar">
+ * <table class="striped">
+ * <caption style="display:none">Configuration of Hijrah Calendar</caption>
  * <thead>
- * <tr class="tableSubHeadingColor">
- * <th class="colFirst" style="text-align:left" > Property Name</th>
- * <th class="colFirst" style="text-align:left" > Property value</th>
- * <th class="colLast" style="text-align:left" > Description </th>
+ * <tr>
+ * <th style="text-align:left" > Property Name</th>
+ * <th style="text-align:left" > Property value</th>
+ * <th style="text-align:left" > Description </th>
  * </tr>
  * </thead>
  * <tbody>
- * <tr class="altColor">
+ * <tr>
  * <td>id</td>
  * <td>Chronology Id, for example, "Hijrah-umalqura"</td>
  * <td>The Id of the calendar in common usage</td>
  * </tr>
- * <tr class="rowColor">
+ * <tr>
  * <td>type</td>
  * <td>Calendar type, for example, "islamic-umalqura"</td>
  * <td>LDML defines the calendar types</td>
  * </tr>
- * <tr class="altColor">
+ * <tr>
  * <td>version</td>
  * <td>Version, for example: "1.8.0_1"</td>
  * <td>The version of the Hijrah variant data</td>
  * </tr>
- * <tr class="rowColor">
+ * <tr>
  * <td>iso-start</td>
  * <td>ISO start date, formatted as {@code yyyy-MM-dd}, for example: "1900-04-30"</td>
  * <td>The ISO date of the first day of the minimum Hijrah year.</td>
  * </tr>
- * <tr class="altColor">
+ * <tr>
  * <td>yyyy - a numeric 4 digit year, for example "1434"</td>
  * <td>The value is a sequence of 12 month lengths,
  * for example: "29 30 29 30 29 30 30 30 29 30 29 29"</td>
--- a/jdk/src/java.base/share/classes/java/time/chrono/IsoEra.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/time/chrono/IsoEra.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -70,25 +70,26 @@
  * A definition has therefore been created with two eras - 'Current era' (CE) for
  * years on or after 0001-01-01 (ISO), and 'Before current era' (BCE) for years before that.
  *
- * <table summary="ISO years and eras" cellpadding="2" cellspacing="3" border="0" >
+ * <table class="striped">
+ * <caption style="display:none">ISO years and eras</caption>
  * <thead>
- * <tr class="tableSubHeadingColor">
- * <th class="colFirst" style="text-align:left">year-of-era</th>
- * <th class="colFirst" style="text-align:left">era</th>
- * <th class="colLast" style="text-align:left">proleptic-year</th>
+ * <tr>
+ * <th style="text-align:left">year-of-era</th>
+ * <th style="text-align:left">era</th>
+ * <th style="text-align:left">proleptic-year</th>
  * </tr>
  * </thead>
  * <tbody>
- * <tr class="rowColor">
+ * <tr>
  * <td>2</td><td>CE</td><td>2</td>
  * </tr>
- * <tr class="altColor">
+ * <tr>
  * <td>1</td><td>CE</td><td>1</td>
  * </tr>
- * <tr class="rowColor">
+ * <tr>
  * <td>1</td><td>BCE</td><td>0</td>
  * </tr>
- * <tr class="altColor">
+ * <tr>
  * <td>2</td><td>BCE</td><td>-1</td>
  * </tr>
  * </tbody>
--- a/jdk/src/java.base/share/classes/java/time/chrono/MinguoEra.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/time/chrono/MinguoEra.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -71,26 +71,27 @@
  * All previous years, zero or earlier in the proleptic count or one and greater
  * in the year-of-era count, are part of the 'Before Republic of China' era.
  *
- * <table summary="Minguo years and eras" cellpadding="2" cellspacing="3" border="0" >
+ * <table class="striped">
+ * <caption style="display:none">Minguo years and eras</caption>
  * <thead>
- * <tr class="tableSubHeadingColor">
- * <th class="colFirst" style="text-align:left">year-of-era</th>
- * <th class="colFirst" style="text-align:left">era</th>
- * <th class="colFirst" style="text-align:left">proleptic-year</th>
- * <th class="colLast" style="text-align:left">ISO proleptic-year</th>
+ * <tr>
+ * <th style="text-align:left">year-of-era</th>
+ * <th style="text-align:left">era</th>
+ * <th style="text-align:left">proleptic-year</th>
+ * <th style="text-align:left">ISO proleptic-year</th>
  * </tr>
  * </thead>
  * <tbody>
- * <tr class="rowColor">
+ * <tr>
  * <td>2</td><td>ROC</td><td>2</td><td>1913</td>
  * </tr>
- * <tr class="altColor">
+ * <tr>
  * <td>1</td><td>ROC</td><td>1</td><td>1912</td>
  * </tr>
- * <tr class="rowColor">
+ * <tr>
  * <td>1</td><td>BEFORE_ROC</td><td>0</td><td>1911</td>
  * </tr>
- * <tr class="altColor">
+ * <tr>
  * <td>2</td><td>BEFORE_ROC</td><td>-1</td><td>1910</td>
  * </tr>
  * </tbody>
--- a/jdk/src/java.base/share/classes/java/time/chrono/ThaiBuddhistEra.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/time/chrono/ThaiBuddhistEra.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -71,26 +71,27 @@
  * All previous years, zero or earlier in the proleptic count or one and greater
  * in the year-of-era count, are part of the 'Before Buddhist' era.
  *
- * <table summary="Buddhist years and eras" cellpadding="2" cellspacing="3" border="0" >
+ * <table class="striped">
+ * <caption style="display:none">Buddhist years and eras</caption>
  * <thead>
- * <tr class="tableSubHeadingColor">
- * <th class="colFirst" style="text-align:left">year-of-era</th>
- * <th class="colFirst" style="text-align:left">era</th>
- * <th class="colFirst" style="text-align:left">proleptic-year</th>
- * <th class="colLast" style="text-align:left">ISO proleptic-year</th>
+ * <tr>
+ * <th style="text-align:left">year-of-era</th>
+ * <th style="text-align:left">era</th>
+ * <th style="text-align:left">proleptic-year</th>
+ * <th style="text-align:left">ISO proleptic-year</th>
  * </tr>
  * </thead>
  * <tbody>
- * <tr class="rowColor">
+ * <tr>
  * <td>2</td><td>BE</td><td>2</td><td>-542</td>
  * </tr>
- * <tr class="altColor">
+ * <tr>
  * <td>1</td><td>BE</td><td>1</td><td>-543</td>
  * </tr>
- * <tr class="rowColor">
+ * <tr>
  * <td>1</td><td>BEFORE_BE</td><td>0</td><td>-544</td>
  * </tr>
- * <tr class="altColor">
+ * <tr>
  * <td>2</td><td>BEFORE_BE</td><td>-1</td><td>-545</td>
  * </tr>
  * </tbody>
--- a/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -150,105 +150,106 @@
  * implementation of {@code java.text.Format}.
  *
  * <h3 id="predefined">Predefined Formatters</h3>
- * <table summary="Predefined Formatters" cellpadding="2" cellspacing="3" border="0" >
+ * <table class="striped">
+ * <caption>Predefined Formatters</caption>
  * <thead>
- * <tr class="tableSubHeadingColor">
- * <th class="colFirst" style="text-align:left">Formatter</th>
- * <th class="colFirst" style="text-align:left">Description</th>
- * <th class="colLast" style="text-align:left">Example</th>
+ * <tr>
+ * <th style="text-align:left">Formatter</th>
+ * <th style="text-align:left">Description</th>
+ * <th style="text-align:left">Example</th>
  * </tr>
  * </thead>
  * <tbody>
- * <tr class="rowColor">
+ * <tr>
  * <td>{@link #ofLocalizedDate ofLocalizedDate(dateStyle)} </td>
  * <td> Formatter with date style from the locale </td>
  * <td> '2011-12-03'</td>
  * </tr>
- * <tr class="altColor">
+ * <tr>
  * <td> {@link #ofLocalizedTime ofLocalizedTime(timeStyle)} </td>
  * <td> Formatter with time style from the locale </td>
  * <td> '10:15:30'</td>
  * </tr>
- * <tr class="rowColor">
+ * <tr>
  * <td> {@link #ofLocalizedDateTime ofLocalizedDateTime(dateTimeStyle)} </td>
  * <td> Formatter with a style for date and time from the locale</td>
  * <td> '3 Jun 2008 11:05:30'</td>
  * </tr>
- * <tr class="altColor">
+ * <tr>
  * <td> {@link #ofLocalizedDateTime ofLocalizedDateTime(dateStyle,timeStyle)}
  * </td>
  * <td> Formatter with date and time styles from the locale </td>
  * <td> '3 Jun 2008 11:05'</td>
  * </tr>
- * <tr class="rowColor">
+ * <tr>
  * <td> {@link #BASIC_ISO_DATE}</td>
  * <td>Basic ISO date </td> <td>'20111203'</td>
  * </tr>
- * <tr class="altColor">
+ * <tr>
  * <td> {@link #ISO_LOCAL_DATE}</td>
  * <td> ISO Local Date </td>
  * <td>'2011-12-03'</td>
  * </tr>
- * <tr class="rowColor">
+ * <tr>
  * <td> {@link #ISO_OFFSET_DATE}</td>
  * <td> ISO Date with offset </td>
  * <td>'2011-12-03+01:00'</td>
  * </tr>
- * <tr class="altColor">
+ * <tr>
  * <td> {@link #ISO_DATE}</td>
  * <td> ISO Date with or without offset </td>
  * <td> '2011-12-03+01:00'; '2011-12-03'</td>
  * </tr>
- * <tr class="rowColor">
+ * <tr>
  * <td> {@link #ISO_LOCAL_TIME}</td>
  * <td> Time without offset </td>
  * <td>'10:15:30'</td>
  * </tr>
- * <tr class="altColor">
+ * <tr>
  * <td> {@link #ISO_OFFSET_TIME}</td>
  * <td> Time with offset </td>
  * <td>'10:15:30+01:00'</td>
  * </tr>
- * <tr class="rowColor">
+ * <tr>
  * <td> {@link #ISO_TIME}</td>
  * <td> Time with or without offset </td>
  * <td>'10:15:30+01:00'; '10:15:30'</td>
  * </tr>
- * <tr class="altColor">
+ * <tr>
  * <td> {@link #ISO_LOCAL_DATE_TIME}</td>
  * <td> ISO Local Date and Time </td>
  * <td>'2011-12-03T10:15:30'</td>
  * </tr>
- * <tr class="rowColor">
+ * <tr>
  * <td> {@link #ISO_OFFSET_DATE_TIME}</td>
  * <td> Date Time with Offset
  * </td><td>2011-12-03T10:15:30+01:00'</td>
  * </tr>
- * <tr class="altColor">
+ * <tr>
  * <td> {@link #ISO_ZONED_DATE_TIME}</td>
  * <td> Zoned Date Time </td>
  * <td>'2011-12-03T10:15:30+01:00[Europe/Paris]'</td>
  * </tr>
- * <tr class="rowColor">
+ * <tr>
  * <td> {@link #ISO_DATE_TIME}</td>
  * <td> Date and time with ZoneId </td>
  * <td>'2011-12-03T10:15:30+01:00[Europe/Paris]'</td>
  * </tr>
- * <tr class="altColor">
+ * <tr>
  * <td> {@link #ISO_ORDINAL_DATE}</td>
  * <td> Year and day of year </td>
  * <td>'2012-337'</td>
  * </tr>
- * <tr class="rowColor">
+ * <tr>
  * <td> {@link #ISO_WEEK_DATE}</td>
  * <td> Year and Week </td>
  * <td>2012-W48-6'</td></tr>
- * <tr class="altColor">
+ * <tr>
  * <td> {@link #ISO_INSTANT}</td>
  * <td> Date and Time of an Instant </td>
  * <td>'2011-12-03T10:15:30Z' </td>
  * </tr>
- * <tr class="rowColor">
+ * <tr>
  * <td> {@link #RFC_1123_DATE_TIME}</td>
  * <td> RFC 1123 / RFC 822 </td>
  * <td>'Tue, 3 Jun 2008 11:05:30 GMT'</td>
--- a/jdk/src/java.base/share/classes/java/time/temporal/IsoFields.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/time/temporal/IsoFields.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -136,15 +136,19 @@
  * <p>
  * For example:
  *
- * <table cellpadding="0" cellspacing="3" border="0" style="text-align: left; width: 50%;">
+ * <table class=striped style="text-align: left; width: 50%;">
  * <caption>Examples of Week based Years</caption>
+ * <thead>
  * <tr><th>Date</th><th>Day-of-week</th><th>Field values</th></tr>
+ * </thead>
+ * <tbody>
  * <tr><th>2008-12-28</th><td>Sunday</td><td>Week 52 of week-based-year 2008</td></tr>
  * <tr><th>2008-12-29</th><td>Monday</td><td>Week 1 of week-based-year 2009</td></tr>
  * <tr><th>2008-12-31</th><td>Wednesday</td><td>Week 1 of week-based-year 2009</td></tr>
  * <tr><th>2009-01-01</th><td>Thursday</td><td>Week 1 of week-based-year 2009</td></tr>
  * <tr><th>2009-01-04</th><td>Sunday</td><td>Week 1 of week-based-year 2009</td></tr>
  * <tr><th>2009-01-05</th><td>Monday</td><td>Week 2 of week-based-year 2009</td></tr>
+ * </tbody>
  * </table>
  *
  * @implSpec
--- a/jdk/src/java.base/share/classes/java/time/temporal/WeekFields.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/time/temporal/WeekFields.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -127,10 +127,13 @@
  * The earliest period is referred to as week 0 if it has less than the minimal number of days
  * and week 1 if it has at least the minimal number of days.
  *
- * <table cellpadding="0" cellspacing="3" border="0" style="text-align: left; width: 50%;">
+ * <table class=striped style="text-align: left">
  * <caption>Examples of WeekFields</caption>
+ * <thead>
  * <tr><th>Date</th><td>Day-of-week</td>
  *  <td>First day: Monday<br>Minimal days: 4</td><td>First day: Monday<br>Minimal days: 5</td></tr>
+ * </thead>
+ * <tbody>
  * <tr><th>2008-12-31</th><td>Wednesday</td>
  *  <td>Week 5 of December 2008</td><td>Week 5 of December 2008</td></tr>
  * <tr><th>2009-01-01</th><td>Thursday</td>
@@ -139,6 +142,7 @@
  *  <td>Week 1 of January 2009</td><td>Week 0 of January 2009</td></tr>
  * <tr><th>2009-01-05</th><td>Monday</td>
  *  <td>Week 2 of January 2009</td><td>Week 1 of January 2009</td></tr>
+ * </tbody>
  * </table>
  *
  * <h3>Week of Year</h3>
@@ -157,10 +161,13 @@
  * The first and last weeks of a year may contain days from the
  * previous calendar year or next calendar year respectively.
  *
- * <table cellpadding="0" cellspacing="3" border="0" style="text-align: left; width: 50%;">
+ * <table class=striped style="text-align: left;">
  * <caption>Examples of WeekFields for week-based-year</caption>
+ * <thead>
  * <tr><th>Date</th><td>Day-of-week</td>
  *  <td>First day: Monday<br>Minimal days: 4</td><td>First day: Monday<br>Minimal days: 5</td></tr>
+ * </thead>
+ * <tbody>
  * <tr><th>2008-12-31</th><td>Wednesday</td>
  *  <td>Week 1 of 2009</td><td>Week 53 of 2008</td></tr>
  * <tr><th>2009-01-01</th><td>Thursday</td>
@@ -169,6 +176,7 @@
  *  <td>Week 1 of 2009</td><td>Week 53 of 2008</td></tr>
  * <tr><th>2009-01-05</th><td>Monday</td>
  *  <td>Week 2 of 2009</td><td>Week 1 of 2009</td></tr>
+ * </tbody>
  * </table>
  *
  * @implSpec
--- a/jdk/src/java.base/share/classes/java/util/Deque.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Deque.java	Thu May 25 22:33:25 2017 +0000
@@ -56,7 +56,7 @@
  * <p>The twelve methods described above are summarized in the
  * following table:
  *
- * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <table class="plain">
  * <caption>Summary of Deque methods</caption>
  *  <tr>
  *    <td></td>
@@ -99,7 +99,7 @@
  * inherited from the {@code Queue} interface are precisely equivalent to
  * {@code Deque} methods as indicated in the following table:
  *
- * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <table class="plain">
  * <caption>Comparison of Queue and Deque methods</caption>
  *  <tr>
  *    <td style="text-align:center"> <b>{@code Queue} Method</b></td>
@@ -137,7 +137,7 @@
  * beginning of the deque.  Stack methods are precisely equivalent to
  * {@code Deque} methods as indicated in the table below:
  *
- * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <table class="plain">
  * <caption>Comparison of Stack and Deque methods</caption>
  *  <tr>
  *    <td style="text-align:center"> <b>Stack Method</b></td>
--- a/jdk/src/java.base/share/classes/java/util/Formatter.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Formatter.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -290,12 +290,14 @@
  * <pre>
  *    out.toUpperCase(Locale.getDefault(Locale.Category.FORMAT)) </pre>
  *
- * <table cellpadding=5 summary="genConv">
- *
+ * <table class="striped">
+ * <caption style="display:none">genConv</caption>
+ * <thead>
  * <tr><th style="vertical-align:bottom"> Conversion
  *     <th style="vertical-align:bottom"> Argument Category
  *     <th style="vertical-align:bottom"> Description
- *
+ * </thead>
+ * <tbody>
  * <tr><td style="vertical-align:top"> {@code 'b'}, {@code 'B'}
  *     <td style="vertical-align:top"> general
  *     <td> If the argument <i>arg</i> is {@code null}, then the result is
@@ -365,6 +367,7 @@
  *     <td style="vertical-align:top"> line separator
  *     <td> The result is the platform-specific line separator
  *
+ * </tbody>
  * </table>
  *
  * <p> Any characters not explicitly defined as conversions are illegal and are
@@ -381,8 +384,9 @@
  *
  * <p> The following conversion characters are used for formatting times:
  *
- * <table cellpadding=5 summary="time">
- *
+ * <table class="striped">
+ * <caption style="display:none">time</caption>
+ * <tbody>
  * <tr><td style="vertical-align:top"> {@code 'H'}
  *     <td> Hour of the day for the 24-hour clock, formatted as two digits with
  *     a leading zero as necessary i.e. {@code 00 - 23}.
@@ -446,11 +450,14 @@
  *     1970 {@code 00:00:00} UTC, i.e. {@code Long.MIN_VALUE} to
  *     {@code Long.MAX_VALUE}.
  *
+ * </tbody>
  * </table>
  *
  * <p> The following conversion characters are used for formatting dates:
  *
- * <table cellpadding=5 summary="date">
+ * <table class="striped">
+ * <caption style="display:none">date</caption>
+ * <tbody>
  *
  * <tr><td style="vertical-align:top">{@code 'B'}
  *     <td> Locale-specific {@linkplain java.text.DateFormatSymbols#getMonths
@@ -502,12 +509,15 @@
  * <tr><td style="vertical-align:top">{@code 'e'}
  *     <td> Day of month, formatted as two digits, i.e. {@code 1 - 31}.
  *
+ * </tbody>
  * </table>
  *
  * <p> The following conversion characters are used for formatting common
  * date/time compositions.
  *
- * <table cellpadding=5 summary="composites">
+ * <table class="striped">
+ * <caption style="display:none">composites</caption>
+ * <tbody>
  *
  * <tr><td style="vertical-align:top">{@code 'R'}
  *     <td> Time formatted for the 24-hour clock as {@code "%tH:%tM"}
@@ -531,6 +541,7 @@
  *     <td> Date and time formatted as {@code "%ta %tb %td %tT %tZ %tY"},
  *     e.g. {@code "Sun Jul 20 16:17:00 EDT 1969"}.
  *
+ * </tbody>
  * </table>
  *
  * <p> Any characters not explicitly defined as date/time conversion suffixes
@@ -541,14 +552,16 @@
  * <p> The following table summarizes the supported flags.  <i>y</i> means the
  * flag is supported for the indicated argument types.
  *
- * <table cellpadding=5 summary="genConv">
- *
+ * <table class="striped">
+ * <caption style="display:none">genConv</caption>
+ * <thead>
  * <tr><th style="vertical-align:bottom"> Flag <th style="vertical-align:bottom"> General
  *     <th style="vertical-align:bottom"> Character <th style="vertical-align:bottom"> Integral
  *     <th style="vertical-align:bottom"> Floating Point
  *     <th style="vertical-align:bottom"> Date/Time
  *     <th style="vertical-align:bottom"> Description
- *
+ * </thead>
+ * <tbody>
  * <tr><td> '-' <td style="text-align:center; vertical-align:top"> y
  *     <td style="text-align:center; vertical-align:top"> y
  *     <td style="text-align:center; vertical-align:top"> y
@@ -599,6 +612,7 @@
  *     <td style="text-align:center"> -
  *     <td> The result will enclose negative numbers in parentheses
  *
+ * </tbody>
  * </table>
  *
  * <p> <sup>1</sup> Depends on the definition of {@link Formattable}.
@@ -705,7 +719,9 @@
  *
  * <p> The following general conversions may be applied to any argument type:
  *
- * <table cellpadding=5 summary="dgConv">
+ * <table class="striped">
+ * <caption style="display:none">dgConv</caption>
+ * <tbody>
  *
  * <tr><td style="vertical-align:top"> {@code 'b'}
  *     <td style="vertical-align:top"> <code>'&#92;u0062'</code>
@@ -756,11 +772,14 @@
  *     <td style="vertical-align:top"> <code>'&#92;u0053'</code>
  *     <td> The upper-case variant of {@code 's'}.
  *
+ * </tbody>
  * </table>
  *
  * <p> The following <a id="dFlags">flags</a> apply to general conversions:
  *
- * <table cellpadding=5 summary="dFlags">
+ * <table class="striped">
+ * <caption style="display:none">dFlags</caption>
+ * <tbody>
  *
  * <tr><td style="vertical-align:top"> {@code '-'}
  *     <td style="vertical-align:top"> <code>'&#92;u002d'</code>
@@ -775,6 +794,7 @@
  *     <td> Requires the output use an alternate form.  The definition of the
  *     form is specified by the conversion.
  *
+ * </tbody>
  * </table>
  *
  * <p> The <a id="genWidth">width</a> is the minimum number of characters to
@@ -801,7 +821,9 @@
  * {@code false} then an {@link IllegalFormatCodePointException} will be
  * thrown.
  *
- * <table cellpadding=5 summary="charConv">
+ * <table class="striped">
+ * <caption style="display:none">charConv</caption>
+ * <tbody>
  *
  * <tr><td style="vertical-align:top"> {@code 'c'}
  *     <td style="vertical-align:top"> <code>'&#92;u0063'</code>
@@ -817,6 +839,7 @@
  *     <td style="vertical-align:top"> <code>'&#92;u0043'</code>
  *     <td> The upper-case variant of {@code 'c'}.
  *
+ * </tbody>
  * </table>
  *
  * <p> The {@code '-'} flag defined for <a href="#dFlags">General
@@ -902,7 +925,9 @@
  * {@code short}, {@link Short}, {@code int} and {@link Integer},
  * {@code long}, and {@link Long}.
  *
- * <table cellpadding=5 summary="IntConv">
+ * <table class="striped">
+ * <caption style="display:none">IntConv</caption>
+ * <tbody>
  *
  * <tr><td style="vertical-align:top"> {@code 'd'}
  *     <td style="vertical-align:top"> <code>'&#92;u0064'</code>
@@ -968,6 +993,7 @@
  *     all hexadecimal digits {@code 'a'} - {@code 'f'}
  *     (<code>'&#92;u0061'</code> -  <code>'&#92;u0066'</code>).
  *
+ * </tbody>
  * </table>
  *
  * <p> If the conversion is {@code 'o'}, {@code 'x'}, or {@code 'X'} and
@@ -982,7 +1008,9 @@
  * <p> The following <a id="intFlags">flags</a> apply to numeric integral
  * conversions:
  *
- * <table cellpadding=5 summary="intFlags">
+ * <table class="striped">
+ * <caption style="display:none">intFlags</caption>
+ * <tbody>
  *
  * <tr><td style="vertical-align:top"> {@code '+'}
  *     <td style="vertical-align:top"> <code>'&#92;u002b'</code>
@@ -1025,6 +1053,7 @@
  *     (<code>'&#92;u0028'</code>) and append a {@code ')'}
  *     (<code>'&#92;u0029'</code>) to negative values.
  *
+ * </tbody>
  * </table>
  *
  * <p> If no <a id="intdFlags">flags</a> are given the default formatting is
@@ -1060,7 +1089,9 @@
  * <p> The following conversions may be applied to {@link
  * java.math.BigInteger}.
  *
- * <table cellpadding=5 summary="BIntConv">
+ * <table class="striped">
+ * <caption style="display:none">bIntConv</caption>
+ * <tbody>
  *
  * <tr><td style="vertical-align:top"> {@code 'd'}
  *     <td style="vertical-align:top"> <code>'&#92;u0064'</code>
@@ -1125,6 +1156,7 @@
  *     all hexadecimal digits {@code 'a'} - {@code 'f'}
  *     (<code>'&#92;u0061'</code> - <code>'&#92;u0066'</code>).
  *
+ * </tbody>
  * </table>
  *
  * <p> If the conversion is {@code 'o'}, {@code 'x'}, or {@code 'X'} and
@@ -1154,7 +1186,9 @@
  * <p> The following conversions may be applied to {@code float}, {@link
  * Float}, {@code double} and {@link Double}.
  *
- * <table cellpadding=5 summary="floatConv">
+ * <table class="striped">
+ * <caption style="display:none">floatConv</caption>
+ * <tbody>
  *
  * <tr><td style="vertical-align:top"> {@code 'e'}
  *     <td style="vertical-align:top"> <code>'&#92;u0065'</code>
@@ -1331,6 +1365,7 @@
  *     (<code>'&#92;u0070'</code> and all hexadecimal digits {@code 'a'} -
  *     {@code 'f'} (<code>'&#92;u0061'</code> - <code>'&#92;u0066'</code>).
  *
+ * </tbody>
  * </table>
  *
  * <p> All <a href="#intFlags">flags</a> defined for Byte, Short, Integer, and
@@ -1388,7 +1423,9 @@
  * <p> The following conversions may be applied {@link java.math.BigDecimal
  * BigDecimal}.
  *
- * <table cellpadding=5 summary="floatConv">
+ * <table class="striped">
+ * <caption style="display:none">floatConv</caption>
+ * <tbody>
  *
  * <tr><td style="vertical-align:top"> {@code 'e'}
  *     <td style="vertical-align:top"> <code>'&#92;u0065'</code>
@@ -1492,6 +1529,7 @@
  *     For a canonical representation of the value, use {@link
  *     BigDecimal#toString()}.
  *
+ * </tbody>
  * </table>
  *
  * <p> All <a href="#intFlags">flags</a> defined for Byte, Short, Integer, and
@@ -1512,7 +1550,9 @@
  * <p> This conversion may be applied to {@code long}, {@link Long}, {@link
  * Calendar}, {@link Date} and {@link TemporalAccessor TemporalAccessor}
  *
- * <table cellpadding=5 summary="DTConv">
+ * <table class="striped">
+ * <caption style="display:none">DTConv</caption>
+ * <tbody>
  *
  * <tr><td style="vertical-align:top"> {@code 't'}
  *     <td style="vertical-align:top"> <code>'&#92;u0074'</code>
@@ -1521,6 +1561,7 @@
  *     <td style="vertical-align:top"> <code>'&#92;u0054'</code>
  *     <td> The upper-case variant of {@code 't'}.
  *
+ * </tbody>
  * </table>
  *
  * <p> The following date and time conversion character suffixes are defined
@@ -1532,7 +1573,9 @@
  *
  * <p> The following conversion characters are used for formatting times:
  *
- * <table cellpadding=5 summary="time">
+ * <table class="striped">
+ * <caption style="display:none">time</caption>
+ * <tbody>
  *
  * <tr><td style="vertical-align:top"> {@code 'H'}
  *     <td style="vertical-align:top"> <code>'&#92;u0048'</code>
@@ -1620,11 +1663,14 @@
  *     {@code Long.MAX_VALUE}. The precision of this value is limited by
  *     the resolution of the underlying operating system or hardware.
  *
+ * </tbody>
  * </table>
  *
  * <p> The following conversion characters are used for formatting dates:
  *
- * <table cellpadding=5 summary="date">
+ * <table class="striped">
+ * <caption style="display:none">date</caption>
+ * <tbody>
  *
  * <tr><td style="vertical-align:top">{@code 'B'}
  *     <td style="vertical-align:top"> <code>'&#92;u0042'</code>
@@ -1692,12 +1738,15 @@
  *     <td> Day of month, formatted as two digits, i.e. {@code 1 - 31} where
  *     "{@code 1}" is the first day of the month.
  *
+ * </tbody>
  * </table>
  *
  * <p> The following conversion characters are used for formatting common
  * date/time compositions.
  *
- * <table cellpadding=5 summary="composites">
+ * <table class="striped">
+ * <caption style="display:none">composites</caption>
+ * <tbody>
  *
  * <tr><td style="vertical-align:top">{@code 'R'}
  *     <td style="vertical-align:top"> <code>'&#92;u0052'</code>
@@ -1727,6 +1776,7 @@
  *     <td> Date and time formatted as {@code "%ta %tb %td %tT %tZ %tY"},
  *     e.g. {@code "Sun Jul 20 16:17:00 EDT 1969"}.
  *
+ * </tbody>
  * </table>
  *
  * <p> The {@code '-'} flag defined for <a href="#dFlags">General
@@ -1748,7 +1798,9 @@
  *
  * <p> The conversion does not correspond to any argument.
  *
- * <table cellpadding=5 summary="DTConv">
+ * <table class="striped">
+ * <caption style="display:none">DTConv</caption>
+ * <tbody>
  *
  * <tr><td style="vertical-align:top">{@code '%'}
  *     <td> The result is a literal {@code '%'} (<code>'&#92;u0025'</code>)
@@ -1767,18 +1819,22 @@
  * <p> The precision is not applicable.  If the precision is specified an
  * {@link IllegalFormatPrecisionException} will be thrown.
  *
+ * </tbody>
  * </table>
  *
  * <h4><a id="dls">Line Separator</a></h4>
  *
  * <p> The conversion does not correspond to any argument.
  *
- * <table cellpadding=5 summary="DTConv">
+ * <table class="striped">
+ * <caption style="display:none">DTConv</caption>
+ * <tbody>
  *
  * <tr><td style="vertical-align:top">{@code 'n'}
  *     <td> the platform-specific line separator as returned by {@link
  *     System#lineSeparator()}.
  *
+ * </tbody>
  * </table>
  *
  * <p> Flags, width, and precision are not applicable.  If any are provided an
--- a/jdk/src/java.base/share/classes/java/util/GregorianCalendar.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/util/GregorianCalendar.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -159,88 +159,89 @@
  * undefined. <code>GregorianCalendar</code> uses the following
  * default value for each calendar field if its value is undefined.
  *
- * <table cellpadding="0" cellspacing="3" border="0"
- *        summary="GregorianCalendar default field values"
- *        style="text-align: left; width: 66%;">
+ * <table class="striped" style="text-align: left; width: 66%;">
+ * <caption style="display:none">GregorianCalendar default field values</caption>
+ *   <thead>
+ *     <tr>
+ *       <th>
+ *          Field
+ *       </th>
+ *       <th>
+            Default Value
+ *       </th>
+ *     </tr>
+ *   </thead>
  *   <tbody>
  *     <tr>
- *       <th style="vertical-align: top; background-color: rgb(204, 204, 255);
- *           text-align: center;">Field<br>
- *       </th>
- *       <th style="vertical-align: top; background-color: rgb(204, 204, 255);
- *           text-align: center;">Default Value<br>
- *       </th>
- *     </tr>
- *     <tr>
- *       <td style="vertical-align: middle;">
- *              <code>ERA<br></code>
+ *       <td>
+ *              <code>ERA</code>
  *       </td>
- *       <td style="vertical-align: middle;">
- *              <code>AD<br></code>
+ *       <td>
+ *              <code>AD</code>
  *       </td>
  *     </tr>
  *     <tr>
- *       <td style="vertical-align: middle; background-color: rgb(238, 238, 255);">
- *              <code>YEAR<br></code>
+ *       <td>
+ *              <code>YEAR</code>
  *       </td>
- *       <td style="vertical-align: middle; background-color: rgb(238, 238, 255);">
- *              <code>1970<br></code>
+ *       <td>
+ *              <code>1970</code>
  *       </td>
  *     </tr>
  *     <tr>
- *       <td style="vertical-align: middle;">
- *              <code>MONTH<br></code>
+ *       <td>
+ *              <code>MONTH</code>
  *       </td>
- *       <td style="vertical-align: middle;">
- *              <code>JANUARY<br></code>
+ *       <td>
+ *              <code>JANUARY</code>
  *       </td>
  *     </tr>
  *     <tr>
- *       <td style="vertical-align: top; background-color: rgb(238, 238, 255);">
- *              <code>DAY_OF_MONTH<br></code>
+ *       <td>
+ *              <code>DAY_OF_MONTH</code>
  *       </td>
- *       <td style="vertical-align: top; background-color: rgb(238, 238, 255);">
- *              <code>1<br></code>
+ *       <td>
+ *              <code>1</code>
  *       </td>
  *     </tr>
  *     <tr>
- *       <td style="vertical-align: middle;">
- *              <code>DAY_OF_WEEK<br></code>
+ *       <td>
+ *              <code>DAY_OF_WEEK</code>
  *       </td>
- *       <td style="vertical-align: middle;">
- *              <code>the first day of week<br></code>
+ *       <td>
+ *              <code>the first day of week</code>
  *       </td>
  *     </tr>
  *     <tr>
- *       <td style="vertical-align: top; background-color: rgb(238, 238, 255);">
- *              <code>WEEK_OF_MONTH<br></code>
+ *       <td>
+ *              <code>WEEK_OF_MONTH</code>
  *       </td>
- *       <td style="vertical-align: top; background-color: rgb(238, 238, 255);">
- *              <code>0<br></code>
+ *       <td>
+ *              <code>0</code>
  *       </td>
  *     </tr>
  *     <tr>
- *       <td style="vertical-align: top;">
- *              <code>DAY_OF_WEEK_IN_MONTH<br></code>
+ *       <td>
+ *              <code>DAY_OF_WEEK_IN_MONTH</code>
  *       </td>
- *       <td style="vertical-align: top;">
- *              <code>1<br></code>
+ *       <td>
+ *              <code>1</code>
  *       </td>
  *     </tr>
  *     <tr>
- *       <td style="vertical-align: middle; background-color: rgb(238, 238, 255);">
- *              <code>AM_PM<br></code>
+ *       <td>
+ *              <code>AM_PM</code>
  *       </td>
- *       <td style="vertical-align: middle; background-color: rgb(238, 238, 255);">
- *              <code>AM<br></code>
+ *       <td>
+ *              <code>AM</code>
  *       </td>
  *     </tr>
  *     <tr>
- *       <td style="vertical-align: middle;">
- *              <code>HOUR, HOUR_OF_DAY, MINUTE, SECOND, MILLISECOND<br></code>
+ *       <td>
+ *              <code>HOUR, HOUR_OF_DAY, MINUTE, SECOND, MILLISECOND</code>
  *       </td>
- *       <td style="vertical-align: middle;">
- *              <code>0<br></code>
+ *       <td>
+ *              <code>0</code>
  *       </td>
  *     </tr>
  *   </tbody>
--- a/jdk/src/java.base/share/classes/java/util/Locale.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Locale.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -1587,44 +1587,50 @@
      *
      * <p>Grandfathered tags with canonical replacements are as follows:
      *
-     * <table summary="Grandfathered tags with canonical replacements">
+     * <table class="striped">
+     * <caption style="display:none">Grandfathered tags with canonical replacements</caption>
+     * <thead style="text-align:center">
+     * <tr><th style="padding: 0 2px">grandfathered tag</th><th style="padding: 0 2px">modern replacement</th></tr>
+     * </thead>
      * <tbody style="text-align:center">
-     * <tr><th>grandfathered tag</th><th>&nbsp;</th><th>modern replacement</th></tr>
-     * <tr><td>art-lojban</td><td>&nbsp;</td><td>jbo</td></tr>
-     * <tr><td>i-ami</td><td>&nbsp;</td><td>ami</td></tr>
-     * <tr><td>i-bnn</td><td>&nbsp;</td><td>bnn</td></tr>
-     * <tr><td>i-hak</td><td>&nbsp;</td><td>hak</td></tr>
-     * <tr><td>i-klingon</td><td>&nbsp;</td><td>tlh</td></tr>
-     * <tr><td>i-lux</td><td>&nbsp;</td><td>lb</td></tr>
-     * <tr><td>i-navajo</td><td>&nbsp;</td><td>nv</td></tr>
-     * <tr><td>i-pwn</td><td>&nbsp;</td><td>pwn</td></tr>
-     * <tr><td>i-tao</td><td>&nbsp;</td><td>tao</td></tr>
-     * <tr><td>i-tay</td><td>&nbsp;</td><td>tay</td></tr>
-     * <tr><td>i-tsu</td><td>&nbsp;</td><td>tsu</td></tr>
-     * <tr><td>no-bok</td><td>&nbsp;</td><td>nb</td></tr>
-     * <tr><td>no-nyn</td><td>&nbsp;</td><td>nn</td></tr>
-     * <tr><td>sgn-BE-FR</td><td>&nbsp;</td><td>sfb</td></tr>
-     * <tr><td>sgn-BE-NL</td><td>&nbsp;</td><td>vgt</td></tr>
-     * <tr><td>sgn-CH-DE</td><td>&nbsp;</td><td>sgg</td></tr>
-     * <tr><td>zh-guoyu</td><td>&nbsp;</td><td>cmn</td></tr>
-     * <tr><td>zh-hakka</td><td>&nbsp;</td><td>hak</td></tr>
-     * <tr><td>zh-min-nan</td><td>&nbsp;</td><td>nan</td></tr>
-     * <tr><td>zh-xiang</td><td>&nbsp;</td><td>hsn</td></tr>
+     * <tr><td>art-lojban</td><td>jbo</td></tr>
+     * <tr><td>i-ami</td><td>ami</td></tr>
+     * <tr><td>i-bnn</td><td>bnn</td></tr>
+     * <tr><td>i-hak</td><td>hak</td></tr>
+     * <tr><td>i-klingon</td><td>tlh</td></tr>
+     * <tr><td>i-lux</td><td>lb</td></tr>
+     * <tr><td>i-navajo</td><td>nv</td></tr>
+     * <tr><td>i-pwn</td><td>pwn</td></tr>
+     * <tr><td>i-tao</td><td>tao</td></tr>
+     * <tr><td>i-tay</td><td>tay</td></tr>
+     * <tr><td>i-tsu</td><td>tsu</td></tr>
+     * <tr><td>no-bok</td><td>nb</td></tr>
+     * <tr><td>no-nyn</td><td>nn</td></tr>
+     * <tr><td>sgn-BE-FR</td><td>sfb</td></tr>
+     * <tr><td>sgn-BE-NL</td><td>vgt</td></tr>
+     * <tr><td>sgn-CH-DE</td><td>sgg</td></tr>
+     * <tr><td>zh-guoyu</td><td>cmn</td></tr>
+     * <tr><td>zh-hakka</td><td>hak</td></tr>
+     * <tr><td>zh-min-nan</td><td>nan</td></tr>
+     * <tr><td>zh-xiang</td><td>hsn</td></tr>
      * </tbody>
      * </table>
      *
      * <p>Grandfathered tags with no modern replacement will be
      * converted as follows:
      *
-     * <table summary="Grandfathered tags with no modern replacement">
+     * <table class="striped">
+     * <caption style="display:none">Grandfathered tags with no modern replacement</caption>
+     * <thead style="text-align:center">
+     * <tr><th style="padding: 0 2px">grandfathered tag</th><th style="padding: 0 2px">converts to</th></tr>
+     * </thead>
      * <tbody style="text-align:center">
-     * <tr><th>grandfathered tag</th><th>&nbsp;</th><th>converts to</th></tr>
-     * <tr><td>cel-gaulish</td><td>&nbsp;</td><td>xtg-x-cel-gaulish</td></tr>
-     * <tr><td>en-GB-oed</td><td>&nbsp;</td><td>en-GB-x-oed</td></tr>
-     * <tr><td>i-default</td><td>&nbsp;</td><td>en-x-i-default</td></tr>
-     * <tr><td>i-enochian</td><td>&nbsp;</td><td>und-x-i-enochian</td></tr>
-     * <tr><td>i-mingo</td><td>&nbsp;</td><td>see-x-i-mingo</td></tr>
-     * <tr><td>zh-min</td><td>&nbsp;</td><td>nan-x-zh-min</td></tr>
+     * <tr><td>cel-gaulish</td><td>xtg-x-cel-gaulish</td></tr>
+     * <tr><td>en-GB-oed</td><td>en-GB-x-oed</td></tr>
+     * <tr><td>i-default</td><td>en-x-i-default</td></tr>
+     * <tr><td>i-enochian</td><td>und-x-i-enochian</td></tr>
+     * <tr><td>i-mingo</td><td>see-x-i-mingo</td></tr>
+     * <tr><td>zh-min</td><td>nan-x-zh-min</td></tr>
      * </tbody>
      * </table>
      *
@@ -2767,12 +2773,16 @@
      *
      * The filtering method will behave as follows:
      *
-     * <table cellpadding=2 summary="Filtering method behavior">
+     * <table class="striped">
+     * <caption>Filtering method behavior</caption>
+     * <thead>
      * <tr>
      * <th>Filtering Mode</th>
      * <th>Language Priority List: {@code "de-DE"}</th>
      * <th>Language Priority List: {@code "de-*-DE"}</th>
      * </tr>
+     * </thead>
+     * <tbody>
      * <tr>
      * <td style="vertical-align:top">
      * {@link FilteringMode#AUTOSELECT_FILTERING AUTOSELECT_FILTERING}
@@ -2832,6 +2842,7 @@
      * not a valid basic language range.
      * </td>
      * </tr>
+     * </tbody>
      * </table>
      *
      * @see #filter(List, Collection, FilteringMode)
--- a/jdk/src/java.base/share/classes/java/util/Queue.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/util/Queue.java	Thu May 25 22:33:25 2017 +0000
@@ -47,7 +47,7 @@
  * implementations; in most implementations, insert operations cannot
  * fail.
  *
- * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <table class="plain">
  * <caption>Summary of Queue methods</caption>
  *  <tr>
  *    <td></td>
--- a/jdk/src/java.base/share/classes/java/util/ResourceBundle.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/util/ResourceBundle.java	Thu May 25 22:33:25 2017 +0000
@@ -1222,12 +1222,15 @@
      * <p>Calling <code>getBundle</code> with the locale arguments below will
      * instantiate resource bundles as follows:
      *
-     * <table summary="getBundle() locale to resource bundle mapping">
+     * <table class="borderless">
+     * <caption style="display:none">getBundle() locale to resource bundle mapping</caption>
+     * <tbody>
      * <tr><td>Locale("fr", "CH")</td><td>MyResources_fr_CH.class, parent MyResources_fr.properties, parent MyResources.class</td></tr>
      * <tr><td>Locale("fr", "FR")</td><td>MyResources_fr.properties, parent MyResources.class</td></tr>
      * <tr><td>Locale("de", "DE")</td><td>MyResources_en.properties, parent MyResources.class</td></tr>
      * <tr><td>Locale("en", "US")</td><td>MyResources_en.properties, parent MyResources.class</td></tr>
      * <tr><td>Locale("es", "ES")</td><td>MyResources_es_ES.class, parent MyResources.class</td></tr>
+     * </tbody>
      * </table>
      *
      * <p>The file MyResources_fr_CH.properties is never used because it is
@@ -1311,9 +1314,9 @@
      * sequence of locale-format combinations to be used to call
      * <code>control.newBundle</code>.
      *
-     * <table style="width: 50%; text-align: left; margin-left: 40px;"
-     *  border="0" cellpadding="2" cellspacing="2" summary="locale-format combinations for newBundle">
-     * <tbody>
+     * <table class=striped style="width: 50%; text-align: left; margin-left: 40px;">
+     * <caption style="display:none">locale-format combinations for newBundle</caption>
+     * <thead>
      * <tr>
      * <td
      * style="vertical-align: top; text-align: left; font-weight: bold; width: 50%;"><code>Locale</code><br>
@@ -1322,6 +1325,8 @@
      * style="vertical-align: top; text-align: left; font-weight: bold; width: 50%;"><code>format</code><br>
      * </td>
      * </tr>
+     * </thead>
+     * <tbody>
      * <tr>
      * <td style="vertical-align: top; width: 50%;"><code>Locale("de", "DE")</code><br>
      * </td>
--- a/jdk/src/java.base/share/classes/java/util/concurrent/BlockingDeque.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/BlockingDeque.java	Thu May 25 22:33:25 2017 +0000
@@ -53,7 +53,7 @@
  * and the fourth blocks for only a given maximum time limit before giving
  * up.  These methods are summarized in the following table:
  *
- * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <table class="plain">
  * <caption>Summary of BlockingDeque methods</caption>
  *  <tr>
  *    <td style="text-align:center" COLSPAN = 5> <b>First Element (Head)</b></td>
@@ -128,7 +128,7 @@
  * {@code BlockingQueue} interface are precisely equivalent to
  * {@code BlockingDeque} methods as indicated in the following table:
  *
- * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <table class="plain">
  * <caption>Comparison of BlockingQueue and BlockingDeque methods</caption>
  *  <tr>
  *    <td style="text-align:center"> <b>{@code BlockingQueue} Method</b></td>
--- a/jdk/src/java.base/share/classes/java/util/concurrent/BlockingQueue.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/BlockingQueue.java	Thu May 25 22:33:25 2017 +0000
@@ -53,7 +53,7 @@
  * and the fourth blocks for only a given maximum time limit before giving
  * up.  These methods are summarized in the following table:
  *
- * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <table class="plain">
  * <caption>Summary of BlockingQueue methods</caption>
  *  <tr>
  *    <td></td>
--- a/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java	Thu May 25 22:33:25 2017 +0000
@@ -109,7 +109,7 @@
  * async event-style tasks that are not usually joined, in which case
  * there is little difference among choice of methods.
  *
- * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <table class="plain">
  * <caption>Summary of task execution methods</caption>
  *  <tr>
  *    <td></td>
--- a/jdk/src/java.base/share/classes/java/util/concurrent/ThreadLocalRandom.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/ThreadLocalRandom.java	Thu May 25 22:33:25 2017 +0000
@@ -49,6 +49,7 @@
 import java.util.stream.LongStream;
 import java.util.stream.StreamSupport;
 import jdk.internal.misc.Unsafe;
+import jdk.internal.misc.VM;
 
 /**
  * A random number generator isolated to the current thread.  Like the
@@ -1093,11 +1094,8 @@
 
     // at end of <clinit> to survive static initialization circularity
     static {
-        if (java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction<>() {
-                public Boolean run() {
-                    return Boolean.getBoolean("java.util.secureRandomSeed");
-                }})) {
+        String sec = VM.getSavedProperty("java.util.secureRandomSeed");
+        if (Boolean.parseBoolean(sec)) {
             byte[] seedBytes = java.security.SecureRandom.getSeed(8);
             long s = (long)seedBytes[0] & 0xffL;
             for (int i = 1; i < 8; ++i)
--- a/jdk/src/java.base/share/classes/java/util/regex/Pattern.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/util/regex/Pattern.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -79,13 +79,15 @@
  *
  * <h3><a id="sum">Summary of regular-expression constructs</a></h3>
  *
- * <table border="0" cellpadding="1" cellspacing="0"
- *  summary="Regular expression constructs, and what they match">
- *
+ * <table class="borderless">
+ * <caption style="display:none">Regular expression constructs, and what they match</caption>
+ * <thead>
  * <tr style="text-align:left">
  * <th style="text-align:left" id="construct">Construct</th>
  * <th style="text-align:left" id="matches">Matches</th>
  * </tr>
+ * </thead>
+ * <tbody>
  *
  * <tr><th>&nbsp;</th></tr>
  * <tr style="text-align:left"><th colspan="2" id="characters">Characters</th></tr>
@@ -383,6 +385,7 @@
  * <tr><td style="vertical-align:top" headers="construct special">{@code (?>}<i>X</i>{@code )}</td>
  *     <td headers="matches"><i>X</i>, as an independent, non-capturing group</td></tr>
  *
+ * </tbody>
  * </table>
  *
  * <hr>
@@ -429,8 +432,9 @@
  *    <p> The precedence of character-class operators is as follows, from
  *    highest to lowest:
  *
- *    <blockquote><table border="0" cellpadding="1" cellspacing="0"
- *                 summary="Precedence of character class operators.">
+ *    <blockquote><table>
+ *      <caption style="display:none">Precedence of character class operators.</caption>
+ *      <tbody>
  *      <tr><th>1&nbsp;&nbsp;&nbsp;&nbsp;</th>
  *        <td>Literal escape&nbsp;&nbsp;&nbsp;&nbsp;</td>
  *        <td>{@code \x}</td></tr>
@@ -446,6 +450,7 @@
  *      <tr><th>5&nbsp;&nbsp;&nbsp;&nbsp;</th>
  *        <td>Intersection</td>
  *        <td>{@code [a-z&&[aeiou]]}</td></tr>
+ *      </tbody>
  *    </table></blockquote>
  *
  *    <p> Note that a different set of metacharacters are in effect inside
@@ -496,7 +501,9 @@
  * left to right.  In the expression {@code ((A)(B(C)))}, for example, there
  * are four such groups: </p>
  *
- * <blockquote><table cellpadding=1 cellspacing=0 summary="Capturing group numberings">
+ * <blockquote><table>
+ * <caption style="display:none">Capturing group numberings</caption>
+ * <tbody>
  * <tr><th>1&nbsp;&nbsp;&nbsp;&nbsp;</th>
  *     <td>{@code ((A)(B(C)))}</td></tr>
  * <tr><th>2&nbsp;&nbsp;&nbsp;&nbsp;</th>
@@ -505,6 +512,7 @@
  *     <td>{@code (B(C))}</td></tr>
  * <tr><th>4&nbsp;&nbsp;&nbsp;&nbsp;</th>
  *     <td>{@code (C)}</td></tr>
+ * </tbody>
  * </table></blockquote>
  *
  * <p> Group zero always stands for the entire expression.
@@ -641,12 +649,15 @@
  * of <a href="http://www.unicode.org/reports/tr18/"><i>Unicode Regular Expression
  * </i></a>, when {@link #UNICODE_CHARACTER_CLASS} flag is specified.
  *
- * <table border="0" cellpadding="1" cellspacing="0"
- *  summary="predefined and posix character classes in Unicode mode">
+ * <table>
+ * <caption style="display:none">predefined and posix character classes in Unicode mode</caption>
+ * <thead>
  * <tr style="text-align:left">
  * <th style="text-align:left" id="predef_classes">Classes</th>
  * <th style="text-align:left" id="predef_matches">Matches</th>
- *</tr>
+ * </tr>
+ * </thead>
+ * <tbody>
  * <tr><td>{@code \p{Lower}}</td>
  *     <td>A lowercase character:{@code \p{IsLowercase}}</td></tr>
  * <tr><td>{@code \p{Upper}}</td>
@@ -685,6 +696,7 @@
  *     <td>A word character: {@code [\p{Alpha}\p{gc=Mn}\p{gc=Me}\p{gc=Mc}\p{Digit}\p{gc=Pc}\p{IsJoin_Control}]}</td></tr>
  * <tr><td>{@code \W}</td>
  *     <td>A non-word character: {@code [^\w]}</td></tr>
+ * </tbody>
  * </table>
  * <p>
  * <a id="jcc">
@@ -1207,11 +1219,14 @@
      * <p> The input {@code "boo:and:foo"}, for example, yields the following
      * results with these parameters:
      *
-     * <blockquote><table cellpadding=1 cellspacing=0
-     *              summary="Split examples showing regex, limit, and result">
+     * <blockquote><table>
+     * <caption>Split examples showing regex, limit, and result</caption>
+     * <thead>
      * <tr><th style="text-align:left"><i>Regex&nbsp;&nbsp;&nbsp;&nbsp;</i></th>
      *     <th style="text-align:left"><i>Limit&nbsp;&nbsp;&nbsp;&nbsp;</i></th>
      *     <th style="text-align:left"><i>Result&nbsp;&nbsp;&nbsp;&nbsp;</i></th></tr>
+     * </thead>
+     * <tbody>
      * <tr><td style="text-align:center">:</td>
      *     <td style="text-align:center">2</td>
      *     <td>{@code { "boo", "and:foo" }}</td></tr>
@@ -1230,6 +1245,7 @@
      * <tr><td style="text-align:center">o</td>
      *     <td style="text-align:center">0</td>
      *     <td>{@code { "b", "", ":and:f" }}</td></tr>
+     * </tbody>
      * </table></blockquote>
      *
      * @param  input
@@ -1294,14 +1310,18 @@
      * <p> The input {@code "boo:and:foo"}, for example, yields the following
      * results with these expressions:
      *
-     * <blockquote><table cellpadding=1 cellspacing=0
-     *              summary="Split examples showing regex and result">
+     * <blockquote><table>
+     * <caption style="display:none">Split examples showing regex and result</caption>
+     * <thead>
      * <tr><th style="text-align:left"><i>Regex&nbsp;&nbsp;&nbsp;&nbsp;</i></th>
      *     <th style="text-align:left"><i>Result</i></th></tr>
+     * </thead>
+     * <tbody>
      * <tr><td style="text-align:center">:</td>
      *     <td>{@code { "boo", "and", "foo" }}</td></tr>
      * <tr><td style="text-align:center">o</td>
      *     <td>{@code { "b", "", ":and:f" }}</td></tr>
+     * </tbody>
      * </table></blockquote>
      *
      *
--- a/jdk/src/java.base/share/classes/java/util/spi/CalendarNameProvider.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/util/spi/CalendarNameProvider.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -46,12 +46,16 @@
  * Calendar}. The following are calendar-common fields and their values to be
  * supported for each calendar system.
  *
- * <table style="border-bottom:1px solid" border="1" cellpadding="3" cellspacing="0" summary="Field values">
+ * <table class="plain" style="border-bottom:1px solid">
+ * <caption style="display:none">Field values</caption>
+ * <thead>
  *   <tr>
  *     <th>Field</th>
  *     <th>Value</th>
  *     <th>Description</th>
  *   </tr>
+ * </thead>
+ * <tbody>
  *   <tr>
  *     <td valign="top">{@link Calendar#MONTH}</td>
  *     <td valign="top">{@link Calendar#JANUARY} to {@link Calendar#UNDECIMBER}</td>
@@ -73,17 +77,22 @@
  *     <td valign="top">{@link Calendar#AM} to {@link Calendar#PM}</td>
  *     <td>0 - AM, 1 - PM</td>
  *   </tr>
+ * </tbody>
  * </table>
  *
  * <p style="margin-top:20px">The following are calendar-specific fields and their values to be supported.
  *
- * <table style="border-bottom:1px solid" border="1" cellpadding="3" cellspacing="0" summary="Calendar type and field values">
+ * <table class="plain" style="border-bottom:1px solid">
+ * <caption style="display:none">Calendar type and field values</caption>
+ * <thead>
  *   <tr>
  *     <th>Calendar Type</th>
  *     <th>Field</th>
  *     <th>Value</th>
  *     <th>Description</th>
  *   </tr>
+ * </thead>
+ * <tbody>
  *   <tr>
  *     <td rowspan="2" valign="top">{@code "gregory"}</td>
  *     <td rowspan="2" valign="top">{@link Calendar#ERA}</td>
@@ -154,6 +163,7 @@
  *     <td>1</td>
  *     <td>Anno Hijrah (AH)</td>
  *   </tr>
+ * </tbody>
  * </table>
  *
  * <p>Calendar field value names for {@code "gregory"} must be consistent with
--- a/jdk/src/java.base/share/classes/java/util/stream/StreamOpFlag.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/util/stream/StreamOpFlag.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -41,7 +41,7 @@
  * contexts:
  *
  * <div>
- * <table>
+ * <table class="borderless">
  *   <caption>Type Characteristics</caption>
  *   <thead class="tableSubHeadingColor">
  *     <tr>
--- a/jdk/src/java.base/share/classes/javax/crypto/Cipher.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/crypto/Cipher.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -150,9 +150,9 @@
  * <li>{@code RSA/ECB/OAEPWithSHA-256AndMGF1Padding} (1024, 2048)</li>
  * </ul>
  * These transformations are described in the
- * <a href="{@docRoot}/../technotes/guides/security/StandardNames.html#Cipher">
+ * <a href="{@docRoot}/../specs/security/standard-names.html#cipher-algorithm-names">
  * Cipher section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other transformations are supported.
  *
@@ -489,8 +489,8 @@
      * @param transformation the name of the transformation, e.g.,
      * <i>DES/CBC/PKCS5Padding</i>.
      * See the Cipher section in the <a href=
-     *   "{@docRoot}/../technotes/guides/security/StandardNames.html#Cipher">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     *   "{@docRoot}/../specs/security/standard-names.html#cipher-algorithm-names">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard transformation names.
      *
      * @return a cipher that implements the requested transformation
@@ -567,8 +567,8 @@
      * @param transformation the name of the transformation,
      * e.g., <i>DES/CBC/PKCS5Padding</i>.
      * See the Cipher section in the <a href=
-     *   "{@docRoot}/../technotes/guides/security/StandardNames.html#Cipher">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     *   "{@docRoot}/../specs/security/standard-names.html#cipher-algorithm-names">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard transformation names.
      *
      * @param provider the name of the provider.
@@ -627,8 +627,8 @@
      * @param transformation the name of the transformation,
      * e.g., <i>DES/CBC/PKCS5Padding</i>.
      * See the Cipher section in the <a href=
-     *   "{@docRoot}/../technotes/guides/security/StandardNames.html#Cipher">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     *   "{@docRoot}/../specs/security/standard-names.html#cipher-algorithm-names">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard transformation names.
      *
      * @param provider the provider.
--- a/jdk/src/java.base/share/classes/javax/crypto/ExemptionMechanism.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/crypto/ExemptionMechanism.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -125,8 +125,8 @@
      * mechanism.
      * See the ExemptionMechanism section in the
      * <a href=
-     *   "{@docRoot}/../technotes/guides/security/StandardNames.html#Exemption">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     *   "{@docRoot}/../specs/security/standard-names.html#exemption-mechanisms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard exemption mechanism names.
      *
      * @return the new {@code ExemptionMechanism} object
@@ -164,8 +164,8 @@
      * @param algorithm the standard name of the requested exemption mechanism.
      * See the ExemptionMechanism section in the
      * <a href=
-     *   "{@docRoot}/../technotes/guides/security/StandardNames.html#Exemption">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     *   "{@docRoot}/../specs/security/standard-names.html#exemption-mechanisms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard exemption mechanism names.
      *
      * @param provider the name of the provider.
@@ -208,8 +208,8 @@
      * @param algorithm the standard name of the requested exemption mechanism.
      * See the ExemptionMechanism section in the
      * <a href=
-     *   "{@docRoot}/../technotes/guides/security/StandardNames.html#Exemption">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     *   "{@docRoot}/../specs/security/standard-names.html#exemption-mechanisms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard exemption mechanism names.
      *
      * @param provider the provider.
--- a/jdk/src/java.base/share/classes/javax/crypto/KeyAgreement.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/crypto/KeyAgreement.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -60,9 +60,9 @@
  * <li>{@code DiffieHellman}</li>
  * </ul>
  * This algorithm is described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyAgreement">
+ * "{@docRoot}/../specs/security/standard-names.html#keyagreement-algorithms">
  * KeyAgreement section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other algorithms are supported.
  *
@@ -161,8 +161,8 @@
      * @param algorithm the standard name of the requested key agreement
      * algorithm.
      * See the KeyAgreement section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyAgreement">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keyagreement-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @return the new {@code KeyAgreement} object
@@ -208,8 +208,8 @@
      * @param algorithm the standard name of the requested key agreement
      * algorithm.
      * See the KeyAgreement section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyAgreement">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keyagreement-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the name of the provider.
@@ -252,8 +252,8 @@
      * @param algorithm the standard name of the requested key agreement
      * algorithm.
      * See the KeyAgreement section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyAgreement">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keyagreement-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the provider.
--- a/jdk/src/java.base/share/classes/javax/crypto/KeyGenerator.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/crypto/KeyGenerator.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -95,9 +95,9 @@
  * <li>{@code HmacSHA256}</li>
  * </ul>
  * These algorithms are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyGenerator">
+ * "{@docRoot}/../specs/security/standard-names.html#keygenerator-algorithms">
  * KeyGenerator section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other algorithms are supported.
  *
@@ -216,8 +216,8 @@
      *
      * @param algorithm the standard name of the requested key algorithm.
      * See the KeyGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyGenerator">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keygenerator-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @return the new {@code KeyGenerator} object
@@ -250,8 +250,8 @@
      *
      * @param algorithm the standard name of the requested key algorithm.
      * See the KeyGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyGenerator">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keygenerator-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the name of the provider.
@@ -293,8 +293,8 @@
      *
      * @param algorithm the standard name of the requested key algorithm.
      * See the KeyGenerator section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyGenerator">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#keygenerator-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the provider.
--- a/jdk/src/java.base/share/classes/javax/crypto/Mac.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/crypto/Mac.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -61,9 +61,9 @@
  * <li>{@code HmacSHA256}</li>
  * </ul>
  * These algorithms are described in the
- * <a href="{@docRoot}/../technotes/guides/security/StandardNames.html#Mac">
+ * <a href="{@docRoot}/../specs/security/standard-names.html#mac-algorithms">
  * Mac section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other algorithms are supported.
  *
@@ -162,8 +162,8 @@
      *
      * @param algorithm the standard name of the requested MAC algorithm.
      * See the Mac section in the <a href=
-     *   "{@docRoot}/../technotes/guides/security/StandardNames.html#Mac">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     *   "{@docRoot}/../specs/security/standard-names.html#mac-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @return the new {@code Mac} object
@@ -206,8 +206,8 @@
      *
      * @param algorithm the standard name of the requested MAC algorithm.
      * See the Mac section in the <a href=
-     *   "{@docRoot}/../technotes/guides/security/StandardNames.html#Mac">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     *   "{@docRoot}/../specs/security/standard-names.html#mac-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the name of the provider.
@@ -247,8 +247,8 @@
      *
      * @param algorithm the standard name of the requested MAC algorithm.
      * See the Mac section in the <a href=
-     *   "{@docRoot}/../technotes/guides/security/StandardNames.html#Mac">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     *   "{@docRoot}/../specs/security/standard-names.html#mac-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the provider.
--- a/jdk/src/java.base/share/classes/javax/crypto/SecretKeyFactory.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/crypto/SecretKeyFactory.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -65,9 +65,9 @@
  * <li>{@code DESede}</li>
  * </ul>
  * These algorithms are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecretKeyFactory">
+ * "{@docRoot}/../specs/security/standard-names.html#secretkeyfactory-algorithms">
  * SecretKeyFactory section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other algorithms are supported.
  *
@@ -148,8 +148,8 @@
      * @param algorithm the standard name of the requested secret-key
      * algorithm.
      * See the SecretKeyFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecretKeyFactory">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#secretkeyfactory-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @return the new {@code SecretKeyFactory} object
@@ -183,8 +183,8 @@
      * @param algorithm the standard name of the requested secret-key
      * algorithm.
      * See the SecretKeyFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecretKeyFactory">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#secretkeyfactory-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the name of the provider.
@@ -227,8 +227,8 @@
      * @param algorithm the standard name of the requested secret-key
      * algorithm.
      * See the SecretKeyFactory section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecretKeyFactory">
-     * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#secretkeyfactory-algorithms">
+     * Java Security Standard Algorithm Names Specification</a>
      * for information about standard algorithm names.
      *
      * @param provider the provider.
--- a/jdk/src/java.base/share/classes/javax/crypto/package-info.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/crypto/package-info.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -42,9 +42,9 @@
  * having to add or rewrite code.
  *
  * <ul>
- *   <li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html">
- *     <b>Java&trade; Cryptography Architecture Standard Algorithm Name
- *     Documentation</b></a></li>
+ *   <li><a href="{@docRoot}/../specs/security/standard-names.html">
+ *     <b>Java&trade; Security Standard Algorithm Names Specification
+ *     </b></a></li>
  * </ul>
  *
  * <h2>Related Documentation</h2>
--- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLContext.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLContext.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -45,9 +45,9 @@
  * <li>{@code TLSv1.2}</li>
  * </ul>
  * These protocols are described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#SSLContext">
+ * "{@docRoot}/../specs/security/standard-names.html#sslcontext-algorithms">
  * SSLContext section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other algorithms are supported.
  *
@@ -147,9 +147,8 @@
      *
      * @param protocol the standard name of the requested protocol.
      *          See the SSLContext section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SSLContext">
-     *          Java Cryptography Architecture Standard Algorithm Name
-     *          Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#sslcontext-algorithms">
+     *          Java Security Standard Algorithm Names Specification</a>
      *          for information about standard protocol names.
      *
      * @return the new {@code SSLContext} object
@@ -185,9 +184,8 @@
      *
      * @param protocol the standard name of the requested protocol.
      *          See the SSLContext section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SSLContext">
-     *          Java Cryptography Architecture Standard Algorithm Name
-     *          Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#sslcontext-algorithms">
+     *          Java Security Standard Algorithm Names Specification</a>
      *          for information about standard protocol names.
      *
      * @param provider the name of the provider.
@@ -228,9 +226,8 @@
      *
      * @param protocol the standard name of the requested protocol.
      *          See the SSLContext section in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#SSLContext">
-     *          Java Cryptography Architecture Standard Algorithm Name
-     *          Documentation</a>
+     * "{@docRoot}/../specs/security/standard-names.html#sslcontext-algorithms">
+     *          Java Security Standard Algorithm Names Specification</a>
      *          for information about standard protocol names.
      *
      * @param provider an instance of the provider.
--- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLEngine.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLEngine.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -866,7 +866,7 @@
      * <P>
      * The returned array includes cipher suites from the list of standard
      * cipher suite names in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#ciphersuites">
+     * "{@docRoot}/../specs/security/standard-names.html#jsse-cipher-suite-names">
      * JSSE Cipher Suite Names</a> section of the Java Cryptography
      * Architecture Standard Algorithm Name Documentation, and may also
      * include other cipher suites that the provider supports.
@@ -892,7 +892,7 @@
      * <P>
      * The returned array includes cipher suites from the list of standard
      * cipher suite names in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#ciphersuites">
+     * "{@docRoot}/../specs/security/standard-names.html#jsse-cipher-suite-names">
      * JSSE Cipher Suite Names</a> section of the Java Cryptography
      * Architecture Standard Algorithm Name Documentation, and may also
      * include other cipher suites that the provider supports.
@@ -914,7 +914,7 @@
      * <P>
      * Note that the standard list of cipher suite names may be found in the
      * <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#ciphersuites">
+     * "{@docRoot}/../specs/security/standard-names.html#jsse-cipher-suite-names">
      * JSSE Cipher Suite Names</a> section of the Java Cryptography
      * Architecture Standard Algorithm Name Documentation.  Providers
      * may support cipher suite names not found in this list or might not
--- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLParameters.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLParameters.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -110,7 +110,7 @@
      * constructor followed by
      * {@code setCipherSuites(cipherSuites);}.  Note that the
      * standard list of cipher suite names may be found in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#ciphersuites">
+     * "{@docRoot}/../specs/security/standard-names.html#jsse-cipher-suite-names">
      * JSSE Cipher Suite Names</a> section of the Java Cryptography
      * Architecture Standard Algorithm Name Documentation.  Providers
      * may support cipher suite names not found in this list.
@@ -130,7 +130,7 @@
      * {@code setCipherSuites(cipherSuites); setProtocols(protocols);}.
      * Note that the standard list of cipher suite names may be found in the
      * <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#ciphersuites">
+     * "{@docRoot}/../specs/security/standard-names.html#jsse-cipher-suite-names">
      * JSSE Cipher Suite Names</a> section of the Java Cryptography
      * Architecture Standard Algorithm Name Documentation.  Providers
      * may support cipher suite names not found in this list.
@@ -153,7 +153,7 @@
      * <P>
      * The returned array includes cipher suites from the list of standard
      * cipher suite names in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#ciphersuites">
+     * "{@docRoot}/../specs/security/standard-names.html#jsse-cipher-suite-names">
      * JSSE Cipher Suite Names</a> section of the Java Cryptography
      * Architecture Standard Algorithm Name Documentation, and may also
      * include other cipher suites that the provider supports.
@@ -170,7 +170,7 @@
      *
      * @param cipherSuites the array of ciphersuites (or null).  Note that the
      * standard list of cipher suite names may be found in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#ciphersuites">
+     * "{@docRoot}/../specs/security/standard-names.html#jsse-cipher-suite-names">
      * JSSE Cipher Suite Names</a> section of the Java Cryptography
      * Architecture Standard Algorithm Name Documentation.  Providers
      * may support cipher suite names not found in this list or might not
@@ -675,4 +675,3 @@
         applicationProtocols = tempProtocols;
     }
 }
-
--- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLPermission.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLPermission.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -44,14 +44,17 @@
  * and for each provides a description of what the permission allows
  * and a discussion of the risks of granting code the permission.
  *
- * <table border=1 cellpadding=5
- *  summary="permission name, what it allows, and associated risks">
+ * <table class="striped">
+ * <caption style="display:none">permission name, what it allows, and associated risks</caption>
+ * <thead>
  * <tr>
  * <th>Permission Target Name</th>
  * <th>What the Permission Allows</th>
  * <th>Risks of Allowing this Permission</th>
  * </tr>
+ * </thead>
  *
+ * <tbody>
  * <tr>
  *   <td>setHostnameVerifier</td>
  *   <td>The ability to set a callback which can decide whether to
@@ -84,6 +87,7 @@
  * </td>
  * </tr>
  *
+ * </tbody>
  * </table>
  *
  * @see java.security.BasicPermission
--- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLServerSocket.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLServerSocket.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -198,7 +198,7 @@
      * <P>
      * The returned array includes cipher suites from the list of standard
      * cipher suite names in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#ciphersuites">
+     * "{@docRoot}/../specs/security/standard-names.html#jsse-cipher-suite-names">
      * JSSE Cipher Suite Names</a> section of the Java Cryptography
      * Architecture Standard Algorithm Name Documentation, and may also
      * include other cipher suites that the provider supports.
@@ -224,7 +224,7 @@
      * <P>
      * Note that the standard list of cipher suite names may be found in the
      * <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#ciphersuites">
+     * "{@docRoot}/../specs/security/standard-names.html#jsse-cipher-suite-names">
      * JSSE Cipher Suite Names</a> section of the Java Cryptography
      * Architecture Standard Algorithm Name Documentation.  Providers
      * may support cipher suite names not found in this list or might not
@@ -254,7 +254,7 @@
      * <P>
      * The returned array includes cipher suites from the list of standard
      * cipher suite names in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#ciphersuites">
+     * "{@docRoot}/../specs/security/standard-names.html#jsse-cipher-suite-names">
      * JSSE Cipher Suite Names</a> section of the Java Cryptography
      * Architecture Standard Algorithm Name Documentation, and may also
      * include other cipher suites that the provider supports.
--- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLServerSocketFactory.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLServerSocketFactory.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -126,7 +126,7 @@
      * <P>
      * The returned array includes cipher suites from the list of standard
      * cipher suite names in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#ciphersuites">
+     * "{@docRoot}/../specs/security/standard-names.html#jsse-cipher-suite-names">
      * JSSE Cipher Suite Names</a> section of the Java Cryptography
      * Architecture Standard Algorithm Name Documentation, and may also
      * include other cipher suites that the provider supports.
@@ -147,7 +147,7 @@
      * <P>
      * The returned array includes cipher suites from the list of standard
      * cipher suite names in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#ciphersuites">
+     * "{@docRoot}/../specs/security/standard-names.html#jsse-cipher-suite-names">
      * JSSE Cipher Suite Names</a> section of the Java Cryptography
      * Architecture Standard Algorithm Name Documentation, and may also
      * include other cipher suites that the provider supports.
--- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLSocket.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLSocket.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -270,7 +270,7 @@
      * <P>
      * The returned array includes cipher suites from the list of standard
      * cipher suite names in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#ciphersuites">
+     * "{@docRoot}/../specs/security/standard-names.html#jsse-cipher-suite-names">
      * JSSE Cipher Suite Names</a> section of the Java Cryptography
      * Architecture Standard Algorithm Name Documentation, and may also
      * include other cipher suites that the provider supports.
@@ -296,7 +296,7 @@
      * <P>
      * The returned array includes cipher suites from the list of standard
      * cipher suite names in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#ciphersuites">
+     * "{@docRoot}/../specs/security/standard-names.html#jsse-cipher-suite-names">
      * JSSE Cipher Suite Names</a> section of the Java Cryptography
      * Architecture Standard Algorithm Name Documentation, and may also
      * include other cipher suites that the provider supports.
@@ -318,7 +318,7 @@
      * <P>
      * Note that the standard list of cipher suite names may be found in the
      * <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#ciphersuites">
+     * "{@docRoot}/../specs/security/standard-names.html#jsse-cipher-suite-names">
      * JSSE Cipher Suite Names</a> section of the Java Cryptography
      * Architecture Standard Algorithm Name Documentation.  Providers
      * may support cipher suite names not found in this list or might not
--- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLSocketFactory.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLSocketFactory.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -151,7 +151,7 @@
      * <P>
      * The returned array includes cipher suites from the list of standard
      * cipher suite names in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#ciphersuites">
+     * "{@docRoot}/../specs/security/standard-names.html#jsse-cipher-suite-names">
      * JSSE Cipher Suite Names</a> section of the Java Cryptography
      * Architecture Standard Algorithm Name Documentation, and may also
      * include other cipher suites that the provider supports.
@@ -170,7 +170,7 @@
      * <P>
      * The returned array includes cipher suites from the list of standard
      * cipher suite names in the <a href=
-     * "{@docRoot}/../technotes/guides/security/StandardNames.html#ciphersuites">
+     * "{@docRoot}/../specs/security/standard-names.html#jsse-cipher-suite-names">
      * JSSE Cipher Suite Names</a> section of the Java Cryptography
      * Architecture Standard Algorithm Name Documentation, and may also
      * include other cipher suites that the provider supports.
--- a/jdk/src/java.base/share/classes/javax/net/ssl/TrustManagerFactory.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/TrustManagerFactory.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -43,9 +43,9 @@
  * <li>{@code PKIX}</li>
  * </ul>
  * This algorithm is described in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#TrustManagerFactory">
+ * "{@docRoot}/../specs/security/standard-names.html#trustmanagerfactory-algorithms">
  * TrustManagerFactory section</a> of the
- * Java Cryptography Architecture Standard Algorithm Name Documentation.
+ * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
  * other algorithms are supported.
  *
--- a/jdk/src/java.base/share/classes/javax/net/ssl/package-info.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/package-info.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -31,9 +31,9 @@
  * the communicating peers.
  *
  * <ul>
- * <li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html">
- * <b>Java&trade; Cryptography Architecture Standard Algorithm Name
- * Documentation</b></a></li>
+ * <li><a href="{@docRoot}/../specs/security/standard-names.html">
+ * <b>Java&trade; Security Standard Algorithm Names Specification
+ * </b></a></li>
  * </ul>
  *
  * @since 1.4
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/Configuration.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/Configuration.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -178,8 +178,8 @@
  * constructed by invoking one of the {@code getInstance} factory methods
  * with a standard type.  The default policy type is "JavaLoginConfig".
  * See the Configuration section in the <a href=
- * "{@docRoot}/../technotes/guides/security/StandardNames.html#Configuration">
- * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
+ * "{@docRoot}/../specs/security/standard-names.html#configuration-types">
+ * Java Security Standard Algorithm Names Specification</a>
  * for a list of standard Configuration types.
  *
  * @see javax.security.auth.login.LoginContext
@@ -323,9 +323,9 @@
      *
      * @param type the specified Configuration type.  See the Configuration
      *    section in the <a href=
-     *    "{@docRoot}/../technotes/guides/security/StandardNames.html#Configuration">
-     *    Java Cryptography Architecture Standard Algorithm Name
-     *    Documentation</a> for a list of standard Configuration types.
+     *    "{@docRoot}/../specs/security/standard-names.html#configuration-types">
+     *    Java Security Standard Algorithm Names Specification</a>
+     *    for a list of standard Configuration types.
      *
      * @param params parameters for the Configuration, which may be null.
      *
@@ -381,9 +381,9 @@
      *
      * @param type the specified Configuration type.  See the Configuration
      *    section in the <a href=
-     *    "{@docRoot}/../technotes/guides/security/StandardNames.html#Configuration">
-     *    Java Cryptography Architecture Standard Algorithm Name
-     *    Documentation</a> for a list of standard Configuration types.
+     *    "{@docRoot}/../specs/security/standard-names.html#configuration-types">
+     *    Java Security Standard Algorithm Names Specification</a>
+     *    for a list of standard Configuration types.
      *
      * @param params parameters for the Configuration, which may be null.
      *
@@ -448,9 +448,9 @@
      *
      * @param type the specified Configuration type.  See the Configuration
      *    section in the <a href=
-     *    "{@docRoot}/../technotes/guides/security/StandardNames.html#Configuration">
-     *    Java Cryptography Architecture Standard Algorithm Name
-     *    Documentation</a> for a list of standard Configuration types.
+     *    "{@docRoot}/../specs/security/standard-names.html#configuration-types">
+     *    Java Security Standard Algorithm Names Specification</a>
+     *    for a list of standard Configuration types.
      *
      * @param params parameters for the Configuration, which may be null.
      *
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/package-info.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/package-info.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -28,10 +28,9 @@
  * <h2>Package Specification</h2>
  *
  * <ul>
- *   <li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html">
- *     <b>Java&trade;
- *     Cryptography Architecture Standard Algorithm Name
- *     Documentation</b></a></li>
+ *   <li><a href="{@docRoot}/../specs/security/standard-names.html">
+ *     <b>Java&trade; Security Standard Algorithm Names Specification
+ *     </b></a></li>
  * </ul>
  *
  * @since 1.4
--- a/jdk/src/java.base/share/classes/module-info.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/classes/module-info.java	Thu May 25 22:33:25 2017 +0000
@@ -190,7 +190,8 @@
         jdk.unsupported;
     exports jdk.internal.vm.annotation to
         jdk.unsupported,
-        jdk.internal.vm.ci;
+        jdk.internal.vm.ci,
+        jdk.incubator.httpclient;
     exports jdk.internal.util.jar to
         jdk.jartool,
         jdk.jdeps,
--- a/jdk/src/java.base/share/classes/sun/security/ssl/RecordType.java	Thu May 25 15:27:40 2017 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +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.
- */
-
-package sun.security.ssl;
-
-/*
- * enumation of record type
- */
-enum RecordType {
-
-    RECORD_CHANGE_CIPHER_SPEC   (Record.ct_change_cipher_spec,
-                                    HandshakeMessage.ht_not_applicable),
-    RECORD_ALERT                (Record.ct_alert,
-                                    HandshakeMessage.ht_not_applicable),
-    RECORD_HELLO_REQUEST        (Record.ct_handshake,
-                                    HandshakeMessage.ht_hello_request),
-    RECORD_CLIENT_HELLO         (Record.ct_handshake,
-                                    HandshakeMessage.ht_client_hello),
-    RECORD_SERVER_HELLO         (Record.ct_handshake,
-                                    HandshakeMessage.ht_server_hello),
-    RECORD_HELLO_VERIFY_REQUEST (Record.ct_handshake,
-                                    HandshakeMessage.ht_hello_verify_request),
-    RECORD_NEW_SESSION_TICKET   (Record.ct_handshake,
-                                    HandshakeMessage.ht_new_session_ticket),
-    RECORD_CERTIFICATE          (Record.ct_handshake,
-                                    HandshakeMessage.ht_certificate),
-    RECORD_SERVER_KEY_EXCHANGE  (Record.ct_handshake,
-                                    HandshakeMessage.ht_server_key_exchange),
-    RECORD_CERTIFICATE_REQUEST  (Record.ct_handshake,
-                                    HandshakeMessage.ht_certificate_request),
-    RECORD_SERVER_HELLO_DONE    (Record.ct_handshake,
-                                    HandshakeMessage.ht_server_hello_done),
-    RECORD_CERTIFICATE_VERIFY   (Record.ct_handshake,
-                                    HandshakeMessage.ht_certificate_verify),
-    RECORD_CLIENT_KEY_EXCHANGE  (Record.ct_handshake,
-                                    HandshakeMessage.ht_client_key_exchange),
-    RECORD_FINISHED             (Record.ct_handshake,
-                                    HandshakeMessage.ht_finished),
-    RECORD_CERTIFICATE_URL      (Record.ct_handshake,
-                                    HandshakeMessage.ht_certificate_url),
-    RECORD_CERTIFICATE_STATUS   (Record.ct_handshake,
-                                    HandshakeMessage.ht_certificate_status),
-    RECORD_SUPPLIEMENTAL_DATA   (Record.ct_handshake,
-                                    HandshakeMessage.ht_supplemental_data),
-    RECORD_APPLICATION_DATA     (Record.ct_application_data,
-                                    HandshakeMessage.ht_not_applicable);
-
-    byte            contentType;
-    byte            handshakeType;
-
-    private RecordType(byte contentType, byte handshakeType) {
-        this.contentType = contentType;
-        this.handshakeType = handshakeType;
-    }
-
-    static RecordType valueOf(byte contentType, byte handshakeType) {
-        if (contentType == Record.ct_change_cipher_spec) {
-            return RECORD_CHANGE_CIPHER_SPEC;
-        } else if (contentType == Record.ct_alert) {
-            return RECORD_ALERT;
-        } else if (contentType == Record.ct_application_data) {
-            return RECORD_APPLICATION_DATA;
-        } else if (handshakeType == HandshakeMessage.ht_hello_request) {
-            return RECORD_HELLO_REQUEST;
-        } else if (handshakeType == HandshakeMessage.ht_client_hello) {
-            return RECORD_CLIENT_HELLO;
-        } else if (handshakeType == HandshakeMessage.ht_server_hello) {
-            return RECORD_SERVER_HELLO;
-        } else if (handshakeType == HandshakeMessage.ht_hello_verify_request) {
-            return RECORD_HELLO_VERIFY_REQUEST;
-        } else if (handshakeType == HandshakeMessage.ht_new_session_ticket) {
-            return RECORD_NEW_SESSION_TICKET;
-        } else if (handshakeType == HandshakeMessage.ht_certificate) {
-            return RECORD_CERTIFICATE;
-        } else if (handshakeType == HandshakeMessage.ht_server_key_exchange) {
-            return RECORD_SERVER_KEY_EXCHANGE;
-        } else if (handshakeType == HandshakeMessage.ht_certificate_request) {
-            return RECORD_CERTIFICATE_REQUEST;
-        } else if (handshakeType == HandshakeMessage.ht_server_hello_done) {
-            return RECORD_SERVER_HELLO_DONE;
-        } else if (handshakeType == HandshakeMessage.ht_certificate_verify) {
-            return RECORD_CERTIFICATE_VERIFY;
-        } else if (handshakeType == HandshakeMessage.ht_client_key_exchange) {
-            return RECORD_CLIENT_KEY_EXCHANGE;
-        } else if (handshakeType == HandshakeMessage.ht_finished) {
-            return RECORD_FINISHED;
-        } else if (handshakeType == HandshakeMessage.ht_certificate_url) {
-            return RECORD_CERTIFICATE_URL;
-        } else if (handshakeType == HandshakeMessage.ht_certificate_status) {
-            return RECORD_CERTIFICATE_STATUS;
-        } else if (handshakeType == HandshakeMessage.ht_supplemental_data) {
-            return RECORD_SUPPLIEMENTAL_DATA;
-        }
-
-        // otherwise, invalid record type
-        throw new IllegalArgumentException(
-                "Invalid record type (ContentType:" + contentType +
-                ", HandshakeType:" + handshakeType + ")");
-    }
-}
--- a/jdk/src/java.base/share/specs/serialization/changelog.md	Thu May 25 15:27:40 2017 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
----
-# Copyright (c) 2005, 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.
-
-include-before: '[CONTENTS](index.html) | [PREV](index.html) | [NEXT](serial-arch.html)'
-include-after: '[CONTENTS](index.html) | [PREV](index.html) | [NEXT](serial-arch.html)'
-
-title: 'Java Object Serialization Specification: 0 - Change History'
----
-
--------------------------------------------------------------------------------
-
-May 12, 2005 Updates for Java^TM^ SE Development Kit, v6 Beta 1
-
--   Added statement about how an array object returned by a `readResolve`
-    invocation for an unshared read is handled.
--   Clarified the behavior in the event of an invalid `serialPersistentFields`
-    value.
--   Clarified that `serialVersionUID` matching is waived for array classes.
--   Clarified when `IllegalArgumentException` is thrown by
-    `ObjectOutputStream.PutFields` methods.
-
-July 24, 2003 Updates for Java^TM^ 2 SDK, Standard Edition, v1.5 Beta 1
-
--   Added support for serializing enum constants.
--   Added specification of class modifier flags used in the computation of
-    default `serialVersionUID` values to [Section 4.6, "Stream Unique
-    Identifiers"](class.html#stream-unique-identifiers).
-
-Aug. 16, 2001 Updates for Java^TM^ 2 SDK, Standard Edition, v1.4 Beta 2
-
--   Added support for class-defined `readObjectNoData` methods, to be used for
-    initializing serializable class fields in cases not covered by
-    class-defined readObject methods. See [Section 3.5, "The readObjectNoData
-    Method"](input.html#the-readobjectnodata-method), as well as Appendix A,
-    "Security in Object Serialization".
--   New methods `ObjectOutputStream.writeUnshared` and
-    `ObjectInputStream.readUnshared` provide a mechanism for ensuring unique
-    references to deserialized objects. See [Section 2.1, "The
-    ObjectOutputStream Class"](output.html#the-objectoutputstream-class),
-    [Section 3.1, "The ObjectInputStream
-    Class"](input.html#the-objectinputstream-class), as well as Appendix A,
-    "Security in Object Serialization".
--   Documented new security checks in the one-argument constructors for
-    `ObjectOutputStream` and `ObjectInputStream`. See [Section 2.1, "The
-    ObjectOutputStream Class"](output.html#the-objectoutputstream-class) and
-    [Section 3.1, "The ObjectInputStream
-    Class"](input.html#the-objectinputstream-class).
--   Added caution against using inner classes for serialization in [Section
-    1.10, "The Serializable
-    Interface"](serial-arch.html#the-serializable-interface).
--   Clarified requirement that class-defined `writeObject` methods invoke
-    `ObjectOutputStream.defaultWriteObject` or `writeFields` once before
-    writing optional data, and that class-defined `readObject` methods invoke
-    `ObjectInputStream.defaultReadObject` or `readFields` once before reading
-    optional data. See [Section 2.3, "The writeObject
-    Method"](output.html#the-writeobject-method) and [Section 3.4, "The
-    readObject Method"](input.html#the-readobject-method).
--   Clarified the behavior of `ObjectInputStream` when class-defined
-    `readObject` or `readExternal` methods attempt read operations which exceed
-    the bounds of available data; see [Section 3.4, "The readObject
-    Method"](input.html#the-readobject-method) and [Section 3.6, "The
-    readExternal Method"](input.html#the-readexternal-method).
--   Clarified the description of non-proxy class descriptor field type strings
-    to require that they be written in "field descriptor" format; see [Section
-    6.2, "Stream Elements"](protocol.html#stream-elements).
-
-July 30, 1999 Updates for Java^TM^ 2 SDK, Standard Edition, v1.3 Beta
-
--   Added the ability to write `String` objects for which the UTF encoding is
-    longer than 65535 bytes in length. See [Section 6.2, "Stream
-    Elements"](protocol.html#stream-elements).
--   New methods `ObjectOutputStream.writeClassDescriptor` and
-    `ObjectInputStream.readClassDescriptor` provide a means of customizing the
-    serialized representation of `ObjectStreamClass` class descriptors. See
-    [Section 2.1, "The ObjectOutputStream
-    Class"](output.html#the-objectoutputstream-class) and [Section 3.1, "The
-    ObjectInputStream Class"](input.html#the-objectinputstream-class).
--   Expanded Appendix A, "[Security in Object
-    Serialization"](security.html#security-in-object-serialization).
-
-Sept. 30, 1998 Updates for JDK^TM^ 1.2 Beta4 RC1
-
--   Documentation corrections only.
-
-June 22, 1998 Updates for JDK^TM^ 1.2 Beta4
-
--   Eliminated JDK^TM^ 1.2 `java.io` interfaces, `Replaceable` and
-    `Resolvable`.References to either of these classes as an interface should
-    be replaced with `java.io.Serializable`. Serialization will use reflection
-    to invoke the methods, `writeReplace` and `readResolve`, if the
-    Serializable class defines these methods. See [Section 2.5, "The
-    writeReplace Method"](output.html#the-writereplace-method) and [Section
-    3.7, "The readResolve Method"](input.html#the-readresolve-method).
--   New javadoc tags *@serial*, *@serialField*, and *@serialData* provide a way
-    to document the Serialized Form of a Serializable class. Javadoc generates
-    a serialization specification based on the contents of these tags. See
-    [Section 1.6, "Documenting Serializable Fields and Data for a
-    Class"](serial-arch.html#documenting-serializable-fields-and-data-for-a-class).
--   Special Serializable class member, `serialPersistentFields`, must be
-    declared private. See [Section 1.5, "Defining Serializable Fields for a
-    Class"](serial-arch.html#defining-serializable-fields-for-a-class).
--   Clarified the steps involved in computing the `serialVersionUID` in
-    [Section 4.6, "Stream Unique
-    Identifiers"](class.html#stream-unique-identifiers).
-
-Feb. 6, 1998 Updates for JDK^TM^ 1.2 Beta 3
-
--   Introduced the concept of `STREAM_PROTOCOL` versions. Added the
-    `STREAM_PROTOCOL_2` version to indicate a new format for `Externalizable`
-    objects that enable skipping by an `Externalizable` object within the
-    stream, even when the object's class is not available in the local Virtual
-    Machine. Compatibility issues are discussed in [Section 6.3, "Stream
-    Protocol Versions"](protocol.html#stream-protocol-versions).
--   `The ObjectInputStream.resolveClass` method can return a local class in a
-    different package than the name of the class within the stream. This
-    capability enables renaming of packages between releases. The
-    `serialVersionUID` and the base class name must be the same in the stream
-    and in the local version of the class. See [Section 3.1, "The
-    ObjectInputStream Class"](input.html#the-objectinputstream-class).
--   Allow substitution of `String` or `array` objects when writing them to or
-    reading them from the stream. See [Section 2.1, "The ObjectOutputStream
-    Class"](output.html#the-objectoutputstream-class) and [Section 3.1, "The
-    ObjectInputStream Class"](input.html#the-objectinputstream-class).
-
-Sept. 4, 1997 Updates for JDK^TM^ 1.2 Beta1
-
--   Separated the Replaceable interface into two interfaces: Replaceable and
-    Resolvable. The Replaceable interface allows a class to nominate its own
-    replacement just before serializing the object to the stream. The
-    Resolvable interface allows a class to nominate its own replacement when
-    reading an object from the stream.
--   Modified serialization to use the JDK^TM^ 1.2 security model. There is a
-    check for `SerializablePermission "enableSubstitution"` within the
-    `ObjectInputStream.enableReplace` and `ObjectOutputStream.enableResolve`
-    methods. See [Section 2.1, "The ObjectOutputStream
-    Class"](output.html#the-objectoutputstream-class) and [Section 3.1, "The
-    ObjectInputStream Class"](input.html#the-objectinputstream-class).
--   Updated `writeObject`'s exception handler to write handled `IOException`s
-    into the stream. See [Section 2.1, "The ObjectOutputStream
-    Class"](output.html#the-objectoutputstream-class).
-
-July 3, 1997 Updates for JDK^TM^ 1.2 Alpha
-
--   Documented the requirements for specifying the serialized state of classes.
-    See [Section 1.5, "Defining Serializable Fields for a
-    Class"](serial-arch.html#defining-serializable-fields-for-a-class).
--   Added the Serializable Fields API to allow classes more flexibility in
-    accessing the serialized fields of a class. The stream protocol is
-    unchanged. See [Section 1.7, "Accessing Serializable Fields of a
-    Class](serial-arch.html#accessing-serializable-fields-of-a-class),"
-    [Section 2.2, "The ObjectOutputStream.PutField
-    Class](output.html#the-objectoutputstream.putfield-class)," and [Section
-    3.2, "The ObjectInputStream.GetField
-    Class"](input.html#the-objectinputstream.getfield-class).
--   Clarified that field descriptors and data are written to and read from the
-    stream in canonical order. See [Section 4.1, "The ObjectStreamClass
-    Class"](class.html#the-objectstreamclass-class).
-
--------------------------------------------------------------------------------
-
-*[Copyright](../../../legal/SMICopyright.html) &copy; 2005, 2017, Oracle
-and/or its affiliates. All rights reserved.*
--- a/jdk/src/java.base/share/specs/serialization/class.md	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/specs/serialization/class.md	Thu May 25 22:33:25 2017 +0000
@@ -241,13 +241,7 @@
 ## 4.5 Inspecting Serializable Classes
 
 The program *serialver* can be used to find out if a class is serializable and
-to get its `serialVersionUID`. When invoked with the-show option, it puts up a
-simple user interface. To find out if a class is serializable and to find out
-its *serialVersionUID*`,` enter its full class name, then press either the
-Enter or the Show button. The string printed can be copied and pasted into the
-evolved class.
-
->   ![*serialver, Serial Version Inspector program*](images/class.gif)
+to get its `serialVersionUID`. 
 
 When invoked on the command line with one or more class names, serialver prints
 the `serialVersionUID` for each class in a form suitable for copying into an
Binary file jdk/src/java.base/share/specs/serialization/images/class.gif has changed
--- a/jdk/src/java.base/share/specs/serialization/index.md	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/specs/serialization/index.md	Thu May 25 22:33:25 2017 +0000
@@ -20,8 +20,8 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 
-include-before: 'CONTENTS | PREV | [NEXT](changelog.html)'
-include-after: 'CONTENTS | PREV | [NEXT](changelog.html)'
+include-before: 'CONTENTS | PREV | [NEXT](serial-arch.html)'
+include-after: 'CONTENTS | PREV | [NEXT](serial-arch.html)'
 
 title: 'Java Object Serialization Specification: Contents'
 ---
@@ -30,8 +30,6 @@
 
 ## Table of Contents
 
-### 0 [Change History](changelog.html)
-
 ### 1 [System Architecture](serial-arch.html)
 
 -   1.1 [Overview](serial-arch.html#overview)
--- a/jdk/src/java.base/share/specs/serialization/output.md	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/specs/serialization/output.md	Thu May 25 22:33:25 2017 +0000
@@ -221,7 +221,8 @@
     If the replacement object is not one of the types covered by Steps 3
     through 7, processing resumes using the replacement object at Step 10.
 
-9.  If the object is a `java.lang.String,` the string is written as length
+9.  <a id="java-lang-string-encoding"></a>
+    If the object is a `java.lang.String,` the string is written as length
     information followed by the contents of the string encoded in modified
     UTF-8. For details, refer to [Section 6.2, "Stream
     Elements"](protocol.html#stream-elements). A handle is assigned to the
--- a/jdk/src/java.base/share/specs/serialization/security.md	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/specs/serialization/security.md	Thu May 25 22:33:25 2017 +0000
@@ -28,9 +28,9 @@
 
 -------------------------------------------------------------------------------
 
-Refer to the [Secure Coding Guidelines for the Java Programming
-Language](http://www.oracle.com/technetwork/java/seccodeguide-139067.html) for
-information about security in object serialization.
+Refer to the [Secure Coding Guidelines for the Java Programming 
+Language](http://www.oracle.com/pls/topic/lookup?ctx=javase9&id=secure_coding_guidelines_javase) 
+for information about security in object serialization.
 
 -------------------------------------------------------------------------------
 
--- a/jdk/src/java.base/share/specs/serialization/serial-arch.md	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/share/specs/serialization/serial-arch.md	Thu May 25 22:33:25 2017 +0000
@@ -20,8 +20,8 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 
-include-before: '[CONTENTS](index.html) | [PREV](changelog.html) | [NEXT](output.html)'
-include-after: '[CONTENTS](index.html) | [PREV](changelog.html) | [NEXT](output.html)'
+include-before: '[CONTENTS](index.html) | [PREV](index.html) | [NEXT](output.html)'
+include-after: '[CONTENTS](index.html) | [PREV](index.html) | [NEXT](output.html)'
 
 title: 'Java Object Serialization Specification: 1 - System Architecture'
 ---
--- a/jdk/src/java.base/unix/native/libjava/UnixFileSystem_md.c	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/unix/native/libjava/UnixFileSystem_md.c	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -229,7 +229,13 @@
     WITH_FIELD_PLATFORM_STRING(env, file, ids.path, path) {
         struct stat64 sb;
         if (stat64(path, &sb) == 0) {
-            rv = 1000 * (jlong)sb.st_mtime;
+#ifndef MACOSX
+            rv  = (jlong)sb.st_mtim.tv_sec * 1000;
+            rv += (jlong)sb.st_mtim.tv_nsec / 1000000;
+#else
+            rv  = (jlong)sb.st_mtimespec.tv_sec * 1000;
+            rv += (jlong)sb.st_mtimespec.tv_nsec / 1000000;
+#endif
         }
     } END_PLATFORM_STRING(env, path);
     return rv;
@@ -413,8 +419,13 @@
             struct timeval tv[2];
 
             /* Preserve access time */
-            tv[0].tv_sec = sb.st_atime;
-            tv[0].tv_usec = 0;
+#ifndef MACOSX
+            tv[0].tv_sec = sb.st_atim.tv_sec;
+            tv[0].tv_usec = sb.st_atim.tv_nsec / 1000;
+#else
+            tv[0].tv_sec = sb.st_atimespec.tv_sec;
+            tv[0].tv_usec = sb.st_atimespec.tv_nsec / 1000;
+#endif
 
             /* Change last-modified time */
             tv[1].tv_sec = time / 1000;
--- a/jdk/src/java.base/windows/native/libjava/WinNTFileSystem_md.c	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.base/windows/native/libjava/WinNTFileSystem_md.c	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -472,7 +472,7 @@
                                                  jobject file)
 {
     jlong rv = 0;
-    LARGE_INTEGER modTime;
+    ULARGE_INTEGER modTime;
     FILETIME t;
     HANDLE h;
     WCHAR *pathbuf = fileToNTPath(env, file, ids.path);
@@ -784,7 +784,7 @@
                     FILE_FLAG_BACKUP_SEMANTICS,
                     0);
     if (h != INVALID_HANDLE_VALUE) {
-        LARGE_INTEGER modTime;
+        ULARGE_INTEGER modTime;
         FILETIME t;
         modTime.QuadPart = (time + 11644473600000L) * 10000L;
         t.dwLowDateTime = (DWORD)modTime.LowPart;
--- a/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -1887,7 +1887,7 @@
      * The registered {@linkplain #addConfigurationListener configuration
      * listeners} will be invoked after the configuration is successfully updated.
      * <br><br>
-     * <table summary="Updating configuration properties">
+     * <table><caption style="display:none">Updating configuration properties</caption>
      * <tr>
      * <th>Property</th>
      * <th>Resulting Behavior</th>
--- a/jdk/src/java.logging/share/classes/java/util/logging/SimpleFormatter.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.logging/share/classes/java/util/logging/SimpleFormatter.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -36,7 +36,7 @@
  * format.  The summary will typically be 1 or 2 lines.
  *
  * <p>
- * <a name="formatting">
+ * <a id="formatting">
  * <b>Configuration:</b></a>
  * The {@code SimpleFormatter} is initialized with the
  * <a href="../Formatter.html#syntax">format string</a>
--- a/jdk/src/java.logging/share/classes/java/util/logging/package.html	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.logging/share/classes/java/util/logging/package.html	Thu May 25 22:33:25 2017 +0000
@@ -115,8 +115,7 @@
 <P>
 For an overview of control flow, 
 please refer to the 
-<a href="../../../../technotes/guides/logging/overview.html">
-Java Logging Overview</a>.
+{@extLink logging_overview Java Logging Overview}
 </P>
 
 <!-- Put @see and @since tags down here. -->
--- a/jdk/src/java.management/share/classes/java/lang/management/ManagementPermission.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.management/share/classes/java/lang/management/ManagementPermission.java	Thu May 25 22:33:25 2017 +0000
@@ -34,7 +34,7 @@
  * provides a summary description of what the permission allows,
  * and discusses the risks of granting code the permission.
  *
- * <table border="1" cellpadding=5>
+ * <table class="striped">
  * <caption style="display:none">Table shows permission target name, what the permission allows, and associated risks</caption>
  * <tr>
  * <th>Permission Target Name</th>
--- a/jdk/src/java.management/share/classes/java/lang/management/ThreadInfo.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.management/share/classes/java/lang/management/ThreadInfo.java	Thu May 25 22:33:25 2017 +0000
@@ -695,7 +695,7 @@
      * The given {@code CompositeData} must contain the following attributes
      * unless otherwise specified below:
      * <blockquote>
-     * <table border="1">
+     * <table class="plain">
      * <caption style="display:none">The attributes and their types the given CompositeData contains</caption>
      * <tr>
      *   <th style="text-align:left">Attribute Name</th>
@@ -766,7 +766,7 @@
      *       Each element is a {@code CompositeData} representing
      *       StackTraceElement containing the following attributes:
      *       <blockquote>
-     *       <table cellspacing=1 cellpadding=0>
+     *       <table class="borderless">
      *       <caption style="display:none">The attributes and their types the given CompositeData contains</caption>
      *       <tr>
      *         <th style="text-align:left">Attribute Name</th>
--- a/jdk/src/java.management/share/classes/java/lang/management/package.html	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.management/share/classes/java/lang/management/package.html	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 <!--
- Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ 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
@@ -35,7 +35,7 @@
 <h3><a id="MXBean">Platform MXBean</a></h3>
 <p>
 A platform MXBean is a <i>managed bean</i> that
-conforms to the <a href="../../../javax/management/package-summary.html">JMX</a>
+conforms to the {@linkplain javax.management JMX}
 Instrumentation Specification and only uses a set of basic data types.
 Each platform MXBean is a {@link java.lang.management.PlatformManagedObject}
 with a unique
@@ -69,7 +69,7 @@
 this allows interoperation across versions.
 A data type used by the MXBean interfaces are mapped to an
 open type when being accessed via MBeanServer interface.
-See the <a href="../../../javax/management/MXBean.html#MXBean-spec">
+See the <a href="{@docRoot}/javax/management/MXBean.html#MXBean-spec">
 MXBean</a> specification for details.
 
 <h3><a id="examples">Ways to Access MXBeans</a></h3>
@@ -234,8 +234,7 @@
 
 <p> The java.lang.management API is thread-safe.
 
-@see <a href="../../../javax/management/package-summary.html">
-     JMX Specification.</a>
+@see {@linkplain javax.management JMX Specification}
 
 @author  Mandy Chung
 @since   1.5
--- a/jdk/src/java.management/share/classes/javax/management/Descriptor.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.management/share/classes/javax/management/Descriptor.java	Thu May 25 22:33:25 2017 +0000
@@ -96,7 +96,7 @@
  * of the mapped Java type, called <em>opendata</em>(J) in the <a
  * href="MXBean.html#mapping-rules">MXBean type mapping rules</a>.</p>
  *
- * <table border="1" cellpadding="5">
+ * <table class="striped">
  * <caption style="display:none">Descriptor Fields</caption>
  *
  * <tr><th>Name</th><th>Type</th><th>Used in</th><th>Meaning</th></tr>
@@ -331,7 +331,7 @@
  * interest outside Model MBeans, for example.  But only Model MBeans have
  * a predefined behavior for these fields.</p>
  *
- * <table border="1" cellpadding="5">
+ * <table class="striped">
  * <caption style="display:none">ModelMBean Fields</caption>
  *
  * <tr><th>Name</th><th>Type</th><th>Used in</th><th>Meaning</th></tr>
--- a/jdk/src/java.management/share/classes/javax/management/MXBean.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.management/share/classes/javax/management/MXBean.java	Thu May 25 22:33:25 2017 +0000
@@ -93,7 +93,7 @@
       Standard MBean concept.  Here is how a managed object might be
       represented as a Standard MBean, and as an MXBean:</p>
 
-    <table border="1" cellpadding="5">
+    <table class="plain">
     <caption style="display:none">Standard Bean vs. MXBean</caption>
       <tr>
         <th>Standard MBean</th><th>MXBean</th>
@@ -134,7 +134,7 @@
 
     <p>So, we might define <code>MemoryUsage</code> like this:</p>
 
-    <table border="1" cellpadding="5">
+    <table class="plain">
     <caption style="display:none">Standard Bean vs. MXBean</caption>
       <tr>
         <th>Standard MBean</th><th>MXBean</th>
@@ -197,7 +197,7 @@
     <p>This becomes clearer if we compare what the clients of the two
       models might look like:</p>
 
-    <table border="1" cellpadding="5">
+    <table class="plain">
     <caption style="display:none">Standard Bean vs. MXBean</caption>
       <tr>
         <th>Standard MBean</th><th>MXBean</th>
@@ -235,7 +235,7 @@
       managed objects when you know the model beforehand, regardless
       of whether you are using Standard MBeans or MXBeans:</p>
 
-    <table border="1" cellpadding="5">
+    <table class="plain">
     <caption style="display:none">Standard Bean vs. MXBean</caption>
       <tr>
         <th>Standard MBean</th><th>MXBean</th>
@@ -269,7 +269,7 @@
     <p>Implementing the MemoryPool object works similarly for both
       Standard MBeans and MXBeans.</p>
 
-    <table border="1" cellpadding="5">
+    <table class="plain">
     <caption style="display:none">Standard Bean vs. MXBean</caption>
       <tr>
         <th>Standard MBean</th><th>MXBean</th>
@@ -297,7 +297,7 @@
     <p>Registering the MBean in the MBean Server works in the same way
       in both cases:</p>
 
-    <table border="1" cellpadding="5">
+    <table class="plain">
     <caption style="display:none">Standard Bean vs. MXBean</caption>
       <tr>
         <th>Standard MBean</th><th>MXBean</th>
@@ -484,7 +484,7 @@
 
     <p>The following table summarizes the type mapping rules.</p>
 
-    <table border="1" cellpadding="5">
+    <table class="striped">
     <caption style="display:none">Type Mapping Rules</caption>
       <tr>
         <th>Java type <em>J</em></th>
--- a/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanAttributeInfo.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanAttributeInfo.java	Thu May 25 22:33:25 2017 +0000
@@ -57,7 +57,7 @@
  * Note that when the Type in this table is Number, a String that is the decimal
  * representation of a Long can also be used.</P>
  *
- * <table border="1" cellpadding="5">
+ * <table class="striped">
  * <caption style="display:none">ModelMBeanAttributeInfo Fields</caption>
  * <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
  * <tr><td>name</td><td>String</td>
--- a/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java	Thu May 25 22:33:25 2017 +0000
@@ -58,7 +58,7 @@
  * Note that when the Type in this table is Number, a String that is the decimal
  * representation of a Long can also be used.</P>
  *
- * <table border="1" cellpadding="5">
+ * <table class="striped">
  * <caption style="display:none">ModelMBeanConstructorInfo Fields</caption>
  * <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
  * <tr><td>name</td><td>String</td>
--- a/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanInfo.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanInfo.java	Thu May 25 22:33:25 2017 +0000
@@ -165,7 +165,7 @@
      * following.  Note that when the Type in this table is Number, a String
      * that is the decimal representation of a Long can also be used.</P>
      *
-     * <table border="1" cellpadding="5">
+     * <table class="striped">
      * <caption style="display:none">ModelMBean Fields</caption>
      * <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
      * <tr><td>name</td><td>String</td>
--- a/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java	Thu May 25 22:33:25 2017 +0000
@@ -56,7 +56,7 @@
  * Note that when the Type in this table is Number, a String that is the decimal
  * representation of a Long can also be used.</P>
  *
- * <table border="1" cellpadding="5">
+ * <table class="striped">
  * <caption style="display:none">ModelMBeanNotificationInfo Fields</caption>
  * <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
  * <tr><td>name</td><td>String</td>
--- a/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java	Thu May 25 22:33:25 2017 +0000
@@ -59,7 +59,7 @@
  * Note that when the Type in this table is Number, a String that is the decimal
  * representation of a Long can also be used.</P>
  *
- * <table border="1" cellpadding="5">
+ * <table class="striped">
  * <caption style="display:none">ModelMBeanOperationInfo Fields</caption>
  * <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
  * <tr><td>name</td><td>String</td>
--- a/jdk/src/java.naming/share/classes/javax/naming/CompositeName.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.naming/share/classes/javax/naming/CompositeName.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -78,7 +78,8 @@
  *the string form of a composite name and its corresponding structural form
  *({@code CompositeName}).
  *
-<table border="1" cellpadding=3 summary="examples showing string form of composite name and its corresponding structural form (CompositeName)">
+<table class="striped"><caption style="display:none">examples showing string
+ form of composite name and its corresponding structural form (CompositeName)</caption>
 
 <tr>
 <th>String Name</th>
@@ -144,7 +145,8 @@
  * string forms of two composite names simply involves concatenating
  * their string forms together.
 
-<table border="1" cellpadding=3 summary="composition examples showing string names and composite names">
+<table class="striped"><caption style="display:none">composition examples
+ showing string names and composite names</caption>
 
 <tr>
 <th>String Names</th>
--- a/jdk/src/java.naming/share/classes/javax/naming/Context.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.naming/share/classes/javax/naming/Context.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -137,7 +137,7 @@
  * known to protect it.
  *
  *<p>
- *<a name=RESOURCEFILES></a>
+ *<a id=RESOURCEFILES></a>
  *<h1>Resource Files</h1>
  *<p>
  * To simplify the task of setting up the environment
@@ -184,7 +184,7 @@
  * {@code jndiprovider.properties}.
  *
  * <p>
- * <a name=LISTPROPS></a>
+ * <a id=LISTPROPS></a>
  * Certain methods in the JNDI class library make use of the standard
  * JNDI properties that specify lists of JNDI factories:
  * <ul>
--- a/jdk/src/java.naming/share/classes/javax/naming/InitialContext.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.naming/share/classes/javax/naming/InitialContext.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -36,7 +36,7 @@
  * The initial context implements the Context interface and
  * provides the starting point for resolution of names.
  *<p>
- * <a name=ENVIRONMENT></a>
+ * <a id=ENVIRONMENT></a>
  * When the initial context is constructed, its environment
  * is initialized with properties defined in the environment parameter
  * passed to the constructor, and in any
--- a/jdk/src/java.naming/share/classes/javax/naming/directory/package.html	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.naming/share/classes/javax/naming/directory/package.html	Thu May 25 22:33:25 2017 +0000
@@ -45,7 +45,7 @@
 associated with objects stored in a directory, and to search for
 objects using specified attributes.
 
-<h4>The Directory Context</h4>
+<h3>The Directory Context</h3>
 
 The <code>DirContext</code>
 interface represents a <em>directory context</em>.
@@ -82,7 +82,7 @@
 <h2>Package Specification</h2>
 
 The JNDI API Specification and related documents can be found in the
-<a href="../../../../technotes/guides/jndi/index.html">JNDI documentation</a>.
+{@extLink jndi_overview JNDI documentation}.
 
 @since 1.3
 
--- a/jdk/src/java.naming/share/classes/javax/naming/event/package.html	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.naming/share/classes/javax/naming/event/package.html	Thu May 25 22:33:25 2017 +0000
@@ -40,7 +40,7 @@
 implementation.  Thus a variety of services--new, emerging, and
 already deployed ones--can be accessed in a common way.
 
-<h4>Naming Events</h4>
+<h3>Naming Events</h3>
 <p>
 This package defines a <code>NamingEvent</code> class to represent an event
 that is generated by a naming/directory service.
@@ -78,7 +78,7 @@
 </pre>
 </blockquote>
 
-<a name=THREADING></a>
+<a id=THREADING></a>
 <h4>Threading Issues</h4>
 
 When an event is dispatched to a listener, the listener method (such
@@ -117,7 +117,7 @@
 
 
 The JNDI API Specification and related documents can be found in the
-<a href="../../../../technotes/guides/jndi/index.html">JNDI documentation</a>.
+{@extLink jndi_overview JNDI documentation}.
 
 @since 1.3
 
--- a/jdk/src/java.naming/share/classes/javax/naming/ldap/package.html	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.naming/share/classes/javax/naming/ldap/package.html	Thu May 25 22:33:25 2017 +0000
@@ -48,7 +48,7 @@
 methods on a context for performing extended operations and handling
 controls.
 
-<h4>Extended Operations</h4>
+<h3>Extended Operations</h3>
 <p>
 This package defines the interface <code>ExtendedRequest</code>
 to represent the argument to an extended operation,
@@ -125,7 +125,7 @@
 }
 </pre></blockquote>
 
-<h4>Controls</h4>
+<h3>Controls</h3>
 
 This package defines the interface <code>Control</code> to represent an LDAPv3
 control. It can be a control that is sent to an LDAP server
@@ -203,7 +203,7 @@
 Control[] respCtls = ectx.getResponseControls();
 if (respCtls != null) {
     // Find the one we want
-    for (int i = 0; i < respCtls; i++) {
+    for (int i = 0; i &lt; respCtls; i++) {
         if(respCtls[i] instanceof ChangeIDControl) {
 	    ChangeIDControl cctl = (ChangeIDControl)respCtls[i];
 	    System.out.println(cctl.getChangeID());
@@ -258,7 +258,7 @@
 <h2>Package Specification</h2>
 
 The JNDI API Specification and related documents can be found in the
-<a href="../../../../technotes/guides/jndi/index.html">JNDI documentation</a>.
+{@extLink jndi_overview JNDI documentation}.
 
 @since 1.3
 
--- a/jdk/src/java.naming/share/classes/javax/naming/package.html	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.naming/share/classes/javax/naming/package.html	Thu May 25 22:33:25 2017 +0000
@@ -40,7 +40,7 @@
 already deployed ones--can be accessed in a common way.
 
 
-<h4>Context</h4>
+<h3>Context</h3>
 <p>
 This package defines the notion of a <em>context</em>, represented
 by the <code>Context</code> interface.
@@ -63,7 +63,7 @@
 </pre>
 </blockquote>
 
-<h4>Names</h4>
+<h3>Names</h3>
 <p>
 Every naming method in the <code>Context</code>
 interface has two
@@ -82,7 +82,7 @@
 for simple applications, such as those that simply read in a name
 and look up the corresponding object.
 
-<h4>Bindings</h4>
+<h3>Bindings</h3>
 
 The <code>Binding</code> class represents a name-to-object binding.
 It is a tuple containing the name of the bound object,
@@ -95,7 +95,7 @@
 information about the object's class and do not want to
 pay the extra cost of getting the object.
 
-<h4>References</h4>
+<h3>References</h3>
 Objects are stored in naming and directory services in different ways.
 If an object store supports storing Java objects, 
 it might support storing an object in its serialized form.
@@ -112,7 +112,7 @@
 is stored in the directory are Java objects. 
 
 
-<h4>The Initial Context</h4>
+<h3>The Initial Context</h3>
 
 In JNDI, all naming and directory operations are performed relative
 to a context. There are no absolute roots.
@@ -122,7 +122,7 @@
 Once you have an initial context, you can use it to
 look up other contexts and objects.
 
-<h4>Exceptions</h4>
+<h3>Exceptions</h3>
 
 JNDI defines a class hierarchy for exceptions that can be thrown in
 the course of performing naming and directory operations.  The root of
@@ -135,7 +135,7 @@
 <h2>Package Specification</h2>
 
 The JNDI API Specification and related documents can be found in the
-<a href="../../../technotes/guides/jndi/index.html">JNDI documentation</a>.
+{@extLink jndi_overview JNDI documentation}.
 
 @since 1.3
 
--- a/jdk/src/java.naming/share/classes/javax/naming/spi/ObjectFactory.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.naming/share/classes/javax/naming/spi/ObjectFactory.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -136,7 +136,7 @@
  *
  * <p>
  * <b>Name and Context Parameters.</b> &nbsp;&nbsp;&nbsp;
- * <a name=NAMECTX></a>
+ * <a id=NAMECTX></a>
  *
  * The {@code name} and {@code nameCtx} parameters may
  * optionally be used to specify the name of the object being created.
--- a/jdk/src/java.naming/share/classes/javax/naming/spi/package.html	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.naming/share/classes/javax/naming/spi/package.html	Thu May 25 22:33:25 2017 +0000
@@ -47,7 +47,7 @@
 directory services.
 
 
-<h4>Plug-in Architecture</h4>
+<h3>Plug-in Architecture</h3>
 
 The service provider package allows different implementations to be plugged in
 dynamically.
@@ -56,7 +56,7 @@
 and implementations for contexts that can be reached 
 from the initial context.
 
-<h4>Java Object Support</h4>
+<h3>Java Object Support</h3>
 
 The service provider package provides support
 for implementors of the
@@ -68,7 +68,7 @@
 back a printer object on which to operate.
 
 
-<h4>Multiple Naming Systems (Federation)</h4>
+<h3>Multiple Naming Systems (Federation)</h3>
 
 JNDI operations allow applications to supply names that span multiple
 naming systems.  So in the process of completing
@@ -82,7 +82,7 @@
 <h2>Package Specification</h2>
 
 The JNDI SPI Specification and related documents can be found in the
-<a href="../../../../technotes/guides/jndi/index.html">JNDI documentation</a>.
+{@extLink jndi_overview JNDI documentation}.
 
 @since 1.3
 
--- a/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/package.html	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/package.html	Thu May 25 22:33:25 2017 +0000
@@ -1,11 +1,11 @@
-<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
-<html>
+<!doctype html>
+<html lang="en">
 <head>
 
   <meta http-equiv="Content-Type"
  content="text/html; charset=iso-8859-1">
 <!--
-Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+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
@@ -31,7 +31,7 @@
 -->
   <title>javax.sql.rowset Package</title>
 </head>
-  <body bgcolor="#ffffff">
+  <body>
 
 <!-- Description clause -->
 Standard interfaces and base classes for JDBC <code>RowSet</code>
@@ -48,7 +48,7 @@
 <li><a href="#reldocs">5.0 Related Documentation</a>
 </ul>
 
-<h3><a name="pkgspec">1.0 Package Specification</a></h3>
+<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
@@ -63,7 +63,7 @@
 should pay particular attention to the assertions detailed in specification
 interfaces. 
 
-<h3><a name="stdrowset">2.0 Standard RowSet Definitions</a></h3>
+<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
@@ -136,7 +136,7 @@
 <code>RowSet</code> instances without the need to touch the originating data source.
 </ul>
 
-<h3><a name="impl">3.0 Implementer's Guide</a></h3>
+<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
@@ -173,47 +173,40 @@
 The following table illustrates the features that the <code>BaseRowSet</code>
 abstract class provides.
   <blockquote>
-    <table cellpadding="2" cellspacing="2" border="1" width="75%">
+    <table class="striped" style="vertical-align:top; width:75%">
+	<caption>Features in <code>BaseRowSet</code></caption>
+          <thead>
+            <tr>
+              <th>Feature</th>
+              <th>Details</th>
+            </tr>
+          </thead>
           <tbody>
             <tr>
-              <td valign="top"><b>Feature</b><br>
-              </td>
-              <td valign="top"><b>Details</b><br>
-              </td>
-            </tr>
-            <tr>
-              <td valign="top">Properties<br>
-              </td>
-              <td valign="top">Provides standard JavaBeans property manipulation
+              <td>Properties</td>
+              <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.<br>
-              </td>
+the standard  <code>RowSet</code> properties.</td>
             </tr>
             <tr>
-              <td valign="top">Event notification<br>
-              </td>
-              <td valign="top">Provides standard JavaBeans event notifications
+              <td>Event notification</td>
+              <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.<br>
-              </td>
+by  compliant implementations.</td>
             </tr>
             <tr>
-              <td valign="top">Setters for a RowSet object's command<br>
-              </td>
-              <td valign="top">Provides a complete set of setter methods
-                 for setting RowSet command parameters.<br>
-              </td>
+              <td>Setters for a RowSet object's command</td>
+              <td>Provides a complete set of setter methods
+                 for setting RowSet command parameters.</td>
             </tr>
             <tr>
-              <td valign="top">Streams<br>
-              </td>
-              <td valign="top">Provides fields for storing of stream instances
-  in addition to providing a set of constants for stream type designation.<br>
-              </td>
+              <td>Streams</td>
+              <td>Provides fields for storing of stream instances
+  in addition to providing a set of constants for stream type designation.</td>
             </tr>
       </tbody>
     </table>
@@ -289,13 +282,13 @@
 </li>
 </ul>
 
-<h3><a name="relspec">4.0 Related Specifications</a></h3>
+<h3><a id="relspec">4.0 Related Specifications</a></h3>
 <ul>
-<li><a href="https://jcp.org/en/jsr/detail?id=221">JDBC 4.2 Specification</a>
+<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 name="reldocs">5.0 Related Documentation</a></h3>
+<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>
--- a/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package.html	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package.html	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
-<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
-<html>
+<!doctype html>
+<html lang="en">
 <head>
 
   <meta http-equiv="Content-Type"
@@ -8,7 +8,7 @@
   <meta name="GENERATOR"
  content="Mozilla/4.79 [en] (Windows NT 5.0; U) [Netscape]">
 <!--
-Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+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
@@ -34,7 +34,7 @@
   <title>javax.sql.rowset.spi</title>
 
 </head>
-  <body bgcolor="#ffffff">
+  <body>
 
 The standard classes and interfaces that a third party vendor has to
 use in its implementation of a synchronization provider. These classes and
@@ -57,7 +57,7 @@
 <li><a href="#reldocs">6.0 Related Documentation</a>
 </ul>
 
-<h3><a name="pkgspec">1.0 Package Specification</a></h3>
+<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:
@@ -202,7 +202,7 @@
 registering the fully qualified class name with Oracle Corporation at
 <code>jdbc@sun.com</code>. This process is discussed in further detail below.
 
-<h3><a name="arch">2.0 Service Provider Interface Architecture</a></h3>
+<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
@@ -267,7 +267,7 @@
 These policies are explored in more detail in the <a href="SyncFactory.html">
 <code>SyncFactory</code></a> class.
 
-<h3><a name="impl">3.0 SyncProvider Implementer's Guide</a></h3>
+<h3><a id="impl">3.0 SyncProvider Implementer's Guide</a></h3>
 
 <b>3.1 Requirements</b>
 <p>
@@ -442,7 +442,7 @@
 </pre>
 
 
-<h3><a name="resolving">4.0 Resolving Synchronization Conflicts</a></h3>
+<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>
@@ -487,13 +487,13 @@
 <P>
 The comment for the <code>SyncResolver</code> interface has more detail.
 
-<h3><a name="relspec">5.0 Related Specifications</a></h3>
+<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}/../technotes/guides/logging/index.html">Java Logging
 APIs</a>
 </ul>
-<h3><a name="reldocs">6.0 Related Documentation</a></h3>
+<h3><a id="reldocs">6.0 Related Documentation</a></h3>
 <ul>
 <li><a href="{@docRoot}/../technotes/tools/index.html#basic">System
 properties</a>
--- a/jdk/src/java.sql/share/classes/java/sql/SQLPermission.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.sql/share/classes/java/sql/SQLPermission.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -58,13 +58,17 @@
  * and a discussion of the risks of granting code the permission.
  *
  *
- * <table border=1 cellpadding=5 summary="permission target name, what the permission allows, and associated risks">
+ * <table class="striped">
+ * <caption style="display:none">permission target name, what the permission allows, and associated risks</caption>
+ * <thead>
  * <tr>
  * <th>Permission Target Name</th>
  * <th>What the Permission Allows</th>
  * <th>Risks of Allowing this Permission</th>
  * </tr>
+ * </thead>
  *
+ * <tbody>
  * <tr>
  *   <td>setLog</td>
  *   <td>Setting of the logging stream</td>
@@ -103,6 +107,7 @@
  *   <td>Permits an application to remove a JDBC driver from the list of
  * registered Drivers and release its resources.</td>
  * </tr>
+ * </tbody>
  * </table>
  *
  * @since 1.3
--- a/jdk/src/java.sql/share/classes/java/sql/Statement.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/java.sql/share/classes/java/sql/Statement.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -686,7 +686,7 @@
      *         more results
      * @exception SQLException if a database access error occurs,
      * this method is called on a closed <code>Statement</code> or the argument
-         *         supplied is not one of the following:
+     *         supplied is not one of the following:
      *        <code>Statement.CLOSE_CURRENT_RESULT</code>,
      *        <code>Statement.KEEP_CURRENT_RESULT</code> or
      *        <code>Statement.CLOSE_ALL_RESULTS</code>
@@ -1379,16 +1379,20 @@
      * single quote within the string will be replaced by two single quotes.
      *
      * <blockquote>
-     * <table border = 1 cellspacing=0 cellpadding=5 >
+     * <table class="striped" >
      * <caption>Examples of the conversion:</caption>
+     * <thead>
      * <tr><th>Value</th><th>Result</th></tr>
-     * <tr> <td align='center'>Hello</td> <td align='center'>'Hello'</td> </tr>
-     * <tr> <td align='center'>G'Day</td> <td align='center'>'G''Day'</td> </tr>
-     * <tr> <td align='center'>'G''Day'</td>
-     * <td align='center'>'''G''''Day'''</td> </tr>
-     * <tr> <td align='center'>I'''M</td> <td align='center'>'I''''''M'</td>
+     * </thead>
+     * <tbody style="text-align:center">
+     * <tr> <td>Hello</td> <td>'Hello'</td> </tr>
+     * <tr> <td>G'Day</td> <td>'G''Day'</td> </tr>
+     * <tr> <td>'G''Day'</td>
+     * <td>'''G''''Day'''</td> </tr>
+     * <tr> <td>I'''M</td> <td>'I''''''M'</td>
      * </tr>
      *
+     * </tbody>
      * </table>
      * </blockquote>
      * @implNote
@@ -1446,52 +1450,56 @@
      * <li>The length of {@code identifier} is less than 1 or greater than 128 characters
      * </ul>
      * <blockquote>
-     * <table border = 1 cellspacing=0 cellpadding=5 >
+     * <table class="striped" >
      * <caption>Examples of the conversion:</caption>
+     * <thead>
      * <tr>
      * <th>identifier</th>
      * <th>alwaysQuote</th>
      * <th>Result</th></tr>
+     * </thead>
+     * <tbody>
      * <tr>
-     * <td align='center'>Hello</td>
-     * <td align='center'>false</td>
-     * <td align='center'>Hello</td>
+     * <td>Hello</td>
+     * <td>false</td>
+     * <td>Hello</td>
      * </tr>
      * <tr>
-     * <td align='center'>Hello</td>
-     * <td align='center'>true</td>
-     * <td align='center'>"Hello"</td>
+     * <td>Hello</td>
+     * <td>true</td>
+     * <td>"Hello"</td>
      * </tr>
      * <tr>
-     * <td align='center'>G'Day</td>
-     * <td align='center'>false</td>
-     * <td align='center'>"G'Day"</td>
+     * <td>G'Day</td>
+     * <td>false</td>
+     * <td>"G'Day"</td>
      * </tr>
      * <tr>
-     * <td align='center'>"Bruce Wayne"</td>
-     * <td align='center'>false</td>
-     * <td align='center'>"Bruce Wayne"</td>
+     * <td>"Bruce Wayne"</td>
+     * <td>false</td>
+     * <td>"Bruce Wayne"</td>
      * </tr>
      * <tr>
-     * <td align='center'>"Bruce Wayne"</td>
-     * <td align='center'>true</td>
-     * <td align='center'>"Bruce Wayne"</td>
+     * <td>"Bruce Wayne"</td>
+     * <td>true</td>
+     * <td>"Bruce Wayne"</td>
      * </tr>
      * <tr>
-     * <td align='center'>GoodDay$</td>
-     * <td align='center'>false</td>
-     * <td align='center'>"GoodDay$"</td>
+     * <td>GoodDay$</td>
+     * <td>false</td>
+     * <td>"GoodDay$"</td>
      * </tr>
      * <tr>
-     * <td align='center'>Hello"World</td>
-     * <td align='center'>false</td>
-     * <td align='center'>SQLException</td>
+     * <td>Hello"World</td>
+     * <td>false</td>
+     * <td>SQLException</td>
      * </tr>
      * <tr>
-     * <td align='center'>"Hello"World"</td>
-     * <td align='center'>false</td>
-     * <td align='center'>SQLException</td>
+     * <td>"Hello"World"</td>
+     * <td>false</td>
+     * <td>SQLException</td>
      * </tr>
+     * </tbody>
      * </table>
      * </blockquote>
      * @implNote
@@ -1542,36 +1550,40 @@
      * </ul>
      *
      * <blockquote>
-     * <table border = 1 cellspacing=0 cellpadding=5 >
+     * <table class="striped" >
      * <caption>Examples of the conversion:</caption>
+     * <thead>
      * <tr>
      * <th>identifier</th>
      * <th>Simple Identifier</th>
+     * </thead>
      *
+     * <tbody>
      * <tr>
-     * <td align='center'>Hello</td>
-     * <td align='center'>true</td>
+     * <td>Hello</td>
+     * <td>true</td>
      * </tr>
      * <tr>
-     * <td align='center'>G'Day</td>
-     * <td align='center'>false</td>
+     * <td>G'Day</td>
+     * <td>false</td>
      * </tr>
      * <tr>
-     * <td align='center'>"Bruce Wayne"</td>
-     * <td align='center'>false</td>
+     * <td>"Bruce Wayne"</td>
+     * <td>false</td>
      * </tr>
      * <tr>
-     * <td align='center'>GoodDay$</td>
-     * <td align='center'>false</td>
+     * <td>GoodDay$</td>
+     * <td>false</td>
      * </tr>
      * <tr>
-     * <td align='center'>Hello"World</td>
-     * <td align='center'>false</td>
+     * <td>Hello"World</td>
+     * <td>false</td>
      * </tr>
      * <tr>
-     * <td align='center'>"Hello"World"</td>
-     * <td align='center'>false</td>
+     * <td>"Hello"World"</td>
+     * <td>false</td>
      * </tr>
+     * </tbody>
      * </table>
      * </blockquote>
      * @implNote JDBC driver implementations may need to provide their own
@@ -1597,19 +1609,23 @@
     * by two single quotes.
     *
     * <blockquote>
-    * <table border = 1 cellspacing=0 cellpadding=5 >
+    * <table class="striped">
     * <caption>Examples of the conversion:</caption>
+    * <thead>
     * <tr>
     * <th>Value</th>
     * <th>Result</th>
     * </tr>
-    * <tr> <td align='center'>Hello</td> <td align='center'>N'Hello'</td> </tr>
-    * <tr> <td align='center'>G'Day</td> <td align='center'>N'G''Day'</td> </tr>
-    * <tr> <td align='center'>'G''Day'</td>
-    * <td align='center'>N'''G''''Day'''</td> </tr>
-    * <tr> <td align='center'>I'''M</td> <td align='center'>N'I''''''M'</td>
-    * <tr> <td align='center'>N'Hello'</td> <td align='center'>N'N''Hello'''</td> </tr>
+    * </thead>
+    * <tbody>
+    * <tr> <td>Hello</td> <td>N'Hello'</td> </tr>
+    * <tr> <td>G'Day</td> <td>N'G''Day'</td> </tr>
+    * <tr> <td>'G''Day'</td>
+    * <td>N'''G''''Day'''</td> </tr>
+    * <tr> <td>I'''M</td> <td>N'I''''''M'</td>
+    * <tr> <td>N'Hello'</td> <td>N'N''Hello'''</td> </tr>
     *
+    * </tbody>
     * </table>
     * </blockquote>
     * @implNote
--- a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachPermission.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachPermission.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -40,8 +40,8 @@
  * permission allows, and discusses the risks of granting code the
  * permission.
  *
- * <table border=1 cellpadding=5 summary="Table shows permission
- * target name, what the permission allows, and associated risks">
+ * <table class="striped"><caption style="display:none">Table shows permission
+ * target name, what the permission allows, and associated risks</caption>
  * <tr>
  * <th>Permission Target Name</th>
  * <th>What the Permission Allows</th>
--- a/jdk/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/KeyStore.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/KeyStore.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -513,7 +513,7 @@
         if (entry != null) {
             // Get end-entity certificate and remove from system cert store
             X509Certificate[] certChain = entry.getCertificateChain();
-            if (certChain != null) {
+            if (certChain != null && certChain.length > 0) {
 
                 try {
 
@@ -629,7 +629,9 @@
 
         for (Map.Entry<String,KeyEntry> mapEntry : entries.entrySet()) {
             KeyEntry entry = mapEntry.getValue();
-            if (entry.certChain != null && entry.certChain[0].equals(cert)) {
+            if (entry.certChain != null &&
+                entry.certChain.length > 0 &&
+                entry.certChain[0].equals(cert)) {
                 return entry.getAlias();
             }
         }
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -51,7 +51,7 @@
  * {@link java.util.concurrent.Executor} object. If none is provided a default
  * implementation is used.
  * <p>
- * <a name="mapping_description"></a>
+ * <a id="mapping_description"></a>
  * <b>Mapping request URIs to HttpContext paths</b><p>
  * When a HTTP request is received,
  * the appropriate HttpContext (and handler) is located by finding the context
@@ -59,7 +59,7 @@
  * Paths are matched literally, which means that the strings are compared
  * case sensitively, and with no conversion to or from any encoded forms.
  * For example. Given a HttpServer with the following HttpContexts configured.
- * <table>
+ * <table><caption style="display:none">description</caption>
  * <tr><td><i>Context</i></td><td><i>Context path</i></td></tr>
  * <tr><td>ctx1</td><td>"/"</td></tr>
  * <tr><td>ctx2</td><td>"/apps/"</td></tr>
@@ -68,7 +68,7 @@
  * <p>
  * the following table shows some request URIs and which, if any context they would
  * match with.
- * <table>
+ * <table><caption style="display:none">description</caption>
  * <tr><td><i>Request URI</i></td><td><i>Matches context</i></td></tr>
  * <tr><td>"http://foo.com/apps/foo/bar"</td><td>ctx3</td></tr>
  * <tr><td>"http://foo.com/apps/Foo/bar"</td><td>no match, wrong case</td></tr>
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsConfigurator.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsConfigurator.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -41,7 +41,7 @@
  * the {@link #configure(HttpsParameters)} method in order to change
  * the default configuration.
  * <p>
- * The following <a name="example">example</a> shows how this may be done:
+ * The following <a id="example">example</a> shows how this may be done:
  *
  * <blockquote><pre>
  * SSLContext sslContext = SSLContext.getInstance (....);
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpRequestImpl.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpRequestImpl.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -123,7 +123,7 @@
         this.method = method;
         this.systemHeaders = new HttpHeadersImpl();
         this.userHeaders = ImmutableHeaders.empty();
-        this.uri = null;
+        this.uri = URI.create("socket://" + authority.getHostString() + ":" + Integer.toString(authority.getPort()) + "/");
         this.requestProcessor = HttpRequest.noBody();
         this.authority = authority;
         this.secure = false;
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainTunnelingConnection.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainTunnelingConnection.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -27,6 +27,7 @@
 
 import jdk.incubator.http.internal.common.ByteBufferReference;
 import jdk.incubator.http.internal.common.MinimalFuture;
+import jdk.incubator.http.HttpResponse.BodyHandler;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
@@ -72,7 +73,8 @@
     public void connect() throws IOException, InterruptedException {
         delegate.connect();
         HttpRequestImpl req = new HttpRequestImpl("CONNECT", client, address);
-        Exchange<?> connectExchange = new Exchange<>(req, null);
+        MultiExchange<Void,Void> mul = new MultiExchange<>(req, client, BodyHandler.<Void>discard(null));
+        Exchange<Void> connectExchange = new Exchange<>(req, mul);
         Response r = connectExchange.responseImpl(delegate);
         if (r.statusCode() != 200) {
             throw new IOException("Tunnel failed");
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/WebSocket.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/WebSocket.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -43,7 +43,7 @@
  * <p> To create a {@code WebSocket} use a {@linkplain HttpClient#newWebSocketBuilder(
  * URI, Listener) builder}. Once a {@code WebSocket} is built, it's ready
  * to send and receive messages. When the {@code WebSocket} is no longer needed
- * it must be closed: a Close message must both be {@linkplain #sendClose()
+ * it must be closed: a Close message must both be {@linkplain #sendClose
  * sent} and {@linkplain Listener#onClose(WebSocket, int, String) received}.
  * The {@code WebSocket} may be also closed {@linkplain #abort() abruptly}.
  *
@@ -94,17 +94,6 @@
     int NORMAL_CLOSURE = 1000;
 
     /**
-     * The WebSocket Close message status code (<code>{@value}</code>), is
-     * designated for use in applications expecting a status code to indicate
-     * that the connection was closed abnormally, e.g., without sending or
-     * receiving a Close message.
-     *
-     * @see Listener#onClose(WebSocket, int, String)
-     * @see #abort()
-     */
-    int CLOSED_ABNORMALLY = 1006;
-
-    /**
      * A builder for creating {@code WebSocket} instances.
      * {@Incubating}
      *
@@ -509,7 +498,7 @@
          *
          * <p> The {@code WebSocket} will close at the earliest of completion of
          * the returned {@code CompletionStage} or sending a Close message. In
-         * particular, if a Close message has been {@link WebSocket#sendClose()
+         * particular, if a Close message has been {@linkplain WebSocket#sendClose
          * sent} before, then this invocation completes the closing handshake
          * and by the time this method is invoked, the {@code WebSocket} will
          * have been closed.
@@ -643,44 +632,6 @@
     CompletableFuture<WebSocket> sendText(CharSequence message, boolean isLast);
 
     /**
-     * Sends a whole Text message with characters from the given {@code
-     * CharSequence}.
-     *
-     * <p> This is a convenience method. For the general case, use {@link
-     * #sendText(CharSequence, boolean)}.
-     *
-     * <p> Returns a {@code CompletableFuture<WebSocket>} which completes
-     * normally when the message has been sent or completes exceptionally if an
-     * error occurs.
-     *
-     * <p> The {@code CharSequence} must not be modified until the returned
-     * {@code CompletableFuture} completes (either normally or exceptionally).
-     *
-     * <p> The returned {@code CompletableFuture} can complete exceptionally
-     * with:
-     * <ul>
-     * <li> {@link IllegalArgumentException} -
-     *          if {@code message} is a malformed UTF-16 sequence
-     * <li> {@link IllegalStateException} -
-     *          if the {@code WebSocket} is closed;
-     *          or if a Close message has been sent;
-     *          or if there is an outstanding send operation;
-     *          or if a previous Binary message was sent with {@code isLast == false}
-     * <li> {@link IOException} -
-     *          if an I/O error occurs during this operation;
-     *          or if the {@code WebSocket} has been closed due to an error;
-     * </ul>
-     *
-     * @param message
-     *         the message
-     *
-     * @return a {@code CompletableFuture} with this {@code WebSocket}
-     */
-    default CompletableFuture<WebSocket> sendText(CharSequence message) {
-        return sendText(message, true);
-    }
-
-    /**
      * Sends a Binary message with bytes from the given {@code ByteBuffer}.
      *
      * <p> Returns a {@code CompletableFuture<WebSocket>} which completes
@@ -831,47 +782,10 @@
      *         the reason
      *
      * @return a {@code CompletableFuture} with this {@code WebSocket}
-     *
-     * @see #sendClose()
      */
     CompletableFuture<WebSocket> sendClose(int statusCode, String reason);
 
     /**
-     * Sends an empty Close message.
-     *
-     * <p> When this method has been invoked, no further messages can be sent.
-     *
-     * <p> For more details on Close message see RFC 6455 section
-     * <a href="https://tools.ietf.org/html/rfc6455#section-5.5.1">5.5.1. Close</a>
-     *
-     * <p> The method returns a {@code CompletableFuture<WebSocket>} which
-     * completes normally when the message has been sent or completes
-     * exceptionally if an error occurs.
-     *
-     * <p> The returned {@code CompletableFuture} can complete exceptionally
-     * with:
-     * <ul>
-     * <li> {@link IOException} -
-     *          if an I/O error occurs during this operation;
-     *          or the {@code WebSocket} has been closed due to an error
-     * </ul>
-     *
-     * <p> If this method has already been invoked or the {@code WebSocket} is
-     * closed, then subsequent invocations of this method have no effect and the
-     * returned {@code CompletableFuture} completes normally.
-     *
-     * <p> If a Close message has been {@linkplain Listener#onClose(WebSocket,
-     * int, String) received} before, then this invocation completes the closing
-     * handshake and by the time the returned {@code CompletableFuture}
-     * completes, the {@code WebSocket} will have been closed.
-     *
-     * @return a {@code CompletableFuture} with this {@code WebSocket}
-     *
-     * @see #sendClose(int, String)
-     */
-    CompletableFuture<WebSocket> sendClose();
-
-    /**
      * Allows {@code n} more messages to be received by the {@link Listener
      * Listener}.
      *
@@ -928,8 +842,7 @@
      * state.
      *
      * <p> As the result {@link Listener#onClose(WebSocket, int, String)
-     * Listener.onClose} will be invoked with the status code {@link
-     * #CLOSED_ABNORMALLY} unless either {@code onClose} or {@link
+     * Listener.onClose} will be invoked unless either {@code onClose} or {@link
      * Listener#onError(WebSocket, Throwable) onError} has been invoked before.
      * In which case no additional invocation will happen.
      *
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/hpack/Decoder.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/hpack/Decoder.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -24,6 +24,8 @@
  */
 package jdk.incubator.http.internal.hpack;
 
+import jdk.internal.vm.annotation.Stable;
+
 import java.io.IOException;
 import java.io.UncheckedIOException;
 import java.net.ProtocolException;
@@ -60,6 +62,7 @@
  */
 public final class Decoder {
 
+    @Stable
     private static final State[] states = new State[256];
 
     static {
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/hpack/HeaderTable.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/hpack/HeaderTable.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -24,6 +24,8 @@
  */
 package jdk.incubator.http.internal.hpack;
 
+import jdk.internal.vm.annotation.Stable;
+
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.Map;
@@ -40,6 +42,7 @@
 //
 final class HeaderTable {
 
+    @Stable
     private static final HeaderField[] staticTable = {
             null, // To make index 1-based, instead of 0-based
             new HeaderField(":authority"),
@@ -110,7 +113,7 @@
     private static final Map<String, LinkedHashMap<String, Integer>> staticIndexes;
 
     static {
-        staticIndexes = new HashMap<>(STATIC_TABLE_LENGTH);
+        staticIndexes = new HashMap<>(STATIC_TABLE_LENGTH); // TODO: Map.of
         for (int i = 1; i <= STATIC_TABLE_LENGTH; i++) {
             HeaderField f = staticTable[i];
             Map<String, Integer> values = staticIndexes
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/BuilderImpl.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/BuilderImpl.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -46,7 +46,7 @@
     private final HttpClient client;
     private final URI uri;
     private final Listener listener;
-    private final List<Pair<String, String>> headers = new LinkedList<>();
+    private final Collection<Pair<String, String>> headers = new LinkedList<>();
     private final Collection<String> subprotocols = new LinkedList<>();
     private Duration timeout;
 
@@ -65,17 +65,18 @@
     }
 
     @Override
-    public Builder subprotocols(String mostPreferred, String... lesserPreferred)
+    public Builder subprotocols(String mostPreferred,
+                                String... lesserPreferred)
     {
         requireNonNull(mostPreferred, "mostPreferred");
         requireNonNull(lesserPreferred, "lesserPreferred");
         List<String> subprotocols = new LinkedList<>();
+        subprotocols.add(mostPreferred);
         for (int i = 0; i < lesserPreferred.length; i++) {
             String p = lesserPreferred[i];
             requireNonNull(p, "lesserPreferred[" + i + "]");
             subprotocols.add(p);
         }
-        subprotocols.add(0, mostPreferred);
         this.subprotocols.clear();
         this.subprotocols.addAll(subprotocols);
         return this;
@@ -98,20 +99,9 @@
 
     Listener getListener() { return listener; }
 
-    List<Pair<String, String>> getHeaders() { return headers; }
+    Collection<Pair<String, String>> getHeaders() { return headers; }
 
     Collection<String> getSubprotocols() { return subprotocols; }
 
     Duration getConnectTimeout() { return timeout; }
-
-    @Override
-    public String toString() {
-        return "WebSocket.Builder{"
-                + ", uri=" + uri
-                + ", listener=" + listener
-                + (!headers.isEmpty() ? ", headers=" + headers : "")
-                + (!subprotocols.isEmpty() ? ", subprotocols=" + subprotocols : "")
-                + ( timeout != null ? ", connectTimeout=" + timeout : "")
-                + '}';
-    }
 }
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/CooperativeHandler.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/CooperativeHandler.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -25,70 +25,184 @@
 
 package jdk.incubator.http.internal.websocket;
 
-import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Consumer;
 
 import static java.util.Objects.requireNonNull;
 
-final class CooperativeHandler {
+/*
+ * A synchronization aid that assists a number of parties in running a task
+ * in a mutually exclusive fashion.
+ *
+ * To run the task, a party invokes `handle`. To permanently prevent the task
+ * from subsequent runs, the party invokes `stop`.
+ *
+ * The parties do not have to operate in different threads.
+ *
+ * The task can be either synchronous or asynchronous.
+ *
+ * If the task is synchronous, it is represented with `Runnable`.
+ * The handler invokes `Runnable.run` to run the task.
+ *
+ * If the task is asynchronous, it is represented with `Consumer<Runnable>`.
+ * The handler invokes `Consumer.accept(end)` to begin the task. The task
+ * invokes `end.run()` when it has ended.
+ *
+ * The next run of the task will not begin until the previous run has finished.
+ *
+ * The task may invoke `handle()` by itself, it's a normal situation.
+ */
+public final class CooperativeHandler {
 
-    private static final long CONTINUE = 0;
-    private static final long OFF      = 1;
-    private static final long ON       = 2;
-    private static final long STOP     = 4;
+    /*
+       Since the task is fixed and known beforehand, no blocking synchronization
+       (locks, queues, etc.) is required. The job can be done solely using
+       nonblocking primitives.
+
+       The machinery below addresses two problems:
+
+         1. Running the task in a sequential order (no concurrent runs):
+
+                begin, end, begin, end...
+
+         2. Avoiding indefinite recursion:
 
-    private final AtomicLong state = new AtomicLong(OFF);
+                begin
+                  end
+                    begin
+                      end
+                        ...
+
+       Problem #1 is solved with a finite state machine with 4 states:
+
+           BEGIN, AGAIN, END, and STOP.
+
+       Problem #2 is solved with a "state modifier" OFFLOAD.
+
+       Parties invoke `handle()` to signal the task must run. A party that has
+       invoked `handle()` either begins the task or exploits the party that is
+       either beginning the task or ending it.
+
+       The party that is trying to end the task either ends it or begins it
+       again.
 
-    private final Runnable task;
+       To avoid indefinite recursion, before re-running the task tryEnd() sets
+       OFFLOAD bit, signalling to its "child" tryEnd() that this ("parent")
+       tryEnd() is available and the "child" must offload the task on to the
+       "parent". Then a race begins. Whichever invocation of tryEnd() manages
+       to unset OFFLOAD bit first does not do the work.
+
+       There is at most 1 thread that is beginning the task and at most 2
+       threads that are trying to end it: "parent" and "child". In case of a
+       synchronous task "parent" and "child" are the same thread.
+     */
 
-    CooperativeHandler(Runnable task) {
-        this.task = requireNonNull(task);
+    private static final int OFFLOAD =  1;
+    private static final int AGAIN   =  2;
+    private static final int BEGIN   =  4;
+    private static final int STOP    =  8;
+    private static final int END     = 16;
+
+    private final AtomicInteger state = new AtomicInteger(END);
+    private final Consumer<Runnable> begin;
+
+    public CooperativeHandler(Runnable task) {
+        this(asyncOf(task));
+    }
+
+    public CooperativeHandler(Consumer<Runnable> begin) {
+        this.begin = requireNonNull(begin);
     }
 
     /*
-     * Causes the task supplied to the constructor to run. The task may be run
-     * by this thread as well as by any other that has invoked this method.
+     * Runs the task (though maybe by a different party).
      *
      * The recursion which is possible here will have the maximum depth of 1:
      *
-     *     task.run()
-     *         this.startOrContinue()
-     *             task.run()
+     *     this.handle()
+     *         begin.accept()
+     *             this.handle()
      */
-    void startOrContinue() {
-        long s;
+    public void handle() {
         while (true) {
-            s = state.get();
-            if (s == OFF && state.compareAndSet(OFF, ON)) {
-                // No one is running the task, we are going to run it
-                break;
-            }
-            if (s == ON && state.compareAndSet(ON, CONTINUE)) {
-                // Some other thread is running the task. We have managed to
-                // update the state, it will be surely noticed by that thread.
+            int s = state.get();
+            if (s == END) {
+                if (state.compareAndSet(END, BEGIN)) {
+                    break;
+                }
+            } else if ((s & BEGIN) != 0) {
+                // Tries to change the state to AGAIN, preserving OFFLOAD bit
+                if (state.compareAndSet(s, AGAIN | (s & OFFLOAD))) {
+                    return;
+                }
+            } else if ((s & AGAIN) != 0 || s == STOP) {
                 return;
-            }
-            if (s == CONTINUE || s == STOP) {
-                return;
+            } else {
+                throw new InternalError(String.valueOf(s));
             }
         }
+        begin.accept(this::tryEnd);
+    }
+
+    private void tryEnd() {
         while (true) {
-            task.run();
-            // State checks are ordered by the probability of expected values
-            // (it might be different in different usage patterns, say, when
-            // invocations to `startOrContinue()` are concurrent)
-            if (state.compareAndSet(ON, OFF)) {
-                break; // The state hasn't changed, all done
+            int s;
+            while (((s = state.get()) & OFFLOAD) != 0) {
+                // Tries to offload ending of the task to the parent
+                if (state.compareAndSet(s, s & ~OFFLOAD)) {
+                    return;
+                }
             }
-            if (state.compareAndSet(CONTINUE, ON)) {
-                continue;
+            while (true) {
+                if (s == BEGIN) {
+                    if (state.compareAndSet(BEGIN, END)) {
+                        return;
+                    }
+                } else if (s == AGAIN) {
+                    if (state.compareAndSet(AGAIN, BEGIN | OFFLOAD)) {
+                        break;
+                    }
+                } else if (s == STOP) {
+                    return;
+                } else {
+                    throw new InternalError(String.valueOf(s));
+                }
+                s = state.get();
             }
-            // Other threads can change the state from CONTINUE to STOP only
-            // So if it's not ON and not CONTINUE, it can only be STOP
-            break;
+            begin.accept(this::tryEnd);
         }
     }
 
-    void stop() {
+    /*
+     * Checks whether or not this handler has been permanently stopped.
+     *
+     * Should be used from inside the task to poll the status of the handler,
+     * pretty much the same way as it is done for threads:
+     *
+     *     if (!Thread.currentThread().isInterrupted()) {
+     *         ...
+     *     }
+     */
+    public boolean isStopped() {
+        return state.get() == STOP;
+    }
+
+    /*
+     * Signals this handler to ignore subsequent invocations to `handle()`.
+     *
+     * If the task has already begun, this invocation will not affect it,
+     * unless the task itself uses `isStopped()` method to check the state
+     * of the handler.
+     */
+    public void stop() {
         state.set(STOP);
     }
+
+    private static Consumer<Runnable> asyncOf(Runnable task) {
+        requireNonNull(task);
+        return ender -> {
+            task.run();
+            ender.run();
+        };
+    }
 }
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/Frame.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/Frame.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -25,6 +25,8 @@
 
 package jdk.incubator.http.internal.websocket;
 
+import jdk.internal.vm.annotation.Stable;
+
 import java.nio.ByteBuffer;
 
 import static jdk.incubator.http.internal.common.Utils.dump;
@@ -58,6 +60,7 @@
         CONTROL_0xE    (0xE),
         CONTROL_0xF    (0xF);
 
+        @Stable
         private static final Opcode[] opcodes;
 
         static {
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/FrameConsumer.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/FrameConsumer.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -38,7 +38,7 @@
 import static java.util.Objects.requireNonNull;
 import static jdk.incubator.http.internal.common.Utils.dump;
 import static jdk.incubator.http.internal.websocket.StatusCodes.NO_STATUS_CODE;
-import static jdk.incubator.http.internal.websocket.StatusCodes.checkIncomingCode;
+import static jdk.incubator.http.internal.websocket.StatusCodes.isLegalToReceiveFromServer;
 
 /*
  * Consumes frame parts and notifies a message consumer, when there is
@@ -212,20 +212,20 @@
         }
         switch (opcode) {
             case CLOSE:
-                int statusCode = NO_STATUS_CODE;
+                char statusCode = NO_STATUS_CODE;
                 String reason = "";
                 if (payloadLen != 0) {
                     int len = binaryData.remaining();
                     assert 2 <= len && len <= 125 : dump(len, payloadLen);
+                    statusCode = binaryData.getChar();
+                    if (!isLegalToReceiveFromServer(statusCode)) {
+                        throw new FailWebSocketException(
+                                "Illegal status code: " + statusCode);
+                    }
                     try {
-                        statusCode = checkIncomingCode(binaryData.getChar());
                         reason = UTF_8.newDecoder().decode(binaryData).toString();
-                    } catch (CheckFailedException e) {
-                        throw new FailWebSocketException("Incorrect status code")
-                                .initCause(e);
                     } catch (CharacterCodingException e) {
-                        throw new FailWebSocketException(
-                                "Close reason is a malformed UTF-8 sequence")
+                        throw new FailWebSocketException("Illegal close reason")
                                 .initCause(e);
                     }
                 }
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/OpeningHandshake.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/OpeningHandshake.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -37,6 +37,8 @@
 import jdk.incubator.http.HttpResponse;
 import jdk.incubator.http.HttpResponse.BodyHandler;
 import jdk.incubator.http.WebSocketHandshakeException;
+import jdk.incubator.http.internal.common.Pair;
+
 import java.nio.charset.StandardCharsets;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
@@ -66,7 +68,6 @@
     private static final String HEADER_KEY        = "Sec-WebSocket-Key";
     private static final String HEADER_PROTOCOL   = "Sec-WebSocket-Protocol";
     private static final String HEADER_VERSION    = "Sec-WebSocket-Version";
-    private static final String VALUE_VERSION     = "13"; // WebSocket's lucky number
 
     private static final Set<String> FORBIDDEN_HEADERS;
 
@@ -106,12 +107,18 @@
         if (connectTimeout != null) {
             requestBuilder.timeout(connectTimeout);
         }
+        for (Pair<String, String> p : b.getHeaders()) {
+            if (FORBIDDEN_HEADERS.contains(p.first)) {
+                throw illegal("Illegal header: " + p.first);
+            }
+            requestBuilder.header(p.first, p.second);
+        }
         this.subprotocols = createRequestSubprotocols(b.getSubprotocols());
         if (!this.subprotocols.isEmpty()) {
             String p = this.subprotocols.stream().collect(Collectors.joining(", "));
             requestBuilder.header(HEADER_PROTOCOL, p);
         }
-        requestBuilder.header(HEADER_VERSION, VALUE_VERSION);
+        requestBuilder.header(HEADER_VERSION, "13"); // WebSocket's lucky number
         this.nonce = createNonce();
         requestBuilder.header(HEADER_KEY, this.nonce);
         // Setting request version to HTTP/1.1 forcibly, since it's not possible
@@ -133,11 +140,7 @@
             if (s.trim().isEmpty() || !isValidName(s)) {
                 throw illegal("Bad subprotocol syntax: " + s);
             }
-            if (FORBIDDEN_HEADERS.contains(s)) {
-                throw illegal("Forbidden header: " + s);
-            }
-            boolean unique = sp.add(s);
-            if (!unique) {
+            if (!sp.add(s)) {
                 throw illegal("Duplicating subprotocol: " + s);
             }
         }
@@ -176,7 +179,7 @@
 
     CompletableFuture<Result> send() {
         return client.sendAsync(this.request, BodyHandler.<Void>discard(null))
-                     .thenCompose(this::resultFrom);
+                .thenCompose(this::resultFrom);
     }
 
     /*
@@ -283,7 +286,6 @@
 
     private static String requireSingle(HttpHeaders responseHeaders,
                                         String headerName)
-            throws CheckFailedException
     {
         List<String> values = responseHeaders.allValues(headerName);
         if (values.isEmpty()) {
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/OutgoingMessage.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/OutgoingMessage.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -60,6 +60,7 @@
  */
 abstract class OutgoingMessage {
 
+    // Share per WebSocket?
     private static final SecureRandom maskingKeys = new SecureRandom();
 
     protected ByteBuffer[] frame;
@@ -71,6 +72,8 @@
      * convenient moment (up to the point where sentTo is invoked).
      */
     protected void contextualize(Context context) {
+        // masking and charset decoding should be performed here rather than in
+        // the constructor (as of today)
         if (context.isCloseSent()) {
             throw new IllegalStateException("Close sent");
         }
@@ -101,7 +104,7 @@
         private final boolean isLast;
 
         Text(CharSequence characters, boolean isLast) {
-            CharsetEncoder encoder = UTF_8.newEncoder();
+            CharsetEncoder encoder = UTF_8.newEncoder(); // Share per WebSocket?
             try {
                 payload = encoder.encode(CharBuffer.wrap(characters));
             } catch (CharacterCodingException e) {
@@ -172,11 +175,11 @@
 
         Close(int statusCode, CharSequence reason) {
             ByteBuffer payload = ByteBuffer.allocate(125)
-                                           .putChar((char) statusCode);
+                    .putChar((char) statusCode);
             CoderResult result = UTF_8.newEncoder()
-                                      .encode(CharBuffer.wrap(reason),
-                                              payload,
-                                              true);
+                    .encode(CharBuffer.wrap(reason),
+                            payload,
+                            true);
             if (result.isOverflow()) {
                 throw new IllegalArgumentException("Long reason");
             } else if (result.isError()) {
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/Receiver.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/Receiver.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -58,8 +58,8 @@
     private final Frame.Reader reader = new Frame.Reader();
     private final RawChannel.RawEvent event = createHandler();
     private final AtomicLong demand = new AtomicLong();
-    private final CooperativeHandler receiveHandler =
-              new CooperativeHandler(this::tryDeliver);
+    private final CooperativeHandler handler =
+              new CooperativeHandler(this::pushContinuously);
     /*
      * Used to ensure registering the channel event at most once (i.e. to avoid
      * multiple registrations).
@@ -72,8 +72,8 @@
         this.channel = channel;
         this.data = channel.initialByteBuffer();
         this.frameConsumer = new FrameConsumer(this.messageConsumer);
-        // To ensure the initial `data` will be read correctly (happens-before)
-        // after readable.get()
+        // To ensure the initial non-final `data` will be read correctly
+        // (happens-before) by reader after executing readable.get()
         readable.set(true);
     }
 
@@ -88,7 +88,7 @@
             @Override
             public void handle() {
                 readable.set(true);
-                receiveHandler.startOrContinue();
+                handler.handle();
             }
         };
     }
@@ -98,7 +98,7 @@
             throw new IllegalArgumentException("Negative: " + n);
         }
         demand.accumulateAndGet(n, (p, i) -> p + i < 0 ? Long.MAX_VALUE : p + i);
-        receiveHandler.startOrContinue();
+        handler.handle();
     }
 
     void acknowledge() {
@@ -113,41 +113,21 @@
      * regardless of the current demand.
      */
     void close() {
-        receiveHandler.stop();
+        handler.stop();
     }
 
-    private void tryDeliver() {
-        if (readable.get() && demand.get() > 0) {
-            deliverAtMostOne();
+    private void pushContinuously() {
+        while (readable.get() && demand.get() > 0 && !handler.isStopped()) {
+            pushOnce();
         }
     }
 
-    private void deliverAtMostOne() {
-        if (data == null) {
-            try {
-                data = channel.read();
-            } catch (IOException e) {
-                readable.set(false);
-                messageConsumer.onError(e);
-                return;
-            }
-            if (data == null || !data.hasRemaining()) {
-                readable.set(false);
-                if (!data.hasRemaining()) {
-                    try {
-                        channel.registerEvent(event);
-                    } catch (IOException e) {
-                        messageConsumer.onError(e);
-                        return;
-                    }
-                } else if (data == null) {
-                    messageConsumer.onComplete();
-                }
-                return;
-            }
+    private void pushOnce() {
+        if (data == null && !readData()) {
+            return;
         }
         try {
-            reader.readFrame(data, frameConsumer);
+            reader.readFrame(data, frameConsumer); // Pushing frame parts to the consumer
         } catch (FailWebSocketException e) {
             messageConsumer.onError(e);
             return;
@@ -156,4 +136,28 @@
             data = null;
         }
     }
+
+    private boolean readData() {
+        try {
+            data = channel.read();
+        } catch (IOException e) {
+            messageConsumer.onError(e);
+            return false;
+        }
+        if (data == null) { // EOF
+            messageConsumer.onComplete();
+            return false;
+        } else if (!data.hasRemaining()) { // No data in the socket at the moment
+            data = null;
+            readable.set(false);
+            try {
+                channel.registerEvent(event);
+            } catch (IOException e) {
+                messageConsumer.onError(e);
+            }
+            return false;
+        }
+        assert data.hasRemaining();
+        return true;
+    }
 }
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/StatusCodes.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/StatusCodes.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -25,120 +25,72 @@
 
 package jdk.incubator.http.internal.websocket;
 
-import static jdk.incubator.http.WebSocket.CLOSED_ABNORMALLY;
-
 /*
- * Utilities and common constants for WebSocket status codes. For more details
- * on status codes and their meaning see:
+ * Utilities for WebSocket status codes.
  *
  *     1. https://tools.ietf.org/html/rfc6455#section-7.4
  *     2. http://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number
  */
 final class StatusCodes {
 
-    static final int PROTOCOL_ERROR        = 1002;
-    static final int CANNOT_ACCEPT         = 1003;
-    static final int NO_STATUS_CODE        = 1005;
-    static final int NOT_CONSISTENT        = 1007;
-    static final int TOO_BIG               = 1009;
-    static final int NO_EXTENSION          = 1010;
-    static final int SERVICE_RESTART       = 1012;
-    static final int TRY_AGAIN_LATER       = 1013;
-    static final int TLS_HANDSHAKE_FAILURE = 1015;
+    static final int PROTOCOL_ERROR    = 1002;
+    static final int NO_STATUS_CODE    = 1005;
+    static final int CLOSED_ABNORMALLY = 1006;
+    static final int NOT_CONSISTENT    = 1007;
 
     private StatusCodes() { }
 
-    /*
-     * Returns the given code if it doesn't violate any rules for outgoing
-     * codes, otherwise throws a CFE with a detailed description.
-     */
-    static int checkOutgoingCode(int code) {
-        checkCommon(code);
-        if (code > 4999) {
-            throw new CheckFailedException("Unspecified: " + code);
-        }
-        if (isNotUserSettable(code)) {
-            throw new CheckFailedException("Cannot set: " + code);
-        }
-        return code;
-    }
-
-    /*
-     * Returns the given code if it doesn't violate any rules for incoming
-     * codes, otherwise throws a CFE with a detailed description.
-     */
-    static int checkIncomingCode(int code) {
-        checkCommon(code);
-        if (code == NO_EXTENSION) {
-            throw new CheckFailedException("Bad server code: " + code);
+    static boolean isLegalToSendFromClient(int code) {
+        if (!isLegal(code)) {
+            return false;
         }
-        return code;
-    }
-
-    private static int checkCommon(int code) {
-        if (isOutOfRange(code)) {
-            throw new CheckFailedException("Out of range: " + code);
-        }
-        if (isForbidden(code)) {
-            throw new CheckFailedException("Forbidden: " + code);
+        // Codes from unreserved range
+        if (code > 4999) {
+            return false;
         }
-        if (isUnassigned(code)) {
-            throw new CheckFailedException("Unassigned: " + code);
-        }
-        return code;
-    }
-
-    /*
-     * Returns true if the given code cannot be set by a user of the WebSocket
-     * API. e.g. this code means something which only a WebSocket implementation
-     * is responsible for or it doesn't make sense to be send by a WebSocket
-     * client.
-     */
-    private static boolean isNotUserSettable(int code) {
+        // Codes below are not allowed to be sent using a WebSocket client API
         switch (code) {
             case PROTOCOL_ERROR:
-            case CANNOT_ACCEPT:
             case NOT_CONSISTENT:
-            case TOO_BIG:
-            case NO_EXTENSION:
-            case TRY_AGAIN_LATER:
-            case SERVICE_RESTART:
+            case 1003:
+            case 1009:
+            case 1010:
+            case 1012:  // code sent by servers
+            case 1013:  // code sent by servers
+            case 1014:  // code sent by servers
+                return false;
+            default:
                 return true;
-            default:
-                return false;
         }
     }
 
-    /*
-     * Returns true if the given code cannot appear on the wire. It's always an
-     * error to send a frame with such a code or to receive one.
-     */
-    private static boolean isForbidden(int code) {
+    static boolean isLegalToReceiveFromServer(int code) {
+        if (!isLegal(code)) {
+            return false;
+        }
+        return code != 1010;  // code sent by clients
+    }
+
+    private static boolean isLegal(int code) {
+        // 2-byte unsigned integer excluding first 1000 numbers from the range
+        // [0, 999] which are never used
+        if (code < 1000 || code > 65535) {
+            return false;
+        }
+        // Codes from the range below has no known meaning under the WebSocket
+        // specification (i.e. unassigned/undefined)
+        if ((code >= 1016 && code <= 2999) || code == 1004) {
+            return false;
+        }
+        // Codes below cannot appear on the wire. It's always an error either
+        // to send a frame with such a code or to receive one.
         switch (code) {
             case NO_STATUS_CODE:
             case CLOSED_ABNORMALLY:
-            case TLS_HANDSHAKE_FAILURE:
+            case 1015:
+                return false;
+            default:
                 return true;
-            default:
-                return false;
         }
     }
-
-    /*
-     * Returns true if the given code has no known meaning under the WebSocket
-     * specification (i.e. unassigned/undefined).
-     */
-    private static boolean isUnassigned(int code) {
-        return (code >= 1016 && code <= 2999) || code == 1004 || code == 1014;
-    }
-
-    /*
-     * Returns true if the given code is not in domain of status codes:
-     *
-     * 2-byte unsigned integer minus first 1000 numbers from the range [0, 999]
-     * that are never used.
-     */
-    private static boolean isOutOfRange(int code) {
-        return code < 1000 || code > 65535;
-    }
 }
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/Transmitter.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/Transmitter.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -37,11 +37,12 @@
  *
  * No matter whether the message has been fully sent or an error has occurred,
  * the transmitter reports the outcome to the supplied handler and becomes ready
- * to accept a new message. Until then, it is considered "busy" and an
- * IllegalStateException will be thrown on each attempt to invoke send.
+ * to accept a new message. Until then, the transmitter is considered "busy" and
+ * an IllegalStateException will be thrown on each attempt to invoke send.
  */
 final class Transmitter {
 
+    /* This flag is used solely for assertions */
     private final AtomicBoolean busy = new AtomicBoolean();
     private OutgoingMessage message;
     private Consumer<Exception> completionHandler;
@@ -53,9 +54,10 @@
         this.event = createHandler();
     }
 
-    /*
-     * The supplied handler may be invoked in the calling thread, so watch out
-     * for stack overflow.
+    /**
+     * The supplied handler may be invoked in the calling thread.
+     * A {@code StackOverflowError} may thus occur if there's a possibility
+     * that this method is called again by the supplied handler.
      */
     void send(OutgoingMessage message, Consumer<Exception> completionHandler) {
         requireNonNull(message);
@@ -86,8 +88,9 @@
     private void send0(OutgoingMessage message, Consumer<Exception> handler) {
         boolean b = busy.get();
         assert b; // Please don't inline this, as busy.get() has memory
-                  // visibility effects and we don't want the correctness
-                  // of the algorithm to depend on assertions flag
+                  // visibility effects and we don't want the program behaviour
+                  // to depend on whether the assertions are turned on
+                  // or turned off
         try {
             boolean sent = message.sendTo(channel);
             if (sent) {
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/WebSocketImpl.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/WebSocketImpl.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -51,9 +51,9 @@
 import static java.util.Objects.requireNonNull;
 import static java.util.concurrent.CompletableFuture.failedFuture;
 import static jdk.incubator.http.internal.common.Pair.pair;
+import static jdk.incubator.http.internal.websocket.StatusCodes.CLOSED_ABNORMALLY;
 import static jdk.incubator.http.internal.websocket.StatusCodes.NO_STATUS_CODE;
-import static jdk.incubator.http.internal.websocket.StatusCodes.TLS_HANDSHAKE_FAILURE;
-import static jdk.incubator.http.internal.websocket.StatusCodes.checkOutgoingCode;
+import static jdk.incubator.http.internal.websocket.StatusCodes.isLegalToSendFromClient;
 
 /*
  * A WebSocket client.
@@ -74,8 +74,8 @@
     private final AtomicBoolean outstandingSend = new AtomicBoolean();
     private final CooperativeHandler sendHandler =
               new CooperativeHandler(this::sendFirst);
-    private final Queue<Pair<OutgoingMessage, Consumer<Exception>>> queue =
-              new ConcurrentLinkedQueue<>();
+    private final Queue<Pair<OutgoingMessage, CompletableFuture<WebSocket>>>
+            queue = new ConcurrentLinkedQueue<>();
     private final Context context = new OutgoingMessage.Context();
     private final Transmitter transmitter;
     private final Receiver receiver;
@@ -110,6 +110,9 @@
                                                  r.subprotocol,
                                                  r.channel,
                                                  b.getListener());
+            // The order of calls might cause a subtle effects, like CF will be
+            // returned from the buildAsync _after_ onOpen has been signalled.
+            // This means if onOpen is lengthy, it might cause some problems.
             ws.signalOpen();
             return ws;
         };
@@ -125,7 +128,8 @@
     WebSocketImpl(URI uri,
                   String subprotocol,
                   RawChannel channel,
-                  Listener listener) {
+                  Listener listener)
+    {
         this.uri = requireNonNull(uri);
         this.subprotocol = requireNonNull(subprotocol);
         this.channel = requireNonNull(channel);
@@ -182,15 +186,17 @@
      * Processes a Close event that came from the channel. Invoked at most once.
      */
     private void processClose(int statusCode, String reason) {
-        assert statusCode != TLS_HANDSHAKE_FAILURE; // TLS problems happen long before WebSocket is alive
         receiver.close();
         try {
             channel.shutdownInput();
         } catch (IOException e) {
             Log.logError(e);
         }
-        boolean wasComplete = !closeReceived.complete(null);
-        if (wasComplete) {
+        boolean alreadyCompleted = !closeReceived.complete(null);
+        if (alreadyCompleted) {
+            // This CF is supposed to be completed only once, the first time a
+            // Close message is received. No further messages are pulled from
+            // the socket.
             throw new InternalError();
         }
         int code;
@@ -261,19 +267,17 @@
     @Override
     public CompletableFuture<WebSocket> sendClose(int statusCode,
                                                   String reason) {
-        try {
-            checkOutgoingCode(statusCode);
-        } catch (CheckFailedException e) {
-            IllegalArgumentException ex = new IllegalArgumentException(
-                    "Bad status code: " + statusCode, e);
-            failedFuture(ex);
+        if (!isLegalToSendFromClient(statusCode)) {
+            return failedFuture(
+                    new IllegalArgumentException("statusCode: " + statusCode));
         }
-        return enqueueClose(new Close(statusCode, reason));
-    }
-
-    @Override
-    public CompletableFuture<WebSocket> sendClose() {
-        return enqueueClose(new Close());
+        Close msg;
+        try {
+            msg = new Close(statusCode, reason);
+        } catch (IllegalArgumentException e) {
+            return failedFuture(e);
+        }
+        return enqueueClose(msg);
     }
 
     /*
@@ -288,8 +292,8 @@
             } catch (IOException e) {
                 Log.logError(e);
             }
-            boolean wasComplete = !closeSent.complete(null);
-            if (wasComplete) {
+            boolean alreadyCompleted = !closeSent.complete(null);
+            if (alreadyCompleted) {
                 // Shouldn't happen as this callback must run at most once
                 throw new InternalError();
             }
@@ -316,40 +320,41 @@
 
     private CompletableFuture<WebSocket> enqueue(OutgoingMessage m) {
         CompletableFuture<WebSocket> cf = new CompletableFuture<>();
-        Consumer<Exception> h = e -> {
-            if (e == null) {
-                cf.complete(WebSocketImpl.this);
-                sendHandler.startOrContinue();
-            } else {
-
-//                what if this is not a users message? (must be different entry points for different messages)
-
-                // TODO: think about correct behaviour in the face of error in
-                // the queue, for now it seems like the best solution is to
-                // deliver the error and stop
-                cf.completeExceptionally(e);
-            }
-        };
-        queue.add(pair(m, h)); // Always returns true
-        sendHandler.startOrContinue();
+        boolean added = queue.add(pair(m, cf));
+        if (!added) {
+            // The queue is supposed to be unbounded
+            throw new InternalError();
+        }
+        sendHandler.handle();
         return cf;
     }
 
-    private void sendFirst() {
-        Pair<OutgoingMessage, Consumer<Exception>> p = queue.poll();
+    /*
+     * This is the main sending method. It may be run in different threads,
+     * but never concurrently.
+     */
+    private void sendFirst(Runnable whenSent) {
+        Pair<OutgoingMessage, CompletableFuture<WebSocket>> p = queue.poll();
         if (p == null) {
+            whenSent.run();
             return;
         }
         OutgoingMessage message = p.first;
-        Consumer<Exception> h = p.second;
+        CompletableFuture<WebSocket> cf = p.second;
         try {
-            // At this point messages are finally ordered and will be written
-            // one by one in a mutually exclusive fashion; thus it's a pretty
-            // convenient place to contextualize them
             message.contextualize(context);
+            Consumer<Exception> h = e -> {
+                if (e == null) {
+                    cf.complete(WebSocketImpl.this);
+                } else {
+                    cf.completeExceptionally(e);
+                }
+                sendHandler.handle();
+                whenSent.run();
+            };
             transmitter.send(message, h);
         } catch (Exception t) {
-            h.accept(t);
+            cf.completeExceptionally(t);
         }
     }
 
@@ -381,7 +386,7 @@
     @Override
     public String toString() {
         return super.toString()
-                + "[" + (closed.get() ? "OPEN" : "CLOSED") + "]: " + uri
+                + "[" + (closed.get() ? "CLOSED" : "OPEN") + "]: " + uri
                 + (!subprotocol.isEmpty() ? ", subprotocol=" + subprotocol : "");
     }
 
@@ -476,7 +481,9 @@
                     int code = ((FailWebSocketException) error).getStatusCode();
                     enqueueClose(new Close(code, ""))
                             .whenComplete((r, e) -> {
-                                ex.addSuppressed(e);
+                                if (e != null) {
+                                    ex.addSuppressed(e);
+                                }
                                 try {
                                     channel.close();
                                 } catch (IOException e1) {
--- a/jdk/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSigner.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSigner.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -172,7 +172,7 @@
          *
          * @param algorithm the standard name of the algorithm. See
          *      the {@code MessageDigest} section in the <a href=
-         *      "{@docRoot}/../technotes/guides/security/StandardNames.html#MessageDigest">
+         *      "{@docRoot}/../specs/security/standard-names.html#messagedigest-algorithms">
          *      Java Cryptography Architecture Standard Algorithm Name
          *      Documentation</a> for information about standard algorithm names.
          * @return the {@code JarSigner.Builder} itself.
@@ -192,7 +192,7 @@
          *
          * @param algorithm the standard name of the algorithm. See
          *      the {@code MessageDigest} section in the <a href=
-         *      "{@docRoot}/../technotes/guides/security/StandardNames.html#MessageDigest">
+         *      "{@docRoot}/../specs/security/standard-names.html#messagedigest-algorithms">
          *      Java Cryptography Architecture Standard Algorithm Name
          *      Documentation</a> for information about standard algorithm names.
          * @param provider the provider.
@@ -218,7 +218,7 @@
          *
          * @param algorithm the standard name of the algorithm. See
          *      the {@code Signature} section in the <a href=
-         *      "{@docRoot}/../technotes/guides/security/StandardNames.html#Signature">
+         *      "{@docRoot}/../specs/security/standard-names.html#signature-algorithms">
          *      Java Cryptography Architecture Standard Algorithm Name
          *      Documentation</a> for information about standard algorithm names.
          * @return the {@code JarSigner.Builder} itself.
@@ -245,7 +245,7 @@
          *
          * @param algorithm the standard name of the algorithm. See
          *      the {@code Signature} section in the <a href=
-         *      "{@docRoot}/../technotes/guides/security/StandardNames.html#Signature">
+         *      "{@docRoot}/../specs/security/standard-names.html#signature-algorithms">
          *      Java Cryptography Architecture Standard Algorithm Name
          *      Documentation</a> for information about standard algorithm names.
          * @param provider  the provider.
--- a/jdk/src/jdk.jconsole/share/classes/com/sun/tools/jconsole/JConsolePlugin.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.jconsole/share/classes/com/sun/tools/jconsole/JConsolePlugin.java	Thu May 25 22:33:25 2017 +0000
@@ -34,8 +34,8 @@
 
 /**
  * A JConsole plugin class.  JConsole uses the
- * <a href="{@docRoot}/../../../../api/java/util/ServiceLoader.html">
- * service provider</a> mechanism to search the JConsole plugins.
+ * {@link java.util.ServiceLoader service provider}
+ * mechanism to search the JConsole plugins.
  * Users can provide their JConsole plugins in a jar file
  * containing a file named
  *
@@ -67,8 +67,7 @@
  * call its {@link #getTabs getTabs} method and add the returned
  * tabs to the JConsole window.
  *
- * @see <a href="{@docRoot}/../../../../api/java/util/ServiceLoader.html">
- * java.util.ServiceLoader</a>
+ * @see java.util.ServiceLoader
  *
  * @since 1.6
  */
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/JDIPermission.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/JDIPermission.java	Thu May 25 22:33:25 2017 +0000
@@ -40,7 +40,7 @@
  * permission allows, and discusses the risks of granting code the
  * permission.
  *
- * <table border="1" cellpadding=5>
+ * <table class="plain">
  * <caption style="display:none">Table shows permission target name, what the
  * permission allows, and associated risks</caption>
  * <tr>
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ThreadGroupReference.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ThreadGroupReference.java	Thu May 25 22:33:25 2017 +0000
@@ -92,7 +92,7 @@
      * Returns a List containing each active {@link ThreadGroupReference} in this
      * thread group. Only the active thread groups in this immediate thread group
      * (and not its subgroups) are returned.
-     * See <a href="{@docRoot}/../../../../api/java/lang/ThreadGroup.html">java.lang.ThreadGroup</a>
+     * See {@link java.lang.ThreadGroup}
      * for information about 'active' ThreadGroups.
      * @return a List of {@link ThreadGroupReference} objects mirroring the
      * active thread groups from this thread group in the target VM.
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/doc-files/signature.html	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/doc-files/signature.html	Thu May 25 22:33:25 2017 +0000
@@ -1,3 +1,4 @@
+<!DOCTYPE HTML>
 <HTML>
 <HEAD>
 <TITLE>
--- a/jdk/src/jdk.management/share/classes/com/sun/management/DiagnosticCommandMBean.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.management/share/classes/com/sun/management/DiagnosticCommandMBean.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -106,7 +106,7 @@
  * The additional meta-data provided for an operation associated with a
  * diagnostic command are described in the table below:
  *
- * <table border="1" cellpadding="5">
+ * <table class="striped"><caption style="display:none">description</caption>
  *   <tr>
  *     <th>Name</th><th>Type</th><th>Description</th>
  *   </tr>
@@ -167,7 +167,7 @@
  * a Descriptor instance. The fields provided in this second Descriptor
  * instance are described in the table below:
  *
- * <table border="1" cellpadding="5">
+ * <table class="striped"><caption style="display:none">description</caption>
  *   <tr>
  *     <th>Name</th><th>Type</th><th>Description</th>
  *   </tr>
@@ -205,7 +205,7 @@
  * Virtual Machine is modified, the {@code DiagnosticCommandMBean} emits
  * a {@link javax.management.Notification} with a
  * {@linkplain javax.management.Notification#getType() type} of
- * <a href="{@docRoot}/../../../../api/javax/management/MBeanInfo.html#info-changed">
+ * <a href="{@docRoot}/javax/management/MBeanInfo.html#info-changed">
  * {@code "jmx.mbean.info.changed"}</a> and a
  * {@linkplain javax.management.Notification#getUserData() userData} that
  * is the new {@code MBeanInfo}.
--- a/jdk/src/jdk.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -181,10 +181,10 @@
      * The given {@code CompositeData} must contain
      * the following attributes:
      * <blockquote>
-     * <table border>
+     * <table class="striped"><caption style="display:none">description</caption>
      * <tr>
-     *   <th align=left>Attribute Name</th>
-     *   <th align=left>Type</th>
+     *   <th style="text-align:left">Attribute Name</th>
+     *   <th style="text-align:left">Type</th>
      * </tr>
      * <tr>
      *   <td>gcName</td>
--- a/jdk/src/jdk.management/share/classes/com/sun/management/GcInfo.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.management/share/classes/com/sun/management/GcInfo.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -56,7 +56,7 @@
  * interface.  This is a historical relic, and other classes should
  * not copy this pattern.  Use {@link CompositeDataView} instead.
  *
- * <h4>MXBean Mapping</h4>
+ * <h3>MXBean Mapping</h3>
  * {@code GcInfo} is mapped to a {@link CompositeData CompositeData}
  * with attributes as specified in the {@link #from from} method.
  *
@@ -183,10 +183,10 @@
      * all the following attributes:
      *
      * <blockquote>
-     * <table border>
+     * <table class="striped"><caption style="display:none">description</caption>
      * <tr>
-     *   <th align=left>Attribute Name</th>
-     *   <th align=left>Type</th>
+     *   <th style="text-align:left">Attribute Name</th>
+     *   <th style="text-align:left">Type</th>
      * </tr>
      * <tr>
      *   <td>index</td>
--- a/jdk/src/jdk.management/share/classes/com/sun/management/VMOption.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.management/share/classes/com/sun/management/VMOption.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -190,10 +190,10 @@
      * must contain the following attributes:
      *
      * <blockquote>
-     * <table border>
+     * <table class="striped"><caption style="display:none">description</caption>
      * <tr>
-     *   <th align=left>Attribute Name</th>
-     *   <th align=left>Type</th>
+     *   <th style="text-align:left">Attribute Name</th>
+     *   <th style="text-align:left">Type</th>
      * </tr>
      * <tr>
      *   <td>name</td>
--- a/jdk/src/jdk.management/share/classes/com/sun/management/package-info.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.management/share/classes/com/sun/management/package-info.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -26,15 +26,13 @@
 /**
  * This package contains Oracle Corporation's platform extension to
  * the implementation of the
- * <a href="{@docRoot}/../../../../api/java/lang/management/package-summary.html">
- * java.lang.management</a> API and also defines the management
+ * {@link java.lang.management} API and also defines the management
  * interface for some other components for the platform.
  *
  * <p>
  * All platform MBeans are registered in the <em>platform MBeanServer</em>
  * which can be obtained via the
- * <a href="{@docRoot}/../../../../api/java/lang/management/ManagementFactory.html#getPlatformMBeanServer()">
- * java.lang.management.ManagementFactory.getPlatformMBeanServer</a>
+ * {@link java.lang.management.ManagementFactory#getPlatformMBeanServer}
  *
  * @author  Mandy Chung
  * @since   1.5
--- a/jdk/src/jdk.net/share/classes/jdk/net/NetworkPermission.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.net/share/classes/jdk/net/NetworkPermission.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -34,8 +34,8 @@
  * <p>
  * The following targets are defined:
  *
- * <table border=1 cellpadding=5 summary="permission target name,
- *  what the target allows,and associated risks">
+ * <table class="striped"><caption style="display:none">permission target name,
+ *  what the target allows,and associated risks</caption>
  * <tr>
  *   <th>Permission Target Name</th>
  *   <th>What the Permission Allows</th>
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -59,7 +59,7 @@
  * {@link #setOption(SctpSocketOption,Object) setOption} method. An SCTP
  * channel support the following options:
  * <blockquote>
- * <table border summary="Socket options">
+ * <table class="striped"><caption style="display:none">Socket options</caption>
  *   <tr>
  *     <th>Option Name</th>
  *     <th>Description</th>
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpMultiChannel.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpMultiChannel.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -63,7 +63,7 @@
  * {@link #setOption(SctpSocketOption,Object,Association) setOption} method. An
  * {@code SctpMultiChannel} supports the following options:
  * <blockquote>
- * <table border summary="Socket options">
+ * <table class="striped"><caption style="display:none">Socket options</caption>
  *   <tr>
  *     <th>Option Name</th>
  *     <th>Description</th>
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpServerChannel.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpServerChannel.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -47,7 +47,7 @@
  * {@link #setOption(SctpSocketOption,Object) setOption} method. SCTP server socket
  * channels support the following options:
  * <blockquote>
- * <table border summary="Socket options">
+ * <table><caption style="display:none">Socket options</caption>
  *   <tr>
  *     <th>Option Name</th>
  *     <th>Description</th>
--- a/jdk/test/java/io/File/SetLastModified.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/io/File/SetLastModified.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,7 @@
  */
 
 /* @test
-   @bug 4091757 6652379
+   @bug 4091757 6652379 8177809
    @summary Basic test for setLastModified method
  */
 
--- a/jdk/test/java/lang/ClassLoader/securityManager/ClassLoaderTest.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/lang/ClassLoader/securityManager/ClassLoaderTest.java	Thu May 25 22:33:25 2017 +0000
@@ -28,8 +28,14 @@
  *          (in)valid security policy file.
  * @library /lib/testlibrary
  * @modules java.base/jdk.internal.module
- * @build JarUtils CompilerUtils
- * @run main/timeout=240 ClassLoaderTest
+ * @build JarUtils
+ * @build TestClassLoader TestClient
+ * @run main ClassLoaderTest -noPolicy
+ * @run main ClassLoaderTest -validPolicy
+ * @run main ClassLoaderTest -invalidPolicy
+ * @run main ClassLoaderTest -noPolicy      -customSCL
+ * @run main ClassLoaderTest -validPolicy   -customSCL
+ * @run main ClassLoaderTest -invalidPolicy -customSCL
  */
 import java.io.File;
 import java.io.OutputStream;
@@ -37,25 +43,23 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.nio.file.StandardCopyOption;
-import java.util.Map;
-import java.util.HashMap;
+import java.util.stream.Stream;
 import java.lang.module.ModuleDescriptor;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
 import jdk.internal.module.ModuleInfoWriter;
 import jdk.testlibrary.ProcessTools;
 
 public class ClassLoaderTest {
 
     private static final String SRC = System.getProperty("test.src");
-    private static final Path CL_SRC = Paths.get(SRC, "TestClassLoader.java");
-    private static final Path C_SRC = Paths.get(SRC, "TestClient.java");
-    private static final Path CL_BIN = Paths.get("classes", "clbin");
-    private static final Path C_BIN = Paths.get("classes", "cbin");
+    private static final Path TEST_CLASSES =
+            Paths.get(System.getProperty("test.classes"));
     private static final Path ARTIFACT_DIR = Paths.get("jars");
     private static final Path VALID_POLICY = Paths.get(SRC, "valid.policy");
     private static final Path INVALID_POLICY
             = Paths.get(SRC, "malformed.policy");
-    private static final Path NO_POLICY = null;
-    private static final String LOCALE = "-Duser.language=en -Duser.region=US";
     /*
      * Here is the naming convention followed for each jar.
      * cl.jar   - Regular custom class loader jar.
@@ -69,180 +73,175 @@
     private static final Path C_JAR = ARTIFACT_DIR.resolve("c.jar");
     private static final Path MC_JAR = ARTIFACT_DIR.resolve("mc.jar");
     private static final Path AMC_JAR = ARTIFACT_DIR.resolve("amc.jar");
-    private static final Map<String, String> MSG_MAP = new HashMap<>();
+
+    // Expected output messages
+    private static final String MISSING_MODULE =
+            "Module cl not found, required by mc";
+    private static final String POLICY_ERROR =
+            "java.security.policy: error parsing file";
+    private static final String SYSTEM_CL_MSG =
+            "jdk.internal.loader.ClassLoaders$AppClassLoader";
+    private static final String CUSTOM_CL_MSG = "cl.TestClassLoader";
+
+    // Member vars
+    private final boolean useSCL;       // Use default system loader, or custom
+    private final String smMsg;         // Security manager message, or ""
+    private final String autoAddModArg; // Flag to add cl modules, or ""
+    private final String addmodArg;     // Flag to add mcl modules, or ""
+    private final String expectedStatus;// Expected exit status from client
+    private final String expectedMsg;   // Expected output message from client
+
+    // Common set of VM arguments used in all test cases
+    private final List<String> commonArgs;
+
+    public ClassLoaderTest(Path policy, boolean useSCL) {
+        this.useSCL = useSCL;
+
+        List<String> argList = new LinkedList<>();
+        argList.add("-Duser.language=en");
+        argList.add("-Duser.region=US");
 
-    static {
-        // This mapping help process finding expected message based
-        // on the key passed as argument while executing java command.
-        MSG_MAP.put("MissingModule", "Module cl not found, required by mc");
-        MSG_MAP.put("ErrorPolicy", "java.security.policy: error parsing file");
-        MSG_MAP.put(
-                "SystemCL", "jdk.internal.loader.ClassLoaders$AppClassLoader");
-        MSG_MAP.put("CustomCL", "cl.TestClassLoader");
+        boolean malformedPolicy = false;
+        if (policy == null) {
+            smMsg = "Without SecurityManager";
+        } else {
+            malformedPolicy = policy.equals(INVALID_POLICY);
+            argList.add("-Djava.security.manager");
+            argList.add("-Djava.security.policy=" +
+                    policy.toFile().getAbsolutePath());
+            smMsg = "With SecurityManager";
+        }
+
+        if (useSCL) {
+            autoAddModArg = "";
+            addmodArg = "";
+        } else {
+            argList.add("-Djava.system.class.loader=cl.TestClassLoader");
+            autoAddModArg = "--add-modules=cl";
+            addmodArg = "--add-modules=mcl";
+        }
+
+        if (malformedPolicy) {
+            expectedStatus = "FAIL";
+            expectedMsg = POLICY_ERROR;
+        } else if (useSCL) {
+            expectedStatus = "PASS";
+            expectedMsg = SYSTEM_CL_MSG;
+        } else {
+            expectedStatus = "PASS";
+            expectedMsg = CUSTOM_CL_MSG;
+        }
+        commonArgs = Collections.unmodifiableList(argList);
     }
 
     public static void main(String[] args) throws Exception {
+        Path policy;
+        if (args[0].equals("-noPolicy")) {
+            policy = null;
+        } else if (args[0].equals("-validPolicy")) {
+            policy = VALID_POLICY;
+        } else if (args[0].equals("-invalidPolicy")) {
+            policy = INVALID_POLICY;
+        } else {
+            throw new RuntimeException("Unknown policy arg: " + args[0]);
+        }
 
-        // Generates regular and modular jars before start processing it.
+        boolean useSystemLoader = true;
+        if (args.length > 1) {
+            if (args[1].equals("-customSCL")) {
+                useSystemLoader = false;
+            } else {
+                throw new RuntimeException("Unknown custom loader arg: " + args[1]);
+            }
+        }
+
+        ClassLoaderTest test = new ClassLoaderTest(policy, useSystemLoader);
         setUp();
-        processForEachPolicyFile();
+        test.processForPolicyFile();
     }
 
     /**
      * Test cases are based on the following logic,
-     *  for (policyFile : {"NO_POLICY", "VALID", "MALFORMED"}) {
-     *      for (classLoader : {"SystemClassLoader", "CustomClassLoader"}){
-     *          for (clientModule : {"NAMED", "AUTOMATIC", "UNNAMED"}) {
-     *              for (classLoaderModule : {"NAMED", "AUTOMATIC", "UNNAMED"}) {
-     *                  Create and run java command for each possible Test case
-     *              }
-     *          }
+     *  given: a policyFile in {none, valid, malformed} and
+     *         a classLoader in {SystemClassLoader, CustomClassLoader}:
+     *  for (clientModule : {"NAMED", "UNNAMED"}) {
+     *      for (classLoaderModule : {"NAMED", "UNNAMED"}) {
+     *          Create and run java command for each possible Test case
      *      }
      *  }
      */
-    private static void processForEachPolicyFile() throws Exception {
-
-        final String regCLloc = CL_JAR.toFile().getAbsolutePath();
-        final String modCLloc = MCL_JAR.toFile().getAbsolutePath();
-        final String regCloc = C_JAR.toFile().getAbsolutePath();
-        final String modCloc = MC_JAR.toFile().getAbsolutePath();
+    private void processForPolicyFile() throws Exception {
+        final String regLoaderLoc = CL_JAR.toFile().getAbsolutePath();
+        final String modLoadrLoc = MCL_JAR.toFile().getAbsolutePath();
+        final String regClientLoc = C_JAR.toFile().getAbsolutePath();
+        final String modClientLoc = MC_JAR.toFile().getAbsolutePath();
         final String autoModCloc = AMC_JAR.toFile().getAbsolutePath();
         final String separator = File.pathSeparator;
 
-        for (Path policy
-                : new Path[]{NO_POLICY, VALID_POLICY, INVALID_POLICY}) {
-            final String policyFile = (policy != null)
-                    ? policy.toFile().getAbsolutePath() : null;
-            final boolean malformedPolicy
-                    = (policy == null) ? false : policy.equals(INVALID_POLICY);
-
-            for (boolean useSCL : new boolean[]{true, false}) {
-                final String clVmArg = (useSCL) ? ""
-                        : "-Djava.system.class.loader=cl.TestClassLoader";
-                final String autoAddModArg
-                        = (useSCL) ? "" : "--add-modules=cl";
-                final String addmodArg = (useSCL) ? "" : "--add-modules=mcl";
-                final String sMArg = (policy != null) ? String.format(
-                        "-Djava.security.manager -Djava.security.policy=%s",
-                        policyFile) : "";
-                final String smMsg = (policy != null) ? "With SecurityManager"
-                        : "Without SecurityManager";
-                final String expectedResult = ((!malformedPolicy)
-                        ? ((useSCL) ? "PASS SystemCL" : "PASS CustomCL")
-                        : "FAIL ErrorPolicy");
+        // NAMED-NAMED:
+        System.out.println("Case:- Modular Client and " +
+                ((useSCL) ? "SystemClassLoader"
+                        : "Modular CustomClassLoader") + " " + smMsg);
+        execute("--module-path", modClientLoc + separator + modLoadrLoc, "-m",
+                "mc/c.TestClient");
 
-                // NAMED-NAMED, NAMED-AUTOMATIC, NAMED-UNNAMED
-                System.out.printf("Case:- Modular Client and %s %s%n",
-                        ((useSCL) ? "SystemClassLoader"
-                                : "Modular CustomClassLoader"), smMsg);
-                execute(new String[]{String.format(
-                    "--module-path %s%s%s %s %s %s -m mc/c.TestClient",
-                    modCloc, separator, modCLloc, LOCALE, clVmArg, sMArg),
-                    expectedResult});
-                System.out.printf("Case:- Modular Client and %s %s%n", ((useSCL)
-                        ? "SystemClassLoader"
-                        : "Automatic modular CustomClassLoader"), smMsg);
-                execute(new String[]{String.format(
-                    "--module-path %s%s%s %s %s %s -m mc/c.TestClient",
-                    autoModCloc, separator, regCLloc, LOCALE, clVmArg, sMArg),
-                    expectedResult});
-                System.out.printf("Case:- Modular Client and %s %s%n", ((useSCL)
-                        ? "SystemClassLoader"
-                        : "Unknown modular CustomClassLoader"), smMsg);
-                execute(new String[]{String.format(
-                    "--module-path %s -cp %s %s %s %s -m mc/c.TestClient",
-                    autoModCloc, regCLloc, LOCALE, clVmArg, sMArg),
-                    "FAIL MissingModule"});
+        // NAMED-UNNAMED:
+        System.out.println("Case:- Modular Client and " + ((useSCL)
+                ? "SystemClassLoader"
+                : "Unknown modular CustomClassLoader") + " " + smMsg);
+        execute(new String[] {"--module-path", autoModCloc, "-cp", regLoaderLoc,
+                "-m", "mc/c.TestClient"},
+                "FAIL", MISSING_MODULE);
+
+        // UNNAMED-NAMED:
+        System.out.println("Case:- Unknown modular Client and " +
+                ((useSCL) ? "SystemClassLoader"
+                      : "Modular CustomClassLoader") + " " + smMsg);
+        execute("-cp", regClientLoc, "--module-path", modLoadrLoc, addmodArg,
+                "c.TestClient");
 
-                // AUTOMATIC-NAMED, AUTOMATIC-AUTOMATIC, AUTOMATIC-UNNAMED
-                System.out.printf("Case:- Automated modular Client and %s %s%n",
-                        ((useSCL) ? "SystemClassLoader"
-                                : "Modular CustomClassLoader"), smMsg);
-                execute(new String[]{String.format(
-                    "--module-path %s%s%s %s %s %s %s -m c/c.TestClient",
-                    regCloc, separator, modCLloc, addmodArg, LOCALE, clVmArg,
-                    sMArg), expectedResult});
-                System.out.printf("Case:- Automated modular Client and %s %s%n",
-                        ((useSCL) ? "SystemClassLoader"
-                                : "Automatic modular CustomClassLoader"),
-                        smMsg);
-                execute(new String[]{String.format(
-                    "--module-path %s%s%s %s %s %s %s -m c/c.TestClient",
-                    regCloc, separator, regCLloc, autoAddModArg, LOCALE,
-                    clVmArg, sMArg), expectedResult});
-                System.out.printf("Case:- Automated modular Client and %s %s%n",
-                        ((useSCL) ? "SystemClassLoader"
-                                : "Unknown modular CustomClassLoader"), smMsg);
-                execute(new String[]{String.format(
-                    "--module-path %s -cp %s %s %s %s -m c/c.TestClient",
-                    regCloc, regCLloc, LOCALE, clVmArg, sMArg),
-                    expectedResult});
+        // UNNAMED-UNNAMED:
+        System.out.println("Case:- Unknown modular Client and " +
+                ((useSCL) ? "SystemClassLoader"
+                        : "Unknown modular CustomClassLoader") + " " + smMsg);
+        execute("-cp", regClientLoc + separator + regLoaderLoc, "c.TestClient");
 
-                // UNNAMED-NAMED, UNNAMED-AUTOMATIC, UNNAMED-UNNAMED
-                System.out.printf("Case:- Unknown modular Client and %s %s%n",
-                        ((useSCL) ? "SystemClassLoader"
-                                : "Modular CustomClassLoader"), smMsg);
-                execute(new String[]{String.format(
-                    "-cp %s --module-path %s %s %s %s %s c.TestClient",
-                    regCloc, modCLloc, addmodArg, LOCALE, clVmArg, sMArg),
-                    expectedResult});
-                System.out.printf("Case:- Unknown modular Client and %s %s%n",
-                        ((useSCL) ? "SystemClassLoader"
-                                : "Automatic modular CustomClassLoader"),
-                        smMsg);
-                execute(new String[]{String.format(
-                    "-cp %s --module-path %s %s %s %s %s c.TestClient",
-                    regCloc, regCLloc, autoAddModArg, LOCALE, clVmArg, sMArg),
-                    expectedResult});
-                System.out.printf("Case:- Unknown modular Client and %s %s%n",
-                        ((useSCL) ? "SystemClassLoader"
-                                : "Unknown modular CustomClassLoader"), smMsg);
-                execute(new String[]{String.format(
-                    "-cp %s%s%s %s %s %s c.TestClient", regCloc, separator,
-                    regCLloc, LOCALE, clVmArg, sMArg), expectedResult});
+        // Regular jars in module-path
+        System.out.println("Case:- Regular Client and " + ((useSCL)
+                ? "SystemClassLoader"
+                : "Unknown modular CustomClassLoader") +
+                " inside --module-path " + smMsg);
+        execute("--module-path", regClientLoc + separator + regLoaderLoc,
+                autoAddModArg, "-m", "c/c.TestClient");
 
-                // Regular jars in module-path and Modular jars in class-path.
-                System.out.printf("Case:- Regular Client and %s "
-                        + "inside --module-path %s.%n", ((useSCL)
-                                ? "SystemClassLoader"
-                                : "Unknown modular CustomClassLoader"), smMsg);
-                execute(new String[]{String.format(
-                    "--module-path %s%s%s %s %s %s %s -m c/c.TestClient",
-                    regCloc, separator, regCLloc, autoAddModArg, LOCALE,
-                    clVmArg, sMArg), expectedResult});
-                System.out.printf("Case:- Modular Client and %s in -cp %s%n",
-                        ((useSCL) ? "SystemClassLoader"
-                                : "Modular CustomClassLoader"), smMsg);
-                execute(new String[]{String.format(
-                    "-cp %s%s%s %s %s %s c.TestClient", modCloc, separator,
-                    modCLloc, LOCALE, clVmArg, sMArg), expectedResult});
-            }
-        }
+        // Modular jars in class-path
+        System.out.println("Case:- Modular Client and " +
+                ((useSCL) ? "SystemClassLoader"
+                        : "Modular CustomClassLoader") + " in -cp " + smMsg);
+        execute("-cp", modClientLoc + separator + modLoadrLoc, "c.TestClient");
+    }
+
+    private void execute(String... args) throws Exception {
+        execute(args, this.expectedStatus, this.expectedMsg);
     }
 
     /**
      * Execute with command arguments and process the result.
      */
-    private static void execute(String[] args) throws Exception {
+    private void execute(String[] args, String status, String msg) throws Exception {
 
-        String status = null;
-        String msgKey = null;
-        if ((args != null && args.length > 1)) {
-            String[] secArgs = args[1].split("\\s+");
-            status = (secArgs.length > 0) ? secArgs[0] : null;
-            msgKey = (secArgs.length > 1) ? secArgs[1] : null;
-        }
-        String out = ProcessTools.executeTestJvm(args[0].split("\\s+"))
-                .getOutput();
+        // Combine with commonArgs, and perform sanity check
+        String[] safeArgs = Stream.concat(commonArgs.stream(), Stream.of(args))
+                .filter(s -> {
+                    if (s.contains(" ")) { throw new RuntimeException("No spaces in args");}
+                    return !s.isEmpty();
+                }).toArray(String[]::new);
+        String out = ProcessTools.executeTestJvm(safeArgs).getOutput();
         // Handle response.
-        if ((status != null && "PASS".equals(status) && msgKey != null
-                && out.contains(MSG_MAP.get(msgKey)))) {
-            System.out.printf("PASS: Expected Result: %s.%n",
-                    MSG_MAP.get(msgKey));
-        } else if ((status != null && "FAIL".equals(status) && msgKey != null
-                && out.contains(MSG_MAP.get(msgKey)))) {
-            System.out.printf("PASS: Expected Failure: %s.%n",
-                    MSG_MAP.get(msgKey));
+        if ("PASS".equals(status) && out.contains(msg)) {
+            System.out.println("PASS: Expected Result: " + msg);
+        } else if ("FAIL".equals(status) && out.contains(msg)) {
+            System.out.printf("PASS: Expected Failure: " +  msg);
         } else if (out.contains("Exception") || out.contains("Error")) {
             System.out.printf("OUTPUT: %s", out);
             throw new RuntimeException("FAIL: Unknown Exception.");
@@ -257,23 +256,23 @@
      */
     private static void setUp() throws Exception {
 
-        boolean compiled = CompilerUtils.compile(CL_SRC, CL_BIN);
-        compiled &= CompilerUtils.compile(C_SRC, C_BIN);
-        if (!compiled) {
-            throw new RuntimeException("Test Setup failed.");
-        }
         // Generate regular jar files for TestClient and TestClassLoader
-        JarUtils.createJarFile(CL_JAR, CL_BIN);
-        JarUtils.createJarFile(C_JAR, C_BIN);
+        JarUtils.createJarFile(CL_JAR, TEST_CLASSES,
+                               "cl/TestClassLoader.class");
+        JarUtils.createJarFile(C_JAR, TEST_CLASSES,
+                               "c/TestClient.class");
         // Generate modular jar files for TestClient and TestClassLoader with
         // their corresponding ModuleDescriptor.
-        Files.copy(CL_JAR, MCL_JAR, StandardCopyOption.REPLACE_EXISTING);
+        Files.copy(CL_JAR, MCL_JAR,
+                StandardCopyOption.REPLACE_EXISTING);
         updateModuleDescr(MCL_JAR, ModuleDescriptor.newModule("mcl")
                 .exports("cl").requires("java.base").build());
-        Files.copy(C_JAR, MC_JAR, StandardCopyOption.REPLACE_EXISTING);
+        Files.copy(C_JAR, MC_JAR,
+                StandardCopyOption.REPLACE_EXISTING);
         updateModuleDescr(MC_JAR, ModuleDescriptor.newModule("mc")
                 .exports("c").requires("java.base").requires("mcl").build());
-        Files.copy(C_JAR, AMC_JAR, StandardCopyOption.REPLACE_EXISTING);
+        Files.copy(C_JAR, AMC_JAR,
+                StandardCopyOption.REPLACE_EXISTING);
         updateModuleDescr(AMC_JAR, ModuleDescriptor.newModule("mc")
                 .exports("c").requires("java.base").requires("cl").build());
     }
--- a/jdk/test/java/lang/String/CompactString/SerializationTest.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/lang/String/CompactString/SerializationTest.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -24,14 +24,13 @@
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
-import static jdk.testlibrary.SerializationUtils.*;
+import static jdk.test.lib.util.SerializationUtils.*;
 import static org.testng.Assert.assertEquals;
 
 /*
  * @test
  * @bug 8077559
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SerializationUtils
+ * @library /test/lib
  * @summary Tests Compact String. This one is testing String serialization
  *          among -XX:+CompactStrings/-XX:-CompactStrings/LegacyString
  * @run testng/othervm -XX:+CompactStrings SerializationTest
--- a/jdk/test/java/lang/StringBuffer/CompactStringBufferSerialization.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/lang/StringBuffer/CompactStringBufferSerialization.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -26,14 +26,13 @@
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
-import static jdk.testlibrary.SerializationUtils.*;
+import static jdk.test.lib.util.SerializationUtils.*;
 import static org.testng.Assert.*;
 
 /*
  * @test
  * @bug 8077559
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SerializationUtils
+ * @library /test/lib
  * @summary Tests Compact String. This one is testing StringBuffer serialization
  *          among -XX:+CompactStrings/-XX:-CompactStrings/LegacyStringBuffer
  * @run testng/othervm -XX:+CompactStrings CompactStringBufferSerialization
--- a/jdk/test/java/lang/StringBuilder/CompactStringBuilderSerialization.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/lang/StringBuilder/CompactStringBuilderSerialization.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -26,14 +26,13 @@
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
-import static jdk.testlibrary.SerializationUtils.*;
+import static jdk.test.lib.util.SerializationUtils.*;
 import static org.testng.Assert.*;
 
 /*
  * @test
  * @bug 8077559
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SerializationUtils
+ * @library /test/lib
  * @summary Tests Compact String. This one is testing StringBuilder serialization
  *          among -XX:+CompactStrings/-XX:-CompactStrings/LegacyStringBuilder
  * @run testng/othervm -XX:+CompactStrings CompactStringBuilderSerialization
--- a/jdk/test/java/lang/Thread/ThreadStateController.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/lang/Thread/ThreadStateController.java	Thu May 25 22:33:25 2017 +0000
@@ -27,7 +27,7 @@
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.locks.LockSupport;
 
-import jdk.testlibrary.LockFreeLogManager;
+import jdk.test.lib.LockFreeLogger;
 import jdk.testlibrary.Utils;
 
 /**
@@ -100,7 +100,7 @@
     private final AtomicInteger iterations = new AtomicInteger();
     private final AtomicInteger interrupted = new AtomicInteger();
 
-    private final LockFreeLogManager logManager = new LockFreeLogManager();
+    private final LockFreeLogger logger = new LockFreeLogger();
 
     @Override
     public void run() {
@@ -349,7 +349,7 @@
     }
 
     private void log(String msg, Object ... params) {
-        logManager.log(msg, params);
+        logger.log(msg, params);
     }
 
     /**
@@ -361,6 +361,6 @@
     public String getLog() throws InterruptedException {
         this.join();
 
-        return logManager.toString();
+        return logger.toString();
     }
 }
--- a/jdk/test/java/lang/Thread/ThreadStateTest.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/lang/Thread/ThreadStateTest.java	Thu May 25 22:33:25 2017 +0000
@@ -31,6 +31,7 @@
  *
  * @author  Mandy Chung
  * @library /lib/testlibrary
+ * @library /test/lib
  * @build jdk.testlibrary.*
  * @build ThreadStateTest ThreadStateController
  * @run main/othervm -Xmixed ThreadStateTest
--- a/jdk/test/java/lang/annotation/AnnotationType/AnnotationTypeRuntimeAssumptionTest.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/lang/annotation/AnnotationType/AnnotationTypeRuntimeAssumptionTest.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -25,8 +25,6 @@
  * @test
  * @summary Test consistent parsing of ex-RUNTIME annotations that
  *          were changed and separately compiled to have CLASS retention
- * @library /lib/testlibrary
- * @build jdk.testlibrary.IOUtils
  * @run main AnnotationTypeRuntimeAssumptionTest
  */
 
@@ -35,8 +33,6 @@
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 
-import jdk.testlibrary.IOUtils;
-
 import static java.lang.annotation.RetentionPolicy.CLASS;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
@@ -140,7 +136,7 @@
                 String altPath = altName.replace('.', '/').concat(".class");
                 try (InputStream is = getResourceAsStream(altPath)) {
                     if (is != null) {
-                        byte[] bytes = IOUtils.readFully(is);
+                        byte[] bytes = is.readAllBytes();
                         // patch class bytes to contain original name
                         for (int i = 0; i < bytes.length - 2; i++) {
                             if (bytes[i] == '_' &&
@@ -163,7 +159,7 @@
                 String path = name.replace('.', '/').concat(".class");
                 try (InputStream is = getResourceAsStream(path)) {
                     if (is != null) {
-                        byte[] bytes = IOUtils.readFully(is);
+                        byte[] bytes = is.readAllBytes();
                         return defineClass(name, bytes, 0, bytes.length);
                     }
                     else {
--- a/jdk/test/java/lang/invoke/lambda/LambdaClassLoaderSerialization.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/lang/invoke/lambda/LambdaClassLoaderSerialization.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -25,8 +25,6 @@
  * @test
  * @bug 8004970
  * @summary Lambda serialization in the presence of class loaders
- * @library /lib/testlibrary
- * @build jdk.testlibrary.IOUtils
  * @run main LambdaClassLoaderSerialization
  * @author Peter Levart
  */
@@ -38,9 +36,6 @@
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
-import java.util.Arrays;
-
-import jdk.testlibrary.IOUtils;
 
 public class LambdaClassLoaderSerialization {
 
@@ -130,7 +125,7 @@
             String path = name.replace('.', '/').concat(".class");
             try (InputStream is = getResourceAsStream(path)) {
                 if (is != null) {
-                    byte[] bytes = IOUtils.readFully(is);
+                    byte[] bytes = is.readAllBytes();
                     return defineClass(name, bytes, 0, bytes.length);
                 } else {
                     throw new ClassNotFoundException(name);
--- a/jdk/test/java/lang/management/ThreadMXBean/Locks.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/lang/management/ThreadMXBean/Locks.java	Thu May 25 22:33:25 2017 +0000
@@ -29,17 +29,17 @@
  * @author  Mandy Chung
  * @author  Jaroslav Bachorik
  *
- * @library /lib/testlibrary
+ * @library /test/lib
  *
- * @build jdk.testlibrary.*
  * @run main/othervm Locks
  */
 import java.lang.management.*;
 import java.util.Arrays;
+import java.util.Objects;
 import java.util.Optional;
 import java.util.concurrent.Phaser;
 import java.util.function.Predicate;
-import jdk.testlibrary.LockFreeLogManager;
+import jdk.test.lib.LockFreeLogger;
 
 public class Locks {
 
@@ -47,7 +47,7 @@
     private static final Object OBJB = new Object();
     private static final EnhancedWaiter OBJC = new EnhancedWaiter();
     private static final ThreadMXBean TM = ManagementFactory.getThreadMXBean();
-    private static final LockFreeLogManager LOGGER = new LockFreeLogManager();
+    private static final LockFreeLogger LOGGER = new LockFreeLogger();
 
     private static String getLockName(Object lock) {
         if (lock == null) return null;
@@ -60,12 +60,12 @@
         if (t == null) {
             return;
         }
-        Optional<ThreadInfo> result = Arrays.asList(
-                TM.getThreadInfo(TM.getAllThreadIds(), true, true)).
-                stream().
-                filter(tInfo -> (tInfo != null && tInfo.getLockOwnerName() != null)
-                        ? tInfo.getLockOwnerName().equals(t.getName()) : false).
-                findAny();
+        String name = t.getName();
+        Optional<ThreadInfo> result = Arrays.stream(
+                TM.getThreadInfo(TM.getAllThreadIds(), true, true))
+                                            .filter(Objects::nonNull)
+                                            .filter(i -> name.equals(i.getLockOwnerName()))
+                                            .findAny();
         if (result.isPresent()) {
             throw new RuntimeException("Thread " + t.getName() + " is not "
                     + "supposed to be hold any lock. Currently owning lock : "
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java	Thu May 25 22:33:25 2017 +0000
@@ -31,6 +31,7 @@
  *
  * @library ../../Thread
  * @library /lib/testlibrary
+ * @library /test/lib
  *
  * @build jdk.testlibrary.*
  * @build ThreadMXBeanStateTest ThreadStateController
--- a/jdk/test/java/lang/reflect/Method/InterfaceStatic/StaticInterfaceMethodInWayOfDefault.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/lang/reflect/Method/InterfaceStatic/StaticInterfaceMethodInWayOfDefault.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -27,19 +27,14 @@
  * @summary Test that a static method on an interface doesn't hide a default
  *          method with the same name and signature in a separate compilation
  *          scenario.
- * @library /lib/testlibrary
- * @build jdk.testlibrary.IOUtils
  * @run main StaticInterfaceMethodInWayOfDefault
  */
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.concurrent.Callable;
 
-import jdk.testlibrary.IOUtils;
-
 public class StaticInterfaceMethodInWayOfDefault {
     public interface A_v1 {
     }
@@ -147,7 +142,7 @@
                 String altPath = altName.replace('.', '/').concat(".class");
                 try (InputStream is = getResourceAsStream(altPath)) {
                     if (is != null) {
-                        byte[] bytes = IOUtils.readFully(is);
+                        byte[] bytes = is.readAllBytes();
                         // patch class bytes to contain original name
                         for (int i = 0; i < bytes.length - 2; i++) {
                             if (bytes[i] == '_' &&
@@ -170,7 +165,7 @@
                 String path = name.replace('.', '/').concat(".class");
                 try (InputStream is = getResourceAsStream(path)) {
                     if (is != null) {
-                        byte[] bytes = IOUtils.readFully(is);
+                        byte[] bytes = is.readAllBytes();
                         return defineClass(name, bytes, 0, bytes.length);
                     }
                     else {
--- a/jdk/test/java/net/Inet6Address/B6206527.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/net/Inet6Address/B6206527.java	Thu May 25 22:33:25 2017 +0000
@@ -25,14 +25,13 @@
  * @test 1.1 05/01/05
  * @bug 6206527
  * @summary "cannot assign address" when binding ServerSocket on Suse 9
- * @library /lib/testlibrary
- * @build jdk.testlibrary.NetworkConfiguration
+ * @library /test/lib
  * @run main B6206527
  */
 
 import java.net.*;
 import java.util.*;
-import jdk.testlibrary.NetworkConfiguration;
+import jdk.test.lib.NetworkConfiguration;
 
 public class B6206527 {
 
--- a/jdk/test/java/net/Inet6Address/B6558853.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/net/Inet6Address/B6558853.java	Thu May 25 22:33:25 2017 +0000
@@ -25,8 +25,7 @@
  * @test
  * @bug 6558853
  * @summary  getHostAddress() on connections using IPv6 link-local addrs should have zone id
- * @library /lib/testlibrary
- * @build jdk.testlibrary.NetworkConfiguration
+ * @library /test/lib
  * @run main B6558853
  */
 
@@ -35,7 +34,7 @@
 import java.io.OutputStream;
 import java.net.*;
 import java.util.Optional;
-import jdk.testlibrary.NetworkConfiguration;
+import jdk.test.lib.NetworkConfiguration;
 
 public class B6558853 implements Runnable {
     private InetAddress addr = null;
--- a/jdk/test/java/net/InetAddress/CheckJNI.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/net/InetAddress/CheckJNI.java	Thu May 25 22:33:25 2017 +0000
@@ -22,17 +22,16 @@
  */
 
 /* @test
-   @bug 4889870 4890033
-   @summary java -Xcheck:jni failing in net code on Solaris / [Datagram]Socket.getLocalAddress() failure
-   @library /lib/testlibrary
-   @build jdk.testlibrary.NetworkConfiguration
-   @run main/othervm -Xcheck:jni CheckJNI
-*/
+ * @bug 4889870 4890033
+ * @summary java -Xcheck:jni failing in net code on Solaris / [Datagram]Socket.getLocalAddress() failure
+ * @library /test/lib
+ * @run main/othervm -Xcheck:jni CheckJNI
+ */
 
 import java.net.*;
 import java.util.*;
 import java.util.stream.Collectors;
-import jdk.testlibrary.NetworkConfiguration;
+import jdk.test.lib.NetworkConfiguration;
 
 public class CheckJNI {
     static Socket s;
--- a/jdk/test/java/net/MulticastSocket/JoinLeave.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/net/MulticastSocket/JoinLeave.java	Thu May 25 22:33:25 2017 +0000
@@ -25,8 +25,7 @@
  * @test
  * @bug 4091811 4148753 4102731
  * @summary Test java.net.MulticastSocket joinGroup and leaveGroup
- * @library /lib/testlibrary
- * @build jdk.testlibrary.NetworkConfiguration
+ * @library /test/lib
  * @run main JoinLeave
  */
 
@@ -35,7 +34,7 @@
 import java.net.InetAddress;
 import java.net.MulticastSocket;
 import java.net.NetworkInterface;
-import jdk.testlibrary.NetworkConfiguration;
+import jdk.test.lib.NetworkConfiguration;
 
 public class JoinLeave {
 
--- a/jdk/test/java/net/MulticastSocket/SetLoopbackMode.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/net/MulticastSocket/SetLoopbackMode.java	Thu May 25 22:33:25 2017 +0000
@@ -25,14 +25,14 @@
  * @test
  * @bug 4686717
  * @summary Test MulticastSocket.setLoopbackMode
- * @library /lib/testlibrary
- * @build jdk.testlibrary.NetworkConfiguration
+ * @library /test/lib
  * @run main/othervm SetLoopbackMode
  */
+
 import java.net.*;
 import java.io.IOException;
 import java.util.Enumeration;
-import jdk.testlibrary.NetworkConfiguration;
+import jdk.test.lib.NetworkConfiguration;
 
 public class SetLoopbackMode {
 
--- a/jdk/test/java/net/MulticastSocket/SetOutgoingIf.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/net/MulticastSocket/SetOutgoingIf.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -40,6 +40,10 @@
         return osname.contains("Windows");
     }
 
+    static boolean isMacOS() {
+        return System.getProperty("os.name").contains("OS X");
+    }
+
     private static boolean hasIPv6() throws Exception {
         List<NetworkInterface> nics = Collections.list(
                                         NetworkInterface.getNetworkInterfaces());
@@ -71,7 +75,7 @@
         int index = 1;
         for (NetworkInterface nic : Collections.list(NetworkInterface.getNetworkInterfaces())) {
             // we should use only network interfaces with multicast support which are in "up" state
-            if (!nic.isLoopback() && nic.supportsMulticast() && nic.isUp()) {
+            if (!nic.isLoopback() && nic.supportsMulticast() && nic.isUp() && !isTestExcludedInterface(nic)) {
                 NetIf netIf = NetIf.create(nic);
 
                 // now determine what (if any) type of addresses are assigned to this interface
@@ -91,6 +95,8 @@
                     netIfs.add(netIf);
                     debug("Using: " + nic);
                 }
+            } else {
+                System.out.println("Ignore NetworkInterface nic == " + nic);
             }
         }
         if (netIfs.size() <= 1) {
@@ -170,6 +176,15 @@
         }
     }
 
+    private static boolean isTestExcludedInterface(NetworkInterface nif) {
+        if (isMacOS() && nif.getName().contains("awdl"))
+            return true;
+        String dName = nif.getDisplayName();
+        if (isWindows() && dName != null && dName.contains("Teredo"))
+            return true;
+        return false;
+    }
+
     private static boolean debug = true;
 
     static void debug(String message) {
--- a/jdk/test/java/net/NetworkConfigurationProbe.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/net/NetworkConfigurationProbe.java	Thu May 25 22:33:25 2017 +0000
@@ -24,15 +24,14 @@
 /**
  * @test
  * @summary NOT A TEST. Captures the network interface configuration.
- * @library /lib/testlibrary
- * @build jdk.testlibrary.NetworkConfiguration
+ * @library /test/lib
  * @run main NetworkConfigurationProbe
  */
 
 import java.net.Inet4Address;
 import java.net.Inet6Address;
 import java.net.NetworkInterface;
-import jdk.testlibrary.NetworkConfiguration;
+import jdk.test.lib.NetworkConfiguration;
 import static java.util.stream.Collectors.joining;
 import static java.lang.System.out;
 
--- a/jdk/test/java/net/ProxySelector/B8035158.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/net/ProxySelector/B8035158.java	Thu May 25 22:33:25 2017 +0000
@@ -158,8 +158,6 @@
         t.add(new TestCase("google.com|bing.com|yahoo.com", "http://127.0.0.1", false));
         t.add(new TestCase("google.com|bing.com|yahoo.com", "http://yahoo.com", false));
 
-        // example from
-        // http://docs.oracle.com/javase/7/docs/technotes/guides/net/proxies.html
         t.add(new TestCase("localhost|host.example.com", "http://localhost",
                 false));
         t.add(new TestCase("localhost|host.example.com",
--- a/jdk/test/java/net/Socket/LinkLocal.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/net/Socket/LinkLocal.java	Thu May 25 22:33:25 2017 +0000
@@ -26,11 +26,11 @@
  * @bug 4469866
  * @summary Connecting to a link-local IPv6 address should not
  *          causes a SocketException to be thrown.
- * @library /lib/testlibrary
- * @build jdk.testlibrary.NetworkConfiguration
+ * @library /test/lib
  * @run main LinkLocal
  */
-import jdk.testlibrary.NetworkConfiguration;
+
+import jdk.test.lib.NetworkConfiguration;
 
 import java.net.*;
 import java.util.List;
--- a/jdk/test/java/net/SocketPermission/SocketPermissionTest.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/net/SocketPermission/SocketPermissionTest.java	Thu May 25 22:33:25 2017 +0000
@@ -25,8 +25,7 @@
  * @test
  * @bug 8047031
  * @summary SocketPermission tests for legacy socket types
- * @library /lib/testlibrary
- * @build jdk.testlibrary.NetworkConfiguration
+ * @library /test/lib
  * @run testng/othervm SocketPermissionTest
  */
 
@@ -55,7 +54,7 @@
 
 import static org.testng.Assert.*;
 
-import static jdk.testlibrary.NetworkConfiguration.probe;
+import static jdk.test.lib.NetworkConfiguration.probe;
 import static java.nio.charset.StandardCharsets.UTF_8;
 
 public class SocketPermissionTest {
--- a/jdk/test/java/net/httpclient/whitebox/Driver.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/net/httpclient/whitebox/Driver.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -26,5 +26,6 @@
  * @bug 8151299 8164704
  * @modules jdk.incubator.httpclient
  * @run testng jdk.incubator.httpclient/jdk.incubator.http.SelectorTest
+ * @run testng jdk.incubator.httpclient/jdk.incubator.http.RawChannelTest
  * @run testng jdk.incubator.httpclient/jdk.incubator.http.ResponseHeadersTest
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/net/httpclient/whitebox/jdk.incubator.httpclient/jdk/incubator/http/RawChannelTest.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,287 @@
+/*
+ * 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.
+ *
+ * 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.incubator.http;
+
+import jdk.incubator.http.internal.websocket.RawChannel;
+import org.testng.annotations.Test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.UncheckedIOException;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.URI;
+import java.nio.ByteBuffer;
+import java.nio.channels.SelectionKey;
+import java.util.Random;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
+
+import static jdk.incubator.http.HttpResponse.BodyHandler.discard;
+import static org.testng.Assert.assertEquals;
+
+/*
+ * This test exercises mechanics of _independent_ reads and writes on the
+ * RawChannel. It verifies that the underlying implementation can manage more
+ * than a single type of notifications at the same time.
+ */
+public class RawChannelTest {
+
+    private final AtomicLong clientWritten = new AtomicLong();
+    private final AtomicLong serverWritten = new AtomicLong();
+    private final AtomicLong clientRead = new AtomicLong();
+    private final AtomicLong serverRead = new AtomicLong();
+
+    /*
+     * Since at this level we don't have any control over the low level socket
+     * parameters, this latch ensures a write to the channel will stall at least
+     * once (socket's send buffer filled up).
+     */
+    private final CountDownLatch writeStall = new CountDownLatch(1);
+
+    /*
+     * This one works similarly by providing means to ensure a read from the
+     * channel will stall at least once (no more data available on the socket).
+     */
+    private final CountDownLatch readStall = new CountDownLatch(1);
+
+    private final AtomicInteger writeHandles = new AtomicInteger();
+    private final AtomicInteger readHandles = new AtomicInteger();
+
+    private final CountDownLatch exit = new CountDownLatch(1);
+
+    @Test
+    public void test() throws Exception {
+        try (ServerSocket server = new ServerSocket(0)) {
+            int port = server.getLocalPort();
+            new TestServer(server).start();
+            final RawChannel chan = channelOf(port);
+
+            // It's very important not to forget the initial bytes, possibly
+            // left from the HTTP thingy
+            int initialBytes = chan.initialByteBuffer().remaining();
+            print("RawChannel has %s initial bytes", initialBytes);
+            clientRead.addAndGet(initialBytes);
+
+            chan.registerEvent(new RawChannel.RawEvent() {
+
+                private final ByteBuffer reusableBuffer = ByteBuffer.allocate(32768);
+
+                @Override
+                public int interestOps() {
+                    return SelectionKey.OP_WRITE;
+                }
+
+                @Override
+                public void handle() {
+                    int i = writeHandles.incrementAndGet();
+                    print("OP_WRITE #%s", i);
+                    if (i > 3) { // Fill up the send buffer not more than 3 times
+                        try {
+                            chan.shutdownOutput();
+                        } catch (IOException e) {
+                            e.printStackTrace();
+                        }
+                        return;
+                    }
+                    long total = 0;
+                    try {
+                        long n;
+                        do {
+                            ByteBuffer[] array = {reusableBuffer.slice()};
+                            n = chan.write(array, 0, 1);
+                            total += n;
+                        } while (n > 0);
+                        print("OP_WRITE clogged SNDBUF with %s bytes", total);
+                        clientWritten.addAndGet(total);
+                        chan.registerEvent(this);
+                        writeStall.countDown(); // signal send buffer is full
+                    } catch (IOException e) {
+                        throw new UncheckedIOException(e);
+                    }
+                }
+            });
+
+            chan.registerEvent(new RawChannel.RawEvent() {
+
+                @Override
+                public int interestOps() {
+                    return SelectionKey.OP_READ;
+                }
+
+                @Override
+                public void handle() {
+                    int i = readHandles.incrementAndGet();
+                    print("OP_READ #%s", i);
+                    ByteBuffer read = null;
+                    long total = 0;
+                    while (true) {
+                        try {
+                            read = chan.read();
+                        } catch (IOException e) {
+                            e.printStackTrace();
+                        }
+                        if (read == null) {
+                            print("OP_READ EOF");
+                            break;
+                        } else if (!read.hasRemaining()) {
+                            print("OP_READ stall");
+                            try {
+                                chan.registerEvent(this);
+                            } catch (IOException e) {
+                                e.printStackTrace();
+                            }
+                            readStall.countDown();
+                            break;
+                        }
+                        int r = read.remaining();
+                        total += r;
+                        clientRead.addAndGet(r);
+                    }
+                    print("OP_READ read %s bytes", total);
+                }
+            });
+            exit.await(); // All done, we need to compare results:
+            assertEquals(clientRead.get(), serverWritten.get());
+            assertEquals(serverRead.get(), clientWritten.get());
+        }
+    }
+
+    private static RawChannel channelOf(int port) throws Exception {
+        URI uri = URI.create("http://127.0.0.1:" + port + "/");
+        print("raw channel to %s", uri.toString());
+        HttpRequest req = HttpRequest.newBuilder(uri).build();
+        HttpResponse<?> r = HttpClient.newHttpClient().send(req, discard(null));
+        r.body();
+        return ((HttpResponseImpl) r).rawChannel();
+    }
+
+    private class TestServer extends Thread { // Powered by Slowpokes
+
+        private final ServerSocket server;
+
+        TestServer(ServerSocket server) throws IOException {
+            this.server = server;
+        }
+
+        @Override
+        public void run() {
+            try (Socket s = server.accept()) {
+                InputStream is = s.getInputStream();
+                OutputStream os = s.getOutputStream();
+
+                processHttp(is, os);
+
+                Thread reader = new Thread(() -> {
+                    try {
+                        long n = readSlowly(is);
+                        print("Server read %s bytes", n);
+                        serverRead.addAndGet(n);
+                        s.shutdownInput();
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                });
+
+                Thread writer = new Thread(() -> {
+                    try {
+                        long n = writeSlowly(os);
+                        print("Server written %s bytes", n);
+                        serverWritten.addAndGet(n);
+                        s.shutdownOutput();
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                });
+
+                reader.start();
+                writer.start();
+
+                reader.join();
+                writer.join();
+            } catch (Exception e) {
+                e.printStackTrace();
+            } finally {
+                exit.countDown();
+            }
+        }
+
+        private void processHttp(InputStream is, OutputStream os)
+                throws IOException
+        {
+            os.write("HTTP/1.1 200 OK\r\nContent-length: 0\r\n\r\n".getBytes());
+            byte[] buf = new byte[1024];
+            String s = "";
+            while (true) {
+                int n = is.read(buf);
+                if (n <= 0) {
+                    throw new RuntimeException("Unexpected end of request");
+                }
+                s = s + new String(buf, 0, n);
+                if (s.contains("\r\n\r\n")) {
+                    break;
+                }
+            }
+        }
+
+        private long writeSlowly(OutputStream os) throws Exception {
+            byte[] first = byteArrayOfSize(1024);
+            long total = first.length;
+            os.write(first);
+            // Let's wait for the signal from the raw channel that its read has
+            // stalled, and then continue sending a bit more stuff
+            readStall.await();
+            for (int i = 0; i < 32; i++) {
+                byte[] b = byteArrayOfSize(1024);
+                os.write(b);
+                total += b.length;
+                TimeUnit.MILLISECONDS.sleep(1);
+            }
+            return total;
+        }
+
+        private long readSlowly(InputStream is) throws Exception {
+            // Wait for the raw channel to fill up the its send buffer
+            writeStall.await();
+            long overall = 0;
+            byte[] array = new byte[1024];
+            for (int n = 0; n != -1; n = is.read(array)) {
+                TimeUnit.MILLISECONDS.sleep(1);
+                overall += n;
+            }
+            return overall;
+        }
+    }
+
+    private static void print(String format, Object... args) {
+        System.out.println(Thread.currentThread() + ": " + String.format(format, args));
+    }
+
+    private static byte[] byteArrayOfSize(int bound) {
+        return new byte[new Random().nextInt(1 + bound)];
+    }
+}
--- a/jdk/test/java/net/ipv6tests/B6521014.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/net/ipv6tests/B6521014.java	Thu May 25 22:33:25 2017 +0000
@@ -25,15 +25,14 @@
  * @test
  * @bug 6521014 6543428
  * @summary IOException thrown when Socket tries to bind to an local IPv6 address on SuSE Linux
- * @library /lib/testlibrary
- * @build jdk.testlibrary.NetworkConfiguration
+ * @library /test/lib
  * @run main B6521014
  */
 
 import java.net.*;
 import java.io.*;
 import java.util.*;
-import jdk.testlibrary.NetworkConfiguration;
+import jdk.test.lib.NetworkConfiguration;
 
 /*
  *
--- a/jdk/test/java/nio/channels/DatagramChannel/BasicMulticastTests.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/nio/channels/DatagramChannel/BasicMulticastTests.java	Thu May 25 22:33:25 2017 +0000
@@ -24,7 +24,8 @@
 /* @test
  * @bug 4527345
  * @summary Unit test for DatagramChannel's multicast support
- * @build BasicMulticastTests NetworkConfiguration
+ * @library /test/lib
+ * @build BasicMulticastTests
  * @run main BasicMulticastTests
  */
 
@@ -34,6 +35,8 @@
 import java.util.*;
 import java.io.IOException;
 
+import jdk.test.lib.NetworkConfiguration;
+
 public class BasicMulticastTests {
 
     /**
@@ -204,14 +207,14 @@
 
         NetworkConfiguration config = NetworkConfiguration.probe();
 
-        NetworkInterface nif = config.ip4Interfaces().iterator().next();
+        NetworkInterface nif = config.ip4MulticastInterfaces().iterator().next();
         InetAddress anySource = config.ip4Addresses(nif).iterator().next();
         membershipKeyTests(nif, ip4Group, anySource);
         exceptionTests(nif);
 
         // re-run the membership key tests with IPv6 if available
 
-        Iterator<NetworkInterface> iter = config.ip6Interfaces().iterator();
+        Iterator<NetworkInterface> iter = config.ip6MulticastInterfaces().iterator();
         if (iter.hasNext()) {
             nif = iter.next();
             anySource = config.ip6Addresses(nif).iterator().next();
--- a/jdk/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java	Thu May 25 22:33:25 2017 +0000
@@ -24,7 +24,8 @@
 /* @test
  * @bug 4527345 7026376 6633549
  * @summary Unit test for DatagramChannel's multicast support
- * @build MulticastSendReceiveTests NetworkConfiguration
+ * @library /test/lib
+ * @build MulticastSendReceiveTests
  * @run main MulticastSendReceiveTests
  * @run main/othervm -Djava.net.preferIPv4Stack=true MulticastSendReceiveTests
  * @key randomness
@@ -36,6 +37,9 @@
 import static java.net.StandardProtocolFamily.*;
 import java.util.*;
 import java.io.IOException;
+import java.util.stream.Collectors;
+
+import jdk.test.lib.NetworkConfiguration;
 
 public class MulticastSendReceiveTests {
 
@@ -238,14 +242,15 @@
         // multicast groups used for the test
         InetAddress ip4Group = InetAddress.getByName("225.4.5.6");
         InetAddress ip6Group = InetAddress.getByName("ff02::a");
-
-        for (NetworkInterface nif: config.ip4Interfaces()) {
+        for (NetworkInterface nif: config.ip4MulticastInterfaces()
+                                         .collect(Collectors.toList())) {
             InetAddress source = config.ip4Addresses(nif).iterator().next();
             test(INET,   nif, ip4Group, source);
             test(UNSPEC, nif, ip4Group, source);
         }
 
-        for (NetworkInterface nif: config.ip6Interfaces()) {
+        for (NetworkInterface nif: config.ip6MulticastInterfaces()
+                                         .collect(Collectors.toList())) {
             InetAddress source = config.ip6Addresses(nif).iterator().next();
             test(INET6,  nif, ip6Group, source);
             test(UNSPEC, nif, ip6Group, source);
--- a/jdk/test/java/nio/channels/DatagramChannel/NetworkConfiguration.java	Thu May 25 15:27:40 2017 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-
-import java.net.*;
-import java.util.*;
-import java.io.IOException;
-
-/**
- * Helper class for multicasting tests.
- */
-
-class NetworkConfiguration {
-
-    private Map<NetworkInterface,List<InetAddress>> ip4Interfaces;
-    private Map<NetworkInterface,List<InetAddress>> ip6Interfaces;
-
-    private NetworkConfiguration(Map<NetworkInterface,List<InetAddress>> ip4Interfaces,
-                                 Map<NetworkInterface,List<InetAddress>> ip6Interfaces)
-    {
-        this.ip4Interfaces = ip4Interfaces;
-        this.ip6Interfaces = ip6Interfaces;
-    }
-
-    Iterable<NetworkInterface> ip4Interfaces() {
-        return ip4Interfaces.keySet();
-    }
-
-    Iterable<NetworkInterface> ip6Interfaces() {
-        return ip6Interfaces.keySet();
-    }
-
-    Iterable<InetAddress> ip4Addresses(NetworkInterface nif) {
-        return ip4Interfaces.get(nif);
-    }
-
-    Iterable<InetAddress> ip6Addresses(NetworkInterface nif) {
-        return ip6Interfaces.get(nif);
-    }
-
-    private static final boolean isMacOs =
-            System.getProperty("os.name").equals("Mac OS X");
-
-    static NetworkConfiguration probe() throws IOException {
-        Map<NetworkInterface,List<InetAddress>> ip4Interfaces =
-            new HashMap<NetworkInterface,List<InetAddress>>();
-        Map<NetworkInterface,List<InetAddress>> ip6Interfaces =
-            new HashMap<NetworkInterface,List<InetAddress>>();
-
-        // find the interfaces that support IPv4 and IPv6
-        List<NetworkInterface> nifs = Collections
-            .list(NetworkInterface.getNetworkInterfaces());
-        for (NetworkInterface nif: nifs) {
-            // ignore intertaces that are down or don't support multicast
-            if (!nif.isUp() || !nif.supportsMulticast() || nif.isLoopback()
-                || (isMacOs && nif.getName().contains("awdl")))
-                continue;
-
-            List<InetAddress> addrs = Collections.list(nif.getInetAddresses());
-            for (InetAddress addr: addrs) {
-                if (!addr.isAnyLocalAddress()) {
-                    if (addr instanceof Inet4Address) {
-                        List<InetAddress> list = ip4Interfaces.get(nif);
-                        if (list == null) {
-                            list = new LinkedList<InetAddress>();
-                        }
-                        list.add(addr);
-                        ip4Interfaces.put(nif, list);
-                    } else if (addr instanceof Inet6Address) {
-                        List<InetAddress> list = ip6Interfaces.get(nif);
-                        if (list == null) {
-                            list = new LinkedList<InetAddress>();
-                        }
-                        list.add(addr);
-                        ip6Interfaces.put(nif, list);
-                    }
-                }
-            }
-        }
-        return new NetworkConfiguration(ip4Interfaces, ip6Interfaces);
-    }
-}
--- a/jdk/test/java/nio/channels/DatagramChannel/Promiscuous.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/nio/channels/DatagramChannel/Promiscuous.java	Thu May 25 22:33:25 2017 +0000
@@ -25,7 +25,8 @@
  * @bug 8014377
  * @summary Test for interference when two sockets are bound to the same
  *   port but joined to different multicast groups
- * @build Promiscuous  NetworkConfiguration
+ * @library /test/lib
+ * @build Promiscuous
  * @run main Promiscuous
  * @run main/othervm -Djava.net.preferIPv4Stack=true Promiscuous
  * @key randomness
@@ -37,6 +38,9 @@
 import static java.net.StandardProtocolFamily.*;
 import java.util.*;
 import java.io.IOException;
+import java.util.stream.Collectors;
+
+import jdk.test.lib.NetworkConfiguration;
 
 public class Promiscuous {
 
@@ -208,7 +212,8 @@
         InetAddress ip4Group1 = InetAddress.getByName("225.4.5.6");
         InetAddress ip4Group2 = InetAddress.getByName("225.4.6.6");
 
-        for (NetworkInterface nif: config.ip4Interfaces()) {
+        for (NetworkInterface nif: config.ip4MulticastInterfaces()
+                                         .collect(Collectors.toList())) {
             InetAddress source = config.ip4Addresses(nif).iterator().next();
             test(INET, nif, ip4Group1, ip4Group2);
 
--- a/jdk/test/java/nio/channels/SocketChannel/VectorIO.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/java/nio/channels/SocketChannel/VectorIO.java	Thu May 25 22:33:25 2017 +0000
@@ -87,8 +87,11 @@
         while (rem > 0L) {
             long bytesWritten = sc.write(bufs);
             if (bytesWritten == 0) {
-                if (sc.isBlocking())
+                if (sc.isBlocking()) {
                     throw new RuntimeException("write did not block");
+                } else {
+                    System.err.println("Non-blocking write() wrote zero bytes");
+                }
                 Thread.sleep(50);
             } else {
                 rem -= bytesWritten;
@@ -140,8 +143,10 @@
 
                 for (;;) {
                     sc = ssc.accept();
-                    if (sc != null)
+                    if (sc != null) {
+                        System.err.println("accept() succeeded");
                         break;
+                    }
                     Thread.sleep(50);
                 }
 
@@ -154,8 +159,12 @@
                     if (bytesRead < 0)
                         break;
                     if (bytesRead == 0) {
-                        if (sc.isBlocking())
+                        if (sc.isBlocking()) {
                             throw new RuntimeException("read did not block");
+                        } else {
+                            System.err.println
+                                ("Non-blocking read() read zero bytes");
+                        }
                         Thread.sleep(50);
                     }
                     avail -= bytesRead;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/text/Format/DecimalFormat/Bug6609740.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,129 @@
+/*
+ * 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.
+ *
+ * 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 6609740
+ * @summary Checks the formatting and parsing of a number based
+ *          on the positive and negative sub-patterns, also
+ *          checks few invalid number patterns
+ */
+import java.text.DecimalFormat;
+import java.text.NumberFormat;
+import java.text.ParseException;
+import java.util.Locale;
+
+public class Bug6609740 {
+
+    public static void main(String[] args) {
+
+        double dNumber = -3456.349347;
+        String fOutput = "(3,456.35)";
+        String[] validCases = {"#,##0.0#;(#,##0.0#)", "#,##0.0#;(#)",
+            "#,##0.0#;(#,##0)"};
+
+        // formatting with the valid cases
+        NumberFormat nf = NumberFormat.getInstance(Locale.US);
+        for (String pattern : validCases) {
+            formatOnPattern(nf, pattern, dNumber, fOutput);
+        }
+
+        // parsing with the valid cases
+        String parseString = "(3,456.35)";
+        Number pOutput = -3456.35;
+        for (String pattern : validCases) {
+            parseOnPattern(nf, pattern, parseString, pOutput);
+        }
+
+        // should throw parse exception
+        String[] invalidParseCases = {"#,##0.0#;0", "#,##0.0#;()"};
+        for (String pattern : invalidParseCases) {
+            if (nf instanceof DecimalFormat) {
+                ((DecimalFormat) nf).applyPattern(pattern);
+            }
+
+            try {
+                nf.parse(parseString);
+            } catch (ParseException ex) {
+                continue;
+            }
+            throw new RuntimeException("[FAILED: Should throw"
+                    + " ParseException for pattern: "
+                    + pattern + " and input: " + parseString + "]");
+        }
+
+        // should throw exception on invalid patterns
+        // invalid patterns: no positive subpattern, zero after non-zero in
+        // the decimal part i.e. 0#0, multiple decimal separators,
+        // multiple percent, malformed pattern
+        String[] invalidPatterns = {";(#,##0.0#)", "#,##0.0#0;(#)",
+            "#,##0.0.#", "#,##0%%", ".#,##0"};
+        for (String pattern : invalidPatterns) {
+            if (nf instanceof DecimalFormat) {
+                try {
+                    ((DecimalFormat) nf).applyPattern(pattern);
+                } catch (IllegalArgumentException ex) {
+                    continue;
+                }
+                throw new RuntimeException("[FAILED: Should throw"
+                        + " IllegalArgumentException for invalid pattern: "
+                        + pattern + "]");
+            }
+        }
+    }
+
+    private static void formatOnPattern(NumberFormat nf, String pattern,
+            double number, String expected) {
+
+        if (nf instanceof DecimalFormat) {
+            ((DecimalFormat) nf).applyPattern(pattern);
+        }
+
+        String formatted = nf.format(number);
+        if (!formatted.equals(expected)) {
+            throw new RuntimeException("[FAILED: Unable to format the number"
+                    + " based on the pattern: '" + pattern + "', Expected : '"
+                    + expected + "', Found: '" + formatted + "']");
+        }
+    }
+
+    private static void parseOnPattern(NumberFormat nf, String pattern,
+            String parseString, Number expected) {
+
+        if (nf instanceof DecimalFormat) {
+            ((DecimalFormat) nf).applyPattern(pattern);
+        }
+
+        try {
+            Number output = nf.parse(parseString);
+            if (expected.doubleValue() != output.doubleValue()) {
+                throw new RuntimeException("[FAILED: Unable to parse the number"
+                        + " based on the pattern: '" + pattern + "', Expected : '"
+                        + expected + "', Found: '" + output + "']");
+            }
+        } catch (ParseException ex) {
+            throw new RuntimeException("[FAILED: Unable to parse the pattern:"
+                    + " '" + pattern + "']", ex);
+        }
+    }
+
+}
--- a/jdk/test/lib/testlibrary/ModuleInfoMaker.java	Thu May 25 15:27:40 2017 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +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.BufferedWriter;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.Arrays;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Stream;
-
-import static org.testng.Assert.assertTrue;
-
-/**
- * Utility class for creating test modules.
- */
-public class ModuleInfoMaker {
-    private static String MODULE_INFO_JAVA = "module-info.java";
-    private static Pattern MODULE_PATTERN =
-        Pattern.compile("module\\s+((?:\\w+\\.)*)");
-    private static Pattern PACKAGE_PATTERN =
-                       Pattern.compile("package\\s+(((?:\\w+\\.)*)(?:\\w+))");
-    private static Pattern CLASS_PATTERN =
-          Pattern.compile("(?:public\\s+)?(?:class|enum|interface)\\s+(\\w+)");
-
-    private final Path dir;
-    public ModuleInfoMaker(Path dir) {
-        this.dir = dir;
-    }
-
-    /**
-     * Create java source files of the given module
-     */
-    public void writeJavaFiles(String module, String moduleInfoJava, String... contents)
-        throws IOException
-    {
-        Path msrc = dir.resolve(module);
-        new JavaSource(moduleInfoJava).write(msrc);
-        for (String c : contents) {
-            new JavaSource(c).write(msrc);
-        }
-    }
-
-    /**
-     * Compile the module to the given destination.
-     */
-    public void compile(String module, Path dest, String... options)
-        throws IOException
-    {
-        Path msrc = dir.resolve(module);
-        Stream<String> args =
-            Stream.concat(Arrays.stream(options),
-                          Stream.of("--module-source-path",
-                                    dir.toString()));
-        assertTrue(CompilerUtils.compile(msrc, dest, args.toArray(String[]::new)),
-                   "Fail to compile " + module);
-    }
-
-    static class JavaSource {
-        final String source;
-        JavaSource(String source) {
-            this.source = source;
-        }
-
-        /**
-         * Writes the source code to a file in a specified directory.
-         * @param dir the directory
-         * @throws IOException if there is a problem writing the file
-         */
-        public void write(Path dir) throws IOException {
-            Path file = dir.resolve(getJavaFileNameFromSource(source));
-            Files.createDirectories(file.getParent());
-            try (BufferedWriter out = Files.newBufferedWriter(file)) {
-                out.write(source.replace("\n", System.lineSeparator()));
-            }
-        }
-
-        /**
-         * Extracts the Java file name from the class declaration.
-         * This method is intended for simple files and uses regular expressions,
-         * so comments matching the pattern can make the method fail.
-         */
-        static String getJavaFileNameFromSource(String source) {
-            String packageName = null;
-
-            Matcher matcher = MODULE_PATTERN.matcher(source);
-            if (matcher.find())
-                return MODULE_INFO_JAVA;
-
-            matcher = PACKAGE_PATTERN.matcher(source);
-            if (matcher.find())
-                packageName = matcher.group(1).replace(".", "/");
-
-            matcher = CLASS_PATTERN.matcher(source);
-            if (matcher.find()) {
-                String className = matcher.group(1) + ".java";
-                return (packageName == null) ? className : packageName + "/" + className;
-            } else if (packageName != null) {
-                return packageName + "/package-info.java";
-            } else {
-                throw new Error("Could not extract the java class " +
-                    "name from the provided source");
-            }
-        }
-    }
-}
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/FilterClassLoader.java	Thu May 25 15:27:40 2017 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * 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.testlibrary;
-
-import java.util.function.Predicate;
-/**
- * A classloader, which using target classloader in case provided condition
- * for class name is met, and using parent otherwise
- */
-public class FilterClassLoader extends ClassLoader {
-
-    private final ClassLoader target;
-    private final Predicate<String> condition;
-
-    public FilterClassLoader(ClassLoader target, ClassLoader parent,
-            Predicate<String> condition) {
-        super(parent);
-        this.condition = condition;
-        this.target = target;
-    }
-
-    @Override
-    public Class<?> loadClass(String name) throws ClassNotFoundException {
-        if (condition.test(name)) {
-            return target.loadClass(name);
-        }
-        return super.loadClass(name);
-    }
-}
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/IOUtils.java	Thu May 25 15:27:40 2017 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * 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.testlibrary;
-
-/**
- * Defines useful I/O methods.
- */
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Arrays;
-
-public final class IOUtils {
-
-    /*
-     * Prevent instantiation.
-     */
-    private IOUtils() {}
-
-    /**
-     * Read all bytes from <code>in</code>
-     * until EOF is detected.
-     * @param in input stream, must not be null
-     * @return bytes read
-     * @throws IOException Any IO error.
-     */
-    public static byte[] readFully(InputStream is) throws IOException {
-        byte[] output = {};
-        int pos = 0;
-        while (true) {
-            int bytesToRead;
-            if (pos >= output.length) { // Only expand when there's no room
-                bytesToRead = output.length + 1024;
-                if (output.length < pos + bytesToRead) {
-                    output = Arrays.copyOf(output, pos + bytesToRead);
-                }
-            } else {
-                bytesToRead = output.length - pos;
-            }
-            int cc = is.read(output, pos, bytesToRead);
-            if (cc < 0) {
-                if (output.length != pos) {
-                    output = Arrays.copyOf(output, pos);
-                }
-                break;
-            }
-            pos += cc;
-        }
-        return output;
-    }
-}
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/LockFreeLogManager.java	Thu May 25 15:27:40 2017 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * 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.testlibrary;
-
-import java.util.Collection;
-import java.util.Formatter;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.stream.Collectors;
-
-/**
- * A log manager designed specifically to allow collecting ordered log messages
- * in a multi-threaded environment without involving any kind of locking.
- * <p>
- * It is particularly useful in situations when one needs to assert various
- * details about the tested thread state or the locks it hold while also wanting
- * to produce diagnostic log messages.
- * <p>
- * The log manager does not provide any guarantees about the completness of the
- * logs written from different threads - it is up to the caller to make sure
- * {@code toString()} method is called only when all the activity has ceased
- * and the per-thread logs contain all the necessary data.
- *
- * @author Jaroslav Bachorik
- **/
-public class LockFreeLogManager {
-    private final AtomicInteger logCntr = new AtomicInteger(0);
-    private final Collection<Map<Integer, String>> allRecords = new ConcurrentLinkedQueue<>();
-    private final ThreadLocal<Map<Integer, String>> records = new ThreadLocal<Map<Integer, String>>() {
-        @Override
-        protected Map<Integer, String> initialValue() {
-            Map<Integer, String> m = new ConcurrentHashMap<>();
-            allRecords.add(m);
-            return m;
-        }
-
-    };
-
-    /**
-     * Log a message
-     * @param format Message format
-     * @param params Message parameters
-     */
-    public void log(String format, Object ... params) {
-        int id = logCntr.getAndIncrement();
-        try (Formatter formatter = new Formatter()) {
-            records.get().put(id, formatter.format(format, params).toString());
-        }
-    }
-
-    /**
-     * Will generate an aggregated log of chronologically ordered messages.
-     * <p>
-     * Make sure that you call this method only when all the related threads
-     * have finished; otherwise you might get incomplete data.
-     *
-     * @return An aggregated log of chronologically ordered messages
-     */
-    @Override
-    public String toString() {
-        return allRecords.stream()
-            .flatMap(m->m.entrySet().stream())
-            .sorted((l, r)->l.getKey().compareTo(r.getKey()))
-            .map(e->e.getValue())
-            .collect(Collectors.joining());
-    }
-}
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/NetworkConfiguration.java	Thu May 25 15:27:40 2017 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,267 +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.
- *
- * 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.testlibrary;
-
-import java.io.PrintStream;
-import java.io.UncheckedIOException;
-import java.io.IOException;
-import java.net.Inet4Address;
-import java.net.Inet6Address;
-import java.net.InetAddress;
-import java.net.NetworkInterface;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.function.Predicate;
-import java.util.stream.Stream;
-import static java.net.NetworkInterface.getNetworkInterfaces;
-import static java.util.Collections.list;
-
-/**
- * Helper class for retrieving network interfaces and local addresses
- * suitable for testing.
- */
-public class NetworkConfiguration {
-
-    static final boolean isWindows =
-            System.getProperty("os.name").startsWith("Windows");
-    static final boolean isMacOS =
-            System.getProperty("os.name").contains("OS X");
-
-    private Map<NetworkInterface,List<Inet4Address>> ip4Interfaces;
-    private Map<NetworkInterface,List<Inet6Address>> ip6Interfaces;
-
-    private NetworkConfiguration(Map<NetworkInterface,List<Inet4Address>> ip4Interfaces,
-                                 Map<NetworkInterface,List<Inet6Address>> ip6Interfaces)
-    {
-        this.ip4Interfaces = ip4Interfaces;
-        this.ip6Interfaces = ip6Interfaces;
-    }
-
-    /**
-     * Returns a stream of interfaces suitable for functional tests.
-     */
-    public Stream<NetworkInterface> interfaces() {
-        return Stream.concat(ip4Interfaces(), ip6Interfaces())
-                     .distinct();
-    }
-
-    /**
-     * Returns a stream of interfaces suitable for IPv4 functional tests.
-     */
-    public Stream<NetworkInterface> ip4Interfaces() {
-        return ip4Interfaces.keySet().stream()
-                .filter(NetworkConfiguration::isNotExcludedInterface)
-                .filter(hasIp4Addresses);
-    }
-
-    /**
-     * Returns a stream of interfaces suitable for IPv6 functional tests.
-     */
-    public Stream<NetworkInterface> ip6Interfaces() {
-        return ip6Interfaces.keySet().stream()
-                .filter(NetworkConfiguration::isNotExcludedInterface)
-                .filter(hasIp6Addresses);
-    }
-
-    private static boolean isNotExcludedInterface(NetworkInterface nif) {
-        if (isMacOS && nif.getName().contains("awdl"))
-            return false;
-        String dName = nif.getDisplayName();
-        if (isWindows && dName != null && dName.contains("Teredo"))
-            return false;
-        return true;
-    }
-
-    private final Predicate<NetworkInterface> hasIp4Addresses = nif -> {
-        Optional<?> addr = ip4Interfaces.get(nif).stream()
-                .filter(a -> !a.isAnyLocalAddress())
-                .findAny();
-
-        return addr.isPresent();
-    };
-
-    private final Predicate<NetworkInterface> hasIp6Addresses = nif -> {
-        Optional<?> addr = ip6Interfaces.get(nif).stream()
-                .filter(a -> !a.isAnyLocalAddress())
-                .findAny();
-
-        return addr.isPresent();
-    };
-
-
-    /**
-     * Returns a stream of interfaces suitable for IPv4 multicast tests.
-     */
-    public Stream<NetworkInterface> ip4MulticastInterfaces() {
-        return ip4Interfaces().filter(supportsIp4Multicast);
-    }
-
-    /**
-     * Returns a stream of interfaces suitable for IPv6 multicast tests.
-     */
-    public Stream<NetworkInterface> ip6MulticastInterfaces() {
-        return ip6Interfaces().filter(supportsIp6Multicast);
-    }
-
-    private final Predicate<NetworkInterface> supportsIp4Multicast = nif -> {
-        try {
-            if (!nif.supportsMulticast() || nif.isLoopback())
-                return false;
-
-            Optional<?> addr = ip4Interfaces.get(nif).stream()
-                    .filter(a -> !a.isAnyLocalAddress())
-                    .findAny();
-
-            return addr.isPresent();
-        } catch (IOException e) {
-            throw new UncheckedIOException(e);
-        }
-    };
-
-    private final Predicate<NetworkInterface> supportsIp6Multicast = nif -> {
-        try {
-            if (!nif.supportsMulticast() || nif.isLoopback())
-                return false;
-
-            Optional<?> addr = ip6Interfaces.get(nif).stream()
-                    .filter(a -> !a.isAnyLocalAddress())
-                    .findAny();
-
-            return addr.isPresent();
-        } catch (IOException e) {
-            throw new UncheckedIOException(e);
-        }
-    };
-
-    /**
-     * Returns all addresses on all "functional" interfaces.
-     */
-    public Stream<InetAddress> addresses(NetworkInterface nif) {
-        return Stream.concat(ip4Interfaces.get(nif).stream(),
-                             ip6Interfaces.get(nif).stream());
-    }
-
-    /**
-     * Returns all IPv4 addresses on all "functional" interfaces.
-     */
-    public Stream<Inet4Address> ip4Addresses() {
-        return ip4Interfaces().flatMap(nif -> ip4Addresses(nif));
-    }
-
-    /**
-     * Returns all IPv6 addresses on all "functional" interfaces.
-     */
-    public Stream<Inet6Address> ip6Addresses() {
-        return ip6Interfaces().flatMap(nif -> ip6Addresses(nif));
-    }
-
-    /**
-     * Returns all IPv4 addresses the given interface.
-     */
-    public Stream<Inet4Address> ip4Addresses(NetworkInterface nif) {
-        return ip4Interfaces.get(nif).stream();
-    }
-
-    /**
-     * Returns all IPv6 addresses for the given interface.
-     */
-    public Stream<Inet6Address> ip6Addresses(NetworkInterface nif) {
-        return ip6Interfaces.get(nif).stream();
-    }
-
-    /**
-     * Return a NetworkConfiguration instance.
-     */
-    public static NetworkConfiguration probe() throws IOException {
-        Map<NetworkInterface, List<Inet4Address>> ip4Interfaces = new HashMap<>();
-        Map<NetworkInterface, List<Inet6Address>> ip6Interfaces = new HashMap<>();
-
-        List<NetworkInterface> nifs = list(getNetworkInterfaces());
-        for (NetworkInterface nif : nifs) {
-            // ignore interfaces that are down
-            if (!nif.isUp() || nif.isPointToPoint())
-                continue;
-
-            List<Inet4Address> ip4Addresses = new LinkedList<>();
-            List<Inet6Address> ip6Addresses = new LinkedList<>();
-            ip4Interfaces.put(nif, ip4Addresses);
-            ip6Interfaces.put(nif, ip6Addresses);
-            for (InetAddress addr : list(nif.getInetAddresses())) {
-                if (addr instanceof Inet4Address)
-                    ip4Addresses.add((Inet4Address)addr);
-                else if (addr instanceof Inet6Address)
-                    ip6Addresses.add((Inet6Address)addr);
-            }
-        }
-        return new NetworkConfiguration(ip4Interfaces, ip6Interfaces);
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        interfaces().forEach(nif -> sb.append(interfaceInformation(nif)));
-        return sb.toString();
-    }
-
-    /** Returns detailed information for the given interface. */
-    public static String interfaceInformation(NetworkInterface nif) {
-        StringBuilder sb = new StringBuilder();
-        try {
-            sb.append("Display name: " + nif.getDisplayName() + "\n");
-            sb.append("Name: " + nif.getName() + "\n");
-            for (InetAddress inetAddress : list(nif.getInetAddresses()))
-                sb.append("InetAddress: " + inetAddress + "\n");
-            sb.append("Up? " + nif.isUp() + "\n");
-            sb.append("Loopback? " + nif.isLoopback() + "\n");
-            sb.append("PointToPoint? " + nif.isPointToPoint() + "\n");
-            sb.append("Supports multicast? " + nif.supportsMulticast() + "\n");
-            sb.append("Virtual? " + nif.isVirtual() + "\n");
-            sb.append("Hardware address: " +
-                    Arrays.toString(nif.getHardwareAddress()) + "\n");
-            sb.append("MTU: " + nif.getMTU() + "\n");
-            sb.append("Index: " + nif.getIndex() + "\n");
-            sb.append("\n");
-            return sb.toString();
-        } catch (IOException e) {
-            throw new UncheckedIOException(e);
-        }
-    }
-
-    /** Prints all the system interface information to the give stream. */
-    public static void printSystemConfiguration(PrintStream out) {
-        try {
-            out.println("*** all system network interface configuration ***");
-            List<NetworkInterface> nifs = list(getNetworkInterfaces());
-            for (NetworkInterface nif : nifs)
-                out.print(interfaceInformation(nif));
-            out.println("*** end ***");
-        } catch (IOException e) {
-            throw new UncheckedIOException(e);
-        }
-    }
-}
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/ParentLastURLClassLoader.java	Thu May 25 15:27:40 2017 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * 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.testlibrary;
-
-import java.net.URL;
-import java.net.URLClassLoader;
-
-/**
- * An url classloader, which trying to load class from provided URL[] first,
- * and using parent classloader in case it failed
- */
-public class ParentLastURLClassLoader extends URLClassLoader {
-
-    public ParentLastURLClassLoader(URL urls[], ClassLoader parent) {
-        super(urls, parent);
-    }
-
-    @Override
-    public Class<?> loadClass(String name) throws ClassNotFoundException {
-        try {
-            Class<?> c = findClass(name);
-            if (c != null) {
-                return c;
-            }
-        } catch (ClassNotFoundException e) {
-            // ignore
-        }
-        return super.loadClass(name);
-    }
-}
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/SerializationUtils.java	Thu May 25 15:27:40 2017 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +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.
- *
- * 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.testlibrary;
-
-import java.io.*;
-
-/**
- * Common library for various test serialization utility functions.
- */
-public final class SerializationUtils {
-    /*
-     * Serialize an object into byte array.
-     */
-    public static byte[] serialize(Object obj) throws Exception {
-        try (ByteArrayOutputStream bs = new ByteArrayOutputStream();
-                ObjectOutputStream out = new ObjectOutputStream(bs);) {
-            out.writeObject(obj);
-            return bs.toByteArray();
-        }
-    }
-
-    /*
-     * Deserialize an object from byte array.
-     */
-    public static Object deserialize(byte[] ba) throws Exception {
-        try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(ba));) {
-            return in.readObject();
-        }
-    }
-}
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/management/InputArguments.java	Thu May 25 15:27:40 2017 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2013, 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.
- *
- * 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.testlibrary.management;
-
-import java.lang.management.RuntimeMXBean;
-import java.lang.management.ManagementFactory;
-import java.util.List;
-
-/**
- * This class provides access to the input arguments to the VM.
- */
-public class InputArguments {
-    private static final List<String> args;
-
-    static {
-        RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
-        args = runtimeMxBean.getInputArguments();
-    }
-
-    /**
-     * Returns true if {@code arg} is an input argument to the VM.
-     *
-     * This is useful for checking boolean flags such as -XX:+UseSerialGC or
-     * -XX:-UsePerfData.
-     *
-     * @param arg The name of the argument.
-     * @return {@code true} if the given argument is an input argument,
-     *         otherwise {@code false}.
-     */
-    public static boolean contains(String arg) {
-        return args.contains(arg);
-    }
-
-    /**
-     * Returns true if {@code prefix} is the start of an input argument to the
-     * VM.
-     *
-     * This is useful for checking if flags describing a quantity, such as
-     * -XX:+MaxMetaspaceSize=100m, is set without having to know the quantity.
-     * To check if the flag -XX:MaxMetaspaceSize is set, use
-     * {@code InputArguments.containsPrefix("-XX:MaxMetaspaceSize")}.
-     *
-     * @param prefix The start of the argument.
-     * @return {@code true} if the given argument is the start of an input
-     *         argument, otherwise {@code false}.
-     */
-    public static boolean hasArgStartingWith(String prefix) {
-        for (String arg : args) {
-            if (arg.startsWith(prefix)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Get the string containing input arguments passed to the VM
-     */
-    public static String getInputArguments() {
-        StringBuilder result = new StringBuilder();
-        for (String arg : args)
-            result.append(arg).append(' ');
-
-        return result.toString();
-    }
-
-}
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/management/ThreadMXBeanTool.java	Thu May 25 15:27:40 2017 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +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.
- *
- * 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.testlibrary.management;
-
-import java.lang.management.ManagementFactory;
-import java.lang.management.ThreadInfo;
-import java.lang.management.ThreadMXBean;
-import java.util.concurrent.TimeoutException;
-
-/**
- * A few utility methods to use ThreadMXBean.
- */
-public final class ThreadMXBeanTool {
-
-    /**
-     * Waits until {@link Thread} is in the certain {@link State}
-     * and blocking on {@code object}.
-     *
-     * @param state The thread state
-     * @param object The object to block on
-     */
-    public static void waitUntilBlockingOnObject(Thread thread, Thread.State state, Object object)
-        throws InterruptedException {
-        String want = object == null ? null : object.getClass().getName() + '@'
-                + Integer.toHexString(System.identityHashCode(object));
-        ThreadMXBean tmx = ManagementFactory.getThreadMXBean();
-        while (thread.isAlive()) {
-            ThreadInfo ti = tmx.getThreadInfo(thread.getId());
-            if (ti.getThreadState() == state
-                    && (want == null || want.equals(ti.getLockName()))) {
-                return;
-            }
-            Thread.sleep(1);
-        }
-    }
-
-    /**
-     * Waits until {@link Thread} is in native.
-     */
-    public static void waitUntilInNative(Thread thread) throws InterruptedException {
-        ThreadMXBean tmx = ManagementFactory.getThreadMXBean();
-        while (thread.isAlive()) {
-            ThreadInfo ti = tmx.getThreadInfo(thread.getId());
-            if (ti.isInNative()) {
-                return;
-            }
-            Thread.sleep(1);
-        }
-    }
-
-}
--- a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java	Thu May 25 22:33:25 2017 +0000
@@ -31,9 +31,9 @@
  * @bug 6216082
  * @summary  Redirect problem with HttpsURLConnection using a proxy
  * @modules java.base/sun.net.www
- * @library .. /lib/testlibrary
+ * @library .. /test/lib
  * @build HttpCallback TestHttpsServer ClosedChannelList
- *        HttpTransaction TunnelProxy jdk.testlibrary.NetworkConfiguration
+ *        HttpTransaction TunnelProxy
  * @key intermittent
  * @run main/othervm B6216082
  */
@@ -43,7 +43,7 @@
 import javax.net.ssl.*;
 import java.util.*;
 
-import jdk.testlibrary.NetworkConfiguration;
+import jdk.test.lib.NetworkConfiguration;
 
 public class B6216082 {
     static SimpleHttpTransaction httpTrans;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/mscapi/KeyStoreEmptyCertChain.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,81 @@
+/*
+ * 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.
+ *
+ * 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 8172244
+ * @summary Verify that no exception is thrown with empty cert chain
+ *    in MSCAPI.
+ * @requires os.family == "windows"
+ * @modules java.base/sun.security.tools.keytool java.base/sun.security.x509
+ * @run main/othervm --add-opens java.base/java.security=ALL-UNNAMED
+ *      KeyStoreEmptyCertChain
+ */
+
+import java.security.KeyStore;
+import java.security.cert.Certificate;
+import sun.security.x509.X500Name;
+import sun.security.tools.keytool.CertAndKeyGen;
+import java.security.KeyPairGenerator;
+import java.security.KeyPair;
+import java.security.PrivateKey;
+import java.security.KeyStoreSpi;
+import java.lang.reflect.*;
+
+public class KeyStoreEmptyCertChain {
+
+    public static void main(String[] args) {
+
+        try {
+
+            KeyStore keyStore = KeyStore.getInstance("Windows-MY", "SunMSCAPI");
+            keyStore.load(null, null);
+
+            // Generate a certificate to use for testing
+            CertAndKeyGen gen = new CertAndKeyGen("RSA", "SHA256withRSA");
+            gen.generate(2048);
+            Certificate cert =
+                gen.getSelfCertificate(new X500Name("CN=test"), 3600);
+            String alias = "JDK-8172244";
+            char[] password = "password".toCharArray();
+            KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
+
+            // generate a private key for the certificate
+            kpg.initialize(2048);
+            KeyPair keyPair = kpg.generateKeyPair();
+            PrivateKey privKey = keyPair.getPrivate();
+            // need to bypass checks to store the private key without the cert
+            Field spiField = KeyStore.class.getDeclaredField("keyStoreSpi");
+            spiField.setAccessible(true);
+            KeyStoreSpi spi = (KeyStoreSpi) spiField.get(keyStore);
+            spi.engineSetKeyEntry(alias, privKey, password, new Certificate[0]);
+            keyStore.store(null, null);
+
+            keyStore.getCertificateAlias(cert);
+            keyStore.deleteEntry(alias);
+            // test passes if no exception is thrown
+        } catch (Exception ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+}
--- a/jdk/test/sun/security/tools/jarsigner/EntriesOrder.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/sun/security/tools/jarsigner/EntriesOrder.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -25,11 +25,9 @@
  * @test
  * @bug 8031572
  * @summary jarsigner -verify exits with 0 when a jar file is not properly signed
- * @library /lib/testlibrary
  * @modules java.base/sun.security.tools.keytool
  *          jdk.jartool/sun.security.tools.jarsigner
  *          jdk.jartool/sun.tools.jar
- * @build jdk.testlibrary.IOUtils
  * @run main EntriesOrder
  */
 
@@ -45,8 +43,6 @@
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
 
-import jdk.testlibrary.IOUtils;
-
 public class EntriesOrder {
 
     public static void main(String[] args) throws Exception {
@@ -114,7 +110,7 @@
                 Enumeration<JarEntry> jes = jf.entries();
                 while (jes.hasMoreElements()) {
                     JarEntry je = jes.nextElement();
-                    IOUtils.readFully(jf.getInputStream(je));
+                    jf.getInputStream(je).readAllBytes();
                     Certificate[] certs = je.getCertificates();
                     if (certs != null && certs.length > 0) {
                         cc++;
@@ -146,7 +142,7 @@
                 while (true) {
                     JarEntry je = jis.getNextJarEntry();
                     if (je == null) break;
-                    IOUtils.readFully(jis);
+                    jis.readAllBytes();
                     Certificate[] certs = je.getCertificates();
                     if (certs != null && certs.length > 0) {
                         cc++;
--- a/jdk/test/tools/jmod/hashes/HashesTest.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/tools/jmod/hashes/HashesTest.java	Thu May 25 22:33:25 2017 +0000
@@ -25,13 +25,12 @@
  * @test
  * @bug 8160286
  * @summary Test the recording and checking of module hashes
- * @library /lib/testlibrary
+ * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.base/jdk.internal.module
  *          jdk.compiler
  *          jdk.jartool
  *          jdk.jlink
- * @build CompilerUtils ModuleInfoMaker
  * @run testng HashesTest
  */
 
@@ -62,6 +61,8 @@
 import jdk.internal.module.ModuleHashes;
 import jdk.internal.module.ModulePath;
 
+import jdk.test.lib.compiler.ModuleInfoMaker;
+
 import org.testng.annotations.Test;
 
 import static org.testng.Assert.*;
@@ -382,7 +383,7 @@
         makeModule(mn, null, deps);
     }
 
-    private void makeModule(String mn, ModuleDescriptor.Requires.Modifier mod,  String... deps)
+    private void makeModule(String mn, ModuleDescriptor.Requires.Modifier mod, String... deps)
         throws IOException
     {
         if (mod != null && mod != TRANSITIVE && mod != STATIC) {
@@ -390,23 +391,23 @@
         }
 
         StringBuilder sb = new StringBuilder();
-        sb.append("module " + mn + " {").append("\n");
-        Arrays.stream(deps).forEach(req -> {
-            sb.append("    requires ");
-            if (mod != null) {
-                sb.append(mod.toString().toLowerCase()).append(" ");
-            }
-            sb.append(req + ";\n");
-        });
+        sb.append("module ")
+          .append(mn)
+          .append(" {")
+          .append("\n");
+        Arrays.stream(deps)
+              .forEach(req -> {
+                  sb.append("    requires ");
+                  if (mod != null) {
+                      sb.append(mod.toString().toLowerCase())
+                        .append(" ");
+                  }
+                  sb.append(req)
+                    .append(";\n");
+              });
         sb.append("}\n");
         builder.writeJavaFiles(mn, sb.toString());
-
-        compileModule(mn, srcDir);
-    }
-
-    private void compileModule(String moduleName, Path src) throws IOException {
-        Path msrc = src.resolve(moduleName);
-        assertTrue(CompilerUtils.compile(msrc, mods, "--module-source-path", src.toString()));
+        builder.compile(mn, mods);
     }
 
     private void jmodHashModules(String moduleName, String hashModulesPattern) {
--- a/jdk/test/tools/launcher/modules/addexports/AddExportsTestWarningError.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/tools/launcher/modules/addexports/AddExportsTestWarningError.java	Thu May 25 22:33:25 2017 +0000
@@ -25,9 +25,8 @@
  * @test
  * @bug 8168836
  * @summary Basic argument validation for --add-exports
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build AddExportsTestWarningError CompilerUtils ModuleInfoMaker
  * @build jdk.testlibrary.*
  * @run testng AddExportsTestWarningError
  */
@@ -40,6 +39,7 @@
 import java.util.Arrays;
 import java.util.stream.Stream;
 
+import jdk.test.lib.compiler.ModuleInfoMaker;
 import jdk.testlibrary.OutputAnalyzer;
 import static jdk.testlibrary.ProcessTools.*;
 
@@ -48,7 +48,6 @@
 import org.testng.annotations.Test;
 import static org.testng.Assert.*;
 
-
 @Test
 public class AddExportsTestWarningError {
 
--- a/jdk/test/tools/launcher/modules/addreads/AddReadsTestWarningError.java	Thu May 25 15:27:40 2017 -0700
+++ b/jdk/test/tools/launcher/modules/addreads/AddReadsTestWarningError.java	Thu May 25 22:33:25 2017 +0000
@@ -25,9 +25,9 @@
  * @test
  * @bug 8168836
  * @summary  Basic argument validation for --add-reads
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build AddReadsTestWarningError CompilerUtils ModuleInfoMaker
+ * @build AddReadsTestWarningError
  * @build jdk.testlibrary.*
  * @run testng AddReadsTestWarningError
  */
@@ -40,6 +40,7 @@
 import java.util.Arrays;
 import java.util.stream.Stream;
 
+import jdk.test.lib.compiler.ModuleInfoMaker;
 import jdk.testlibrary.OutputAnalyzer;
 import static jdk.testlibrary.ProcessTools.*;
 
@@ -48,7 +49,6 @@
 import org.testng.annotations.Test;
 import static org.testng.Assert.*;
 
-
 @Test
 public class AddReadsTestWarningError {
 
--- a/langtools/.hgtags	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/.hgtags	Thu May 25 22:33:25 2017 +0000
@@ -419,3 +419,6 @@
 f260f1a2acf616509a4ee5a29bc7f2acca3853e3 jdk-9+167
 bc21e5ba6bf1538551093f57fa0f1a6571be05cc jdk-9+168
 0e522ff8b9f52a9d4929af9a6aa84110f4dcd81d jdk-9+169
+18355c879c69a33167f1862896738a7b9a4da729 jdk-9+170
+85581ae8a97f20fd2f817a71eb3cd7b04e492722 jdk-10+7
+6d9a33d72d0647f3981c9d9c636a6f1290689895 jdk-10+8
--- a/langtools/make/gendata/Gendata-jdk.compiler.gmk	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/make/gendata/Gendata-jdk.compiler.gmk	Thu May 25 22:33:25 2017 +0000
@@ -25,10 +25,20 @@
 
 include JarArchive.gmk
 include JavaCompilation.gmk
+include Modules.gmk
 include SetupJavaCompilers.gmk
 
 ################################################################################
 
+# This is needed to properly setup DOCS_MODULES.
+$(eval $(call ReadImportMetaData))
+
+# Modules that should be visible for 9 - the documented modules:
+CT_MODULES := $(DOCS_MODULES)
+
+# Get the complete module source path:
+CT_MODULESOURCEPATH := $(call GetModuleSrcPath)
+
 CT_DATA_DESCRIPTION ?= $(LANGTOOLS_TOPDIR)/make/data/symbols/symbols
 
 $(eval $(call SetupJavaCompilation, COMPILE_CREATE_SYMBOLS, \
@@ -41,6 +51,8 @@
 
 ifeq ($(BOOT_JDK_MODULAR), true)
   COMPILECREATESYMBOLS_ADD_EXPORTS := \
+      --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
+      --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
       --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
       --add-exports=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \
       --add-exports=jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED
@@ -59,6 +71,14 @@
 	    build-ctsym \
 	    $(CT_DATA_DESCRIPTION) \
 	    $(@D)
+	$(MKDIR) $(@D)/9
+	$(JAVA_SMALL) $(INTERIM_LANGTOOLS_ARGS) \
+	    $(COMPILECREATESYMBOLS_ADD_EXPORTS) \
+	    -classpath $(BUILDTOOLS_OUTPUTDIR)/create_symbols \
+	    build.tools.symbolgenerator.TransitiveDependencies \
+	    $(CT_MODULESOURCEPATH) \
+	    $(CT_MODULES) \
+	    >$(@D)/9/system-modules
 	$(TOUCH) $@
 
 # Can't generate ct.sym directly into modules libs as the SetupJarArchive macro
@@ -66,7 +86,7 @@
 $(eval $(call SetupJarArchive, CREATE_CTSYM, \
     DEPENDENCIES := $(SUPPORT_OUTPUTDIR)/symbols/ct.sym-files/_the.symbols, \
     SRCS := $(SUPPORT_OUTPUTDIR)/symbols/ct.sym-files, \
-    SUFFIXES := .sig, \
+    SUFFIXES := .sig system-modules, \
     JAR := $(SUPPORT_OUTPUTDIR)/symbols/ct.sym, \
 ))
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/make/src/classes/build/tools/symbolgenerator/TransitiveDependencies.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,103 @@
+/*
+ * 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 build.tools.symbolgenerator;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import javax.lang.model.element.ModuleElement.RequiresDirective;
+import javax.lang.model.util.Elements;
+import javax.tools.JavaCompiler;
+import javax.tools.ToolProvider;
+
+import com.sun.tools.javac.api.JavacTaskImpl;
+import com.sun.tools.javac.code.Symbol.ModuleSymbol;
+
+/**
+ * Print reflexive transitive closure of the given modules along their requires transitive edges.
+ */
+public class TransitiveDependencies {
+
+    private static void help() {
+        System.err.println("java TransitiveDependencies <module-source-path> <root-modules>");
+    }
+
+    public static void main(String... args) throws IOException {
+        if (args.length < 1) {
+            help();
+            return ;
+        }
+
+        JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
+        List<String> options = Arrays.asList("-source", "9",
+                                             "-target", "9",
+                                             "--system", "none",
+                                             "--module-source-path", args[0],
+                                             "--add-modules", Arrays.stream(args)
+                                                                    .skip(1)
+                                                                    .collect(Collectors.joining(",")));
+        List<String> jlObjectList = Arrays.asList("java.lang.Object");
+        JavacTaskImpl task = (JavacTaskImpl) compiler.getTask(null, null, d -> {}, options, jlObjectList, null);
+        task.enter();
+        Elements elements = task.getElements();
+        List<String> todo = new LinkedList<>();
+        Arrays.stream(args).skip(1).forEach(todo::add);
+        Set<String> allModules = new HashSet<>();
+
+        while (!todo.isEmpty()) {
+            String current = todo.remove(0);
+
+            if (!allModules.add(current))
+                continue;
+
+            ModuleSymbol mod = (ModuleSymbol) elements.getModuleElement(current);
+
+            if (mod == null) {
+                throw new IllegalStateException("Missing: " + current);
+            }
+
+             //use the internal structure to avoid unnecesarily completing the symbol using the UsesProvidesVisitor:
+            for (RequiresDirective rd : mod.requires) {
+                if (rd.isTransitive()) {
+                    todo.add(rd.getDependency().getQualifiedName().toString());
+                }
+            }
+        }
+
+        allModules.add("java.base");
+        allModules.add("jdk.unsupported");
+
+        allModules.stream()
+                  .sorted()
+                  .forEach(System.out::println);
+    }
+
+}
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java	Thu May 25 22:33:25 2017 +0000
@@ -1889,10 +1889,13 @@
                     Type i = n_i.data.first();
                     for (Node n_j : nodes) {
                         Type j = n_j.data.first();
-                        UndetVar uv_i = (UndetVar)inferenceContext.asUndetVar(i);
-                        if (Type.containsAny(uv_i.getBounds(InferenceBound.values()), List.of(j))) {
-                            //update i's bound dependencies
-                            n_i.addDependency(n_j);
+                        // don't compare a variable to itself
+                        if (i != j) {
+                            UndetVar uv_i = (UndetVar)inferenceContext.asUndetVar(i);
+                            if (Type.containsAny(uv_i.getBounds(InferenceBound.values()), List.of(j))) {
+                                //update i's bound dependencies
+                                n_i.addDependency(n_j);
+                            }
                         }
                     }
                 }
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java	Thu May 25 22:33:25 2017 +0000
@@ -142,6 +142,7 @@
     private final ModuleFinder moduleFinder;
     private final Source source;
     private final boolean allowModules;
+    private final boolean allowAccessIntoSystem;
 
     public final boolean multiModuleMode;
 
@@ -192,6 +193,7 @@
         allowModules = source.allowModules();
         Options options = Options.instance(context);
 
+        allowAccessIntoSystem = options.isUnset(Option.RELEASE);
         lintOptions = options.isUnset(Option.XLINT_CUSTOM, "-" + LintCategory.OPTIONS.option);
 
         Collection<String> xmodules = options.keySet()
@@ -1221,7 +1223,7 @@
             for (String limit : extraLimitMods) {
                 limitMods.add(syms.enterModule(names.fromString(limit)));
             }
-            observable = computeTransitiveClosure(limitMods, null);
+            observable = computeTransitiveClosure(limitMods, rootModules, null);
             observable.addAll(rootModules);
             if (lintOptions) {
                 for (ModuleSymbol msym : limitMods) {
@@ -1301,7 +1303,7 @@
             }
         }
 
-        Set<ModuleSymbol> result = computeTransitiveClosure(enabledRoot, observable);
+        Set<ModuleSymbol> result = computeTransitiveClosure(enabledRoot, rootModules, observable);
 
         result.add(syms.unnamedModule);
 
@@ -1339,12 +1341,18 @@
         return allModules == null || allModules.contains(msym);
     }
 
-    private Set<ModuleSymbol> computeTransitiveClosure(Set<? extends ModuleSymbol> base, Set<ModuleSymbol> observable) {
+    private Set<ModuleSymbol> computeTransitiveClosure(Set<? extends ModuleSymbol> base,
+                                                       Set<? extends ModuleSymbol> rootModules,
+                                                       Set<ModuleSymbol> observable) {
         List<ModuleSymbol> primaryTodo = List.nil();
         List<ModuleSymbol> secondaryTodo = List.nil();
 
         for (ModuleSymbol ms : base) {
-            primaryTodo = primaryTodo.prepend(ms);
+            if (rootModules.contains(ms)) {
+                primaryTodo = primaryTodo.prepend(ms);
+            } else {
+                secondaryTodo = secondaryTodo.prepend(ms);
+            }
         }
 
         Set<ModuleSymbol> result = new LinkedHashSet<>();
@@ -1367,12 +1375,12 @@
             if (!result.add(current) || current == syms.unnamedModule || ((current.flags_field & Flags.AUTOMATIC_MODULE) != 0))
                 continue;
             current.complete();
-            if (current.kind == ERR && isPrimaryTodo && warnedMissing.add(current)) {
+            if (current.kind == ERR && (isPrimaryTodo || base.contains(current)) && warnedMissing.add(current)) {
                 log.error(Errors.ModuleNotFound(current));
             }
             for (RequiresDirective rd : current.requires) {
                 if (rd.module == syms.java_base) continue;
-                if ((rd.isTransitive() && isPrimaryTodo) || base.contains(current)) {
+                if ((rd.isTransitive() && isPrimaryTodo) || rootModules.contains(current)) {
                     primaryTodo = primaryTodo.prepend(rd.module);
                 } else {
                     secondaryTodo = secondaryTodo.prepend(rd.module);
@@ -1479,6 +1487,10 @@
             }
         }
 
+        if (!allowAccessIntoSystem && (msym.flags() & Flags.SYSTEM_MODULE) != 0 &&
+            msym.patchLocation != null) {
+            log.error(Errors.PatchModuleWithRelease(msym));
+        }
     }
 
     private Set<ModuleSymbol> retrieveRequiresTransitive(ModuleSymbol msym) {
@@ -1604,6 +1616,12 @@
 
             if (!isValidName(packageName))
                 continue;
+
+            if (!allowAccessIntoSystem && (msym.flags() & Flags.SYSTEM_MODULE) != 0) {
+                log.error(Errors.AddExportsWithRelease(msym));
+                continue;
+            }
+
             PackageSymbol p = syms.enterPackage(msym, names.fromString(packageName));
             p.modle = msym;  // TODO: do we need this?
 
@@ -1679,6 +1697,11 @@
                 continue;
             }
 
+            if (!allowAccessIntoSystem && (msym.flags() & Flags.SYSTEM_MODULE) != 0) {
+                log.error(Errors.AddReadsWithRelease(msym));
+                continue;
+            }
+
             for (String targetName : targetNames.split("[ ,]+", -1)) {
                 ModuleSymbol targetModule;
                 if (targetName.equals("ALL-UNNAMED")) {
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java	Thu May 25 22:33:25 2017 +0000
@@ -25,6 +25,7 @@
 
 package com.sun.tools.javac.jvm;
 
+import com.sun.tools.javac.tree.TreeInfo.PosKind;
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
 import com.sun.tools.javac.util.List;
@@ -1399,12 +1400,16 @@
                                   catchallpc, 0);
                     startseg = env.info.gaps.next().intValue();
                 }
-                code.statBegin(TreeInfo.finalizerPos(env.tree));
+                code.statBegin(TreeInfo.finalizerPos(env.tree, PosKind.FIRST_STAT_POS));
                 code.markStatBegin();
 
                 Item excVar = makeTemp(syms.throwableType);
                 excVar.store();
                 genFinalizer(env);
+                code.resolvePending();
+                code.statBegin(TreeInfo.finalizerPos(env.tree, PosKind.END_POS));
+                code.markStatBegin();
+
                 excVar.load();
                 registerCatch(body.pos(), startseg,
                               env.info.gaps.next().intValue(),
@@ -1418,7 +1423,7 @@
                     code.resolve(env.info.cont);
 
                     // Mark statement line number
-                    code.statBegin(TreeInfo.finalizerPos(env.tree));
+                    code.statBegin(TreeInfo.finalizerPos(env.tree, PosKind.FIRST_STAT_POS));
                     code.markStatBegin();
 
                     // Save return address.
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java	Thu May 25 22:33:25 2017 +0000
@@ -300,7 +300,8 @@
                 Option.XBOOTCLASSPATH_PREPEND,
                 Option.ENDORSEDDIRS, Option.DJAVA_ENDORSED_DIRS,
                 Option.EXTDIRS, Option.DJAVA_EXT_DIRS,
-                Option.SOURCE, Option.TARGET);
+                Option.SOURCE, Option.TARGET,
+                Option.SYSTEM, Option.UPGRADE_MODULE_PATH);
 
         if (platformString != null) {
             PlatformDescription platformDescription = PlatformUtils.lookupPlatformDescription(platformString);
@@ -331,7 +332,12 @@
                 try {
                     StandardJavaFileManager sfm = (StandardJavaFileManager) fm;
 
-                    sfm.setLocationFromPaths(StandardLocation.PLATFORM_CLASS_PATH, platformCP);
+                    if (Source.instance(context).allowModules()) {
+                        sfm.handleOption("--system", Arrays.asList("none").iterator());
+                        sfm.setLocationFromPaths(StandardLocation.UPGRADE_MODULE_PATH, platformCP);
+                    } else {
+                        sfm.setLocationFromPaths(StandardLocation.PLATFORM_CLASS_PATH, platformCP);
+                    }
                 } catch (IOException ex) {
                     log.printLines(PrefixKind.JAVAC, "msg.io");
                     ex.printStackTrace(log.getWriter(WriterKind.NOTICE));
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/JDKPlatformProvider.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/JDKPlatformProvider.java	Thu May 25 22:33:25 2017 +0000
@@ -26,6 +26,8 @@
 package com.sun.tools.javac.platform;
 
 import java.io.IOException;
+import java.net.URI;
+import java.nio.charset.Charset;
 import java.nio.file.DirectoryStream;
 import java.nio.file.FileSystem;
 import java.nio.file.FileSystems;
@@ -41,6 +43,7 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
+import java.util.stream.Stream;
 
 import javax.annotation.processing.Processor;
 
@@ -63,7 +66,7 @@
 
     @Override
     public PlatformDescription getPlatform(String platformName, String options) {
-        return new PlatformDescriptionImpl(platformName);
+        return new PlatformDescriptionImpl(platformName.equals("10") ? "9" : platformName);
     }
 
     private static final String[] symbolFileLocation = { "lib", "ct.sym" };
@@ -90,9 +93,10 @@
             } catch (IOException | ProviderNotFoundException ex) {
             }
         }
-        // Workaround until full support for --release 9 distinct from --release 10
-        SUPPORTED_JAVA_PLATFORM_VERSIONS.add(targetNumericVersion(Target.JDK1_9));
-        SUPPORTED_JAVA_PLATFORM_VERSIONS.add(targetNumericVersion(Target.DEFAULT));
+
+        if (SUPPORTED_JAVA_PLATFORM_VERSIONS.contains("9")) {
+            SUPPORTED_JAVA_PLATFORM_VERSIONS.add("10");
+        }
     }
 
     private static String targetNumericVersion(Target target) {
@@ -110,12 +114,6 @@
 
         @Override
         public Collection<Path> getPlatformPath() {
-            // Comparison should be == Target.DEFAULT once --release 9
-            // is distinct from 10
-            if (Target.lookup(version).compareTo(Target.JDK1_9)  >=  0) {
-                return null;
-            }
-
             List<Path> paths = new ArrayList<>();
             Path file = findCtSym();
             // file == ${jdk.home}/lib/ct.sym
@@ -132,7 +130,21 @@
                 try (DirectoryStream<Path> dir = Files.newDirectoryStream(root)) {
                     for (Path section : dir) {
                         if (section.getFileName().toString().contains(version)) {
-                            paths.add(section);
+                            Path systemModules = section.resolve("system-modules");
+
+                            if (Files.isRegularFile(systemModules)) {
+                                Path modules =
+                                        FileSystems.getFileSystem(URI.create("jrt:/"))
+                                                   .getPath("modules");
+                                try (Stream<String> lines =
+                                        Files.lines(systemModules, Charset.forName("UTF-8"))) {
+                                    lines.map(line -> modules.resolve(line))
+                                         .filter(mod -> Files.exists(mod))
+                                         .forEach(mod -> paths.add(mod));
+                                }
+                            } else {
+                                paths.add(section);
+                            }
                         }
                     }
                 } catch (IOException ex) {
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Thu May 25 22:33:25 2017 +0000
@@ -3027,6 +3027,18 @@
 compiler.err.addmods.all.module.path.invalid=\
     --add-modules ALL-MODULE-PATH can only be used when compiling the unnamed module
 
+# 0: symbol
+compiler.err.add.exports.with.release=\
+    exporting a package from system module {0} is not allowed with --release
+
+# 0: symbol
+compiler.err.add.reads.with.release=\
+    adding read edges for system module {0} is not allowed with --release
+
+# 0: symbol
+compiler.err.patch.module.with.release=\
+    patching system module {0} is not allowed in combination with --release
+
 compiler.warn.addopens.ignored=\
     --add-opens has no effect at compile time
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -46,6 +46,8 @@
 
 import javax.tools.JavaFileObject;
 
+import java.util.function.ToIntFunction;
+
 import static com.sun.tools.javac.tree.JCTree.JCOperatorExpression.OperandPos.LEFT;
 import static com.sun.tools.javac.tree.JCTree.JCOperatorExpression.OperandPos.RIGHT;
 
@@ -580,13 +582,29 @@
         };
     }
 
+    public enum PosKind {
+        START_POS(TreeInfo::getStartPos),
+        FIRST_STAT_POS(TreeInfo::firstStatPos),
+        END_POS(TreeInfo::endPos);
+
+        final ToIntFunction<JCTree> posFunc;
+
+        PosKind(ToIntFunction<JCTree> posFunc) {
+            this.posFunc = posFunc;
+        }
+
+        int toPos(JCTree tree) {
+            return posFunc.applyAsInt(tree);
+        }
+    }
+
     /** The position of the finalizer of given try/synchronized statement.
      */
-    public static int finalizerPos(JCTree tree) {
+    public static int finalizerPos(JCTree tree, PosKind posKind) {
         if (tree.hasTag(TRY)) {
             JCTry t = (JCTry) tree;
             Assert.checkNonNull(t.finalizer);
-            return firstStatPos(t.finalizer);
+            return posKind.toPos(t.finalizer);
         } else if (tree.hasTag(SYNCHRONIZED)) {
             return endPos(((JCSynchronized) tree).body);
         } else {
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/javadoc/package-info.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/javadoc/package-info.java	Thu May 25 22:33:25 2017 +0000
@@ -26,7 +26,7 @@
 /**
 <p style="font-style: italic; font-size:larger">
 <b>Note:</b> The declarations in this package have been superseded by those
-in the package {@code jdk.javadoc.doclet}.
+in the package {@link jdk.javadoc.doclet}.
 For more information, see the <i>Migration Guide</i> in the documentation for that package.
 </p>
 
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/package-info.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/package-info.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -26,16 +26,8 @@
 /**
 <p style="font-style: italic; font-size:larger">
 <b>Note:</b> The declarations in this package have been superseded by those
-in the new package {@code jdk.javadoc.doclet}.
+in the new package {@link jdk.javadoc.doclet}.
 </p>
-
-    As of JDK version 1.5, replaced by
-    {@code com.sun.tools.doclets.internal.toolkit.util}.
-
-    <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>
 */
 
 package com.sun.tools.doclets;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/standard/package-info.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+/**
+<p style="font-style: italic; font-size:larger">
+<b>Note:</b> The declarations in this package have been superseded by those
+in the new package {@link jdk.javadoc.doclet}.
+</p>
+*/
+
+package com.sun.tools.doclets.standard;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java	Thu May 25 22:33:25 2017 +0000
@@ -25,6 +25,7 @@
 
 package jdk.javadoc.internal.doclets.formats.html;
 
+import java.util.Collection;
 import java.util.Map;
 import java.util.Set;
 import java.util.SortedMap;
@@ -101,7 +102,7 @@
      * @param tableSummary summary for the table
      * @param body the document tree to which the modules list will be added
      */
-    protected abstract void addModulesList(Map<ModuleElement, Set<PackageElement>> modules, String text,
+    protected abstract void addModulesList(Collection<ModuleElement> modules, String text,
             String tableSummary, Content body);
 
     /**
@@ -173,7 +174,7 @@
      * @param body the document tree to which the index will be added
      */
     protected void addIndex(Content body) {
-        addIndexContents(modules, "doclet.Module_Summary",
+        addIndexContents(configuration.modules, "doclet.Module_Summary",
                 configuration.getText("doclet.Member_Table_Summary",
                 configuration.getText("doclet.Module_Summary"),
                 configuration.getText("doclet.modules")), body);
@@ -201,7 +202,7 @@
      * @param tableSummary summary for the table
      * @param body the document tree to which the index contents will be added
      */
-    protected void addIndexContents(Map<ModuleElement, Set<PackageElement>> modules, String text,
+    protected void addIndexContents(Collection<ModuleElement> modules, String text,
             String tableSummary, Content body) {
         HtmlTree htmlTree = (configuration.allowTag(HtmlTag.NAV))
                 ? HtmlTree.NAV()
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -25,6 +25,7 @@
 
 package jdk.javadoc.internal.doclets.formats.html;
 
+import java.util.Collection;
 import java.util.Map;
 import java.util.Set;
 
@@ -81,7 +82,7 @@
     /**
      * {@inheritDoc}
      */
-    protected void addModulesList(Map<ModuleElement, Set<PackageElement>> modules, String text,
+    protected void addModulesList(Collection<ModuleElement> modules, String text,
             String tableSummary, Content body) {
         Content heading = HtmlTree.HEADING(HtmlConstants.MODULE_HEADING, true,
                 contents.modulesLabel);
@@ -90,7 +91,7 @@
                 : HtmlTree.DIV(HtmlStyle.indexContainer, heading);
         HtmlTree ul = new HtmlTree(HtmlTag.UL);
         ul.setTitle(contents.modulesLabel);
-        for (ModuleElement mdle: modules.keySet()) {
+        for (ModuleElement mdle: modules) {
             ul.addContent(getModuleLink(mdle));
         }
         htmlTree.addContent(ul);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java	Thu May 25 22:33:25 2017 +0000
@@ -30,7 +30,7 @@
 import javax.lang.model.element.ModuleElement;
 import javax.lang.model.element.PackageElement;
 
-import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
+import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@@ -56,11 +56,16 @@
 public class ModuleIndexWriter extends AbstractModuleIndexWriter {
 
     /**
-     * Set representing the modules.
+     * Map representing the group of modules as specified on the command line.
      *
      * @see Group
      */
-    private final SortedSet<ModuleElement> modules;
+    private final Map<String, SortedSet<ModuleElement>> groupModuleMap;
+
+    /**
+     * List to store the order groups as specified on the command line.
+     */
+    private final List<String> groupList;
 
     /**
      * HTML tree for main tag.
@@ -74,7 +79,8 @@
      */
     public ModuleIndexWriter(ConfigurationImpl configuration, DocPath filename) {
         super(configuration, filename);
-        modules = configuration.modules;
+        groupModuleMap = configuration.group.groupModules(configuration.modules);
+        groupList = configuration.group.getGroupList();
     }
 
     /**
@@ -96,11 +102,13 @@
      */
     @Override
     protected void addIndex(Content body) {
-        if (modules != null && !modules.isEmpty()) {
-            addIndexContents(configuration.getText("doclet.Modules"),
-                    configuration.getText("doclet.Member_Table_Summary",
-                            configuration.getText("doclet.Module_Summary"),
-                            configuration.getText("doclet.modules")), body);
+        for (String groupname : groupList) {
+            SortedSet<ModuleElement> list = groupModuleMap.get(groupname);
+            if (list != null && !list.isEmpty()) {
+                addIndexContents(list,
+                        groupname, configuration.getText("doclet.Member_Table_Summary",
+                                groupname, configuration.getText("doclet.modules")), body);
+            }
         }
     }
 
@@ -111,7 +119,7 @@
      * @param tableSummary summary for the table
      * @param body the document tree to which the index contents will be added
      */
-    protected void addIndexContents(String title, String tableSummary, Content body) {
+    protected void addIndexContents(Collection<ModuleElement> modules, String title, String tableSummary, Content body) {
         HtmlTree htmltree = (configuration.allowTag(HtmlTag.NAV))
                 ? HtmlTree.NAV()
                 : new HtmlTree(HtmlTag.DIV);
@@ -123,7 +131,7 @@
         }
         htmltree.addContent(ul);
         body.addContent(htmltree);
-        addModulesList(title, tableSummary, body);
+        addModulesList(modules, title, tableSummary, body);
     }
 
     /**
@@ -133,15 +141,17 @@
      * @param tableSummary the summary of the table tag
      * @param body the content tree to which the module list will be added
      */
-    protected void addModulesList(String text, String tableSummary, Content body) {
+    protected void addModulesList(Collection<ModuleElement> modules, String text, String tableSummary, Content body) {
         Content table = (configuration.isOutputHtml5())
                 ? HtmlTree.TABLE(HtmlStyle.overviewSummary, getTableCaption(new RawHtml(text)))
                 : HtmlTree.TABLE(HtmlStyle.overviewSummary, tableSummary, getTableCaption(new RawHtml(text)));
         table.addContent(getSummaryTableHeader(moduleTableHeader, "col"));
         Content tbody = new HtmlTree(HtmlTag.TBODY);
-        addModulesList(tbody);
+        addModulesList(modules, tbody);
         table.addContent(tbody);
-        Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table);
+        Content anchor = getMarkerAnchor(text);
+        Content div = HtmlTree.DIV(HtmlStyle.contentContainer, anchor);
+        div.addContent(table);
         if (configuration.allowTag(HtmlTag.MAIN)) {
             htmlTree.addContent(div);
         } else {
@@ -154,7 +164,7 @@
      *
      * @param tbody the documentation tree to which the list will be added
      */
-    protected void addModulesList(Content tbody) {
+    protected void addModulesList(Collection<ModuleElement> modules, Content tbody) {
         boolean altColor = true;
         for (ModuleElement mdle : modules) {
             if (!mdle.isUnnamed()) {
@@ -260,9 +270,4 @@
     protected void addModulePackagesList(Map<ModuleElement, Set<PackageElement>> modules, String text,
             String tableSummary, Content body, ModuleElement mdle) {
     }
-
-    @Override
-    protected void addModulesList(Map<ModuleElement, Set<PackageElement>> modules, String text,
-            String tableSummary, Content body) {
-    }
 }
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -26,6 +26,7 @@
 package jdk.javadoc.internal.doclets.formats.html;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -175,7 +176,7 @@
     protected void addOverviewHeader(Content body) {
     }
 
-    protected void addModulesList(Map<ModuleElement, Set<PackageElement>> modules, String text,
+    protected void addModulesList(Collection<ModuleElement> modules, String text,
             String tableSummary, Content body) {
     }
 
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java	Thu May 25 22:33:25 2017 +0000
@@ -29,11 +29,12 @@
 
 import javax.lang.model.element.PackageElement;
 
-import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
+import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
 import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
+import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
 import jdk.javadoc.internal.doclets.toolkit.Content;
 import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
 import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
@@ -112,8 +113,8 @@
             SortedSet<PackageElement> list = groupPackageMap.get(groupname);
             if (list != null && !list.isEmpty()) {
                 addIndexContents(list,
-                                 groupname, configuration.getText("doclet.Member_Table_Summary",
-                                                                  groupname, configuration.getText("doclet.packages")), body);
+                        groupname, configuration.getText("doclet.Member_Table_Summary",
+                                groupname, configuration.getText("doclet.packages")), body);
             }
         }
     }
@@ -131,7 +132,9 @@
         Content tbody = new HtmlTree(HtmlTag.TBODY);
         addPackagesList(packages, tbody);
         table.addContent(tbody);
-        Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table);
+        Content anchor = getMarkerAnchor(text);
+        Content div = HtmlTree.DIV(HtmlStyle.contentContainer, anchor);
+        div.addContent(table);
         if (configuration.allowTag(HtmlTag.MAIN)) {
             htmlTree.addContent(div);
         } else {
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties	Thu May 25 22:33:25 2017 +0000
@@ -192,9 +192,9 @@
 doclet.Window_ClassUse_Header=Uses of {0} {1}
 doclet.ClassUse_Title=Uses of {0}
 doclet.navClassUse=Use
-doclet.Error_in_packagelist=Error in using -group option: {0} {1}
-doclet.Groupname_already_used=In -group option, groupname already used: {0}
-doclet.Same_package_name_used=Package name format used twice: {0}
+doclet.Error_in_grouplist=Bad -group option: {0} {1}
+doclet.Groupname_already_used=In -group option, group name already used: {0}
+doclet.Same_element_name_used=Element name or pattern used twice: {0}
 
 # option specifiers
 doclet.usage.d.parameters=\
@@ -274,9 +274,9 @@
     Exclude any doc-files subdirectories with given name
 
 doclet.usage.group.parameters=\
-    <name> <p1>:<p2>..
+    <name> <g1>:<g2>...
 doclet.usage.group.description=\
-    Group specified packages together in overview page
+    Group specified elements together in overview page
 
 doclet.usage.nocomment.description=\
     Suppress description and tags, generate only declarations
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Configuration.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Configuration.java	Thu May 25 22:33:25 2017 +0000
@@ -699,7 +699,11 @@
         typeElementCatalog = new TypeElementCatalog(includedTypeElements, this);
         initTagletManager(customTagStrs);
         groups.stream().forEach((grp) -> {
-            group.checkPackageGroups(grp.value1, grp.value2);
+            if (showModules) {
+                group.checkModuleGroups(grp.value1, grp.value2);
+            } else {
+                group.checkPackageGroups(grp.value1, grp.value2);
+            }
         });
     }
 
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties	Thu May 25 22:33:25 2017 +0000
@@ -49,6 +49,7 @@
 doclet.Packages=Packages
 doclet.Modules=Modules
 doclet.Other_Packages=Other Packages
+doclet.Other_Modules=Other Modules
 doclet.Notice_taglet_registered=Registered Taglet {0} ...
 doclet.Notice_taglet_unseen=Note: Custom tags that were not seen: {0}
 doclet.Notice_taglet_overriden=Note: Custom tags that override standard tags: {0}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css	Thu May 25 22:33:25 2017 +0000
@@ -789,4 +789,82 @@
     z-index: 1;
 }
 
+/*
+ * Styles for user-provided tables.
+ *
+ * borderless:
+ *      No borders, vertical margins, styled caption.
+ *      This style is provided for use with existing doc comments.
+ *      In general, borderless tables should not be used for layout purposes.
+ *
+ * plain:
+ *      Plain borders around table and cells, vertical margins, styled caption.
+ *      Best for small tables or for complex tables for tables with cells that span
+ *      rows and columns, when the "striped" style does not work well.
+ *
+ * striped:
+ *      Borders around the table and vertical borders between cells, striped rows,
+ *      vertical margins, styled caption.
+ *      Best for tables that have a header row, and a body containing a series of simple rows.
+ */
 
+table.borderless,
+table.plain,
+table.striped {
+    margin-top: 10px;
+    margin-bottom: 10px;
+}
+
+table.borderless > caption,
+table.plain > caption,
+table.striped > caption {
+    font-weight: bold;
+    font-size: smaller;
+}
+
+table.borderless th, table.borderless td,
+table.plain th, table.plain td,
+table.striped th, table.striped td {
+    padding: 2px 5px;
+}
+
+table.borderless,
+table.borderless > thead > tr > th, table.borderless > tbody > tr > th, table.borderless > tr > th,
+table.borderless > thead > tr > td, table.borderless > tbody > tr > td, table.borderless > tr > td {
+    border: none;
+}
+table.borderless > thead > tr, table.borderless > tbody > tr, table.borderless > tr {
+    background-color: transparent;
+}
+
+table.plain {
+    border-collapse: collapse;
+    border: 1px solid black;
+}
+table.plain > thead > tr, table.plain > tbody tr, table.plain > tr {
+    background-color: transparent;
+}
+table.plain > thead > tr > th, table.plain > tbody > tr > th, table.plain > tr > th,
+table.plain > thead > tr > td, table.plain > tbody > tr > td, table.plain > tr > td {
+    border: 1px solid black;
+}
+
+table.striped {
+    border-collapse: collapse;
+    border: 1px solid black;
+}
+table.striped > thead {
+    background-color: #DDD;
+    border: 1px solid black;
+}
+table.striped > tbody > tr:nth-child(even) {
+    background-color: #EEE
+}
+table.striped > tbody > tr:nth-child(odd) {
+    background-color: #FFF
+}
+table.striped > thead > tr > th, table.striped > tbody > tr > th,
+table.striped > tbody > tr > td, table.striped > tbody > tr > td {
+    border-left: 1px solid black;
+    border-right: 1px solid black;
+}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Group.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Group.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -27,7 +27,7 @@
 
 import java.util.*;
 
-import javax.lang.model.element.Element;
+import javax.lang.model.element.ModuleElement;
 import javax.lang.model.element.PackageElement;
 
 import jdk.javadoc.internal.doclets.toolkit.Configuration;
@@ -35,7 +35,7 @@
 
 
 /**
- * Process and manage grouping of packages, as specified by "-group" option on
+ * Process and manage grouping of elements, as specified by "-group" option on
  * the command line.
  * <p>
  * For example, if user has used -group option as
@@ -79,10 +79,10 @@
     private List<String> groupList = new ArrayList<>();
 
     /**
-     * Map of non-regular expressions(possible package names) with the
+     * Map of non-regular expressions(possible package or module names) with the
      * corresponding group name.
      */
-    private Map<String,String> pkgNameGroupMap = new HashMap<>();
+    private Map<String,String> elementNameGroupMap = new HashMap<>();
 
     /**
      * The global configuration information for this run.
@@ -107,11 +107,57 @@
     }
 
     /**
+     * Depending upon the format of the module name provided in the "-group"
+     * option, generate two separate maps. There will be a map for mapping
+     * regular expression(only meta character allowed is '*' and that is at the
+     * end of the regular expression) on to the group name. And another map
+     * for mapping (possible) module names(if the name format doesn't contain
+     * meta character '*', then it is assumed to be a module name) on to the
+     * group name. This will also sort all the regular expressions found in the
+     * reverse order of their lengths, i.e. longest regular expression will be
+     * first in the sorted list.
+     *
+     * @param groupname       The name of the group from -group option.
+     * @param moduleNameFormList List of the module name formats.
+     */
+    public boolean checkModuleGroups(String groupname, String moduleNameFormList) {
+        String[] mdlPatterns = moduleNameFormList.split(":");
+        if (groupList.contains(groupname)) {
+            initMessages();
+            messages.warning("doclet.Groupname_already_used", groupname);
+            return false;
+        }
+        groupList.add(groupname);
+        for (String mdlPattern : mdlPatterns) {
+            if (mdlPattern.length() == 0) {
+                initMessages();
+                messages.warning("doclet.Error_in_grouplist", groupname, moduleNameFormList);
+                return false;
+            }
+            if (mdlPattern.endsWith("*")) {
+                mdlPattern = mdlPattern.substring(0, mdlPattern.length() - 1);
+                if (foundGroupFormat(regExpGroupMap, mdlPattern)) {
+                    return false;
+                }
+                regExpGroupMap.put(mdlPattern, groupname);
+                sortedRegExpList.add(mdlPattern);
+            } else {
+                if (foundGroupFormat(elementNameGroupMap, mdlPattern)) {
+                    return false;
+                }
+                elementNameGroupMap.put(mdlPattern, groupname);
+            }
+        }
+        Collections.sort(sortedRegExpList, new MapKeyComparator());
+        return true;
+    }
+
+    /**
      * Depending upon the format of the package name provided in the "-group"
      * option, generate two separate maps. There will be a map for mapping
      * regular expression(only meta character allowed is '*' and that is at the
      * end of the regular expression) on to the group name. And another map
-     * for mapping (possible) package names(if the name format doesen't contain
+     * for mapping (possible) package names(if the name format doesn't contain
      * meta character '*', then it is assumed to be a package name) on to the
      * group name. This will also sort all the regular expressions found in the
      * reverse order of their lengths, i.e. longest regular expression will be
@@ -121,32 +167,31 @@
      * @param pkgNameFormList List of the package name formats.
      */
     public boolean checkPackageGroups(String groupname, String pkgNameFormList) {
-        StringTokenizer strtok = new StringTokenizer(pkgNameFormList, ":");
+        String[] pkgPatterns = pkgNameFormList.split(":");
         if (groupList.contains(groupname)) {
             initMessages();
             messages.warning("doclet.Groupname_already_used", groupname);
             return false;
         }
         groupList.add(groupname);
-        while (strtok.hasMoreTokens()) {
-            String id = strtok.nextToken();
-            if (id.length() == 0) {
+        for (String pkgPattern : pkgPatterns) {
+            if (pkgPattern.length() == 0) {
                 initMessages();
-                messages.warning("doclet.Error_in_packagelist", groupname, pkgNameFormList);
+                messages.warning("doclet.Error_in_grouplist", groupname, pkgNameFormList);
                 return false;
             }
-            if (id.endsWith("*")) {
-                id = id.substring(0, id.length() - 1);
-                if (foundGroupFormat(regExpGroupMap, id)) {
+            if (pkgPattern.endsWith("*")) {
+                pkgPattern = pkgPattern.substring(0, pkgPattern.length() - 1);
+                if (foundGroupFormat(regExpGroupMap, pkgPattern)) {
                     return false;
                 }
-                regExpGroupMap.put(id, groupname);
-                sortedRegExpList.add(id);
+                regExpGroupMap.put(pkgPattern, groupname);
+                sortedRegExpList.add(pkgPattern);
             } else {
-                if (foundGroupFormat(pkgNameGroupMap, id)) {
+                if (foundGroupFormat(elementNameGroupMap, pkgPattern)) {
                     return false;
                 }
-                pkgNameGroupMap.put(id, groupname);
+                elementNameGroupMap.put(pkgPattern, groupname);
             }
         }
         Collections.sort(sortedRegExpList, new MapKeyComparator());
@@ -162,39 +207,82 @@
     }
 
     /**
-     * Search if the given map has given the package format.
+     * Search if the given map has the given element format.
      *
      * @param map Map to be searched.
-     * @param pkgFormat The pacakge format to search.
+     * @param elementFormat The format to search.
      *
-     * @return true if package name format found in the map, else false.
+     * @return true if element name format found in the map, else false.
      */
-    boolean foundGroupFormat(Map<String,?> map, String pkgFormat) {
-        if (map.containsKey(pkgFormat)) {
+    boolean foundGroupFormat(Map<String,?> map, String elementFormat) {
+        if (map.containsKey(elementFormat)) {
             initMessages();
-            messages.error("doclet.Same_package_name_used", pkgFormat);
+            messages.error("doclet.Same_element_name_used", elementFormat);
             return true;
         }
         return false;
     }
 
     /**
+     * Group the modules according the grouping information provided on the
+     * command line. Given a list of modules, search each module name in
+     * regular expression map as well as module name map to get the
+     * corresponding group name. Create another map with mapping of group name
+     * to the module list, which will fall under the specified group. If any
+     * module doesn't belong to any specified group on the command line, then
+     * a new group named "Other Modules" will be created for it. If there are
+     * no groups found, in other words if "-group" option is not at all used,
+     * then all the modules will be grouped under group "Modules".
+     *
+     * @param modules Specified modules.
+     * @return map of group names and set of module elements.
+     */
+    public Map<String, SortedSet<ModuleElement>> groupModules(Set<ModuleElement> modules) {
+        Map<String, SortedSet<ModuleElement>> groupModuleMap = new HashMap<>();
+        String defaultGroupName =
+            (elementNameGroupMap.isEmpty() && regExpGroupMap.isEmpty())?
+                configuration.getResources().getText("doclet.Modules") :
+                configuration.getResources().getText("doclet.Other_Modules");
+        // if the user has not used the default group name, add it
+        if (!groupList.contains(defaultGroupName)) {
+            groupList.add(defaultGroupName);
+        }
+        for (ModuleElement mdl : modules) {
+            String moduleName = mdl.isUnnamed() ? null : mdl.getQualifiedName().toString();
+            String groupName = mdl.isUnnamed() ? null : elementNameGroupMap.get(moduleName);
+            // if this module is not explicitly assigned to a group,
+            // try matching it to group specified by regular expression
+            if (groupName == null) {
+                groupName = regExpGroupName(moduleName);
+            }
+            // if it is in neither group map, put it in the default
+            // group
+            if (groupName == null) {
+                groupName = defaultGroupName;
+            }
+            getModuleList(groupModuleMap, groupName).add(mdl);
+        }
+        return groupModuleMap;
+    }
+
+    /**
      * Group the packages according the grouping information provided on the
      * command line. Given a list of packages, search each package name in
      * regular expression map as well as package name map to get the
      * corresponding group name. Create another map with mapping of group name
      * to the package list, which will fall under the specified group. If any
-     * package doesen't belong to any specified group on the comamnd line, then
+     * package doesn't belong to any specified group on the command line, then
      * a new group named "Other Packages" will be created for it. If there are
      * no groups found, in other words if "-group" option is not at all used,
      * then all the packages will be grouped under group "Packages".
      *
      * @param packages Packages specified on the command line.
+     * @return map of group names and set of package elements
      */
     public Map<String, SortedSet<PackageElement>> groupPackages(Set<PackageElement> packages) {
         Map<String, SortedSet<PackageElement>> groupPackageMap = new HashMap<>();
         String defaultGroupName =
-            (pkgNameGroupMap.isEmpty() && regExpGroupMap.isEmpty())?
+            (elementNameGroupMap.isEmpty() && regExpGroupMap.isEmpty())?
                 configuration.getResources().getText("doclet.Packages") :
                 configuration.getResources().getText("doclet.Other_Packages");
         // if the user has not used the default group name, add it
@@ -203,7 +291,7 @@
         }
         for (PackageElement pkg : packages) {
             String pkgName = pkg.isUnnamed() ? null : configuration.utils.getPackageName(pkg);
-            String groupName = pkg.isUnnamed() ? null : pkgNameGroupMap.get(pkgName);
+            String groupName = pkg.isUnnamed() ? null : elementNameGroupMap.get(pkgName);
             // if this package is not explicitly assigned to a group,
             // try matching it to group specified by regular expression
             if (groupName == null) {
@@ -220,15 +308,15 @@
     }
 
     /**
-     * Search for package name in the sorted regular expression
+     * Search for element name in the sorted regular expression
      * list, if found return the group name.  If not, return null.
      *
-     * @param pkgName Name of package to be found in the regular
+     * @param elementName Name of element to be found in the regular
      * expression list.
      */
-    String regExpGroupName(String pkgName) {
+    String regExpGroupName(String elementName) {
         for (String regexp : sortedRegExpList) {
-            if (pkgName.startsWith(regexp)) {
+            if (elementName.startsWith(regexp)) {
                 return regExpGroupMap.get(regexp);
             }
         }
@@ -239,7 +327,7 @@
      * For the given group name, return the package list, on which it is mapped.
      * Create a new list, if not found.
      *
-     * @param map Map to be searched for gorup name.
+     * @param map Map to be searched for group name.
      * @param groupname Group name to search.
      */
     SortedSet<PackageElement> getPkgList(Map<String, SortedSet<PackageElement>> map,
@@ -248,6 +336,18 @@
     }
 
     /**
+     * For the given group name, return the module list, on which it is mapped.
+     * Create a new list, if not found.
+     *
+     * @param map Map to be searched for group name.
+     * @param groupname Group name to search.
+     */
+    SortedSet<ModuleElement> getModuleList(Map<String, SortedSet<ModuleElement>> map,
+            String groupname) {
+        return map.computeIfAbsent(groupname, g -> new TreeSet<>(configuration.utils.makeModuleComparator()));
+    }
+
+    /**
      * Return the list of groups, in the same order as specified
      * on the command line.
      */
--- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ArgTokenizer.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ArgTokenizer.java	Thu May 25 22:33:25 2017 +0000
@@ -121,6 +121,17 @@
     }
 
     /**
+     * Is the specified option allowed.
+     *
+     * @param opt the option to check
+     * @return true if the option is allowed
+     */
+    boolean isAllowedOption(String opt) {
+        Boolean has = options.get(opt);
+        return has != null;
+    }
+
+    /**
      * Has the specified option been encountered.
      *
      * @param opt the option to check
--- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java	Thu May 25 22:33:25 2017 +0000
@@ -90,7 +90,6 @@
 import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING;
 import static java.nio.file.StandardOpenOption.WRITE;
 import java.util.MissingResourceException;
-import java.util.Optional;
 import java.util.ResourceBundle;
 import java.util.ServiceLoader;
 import java.util.Spliterators;
@@ -126,6 +125,7 @@
 public class JShellTool implements MessageHandler {
 
     private static final Pattern LINEBREAK = Pattern.compile("\\R");
+    private static final Pattern ID = Pattern.compile("[se]?\\d+([-\\s].*)?");
             static final String RECORD_SEPARATOR = "\u241E";
     private static final String RB_NAME_PREFIX  = "jdk.internal.jshell.tool.resources";
     private static final String VERSION_RB_NAME = RB_NAME_PREFIX + ".version";
@@ -1189,36 +1189,54 @@
         }
     }
 
-    private void processCommand(String cmd) {
-        if (cmd.startsWith("/-")) {
+    /**
+     * Process a command (as opposed to a snippet) -- things that start with
+     * slash.
+     *
+     * @param input
+     */
+    private void processCommand(String input) {
+        if (input.startsWith("/-")) {
             try {
                 //handle "/-[number]"
-                cmdUseHistoryEntry(Integer.parseInt(cmd.substring(1)));
+                cmdUseHistoryEntry(Integer.parseInt(input.substring(1)));
                 return ;
             } catch (NumberFormatException ex) {
                 //ignore
             }
         }
-        String arg = "";
-        int idx = cmd.indexOf(' ');
+        String cmd;
+        String arg;
+        int idx = input.indexOf(' ');
         if (idx > 0) {
-            arg = cmd.substring(idx + 1).trim();
-            cmd = cmd.substring(0, idx);
+            arg = input.substring(idx + 1).trim();
+            cmd = input.substring(0, idx);
+        } else {
+            cmd = input;
+            arg = "";
         }
+        // find the command as a "real command", not a pseudo-command or doc subject
         Command[] candidates = findCommand(cmd, c -> c.kind.isRealCommand);
         switch (candidates.length) {
             case 0:
-                if (!rerunHistoryEntryById(cmd.substring(1))) {
-                    errormsg("jshell.err.no.such.command.or.snippet.id", cmd);
+                // not found, it is either a snippet command or an error
+                if (ID.matcher(cmd.substring(1)).matches()) {
+                    // it is in the form of a snipppet id, see if it is a valid history reference
+                    rerunHistoryEntriesById(input);
+                } else {
+                    errormsg("jshell.err.invalid.command", cmd);
                     fluffmsg("jshell.msg.help.for.help");
-                }   break;
+                }
+                break;
             case 1:
                 Command command = candidates[0];
                 // If comand was successful and is of a replayable kind, add it the replayable history
                 if (command.run.apply(arg) && command.kind == CommandKind.REPLAY) {
                     addToReplayHistory((command.command + " " + arg).trim());
-                }   break;
+                }
+                break;
             default:
+                // command if too short (ambigous), show the possibly matches
                 errormsg("jshell.err.command.ambiguous", cmd,
                         Arrays.stream(candidates).map(c -> c.command).collect(Collectors.joining(", ")));
                 fluffmsg("jshell.msg.help.for.help");
@@ -1701,6 +1719,9 @@
         registerCommand(new Command("context",
                 "help.context",
                 CommandKind.HELP_SUBJECT));
+        registerCommand(new Command("rerun",
+                "help.rerun",
+                CommandKind.HELP_SUBJECT));
 
         commandCompletions = new ContinuousCompletionProvider(
                 commands.values().stream()
@@ -2247,6 +2268,20 @@
             Predicate<Snippet> defFilter, String rawargs, String cmd) {
         ArgTokenizer at = new ArgTokenizer(cmd, rawargs.trim());
         at.allowedOptions("-all", "-start");
+        return argsOptionsToSnippets(snippetSupplier, defFilter, at);
+    }
+
+    /**
+     * Convert user arguments to a Stream of snippets referenced by those
+     * arguments (or lack of arguments).
+     *
+     * @param snippets the base list of possible snippets
+     * @param defFilter the filter to apply to the arguments if no argument
+     * @param at the ArgTokenizer, with allowed options set
+     * @return
+     */
+    private <T extends Snippet> Stream<T> argsOptionsToSnippets(Supplier<Stream<T>> snippetSupplier,
+            Predicate<Snippet> defFilter, ArgTokenizer at) {
         List<String> args = new ArrayList<>();
         String s;
         while ((s = at.next()) != null) {
@@ -2263,11 +2298,11 @@
             errormsg("jshell.err.conflicting.options", at.whole());
             return null;
         }
-        if (at.hasOption("-all")) {
+        if (at.isAllowedOption("-all") && at.hasOption("-all")) {
             // all snippets including start-up, failed, and overwritten
             return snippetSupplier.get();
         }
-        if (at.hasOption("-start")) {
+        if (at.isAllowedOption("-start") && at.hasOption("-start")) {
             // start-up snippets
             return snippetSupplier.get()
                     .filter(this::inStartUp);
@@ -2277,54 +2312,227 @@
             return snippetSupplier.get()
                     .filter(defFilter);
         }
-        return argsToSnippets(snippetSupplier, args);
+        return new ArgToSnippets<>(snippetSupplier).argsToSnippets(args);
     }
 
     /**
-     * Convert user arguments to a Stream of snippets referenced by those
-     * arguments.
+     * Support for converting arguments that are definition names, snippet ids,
+     * or snippet id ranges into a stream of snippets,
      *
-     * @param snippetSupplier the base list of possible snippets
-     * @param args the user's argument to the command, maybe be the empty list
-     * @return a Stream of referenced snippets or null if no matches to specific
-     * arg
+     * @param <T> the snipper subtype
      */
-    private <T extends Snippet> Stream<T> argsToSnippets(Supplier<Stream<T>> snippetSupplier,
-            List<String> args) {
-        Stream<T> result = null;
-        for (String arg : args) {
+    private class ArgToSnippets<T extends Snippet> {
+
+        // the supplier of snippet streams
+        final Supplier<Stream<T>> snippetSupplier;
+        // these two are parallel, and lazily filled if a range is encountered
+        List<T> allSnippets;
+        String[] allIds = null;
+
+        /**
+         *
+         * @param snippetSupplier the base list of possible snippets
+        */
+        ArgToSnippets(Supplier<Stream<T>> snippetSupplier) {
+            this.snippetSupplier = snippetSupplier;
+        }
+
+        /**
+         * Convert user arguments to a Stream of snippets referenced by those
+         * arguments.
+         *
+         * @param args the user's argument to the command, maybe be the empty
+         * list
+         * @return a Stream of referenced snippets or null if no matches to
+         * specific arg
+         */
+        Stream<T> argsToSnippets(List<String> args) {
+            Stream<T> result = null;
+            for (String arg : args) {
+                // Find the best match
+                Stream<T> st = argToSnippets(arg);
+                if (st == null) {
+                    return null;
+                } else {
+                    result = (result == null)
+                            ? st
+                            : Stream.concat(result, st);
+                }
+            }
+            return result;
+        }
+
+        /**
+         * Convert a user argument to a Stream of snippets referenced by the
+         * argument.
+         *
+         * @param snippetSupplier the base list of possible snippets
+         * @param arg the user's argument to the command
+         * @return a Stream of referenced snippets or null if no matches to
+         * specific arg
+         */
+        Stream<T> argToSnippets(String arg) {
+            if (arg.contains("-")) {
+                return range(arg);
+            }
             // Find the best match
             Stream<T> st = layeredSnippetSearch(snippetSupplier, arg);
             if (st == null) {
-                Stream<Snippet> est = layeredSnippetSearch(state::snippets, arg);
-                if (est == null) {
+                badSnippetErrormsg(arg);
+                return null;
+            } else {
+                return st;
+            }
+        }
+
+        /**
+         * Look for inappropriate snippets to give best error message
+         *
+         * @param arg the bad snippet arg
+         * @param errKey the not found error key
+         */
+        void badSnippetErrormsg(String arg) {
+            Stream<Snippet> est = layeredSnippetSearch(state::snippets, arg);
+            if (est == null) {
+                if (ID.matcher(arg).matches()) {
+                    errormsg("jshell.err.no.snippet.with.id", arg);
+                } else {
                     errormsg("jshell.err.no.such.snippets", arg);
-                } else {
-                    errormsg("jshell.err.the.snippet.cannot.be.used.with.this.command",
-                            arg, est.findFirst().get().source());
                 }
-                return null;
-            }
-            if (result == null) {
-                result = st;
             } else {
-                result = Stream.concat(result, st);
+                errormsg("jshell.err.the.snippet.cannot.be.used.with.this.command",
+                        arg, est.findFirst().get().source());
             }
         }
-        return result;
-    }
-
-    private <T extends Snippet> Stream<T> layeredSnippetSearch(Supplier<Stream<T>> snippetSupplier, String arg) {
-        return nonEmptyStream(
-                // the stream supplier
-                snippetSupplier,
-                // look for active user declarations matching the name
-                sn -> isActive(sn) && matchingDeclaration(sn, arg),
-                // else, look for any declarations matching the name
-                sn -> matchingDeclaration(sn, arg),
-                // else, look for an id of this name
-                sn -> sn.id().equals(arg)
-        );
+
+        /**
+         * Search through the snippets for the best match to the id/name.
+         *
+         * @param <R> the snippet type
+         * @param aSnippetSupplier the supplier of snippet streams
+         * @param arg the arg to match
+         * @return a Stream of referenced snippets or null if no matches to
+         * specific arg
+         */
+        <R extends Snippet> Stream<R> layeredSnippetSearch(Supplier<Stream<R>> aSnippetSupplier, String arg) {
+            return nonEmptyStream(
+                    // the stream supplier
+                    aSnippetSupplier,
+                    // look for active user declarations matching the name
+                    sn -> isActive(sn) && matchingDeclaration(sn, arg),
+                    // else, look for any declarations matching the name
+                    sn -> matchingDeclaration(sn, arg),
+                    // else, look for an id of this name
+                    sn -> sn.id().equals(arg)
+            );
+        }
+
+        /**
+         * Given an id1-id2 range specifier, return a stream of snippets within
+         * our context
+         *
+         * @param arg the range arg
+         * @return a Stream of referenced snippets or null if no matches to
+         * specific arg
+         */
+        Stream<T> range(String arg) {
+            int dash = arg.indexOf('-');
+            String iid = arg.substring(0, dash);
+            String tid = arg.substring(dash + 1);
+            int iidx = snippetIndex(iid);
+            if (iidx < 0) {
+                return null;
+            }
+            int tidx = snippetIndex(tid);
+            if (tidx < 0) {
+                return null;
+            }
+            if (tidx < iidx) {
+                errormsg("jshell.err.end.snippet.range.less.than.start", iid, tid);
+                return null;
+            }
+            return allSnippets.subList(iidx, tidx+1).stream();
+        }
+
+        /**
+         * Lazily initialize the id mapping -- needed only for id ranges.
+         */
+        void initIdMapping() {
+            if (allIds == null) {
+                allSnippets = snippetSupplier.get()
+                        .sorted((a, b) -> order(a) - order(b))
+                        .collect(toList());
+                allIds = allSnippets.stream()
+                        .map(sn -> sn.id())
+                        .toArray(n -> new String[n]);
+            }
+        }
+
+        /**
+         * Return all the snippet ids -- within the context, and in order.
+         *
+         * @return the snippet ids
+         */
+        String[] allIds() {
+            initIdMapping();
+            return allIds;
+        }
+
+        /**
+         * Establish an order on snippet ids.  All startup snippets are first,
+         * all error snippets are last -- within that is by snippet number.
+         *
+         * @param id the id string
+         * @return an ordering int
+         */
+        int order(String id) {
+            try {
+                switch (id.charAt(0)) {
+                    case 's':
+                        return Integer.parseInt(id.substring(1));
+                    case 'e':
+                        return 0x40000000 + Integer.parseInt(id.substring(1));
+                    default:
+                        return 0x20000000 + Integer.parseInt(id);
+                }
+            } catch (Exception ex) {
+                return 0x60000000;
+            }
+        }
+
+        /**
+         * Establish an order on snippets, based on its snippet id. All startup
+         * snippets are first, all error snippets are last -- within that is by
+         * snippet number.
+         *
+         * @param sn the id string
+         * @return an ordering int
+         */
+        int order(Snippet sn) {
+            return order(sn.id());
+        }
+
+        /**
+         * Find the index into the parallel allSnippets and allIds structures.
+         *
+         * @param s the snippet id name
+         * @return the index, or, if not found, report the error and return a
+         * negative number
+         */
+        int snippetIndex(String s) {
+            int idx = Arrays.binarySearch(allIds(), 0, allIds().length, s,
+                    (a, b) -> order(a) - order(b));
+            if (idx < 0) {
+                // the id is not in the snippet domain, find the right error to report
+                if (!ID.matcher(s).matches()) {
+                    errormsg("jshell.err.range.requires.id", s);
+                } else {
+                    badSnippetErrormsg(s);
+                }
+            }
+            return idx;
+        }
+
     }
 
     private boolean cmdDrop(String rawargs) {
@@ -2342,24 +2550,13 @@
             errormsg("jshell.err.drop.arg");
             return false;
         }
-        Stream<Snippet> stream = argsToSnippets(this::dropableSnippets, args);
+        Stream<Snippet> stream = new ArgToSnippets<>(this::dropableSnippets).argsToSnippets(args);
         if (stream == null) {
             // Snippet not found. Error already printed
             fluffmsg("jshell.msg.see.classes.etc");
             return false;
         }
-        List<Snippet> snippets = stream.collect(toList());
-        if (snippets.size() > args.size()) {
-            // One of the args references more thean one snippet
-            errormsg("jshell.err.drop.ambiguous");
-            fluffmsg("jshell.msg.use.one.of", snippets.stream()
-                    .map(sn -> String.format("\n/drop %-5s :   %s", sn.id(), sn.source().replace("\n", "\n       ")))
-                    .collect(Collectors.joining(", "))
-            );
-            return false;
-        }
-        snippets.stream()
-                .forEach(sn -> state.drop(sn).forEach(this::handleEvent));
+        stream.forEach(sn -> state.drop(sn).forEach(this::handleEvent));
         return true;
     }
 
@@ -2690,37 +2887,38 @@
     }
 
     private boolean cmdSave(String rawargs) {
-        ArgTokenizer at = new ArgTokenizer("/save", rawargs.trim());
-        at.allowedOptions("-all", "-start", "-history");
-        String filename = at.next();
-        if (filename == null) {
+        // The filename to save to is the last argument, extract it
+        String[] args = rawargs.split("\\s");
+        String filename = args[args.length - 1];
+        if (filename.isEmpty()) {
             errormsg("jshell.err.file.filename", "/save");
             return false;
         }
-        if (!checkOptionsAndRemainingInput(at)) {
-            return false;
-        }
-        if (at.optionCount() > 1) {
-            errormsg("jshell.err.conflicting.options", at.whole());
+        // All the non-filename arguments are the specifier of what to save
+        String srcSpec = Arrays.stream(args, 0, args.length - 1)
+                .collect(Collectors.joining("\n"));
+        // From the what to save specifier, compute the snippets (as a stream)
+        ArgTokenizer at = new ArgTokenizer("/save", srcSpec);
+        at.allowedOptions("-all", "-start", "-history");
+        Stream<Snippet> snippetStream = argsOptionsToSnippets(state::snippets, this::mainActive, at);
+        if (snippetStream == null) {
+            // error occurred, already reported
             return false;
         }
         try (BufferedWriter writer = Files.newBufferedWriter(toPathResolvingUserHome(filename),
                 Charset.defaultCharset(),
                 CREATE, TRUNCATE_EXISTING, WRITE)) {
             if (at.hasOption("-history")) {
+                // they want history (commands and snippets), ignore the snippet stream
                 for (String s : input.currentSessionHistory()) {
                     writer.write(s);
                     writer.write("\n");
                 }
-            } else if (at.hasOption("-start")) {
-                writer.append(startup.toString());
             } else {
-                String sources = (at.hasOption("-all")
-                        ? state.snippets()
-                        : state.snippets().filter(this::mainActive))
+                // write the snippet stream to the file
+                writer.write(snippetStream
                         .map(Snippet::source)
-                        .collect(Collectors.joining("\n"));
-                writer.write(sources);
+                        .collect(Collectors.joining("\n")));
             }
         } catch (FileNotFoundException e) {
             errormsg("jshell.err.file.not.found", "/save", filename, e.getMessage());
@@ -2837,14 +3035,21 @@
         return true;
     }
 
-    private boolean rerunHistoryEntryById(String id) {
-        Optional<Snippet> snippet = state.snippets()
-            .filter(s -> s.id().equals(id))
-            .findFirst();
-        return snippet.map(s -> {
-            rerunSnippet(s);
-            return true;
-        }).orElse(false);
+    /**
+     * Handle snippet reevaluation commands: {@code /<id>}. These commands are a
+     * sequence of ids and id ranges (names are permitted, though not in the
+     * first position. Support for names is purposely not documented).
+     *
+     * @param rawargs the whole command including arguments
+     */
+    private void rerunHistoryEntriesById(String rawargs) {
+        ArgTokenizer at = new ArgTokenizer("/<id>", rawargs.trim().substring(1));
+        at.allowedOptions();
+        Stream<Snippet> stream = argsOptionsToSnippets(state::snippets, sn -> true, at);
+        if (stream != null) {
+            // successfully parsed, rerun snippets
+            stream.forEach(sn -> rerunSnippet(sn));
+        }
     }
 
     private void rerunSnippet(Snippet snippet) {
--- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties	Thu May 25 22:33:25 2017 +0000
@@ -50,7 +50,7 @@
 jshell.err.startup.unexpected.exception = Unexpected exception reading start-up: {0}
 jshell.err.unexpected.exception = Unexpected exception: {0}
 
-jshell.err.no.such.command.or.snippet.id = No such command or snippet id: {0}
+jshell.err.invalid.command = Invalid command: {0}
 jshell.err.command.ambiguous = Command: ''{0}'' is ambiguous: {1}
 jshell.msg.set.restore = Setting new options and restoring state.
 jshell.msg.set.editor.set = Editor set to: {0}
@@ -105,10 +105,13 @@
 Subjects:\n\
 \n
 
+jshell.err.no.snippet.with.id = No snippet with id: {0}
+jshell.err.end.snippet.range.less.than.start = End of snippet range less than start: {0} - {1}
+jshell.err.range.requires.id = Snippet ranges require snippet ids: {0}
+
 jshell.err.drop.arg =\
 In the /drop argument, please specify an import, variable, method, or class to drop.\n\
 Specify by id or name. Use /list to see ids. Use /reset to reset all state.
-jshell.err.drop.ambiguous = The argument references more than one import, variable, method, or class.
 jshell.err.failed = Failed.
 jshell.msg.native.method = Native Method
 jshell.msg.unknown.source = Unknown Source
@@ -225,7 +228,11 @@
 /list <name>\n\t\
     List snippets with the specified name (preference for active snippets)\n\n\
 /list <id>\n\t\
-    List the snippet with the specified snippet id
+    List the snippet with the specified snippet id\n\n\
+/list <id> <id>...\n\t\
+    List the snippets with the specified snippet ids\n\n\
+/list <id>-<id>\n\t\
+    List the snippets within the range of snippet ids
 
 help.edit.summary = edit a source entry referenced by name or id
 help.edit.args = <name or id>
@@ -238,6 +245,10 @@
     Edit the snippet or snippets with the specified name (preference for active snippets)\n\n\
 /edit <id>\n\t\
     Edit the snippet with the specified snippet id\n\n\
+/edit <id> <id>...\n\t\
+    Edit the snippets with the specified snippet ids\n\n\
+/edit <id>-<id>\n\t\
+    Edit the snippets within the range of snippet ids\n\n\
 /edit\n\t\
     Edit the currently active snippets of code that you typed or read with /open
 
@@ -249,7 +260,11 @@
 /drop <name>\n\t\
     Drop the snippet with the specified name\n\n\
 /drop <id>\n\t\
-    Drop the snippet with the specified snippet id
+    Drop the snippet with the specified snippet id\n\n\
+/drop <id> <id>...\n\t\
+    Drop the snippets with the specified snippet ids\n\n\
+/drop <id>-<id>\n\t\
+    Drop the snippets within the range of snippet ids
 
 help.save.summary = Save snippet source to a file.
 help.save.args = [-all|-history|-start] <file>
@@ -264,7 +279,13 @@
 /save -history <file>\n\t\
     Save the sequential history of all commands and snippets entered since jshell was launched.\n\n\
 /save -start <file>\n\t\
-    Save the current start-up definitions to the file.
+    Save the current start-up definitions to the file.\n\n\
+/save <id> <file>\n\t\
+    Save the snippet with the specified snippet id\n\n\
+/save <id> <id>... <file>\n\t\
+    Save the snippets with the specified snippet ids\n\n\
+/save <id>-<id> <file>\n\t\
+    Save the snippets within the range of snippet ids
 
 help.open.summary = open a file as source input
 help.open.args = <file>
@@ -285,6 +306,10 @@
     List jshell variables with the specified name (preference for active variables)\n\n\
 /vars <id>\n\t\
     List the jshell variable with the specified snippet id\n\n\
+/vars <id> <id>... <file>\n\t\
+    List the jshell variables with the specified snippet ids\n\n\
+/vars <id>-<id> <file>\n\t\
+    List the jshell variables within the range of snippet ids\n\n\
 /vars -start\n\t\
     List the automatically added start-up jshell variables\n\n\
 /vars -all\n\t\
@@ -301,6 +326,10 @@
     List jshell methods with the specified name (preference for active methods)\n\n\
 /methods <id>\n\t\
     List the jshell method with the specified snippet id\n\n\
+/methods <id> <id>... <file>\n\t\
+    List jshell methods with the specified snippet ids\n\n\
+/methods <id>-<id> <file>\n\t\
+    List jshell methods within the range of snippet ids\n\n\
 /methods -start\n\t\
     List the automatically added start-up jshell methods\n\n\
 /methods -all\n\t\
@@ -317,6 +346,10 @@
     List jshell types with the specified name (preference for active types)\n\n\
 /types <id>\n\t\
     List the jshell type with the specified snippet id\n\n\
+/types <id> <id>... <file>\n\t\
+    List jshell types with the specified snippet ids\n\n\
+/types <id>-<id> <file>\n\t\
+    List jshell types within the range of snippet ids\n\n\
 /types -start\n\t\
     List the automatically added start-up jshell types\n\n\
 /types -all\n\t\
@@ -461,17 +494,24 @@
 /? <subject>\n\t\
      Display information about the specified help subject. Example: /? intro
 
-help.bang.summary = re-run last snippet
+help.bang.summary = rerun last snippet -- see /help rerun
 help.bang.args =
 help.bang =\
 Reevaluate the most recently entered snippet.
 
-help.id.summary = re-run snippet by id
+help.id.summary = rerun snippets by id or id range -- see /help rerun
 help.id.args =
 help.id =\
-Reevaluate the snippet specified by the id.
+/<id> <id> <id>\n\
+\n\
+/<id>-<id>\n\
+\n\
+Reevaluate the snippets specified by the id or id range.\n\
+An id range is represented as a two ids separated by a hyphen, e.g.:  3-17\n\
+Start-up and error snippets maybe used, e.g.:  s3-s9    or   e1-e4\n\
+Any number of ids or id ranges may be used, e.g.:  /3-7 s4 14-16 e2
 
-help.previous.summary = re-run n-th previous snippet
+help.previous.summary = rerun n-th previous snippet -- see /help rerun
 help.previous.args =
 help.previous =\
 Reevaluate the n-th most recently entered snippet.
@@ -509,7 +549,7 @@
         then release and press "i", and jshell will propose possible imports\n\t\t\
         which will resolve the identifier based on the content of the specified classpath.
 
-help.context.summary = the evaluation context options for /env /reload and /reset
+help.context.summary = a description of the evaluation context options for /env /reload and /reset
 help.context =\
 These options configure the evaluation context, they can be specified when\n\
 jshell is started: on the command-line, or restarted with the commands /env,\n\
@@ -540,6 +580,38 @@
 On the command-line these options must have two dashes, e.g.: --module-path\n\
 On jshell commands they can have one or two dashes, e.g.: -module-path\n\
 
+help.rerun.summary = a description of ways to re-evaluate previously entered snippets
+help.rerun =\
+There are four ways to re-evaluate previously entered snippets.\n\
+The last snippet can be re-evaluated using: /!\n\
+The n-th previous snippet can be re-evaluated by slash-minus and the digits of n, e.g.:  /-4\n\
+For example:\n\
+\n\
+    \tjshell> 2 + 2\n\
+    \t$1 ==> 4\n\
+\n\
+    \tjshell> /!\n\
+    \t2 + 2\n\
+    \t$2 ==> 4\n\
+\n\
+    \tjshell> int z\n\
+    \tz ==> 0\n\
+\n\
+    \tjshell> /-1\n\
+    \tint z;\n\
+    \tz ==> 0\n\
+\n\
+    \tjshell> /-4\n\
+    \t2 + 2\n\
+    \t$5 ==> 4\n\
+\n\
+The snippets to re-evaluate may be specified by snippet id or id range.\n\
+An id range is represented as a two ids separated by a hyphen, e.g.:  3-17\n\
+Start-up and error snippets maybe used, e.g.:  s3-s9    or   e1-e4\n\
+Any number of ids or id ranges may be used, e.g.:  /3-7 s4 14-16 e2\n\
+\n\
+Finally, you can search backwards through history by entering ctrl-R followed by the string to search for.
+
 help.set._retain = \
 The '-retain' option saves a setting so that it is used in future sessions.\n\
 The -retain option can be used on the following forms of /set:\n\n\t\
--- a/langtools/test/jdk/javadoc/doclet/testModules/TestModules.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/test/jdk/javadoc/doclet/testModules/TestModules.java	Thu May 25 22:33:25 2017 +0000
@@ -25,6 +25,7 @@
  * @test
  * @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363
  *      8168766 8168688 8162674 8160196 8175799 8174974 8176778 8177562 8175218 8175823 8166306
+ *      8178043
  * @summary Test modules support in javadoc.
  * @author bpatel
  * @library ../lib
@@ -326,6 +327,54 @@
         checkAllModulesLink(false);
     }
 
+    /**
+     * Test -group option for modules. The overview-summary.html page should group the modules accordingly.
+     */
+    @Test
+    void testGroupOption() {
+        javadoc("-d", "out-group", "--show-module-contents=all",
+                "-tag", "regular:a:Regular Tag:",
+                "-tag", "moduletag:s:Module Tag:",
+                "--module-source-path", testSrc,
+                "-group", "Module Group A", "moduleA*",
+                "-group", "Module Group B & C", "moduleB*:moduleC*",
+                "-group", "Java SE Modules", "java*",
+                "--module", "moduleA,moduleB,moduleC,moduletags",
+                "moduleA/concealedpkgmdlA", "testpkgmdlA", "testpkg2mdlB", "testpkgmdlB", "testpkgmdlC",
+                "testpkgmdltags");
+        checkExit(Exit.OK);
+        checkGroupOption();
+    }
+
+    /**
+     * Test -group option for unnamed modules. The overview-summary.html page should group the packages accordingly.
+     */
+    @Test
+    void testUnnamedModuleGroupOption() {
+        javadoc("-d", "out-groupnomodule", "-use",
+                "-overview", testSrc("overview.html"),
+                "-sourcepath", testSrc,
+                "-group", "Package Group 0", "testpkgnomodule",
+                "-group", "Package Group 1", "testpkgnomodule1",
+                "testpkgnomodule", "testpkgnomodule1");
+        checkExit(Exit.OK);
+        checkUnnamedModuleGroupOption();
+    }
+
+    /**
+     * Test -group option for a single module.
+     */
+    @Test
+    void testGroupOptionSingleModule() {
+        javadoc("-d", "out-groupsinglemodule", "-use",
+                "--module-source-path", testSrc,
+                "-group", "Module Group B", "moduleB*",
+                "--module", "moduleB",
+                "testpkg2mdlB", "testpkgmdlB");
+        checkExit(Exit.OK);
+        //checkOverviewSummaryPackages();
+    }
+
     void checkDescription(boolean found) {
         checkOutput("moduleA-summary.html", found,
                 "<!-- ============ MODULE DESCRIPTION =========== -->\n"
@@ -346,8 +395,10 @@
                 + "<div class=\"contentContainer\">\n"
                 + "<div class=\"block\">The overview summary page header.</div>\n"
                 + "</div>\n"
-                + "<div class=\"contentContainer\">\n"
-                + "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
+                + "<div class=\"contentContainer\"><a name=\"Modules\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<table class=\"overviewSummary\" summary=\"Modules table, listing modules, and an explanation\">\n"
                 + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
         checkOutput("overview-summary.html", false,
                 "</table>\n"
@@ -355,8 +406,10 @@
                 + "<div class=\"contentContainer\">\n"
                 + "<div class=\"block\">The overview summary page header.</div>\n"
                 + "</div>\n"
-                + "<div class=\"contentContainer\">\n"
-                + "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
+                + "<div class=\"contentContainer\"><a name=\"Modules\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<table class=\"overviewSummary\" summary=\"Modules table, listing modules, and an explanation\">\n"
                 + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
     }
 
@@ -405,7 +458,9 @@
                 + "<div class=\"contentContainer\">\n"
                 + "<div class=\"block\">The overview summary page header.</div>\n"
                 + "</div>\n"
-                + "<div class=\"contentContainer\">\n"
+                + "<div class=\"contentContainer\"><a id=\"Modules\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
                 + "<table class=\"overviewSummary\">\n"
                 + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
         checkOutput("overview-summary.html", false,
@@ -416,7 +471,9 @@
                 + "<div class=\"contentContainer\">\n"
                 + "<div class=\"block\">The overview summary page header.</div>\n"
                 + "</div>\n"
-                + "<div class=\"contentContainer\">\n"
+                + "<div class=\"contentContainer\"><a id=\"Modules\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
                 + "<table class=\"overviewSummary\">\n"
                 + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
     }
@@ -495,7 +552,7 @@
 
     void checkOverviewSummaryModules() {
         checkOutput("overview-summary.html", true,
-                "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
+                "<table class=\"overviewSummary\" summary=\"Modules table, listing modules, and an explanation\">\n"
                 + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
                 + "<tr>\n"
                 + "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
@@ -512,7 +569,7 @@
 
     void checkOverviewSummaryPackages() {
         checkOutput("overview-summary.html", false,
-                "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
+                "<table class=\"overviewSummary\" summary=\"Modules table, listing modules, and an explanation\">\n"
                 + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
                 + "<tr>\n"
                 + "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
@@ -523,7 +580,9 @@
                 + "<div class=\"contentContainer\">\n"
                 + "<div class=\"block\">The overview summary page header.</div>\n"
                 + "</div>\n"
-                + "<div class=\"contentContainer\">\n"
+                + "<div class=\"contentContainer\"><a name=\"Packages\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
                 + "<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
                 + "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>");
         checkOutput("overview-summary.html", true,
@@ -537,7 +596,9 @@
                 + "<div class=\"contentContainer\">\n"
                 + "<div class=\"block\">The overview summary page header.</div>\n"
                 + "</div>\n"
-                + "<div class=\"contentContainer\">\n"
+                + "<div class=\"contentContainer\"><a name=\"Packages\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
                 + "<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
                 + "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>");
     }
@@ -574,7 +635,9 @@
                 + "<div class=\"contentContainer\">\n"
                 + "<div class=\"block\">The overview summary page header.</div>\n"
                 + "</div>\n"
-                + "<div class=\"contentContainer\">\n"
+                + "<div class=\"contentContainer\"><a id=\"Packages\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
                 + "<table class=\"overviewSummary\">\n"
                 + "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>");
         checkOutput("overview-summary.html", true,
@@ -591,7 +654,9 @@
                 + "<div class=\"contentContainer\">\n"
                 + "<div class=\"block\">The overview summary page header.</div>\n"
                 + "</div>\n"
-                + "<div class=\"contentContainer\">\n"
+                + "<div class=\"contentContainer\"><a id=\"Packages\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
                 + "<table class=\"overviewSummary\">\n"
                 + "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>");
     }
@@ -974,4 +1039,54 @@
                 + "</a>",
                 "<caption><span>Concealed</span><span class=\"tabEnd\">&nbsp;</span></caption>");
     }
+
+    void checkGroupOption() {
+        checkOutput("overview-summary.html", true,
+                "<div class=\"contentContainer\"><a name=\"ModuleGroupA\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<table class=\"overviewSummary\" summary=\"Module Group A table, listing modules, and an explanation\">\n"
+                + "<caption><span>Module Group A</span><span class=\"tabEnd\">&nbsp;</span></caption>",
+                "<div class=\"contentContainer\"><a name=\"ModuleGroupB&amp;C\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<table class=\"overviewSummary\" summary=\"Module Group B &amp; C table, listing modules, and an explanation\">\n"
+                + "<caption><span>Module Group B & C</span><span class=\"tabEnd\">&nbsp;</span></caption>",
+                "<div class=\"contentContainer\"><a name=\"OtherModules\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<table class=\"overviewSummary\" summary=\"Other Modules table, listing modules, and an explanation\">\n"
+                + "<caption><span>Other Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
+        checkOutput("overview-summary.html", false,
+                "<table class=\"overviewSummary\" summary=\"Modules table, listing modules, and an explanation\">\n"
+                + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>",
+                "Java SE Modules");
+    }
+
+    void checkUnnamedModuleGroupOption() {
+        checkOutput("overview-summary.html", true,
+                "<div class=\"contentContainer\"><a name=\"PackageGroup0\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<table class=\"overviewSummary\" summary=\"Package Group 0 table, listing packages, and an explanation\">\n"
+                + "<caption><span>Package Group 0</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                + "<tr>",
+                "<div class=\"contentContainer\"><a name=\"PackageGroup1\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<table class=\"overviewSummary\" summary=\"Package Group 1 table, listing packages, and an explanation\">\n"
+                + "<caption><span>Package Group 1</span><span class=\"tabEnd\">&nbsp;</span></caption>");
+    }
+
+    void checkGroupOptionSingleModule() {
+        checkOutput("overview-summary.html", true,
+                "<div class=\"contentContainer\"><a name=\"ModuleGroupB\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<table class=\"overviewSummary\" summary=\"Module Group B table, listing modules, and an explanation\">\n"
+                + "<caption><span>Module Group B</span><span class=\"tabEnd\">&nbsp;</span></caption>");
+        checkOutput("overview-summary.html", false,
+                "<table class=\"overviewSummary\" summary=\"Modules table, listing modules, and an explanation\">\n"
+                + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
+    }
 }
--- a/langtools/test/jdk/jshell/CommandCompletionTest.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/test/jdk/jshell/CommandCompletionTest.java	Thu May 25 22:33:25 2017 +0000
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8144095 8164825 8169818 8153402 8165405 8177079 8178013
+ * @bug 8144095 8164825 8169818 8153402 8165405 8177079 8178013 8167554
  * @summary Test Command Completion
  * @modules jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
@@ -162,13 +162,13 @@
                 "/edit ", "/env ", "/exit ",
                 "/help ", "/history ", "/imports ",
                 "/list ", "/methods ", "/open ", "/reload ", "/reset ",
-                "/save ", "/set ", "/types ", "/vars ", "context ", "intro ", "shortcuts "),
+                "/save ", "/set ", "/types ", "/vars ", "context ", "intro ", "rerun ", "shortcuts "),
                 a -> assertCompletion(a, "/? |", false,
                 "/! ", "/-<n> ", "/<id> ", "/? ", "/drop ",
                 "/edit ", "/env ", "/exit ",
                 "/help ", "/history ", "/imports ",
                 "/list ", "/methods ", "/open ", "/reload ", "/reset ",
-                "/save ", "/set ", "/types ", "/vars ", "context ", "intro ", "shortcuts "),
+                "/save ", "/set ", "/types ", "/vars ", "context ", "intro ", "rerun ", "shortcuts "),
                 a -> assertCompletion(a, "/help /s|", false,
                 "/save ", "/set "),
                 a -> assertCompletion(a, "/help /set |", false,
--- a/langtools/test/jdk/jshell/EditorTestBase.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/test/jdk/jshell/EditorTestBase.java	Thu May 25 22:33:25 2017 +0000
@@ -73,7 +73,7 @@
         for (String edit : new String[] {"/ed", "/edit"}) {
             test(new String[]{"--no-startup"},
                     a -> assertCommandOutputStartsWith(a, edit + " 1",
-                            "|  No such snippet: 1"),
+                            "|  No snippet with id: 1"),
                     a -> assertCommandOutputStartsWith(a, edit + " unknown",
                             "|  No such snippet: unknown")
             );
--- a/langtools/test/jdk/jshell/MergedTabShiftTabCommandTest.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/test/jdk/jshell/MergedTabShiftTabCommandTest.java	Thu May 25 22:33:25 2017 +0000
@@ -66,17 +66,17 @@
                             Pattern.quote(getResource("jshell.console.see.next.command.doc")) + "\n" +
                             "\r\u0005/");
 
-            inputSink.write("lis\011");
-            waitOutput(out, "list $");
+            inputSink.write("ed\011");
+            waitOutput(out, "edit $");
 
             inputSink.write("\011");
             waitOutput(out, ".*-all.*" +
                             "\n\n" + Pattern.quote(getResource("jshell.console.see.synopsis")) + "\n\r\u0005/");
             inputSink.write("\011");
-            waitOutput(out, Pattern.quote(getResource("help.list.summary")) + "\n\n" +
-                            Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n\r\u0005/list ");
+            waitOutput(out, Pattern.quote(getResource("help.edit.summary")) + "\n\n" +
+                            Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n\r\u0005/edit ");
             inputSink.write("\011");
-            waitOutput(out, Pattern.quote(getResource("help.list").replaceAll("\t", "    ")));
+            waitOutput(out, Pattern.quote(getResource("help.edit").replaceAll("\t", "    ")));
 
             inputSink.write("\u0003/env \011");
             waitOutput(out, "\u0005/env -\n" +
--- a/langtools/test/jdk/jshell/ToolBasicTest.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/test/jdk/jshell/ToolBasicTest.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8143037 8142447 8144095 8140265 8144906 8146138 8147887 8147886 8148316 8148317 8143955 8157953 8080347 8154714 8166649 8167643 8170162 8172102 8165405 8174796 8174797 8175304
+ * @bug 8143037 8142447 8144095 8140265 8144906 8146138 8147887 8147886 8148316 8148317 8143955 8157953 8080347 8154714 8166649 8167643 8170162 8172102 8165405 8174796 8174797 8175304 8167554 8180508
  * @summary Tests for Basic tests for REPL tool
  * @modules jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
@@ -190,8 +190,8 @@
 
     public void testRerun() {
         test(false, new String[] {"--no-startup"},
-                (a) -> assertCommand(a, "/0", "|  No such command or snippet id: /0\n|  Type /help for help."),
-                (a) -> assertCommand(a, "/5", "|  No such command or snippet id: /5\n|  Type /help for help.")
+                (a) -> assertCommand(a, "/0", "|  No snippet with id: 0"),
+                (a) -> assertCommand(a, "/5", "|  No snippet with id: 5")
         );
         String[] codes = new String[] {
                 "int a = 0;", // var
@@ -252,9 +252,9 @@
         );
 
         test(false, new String[] {"--no-startup"},
-                (a) -> assertCommand(a, "/s1", "|  No such command or snippet id: /s1\n|  Type /help for help."),
-                (a) -> assertCommand(a, "/1", "|  No such command or snippet id: /1\n|  Type /help for help."),
-                (a) -> assertCommand(a, "/e1", "|  No such command or snippet id: /e1\n|  Type /help for help.")
+                (a) -> assertCommand(a, "/s1", "|  No snippet with id: s1"),
+                (a) -> assertCommand(a, "/1", "|  No snippet with id: 1"),
+                (a) -> assertCommand(a, "/e1", "|  No snippet with id: e1")
         );
     }
 
@@ -481,17 +481,19 @@
     public void testSave() throws IOException {
         Compiler compiler = new Compiler();
         Path path = compiler.getPath("testSave.repl");
-        List<String> list = Arrays.asList(
-                "int a;",
-                "class A { public String toString() { return \"A\"; } }"
-        );
-        test(
-                (a) -> assertVariable(a, "int", "a"),
-                (a) -> assertCommand(a, "()", null, null, null, "", ""),
-                (a) -> assertClass(a, "class A { public String toString() { return \"A\"; } }", "class", "A"),
-                (a) -> assertCommand(a, "/save " + path.toString(), "")
-        );
-        assertEquals(Files.readAllLines(path), list);
+        {
+            List<String> list = Arrays.asList(
+                    "int a;",
+                    "class A { public String toString() { return \"A\"; } }"
+            );
+            test(
+                    (a) -> assertVariable(a, "int", "a"),
+                    (a) -> assertCommand(a, "()", null, null, null, "", ""),
+                    (a) -> assertClass(a, "class A { public String toString() { return \"A\"; } }", "class", "A"),
+                    (a) -> assertCommand(a, "/save " + path.toString(), "")
+            );
+            assertEquals(Files.readAllLines(path), list);
+        }
         {
             List<String> output = new ArrayList<>();
             test(
@@ -499,28 +501,47 @@
                     (a) -> assertCommand(a, "()", null, null, null, "", ""),
                     (a) -> assertClass(a, "class A { public String toString() { return \"A\"; } }", "class", "A"),
                     (a) -> assertCommandCheckOutput(a, "/list -all", (out) ->
-                            output.addAll(Stream.of(out.split("\n"))
-                                    .filter(str -> !str.isEmpty())
-                                    .map(str -> str.substring(str.indexOf(':') + 2))
-                                    .filter(str -> !str.startsWith("/"))
-                                    .collect(Collectors.toList()))),
+                                    output.addAll(Stream.of(out.split("\n"))
+                            .filter(str -> !str.isEmpty())
+                            .map(str -> str.substring(str.indexOf(':') + 2))
+                            .filter(str -> !str.startsWith("/"))
+                            .collect(Collectors.toList()))),
                     (a) -> assertCommand(a, "/save -all " + path.toString(), "")
             );
             assertEquals(Files.readAllLines(path), output);
         }
-        List<String> output = new ArrayList<>();
-        test(
-                (a) -> assertVariable(a, "int", "a"),
-                (a) -> assertCommand(a, "()", null, null, null, "", ""),
-                (a) -> assertClass(a, "class A { public String toString() { return \"A\"; } }", "class", "A"),
-                (a) -> assertCommandCheckOutput(a, "/history", (out) ->
-                        output.addAll(Stream.of(out.split("\n"))
-                                .filter(str -> !str.isEmpty())
-                                .collect(Collectors.toList()))),
-                (a) -> assertCommand(a, "/save -history " + path.toString(), "")
-        );
-        output.add("/save -history " + path.toString());
-        assertEquals(Files.readAllLines(path), output);
+        {
+            List<String> output = new ArrayList<>();
+            test(
+                    (a) -> assertCommand(a, "int a;", null),
+                    (a) -> assertCommand(a, "int b;", null),
+                    (a) -> assertCommand(a, "int c;", null),
+                    (a) -> assertClass(a, "class A { public String toString() { return \"A\"; } }", "class", "A"),
+                    (a) -> assertCommandCheckOutput(a, "/list b c a A", (out) ->
+                                    output.addAll(Stream.of(out.split("\n"))
+                            .filter(str -> !str.isEmpty())
+                            .map(str -> str.substring(str.indexOf(':') + 2))
+                            .filter(str -> !str.startsWith("/"))
+                            .collect(Collectors.toList()))),
+                    (a) -> assertCommand(a, "/save 2-3 1 4 " + path.toString(), "")
+            );
+            assertEquals(Files.readAllLines(path), output);
+        }
+        {
+            List<String> output = new ArrayList<>();
+            test(
+                    (a) -> assertVariable(a, "int", "a"),
+                    (a) -> assertCommand(a, "()", null, null, null, "", ""),
+                    (a) -> assertClass(a, "class A { public String toString() { return \"A\"; } }", "class", "A"),
+                    (a) -> assertCommandCheckOutput(a, "/history", (out) ->
+                                output.addAll(Stream.of(out.split("\n"))
+                            .filter(str -> !str.isEmpty())
+                            .collect(Collectors.toList()))),
+                    (a) -> assertCommand(a, "/save -history " + path.toString(), "")
+            );
+            output.add("/save -history " + path.toString());
+            assertEquals(Files.readAllLines(path), output);
+        }
     }
 
     public void testStartRetain() {
@@ -652,6 +673,64 @@
         );
     }
 
+    public void testRerunIdRange() {
+        Compiler compiler = new Compiler();
+        Path startup = compiler.getPath("rangeStartup");
+        String[] startupSources = new String[] {
+            "boolean go = false",
+            "void println(String s) { if (go) System.out.println(s); }",
+            "void println(int i) { if (go) System.out.println(i); }",
+            "println(\"s4\")",
+            "println(\"s5\")",
+            "println(\"s6\")"
+        };
+        String[] sources = new String[] {
+            "frog",
+            "go = true",
+            "println(2)",
+            "println(3)",
+            "println(4)",
+            "querty"
+        };
+        compiler.writeToFile(startup, startupSources);
+        test(false, new String[]{"--startup", startup.toString()},
+                a -> assertCommandOutputStartsWith(a, sources[0], "|  Error:"),
+                a -> assertCommand(a, sources[1], "go ==> true", "", null, "", ""),
+                a -> assertCommand(a, sources[2], "", "", null, "2\n", ""),
+                a -> assertCommand(a, sources[3], "", "", null, "3\n", ""),
+                a -> assertCommand(a, sources[4], "", "", null, "4\n", ""),
+                a -> assertCommandOutputStartsWith(a, sources[5], "|  Error:"),
+                a -> assertCommand(a, "/3", "println(3)", "", null, "3\n", ""),
+                a -> assertCommand(a, "/s4", "println(\"s4\")", "", null, "s4\n", ""),
+                a -> assertCommandOutputStartsWith(a, "/e1", "frog\n|  Error:"),
+                a -> assertCommand(a, "/2-4",
+                        "println(2)\nprintln(3)\nprintln(4)",
+                        "", null, "2\n3\n4\n", ""),
+                a -> assertCommand(a, "/s4-s6",
+                        startupSources[3] + "\n" +startupSources[4] + "\n" +startupSources[5],
+                        "", null, "s4\ns5\ns6\n", ""),
+                a -> assertCommand(a, "/s4-4", null,
+                        "", null, "s4\ns5\ns6\n2\n3\n4\n", ""),
+                a -> assertCommandCheckOutput(a, "/e1-e2",
+                        s -> {
+                            assertTrue(s.trim().startsWith("frog\n|  Error:"),
+                                    "Output: \'" + s + "' does not start with: " + "|  Error:");
+                            assertTrue(s.trim().lastIndexOf("|  Error:") > 10,
+                                    "Output: \'" + s + "' does not have second: " + "|  Error:");
+                        }),
+                a -> assertCommand(a, "/4  s4 2",
+                        "println(4)\nprintln(\"s4\")\nprintln(2)",
+                        "", null, "4\ns4\n2\n", ""),
+                a -> assertCommand(a, "/s5 2-4 3",
+                        "println(\"s5\")\nprintln(2)\nprintln(3)\nprintln(4)\nprintln(3)",
+                        "", null, "s5\n2\n3\n4\n3\n", ""),
+                a -> assertCommand(a, "/2 ff", "|  No such snippet: ff"),
+                a -> assertCommand(a, "/4-2", "|  End of snippet range less than start: 4 - 2"),
+                a -> assertCommand(a, "/s5-s3", "|  End of snippet range less than start: s5 - s3"),
+                a -> assertCommand(a, "/4-s5", "|  End of snippet range less than start: 4 - s5")
+        );
+    }
+
     @Test(enabled = false) // TODO 8158197
     public void testHeadlessEditPad() {
         String prevHeadless = System.getProperty("java.awt.headless");
--- a/langtools/test/jdk/jshell/ToolLocaleMessageTest.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/test/jdk/jshell/ToolLocaleMessageTest.java	Thu May 25 22:33:25 2017 +0000
@@ -117,7 +117,6 @@
                     (a) -> assertCommandFail(a, "/drop rats"),
                     (a) -> assertCommandOK(a, "void dup() {}"),
                     (a) -> assertCommandOK(a, "int dup"),
-                    (a) -> assertCommandFail(a, "/drop dup"),
                     (a) -> assertCommandFail(a, "/edit zebra", "zebra"),
                     (a) -> assertCommandFail(a, "/list zebra", "zebra", "No such snippet: zebra"),
                     (a) -> assertCommandFail(a, "/open", "/open"),
--- a/langtools/test/jdk/jshell/ToolSimpleTest.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/test/jdk/jshell/ToolSimpleTest.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8153716 8143955 8151754 8150382 8153920 8156910 8131024 8160089 8153897 8167128 8154513 8170015 8170368 8172102 8172103  8165405 8173073 8173848 8174041 8173916 8174028 8174262 8174797 8177079
+ * @bug 8153716 8143955 8151754 8150382 8153920 8156910 8131024 8160089 8153897 8167128 8154513 8170015 8170368 8172102 8172103  8165405 8173073 8173848 8174041 8173916 8174028 8174262 8174797 8177079 8180508
  * @summary Simple jshell tool tests
  * @modules jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
@@ -37,6 +37,7 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.function.Consumer;
+import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -202,7 +203,7 @@
     @Test
     public void testUnknownCommand() {
         test((a) -> assertCommand(a, "/unknown",
-                "|  No such command or snippet id: /unknown\n" +
+                "|  Invalid command: /unknown\n" +
                 "|  Type /help for help."));
     }
 
@@ -275,9 +276,25 @@
     }
 
     @Test
+    public void testDropRange() {
+        test(false, new String[]{"--no-startup"},
+                a -> assertVariable(a, "int", "a"),
+                a -> assertMethod(a, "int b() { return 0; }", "()int", "b"),
+                a -> assertClass(a, "class A {}", "class", "A"),
+                a -> assertImport(a, "import java.util.stream.*;", "", "java.util.stream.*"),
+                a -> assertCommand(a, "for (int i = 0; i < 10; ++i) {}", ""),
+                a -> assertCommand(a, "/drop 3-5 b 1",
+                        "|  dropped class A\n" +
+                        "|  dropped method b()\n" +
+                        "|  dropped variable a\n"),
+                a -> assertCommand(a, "/list", "")
+        );
+    }
+
+    @Test
     public void testDropNegative() {
         test(false, new String[]{"--no-startup"},
-                a -> assertCommandOutputStartsWith(a, "/drop 0", "|  No such snippet: 0"),
+                a -> assertCommandOutputStartsWith(a, "/drop 0", "|  No snippet with id: 0"),
                 a -> assertCommandOutputStartsWith(a, "/drop a", "|  No such snippet: a"),
                 a -> assertCommandCheckOutput(a, "/drop",
                         assertStartsWith("|  In the /drop argument, please specify an import, variable, method, or class to drop.")),
@@ -292,27 +309,23 @@
 
     @Test
     public void testAmbiguousDrop() {
-        Consumer<String> check = s -> {
-            assertTrue(s.startsWith("|  The argument references more than one import, variable, method, or class"), s);
-            int lines = s.split("\n").length;
-            assertEquals(lines, 5, "Expected 3 ambiguous keys, but found: " + (lines - 2) + "\n" + s);
-        };
         test(
                 a -> assertVariable(a, "int", "a"),
                 a -> assertMethod(a, "int a() { return 0; }", "()int", "a"),
                 a -> assertClass(a, "class a {}", "class", "a"),
-                a -> assertCommandCheckOutput(a, "/drop a", check),
-                a -> assertCommandCheckOutput(a, "/vars", assertVariables()),
-                a -> assertCommandCheckOutput(a, "/methods", assertMethods()),
-                a -> assertCommandCheckOutput(a, "/types", assertClasses()),
-                a -> assertCommandCheckOutput(a, "/imports", assertImports())
+                a -> assertCommand(a, "/drop a",
+                        "|  dropped variable a\n" +
+                        "|  dropped method a()\n" +
+                        "|  dropped class a")
         );
         test(
                 a -> assertMethod(a, "int a() { return 0; }", "()int", "a"),
                 a -> assertMethod(a, "double a(int a) { return 0; }", "(int)double", "a"),
                 a -> assertMethod(a, "double a(double a) { return 0; }", "(double)double", "a"),
-                a -> assertCommandCheckOutput(a, "/drop a", check),
-                a -> assertCommandCheckOutput(a, "/methods", assertMethods())
+                a -> assertCommand(a, "/drop a",
+                        "|  dropped method a()\n" +
+                        "|  dropped method a(int)\n" +
+                        "|  dropped method a(double)\n")
         );
     }
 
@@ -402,12 +415,14 @@
         String arg = "qqqq";
         List<String> startVarList = new ArrayList<>(START_UP);
         startVarList.add("int aardvark");
+        startVarList.add("int weevil");
         test(
                 a -> assertCommandCheckOutput(a, "/list -all",
                         s -> checkLineToList(s, START_UP)),
                 a -> assertCommandOutputStartsWith(a, "/list " + arg,
                         "|  No such snippet: " + arg),
                 a -> assertVariable(a, "int", "aardvark"),
+                a -> assertVariable(a, "int", "weevil"),
                 a -> assertCommandOutputContains(a, "/list aardvark", "aardvark"),
                 a -> assertCommandCheckOutput(a, "/list -start",
                         s -> checkLineToList(s, START_UP)),
@@ -415,6 +430,11 @@
                         s -> checkLineToList(s, startVarList)),
                 a -> assertCommandOutputStartsWith(a, "/list s3",
                         "s3 : import"),
+                a -> assertCommandCheckOutput(a, "/list 1-2 s3",
+                        s -> {
+                            assertTrue(Pattern.matches(".*aardvark.*\\R.*weevil.*\\R.*s3.*import.*", s.trim()),
+                                    "No match: " + s);
+                        }),
                 a -> assertCommandOutputStartsWith(a, "/list " + arg,
                         "|  No such snippet: " + arg)
         );
@@ -439,6 +459,8 @@
                         s -> checkLineToList(s, startVarList)),
                 a -> assertCommandOutputStartsWith(a, "/vars -all",
                         "|    int aardvark = 0\n|    int a = "),
+                a -> assertCommandOutputStartsWith(a, "/vars 1-4",
+                        "|    int aardvark = 0\n|    int a = "),
                 a -> assertCommandOutputStartsWith(a, "/vars f",
                         "|  This command does not accept the snippet 'f'"),
                 a -> assertCommand(a, "/var " + arg,
--- a/langtools/test/tools/javac/T7008643/InlinedFinallyConfuseDebuggersTest.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/test/tools/javac/T7008643/InlinedFinallyConfuseDebuggersTest.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -72,6 +72,7 @@
         {9,           21},      //System.out.println("finally");
         {10,          29},
         {9,           32},      //System.out.println("finally");
+        {10,          41},      //}
         {11,          43},
     };
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T8180660/MissingLNTEntryForFinalizerTest.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,180 @@
+/*
+ * 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.
+ *
+ * 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 8180141
+ * @summary Missing entry in LineNumberTable for break statement that jumps out of try-finally
+ * @modules jdk.jdeps/com.sun.tools.classfile
+ *          jdk.compiler/com.sun.tools.javac.code
+ *          jdk.compiler/com.sun.tools.javac.comp
+ *          jdk.compiler/com.sun.tools.javac.file
+ *          jdk.compiler/com.sun.tools.javac.main
+ *          jdk.compiler/com.sun.tools.javac.tree
+ *          jdk.compiler/com.sun.tools.javac.util
+ * @compile -g MissingLNTEntryForFinalizerTest.java
+ * @run main MissingLNTEntryForFinalizerTest
+ */
+
+import java.io.File;
+import java.net.URI;
+
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+
+import com.sun.tools.classfile.*;
+import com.sun.tools.javac.comp.Attr;
+import com.sun.tools.javac.comp.AttrContext;
+import com.sun.tools.javac.comp.Env;
+import com.sun.tools.javac.comp.Modules;
+import com.sun.tools.javac.file.JavacFileManager;
+import com.sun.tools.javac.main.JavaCompiler;
+import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.tree.JCTree.*;
+import com.sun.tools.javac.util.Context;
+import com.sun.tools.javac.util.List;
+
+import static com.sun.tools.javac.util.List.of;
+import static com.sun.tools.javac.tree.JCTree.Tag.*;
+
+public class MissingLNTEntryForFinalizerTest {
+    protected ReusableJavaCompiler tool;
+    Context context;
+
+    MissingLNTEntryForFinalizerTest() {
+        context = new Context();
+        JavacFileManager.preRegister(context);
+        MyAttr.preRegister(context);
+        tool = new ReusableJavaCompiler(context);
+    }
+
+    public static void main(String... args) throws Throwable {
+        new MissingLNTEntryForFinalizerTest().test();
+    }
+
+    void test() throws Throwable {
+        JavaSource source = new JavaSource("1");
+        tool.clear();
+        List<JavaFileObject> inputs = of(source);
+        try {
+            tool.compile(inputs);
+        } catch (Throwable ex) {
+            throw new AssertionError(ex);
+        }
+        File testClasses = new File(".");
+        File file = new File(testClasses, "Test1.class");
+        ClassFile classFile = ClassFile.read(file);
+        for (Method m : classFile.methods) {
+            if (classFile.constant_pool.getUTF8Value(m.name_index).equals("foo")) {
+                Code_attribute code = (Code_attribute)m.attributes.get(Attribute.Code);
+                LineNumberTable_attribute lnt = (LineNumberTable_attribute)code.attributes.get(Attribute.LineNumberTable);
+                checkLNT(lnt, MyAttr.lineNumber);
+            }
+        }
+    }
+
+    void checkLNT(LineNumberTable_attribute lnt, int lineToCheckFor) {
+        for (LineNumberTable_attribute.Entry e: lnt.line_number_table) {
+            if (e.line_number == lineToCheckFor) {
+                return;
+            }
+        }
+        throw new AssertionError("seek line number not found in the LNT for method foo()");
+    }
+
+    class JavaSource extends SimpleJavaFileObject {
+        String id;
+        String template =
+                "import java.util.*;\n" +
+                "class Test#Id {\n" +
+                "    void foo() {\n" +
+                "        List<String> l = null;\n" +
+                "        String first = null;\n" +
+                "        try {\n" +
+                "            first = l.get(0);\n" +
+                "        } finally {\n" +
+                "            if (first != null) {\n" +
+                "                System.out.println(\"finalizer\");\n" +
+                "            }\n" +
+                "        }\n" +
+                "    }\n" +
+                "}";
+
+        JavaSource(String id) {
+            super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
+            this.id = id;
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return template.replace("#Id", id);
+        }
+    }
+
+    /* this class has been set up to do not depend on a fixed line number, this Attr subclass will
+     * look for 'break' or 'continue' statements in order to find the actual line number they occupy.
+     * This way the test can find if that line number appears in the LNT generated for a given class.
+     */
+    static class MyAttr extends Attr {
+        static int lineNumber;
+
+        static void preRegister(Context context) {
+            context.put(attrKey, (com.sun.tools.javac.util.Context.Factory<Attr>) c -> new MyAttr(c));
+        }
+
+        MyAttr(Context context) {
+            super(context);
+        }
+
+        @Override
+        public com.sun.tools.javac.code.Type attribStat(JCTree tree, Env<AttrContext> env) {
+            com.sun.tools.javac.code.Type result = super.attribStat(tree, env);
+            if (tree.hasTag(TRY)) {
+                JCTry tryTree = (JCTry)tree;
+                lineNumber = env.toplevel.lineMap.getLineNumber(tryTree.finalizer.endpos);
+            }
+            return result;
+        }
+    }
+
+    static class ReusableJavaCompiler extends JavaCompiler {
+        ReusableJavaCompiler(Context context) {
+            super(context);
+        }
+
+        @Override
+        protected void checkReusable() {
+            // do nothing
+        }
+
+        @Override
+        public void close() {
+            //do nothing
+        }
+
+        void clear() {
+            newRound();
+            Modules.instance(context).newRound();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/AddExportsWithRelease.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+// key: compiler.err.add.exports.with.release
+// options: --add-exports java.base/jdk.internal.misc=ALL-UNNAMED --release 9
+
+class AddExportsWithRelease {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/AddReadsWithRelease.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+// key: compiler.err.add.reads.with.release
+// options: --add-reads java.base=java.compiler --release 9
+
+class AddReadsWithRelease {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/PatchModuleWithRelease/PatchModuleWithRelease.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+// key: compiler.err.patch.module.with.release
+// options: --release 9
+
+class PatchModuleWithRelease {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/PatchModuleWithRelease/patchmodule/java.base/java/lang/Test.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ *
+ * 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 java.lang;
+
+class Test {
+}
--- a/langtools/test/tools/javac/linenumbers/FinallyLineNumberTest.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/test/tools/javac/linenumbers/FinallyLineNumberTest.java	Thu May 25 22:33:25 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -36,7 +36,6 @@
 import com.sun.tools.classfile.LineNumberTable_attribute;
 import com.sun.tools.classfile.LineNumberTable_attribute.Entry;
 
-import java.io.File;
 import java.io.IOException;
 
 public class FinallyLineNumberTest {
@@ -46,13 +45,13 @@
         if (lines == null) {
             throw new Exception("finally line number table could not be loaded");
         }
-        if (lines.length != 4) {
+        if (lines.length != 5) {
             // Help debug
             System.err.println("LineTable error, got lines:");
             for (Entry e : lines) {
                 System.err.println(e.line_number);
             }
-            throw new Exception("finally line number table incorrect: length=" + lines.length + " expected length=4");
+            throw new Exception("finally line number table incorrect: length=" + lines.length + " expected length=5");
         }
 
         // return null line, for the load null operation
@@ -71,11 +70,17 @@
             throw new Exception("finally line number table incorrect: got=" + current + " expected=" + first);
         }
 
-        // finally line, for when exception is thrown
+        // for when exception is thrown
         current = lines[3].line_number;
         if (current != first + 2) {
             throw new Exception("finally line number table incorrect: got=" + current + " expected=" + (first + 2));
         }
+
+        // the '}' closing the finally block
+        current = lines[4].line_number;
+        if (current != first + 3) {
+            throw new Exception("finally line number table incorrect: got=" + current + " expected=" + (first + 3));
+        }
     }
 
     static Entry[] findEntries() throws IOException, ConstantPoolException {
--- a/langtools/test/tools/javac/options/release/ReleaseOptionClashes.java	Thu May 25 15:27:40 2017 -0700
+++ b/langtools/test/tools/javac/options/release/ReleaseOptionClashes.java	Thu May 25 22:33:25 2017 +0000
@@ -44,17 +44,19 @@
     }
 
     void run() throws Exception {
-        doRunTest("-bootclasspath", "any");
-        doRunTest("-Xbootclasspath:any");
-        doRunTest("-Xbootclasspath/a:any");
-        doRunTest("-Xbootclasspath/p:any");
-        doRunTest("-endorseddirs", "any");
-        doRunTest("-extdirs", "any");
-        doRunTest("-source", "8");
-        doRunTest("-target", "8");
+        doRunTest("7", "-bootclasspath", "any");
+        doRunTest("7", "-Xbootclasspath:any");
+        doRunTest("7", "-Xbootclasspath/a:any");
+        doRunTest("7", "-Xbootclasspath/p:any");
+        doRunTest("7", "-endorseddirs", "any");
+        doRunTest("7", "-extdirs", "any");
+        doRunTest("7", "-source", "8");
+        doRunTest("7", "-target", "8");
+        doRunTest("9", "--system", "none");
+        doRunTest("9", "--upgrade-module-path", "any");
     }
 
-    void doRunTest(String... args) throws Exception {
+    void doRunTest(String release, String... args) throws Exception {
         System.out.println("Testing clashes for arguments: " + Arrays.asList(args));
         Class<?> log = Class.forName("com.sun.tools.javac.util.Log", true, cl);
         Field useRawMessages = log.getDeclaredField("useRawMessages");
@@ -62,7 +64,7 @@
         useRawMessages.setBoolean(null, true);
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         List<String> options = new ArrayList<>();
-        options.addAll(Arrays.asList("--release", "7"));
+        options.addAll(Arrays.asList("--release", release));
         options.addAll(Arrays.asList(args));
         options.add(System.getProperty("test.src") + File.separator + "ReleaseOptionClashes.java");
         compiler.run(null, null, out, options.toArray(new String[0]));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/options/release/ReleaseOptionUnsupported.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,313 @@
+/*
+ * 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.
+ *
+ * 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 8178152
+ * @summary Verify unsupported modules and module options handling.
+ * @library /tools/lib
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.main
+ *          jdk.compiler/com.sun.tools.javac.jvm
+ *          jdk.jdeps/com.sun.tools.classfile
+ *          jdk.jdeps/com.sun.tools.javap
+ * @build toolbox.ToolBox toolbox.JarTask toolbox.JavacTask toolbox.JavapTask toolbox.TestRunner
+ * @run main ReleaseOptionUnsupported
+ */
+
+import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.List;
+
+import com.sun.tools.javac.jvm.Target;
+import toolbox.JavacTask;
+import toolbox.Task;
+import toolbox.Task.Expect;
+import toolbox.TestRunner;
+import toolbox.ToolBox;
+
+public class ReleaseOptionUnsupported extends TestRunner {
+
+    private final ToolBox tb = new ToolBox();
+
+    public ReleaseOptionUnsupported() {
+        super(System.err);
+    }
+
+    public static void main(String... args) throws Exception {
+        new ReleaseOptionUnsupported().runTests();
+    }
+
+    @Test
+    public void testUnsafe(Path base) throws IOException {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src,
+                          "module m { requires jdk.unsupported; }",
+                          "package test; public class Test { sun.misc.Unsafe unsafe; } ");
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        List<String> log;
+        List<String> expected = Arrays.asList(
+                "Test.java:1:43: compiler.warn.sun.proprietary: sun.misc.Unsafe",
+                "1 warning"
+        );
+
+        log = new JavacTask(tb)
+                .options("-XDrawDiagnostics")
+                .outdir(classes)
+                .files(tb.findJavaFiles(src))
+                .run(Expect.SUCCESS)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+
+        if (!expected.equals(log)) {
+            throw new AssertionError("Unexpected output: " + log);
+        }
+
+        log = new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "--release", Target.DEFAULT.multiReleaseValue())
+                .outdir(classes)
+                .files(tb.findJavaFiles(src))
+                .run(Expect.SUCCESS)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+
+        if (!expected.equals(log)) {
+            throw new AssertionError("Unexpected output: " + log);
+        }
+    }
+
+    @Test
+    public void testUnsafeUnnamed(Path base) throws IOException {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src,
+                          "package test; public class Test { sun.misc.Unsafe unsafe; } ");
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        List<String> log;
+        List<String> expected = Arrays.asList(
+                "Test.java:1:43: compiler.warn.sun.proprietary: sun.misc.Unsafe",
+                "1 warning"
+        );
+
+        log = new JavacTask(tb)
+                .options("-XDrawDiagnostics")
+                .outdir(classes)
+                .files(tb.findJavaFiles(src))
+                .run(Expect.SUCCESS)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+
+        if (!expected.equals(log)) {
+            throw new AssertionError("Unexpected output: " + log);
+        }
+
+        log = new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "--release", Target.DEFAULT.multiReleaseValue())
+                .outdir(classes)
+                .files(tb.findJavaFiles(src))
+                .run(Expect.SUCCESS)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+
+        if (!expected.equals(log)) {
+            throw new AssertionError("Unexpected output: " + log);
+        }
+    }
+
+    @Test
+    public void testAddExports(Path base) throws IOException {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src,
+                          "module m { }",
+                          "package test; public class Test { jdk.internal.misc.Unsafe unsafe; } ");
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "--add-exports", "java.base/jdk.internal.misc=m")
+                .outdir(classes)
+                .files(tb.findJavaFiles(src))
+                .run(Expect.SUCCESS)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+
+        List<String> log;
+        List<String> expected;
+
+        log = new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "--add-exports", "java.base/jdk.internal.misc=m",
+                         "--release", Target.DEFAULT.multiReleaseValue())
+                .outdir(classes)
+                .files(tb.findJavaFiles(src))
+                .run(Expect.FAIL)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+
+        expected = Arrays.asList(
+                "- compiler.err.add.exports.with.release: java.base",
+                "1 error"
+        );
+
+        if (!expected.equals(log)) {
+            throw new AssertionError("Unexpected output: " + log);
+        }
+
+        //OK to add exports a package of a non-system module:
+        tb.writeJavaFiles(src,
+                          "package test; public class Test { } ");
+        tb.createDirectories(classes);
+
+        new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "--add-exports", "m/test=ALL-UNNAMED",
+                         "--release", Target.DEFAULT.multiReleaseValue())
+                .outdir(classes)
+                .files(tb.findJavaFiles(src))
+                .run(Expect.SUCCESS)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+    }
+
+    @Test
+    public void testAddReads(Path base) throws IOException {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src,
+                          "module m { }",
+                          "package test; public class Test { } ");
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "--add-reads", "java.base=m")
+                .outdir(classes)
+                .files(tb.findJavaFiles(src))
+                .run(Expect.SUCCESS)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+
+        List<String> log;
+        List<String> expected;
+
+        log = new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "--add-reads", "java.base=m",
+                         "--release", Target.DEFAULT.multiReleaseValue())
+                .outdir(classes)
+                .files(tb.findJavaFiles(src))
+                .run(Expect.FAIL)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+
+        expected = Arrays.asList(
+                "- compiler.err.add.reads.with.release: java.base",
+                "1 error"
+        );
+
+        if (!expected.equals(log)) {
+            throw new AssertionError("Unexpected output: " + log);
+        }
+
+        //OK to add reads a package of a non-system module:
+        tb.createDirectories(classes);
+
+        new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "--add-reads", "m=java.base",
+                         "--release", Target.DEFAULT.multiReleaseValue())
+                .outdir(classes)
+                .files(tb.findJavaFiles(src))
+                .run(Expect.SUCCESS)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+    }
+
+    @Test
+    public void testPatchModule(Path base) throws IOException {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src,
+                          "module m { }",
+                          "package test; public class Test { } ");
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+        Path patch = base.resolve("patch");
+        tb.createDirectories(patch);
+
+        new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "--patch-module", "java.base=" + patch)
+                .outdir(classes)
+                .files(tb.findJavaFiles(src))
+                .run(Expect.SUCCESS)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+
+        List<String> log;
+        List<String> expected;
+
+        log = new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "--patch-module", "java.base=" + patch,
+                         "--release", Target.DEFAULT.multiReleaseValue())
+                .outdir(classes)
+                .files(tb.findJavaFiles(src))
+                .run(Expect.FAIL)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+
+        expected = Arrays.asList(
+                "- compiler.err.patch.module.with.release: java.base",
+                "1 error"
+        );
+
+        if (!expected.equals(log)) {
+            throw new AssertionError("Unexpected output: " + log);
+        }
+
+        //OK to patch a non-system module:
+        tb.createDirectories(classes);
+
+        new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "--patch-module", "m=" + patch,
+                         "--release", Target.DEFAULT.multiReleaseValue())
+                .outdir(classes)
+                .files(tb.findJavaFiles(src))
+                .run(Expect.SUCCESS)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+    }
+
+    protected void runTests() throws Exception {
+        runTests(m -> new Object[] { Paths.get(m.getName()) });
+    }
+}
--- a/make/Bundles.gmk	Thu May 25 15:27:40 2017 -0700
+++ b/make/Bundles.gmk	Thu May 25 22:33:25 2017 +0000
@@ -183,6 +183,7 @@
           $(JDK_SYMBOLS_EXCLUDE_PATTERN) \
           $(JDK_EXTRA_EXCLUDES) \
           $(SYMBOLS_EXCLUDE_PATTERN) \
+          $(JDK_IMAGE_HOMEDIR)/demo/% \
           , \
           $(ALL_JDK_FILES) \
       )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/Docs.gmk	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,476 @@
+# Copyright (c) 1997, 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.
+#
+
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+include Modules.gmk
+include ProcessMarkdown.gmk
+include ZipArchive.gmk
+include $(JDK_TOPDIR)/make/Tools.gmk
+include $(JDK_TOPDIR)/make/ModuleTools.gmk
+
+# This is needed to properly setup DOCS_MODULES.
+$(eval $(call ReadImportMetaData))
+
+################################################################################
+
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, , Docs.gmk))
+
+################################################################################
+# Javadoc settings
+
+# On top of the sources that was used to compile the JDK, we need some
+# extra java.rmi sources that are used just for javadoc.
+MODULES_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) \
+    $(SUPPORT_OUTPUTDIR)/rmic/* $(JDK_TOPDIR)/src/*/share/doc/stub)
+
+# URLs
+JAVADOC_BASE_URL := http://www.oracle.com/pls/topic/lookup?ctx=javase9&amp;id=homepage
+BUG_SUBMIT_URL := http://bugreport.java.com/bugreport/
+COPYRIGHT_URL := {@docroot}/../legal/cpyr.html
+LICENSE_URL := http://www.oracle.com/technetwork/java/javase/terms/license/java9speclicense.html
+REDISTRIBUTION_URL := http://www.oracle.com/technetwork/java/redist-137594.html
+
+
+# In order to get a specific ordering it's necessary to specify the total
+# ordering of tags as the tags are otherwise ordered in order of definition.
+JAVADOC_TAGS := \
+    -tag beaninfo:X \
+    -tag revised:X \
+    -tag since.unbundled:X \
+    -tag spec:X \
+    -tag specdefault:X \
+    -tag Note:X \
+    -tag ToDo:X \
+    -tag 'apiNote:a:API Note:' \
+    -tag 'implSpec:a:Implementation Requirements:' \
+    -tag 'implNote:a:Implementation Note:' \
+    -tag param \
+    -tag return \
+    -tag throws \
+    -taglet build.tools.taglet.ModuleGraph \
+    -tag since \
+    -tag version \
+    -tag serialData \
+    -tag factory \
+    -tag see \
+    -tag 'jvms:a:See <cite>The Java&trade; Virtual Machine Specification</cite>:' \
+    -tag 'jls:a:See <cite>The Java&trade; Language Specification</cite>:' \
+    -taglet build.tools.taglet.ExtLink \
+    -taglet build.tools.taglet.Incubating \
+    -tagletpath $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
+    $(CUSTOM_JAVADOC_TAGS) \
+    #
+
+# Which doclint checks to ignore
+JAVADOC_DISABLED_DOCLINT := accessibility html missing syntax reference
+
+# The initial set of options for javadoc
+JAVADOC_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
+    -serialwarn -encoding ISO-8859-1 -breakiterator -splitIndex --system none \
+    -html5 -javafx --expand-requires transitive
+
+# Should we add DRAFT stamps to the generated javadoc?
+ifeq ($(VERSION_IS_GA), true)
+  IS_DRAFT := false
+else
+  IS_DRAFT := true
+endif
+
+################################################################################
+# General text snippets
+
+FULL_COMPANY_NAME := Oracle and/or its affiliates
+COMPANY_ADDRESS := 500 Oracle Parkway<br>Redwood Shores, CA 94065 USA
+
+ifeq ($(IS_DRAFT), true)
+  DRAFT_MARKER_STR := <br><strong>DRAFT $(VERSION_STRING)</strong>
+  ifeq ($(VERSION_BUILD), 0)
+    DRAFT_MARKER_TITLE := [ad-hoc build]
+  else
+    DRAFT_MARKER_TITLE := [build $(VERSION_BUILD)]
+  endif
+endif
+
+JAVADOC_WINDOW_TITLE := Java Platform SE $(VERSION_SPECIFICATION) \
+    $(DRAFT_MARKER_TITLE)
+
+JAVADOC_HEADER_TITLE := $(subst $(SPACE),&nbsp;,$(strip \
+    <strong>Java&trade; Platform<br>Standard Ed. \
+    $(VERSION_SPECIFICATION)</strong>$(DRAFT_MARKER_STR)))
+
+JAVADOC_BOTTOM := \
+    <span style="font-size:smaller"> \
+    <a href="$(BUG_SUBMIT_URL)">Submit a bug or feature</a><br> \
+    For further API reference and developer documentation, see \
+    <a href="$(JAVADOC_BASE_URL)" target="_blank">Java SE \
+    Documentation</a>. That documentation contains more detailed, \
+    developer-targeted descriptions, with conceptual overviews, definitions \
+    of terms, workarounds, and working code examples.<br> \
+    Java is a trademark or registered trademark of $(FULL_COMPANY_NAME) in \
+    the US and other countries.<br> \
+    <a href="$(COPYRIGHT_URL)">Copyright</a> \
+    &copy; 1993, $(COPYRIGHT_YEAR), $(FULL_COMPANY_NAME). \
+    $(COMPANY_ADDRESS). All rights reserved. \
+    Use is subject to <a href="$(LICENSE_URL)">license terms</a>. Also see the \
+    <a href="$(REDISTRIBUTION_URL)">documentation redistribution policy</a>. \
+    $(DRAFT_MARKER_STR)</span>
+
+JAVADOC_TOP := \
+    <div style="background-color: $(HASH)EEEEEE"><div style="padding: 6px; \
+    margin-top: 2px; margin-bottom: 6px; margin-left: 6px; margin-right: \
+    6px; text-align: justify; font-size: 80%; font-family: Helvetica, Arial, \
+    sans-serif; font-weight: normal;">Please note that the specifications \
+    and other information contained herein are not final and are subject to \
+    change. The information is being made available to you solely for \
+    purpose of evaluation.</div></div>
+
+################################################################################
+# JDK javadoc titles/text snippets
+
+JDK_JAVADOC_DOC_TITLE := Java&trade; Platform, Standard Edition Development Kit \
+    (JDK&trade;) $(VERSION_SPECIFICATION)<br>API Specification
+
+################################################################################
+# Java SE javadoc titles/text snippets
+
+JAVASE_JAVADOC_DOC_TITLE := Java&trade; Platform, Standard Edition \
+    $(VERSION_SPECIFICATION)<br>API Specification
+
+################################################################################
+
+JDK_DOCS_INDEX_HTML_TITLE := Java&trade; Platform, Standard Edition Development Kit \
+    (JDK&trade;) $(VERSION_SPECIFICATION) Specification<br>$(DRAFT_MARKER_TITLE)
+
+################################################################################
+# Functions
+
+# Helper function for creating a png file from a dot file generated by the
+# GenGraphs tool.
+# param 1: SetupJavadocGeneration namespace ($1)
+# param 2: module name
+#
+define setup_gengraph_dot_to_png
+  $1_$2_DOT_SRC :=  $$($1_GENGRAPHS_DIR)/$2.dot
+  $1_$2_PNG_TARGET := $$($1_TARGET_DIR)/$2-graph.png
+
+    # For each module needing a graph, create a png file from the dot file
+    # generated by the GenGraphs tool and store it in the target dir.
+    $$($1_$2_PNG_TARGET): $$($1_GENGRAPHS_MARKER)
+	$$(call MakeDir, $$(@D))
+	$$(call ExecuteWithLog, $$($1_$2_DOT_SRC), \
+	    $$(DOT) -Tpng -o $$($1_$2_PNG_TARGET) $$($1_$2_DOT_SRC))
+
+  $1_MODULEGRAPH_TARGETS += $$($1_$2_PNG_TARGET)
+endef
+
+################################################################################
+# Setup make rules for creating the API documentation, using javadoc and other
+# tools if needed.
+#
+# Parameter 1 is the name of the rule. This name is used as variable prefix.
+# Targets generated are returned as $1_JAVADOC_TARGETS and
+# $1_MODULEGRAPH_TARGETS. Note that the index.html file will work as a "touch
+# file" for all the magnitude of files that are generated by javadoc.
+#
+# Remaining parameters are named arguments. These include:
+#   MODULES - Modules to generate javadoc for
+#   NAME - The name of the javadoc compilation, to be presented to the user
+#   TARGET_DIR - Where to store the output
+#   OVERVIEW - Path to an html overview file
+#   DOC_TITLE - Title to use in -doctitle.
+#   WINDOW_TITLE - Title to use in -windowtitle.
+#   HEADER_TITLE - Title to use in -header.
+#   BOTTOM_TEXT - Text to use in -bottom.
+#   TOP_TEXT - Text to use in -top.
+#
+SetupApiDocsGeneration = $(NamedParamsMacroTemplate)
+define SetupApiDocsGenerationBody
+
+  # Figure out all modules, both specified and transitive, that will be processed
+  # by javadoc.
+  $1_TRANSITIVE_MODULES := $$(call FindTransitiveDepsForModules, $$($1_MODULES))
+  $1_ALL_MODULES := $$(sort $$($1_MODULES) $$($1_TRANSITIVE_MODULES))
+
+  ifeq ($$(ENABLE_FULL_DOCS), true)
+    # Tell the ModuleGraph taglet to generate html links to soon-to-be-created
+    # png files with module graphs.
+    $1_JAVA_ARGS += -DenableModuleGraph=true
+  endif
+
+  # Always include tags and basic options
+  $1_OPTIONS := $$(JAVADOC_TAGS) $$(JAVADOC_OPTIONS)
+
+  $1_OPTIONS += -overview $$($1_OVERVIEW)
+  $1_OPTIONS += --module-source-path $$(MODULES_SOURCE_PATH)
+  $1_OPTIONS += --module $$(call CommaList, $$($1_MODULES))
+
+  # Create a string like "-Xdoclint:all,-syntax,-html,..."
+  $1_OPTIONS += -Xdoclint:all,$$(call CommaList, $$(addprefix -, \
+      $$(JAVADOC_DISABLED_DOCLINT)))
+
+  $1_OPTIONS += -doctitle '$$($1_DOC_TITLE)'
+  $1_OPTIONS += -windowtitle '$$($1_WINDOW_TITLE)'
+  $1_OPTIONS += -header '$$($1_HEADER_TITLE)'
+  $1_OPTIONS += -bottom '$$($1_BOTTOM_TEXT)'
+  ifeq ($$(IS_DRAFT), true)
+    $1_OPTIONS += -top '$$($1_TOP_TEXT)'
+  endif
+
+  # Do not store debug level options in VARDEPS.
+  ifneq ($$(LOG_LEVEL), trace)
+    $1_LOG_OPTION += -quiet
+  else
+    $1_LOG_OPTION += -verbose
+  endif
+
+  $1_VARDEPS := $$($1_JAVA_ARGS) $$($1_OPTIONS) $$(MODULES_SOURCE_PATH) \
+      $$($1_ALL_MODULES)
+  $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
+      $$(SUPPORT_OUTPUTDIR)/docs/$1.vardeps)
+
+  # Get a list of all files in all the source dirs for all included modules
+  $1_SOURCE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach module, \
+      $$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module)))))
+
+  # Javadoc creates a lot of files but use index.html as a marker
+  $$($1_TARGET_DIR)/index.html: $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) \
+      $$($1_SOURCE_DEPS) $$($1_OVERVIEW)
+	$$(call LogWarn, Generating $$($1_NAME) API javadoc for \
+	    $$(words $$($1_ALL_MODULES)) modules)
+	$$(call LogInfo, Javadoc modules: $$($1_ALL_MODULES))
+	$$(call MakeDir, $$($1_TARGET_DIR))
+	$$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/docs/$1, \
+	    $$(JAVA) -Djava.awt.headless=true $$($1_JAVA_ARGS) \
+	        $$(NEW_JAVADOC) -d $$($1_TARGET_DIR) \
+	        $$(JAVADOC_TAGS) $$($1_OPTIONS) $$($1_LOG_OPTION))
+
+  $1_JAVADOC_TARGETS := $$($1_TARGET_DIR)/index.html
+
+  ifeq ($$(ENABLE_FULL_DOCS), true)
+    # We have asked ModuleGraph to generate links to png files. Now we must
+    # produce the png files.
+
+    # Locate which modules has the @moduleGraph tag in their module-info.java
+    $1_MODULES_NEEDING_GRAPH := $$(strip $$(foreach m, $$($1_ALL_MODULES), \
+      $$(if $$(shell $$(GREP) -e @moduleGraph \
+          $$(wildcard $$(addsuffix /module-info.java, \
+          $$(call FindModuleSrcDirs, $$m)))), \
+        $$m) \
+    ))
+
+    # First we run the GenGraph tool. It will query the module structure of the
+    # running JVM and output .dot files for all existing modules.
+    GENGRAPHS_PROPS := \
+        $$(JDK_TOPDIR)/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
+
+    $1_GENGRAPHS_DIR := $$(SUPPORT_OUTPUTDIR)/docs/$1-gengraphs
+    $1_GENGRAPHS_MARKER := $$($1_GENGRAPHS_DIR)/_gengraphs_run.marker
+
+    $$($1_GENGRAPHS_MARKER): $$(BUILD_JIGSAW_TOOLS) $$(GENGRAPHS_PROPS)
+	$$(call LogInfo, Running gengraphs for $$($1_NAME) API documentation)
+	$$(call MakeDir, $$($1_GENGRAPHS_DIR))
+	$$(call ExecuteWithLog, $$($1_GENGRAPHS_DIR)/gengraphs, \
+	    $$(TOOL_GENGRAPHS) --spec --output $$($1_GENGRAPHS_DIR) \
+	    --dot-attributes $$(GENGRAPHS_PROPS) && \
+	    $$(TOUCH) $$($1_GENGRAPHS_MARKER))
+
+    # For each module needing a graph, create a png file from the dot file
+    # generated by the GenGraphs tool and store it in the target dir.
+    # They will depend on $1_GENGRAPHS_MARKER, and will be added to $1.
+    $$(foreach m, $$($1_MODULES_NEEDING_GRAPH), \
+      $$(eval $$(call setup_gengraph_dot_to_png,$1,$$m)) \
+    )
+  endif
+endef
+
+################################################################################
+# Setup generation of the JDK API documentation (javadoc + modulegraph)
+
+# All modules to have docs generated by docs-jdk-api target
+JDK_JAVADOC_MODULES := $(sort $(DOCS_MODULES))
+
+JDK_JAVADOC_OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html
+
+$(eval $(call SetupApiDocsGeneration, JDK_API, \
+    MODULES := $(JDK_JAVADOC_MODULES), \
+    NAME := JDK, \
+    TARGET_DIR := $(DOCS_OUTPUTDIR)/api, \
+    OVERVIEW := $(JDK_JAVADOC_OVERVIEW), \
+    DOC_TITLE := $(JDK_JAVADOC_DOC_TITLE), \
+    WINDOW_TITLE := $(JAVADOC_WINDOW_TITLE), \
+    HEADER_TITLE := $(JAVADOC_HEADER_TITLE), \
+    BOTTOM_TEXT := $(JAVADOC_BOTTOM), \
+    TOP_TEXT := $(JAVADOC_TOP), \
+))
+
+# Targets generated are returned in JDK_API_JAVADOC_TARGETS and
+# JDK_API_MODULEGRAPH_TARGETS.
+
+################################################################################
+# Setup generation of the Java SE API documentation (javadoc + modulegraph)
+
+# The Java SE module scope is just java.se.ee and it's transitive modules.
+JAVASE_JAVADOC_MODULES := java.se.ee
+
+JAVASE_JAVADOC_OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html
+
+$(eval $(call SetupApiDocsGeneration, JAVASE_API, \
+    MODULES := $(JAVASE_JAVADOC_MODULES), \
+    NAME := Java SE, \
+    TARGET_DIR := $(IMAGES_OUTPUTDIR)/javase-docs/api, \
+    OVERVIEW := $(JAVASE_JAVADOC_OVERVIEW), \
+    DOC_TITLE := $(JAVASE_JAVADOC_DOC_TITLE), \
+    WINDOW_TITLE := $(JAVADOC_WINDOW_TITLE), \
+    HEADER_TITLE := $(JAVADOC_HEADER_TITLE), \
+    BOTTOM_TEXT := $(JAVADOC_BOTTOM), \
+    TOP_TEXT := $(JAVADOC_TOP), \
+))
+
+# Targets generated are returned in JAVASE_API_JAVADOC_TARGETS and
+# JAVASE_API_MODULEGRAPH_TARGETS.
+
+################################################################################
+
+JDK_DOCS_INDEX_HTML := $(DOCS_OUTPUTDIR)/index.html
+
+$(JDK_DOCS_INDEX_HTML): $(BUILD_JIGSAW_TOOLS)
+	$(call LogInfo, Generating docs bundle index page)
+	$(MKDIR) -p $(@D)
+	$(TOOL_GEN_DOCS_BUNDLE_PAGE) --title '$(JDK_DOCS_INDEX_HTML_TITLE)' \
+		--output $@
+
+JDK_DOCS_INDEX_HTML_TARGETS := $(JDK_DOCS_INDEX_HTML)
+
+################################################################################
+# Copy JDK specs files
+
+# For all html documentation in $module/share/specs directories, copy it
+# unmodified
+
+ALL_MODULES := $(call FindAllModules)
+COPY_SPEC_FILTER := %.html %.gif %.jpg %.mib %.css
+
+$(foreach m, $(ALL_MODULES), \
+  $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
+  $(foreach d, $(SPECS_$m), \
+    $(if $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $d)), \
+      $(eval $(call SetupCopyFiles, COPY_$m, \
+          SRC := $d, \
+          FILES := $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $d)), \
+          DEST := $(DOCS_OUTPUTDIR)/specs/, \
+      )) \
+      $(eval JDK_SPECS_TARGETS += $(COPY_$m)) \
+    ) \
+  ) \
+)
+
+# Copy the global resources
+GLOBAL_SPECS_RESOURCES_DIR := $(JDK_TOPDIR)/make/data/docs-resources/specs
+$(eval $(call SetupCopyFiles, COPY_GLOBAL_RESOURCES, \
+    SRC := $(GLOBAL_SPECS_RESOURCES_DIR), \
+    FILES := $(call CacheFind, $(GLOBAL_SPECS_RESOURCES_DIR)), \
+    DEST := $(DOCS_OUTPUTDIR)/specs/, \
+))
+JDK_SPECS_TARGETS += $(COPY_GLOBAL_RESOURCES)
+
+ifeq ($(ENABLE_FULL_DOCS), true)
+  # For all markdown files in $module/share/specs directories, convert them to
+  # html.
+
+  GLOBAL_SPECS_DEFAULT_CSS_FILE := $(DOCS_OUTPUTDIR)/specs/resources/jdk-default.css
+
+  $(foreach m, $(ALL_MODULES), \
+    $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
+    $(foreach d, $(SPECS_$m), \
+      $(if $(filter %.md, $(call CacheFind, $d)), \
+        $(eval $(call SetupProcessMarkdown, CONVERT_MARKDOWN_$m_$(patsubst $(TOPDIR)/%,%,$d), \
+            SRC := $d, \
+            FILES := $(filter %.md, $(call CacheFind, $d)), \
+            DEST := $(DOCS_OUTPUTDIR)/specs/, \
+            CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
+        )) \
+      ) \
+      $(eval JDK_SPECS_TARGETS += $(CONVERT_MARKDOWN_$m_$(patsubst $(TOPDIR)/%,%,$d))) \
+    ) \
+  )
+endif
+
+# Special treatment for generated documentation
+
+JDWP_PROTOCOL := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html
+$(eval $(call SetupCopyFiles, COPY_JDWP_PROTOCOL, \
+    FILES := $(JDWP_PROTOCOL), \
+    DEST := $(DOCS_OUTPUTDIR)/specs/jdwp, \
+))
+JDK_SPECS_TARGETS += $(COPY_JDWP_PROTOCOL)
+
+# Get jvmti.html from the main jvm variant (all variants' jvmti.html are identical).
+JVMTI_HTML := $(HOTSPOT_OUTPUTDIR)/variant-$(JVM_VARIANT_MAIN)/gensrc/jvmtifiles/jvmti.html
+$(eval $(call SetupCopyFiles, COPY_JVMTI_HTML, \
+    FILES := $(JVMTI_HTML), \
+    DEST := $(DOCS_OUTPUTDIR)/specs, \
+))
+JDK_SPECS_TARGETS += $(COPY_JVMTI_HTML)
+
+################################################################################
+# Optional target which bundles all generated javadocs into a zip archive.
+
+JAVADOC_ZIP_NAME := jdk-$(VERSION_STRING)-docs.zip
+JAVADOC_ZIP_FILE := $(OUTPUT_ROOT)/bundles/$(JAVADOC_ZIP_NAME)
+
+$(eval $(call SetupZipArchive, BUILD_JAVADOC_ZIP, \
+    SRC := $(DOCS_OUTPUTDIR), \
+    ZIP := $(JAVADOC_ZIP_FILE), \
+    EXTRA_DEPS := $(JDK_API_JAVADOC_TARGETS) $(JDK_API_MODULEGRAPH_TARGETS) \
+        $(JDK_SPECS_TARGETS), \
+))
+
+ZIP_TARGETS += $(BUILD_JAVADOC_ZIP)
+
+################################################################################
+
+docs-jdk-api-javadoc: $(JDK_API_JAVADOC_TARGETS) $(JDK_API_CUSTOM_TARGETS)
+
+docs-jdk-api-modulegraph: $(JDK_API_MODULEGRAPH_TARGETS)
+
+docs-javase-api-javadoc: $(JAVASE_API_JAVADOC_TARGETS) $(JAVASE_API_CUSTOM_TARGETS)
+
+docs-javase-api-modulegraph: $(JAVASE_API_MODULEGRAPH_TARGETS)
+
+docs-jdk-specs: $(JDK_SPECS_TARGETS)
+
+docs-jdk-index: $(JDK_DOCS_INDEX_HTML_TARGETS)
+
+docs-zip: $(ZIP_TARGETS)
+
+all: docs-jdk-api-javadoc docs-jdk-api-modulegraph docs-javase-api-javadoc \
+    docs-javase-api-modulegraph docs-jdk-specs docs-jdk-index docs-zip
+
+.PHONY: default all docs-jdk-api-javadoc docs-jdk-api-modulegraph \
+    docs-javase-api-javadoc docs-javase-api-modulegraph docs-jdk-specs \
+    docs-jdk-index docs-zip
--- a/make/Javadoc.gmk	Thu May 25 15:27:40 2017 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,461 +0,0 @@
-# Copyright (c) 1997, 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.
-#
-
-default: all
-
-include $(SPEC)
-include MakeBase.gmk
-include Modules.gmk
-include ProcessMarkdown.gmk
-include ZipArchive.gmk
-include $(JDK_TOPDIR)/make/Tools.gmk
-include $(JDK_TOPDIR)/make/ModuleTools.gmk
-
-# This is needed to properly setup DOCS_MODULES.
-$(eval $(call ReadImportMetaData))
-
-################################################################################
-
-# Hook to include the corresponding custom file, if present.
-$(eval $(call IncludeCustomExtension, , Javadoc.gmk))
-
-################################################################################
-# Javadoc settings
-
-# On top of the sources that was used to compile the JDK, we need some
-# extra java.rmi sources that are used just for javadoc.
-MODULES_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) \
-    $(SUPPORT_OUTPUTDIR)/rmic/* $(JDK_TOPDIR)/src/*/share/doc/stub)
-
-# Should we use -Xdocrootparent? Allow custom to overwrite.
-DOCROOTPARENT_FLAG ?= TRUE
-
-# URLs
-JAVADOC_BASE_URL := http://www.oracle.com/pls/topic/lookup?ctx=javase9&id=homepage
-BUG_SUBMIT_URL := http://bugreport.java.com/bugreport/
-COPYRIGHT_URL := {@docroot}/../legal/cpyr.html
-LICENSE_URL := http://www.oracle.com/technetwork/java/javase/terms/license/java9speclicense.html
-REDISTRIBUTION_URL := http://www.oracle.com/technetwork/java/redist-137594.html
-
-
-# In order to get a specific ordering it's necessary to specify the total
-# ordering of tags as the tags are otherwise ordered in order of definition.
-JAVADOC_TAGS := \
-    -tag beaninfo:X \
-    -tag revised:X \
-    -tag since.unbundled:X \
-    -tag spec:X \
-    -tag specdefault:X \
-    -tag Note:X \
-    -tag ToDo:X \
-    -tag 'apiNote:a:API Note:' \
-    -tag 'implSpec:a:Implementation Requirements:' \
-    -tag 'implNote:a:Implementation Note:' \
-    -tag param \
-    -tag return \
-    -tag throws \
-    -taglet build.tools.taglet.ModuleGraph \
-    -tag since \
-    -tag version \
-    -tag serialData \
-    -tag factory \
-    -tag see \
-    -tag 'jvms:a:See <cite>The Java&trade; Virtual Machine Specification</cite>:' \
-    -tag 'jls:a:See <cite>The Java&trade; Language Specification</cite>:' \
-    -taglet build.tools.taglet.ExtLink \
-    -taglet build.tools.taglet.Incubating \
-    -tagletpath $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
-    $(CUSTOM_JAVADOC_TAGS) \
-    #
-
-# Which doclint checks to ignore
-JAVADOC_DISABLED_DOCLINT := accessibility html missing syntax reference
-
-# The initial set of options for javadoc
-JAVADOC_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
-    -serialwarn -encoding ISO-8859-1 -breakiterator -splitIndex --system none \
-    -html5 -javafx --expand-requires transitive
-
-# Should we add DRAFT stamps to the generated javadoc?
-ifeq ($(VERSION_IS_GA), true)
-  IS_DRAFT := false
-else
-  IS_DRAFT := true
-endif
-
-################################################################################
-# General text snippets
-
-FULL_COMPANY_NAME := Oracle and/or its affiliates
-COMPANY_ADDRESS := 500 Oracle Parkway<br>Redwood Shores, CA 94065 USA
-
-ifeq ($(IS_DRAFT), true)
-  DRAFT_MARKER_STR := <br><strong>DRAFT $(VERSION_STRING)</strong>
-  ifeq ($(VERSION_BUILD), 0)
-    DRAFT_MARKER_TITLE := [ad-hoc build]
-  else
-    DRAFT_MARKER_TITLE := [build $(VERSION_BUILD)]
-  endif
-endif
-
-JAVADOC_WINDOW_TITLE := Java Platform SE $(VERSION_SPECIFICATION) \
-    $(DRAFT_MARKER_TITLE)
-
-JAVADOC_HEADER_TITLE := $(subst $(SPACE),&nbsp;,$(strip \
-    <strong>Java&trade; Platform<br>Standard Ed. \
-    $(VERSION_SPECIFICATION)</strong>$(DRAFT_MARKER_STR)))
-
-JAVADOC_BOTTOM := \
-    <span style="font-size:smaller"> \
-    <a href="$(BUG_SUBMIT_URL)">Submit a bug or feature</a><br> \
-    For further API reference and developer documentation, see \
-    <a href="$(JAVADOC_BASE_URL)/index.html" target="_blank">Java SE \
-    Documentation</a>. That documentation contains more detailed, \
-    developer-targeted descriptions, with conceptual overviews, definitions \
-    of terms, workarounds, and working code examples.<br> \
-    Java is a trademark or registered trademark of $(FULL_COMPANY_NAME) in \
-    the US and other countries.<br> \
-    <a href="$(COPYRIGHT_URL)">Copyright</a> \
-    &copy; 1993, $(COPYRIGHT_YEAR), $(FULL_COMPANY_NAME). \
-    $(COMPANY_ADDRESS). All rights reserved. \
-    Use is subject to <a href="$(LICENSE_URL)">license terms</a>. Also see the \
-    <a href="$(REDISTRIBUTION_URL)">documentation redistribution policy</a>. \
-    $(DRAFT_MARKER_STR)</span>
-
-JAVADOC_TOP := \
-    <div style="background-color: $(HASH)EEEEEE"><div style="padding: 6px; \
-    margin-top: 2px; margin-bottom: 6px; margin-left: 6px; margin-right: \
-    6px; text-align: justify; font-size: 80%; font-family: Helvetica, Arial, \
-    sans-serif; font-weight: normal;">Please note that the specifications \
-    and other information contained herein are not final and are subject to \
-    change. The information is being made available to you solely for \
-    purpose of evaluation.</div></div>
-
-################################################################################
-# JDK javadoc titles/text snippets
-
-JDK_JAVADOC_DOC_TITLE := Java&trade; Platform, Standard Edition Development Kit \
-    (JDK&trade;) $(VERSION_SPECIFICATION)<br>API Specification
-
-################################################################################
-# Java SE javadoc titles/text snippets
-
-JAVASE_JAVADOC_DOC_TITLE := Java&trade; Platform, Standard Edition \
-    $(VERSION_SPECIFICATION)<br>API Specification
-
-################################################################################
-# Functions
-
-# Helper function for creating a png file from a dot file generated by the
-# GenGraphs tool.
-# param 1: SetupJavadocGeneration namespace ($1)
-# param 2: module name
-#
-define setup_gengraph_dot_to_png
-  $1_$2_DOT_SRC :=  $$($1_GENGRAPHS_DIR)/$2.dot
-  $1_$2_PNG_TARGET := $$($1_TARGET_DIR)/$2-graph.png
-
-    # For each module needing a graph, create a png file from the dot file
-    # generated by the GenGraphs tool and store it in the target dir.
-    $$($1_$2_PNG_TARGET): $$($1_GENGRAPHS_MARKER)
-	$$(call MakeDir, $$(@D))
-	$$(call ExecuteWithLog, $$($1_$2_DOT_SRC), \
-	    $$(DOT) -Tpng -o $$($1_$2_PNG_TARGET) $$($1_$2_DOT_SRC))
-
-  $1_MODULEGRAPH_TARGETS += $$($1_$2_PNG_TARGET)
-endef
-
-################################################################################
-# Setup make rules for creating the API documentation, using javadoc and other
-# tools if needed.
-#
-# Parameter 1 is the name of the rule. This name is used as variable prefix.
-# Targets generated are returned as $1_JAVADOC_TARGETS and
-# $1_MODULEGRAPH_TARGETS. Note that the index.html file will work as a "touch
-# file" for all the magnitude of files that are generated by javadoc.
-#
-# Remaining parameters are named arguments. These include:
-#   MODULES - Modules to generate javadoc for
-#   NAME - The name of the javadoc compilation, to be presented to the user
-#   TARGET_DIR - Where to store the output
-#   OVERVIEW - Path to an html overview file
-#   DOC_TITLE - Title to use in -doctitle.
-#   WINDOW_TITLE - Title to use in -windowtitle.
-#   HEADER_TITLE - Title to use in -header.
-#   BOTTOM_TEXT - Text to use in -bottom.
-#   TOP_TEXT - Text to use in -top.
-#
-SetupApiDocsGeneration = $(NamedParamsMacroTemplate)
-define SetupApiDocsGenerationBody
-
-  # Figure out all modules, both specified and transitive, that will be processed
-  # by javadoc.
-  $1_TRANSITIVE_MODULES := $$(call FindTransitiveDepsForModules, $$($1_MODULES))
-  $1_ALL_MODULES := $$(sort $$($1_MODULES) $$($1_TRANSITIVE_MODULES))
-
-  ifeq ($$(ENABLE_FULL_DOCS), true)
-    # Tell the ModuleGraph taglet to generate html links to soon-to-be-created
-    # png files with module graphs.
-    $1_JAVA_ARGS += -DenableModuleGraph=true
-  endif
-
-  # Always include tags and basic options
-  $1_OPTIONS := $$(JAVADOC_TAGS) $$(JAVADOC_OPTIONS)
-
-  $1_OPTIONS += -overview $$($1_OVERVIEW)
-  $1_OPTIONS += --module-source-path $$(MODULES_SOURCE_PATH)
-  $1_OPTIONS += --module $$(call CommaList, $$($1_MODULES))
-
-  # Create a string like "-Xdoclint:all,-syntax,-html,..."
-  $1_OPTIONS += -Xdoclint:all,$$(call CommaList, $$(addprefix -, \
-      $$(JAVADOC_DISABLED_DOCLINT)))
-
-  ifeq ($$($$DOCROOTPARENT_FLAG), TRUE)
-    $1_OPTIONS += -Xdocrootparent $$(JAVADOC_BASE_URL)
-  endif
-
-  $1_OPTIONS += -doctitle '$$($1_DOC_TITLE)'
-  $1_OPTIONS += -windowtitle '$$($1_WINDOW_TITLE)'
-  $1_OPTIONS += -header '$$($1_HEADER_TITLE)'
-  $1_OPTIONS += -bottom '$$($1_BOTTOM_TEXT)'
-  ifeq ($$(IS_DRAFT), true)
-    $1_OPTIONS += -top '$$($1_TOP_TEXT)'
-  endif
-
-  # Do not store debug level options in VARDEPS.
-  ifneq ($$(LOG_LEVEL), trace)
-    $1_LOG_OPTION += -quiet
-  else
-    $1_LOG_OPTION += -verbose
-  endif
-
-  $1_VARDEPS := $$($1_JAVA_ARGS) $$($1_OPTIONS) $$(MODULES_SOURCE_PATH) \
-      $$($1_ALL_MODULES)
-  $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
-      $$(SUPPORT_OUTPUTDIR)/docs/$1.vardeps)
-
-  # Get a list of all files in all the source dirs for all included modules
-  $1_SOURCE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach module, \
-      $$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module)))))
-
-  # Javadoc creates a lot of files but use index.html as a marker
-  $$($1_TARGET_DIR)/index.html: $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) \
-      $$($1_SOURCE_DEPS) $$($1_OVERVIEW)
-	$$(call LogWarn, Generating $$($1_NAME) API javadoc for \
-	    $$(words $$($1_ALL_MODULES)) modules)
-	$$(call LogInfo, Javadoc modules: $$($1_ALL_MODULES))
-	$$(call MakeDir, $$($1_TARGET_DIR))
-	$$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/docs/$1, \
-	    $$(JAVA) -Djava.awt.headless=true $$($1_JAVA_ARGS) \
-	        $$(NEW_JAVADOC) -d $$($1_TARGET_DIR) \
-	        $$(JAVADOC_TAGS) $$($1_OPTIONS) $$($1_LOG_OPTION))
-
-  $1_JAVADOC_TARGETS := $$($1_TARGET_DIR)/index.html
-
-  ifeq ($$(ENABLE_FULL_DOCS), true)
-    # We have asked ModuleGraph to generate links to png files. Now we must
-    # produce the png files.
-
-    # Locate which modules has the @moduleGraph tag in their module-info.java
-    $1_MODULES_NEEDING_GRAPH := $$(strip $$(foreach m, $$($1_ALL_MODULES), \
-      $$(if $$(shell $$(GREP) -e @moduleGraph \
-          $$(wildcard $$(addsuffix /module-info.java, \
-          $$(call FindModuleSrcDirs, $$m)))), \
-        $$m) \
-    ))
-
-    # First we run the GenGraph tool. It will query the module structure of the
-    # running JVM and output .dot files for all existing modules.
-    GENGRAPHS_PROPS := \
-        $$(JDK_TOPDIR)/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
-
-    $1_GENGRAPHS_DIR := $$(SUPPORT_OUTPUTDIR)/docs/$1-gengraphs
-    $1_GENGRAPHS_MARKER := $$($1_GENGRAPHS_DIR)/_gengraphs_run.marker
-
-    $$($1_GENGRAPHS_MARKER): $$(BUILD_JIGSAW_TOOLS) $$(GENGRAPHS_PROPS)
-	$$(call LogInfo, Running gengraphs for $$($1_NAME) API documentation)
-	$$(call MakeDir, $$($1_GENGRAPHS_DIR))
-	$$(call ExecuteWithLog, $$($1_GENGRAPHS_DIR)/gengraphs, \
-	    $$(TOOL_GENGRAPHS) --spec --output $$($1_GENGRAPHS_DIR) \
-	    --dot-attributes $$(GENGRAPHS_PROPS) && \
-	    $$(TOUCH) $$($1_GENGRAPHS_MARKER))
-
-    # For each module needing a graph, create a png file from the dot file
-    # generated by the GenGraphs tool and store it in the target dir.
-    # They will depend on $1_GENGRAPHS_MARKER, and will be added to $1.
-    $$(foreach m, $$($1_MODULES_NEEDING_GRAPH), \
-      $$(eval $$(call setup_gengraph_dot_to_png,$1,$$m)) \
-    )
-  endif
-endef
-
-################################################################################
-# Setup generation of the JDK API documentation (javadoc + modulegraph)
-
-# All modules to have docs generated by docs-jdk-api target
-JDK_JAVADOC_MODULES := $(sort $(DOCS_MODULES))
-
-JDK_JAVADOC_OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html
-
-$(eval $(call SetupApiDocsGeneration, JDK_API, \
-    MODULES := $(JDK_JAVADOC_MODULES), \
-    NAME := JDK, \
-    TARGET_DIR := $(JAVADOC_OUTPUTDIR)/api, \
-    OVERVIEW := $(JDK_JAVADOC_OVERVIEW), \
-    DOC_TITLE := $(JDK_JAVADOC_DOC_TITLE), \
-    WINDOW_TITLE := $(JAVADOC_WINDOW_TITLE), \
-    HEADER_TITLE := $(JAVADOC_HEADER_TITLE), \
-    BOTTOM_TEXT := $(JAVADOC_BOTTOM), \
-    TOP_TEXT := $(JAVADOC_TOP), \
-))
-
-# Targets generated are returned in JDK_API_JAVADOC_TARGETS and
-# JDK_API_MODULEGRAPH_TARGETS.
-
-################################################################################
-# Setup generation of the Java SE API documentation (javadoc + modulegraph)
-
-# The Java SE module scope is just java.se.ee and it's transitive modules.
-JAVASE_JAVADOC_MODULES := java.se.ee
-
-JAVASE_JAVADOC_OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html
-
-$(eval $(call SetupApiDocsGeneration, JAVASE_API, \
-    MODULES := $(JAVASE_JAVADOC_MODULES), \
-    NAME := Java SE, \
-    TARGET_DIR := $(IMAGES_OUTPUTDIR)/javase-docs/api, \
-    OVERVIEW := $(JAVASE_JAVADOC_OVERVIEW), \
-    DOC_TITLE := $(JAVASE_JAVADOC_DOC_TITLE), \
-    WINDOW_TITLE := $(JAVADOC_WINDOW_TITLE), \
-    HEADER_TITLE := $(JAVADOC_HEADER_TITLE), \
-    BOTTOM_TEXT := $(JAVADOC_BOTTOM), \
-    TOP_TEXT := $(JAVADOC_TOP), \
-))
-
-# Targets generated are returned in JAVASE_API_JAVADOC_TARGETS and
-# JAVASE_API_MODULEGRAPH_TARGETS.
-
-################################################################################
-# Copy JDK specs files
-
-# For all html documentation in $module/share/specs directories, copy it
-# unmodified
-
-ALL_MODULES := $(call FindAllModules)
-COPY_SPEC_FILTER := %.html %.gif %.jpg %.mib %.css
-
-$(foreach m, $(ALL_MODULES), \
-  $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
-  $(if $(SPECS_$m), \
-    $(eval $(call SetupCopyFiles, COPY_$m, \
-        SRC := $(SPECS_$m), \
-        FILES := $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $(SPECS_$m))), \
-        DEST := $(JAVADOC_OUTPUTDIR)/specs/, \
-    )) \
-    $(eval JDK_SPECS_TARGETS += $(COPY_$m)) \
-  ) \
-)
-
-# Copy the global resources
-GLOBAL_SPECS_RESOURCES_DIR := $(JDK_TOPDIR)/make/data/docs-resources/specs
-$(eval $(call SetupCopyFiles, COPY_GLOBAL_RESOURCES, \
-    SRC := $(GLOBAL_SPECS_RESOURCES_DIR), \
-    FILES := $(call CacheFind, $(GLOBAL_SPECS_RESOURCES_DIR)), \
-    DEST := $(JAVADOC_OUTPUTDIR)/specs/, \
-))
-JDK_SPECS_TARGETS += $(COPY_GLOBAL_RESOURCES)
-
-ifeq ($(ENABLE_FULL_DOCS), true)
-  # For all markdown files in $module/share/specs directories, convert them to
-  # html.
-
-  GLOBAL_SPECS_DEFAULT_CSS_FILE := $(JAVADOC_OUTPUTDIR)/specs/resources/jdk-default.css
-
-  $(foreach m, $(ALL_MODULES), \
-    $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
-    $(foreach d, $(SPECS_$m), \
-      $(if $(filter %.md, $(call CacheFind, $d)), \
-        $(eval $(call SetupProcessMarkdown, CONVERT_MARKDOWN_$m_$(patsubst $(TOPDIR)/%,%,$d), \
-            SRC := $d, \
-            FILES := $(filter %.md, $(call CacheFind, $d)), \
-            DEST := $(JAVADOC_OUTPUTDIR)/specs/, \
-            CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
-        )) \
-      ) \
-      $(eval JDK_SPECS_TARGETS += $(CONVERT_MARKDOWN_$m_$(patsubst $(TOPDIR)/%,%,$d))) \
-    ) \
-  )
-endif
-
-# Special treatment for generated documentation
-
-JDWP_PROTOCOL := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html
-$(eval $(call SetupCopyFiles, COPY_JDWP_PROTOCOL, \
-    FILES := $(JDWP_PROTOCOL), \
-    DEST := $(JAVADOC_OUTPUTDIR)/specs/jdwp, \
-))
-JDK_SPECS_TARGETS += $(COPY_JDWP_PROTOCOL)
-
-# Get jvmti.html from the main jvm variant (all variants' jvmti.html are identical).
-JVMTI_HTML := $(HOTSPOT_OUTPUTDIR)/variant-$(JVM_VARIANT_MAIN)/gensrc/jvmtifiles/jvmti.html
-$(eval $(call SetupCopyFiles, COPY_JVMTI_HTML, \
-    FILES := $(JVMTI_HTML), \
-    DEST := $(JAVADOC_OUTPUTDIR)/specs, \
-))
-JDK_SPECS_TARGETS += $(COPY_JVMTI_HTML)
-
-################################################################################
-# Optional target which bundles all generated javadocs into a zip archive.
-
-JAVADOC_ZIP_NAME := jdk-$(VERSION_STRING)-docs.zip
-JAVADOC_ZIP_FILE := $(OUTPUT_ROOT)/bundles/$(JAVADOC_ZIP_NAME)
-
-$(eval $(call SetupZipArchive, BUILD_JAVADOC_ZIP, \
-    SRC := $(JAVADOC_OUTPUTDIR), \
-    ZIP := $(JAVADOC_ZIP_FILE), \
-    EXTRA_DEPS := $(JDK_API_JAVADOC_TARGETS) $(JDK_API_MODULEGRAPH_TARGETS) \
-        $(JDK_SPECS_TARGETS), \
-))
-
-ZIP_TARGETS += $(BUILD_JAVADOC_ZIP)
-
-################################################################################
-
-docs-jdk-api-javadoc: $(JDK_API_JAVADOC_TARGETS)
-
-docs-jdk-api-modulegraph: $(JDK_API_MODULEGRAPH_TARGETS)
-
-docs-javase-api-javadoc: $(JAVASE_API_JAVADOC_TARGETS)
-
-docs-javase-api-modulegraph: $(JAVASE_API_MODULEGRAPH_TARGETS)
-
-docs-jdk-specs: $(JDK_SPECS_TARGETS)
-
-docs-zip: $(ZIP_TARGETS)
-
-all: docs-jdk-api-javadoc docs-jdk-api-modulegraph docs-javase-api-javadoc \
-    docs-javase-api-modulegraph docs-jdk-specs docs-zip
-
-.PHONY: default all docs-jdk-api-javadoc docs-jdk-api-modulegraph \
-    docs-javase-api-javadoc docs-javase-api-modulegraph docs-jdk-specs docs-zip
--- a/make/Main.gmk	Thu May 25 15:27:40 2017 -0700
+++ b/make/Main.gmk	Thu May 25 22:33:25 2017 +0000
@@ -277,7 +277,10 @@
 demos-jdk:
 	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk)
 
-ALL_TARGETS += demos-jdk
+test-image-demos-jdk:
+	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk images)
+
+ALL_TARGETS += demos-jdk test-image-demos-jdk
 
 ################################################################################
 # Jigsaw specific data and analysis targets.
@@ -363,29 +366,32 @@
 # If building full docs, to complete docs-*-api we need both the javadoc and
 # modulegraph targets.
 docs-jdk-api-javadoc:
-	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-jdk-api-javadoc)
+	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-jdk-api-javadoc)
 
 docs-jdk-api-modulegraph:
-	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-jdk-api-modulegraph)
+	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-jdk-api-modulegraph)
 
 docs-javase-api-javadoc:
-	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-javase-api-javadoc)
+	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-javase-api-javadoc)
 
 docs-javase-api-modulegraph:
-	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-javase-api-modulegraph)
+	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-javase-api-modulegraph)
 
 docs-jdk-specs:
-	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-jdk-specs)
+	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-jdk-specs)
+
+docs-jdk-index:
+	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-jdk-index)
 
 docs-zip:
-	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-zip)
+	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-zip)
 
 update-build-docs:
 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f UpdateBuildDocs.gmk)
 
 ALL_TARGETS += docs-jdk-api-javadoc docs-jdk-api-modulegraph \
     docs-javase-api-javadoc docs-javase-api-modulegraph docs-jdk-specs \
-    docs-zip update-build-docs
+    docs-jdk-index docs-zip update-build-docs
 
 ################################################################################
 # Cross compilation support
@@ -631,6 +637,7 @@
   # jdk libs, even though they don't need to. To avoid warnings, make sure they
   # aren't built until after libjava and libjvm are available to link to.
   demos-jdk: java.base-libs exploded-image-optimize
+  test-image-demos-jdk: demos-jdk
 
   # Declare dependency from <module>-java to <module>-gensrc
   $(foreach m, $(GENSRC_MODULES), $(eval $m-java: $m-gensrc))
@@ -793,6 +800,8 @@
   # The gensrc steps for hotspot and jdk.jdi create html spec files.
   docs-jdk-specs: hotspot-$(JVM_VARIANT_MAIN)-gensrc jdk.jdi-gensrc
 
+  docs-jdk-index: exploded-image buildtools-modules
+
   docs-zip: docs-jdk
 
   test: jdk-image test-image
@@ -922,7 +931,7 @@
   docs-javase-api: docs-javase-api-modulegraph
 endif
 
-docs-jdk: docs-jdk-api docs-jdk-specs
+docs-jdk: docs-jdk-api docs-jdk-specs docs-jdk-index
 docs-javase: docs-javase-api
 
 # alias for backwards compatibility
@@ -963,7 +972,8 @@
 
 # This target builds the test image
 test-image: prepare-test-image test-image-hotspot-jtreg-native \
-    test-image-jdk-jtreg-native test-image-failure-handler test-image-hotspot-gtest
+    test-image-jdk-jtreg-native test-image-failure-handler test-image-hotspot-gtest \
+    test-image-demos-jdk
 
 # all-images builds all our deliverables as images.
 all-images: product-images test-image docs-image
--- a/make/RunTests.gmk	Thu May 25 15:27:40 2017 -0700
+++ b/make/RunTests.gmk	Thu May 25 22:33:25 2017 +0000
@@ -299,6 +299,12 @@
   $1_TEST_NAME := $$(strip $$(patsubst jtreg:%, %, $$($1_TEST)))
   $1_COMPONENT := $$(firstword $$(subst /, $$(SPACE), $$($1_TEST_NAME)))
 
+  ifeq ($$(JT_HOME), )
+    $$(info Error: jtreg framework is not found.)
+    $$(info Please run configure using --with-jtreg.)
+    $$(error Cannot continue)
+  endif
+
   # Unfortunately, we need different defaults for some JTREG values,
   # depending on what component we're running.
 
--- a/make/common/Modules.gmk	Thu May 25 15:27:40 2017 -0700
+++ b/make/common/Modules.gmk	Thu May 25 22:33:25 2017 +0000
@@ -391,7 +391,10 @@
       else ifeq ($$(classloader), ext)
         PLATFORM_MODULES += $1
       endif
-      DOCS_MODULES += $1
+      ifneq ($$(include_in_docs), false)
+        # defaults to true if unspecified
+        DOCS_MODULES += $1
+      endif
     else
       # Default to include in all
       JRE_MODULES += $1
--- a/nashorn/.hgtags	Thu May 25 15:27:40 2017 -0700
+++ b/nashorn/.hgtags	Thu May 25 22:33:25 2017 +0000
@@ -410,3 +410,6 @@
 e118c818dbf84d15191414c453b77c089116fdc0 jdk-9+167
 0f81cde5a1f75786f381dbfb59b9afbab70174c7 jdk-9+168
 131e250080158e57ce45130560f5f987b92642b5 jdk-9+169
+550bfc15779f8f339610793867fdc251125811b5 jdk-9+170
+7e9cb37e6d6edbe56fdf4d510e5110f797823f09 jdk-10+7
+edb825e2dfb140c8e57a61b5d45de19edebccccf jdk-10+8
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForOfLoopTree.java	Thu May 25 15:27:40 2017 -0700
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForOfLoopTree.java	Thu May 25 22:33:25 2017 +0000
@@ -38,7 +38,7 @@
  */
 public interface ForOfLoopTree extends LoopTree {
     /**
-     * The for..in left hand side expression.
+     * The for..of left hand side expression.
      *
      * @return the left hand side expression
      */
@@ -52,7 +52,7 @@
     ExpressionTree getExpression();
 
     /**
-     * The statement contained in this for..in statement.
+     * The statement contained in this for..of statement.
      *
      * @return the statement
      */
--- a/test/lib/RedefineClassHelper.java	Thu May 25 15:27:40 2017 -0700
+++ b/test/lib/RedefineClassHelper.java	Thu May 25 22:33:25 2017 +0000
@@ -23,7 +23,7 @@
 
 import java.io.PrintWriter;
 import java.lang.instrument.*;
-import jdk.test.lib.InMemoryJavaCompiler;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
 
 /*
  * Helper class to write tests that redefine classes.
--- a/test/lib/jdk/test/lib/DynamicVMOption.java	Thu May 25 15:27:40 2017 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * 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.test.lib;
-
-import com.sun.management.HotSpotDiagnosticMXBean;
-import java.lang.management.ManagementFactory;
-
-/**
- * A utility class to work with VM options which could be altered during
- * execution.
- *
- * This class is a wrapper around {@code com.sun.management.VMOption}.
- * It provides more convenient interface to read/write the values.
- *
- */
-public class DynamicVMOption {
-
-    private final HotSpotDiagnosticMXBean mxBean;
-
-    /**
-     * VM option name, like "MinHeapFreeRatio".
-     */
-    public final String name;
-
-    /**
-     * Creates an instance of DynamicVMOption.
-     *
-     * @param name the VM option name
-     */
-    public DynamicVMOption(String name) {
-        this.name = name;
-        mxBean = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
-    }
-
-    /**
-     * Sets a new value for the option.
-     * Trying to set not applicable value will cause IllegalArgumentException.
-     * Behavior with null is undefined, most likely NPE will be thrown.
-     *
-     * @param newValue the value to be set
-     * @see #getValue()
-     * @throws IllegalArgumentException if newValue is not applicable to the option
-     */
-    public final void setValue(String newValue) {
-        mxBean.setVMOption(name, newValue);
-    }
-
-    /**
-     * Returns the value of option.
-     *
-     * @return the current option value
-     * @see #setValue(java.lang.String)
-     */
-    public final String getValue() {
-        return mxBean.getVMOption(name).getValue();
-    }
-
-    /**
-     * Returns true, if option is writable, false otherwise.
-     *
-     * @return true, if option is writable, false otherwise
-     */
-    public final boolean isWriteable() {
-        return mxBean.getVMOption(name).isWriteable();
-    }
-
-    /**
-     * Checks if the given value is applicable for the option.
-     *
-     * This method tries to set the option to the new value. If no exception
-     * has been thrown the value is treated as valid.
-     *
-     * Calling this method will not change the option value. After an attempt
-     * to set a new value, the option will be restored to its previous value.
-     *
-     * @param value the value to verify
-     * @return true if option could be set to the given value
-     */
-    public boolean isValidValue(String value) {
-        boolean isValid = true;
-        String oldValue = getValue();
-        try {
-            setValue(value);
-        } catch (NullPointerException e) {
-            if (value == null) {
-                isValid = false;
-            }
-        } catch (IllegalArgumentException e) {
-            isValid = false;
-        } finally {
-            setValue(oldValue);
-        }
-        return isValid;
-    }
-
-    /**
-     * Returns the value of the given VM option as String.
-     *
-     * This is a simple shortcut for {@code new DynamicVMOption(name).getValue()}
-     *
-     * @param name the name of VM option
-     * @return value as a string
-     * @see #getValue()
-     */
-    public static String getString(String name) {
-        return new DynamicVMOption(name).getValue();
-    }
-
-    /**
-     * Returns the value of the given option as int.
-     *
-     * @param name the name of VM option
-     * @return value parsed as integer
-     * @see #getString(java.lang.String)
-     *
-     */
-    public static int getInt(String name) {
-        return Integer.parseInt(getString(name));
-    }
-
-    /**
-     * Sets the VM option to a new value.
-     *
-     * This is a simple shortcut for {@code new DynamicVMOption(name).setValue(value)}
-     *
-     * @param name the name of VM option
-     * @param value the value to be set
-     * @see #setValue(java.lang.String)
-     */
-    public static void setString(String name, String value) {
-        new DynamicVMOption(name).setValue(value);
-    }
-
-    /**
-     * Sets the VM option value to a new integer value.
-     *
-     * @param name the name of VM option
-     * @param value the integer value to be set
-     * @see #setString(java.lang.String, java.lang.String)
-     */
-    public static void setInt(String name, int value) {
-        new DynamicVMOption(name).setValue(Integer.toString(value));
-    }
-
-}
--- a/test/lib/jdk/test/lib/InMemoryJavaCompiler.java	Thu May 25 15:27:40 2017 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2013, 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.
- */
-
-package jdk.test.lib;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.tools.ForwardingJavaFileManager;
-import javax.tools.FileObject;
-import javax.tools.JavaCompiler;
-import javax.tools.JavaCompiler.CompilationTask;
-import javax.tools.JavaFileObject;
-import javax.tools.JavaFileObject.Kind;
-import javax.tools.SimpleJavaFileObject;
-import javax.tools.StandardLocation;
-import javax.tools.ToolProvider;
-
-/**
- * {@code InMemoryJavaCompiler} can be used for compiling a {@link
- * CharSequence} to a {@code byte[]}.
- *
- * The compiler will not use the file system at all, instead using a {@link
- * ByteArrayOutputStream} for storing the byte code. For the source code, any
- * kind of {@link CharSequence} can be used, e.g. {@link String}, {@link
- * StringBuffer} or {@link StringBuilder}.
- *
- * The {@code InMemoryCompiler} can easily be used together with a {@code
- * ByteClassLoader} to easily compile and load source code in a {@link String}:
- *
- * <pre>
- * {@code
- * import jdk.test.lib.InMemoryJavaCompiler;
- * import jdk.test.lib.ByteClassLoader;
- *
- * class Example {
- *     public static void main(String[] args) {
- *         String className = "Foo";
- *         String sourceCode = "public class " + className + " {" +
- *                             "    public void bar() {" +
- *                             "        System.out.println("Hello from bar!");" +
- *                             "    }" +
- *                             "}";
- *         byte[] byteCode = InMemoryJavaCompiler.compile(className, sourceCode);
- *         Class fooClass = ByteClassLoader.load(className, byteCode);
- *     }
- * }
- * }
- * </pre>
- */
-public class InMemoryJavaCompiler {
-    private static class MemoryJavaFileObject extends SimpleJavaFileObject {
-        private final String className;
-        private final CharSequence sourceCode;
-        private final ByteArrayOutputStream byteCode;
-
-        public MemoryJavaFileObject(String className, CharSequence sourceCode) {
-            super(URI.create("string:///" + className.replace('.','/') + Kind.SOURCE.extension), Kind.SOURCE);
-            this.className = className;
-            this.sourceCode = sourceCode;
-            this.byteCode = new ByteArrayOutputStream();
-        }
-
-        @Override
-        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
-            return sourceCode;
-        }
-
-        @Override
-        public OutputStream openOutputStream() throws IOException {
-            return byteCode;
-        }
-
-        public byte[] getByteCode() {
-            return byteCode.toByteArray();
-        }
-
-        public String getClassName() {
-            return className;
-        }
-    }
-
-    private static class FileManagerWrapper extends ForwardingJavaFileManager {
-        private static final Location PATCH_LOCATION = new Location() {
-            @Override
-            public String getName() {
-                return "patch module location";
-            }
-
-            @Override
-            public boolean isOutputLocation() {
-                return false;
-            }
-        };
-        private final MemoryJavaFileObject file;
-        private final String moduleOverride;
-
-        public FileManagerWrapper(MemoryJavaFileObject file, String moduleOverride) {
-            super(getCompiler().getStandardFileManager(null, null, null));
-            this.file = file;
-            this.moduleOverride = moduleOverride;
-        }
-
-        @Override
-        public JavaFileObject getJavaFileForOutput(Location location, String className,
-                                                   Kind kind, FileObject sibling)
-            throws IOException {
-            if (!file.getClassName().equals(className)) {
-                throw new IOException("Expected class with name " + file.getClassName() +
-                                      ", but got " + className);
-            }
-            return file;
-        }
-
-        @Override
-        public Location getLocationForModule(Location location, JavaFileObject fo) throws IOException {
-            if (fo == file && moduleOverride != null) {
-                return PATCH_LOCATION;
-            }
-            return super.getLocationForModule(location, fo);
-        }
-
-        @Override
-        public String inferModuleName(Location location) throws IOException {
-            if (location == PATCH_LOCATION) {
-                return moduleOverride;
-            }
-            return super.inferModuleName(location);
-        }
-
-        @Override
-        public boolean hasLocation(Location location) {
-            return super.hasLocation(location) || location == StandardLocation.PATCH_MODULE_PATH;
-        }
-
-    }
-
-    /**
-     * Compiles the class with the given name and source code.
-     *
-     * @param className The name of the class
-     * @param sourceCode The source code for the class with name {@code className}
-     * @param options additional command line options
-     * @throws RuntimeException if the compilation did not succeed
-     * @return The resulting byte code from the compilation
-     */
-    public static byte[] compile(String className, CharSequence sourceCode, String... options) {
-        MemoryJavaFileObject file = new MemoryJavaFileObject(className, sourceCode);
-        CompilationTask task = getCompilationTask(file, options);
-
-        if(!task.call()) {
-            throw new RuntimeException("Could not compile " + className + " with source code " + sourceCode);
-        }
-
-        return file.getByteCode();
-    }
-
-    private static JavaCompiler getCompiler() {
-        return ToolProvider.getSystemJavaCompiler();
-    }
-
-    private static CompilationTask getCompilationTask(MemoryJavaFileObject file, String... options) {
-        List<String> opts = new ArrayList<>();
-        String moduleOverride = null;
-        for (String opt : options) {
-            if (opt.startsWith("-Xmodule:")) {
-                moduleOverride = opt.substring("-Xmodule:".length());
-            } else {
-                opts.add(opt);
-            }
-        }
-        return getCompiler().getTask(null, new FileManagerWrapper(file, moduleOverride), null, opts, null, Arrays.asList(file));
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/jdk/test/lib/LockFreeLogger.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2014, 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.
+ */
+
+package jdk.test.lib;
+
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
+
+/**
+ * A logger designed specifically to allow collecting ordered log messages
+ * in a multi-threaded environment without involving any kind of locking.
+ * <p>
+ * It is particularly useful in situations when one needs to assert various
+ * details about the tested thread state or the locks it hold while also wanting
+ * to produce diagnostic log messages.
+ * <p>
+ * The logger does not provide any guarantees about the completness of the
+ * logs written from different threads - it is up to the caller to make sure
+ * {@code toString()} method is called only when all the activity has ceased
+ * and the per-thread logs contain all the necessary data.
+ *
+ * @author Jaroslav Bachorik
+ **/
+public class LockFreeLogger {
+    private final AtomicInteger logCntr = new AtomicInteger(0);
+    private final Collection<Map<Integer, String>> allRecords = new ConcurrentLinkedQueue<>();
+    private final ThreadLocal<Map<Integer, String>> records = ThreadLocal.withInitial(ConcurrentHashMap::new);
+
+    public LockFreeLogger() {
+        allRecords.add(records.get());
+    }
+
+    /**
+     * Log a message
+     * @param format Message format
+     * @param params Message parameters
+     */
+    public void log(String format, Object ... params) {
+        int id = logCntr.getAndIncrement();
+        records.get().put(id, String.format(format, params));
+    }
+
+    /**
+     * Will generate an aggregated log of chronologically ordered messages.
+     * <p>
+     * Make sure that you call this method only when all the related threads
+     * have finished; otherwise you might get incomplete data.
+     *
+     * @return An aggregated log of chronologically ordered messages
+     */
+    @Override
+    public String toString() {
+        return allRecords.stream()
+            .flatMap(m -> m.entrySet().stream())
+            .sorted(Comparator.comparing(Map.Entry::getKey))
+            .map(Map.Entry::getValue)
+            .collect(Collectors.joining());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/jdk/test/lib/NetworkConfiguration.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,272 @@
+/*
+ * 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.
+ *
+ * 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.test.lib;
+
+import java.io.PrintStream;
+import java.io.UncheckedIOException;
+import java.io.IOException;
+import java.net.Inet4Address;
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import static java.net.NetworkInterface.getNetworkInterfaces;
+import static java.util.Collections.list;
+
+/**
+ * Helper class for retrieving network interfaces and local addresses
+ * suitable for testing.
+ */
+public class NetworkConfiguration {
+
+    private Map<NetworkInterface,List<Inet4Address>> ip4Interfaces;
+    private Map<NetworkInterface,List<Inet6Address>> ip6Interfaces;
+
+    private NetworkConfiguration(
+            Map<NetworkInterface,List<Inet4Address>> ip4Interfaces,
+            Map<NetworkInterface,List<Inet6Address>> ip6Interfaces) {
+        this.ip4Interfaces = ip4Interfaces;
+        this.ip6Interfaces = ip6Interfaces;
+    }
+
+    /**
+     * Returns a stream of interfaces suitable for functional tests.
+     */
+    public Stream<NetworkInterface> interfaces() {
+        return Stream.concat(ip4Interfaces(), ip6Interfaces())
+                     .distinct();
+    }
+
+    /**
+     * Returns a stream of interfaces suitable for IPv4 functional tests.
+     */
+    public Stream<NetworkInterface> ip4Interfaces() {
+        return ip4Interfaces.keySet()
+                            .stream()
+                            .filter(NetworkConfiguration::isNotExcludedInterface)
+                            .filter(hasIp4Addresses);
+    }
+
+    /**
+     * Returns a stream of interfaces suitable for IPv6 functional tests.
+     */
+    public Stream<NetworkInterface> ip6Interfaces() {
+        return ip6Interfaces.keySet()
+                            .stream()
+                            .filter(NetworkConfiguration::isNotExcludedInterface)
+                            .filter(hasIp6Addresses);
+    }
+
+    private static boolean isNotExcludedInterface(NetworkInterface nif) {
+        if (Platform.isOSX() && nif.getName().contains("awdl")) {
+            return false;
+        }
+        String dName = nif.getDisplayName();
+        if (Platform.isWindows() && dName != null && dName.contains("Teredo")) {
+            return false;
+        }
+        return true;
+    }
+
+    private final Predicate<NetworkInterface> hasIp4Addresses = nif ->
+            ip4Interfaces.get(nif).stream().anyMatch(a -> !a.isAnyLocalAddress());
+
+    private final Predicate<NetworkInterface> hasIp6Addresses = nif ->
+            ip6Interfaces.get(nif).stream().anyMatch(a -> !a.isAnyLocalAddress());
+
+
+    /**
+     * Returns a stream of interfaces suitable for IPv4 multicast tests.
+     */
+    public Stream<NetworkInterface> ip4MulticastInterfaces() {
+        return ip4Interfaces().filter(supportsIp4Multicast);
+    }
+
+    /**
+     * Returns a stream of interfaces suitable for IPv6 multicast tests.
+     */
+    public Stream<NetworkInterface> ip6MulticastInterfaces() {
+        return ip6Interfaces().filter(supportsIp6Multicast);
+    }
+
+    private final Predicate<NetworkInterface> supportsIp4Multicast = nif -> {
+        try {
+            if (!nif.supportsMulticast() || nif.isLoopback()) {
+                return false;
+            }
+            return hasIp4Addresses.test(nif);
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        }
+    };
+
+    private final Predicate<NetworkInterface> supportsIp6Multicast = nif -> {
+        try {
+            if (!nif.supportsMulticast() || nif.isLoopback()) {
+                return false;
+            }
+
+            return hasIp6Addresses.test(nif);
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        }
+    };
+
+    /**
+     * Returns all addresses on all "functional" interfaces.
+     */
+    public Stream<InetAddress> addresses(NetworkInterface nif) {
+        return Stream.concat(ip4Interfaces.get(nif).stream(),
+                             ip6Interfaces.get(nif).stream());
+    }
+
+    /**
+     * Returns all IPv4 addresses on all "functional" interfaces.
+     */
+    public Stream<Inet4Address> ip4Addresses() {
+        return ip4Interfaces().flatMap(this::ip4Addresses);
+    }
+
+    /**
+     * Returns all IPv6 addresses on all "functional" interfaces.
+     */
+    public Stream<Inet6Address> ip6Addresses() {
+        return ip6Interfaces().flatMap(this::ip6Addresses);
+    }
+
+    /**
+     * Returns all IPv4 addresses the given interface.
+     */
+    public Stream<Inet4Address> ip4Addresses(NetworkInterface nif) {
+        return ip4Interfaces.get(nif).stream();
+    }
+
+    /**
+     * Returns all IPv6 addresses for the given interface.
+     */
+    public Stream<Inet6Address> ip6Addresses(NetworkInterface nif) {
+        return ip6Interfaces.get(nif).stream();
+    }
+
+    /**
+     * Return a NetworkConfiguration instance.
+     */
+    public static NetworkConfiguration probe() throws IOException {
+        Map<NetworkInterface, List<Inet4Address>> ip4Interfaces = new HashMap<>();
+        Map<NetworkInterface, List<Inet6Address>> ip6Interfaces = new HashMap<>();
+
+        List<NetworkInterface> nifs = list(getNetworkInterfaces());
+        for (NetworkInterface nif : nifs) {
+            // ignore interfaces that are down
+            if (!nif.isUp() || nif.isPointToPoint()) {
+                continue;
+            }
+
+            List<Inet4Address> ip4Addresses = new LinkedList<>();
+            List<Inet6Address> ip6Addresses = new LinkedList<>();
+            ip4Interfaces.put(nif, ip4Addresses);
+            ip6Interfaces.put(nif, ip6Addresses);
+            for (InetAddress addr : list(nif.getInetAddresses())) {
+                if (addr instanceof Inet4Address) {
+                    ip4Addresses.add((Inet4Address) addr);
+                } else if (addr instanceof Inet6Address) {
+                    ip6Addresses.add((Inet6Address) addr);
+                }
+            }
+        }
+        return new NetworkConfiguration(ip4Interfaces, ip6Interfaces);
+    }
+
+    @Override
+    public String toString() {
+        return interfaces().map(NetworkConfiguration::interfaceInformation)
+                           .collect(Collectors.joining());
+    }
+
+    /** Returns detailed information for the given interface. */
+    public static String interfaceInformation(NetworkInterface nif) {
+        StringBuilder sb = new StringBuilder();
+        try {
+            sb.append("Display name: ")
+              .append(nif.getDisplayName())
+              .append("\n");
+            sb.append("Name: ")
+              .append(nif.getName())
+              .append("\n");
+            for (InetAddress inetAddress : list(nif.getInetAddresses())) {
+                sb.append("InetAddress: ")
+                  .append(inetAddress)
+                  .append("\n");
+            }
+            sb.append("Up? ")
+              .append(nif.isUp())
+              .append("\n");
+            sb.append("Loopback? ")
+              .append(nif.isLoopback())
+              .append("\n");
+            sb.append("PointToPoint? ")
+              .append(nif.isPointToPoint())
+              .append("\n");
+            sb.append("Supports multicast? ")
+              .append(nif.supportsMulticast())
+              .append("\n");
+            sb.append("Virtual? ")
+              .append(nif.isVirtual())
+              .append("\n");
+            sb.append("Hardware address: ")
+              .append(Arrays.toString(nif.getHardwareAddress()))
+              .append("\n");
+            sb.append("MTU: ")
+              .append(nif.getMTU())
+              .append("\n");
+            sb.append("Index: ")
+              .append(nif.getIndex())
+              .append("\n");
+            sb.append("\n");
+            return sb.toString();
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        }
+    }
+
+    /** Prints all the system interface information to the give stream. */
+    public static void printSystemConfiguration(PrintStream out) {
+        try {
+            out.println("*** all system network interface configuration ***");
+            for (NetworkInterface nif : list(getNetworkInterfaces())) {
+                out.print(interfaceInformation(nif));
+            }
+            out.println("*** end ***");
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/jdk/test/lib/classloader/FilterClassLoader.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, 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.
+ */
+
+package jdk.test.lib.classloader;
+
+import java.util.function.Predicate;
+/**
+ * A classloader, which using target classloader in case provided condition
+ * for class name is met, and using parent otherwise
+ */
+public class FilterClassLoader extends ClassLoader {
+
+    private final ClassLoader target;
+    private final Predicate<String> condition;
+
+    public FilterClassLoader(ClassLoader target, ClassLoader parent,
+            Predicate<String> condition) {
+        super(parent);
+        this.condition = condition;
+        this.target = target;
+    }
+
+    @Override
+    public Class<?> loadClass(String name) throws ClassNotFoundException {
+        if (condition.test(name)) {
+            return target.loadClass(name);
+        }
+        return super.loadClass(name);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/jdk/test/lib/classloader/ParentLastURLClassLoader.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2014, 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.
+ */
+
+package jdk.test.lib.classloader;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+
+/**
+ * An url classloader, which trying to load class from provided URL[] first,
+ * and using parent classloader in case it failed
+ */
+public class ParentLastURLClassLoader extends URLClassLoader {
+
+    public ParentLastURLClassLoader(URL urls[], ClassLoader parent) {
+        super(urls, parent);
+    }
+
+    @Override
+    public Class<?> loadClass(String name) throws ClassNotFoundException {
+        try {
+            Class<?> c = findClass(name);
+            if (c != null) {
+                return c;
+            }
+        } catch (ClassNotFoundException e) {
+            // ignore
+        }
+        return super.loadClass(name);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/jdk/test/lib/compiler/InMemoryJavaCompiler.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2013, 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.
+ */
+
+package jdk.test.lib.compiler;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.tools.ForwardingJavaFileManager;
+import javax.tools.FileObject;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaCompiler.CompilationTask;
+import javax.tools.JavaFileObject;
+import javax.tools.JavaFileObject.Kind;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.StandardLocation;
+import javax.tools.ToolProvider;
+
+/**
+ * {@code InMemoryJavaCompiler} can be used for compiling a {@link
+ * CharSequence} to a {@code byte[]}.
+ *
+ * The compiler will not use the file system at all, instead using a {@link
+ * ByteArrayOutputStream} for storing the byte code. For the source code, any
+ * kind of {@link CharSequence} can be used, e.g. {@link String}, {@link
+ * StringBuffer} or {@link StringBuilder}.
+ *
+ * The {@code InMemoryCompiler} can easily be used together with a {@code
+ * ByteClassLoader} to easily compile and load source code in a {@link String}:
+ *
+ * <pre>
+ * {@code
+ * import jdk.test.lib.compiler.InMemoryJavaCompiler;
+ * import jdk.test.lib.ByteClassLoader;
+ *
+ * class Example {
+ *     public static void main(String[] args) {
+ *         String className = "Foo";
+ *         String sourceCode = "public class " + className + " {" +
+ *                             "    public void bar() {" +
+ *                             "        System.out.println("Hello from bar!");" +
+ *                             "    }" +
+ *                             "}";
+ *         byte[] byteCode = InMemoryJavaCompiler.compile(className, sourceCode);
+ *         Class fooClass = ByteClassLoader.load(className, byteCode);
+ *     }
+ * }
+ * }
+ * </pre>
+ */
+public class InMemoryJavaCompiler {
+    private static class MemoryJavaFileObject extends SimpleJavaFileObject {
+        private final String className;
+        private final CharSequence sourceCode;
+        private final ByteArrayOutputStream byteCode;
+
+        public MemoryJavaFileObject(String className, CharSequence sourceCode) {
+            super(URI.create("string:///" + className.replace('.','/') + Kind.SOURCE.extension), Kind.SOURCE);
+            this.className = className;
+            this.sourceCode = sourceCode;
+            this.byteCode = new ByteArrayOutputStream();
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return sourceCode;
+        }
+
+        @Override
+        public OutputStream openOutputStream() throws IOException {
+            return byteCode;
+        }
+
+        public byte[] getByteCode() {
+            return byteCode.toByteArray();
+        }
+
+        public String getClassName() {
+            return className;
+        }
+    }
+
+    private static class FileManagerWrapper extends ForwardingJavaFileManager {
+        private static final Location PATCH_LOCATION = new Location() {
+            @Override
+            public String getName() {
+                return "patch module location";
+            }
+
+            @Override
+            public boolean isOutputLocation() {
+                return false;
+            }
+        };
+        private final MemoryJavaFileObject file;
+        private final String moduleOverride;
+
+        public FileManagerWrapper(MemoryJavaFileObject file, String moduleOverride) {
+            super(getCompiler().getStandardFileManager(null, null, null));
+            this.file = file;
+            this.moduleOverride = moduleOverride;
+        }
+
+        @Override
+        public JavaFileObject getJavaFileForOutput(Location location, String className,
+                                                   Kind kind, FileObject sibling)
+            throws IOException {
+            if (!file.getClassName().equals(className)) {
+                throw new IOException("Expected class with name " + file.getClassName() +
+                                      ", but got " + className);
+            }
+            return file;
+        }
+
+        @Override
+        public Location getLocationForModule(Location location, JavaFileObject fo) throws IOException {
+            if (fo == file && moduleOverride != null) {
+                return PATCH_LOCATION;
+            }
+            return super.getLocationForModule(location, fo);
+        }
+
+        @Override
+        public String inferModuleName(Location location) throws IOException {
+            if (location == PATCH_LOCATION) {
+                return moduleOverride;
+            }
+            return super.inferModuleName(location);
+        }
+
+        @Override
+        public boolean hasLocation(Location location) {
+            return super.hasLocation(location) || location == StandardLocation.PATCH_MODULE_PATH;
+        }
+
+    }
+
+    /**
+     * Compiles the class with the given name and source code.
+     *
+     * @param className The name of the class
+     * @param sourceCode The source code for the class with name {@code className}
+     * @param options additional command line options
+     * @throws RuntimeException if the compilation did not succeed
+     * @return The resulting byte code from the compilation
+     */
+    public static byte[] compile(String className, CharSequence sourceCode, String... options) {
+        MemoryJavaFileObject file = new MemoryJavaFileObject(className, sourceCode);
+        CompilationTask task = getCompilationTask(file, options);
+
+        if(!task.call()) {
+            throw new RuntimeException("Could not compile " + className + " with source code " + sourceCode);
+        }
+
+        return file.getByteCode();
+    }
+
+    private static JavaCompiler getCompiler() {
+        return ToolProvider.getSystemJavaCompiler();
+    }
+
+    private static CompilationTask getCompilationTask(MemoryJavaFileObject file, String... options) {
+        List<String> opts = new ArrayList<>();
+        String moduleOverride = null;
+        for (String opt : options) {
+            if (opt.startsWith("-Xmodule:")) {
+                moduleOverride = opt.substring("-Xmodule:".length());
+            } else {
+                opts.add(opt);
+            }
+        }
+        return getCompiler().getTask(null, new FileManagerWrapper(file, moduleOverride), null, opts, null, Arrays.asList(file));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/jdk/test/lib/compiler/ModuleInfoMaker.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,129 @@
+/*
+ * 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.
+ */
+
+package jdk.test.lib.compiler;
+
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Arrays;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Stream;
+
+/**
+ * Utility class for creating test modules.
+ */
+public class ModuleInfoMaker {
+    private static final String MODULE_INFO_JAVA = "module-info.java";
+    private static final Pattern MODULE_PATTERN =
+        Pattern.compile("module\\s+((?:\\w+\\.)*)");
+    private static final Pattern PACKAGE_PATTERN =
+                       Pattern.compile("package\\s+(((?:\\w+\\.)*)(?:\\w+))");
+    private static final Pattern CLASS_PATTERN =
+          Pattern.compile("(?:public\\s+)?(?:class|enum|interface)\\s+(\\w+)");
+
+    private final Path dir;
+
+    public ModuleInfoMaker(Path dir) {
+        this.dir = dir;
+    }
+
+    /**
+     * Create java source files of the given module
+     */
+    public void writeJavaFiles(String module, String moduleInfoJava, String... contents)
+        throws IOException
+    {
+        Path msrc = dir.resolve(module);
+        new JavaSource(moduleInfoJava).write(msrc);
+        for (String c : contents) {
+            new JavaSource(c).write(msrc);
+        }
+    }
+
+    /**
+     * Compile the module to the given destination.
+     */
+    public void compile(String module, Path dest, String... options)
+        throws IOException
+    {
+        Path msrc = dir.resolve(module);
+        String[] args =
+            Stream.concat(Arrays.stream(options),
+                          Stream.of("--module-source-path",
+                                    dir.toString())).toArray(String[]::new);
+        if (!CompilerUtils.compile(msrc, dest, args)) {
+            throw new Error("Fail to compile " + module);
+        }
+    }
+
+    static class JavaSource {
+        final String source;
+        JavaSource(String source) {
+            this.source = source;
+        }
+
+        /**
+         * Writes the source code to a file in a specified directory.
+         * @param dir the directory
+         * @throws IOException if there is a problem writing the file
+         */
+        public void write(Path dir) throws IOException {
+            Path file = dir.resolve(getJavaFileNameFromSource(source));
+            Files.createDirectories(file.getParent());
+            try (BufferedWriter out = Files.newBufferedWriter(file)) {
+                out.write(source.replace("\n", System.lineSeparator()));
+            }
+        }
+
+        /**
+         * Extracts the Java file name from the class declaration.
+         * This method is intended for simple files and uses regular expressions,
+         * so comments matching the pattern can make the method fail.
+         */
+        static String getJavaFileNameFromSource(String source) {
+            String packageName = null;
+
+            Matcher matcher = MODULE_PATTERN.matcher(source);
+            if (matcher.find())
+                return MODULE_INFO_JAVA;
+
+            matcher = PACKAGE_PATTERN.matcher(source);
+            if (matcher.find())
+                packageName = matcher.group(1).replace(".", "/");
+
+            matcher = CLASS_PATTERN.matcher(source);
+            if (matcher.find()) {
+                String className = matcher.group(1) + ".java";
+                return (packageName == null) ? className : packageName + "/" + className;
+            } else if (packageName != null) {
+                return packageName + "/package-info.java";
+            } else {
+                throw new Error("Could not extract the java class " +
+                    "name from the provided source");
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/jdk/test/lib/management/DynamicVMOption.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.test.lib.management;
+
+import com.sun.management.HotSpotDiagnosticMXBean;
+import java.lang.management.ManagementFactory;
+
+/**
+ * A utility class to work with VM options which could be altered during
+ * execution.
+ *
+ * This class is a wrapper around {@code com.sun.management.VMOption}.
+ * It provides more convenient interface to read/write the values.
+ *
+ */
+public class DynamicVMOption {
+
+    private final HotSpotDiagnosticMXBean mxBean;
+
+    /**
+     * VM option name, like "MinHeapFreeRatio".
+     */
+    public final String name;
+
+    /**
+     * Creates an instance of DynamicVMOption.
+     *
+     * @param name the VM option name
+     */
+    public DynamicVMOption(String name) {
+        this.name = name;
+        mxBean = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
+    }
+
+    /**
+     * Sets a new value for the option.
+     * Trying to set not applicable value will cause IllegalArgumentException.
+     * Behavior with null is undefined, most likely NPE will be thrown.
+     *
+     * @param newValue the value to be set
+     * @see #getValue()
+     * @throws IllegalArgumentException if newValue is not applicable to the option
+     */
+    public final void setValue(String newValue) {
+        mxBean.setVMOption(name, newValue);
+    }
+
+    /**
+     * Returns the value of option.
+     *
+     * @return the current option value
+     * @see #setValue(java.lang.String)
+     */
+    public final String getValue() {
+        return mxBean.getVMOption(name).getValue();
+    }
+
+    /**
+     * Returns true, if option is writable, false otherwise.
+     *
+     * @return true, if option is writable, false otherwise
+     */
+    public final boolean isWriteable() {
+        return mxBean.getVMOption(name).isWriteable();
+    }
+
+    /**
+     * Checks if the given value is applicable for the option.
+     *
+     * This method tries to set the option to the new value. If no exception
+     * has been thrown the value is treated as valid.
+     *
+     * Calling this method will not change the option value. After an attempt
+     * to set a new value, the option will be restored to its previous value.
+     *
+     * @param value the value to verify
+     * @return true if option could be set to the given value
+     */
+    public boolean isValidValue(String value) {
+        boolean isValid = true;
+        String oldValue = getValue();
+        try {
+            setValue(value);
+        } catch (NullPointerException e) {
+            if (value == null) {
+                isValid = false;
+            }
+        } catch (IllegalArgumentException e) {
+            isValid = false;
+        } finally {
+            setValue(oldValue);
+        }
+        return isValid;
+    }
+
+    /**
+     * Returns the value of the given VM option as String.
+     *
+     * This is a simple shortcut for {@code new DynamicVMOption(name).getValue()}
+     *
+     * @param name the name of VM option
+     * @return value as a string
+     * @see #getValue()
+     */
+    public static String getString(String name) {
+        return new DynamicVMOption(name).getValue();
+    }
+
+    /**
+     * Returns the value of the given option as int.
+     *
+     * @param name the name of VM option
+     * @return value parsed as integer
+     * @see #getString(java.lang.String)
+     *
+     */
+    public static int getInt(String name) {
+        return Integer.parseInt(getString(name));
+    }
+
+    /**
+     * Sets the VM option to a new value.
+     *
+     * This is a simple shortcut for {@code new DynamicVMOption(name).setValue(value)}
+     *
+     * @param name the name of VM option
+     * @param value the value to be set
+     * @see #setValue(java.lang.String)
+     */
+    public static void setString(String name, String value) {
+        new DynamicVMOption(name).setValue(value);
+    }
+
+    /**
+     * Sets the VM option value to a new integer value.
+     *
+     * @param name the name of VM option
+     * @param value the integer value to be set
+     * @see #setString(java.lang.String, java.lang.String)
+     */
+    public static void setInt(String name, int value) {
+        new DynamicVMOption(name).setValue(Integer.toString(value));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/jdk/test/lib/management/ThreadMXBeanTool.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+package jdk.test.lib.management;
+
+import java.lang.management.ManagementFactory;
+import java.lang.management.ThreadInfo;
+import java.lang.management.ThreadMXBean;
+
+/**
+ * A few utility methods to use ThreadMXBean.
+ */
+public final class ThreadMXBeanTool {
+
+    /**
+     * Waits until {@link Thread} is in the certain {@link Thread.State}
+     * and blocking on {@code object}.
+     *
+     * @param state The thread state
+     * @param object The object to block on
+     */
+    public static void waitUntilBlockingOnObject(Thread thread, Thread.State state, Object object)
+        throws InterruptedException {
+        String want = object == null ? null : object.getClass().getName() + '@'
+                + Integer.toHexString(System.identityHashCode(object));
+        ThreadMXBean tmx = ManagementFactory.getThreadMXBean();
+        while (thread.isAlive()) {
+            ThreadInfo ti = tmx.getThreadInfo(thread.getId());
+            if (ti.getThreadState() == state
+                    && (want == null || want.equals(ti.getLockName()))) {
+                return;
+            }
+            Thread.sleep(1);
+        }
+    }
+
+    /**
+     * Waits until {@link Thread} is in native.
+     */
+    public static void waitUntilInNative(Thread thread) throws InterruptedException {
+        ThreadMXBean tmx = ManagementFactory.getThreadMXBean();
+        while (thread.isAlive()) {
+            ThreadInfo ti = tmx.getThreadInfo(thread.getId());
+            if (ti.isInNative()) {
+                return;
+            }
+            Thread.sleep(1);
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/jdk/test/lib/util/SerializationUtils.java	Thu May 25 22:33:25 2017 +0000
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ *
+ * 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.test.lib.util;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+/**
+ * Common library for various test serialization utility functions.
+ */
+public final class SerializationUtils {
+    /**
+     * Serialize an object into byte array.
+     */
+    public static byte[] serialize(Object obj) throws IOException {
+        ByteArrayOutputStream bs = new ByteArrayOutputStream();
+        try (ObjectOutputStream out = new ObjectOutputStream(bs)) {
+            out.writeObject(obj);
+        }
+        return bs.toByteArray();
+    }
+
+    /**
+     * Deserialize an object from byte array.
+     */
+    public static Object deserialize(byte[] ba) throws IOException, ClassNotFoundException {
+        try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(ba))) {
+            return in.readObject();
+        }
+    }
+    private SerializationUtils() {}
+}