Merge
authorprr
Tue, 30 Jan 2018 09:03:47 -0800
changeset 48729 2d03ebb72df2
parent 48728 fb62f481671e (current diff)
parent 48683 b2f2bdba0472 (diff)
child 48730 2f4fe7776a53
Merge
make/devkit/createWindowsDevkit.sh
test/jdk/ProblemList.txt
test/jdk/sun/security/krb5/auto/principalProperty/TestHosts
--- a/bin/idea.sh	Tue Jan 30 11:53:00 2018 +0530
+++ b/bin/idea.sh	Tue Jan 30 09:03:47 2018 -0800
@@ -30,9 +30,10 @@
 }
 
 SCRIPT_DIR=`dirname $0`
-PWD=`pwd`
+#assume TOP is the dir from which the script has been called
+TOP=`pwd`
 cd $SCRIPT_DIR; SCRIPT_DIR=`pwd`
-cd ../; TOP=`pwd`; cd $PWD
+cd $TOP;
 
 IDEA_OUTPUT=$TOP/.idea
 VERBOSE="false"
@@ -66,30 +67,42 @@
 mkdir $IDEA_OUTPUT || exit 1
 cd $IDEA_OUTPUT; IDEA_OUTPUT=`pwd`
 
-IDEA_MAKE="$TOP/make/idea"
+MAKE_DIR="$SCRIPT_DIR/../make"
+IDEA_MAKE="$MAKE_DIR/idea"
 IDEA_TEMPLATE="$IDEA_MAKE/template"
-IML_TEMPLATE="$IDEA_TEMPLATE/jdk.iml"
-ANT_TEMPLATE="$IDEA_TEMPLATE/ant.xml"
-MISC_TEMPLATE="$IDEA_TEMPLATE/misc.xml"
-IDEA_IML="$IDEA_OUTPUT/jdk.iml"
-IDEA_ANT="$IDEA_OUTPUT/ant.xml"
-IDEA_MISC="$IDEA_OUTPUT/misc.xml"
+
+cp -r "$IDEA_TEMPLATE"/* "$IDEA_OUTPUT"
+
+#init template variables
+for file in `ls -p $IDEA_TEMPLATE | grep -v /`; do
+	VAR_SUFFIX=`echo $file | cut -d'.' -f1 | tr [:lower:] [:upper:]`
+    eval "$VAR_SUFFIX"_TEMPLATE="$IDEA_TEMPLATE"/$file
+	eval IDEA_"$VAR_SUFFIX"="$IDEA_OUTPUT"/$file
+done
+
+#override template variables
+if [ -d "$TEMPLATES_OVERRIDE" ] ; then
+    for file in `ls -p "$TEMPLATES_OVERRIDE" | grep -v /`; do
+        cp "$TEMPLATES_OVERRIDE"/$file "$IDEA_OUTPUT"/
+    	VAR_SUFFIX=`echo $file | cut -d'.' -f1 | tr [:lower:] [:upper:]`
+        eval "$VAR_SUFFIX"_TEMPLATE="$TEMPLATES_OVERRIDE"/$file
+    done
+fi
 
 if [ "$VERBOSE" = "true" ] ; then
   echo "output dir: $IDEA_OUTPUT"
   echo "idea template dir: $IDEA_TEMPLATE"
 fi
 
-if [ ! -f "$IML_TEMPLATE" ] ; then
-  echo "FATAL: cannot find $IML_TEMPLATE" >&2; exit 1
+if [ ! -f "$JDK_TEMPLATE" ] ; then
+  echo "FATAL: cannot find $JDK_TEMPLATE" >&2; exit 1
 fi
 
 if [ ! -f "$ANT_TEMPLATE" ] ; then
   echo "FATAL: cannot find $ANT_TEMPLATE" >&2; exit 1
 fi
 
-cp -r "$IDEA_TEMPLATE"/* "$IDEA_OUTPUT"
-cd $TOP ; make -f "$IDEA_MAKE/idea.gmk" -I make/common idea MAKEOVERRIDES= OUT=$IDEA_OUTPUT/env.cfg MODULES="$*" || exit 1
+cd $TOP ; make -f "$IDEA_MAKE/idea.gmk" -I $MAKE_DIR/.. idea MAKEOVERRIDES= OUT=$IDEA_OUTPUT/env.cfg MODULES="$*" || exit 1
 cd $SCRIPT_DIR
 
 . $IDEA_OUTPUT/env.cfg
@@ -118,11 +131,12 @@
   root=$@
   relativePath="`echo "$root" | sed -e s@"$TOP/\(.*$\)"@"\1"@`"
   folder="`echo "$SOURCE_FOLDER" | sed -e s@"\(.*/\)####\(.*\)"@"\1$relativePath\2"@`"
-  printf "%s\n" "$folder" >> $IDEA_IML
+  printf "%s\n" "$folder" >> $IDEA_JDK
 }
 
 ### Generate project iml
-rm -f $IDEA_IML
+
+rm -f $IDEA_JDK
 while IFS= read -r line
 do
   if echo "$line" | egrep "^ .* <sourceFolder.*####" > /dev/null ; then
@@ -133,9 +147,9 @@
       done
     fi
   else
-    printf "%s\n" "$line" >> $IDEA_IML
+    printf "%s\n" "$line" >> $IDEA_JDK
   fi
-done < "$IML_TEMPLATE"
+done < "$JDK_TEMPLATE"
 
 
 MODULE_NAME="        <property name=\"module.name\" value=\"####\" />"
--- a/make/autoconf/basics.m4	Tue Jan 30 11:53:00 2018 +0530
+++ b/make/autoconf/basics.m4	Tue Jan 30 09:03:47 2018 -0800
@@ -586,69 +586,71 @@
 AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
 [
   AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit],
-      [use this devkit for compilers, tools and resources])],
-      [
-        BASIC_FIXUP_PATH([with_devkit])
-        DEVKIT_ROOT="$with_devkit"
-        # Check for a meta data info file in the root of the devkit
-        if test -f "$DEVKIT_ROOT/devkit.info"; then
-          . $DEVKIT_ROOT/devkit.info
-          # This potentially sets the following:
-          # A descriptive name of the devkit
-          BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_NAME])
-          # Corresponds to --with-extra-path
-          BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_EXTRA_PATH])
-          # Corresponds to --with-toolchain-path
-          BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_TOOLCHAIN_PATH])
-          # Corresponds to --with-sysroot
-          BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_SYSROOT])
+      [use this devkit for compilers, tools and resources])])
 
-          # Identifies the Visual Studio version in the devkit
-          BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_VERSION])
-          # The Visual Studio include environment variable
-          BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_INCLUDE])
-          # The Visual Studio lib environment variable
-          BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_LIB])
-          # Corresponds to --with-msvcr-dll
-          BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_MSVCR_DLL])
-          # Corresponds to --with-msvcp-dll
-          BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_MSVCP_DLL])
-        fi
+  if test "x$with_devkit" = xyes; then
+    AC_MSG_ERROR([--with-devkit must have a value])
+  elif test "x$with_devkit" != x && test "x$with_devkit" != xno; then
+    BASIC_FIXUP_PATH([with_devkit])
+    DEVKIT_ROOT="$with_devkit"
+    # Check for a meta data info file in the root of the devkit
+    if test -f "$DEVKIT_ROOT/devkit.info"; then
+      . $DEVKIT_ROOT/devkit.info
+      # This potentially sets the following:
+      # A descriptive name of the devkit
+      BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_NAME])
+      # Corresponds to --with-extra-path
+      BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_EXTRA_PATH])
+      # Corresponds to --with-toolchain-path
+      BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_TOOLCHAIN_PATH])
+      # Corresponds to --with-sysroot
+      BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_SYSROOT])
+
+      # Identifies the Visual Studio version in the devkit
+      BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_VERSION])
+      # The Visual Studio include environment variable
+      BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_INCLUDE])
+      # The Visual Studio lib environment variable
+      BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_LIB])
+      # Corresponds to --with-msvcr-dll
+      BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_MSVCR_DLL])
+      # Corresponds to --with-msvcp-dll
+      BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_MSVCP_DLL])
+    fi
 
-        AC_MSG_CHECKING([for devkit])
-        if test "x$DEVKIT_NAME" != x; then
-          AC_MSG_RESULT([$DEVKIT_NAME in $DEVKIT_ROOT])
-        else
-          AC_MSG_RESULT([$DEVKIT_ROOT])
-        fi
+    AC_MSG_CHECKING([for devkit])
+    if test "x$DEVKIT_NAME" != x; then
+      AC_MSG_RESULT([$DEVKIT_NAME in $DEVKIT_ROOT])
+    else
+      AC_MSG_RESULT([$DEVKIT_ROOT])
+    fi
 
-        BASIC_PREPEND_TO_PATH([EXTRA_PATH],$DEVKIT_EXTRA_PATH)
+    BASIC_PREPEND_TO_PATH([EXTRA_PATH],$DEVKIT_EXTRA_PATH)
 
-        # Fallback default of just /bin if DEVKIT_PATH is not defined
-        if test "x$DEVKIT_TOOLCHAIN_PATH" = x; then
-          DEVKIT_TOOLCHAIN_PATH="$DEVKIT_ROOT/bin"
-        fi
-        BASIC_PREPEND_TO_PATH([TOOLCHAIN_PATH],$DEVKIT_TOOLCHAIN_PATH)
+    # Fallback default of just /bin if DEVKIT_PATH is not defined
+    if test "x$DEVKIT_TOOLCHAIN_PATH" = x; then
+      DEVKIT_TOOLCHAIN_PATH="$DEVKIT_ROOT/bin"
+    fi
+    BASIC_PREPEND_TO_PATH([TOOLCHAIN_PATH],$DEVKIT_TOOLCHAIN_PATH)
 
-        # If DEVKIT_SYSROOT is set, use that, otherwise try a couple of known
-        # places for backwards compatiblity.
-        if test "x$DEVKIT_SYSROOT" != x; then
-          SYSROOT="$DEVKIT_SYSROOT"
-        elif test -d "$DEVKIT_ROOT/$host_alias/libc"; then
-          SYSROOT="$DEVKIT_ROOT/$host_alias/libc"
-        elif test -d "$DEVKIT_ROOT/$host/sys-root"; then
-          SYSROOT="$DEVKIT_ROOT/$host/sys-root"
-        fi
+    # If DEVKIT_SYSROOT is set, use that, otherwise try a couple of known
+    # places for backwards compatiblity.
+    if test "x$DEVKIT_SYSROOT" != x; then
+      SYSROOT="$DEVKIT_SYSROOT"
+    elif test -d "$DEVKIT_ROOT/$host_alias/libc"; then
+      SYSROOT="$DEVKIT_ROOT/$host_alias/libc"
+    elif test -d "$DEVKIT_ROOT/$host/sys-root"; then
+      SYSROOT="$DEVKIT_ROOT/$host/sys-root"
+    fi
 
-        if test "x$DEVKIT_ROOT" != x; then
-          DEVKIT_LIB_DIR="$DEVKIT_ROOT/lib"
-          if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
-            DEVKIT_LIB_DIR="$DEVKIT_ROOT/lib64"
-          fi
-          AC_SUBST(DEVKIT_LIB_DIR)
-        fi
-      ]
-  )
+    if test "x$DEVKIT_ROOT" != x; then
+      DEVKIT_LIB_DIR="$DEVKIT_ROOT/lib"
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
+        DEVKIT_LIB_DIR="$DEVKIT_ROOT/lib64"
+      fi
+      AC_SUBST(DEVKIT_LIB_DIR)
+    fi
+  fi
 
   # You can force the sysroot if the sysroot encoded into the compiler tools
   # is not correct.
@@ -1185,9 +1187,6 @@
 
 AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES],
 [
-  # Did user specify any unknown variables?
-  BASIC_CHECK_LEFTOVER_OVERRIDDEN
-
   AC_MSG_CHECKING([if build directory is on local disk])
   BASIC_CHECK_DIR_ON_LOCAL_DISK($OUTPUTDIR,
       [OUTPUT_DIR_IS_LOCAL="yes"],
--- a/make/autoconf/configure.ac	Tue Jan 30 11:53:00 2018 +0530
+++ b/make/autoconf/configure.ac	Tue Jan 30 09:03:47 2018 -0800
@@ -280,6 +280,9 @@
 # This needs to be done after CUSTOM_LATE_HOOK since we can setup custom features.
 HOTSPOT_VALIDATE_JVM_FEATURES
 
+# Did user specify any unknown variables?
+BASIC_CHECK_LEFTOVER_OVERRIDDEN
+
 # We're messing a bit with internal autoconf variables to put the config.status
 # in the output directory instead of the current directory.
 CONFIG_STATUS="$CONFIGURESUPPORT_OUTPUTDIR/config.status"
--- a/make/autoconf/generated-configure.sh	Tue Jan 30 11:53:00 2018 +0530
+++ b/make/autoconf/generated-configure.sh	Tue Jan 30 09:03:47 2018 -0800
@@ -5117,7 +5117,7 @@
 
 ################################################################################
 # The order of these defines the priority by which we try to find them.
-VALID_VS_VERSIONS="2013 2012 2010"
+VALID_VS_VERSIONS="2013 2012 2010 2015 2017"
 
 VS_DESCRIPTION_2010="Microsoft Visual Studio 2010"
 VS_VERSION_INTERNAL_2010=100
@@ -5150,6 +5150,30 @@
 VS_VS_PLATFORM_NAME_2013="v120"
 VS_SDK_PLATFORM_NAME_2013=
 
+VS_DESCRIPTION_2015="Microsoft Visual Studio 2015 - CURRENTLY NOT WORKING"
+VS_VERSION_INTERNAL_2015=140
+VS_MSVCR_2015=vcruntime140.dll
+VS_MSVCP_2015=msvcp140.dll
+VS_ENVVAR_2015="VS140COMNTOOLS"
+VS_VS_INSTALLDIR_2015="Microsoft Visual Studio 14.0"
+VS_SDK_INSTALLDIR_2015=
+VS_VS_PLATFORM_NAME_2015="v140"
+VS_SDK_PLATFORM_NAME_2015=
+# The vcvars of 2015 breaks if 2017 is also installed. Work around this by
+# explicitly specifying Windows Kit 8.1 to be used.
+VS_ENV_ARGS_2015="8.1"
+
+VS_DESCRIPTION_2017="Microsoft Visual Studio 2017 - CURRENTLY NOT WORKING"
+VS_VERSION_INTERNAL_2017=141
+VS_MSVCR_2017=vcruntime140.dll
+VS_MSVCP_2017=msvcp140.dll
+VS_ENVVAR_2017="VS150COMNTOOLS"
+VS_VS_INSTALLDIR_2017="Microsoft Visual Studio/2017"
+VS_EDITIONS_2017="Community Professional Enterprise"
+VS_SDK_INSTALLDIR_2017=
+VS_VS_PLATFORM_NAME_2017="v141"
+VS_SDK_PLATFORM_NAME_2017=
+
 ################################################################################
 
 
@@ -5191,7 +5215,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1516225089
+DATE_WHEN_GENERATED=1517274450
 
 ###############################################################################
 #
@@ -17113,6 +17137,12 @@
 # Check whether --with-devkit was given.
 if test "${with_devkit+set}" = set; then :
   withval=$with_devkit;
+fi
+
+
+  if test "x$with_devkit" = xyes; then
+    as_fn_error $? "--with-devkit must have a value" "$LINENO" 5
+  elif test "x$with_devkit" != x && test "x$with_devkit" != xno; then
 
   # Only process if variable expands to non-empty
 
@@ -17245,77 +17275,77 @@
     fi
   fi
 
-        DEVKIT_ROOT="$with_devkit"
-        # Check for a meta data info file in the root of the devkit
-        if test -f "$DEVKIT_ROOT/devkit.info"; then
-          . $DEVKIT_ROOT/devkit.info
-          # This potentially sets the following:
-          # A descriptive name of the devkit
+    DEVKIT_ROOT="$with_devkit"
+    # Check for a meta data info file in the root of the devkit
+    if test -f "$DEVKIT_ROOT/devkit.info"; then
+      . $DEVKIT_ROOT/devkit.info
+      # This potentially sets the following:
+      # A descriptive name of the devkit
 
   if test "x$DEVKIT_NAME" = x; then
     eval DEVKIT_NAME="\${DEVKIT_NAME_${OPENJDK_TARGET_CPU}}"
   fi
 
-          # Corresponds to --with-extra-path
+      # Corresponds to --with-extra-path
 
   if test "x$DEVKIT_EXTRA_PATH" = x; then
     eval DEVKIT_EXTRA_PATH="\${DEVKIT_EXTRA_PATH_${OPENJDK_TARGET_CPU}}"
   fi
 
-          # Corresponds to --with-toolchain-path
+      # Corresponds to --with-toolchain-path
 
   if test "x$DEVKIT_TOOLCHAIN_PATH" = x; then
     eval DEVKIT_TOOLCHAIN_PATH="\${DEVKIT_TOOLCHAIN_PATH_${OPENJDK_TARGET_CPU}}"
   fi
 
-          # Corresponds to --with-sysroot
+      # Corresponds to --with-sysroot
 
   if test "x$DEVKIT_SYSROOT" = x; then
     eval DEVKIT_SYSROOT="\${DEVKIT_SYSROOT_${OPENJDK_TARGET_CPU}}"
   fi
 
 
-          # Identifies the Visual Studio version in the devkit
+      # Identifies the Visual Studio version in the devkit
 
   if test "x$DEVKIT_VS_VERSION" = x; then
     eval DEVKIT_VS_VERSION="\${DEVKIT_VS_VERSION_${OPENJDK_TARGET_CPU}}"
   fi
 
-          # The Visual Studio include environment variable
+      # The Visual Studio include environment variable
 
   if test "x$DEVKIT_VS_INCLUDE" = x; then
     eval DEVKIT_VS_INCLUDE="\${DEVKIT_VS_INCLUDE_${OPENJDK_TARGET_CPU}}"
   fi
 
-          # The Visual Studio lib environment variable
+      # The Visual Studio lib environment variable
 
   if test "x$DEVKIT_VS_LIB" = x; then
     eval DEVKIT_VS_LIB="\${DEVKIT_VS_LIB_${OPENJDK_TARGET_CPU}}"
   fi
 
-          # Corresponds to --with-msvcr-dll
+      # Corresponds to --with-msvcr-dll
 
   if test "x$DEVKIT_MSVCR_DLL" = x; then
     eval DEVKIT_MSVCR_DLL="\${DEVKIT_MSVCR_DLL_${OPENJDK_TARGET_CPU}}"
   fi
 
-          # Corresponds to --with-msvcp-dll
+      # Corresponds to --with-msvcp-dll
 
   if test "x$DEVKIT_MSVCP_DLL" = x; then
     eval DEVKIT_MSVCP_DLL="\${DEVKIT_MSVCP_DLL_${OPENJDK_TARGET_CPU}}"
   fi
 
-        fi
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for devkit" >&5
+    fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for devkit" >&5
 $as_echo_n "checking for devkit... " >&6; }
-        if test "x$DEVKIT_NAME" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEVKIT_NAME in $DEVKIT_ROOT" >&5
+    if test "x$DEVKIT_NAME" != x; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEVKIT_NAME in $DEVKIT_ROOT" >&5
 $as_echo "$DEVKIT_NAME in $DEVKIT_ROOT" >&6; }
-        else
-          { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEVKIT_ROOT" >&5
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEVKIT_ROOT" >&5
 $as_echo "$DEVKIT_ROOT" >&6; }
-        fi
+    fi
 
 
   if test "x$DEVKIT_EXTRA_PATH" != x; then
@@ -17327,10 +17357,10 @@
   fi
 
 
-        # Fallback default of just /bin if DEVKIT_PATH is not defined
-        if test "x$DEVKIT_TOOLCHAIN_PATH" = x; then
-          DEVKIT_TOOLCHAIN_PATH="$DEVKIT_ROOT/bin"
-        fi
+    # Fallback default of just /bin if DEVKIT_PATH is not defined
+    if test "x$DEVKIT_TOOLCHAIN_PATH" = x; then
+      DEVKIT_TOOLCHAIN_PATH="$DEVKIT_ROOT/bin"
+    fi
 
   if test "x$DEVKIT_TOOLCHAIN_PATH" != x; then
     if test "x$TOOLCHAIN_PATH" = x; then
@@ -17341,27 +17371,24 @@
   fi
 
 
-        # If DEVKIT_SYSROOT is set, use that, otherwise try a couple of known
-        # places for backwards compatiblity.
-        if test "x$DEVKIT_SYSROOT" != x; then
-          SYSROOT="$DEVKIT_SYSROOT"
-        elif test -d "$DEVKIT_ROOT/$host_alias/libc"; then
-          SYSROOT="$DEVKIT_ROOT/$host_alias/libc"
-        elif test -d "$DEVKIT_ROOT/$host/sys-root"; then
-          SYSROOT="$DEVKIT_ROOT/$host/sys-root"
-        fi
-
-        if test "x$DEVKIT_ROOT" != x; then
-          DEVKIT_LIB_DIR="$DEVKIT_ROOT/lib"
-          if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
-            DEVKIT_LIB_DIR="$DEVKIT_ROOT/lib64"
-          fi
-
-        fi
-
-
-fi
-
+    # If DEVKIT_SYSROOT is set, use that, otherwise try a couple of known
+    # places for backwards compatiblity.
+    if test "x$DEVKIT_SYSROOT" != x; then
+      SYSROOT="$DEVKIT_SYSROOT"
+    elif test -d "$DEVKIT_ROOT/$host_alias/libc"; then
+      SYSROOT="$DEVKIT_ROOT/$host_alias/libc"
+    elif test -d "$DEVKIT_ROOT/$host/sys-root"; then
+      SYSROOT="$DEVKIT_ROOT/$host/sys-root"
+    fi
+
+    if test "x$DEVKIT_ROOT" != x; then
+      DEVKIT_LIB_DIR="$DEVKIT_ROOT/lib"
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
+        DEVKIT_LIB_DIR="$DEVKIT_ROOT/lib64"
+      fi
+
+    fi
+  fi
 
   # You can force the sysroot if the sysroot encoded into the compiler tools
   # is not correct.
@@ -32299,7 +32326,11 @@
   elif test "x$DEVKIT_VS_VERSION" != x; then
     VS_VERSION=$DEVKIT_VS_VERSION
     TOOLCHAIN_VERSION=$VS_VERSION
-    eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}"
+    # If the devkit has a name, use that as description
+    VS_DESCRIPTION="$DEVKIT_NAME"
+    if test "x$VS_DESCRIPTION" = x; then
+      eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}"
+    fi
     eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}"
     eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}"
     eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}"
@@ -32367,7 +32398,9 @@
   eval VS_COMNTOOLS_VAR="\${VS_ENVVAR_${VS_VERSION}}"
   eval VS_COMNTOOLS="\$${VS_COMNTOOLS_VAR}"
   eval VS_INSTALL_DIR="\${VS_VS_INSTALLDIR_${VS_VERSION}}"
+  eval VS_EDITIONS="\${VS_EDITIONS_${VS_VERSION}}"
   eval SDK_INSTALL_DIR="\${VS_SDK_INSTALLDIR_${VS_VERSION}}"
+  eval VS_ENV_ARGS="\${VS_ENV_ARGS_${VS_VERSION}}"
 
   # When using --with-tools-dir, assume it points to the correct and default
   # version of Visual Studio or that --with-toolchain-version was also set.
@@ -32378,12 +32411,6 @@
     VS_BASE="$with_tools_dir/../.."
     METHOD="--with-tools-dir"
 
-    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
-      VCVARSFILE="vc/bin/vcvars32.bat"
-    else
-      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
-    fi
-
 
   windows_path="$VS_BASE"
   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -32394,19 +32421,42 @@
     VS_BASE="$unix_path"
   fi
 
+    # In VS 2017, the default installation is in a subdir named after the edition.
+    # Find the first one present and use that.
+    if test "x$VS_EDITIONS" != x; then
+      for edition in $VS_EDITIONS; do
+        if test -d "$VS_BASE/$edition"; then
+          VS_BASE="$VS_BASE/$edition"
+          break
+        fi
+      done
+    fi
+
     if test -d "$VS_BASE"; then
-      if test -f "$VS_BASE/$VCVARSFILE"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
-        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
-        # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
-        # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        VCVARSFILES="vc/bin/vcvars32.bat vc/auxiliary/build/vcvars32.bat"
+      else
+        VCVARSFILES="vc/bin/amd64/vcvars64.bat vc/bin/x86_amd64/vcvarsx86_amd64.bat \
+            vc/auxiliary/build/vcvarsx86_amd64.bat vc/auxiliary/build/vcvars64.bat"
+      fi
+
+      for VCVARSFILE in $VCVARSFILES; do
+        if test -f "$VS_BASE/$VCVARSFILE"; then
+          VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
+          break
+        fi
+      done
+
+      if test "x$VS_ENV_CMD" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: None of $VCVARSFILES were found, Visual Studio installation not recognized. Ignoring" >&5
+$as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio installation not recognized. Ignoring" >&6;}
+      else
+        # PLATFORM_TOOLSET is used during the compilation of the freetype sources
+        # (see 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100',
+        # 'v110' or 'v120' for VS 2010, 2012 or VS2013
         eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
-$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
       fi
     fi
   fi
@@ -32417,12 +32467,6 @@
     VS_BASE="$with_tools_dir/../../.."
     METHOD="--with-tools-dir"
 
-    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
-      VCVARSFILE="vc/bin/vcvars32.bat"
-    else
-      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
-    fi
-
 
   windows_path="$VS_BASE"
   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -32433,19 +32477,42 @@
     VS_BASE="$unix_path"
   fi
 
+    # In VS 2017, the default installation is in a subdir named after the edition.
+    # Find the first one present and use that.
+    if test "x$VS_EDITIONS" != x; then
+      for edition in $VS_EDITIONS; do
+        if test -d "$VS_BASE/$edition"; then
+          VS_BASE="$VS_BASE/$edition"
+          break
+        fi
+      done
+    fi
+
     if test -d "$VS_BASE"; then
-      if test -f "$VS_BASE/$VCVARSFILE"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
-        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
-        # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
-        # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        VCVARSFILES="vc/bin/vcvars32.bat vc/auxiliary/build/vcvars32.bat"
+      else
+        VCVARSFILES="vc/bin/amd64/vcvars64.bat vc/bin/x86_amd64/vcvarsx86_amd64.bat \
+            vc/auxiliary/build/vcvarsx86_amd64.bat vc/auxiliary/build/vcvars64.bat"
+      fi
+
+      for VCVARSFILE in $VCVARSFILES; do
+        if test -f "$VS_BASE/$VCVARSFILE"; then
+          VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
+          break
+        fi
+      done
+
+      if test "x$VS_ENV_CMD" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: None of $VCVARSFILES were found, Visual Studio installation not recognized. Ignoring" >&5
+$as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio installation not recognized. Ignoring" >&6;}
+      else
+        # PLATFORM_TOOLSET is used during the compilation of the freetype sources
+        # (see 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100',
+        # 'v110' or 'v120' for VS 2010, 2012 or VS2013
         eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
-$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
       fi
     fi
   fi
@@ -32464,7 +32531,6 @@
   fi
 
   VS_ENV_CMD=""
-  VS_ENV_ARGS=""
 
   if test "x$VS_COMNTOOLS" != x; then
 
@@ -32473,12 +32539,6 @@
     VS_BASE="$VS_COMNTOOLS/../.."
     METHOD="$VS_COMNTOOLS_VAR variable"
 
-    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
-      VCVARSFILE="vc/bin/vcvars32.bat"
-    else
-      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
-    fi
-
 
   windows_path="$VS_BASE"
   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -32489,19 +32549,42 @@
     VS_BASE="$unix_path"
   fi
 
+    # In VS 2017, the default installation is in a subdir named after the edition.
+    # Find the first one present and use that.
+    if test "x$VS_EDITIONS" != x; then
+      for edition in $VS_EDITIONS; do
+        if test -d "$VS_BASE/$edition"; then
+          VS_BASE="$VS_BASE/$edition"
+          break
+        fi
+      done
+    fi
+
     if test -d "$VS_BASE"; then
-      if test -f "$VS_BASE/$VCVARSFILE"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
-        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
-        # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
-        # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        VCVARSFILES="vc/bin/vcvars32.bat vc/auxiliary/build/vcvars32.bat"
+      else
+        VCVARSFILES="vc/bin/amd64/vcvars64.bat vc/bin/x86_amd64/vcvarsx86_amd64.bat \
+            vc/auxiliary/build/vcvarsx86_amd64.bat vc/auxiliary/build/vcvars64.bat"
+      fi
+
+      for VCVARSFILE in $VCVARSFILES; do
+        if test -f "$VS_BASE/$VCVARSFILE"; then
+          VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
+          break
+        fi
+      done
+
+      if test "x$VS_ENV_CMD" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: None of $VCVARSFILES were found, Visual Studio installation not recognized. Ignoring" >&5
+$as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio installation not recognized. Ignoring" >&6;}
+      else
+        # PLATFORM_TOOLSET is used during the compilation of the freetype sources
+        # (see 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100',
+        # 'v110' or 'v120' for VS 2010, 2012 or VS2013
         eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
-$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
       fi
     fi
   fi
@@ -32514,12 +32597,6 @@
     VS_BASE="$PROGRAMFILES/$VS_INSTALL_DIR"
     METHOD="well-known name"
 
-    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
-      VCVARSFILE="vc/bin/vcvars32.bat"
-    else
-      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
-    fi
-
 
   windows_path="$VS_BASE"
   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -32530,19 +32607,42 @@
     VS_BASE="$unix_path"
   fi
 
+    # In VS 2017, the default installation is in a subdir named after the edition.
+    # Find the first one present and use that.
+    if test "x$VS_EDITIONS" != x; then
+      for edition in $VS_EDITIONS; do
+        if test -d "$VS_BASE/$edition"; then
+          VS_BASE="$VS_BASE/$edition"
+          break
+        fi
+      done
+    fi
+
     if test -d "$VS_BASE"; then
-      if test -f "$VS_BASE/$VCVARSFILE"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
-        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
-        # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
-        # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        VCVARSFILES="vc/bin/vcvars32.bat vc/auxiliary/build/vcvars32.bat"
+      else
+        VCVARSFILES="vc/bin/amd64/vcvars64.bat vc/bin/x86_amd64/vcvarsx86_amd64.bat \
+            vc/auxiliary/build/vcvarsx86_amd64.bat vc/auxiliary/build/vcvars64.bat"
+      fi
+
+      for VCVARSFILE in $VCVARSFILES; do
+        if test -f "$VS_BASE/$VCVARSFILE"; then
+          VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
+          break
+        fi
+      done
+
+      if test "x$VS_ENV_CMD" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: None of $VCVARSFILES were found, Visual Studio installation not recognized. Ignoring" >&5
+$as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio installation not recognized. Ignoring" >&6;}
+      else
+        # PLATFORM_TOOLSET is used during the compilation of the freetype sources
+        # (see 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100',
+        # 'v110' or 'v120' for VS 2010, 2012 or VS2013
         eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
-$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
       fi
     fi
   fi
@@ -32557,12 +32657,6 @@
     VS_BASE="$PROGRAMFILES_X86/$VS_INSTALL_DIR"
     METHOD="well-known name"
 
-    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
-      VCVARSFILE="vc/bin/vcvars32.bat"
-    else
-      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
-    fi
-
 
   windows_path="$VS_BASE"
   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -32573,19 +32667,42 @@
     VS_BASE="$unix_path"
   fi
 
+    # In VS 2017, the default installation is in a subdir named after the edition.
+    # Find the first one present and use that.
+    if test "x$VS_EDITIONS" != x; then
+      for edition in $VS_EDITIONS; do
+        if test -d "$VS_BASE/$edition"; then
+          VS_BASE="$VS_BASE/$edition"
+          break
+        fi
+      done
+    fi
+
     if test -d "$VS_BASE"; then
-      if test -f "$VS_BASE/$VCVARSFILE"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
-        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
-        # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
-        # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        VCVARSFILES="vc/bin/vcvars32.bat vc/auxiliary/build/vcvars32.bat"
+      else
+        VCVARSFILES="vc/bin/amd64/vcvars64.bat vc/bin/x86_amd64/vcvarsx86_amd64.bat \
+            vc/auxiliary/build/vcvarsx86_amd64.bat vc/auxiliary/build/vcvars64.bat"
+      fi
+
+      for VCVARSFILE in $VCVARSFILES; do
+        if test -f "$VS_BASE/$VCVARSFILE"; then
+          VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
+          break
+        fi
+      done
+
+      if test "x$VS_ENV_CMD" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: None of $VCVARSFILES were found, Visual Studio installation not recognized. Ignoring" >&5
+$as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio installation not recognized. Ignoring" >&6;}
+      else
+        # PLATFORM_TOOLSET is used during the compilation of the freetype sources
+        # (see 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100',
+        # 'v110' or 'v120' for VS 2010, 2012 or VS2013
         eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
-$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
       fi
     fi
   fi
@@ -32597,11 +32714,61 @@
     VS_BASE="C:/Program Files/$VS_INSTALL_DIR"
     METHOD="well-known name"
 
-    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
-      VCVARSFILE="vc/bin/vcvars32.bat"
-    else
-      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
-    fi
+
+  windows_path="$VS_BASE"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    VS_BASE="$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'`
+    VS_BASE="$unix_path"
+  fi
+
+    # In VS 2017, the default installation is in a subdir named after the edition.
+    # Find the first one present and use that.
+    if test "x$VS_EDITIONS" != x; then
+      for edition in $VS_EDITIONS; do
+        if test -d "$VS_BASE/$edition"; then
+          VS_BASE="$VS_BASE/$edition"
+          break
+        fi
+      done
+    fi
+
+    if test -d "$VS_BASE"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        VCVARSFILES="vc/bin/vcvars32.bat vc/auxiliary/build/vcvars32.bat"
+      else
+        VCVARSFILES="vc/bin/amd64/vcvars64.bat vc/bin/x86_amd64/vcvarsx86_amd64.bat \
+            vc/auxiliary/build/vcvarsx86_amd64.bat vc/auxiliary/build/vcvars64.bat"
+      fi
+
+      for VCVARSFILE in $VCVARSFILES; do
+        if test -f "$VS_BASE/$VCVARSFILE"; then
+          VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
+          break
+        fi
+      done
+
+      if test "x$VS_ENV_CMD" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: None of $VCVARSFILES were found, Visual Studio installation not recognized. Ignoring" >&5
+$as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio installation not recognized. Ignoring" >&6;}
+      else
+        # PLATFORM_TOOLSET is used during the compilation of the freetype sources
+        # (see 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100',
+        # 'v110' or 'v120' for VS 2010, 2012 or VS2013
+        eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
+      fi
+    fi
+  fi
+
+
+  if test "x$VS_ENV_CMD" = x; then
+    VS_VERSION="${VS_VERSION}"
+    VS_BASE="C:/Program Files (x86)/$VS_INSTALL_DIR"
+    METHOD="well-known name"
 
 
   windows_path="$VS_BASE"
@@ -32613,58 +32780,42 @@
     VS_BASE="$unix_path"
   fi
 
-    if test -d "$VS_BASE"; then
-      if test -f "$VS_BASE/$VCVARSFILE"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
-        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
-        # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
-        # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
-        eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
-$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
-      fi
-    fi
-  fi
-
-
-  if test "x$VS_ENV_CMD" = x; then
-    VS_VERSION="${VS_VERSION}"
-    VS_BASE="C:/Program Files (x86)/$VS_INSTALL_DIR"
-    METHOD="well-known name"
-
-    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
-      VCVARSFILE="vc/bin/vcvars32.bat"
-    else
-      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
-    fi
-
-
-  windows_path="$VS_BASE"
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
-    unix_path=`$CYGPATH -u "$windows_path"`
-    VS_BASE="$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'`
-    VS_BASE="$unix_path"
-  fi
+    # In VS 2017, the default installation is in a subdir named after the edition.
+    # Find the first one present and use that.
+    if test "x$VS_EDITIONS" != x; then
+      for edition in $VS_EDITIONS; do
+        if test -d "$VS_BASE/$edition"; then
+          VS_BASE="$VS_BASE/$edition"
+          break
+        fi
+      done
+    fi
 
     if test -d "$VS_BASE"; then
-      if test -f "$VS_BASE/$VCVARSFILE"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
-        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
-        # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
-        # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        VCVARSFILES="vc/bin/vcvars32.bat vc/auxiliary/build/vcvars32.bat"
+      else
+        VCVARSFILES="vc/bin/amd64/vcvars64.bat vc/bin/x86_amd64/vcvarsx86_amd64.bat \
+            vc/auxiliary/build/vcvarsx86_amd64.bat vc/auxiliary/build/vcvars64.bat"
+      fi
+
+      for VCVARSFILE in $VCVARSFILES; do
+        if test -f "$VS_BASE/$VCVARSFILE"; then
+          VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
+          break
+        fi
+      done
+
+      if test "x$VS_ENV_CMD" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: None of $VCVARSFILES were found, Visual Studio installation not recognized. Ignoring" >&5
+$as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio installation not recognized. Ignoring" >&6;}
+      else
+        # PLATFORM_TOOLSET is used during the compilation of the freetype sources
+        # (see 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100',
+        # 'v110' or 'v120' for VS 2010, 2012 or VS2013
         eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
-$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
       fi
     fi
   fi
@@ -32917,6 +33068,11 @@
     fi
   done
 
+  TOOLCHAIN_DESCRIPTION="$VS_DESCRIPTION"
+  if test "$TOOLCHAIN_VERSION" -gt 2013; then
+    UNSUPPORTED_TOOLCHAIN_VERSION=yes
+  fi
+
 
   # If we have a devkit, skip all of the below.
   if test "x$DEVKIT_VS_VERSION" = x; then
@@ -33249,6 +33405,9 @@
       # This will end up something like:
       # call C:/progra~2/micros~2.0/vc/bin/amd64/vcvars64.bat
       $ECHO "call $WINPATH_VS_ENV_CMD $VS_ENV_ARGS" >> $EXTRACT_VC_ENV_BAT_FILE
+      # In some cases, the VS_ENV_CMD will change directory, change back so
+      # the set-vs-env.sh ends up in the right place.
+      $ECHO 'cd %~dp0' >> $EXTRACT_VC_ENV_BAT_FILE
       # These will end up something like:
       # C:/CygWin/bin/bash -c 'echo VS_PATH=\"$PATH\" > localdevenv.sh
       # The trailing space for everyone except PATH is no typo, but is needed due
@@ -33670,7 +33829,7 @@
     if test "x$XCODE_VERSION_OUTPUT" != x; then
       # For Xcode, we set the Xcode version as TOOLCHAIN_VERSION
       TOOLCHAIN_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | $CUT -f 2 -d ' '`
-      TOOLCHAIN_DESCRIPTION="$TOOLCHAIN_DESCRIPTION from Xcode"
+      TOOLCHAIN_DESCRIPTION="$TOOLCHAIN_DESCRIPTION from Xcode $TOOLCHAIN_VERSION"
     else
       # Currently we do not define this for other toolchains. This might change as the need arise.
       TOOLCHAIN_VERSION=
@@ -55888,7 +56047,6 @@
   MSVC_DLL=
 
   if test "x$MSVC_DLL" = x; then
-    # Probe: Using well-known location from Visual Studio 10.0
     if test "x$VCINSTALLDIR" != x; then
       CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR"
 
@@ -55901,15 +56059,27 @@
     CYGWIN_VC_INSTALL_DIR="$unix_path"
   fi
 
-      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
-        POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
-      else
-        POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
-      fi
-      $ECHO "POSSIBLE_MSVC_DLL $POSSIBLEMSVC_DLL"
+      if test "$VS_VERSION" -lt 2017; then
+        # Probe: Using well-known location from Visual Studio 12.0 and older
+        if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
+          POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
+        else
+          POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
+        fi
+      else
+        # Probe: Using well-known location from VS 2017
+        if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
+          POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_INSTALL_DIR/Redist/MSVC/*/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`"
+        else
+          POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_INSTALL_DIR/Redist/MSVC/*/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`"
+        fi
+      fi
+      # In case any of the above finds more than one file, loop over them.
+      for possible_msvc_dll in $POSSIBLE_MSVC_DLL; do
+        $ECHO "POSSIBLE_MSVC_DLL $possible_msvc_dll"
 
   DLL_NAME="$DLL_NAME"
-  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
+  POSSIBLE_MSVC_DLL="$possible_msvc_dll"
   METHOD="well-known location in VCINSTALLDIR"
   if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
@@ -56082,6 +56252,7 @@
     fi
   fi
 
+      done
     fi
   fi
 
@@ -57237,7 +57408,6 @@
   MSVC_DLL=
 
   if test "x$MSVC_DLL" = x; then
-    # Probe: Using well-known location from Visual Studio 10.0
     if test "x$VCINSTALLDIR" != x; then
       CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR"
 
@@ -57250,15 +57420,27 @@
     CYGWIN_VC_INSTALL_DIR="$unix_path"
   fi
 
-      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
-        POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
-      else
-        POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
-      fi
-      $ECHO "POSSIBLE_MSVC_DLL $POSSIBLEMSVC_DLL"
+      if test "$VS_VERSION" -lt 2017; then
+        # Probe: Using well-known location from Visual Studio 12.0 and older
+        if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
+          POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
+        else
+          POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
+        fi
+      else
+        # Probe: Using well-known location from VS 2017
+        if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
+          POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_INSTALL_DIR/Redist/MSVC/*/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`"
+        else
+          POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_INSTALL_DIR/Redist/MSVC/*/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`"
+        fi
+      fi
+      # In case any of the above finds more than one file, loop over them.
+      for possible_msvc_dll in $POSSIBLE_MSVC_DLL; do
+        $ECHO "POSSIBLE_MSVC_DLL $possible_msvc_dll"
 
   DLL_NAME="$DLL_NAME"
-  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
+  POSSIBLE_MSVC_DLL="$possible_msvc_dll"
   METHOD="well-known location in VCINSTALLDIR"
   if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
@@ -57431,6 +57613,7 @@
     fi
   fi
 
+      done
     fi
   fi
 
@@ -68900,16 +69083,6 @@
   fi
 
 
-  # Did user specify any unknown variables?
-
-  if test "x$CONFIGURE_OVERRIDDEN_VARIABLES" != x; then
-    # Replace the separating ! with spaces before presenting for end user.
-    unknown_variables=${CONFIGURE_OVERRIDDEN_VARIABLES//!/ }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The following variables might be unknown to configure: $unknown_variables" >&5
-$as_echo "$as_me: WARNING: The following variables might be unknown to configure: $unknown_variables" >&2;}
-  fi
-
-
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if build directory is on local disk" >&5
 $as_echo_n "checking if build directory is on local disk... " >&6; }
 
@@ -68991,6 +69164,16 @@
   done
 
 
+# Did user specify any unknown variables?
+
+  if test "x$CONFIGURE_OVERRIDDEN_VARIABLES" != x; then
+    # Replace the separating ! with spaces before presenting for end user.
+    unknown_variables=${CONFIGURE_OVERRIDDEN_VARIABLES//!/ }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The following variables might be unknown to configure: $unknown_variables" >&5
+$as_echo "$as_me: WARNING: The following variables might be unknown to configure: $unknown_variables" >&2;}
+  fi
+
+
 # We're messing a bit with internal autoconf variables to put the config.status
 # in the output directory instead of the current directory.
 CONFIG_STATUS="$CONFIGURESUPPORT_OUTPUTDIR/config.status"
@@ -70223,10 +70406,7 @@
     printf "* Environment:    $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n"
   fi
   printf "* Boot JDK:       $BOOT_JDK_VERSION (at $BOOT_JDK)\n"
-  if test "x$TOOLCHAIN_VERSION" != "x"; then
-    print_version=" $TOOLCHAIN_VERSION"
-  fi
-  printf "* Toolchain:      $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION$print_version)\n"
+  printf "* Toolchain:      $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n"
   printf "* C Compiler:     Version $CC_VERSION_NUMBER (at $CC)\n"
   printf "* C++ Compiler:   Version $CXX_VERSION_NUMBER (at $CXX)\n"
 
@@ -70274,6 +70454,12 @@
     printf "\n"
   fi
 
+  if test "x$UNSUPPORTED_TOOLCHAIN_VERSION" = "xyes"; then
+    printf "WARNING: The toolchain version used is known to have issues. Please\n"
+    printf "consider using a supported version unless you know what you are doing.\n"
+    printf "\n"
+  fi
+
 
 
   # Locate config.log.
--- a/make/autoconf/help.m4	Tue Jan 30 11:53:00 2018 +0530
+++ b/make/autoconf/help.m4	Tue Jan 30 09:03:47 2018 -0800
@@ -242,10 +242,7 @@
     printf "* Environment:    $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n"
   fi
   printf "* Boot JDK:       $BOOT_JDK_VERSION (at $BOOT_JDK)\n"
-  if test "x$TOOLCHAIN_VERSION" != "x"; then
-    print_version=" $TOOLCHAIN_VERSION"
-  fi
-  printf "* Toolchain:      $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION$print_version)\n"
+  printf "* Toolchain:      $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n"
   printf "* C Compiler:     Version $CC_VERSION_NUMBER (at $CC)\n"
   printf "* C++ Compiler:   Version $CXX_VERSION_NUMBER (at $CXX)\n"
 
@@ -292,6 +289,12 @@
     printf "You should run without '--no-create | -n' to create the configuration.\n"
     printf "\n"
   fi
+
+  if test "x$UNSUPPORTED_TOOLCHAIN_VERSION" = "xyes"; then
+    printf "WARNING: The toolchain version used is known to have issues. Please\n"
+    printf "consider using a supported version unless you know what you are doing.\n"
+    printf "\n"
+  fi
 ])
 
 AC_DEFUN_ONCE([HELP_REPEAT_WARNINGS],
--- a/make/autoconf/toolchain.m4	Tue Jan 30 11:53:00 2018 +0530
+++ b/make/autoconf/toolchain.m4	Tue Jan 30 09:03:47 2018 -0800
@@ -286,7 +286,7 @@
     if test "x$XCODE_VERSION_OUTPUT" != x; then
       # For Xcode, we set the Xcode version as TOOLCHAIN_VERSION
       TOOLCHAIN_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | $CUT -f 2 -d ' '`
-      TOOLCHAIN_DESCRIPTION="$TOOLCHAIN_DESCRIPTION from Xcode"
+      TOOLCHAIN_DESCRIPTION="$TOOLCHAIN_DESCRIPTION from Xcode $TOOLCHAIN_VERSION"
     else
       # Currently we do not define this for other toolchains. This might change as the need arise.
       TOOLCHAIN_VERSION=
--- a/make/autoconf/toolchain_windows.m4	Tue Jan 30 11:53:00 2018 +0530
+++ b/make/autoconf/toolchain_windows.m4	Tue Jan 30 09:03:47 2018 -0800
@@ -25,7 +25,7 @@
 
 ################################################################################
 # The order of these defines the priority by which we try to find them.
-VALID_VS_VERSIONS="2013 2012 2010"
+VALID_VS_VERSIONS="2013 2012 2010 2015 2017"
 
 VS_DESCRIPTION_2010="Microsoft Visual Studio 2010"
 VS_VERSION_INTERNAL_2010=100
@@ -58,6 +58,30 @@
 VS_VS_PLATFORM_NAME_2013="v120"
 VS_SDK_PLATFORM_NAME_2013=
 
+VS_DESCRIPTION_2015="Microsoft Visual Studio 2015 - CURRENTLY NOT WORKING"
+VS_VERSION_INTERNAL_2015=140
+VS_MSVCR_2015=vcruntime140.dll
+VS_MSVCP_2015=msvcp140.dll
+VS_ENVVAR_2015="VS140COMNTOOLS"
+VS_VS_INSTALLDIR_2015="Microsoft Visual Studio 14.0"
+VS_SDK_INSTALLDIR_2015=
+VS_VS_PLATFORM_NAME_2015="v140"
+VS_SDK_PLATFORM_NAME_2015=
+# The vcvars of 2015 breaks if 2017 is also installed. Work around this by
+# explicitly specifying Windows Kit 8.1 to be used.
+VS_ENV_ARGS_2015="8.1"
+
+VS_DESCRIPTION_2017="Microsoft Visual Studio 2017 - CURRENTLY NOT WORKING"
+VS_VERSION_INTERNAL_2017=141
+VS_MSVCR_2017=vcruntime140.dll
+VS_MSVCP_2017=msvcp140.dll
+VS_ENVVAR_2017="VS150COMNTOOLS"
+VS_VS_INSTALLDIR_2017="Microsoft Visual Studio/2017"
+VS_EDITIONS_2017="Community Professional Enterprise"
+VS_SDK_INSTALLDIR_2017=
+VS_VS_PLATFORM_NAME_2017="v141"
+VS_SDK_PLATFORM_NAME_2017=
+
 ################################################################################
 
 AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT],
@@ -67,23 +91,41 @@
     VS_BASE="$2"
     METHOD="$3"
 
-    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
-      VCVARSFILE="vc/bin/vcvars32.bat"
-    else
-      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
+    BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VS_BASE)
+    # In VS 2017, the default installation is in a subdir named after the edition.
+    # Find the first one present and use that.
+    if test "x$VS_EDITIONS" != x; then
+      for edition in $VS_EDITIONS; do
+        if test -d "$VS_BASE/$edition"; then
+          VS_BASE="$VS_BASE/$edition"
+          break
+        fi
+      done
     fi
 
-    BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VS_BASE)
     if test -d "$VS_BASE"; then
-      if test -f "$VS_BASE/$VCVARSFILE"; then
-        AC_MSG_NOTICE([Found Visual Studio installation at $VS_BASE using $METHOD])
-        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
-        # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
-        # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
+      AC_MSG_NOTICE([Found Visual Studio installation at $VS_BASE using $METHOD])
+      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+        VCVARSFILES="vc/bin/vcvars32.bat vc/auxiliary/build/vcvars32.bat"
+      else
+        VCVARSFILES="vc/bin/amd64/vcvars64.bat vc/bin/x86_amd64/vcvarsx86_amd64.bat \
+            vc/auxiliary/build/vcvarsx86_amd64.bat vc/auxiliary/build/vcvars64.bat"
+      fi
+
+      for VCVARSFILE in $VCVARSFILES; do
+        if test -f "$VS_BASE/$VCVARSFILE"; then
+          VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
+          break
+        fi
+      done
+
+      if test "x$VS_ENV_CMD" = x; then
+        AC_MSG_NOTICE([Warning: None of $VCVARSFILES were found, Visual Studio installation not recognized. Ignoring])
+      else
+        # PLATFORM_TOOLSET is used during the compilation of the freetype sources
+        # (see 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100',
+        # 'v110' or 'v120' for VS 2010, 2012 or VS2013
         eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
-      else
-        AC_MSG_NOTICE([Found Visual Studio installation at $VS_BASE using $METHOD])
-        AC_MSG_NOTICE([Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring])
       fi
     fi
   fi
@@ -133,7 +175,9 @@
   eval VS_COMNTOOLS_VAR="\${VS_ENVVAR_${VS_VERSION}}"
   eval VS_COMNTOOLS="\$${VS_COMNTOOLS_VAR}"
   eval VS_INSTALL_DIR="\${VS_VS_INSTALLDIR_${VS_VERSION}}"
+  eval VS_EDITIONS="\${VS_EDITIONS_${VS_VERSION}}"
   eval SDK_INSTALL_DIR="\${VS_SDK_INSTALLDIR_${VS_VERSION}}"
+  eval VS_ENV_ARGS="\${VS_ENV_ARGS_${VS_VERSION}}"
 
   # When using --with-tools-dir, assume it points to the correct and default
   # version of Visual Studio or that --with-toolchain-version was also set.
@@ -153,7 +197,6 @@
   fi
 
   VS_ENV_CMD=""
-  VS_ENV_ARGS=""
 
   if test "x$VS_COMNTOOLS" != x; then
     TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}],
@@ -213,7 +256,11 @@
   elif test "x$DEVKIT_VS_VERSION" != x; then
     VS_VERSION=$DEVKIT_VS_VERSION
     TOOLCHAIN_VERSION=$VS_VERSION
-    eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}"
+    # If the devkit has a name, use that as description
+    VS_DESCRIPTION="$DEVKIT_NAME"
+    if test "x$VS_DESCRIPTION" = x; then
+      eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}"
+    fi
     eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}"
     eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}"
     eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}"
@@ -267,6 +314,11 @@
       break
     fi
   done
+
+  TOOLCHAIN_DESCRIPTION="$VS_DESCRIPTION"
+  if test "$TOOLCHAIN_VERSION" -gt 2013; then
+    UNSUPPORTED_TOOLCHAIN_VERSION=yes
+  fi
 ])
 
 ################################################################################
@@ -320,6 +372,9 @@
       # This will end up something like:
       # call C:/progra~2/micros~2.0/vc/bin/amd64/vcvars64.bat
       $ECHO "call $WINPATH_VS_ENV_CMD $VS_ENV_ARGS" >> $EXTRACT_VC_ENV_BAT_FILE
+      # In some cases, the VS_ENV_CMD will change directory, change back so
+      # the set-vs-env.sh ends up in the right place.
+      $ECHO 'cd %~dp0' >> $EXTRACT_VC_ENV_BAT_FILE
       # These will end up something like:
       # C:/CygWin/bin/bash -c 'echo VS_PATH=\"$PATH\" > localdevenv.sh
       # The trailing space for everyone except PATH is no typo, but is needed due
@@ -483,18 +538,30 @@
   MSVC_DLL=
 
   if test "x$MSVC_DLL" = x; then
-    # Probe: Using well-known location from Visual Studio 10.0
     if test "x$VCINSTALLDIR" != x; then
       CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR"
       BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VC_INSTALL_DIR)
-      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
-        POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
+      if test "$VS_VERSION" -lt 2017; then
+        # Probe: Using well-known location from Visual Studio 12.0 and older
+        if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
+          POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
+        else
+          POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
+        fi
       else
-        POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
+        # Probe: Using well-known location from VS 2017
+        if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
+          POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_INSTALL_DIR/Redist/MSVC/*/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`"
+        else
+          POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_INSTALL_DIR/Redist/MSVC/*/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`"
+        fi
       fi
-      $ECHO "POSSIBLE_MSVC_DLL $POSSIBLEMSVC_DLL"
-      TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL],
-          [well-known location in VCINSTALLDIR])
+      # In case any of the above finds more than one file, loop over them.
+      for possible_msvc_dll in $POSSIBLE_MSVC_DLL; do
+        $ECHO "POSSIBLE_MSVC_DLL $possible_msvc_dll"
+        TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$possible_msvc_dll],
+            [well-known location in VCINSTALLDIR])
+      done
     fi
   fi
 
@@ -576,7 +643,7 @@
     TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCR_NAME, [$DEVKIT_MSVCR_DLL], [devkit])
     if test "x$MSVC_DLL" = x; then
       AC_MSG_ERROR([Could not find a proper $MSVCR_NAME as specified by devkit])
-    fi  
+    fi
     MSVCR_DLL="$MSVC_DLL"
   else
     TOOLCHAIN_SETUP_MSVC_DLL([${MSVCR_NAME}])
@@ -599,7 +666,7 @@
       TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCP_NAME, [$DEVKIT_MSVCP_DLL], [devkit])
       if test "x$MSVC_DLL" = x; then
         AC_MSG_ERROR([Could not find a proper $MSVCP_NAME as specified by devkit])
-      fi  
+      fi
       MSVCP_DLL="$MSVC_DLL"
     else
       TOOLCHAIN_SETUP_MSVC_DLL([${MSVCP_NAME}])
--- a/make/devkit/createWindowsDevkit.sh	Tue Jan 30 11:53:00 2018 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# This script copies parts of a Visual Studio 2013 installation into a devkit
-# suitable for building OpenJDK and OracleJDK. Needs to run in Cygwin.
-# erik.joelsson@oracle.com
-
-VS_VERSION="2013"
-VS_VERSION_NUM="12.0"
-VS_VERSION_NUM_NODOT="120"
-SDK_VERSION="8.1"
-VS_VERSION_SP="SP4"
-
-SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)"
-BUILD_DIR="${SCRIPT_DIR}/../../build/devkit"
-DEVKIT_ROOT="${BUILD_DIR}/VS${VS_VERSION}${VS_VERSION_SP}-devkit"
-DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz"
-
-echo "Creating devkit in $DEVKIT_ROOT"
-
-MSVCR_DLL=Microsoft.VC${VS_VERSION_NUM_NODOT}.CRT/msvcr${VS_VERSION_NUM_NODOT}.dll
-MSVCP_DLL=Microsoft.VC${VS_VERSION_NUM_NODOT}.CRT/msvcp${VS_VERSION_NUM_NODOT}.dll
-
-################################################################################
-# Copy Visual Studio files
-
-eval VSNNNCOMNTOOLS="\"\${VS${VS_VERSION_NUM_NODOT}COMNTOOLS}\""
-VS_INSTALL_DIR="$(cygpath "$VSNNNCOMNTOOLS/../..")"
-echo "VS_INSTALL_DIR: $VS_INSTALL_DIR"
-
-if [ ! -d $DEVKIT_ROOT/VC ]; then
-    echo "Copying VC..."
-    mkdir -p $DEVKIT_ROOT/VC/bin
-    cp -r "$VS_INSTALL_DIR/VC/bin/amd64" $DEVKIT_ROOT/VC/bin/
-    cp    "$VS_INSTALL_DIR/VC/bin/"*.* $DEVKIT_ROOT/VC/bin/
-    cp -r "$VS_INSTALL_DIR/VC/bin/1033/" $DEVKIT_ROOT/VC/bin/
-    mkdir -p $DEVKIT_ROOT/VC/lib
-    cp -r "$VS_INSTALL_DIR/VC/lib/amd64" $DEVKIT_ROOT/VC/lib/
-    cp    "$VS_INSTALL_DIR/VC/lib/"*.* $DEVKIT_ROOT/VC/lib/
-    cp -r "$VS_INSTALL_DIR/VC/include" $DEVKIT_ROOT/VC/
-    mkdir -p $DEVKIT_ROOT/VC/atlmfc/lib
-    cp -r "$VS_INSTALL_DIR/VC/atlmfc/include" $DEVKIT_ROOT/VC/atlmfc/
-    cp -r "$VS_INSTALL_DIR/VC/atlmfc/lib/amd64" $DEVKIT_ROOT/VC/atlmfc/lib/
-    cp    "$VS_INSTALL_DIR/VC/atlmfc/lib/"*.* $DEVKIT_ROOT/VC/atlmfc/lib/
-    mkdir -p $DEVKIT_ROOT/VC/redist
-    cp -r "$VS_INSTALL_DIR/VC/redist/x64" $DEVKIT_ROOT/VC/redist/
-    cp -r "$VS_INSTALL_DIR/VC/redist/x86" $DEVKIT_ROOT/VC/redist/
-    # The redist runtime libs are needed to run the compiler but may not be
-    # installed on the machine where the devkit will be used.
-    cp $DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/
-    cp $DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/
-    cp $DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/amd64/
-    cp $DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/amd64/
-    # The msvcdis dll is needed to run some of the tools in VC/bin but is not
-    # shipped in that directory. Copy it from the common dir.
-    cp "$VS_INSTALL_DIR/Common7/IDE/msvcdis${VS_VERSION_NUM_NODOT}.dll" \
-        $DEVKIT_ROOT/VC/bin/
-fi
-
-################################################################################
-# Copy SDK files
-
-PROGRAMFILES_X86="`env | sed -n 's/^ProgramFiles(x86)=//p'`"
-SDK_INSTALL_DIR="$(cygpath "$PROGRAMFILES_X86/Windows Kits/$SDK_VERSION")"
-echo "SDK_INSTALL_DIR: $SDK_INSTALL_DIR"
-
-if [ ! -d $DEVKIT_ROOT/$SDK_VERSION ]; then
-    echo "Copying SDK..."
-    mkdir -p $DEVKIT_ROOT/$SDK_VERSION/bin
-    cp -r "$SDK_INSTALL_DIR/bin/x64" $DEVKIT_ROOT/$SDK_VERSION/bin/
-    cp -r "$SDK_INSTALL_DIR/bin/x86" $DEVKIT_ROOT/$SDK_VERSION/bin/
-    mkdir -p $DEVKIT_ROOT/$SDK_VERSION/lib
-    cp -r "$SDK_INSTALL_DIR/lib/"winv*/um/x64 $DEVKIT_ROOT/$SDK_VERSION/lib/
-    cp -r "$SDK_INSTALL_DIR/lib/"winv*/um/x86 $DEVKIT_ROOT/$SDK_VERSION/lib/
-    cp -r "$SDK_INSTALL_DIR/include" $DEVKIT_ROOT/$SDK_VERSION/
-fi
-
-################################################################################
-# Generate devkit.info
-
-echo-info() {
-    echo "$1" >> $DEVKIT_ROOT/devkit.info
-}
-
-echo "Generating devkit.info..."
-rm -f $DEVKIT_ROOT/devkit.info
-echo-info "# This file describes to configure how to interpret the contents of this devkit"
-echo-info "DEVKIT_NAME=\"Microsoft Visual Studio $VS_VERSION $VS_VERSION_SP (devkit)\""
-echo-info "DEVKIT_VS_VERSION=\"$VS_VERSION\""
-echo-info ""
-echo-info "DEVKIT_TOOLCHAIN_PATH_x86=\"\$DEVKIT_ROOT/VC/bin:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\""
-echo-info "DEVKIT_VS_INCLUDE_x86=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt\""
-echo-info "DEVKIT_VS_LIB_x86=\"\$DEVKIT_ROOT/VC/lib;\$DEVKIT_ROOT/VC/atlmfc/lib;\$DEVKIT_ROOT/$SDK_VERSION/lib/x86\""
-echo-info "DEVKIT_MSVCR_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL\""
-echo-info "DEVKIT_MSVCP_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL\""
-echo-info ""
-echo-info "DEVKIT_TOOLCHAIN_PATH_x86_64=\"\$DEVKIT_ROOT/VC/bin/amd64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\""
-echo-info "DEVKIT_VS_INCLUDE_x86_64=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt\""
-echo-info "DEVKIT_VS_LIB_x86_64=\"\$DEVKIT_ROOT/VC/lib/amd64;\$DEVKIT_ROOT/VC/atlmfc/lib/amd64;\$DEVKIT_ROOT/$SDK_VERSION/lib/x64\""
-echo-info "DEVKIT_MSVCR_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL\""
-echo-info "DEVKIT_MSVCP_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL\""
-
-################################################################################
-# Copy this script
-
-echo "Copying this script..."
-cp $0 $DEVKIT_ROOT/
-
-################################################################################
-# Create bundle
-
-echo "Creating bundle: $DEVKIT_BUNDLE"
-(cd "$DEVKIT_ROOT" && tar zcf "$DEVKIT_BUNDLE" .)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/devkit/createWindowsDevkit2013.sh	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,136 @@
+#!/bin/bash
+#
+# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# This script copies parts of a Visual Studio 2013 installation into a devkit
+# suitable for building OpenJDK and OracleJDK. Needs to run in Cygwin.
+# erik.joelsson@oracle.com
+
+VS_VERSION="2013"
+VS_VERSION_NUM="12.0"
+VS_VERSION_NUM_NODOT="120"
+SDK_VERSION="8.1"
+VS_VERSION_SP="SP4"
+
+SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)"
+BUILD_DIR="${SCRIPT_DIR}/../../build/devkit"
+DEVKIT_ROOT="${BUILD_DIR}/VS${VS_VERSION}${VS_VERSION_SP}-devkit"
+DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz"
+
+echo "Creating devkit in $DEVKIT_ROOT"
+
+MSVCR_DLL=Microsoft.VC${VS_VERSION_NUM_NODOT}.CRT/msvcr${VS_VERSION_NUM_NODOT}.dll
+MSVCP_DLL=Microsoft.VC${VS_VERSION_NUM_NODOT}.CRT/msvcp${VS_VERSION_NUM_NODOT}.dll
+
+################################################################################
+# Copy Visual Studio files
+
+eval VSNNNCOMNTOOLS="\"\${VS${VS_VERSION_NUM_NODOT}COMNTOOLS}\""
+VS_INSTALL_DIR="$(cygpath "$VSNNNCOMNTOOLS/../..")"
+echo "VS_INSTALL_DIR: $VS_INSTALL_DIR"
+
+if [ ! -d $DEVKIT_ROOT/VC ]; then
+    echo "Copying VC..."
+    mkdir -p $DEVKIT_ROOT/VC/bin
+    cp -r "$VS_INSTALL_DIR/VC/bin/amd64" $DEVKIT_ROOT/VC/bin/
+    cp    "$VS_INSTALL_DIR/VC/bin/"*.* $DEVKIT_ROOT/VC/bin/
+    cp -r "$VS_INSTALL_DIR/VC/bin/1033/" $DEVKIT_ROOT/VC/bin/
+    mkdir -p $DEVKIT_ROOT/VC/lib
+    cp -r "$VS_INSTALL_DIR/VC/lib/amd64" $DEVKIT_ROOT/VC/lib/
+    cp    "$VS_INSTALL_DIR/VC/lib/"*.* $DEVKIT_ROOT/VC/lib/
+    cp -r "$VS_INSTALL_DIR/VC/include" $DEVKIT_ROOT/VC/
+    mkdir -p $DEVKIT_ROOT/VC/atlmfc/lib
+    cp -r "$VS_INSTALL_DIR/VC/atlmfc/include" $DEVKIT_ROOT/VC/atlmfc/
+    cp -r "$VS_INSTALL_DIR/VC/atlmfc/lib/amd64" $DEVKIT_ROOT/VC/atlmfc/lib/
+    cp    "$VS_INSTALL_DIR/VC/atlmfc/lib/"*.* $DEVKIT_ROOT/VC/atlmfc/lib/
+    mkdir -p $DEVKIT_ROOT/VC/redist
+    cp -r "$VS_INSTALL_DIR/VC/redist/x64" $DEVKIT_ROOT/VC/redist/
+    cp -r "$VS_INSTALL_DIR/VC/redist/x86" $DEVKIT_ROOT/VC/redist/
+    # The redist runtime libs are needed to run the compiler but may not be
+    # installed on the machine where the devkit will be used.
+    cp $DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/
+    cp $DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/
+    cp $DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/amd64/
+    cp $DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/amd64/
+    # The msvcdis dll is needed to run some of the tools in VC/bin but is not
+    # shipped in that directory. Copy it from the common dir.
+    cp "$VS_INSTALL_DIR/Common7/IDE/msvcdis${VS_VERSION_NUM_NODOT}.dll" \
+        $DEVKIT_ROOT/VC/bin/
+fi
+
+################################################################################
+# Copy SDK files
+
+PROGRAMFILES_X86="`env | sed -n 's/^ProgramFiles(x86)=//p'`"
+SDK_INSTALL_DIR="$(cygpath "$PROGRAMFILES_X86/Windows Kits/$SDK_VERSION")"
+echo "SDK_INSTALL_DIR: $SDK_INSTALL_DIR"
+
+if [ ! -d $DEVKIT_ROOT/$SDK_VERSION ]; then
+    echo "Copying SDK..."
+    mkdir -p $DEVKIT_ROOT/$SDK_VERSION/bin
+    cp -r "$SDK_INSTALL_DIR/bin/x64" $DEVKIT_ROOT/$SDK_VERSION/bin/
+    cp -r "$SDK_INSTALL_DIR/bin/x86" $DEVKIT_ROOT/$SDK_VERSION/bin/
+    mkdir -p $DEVKIT_ROOT/$SDK_VERSION/lib
+    cp -r "$SDK_INSTALL_DIR/lib/"winv*/um/x64 $DEVKIT_ROOT/$SDK_VERSION/lib/
+    cp -r "$SDK_INSTALL_DIR/lib/"winv*/um/x86 $DEVKIT_ROOT/$SDK_VERSION/lib/
+    cp -r "$SDK_INSTALL_DIR/include" $DEVKIT_ROOT/$SDK_VERSION/
+fi
+
+################################################################################
+# Generate devkit.info
+
+echo-info() {
+    echo "$1" >> $DEVKIT_ROOT/devkit.info
+}
+
+echo "Generating devkit.info..."
+rm -f $DEVKIT_ROOT/devkit.info
+echo-info "# This file describes to configure how to interpret the contents of this devkit"
+echo-info "DEVKIT_NAME=\"Microsoft Visual Studio $VS_VERSION $VS_VERSION_SP (devkit)\""
+echo-info "DEVKIT_VS_VERSION=\"$VS_VERSION\""
+echo-info ""
+echo-info "DEVKIT_TOOLCHAIN_PATH_x86=\"\$DEVKIT_ROOT/VC/bin:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\""
+echo-info "DEVKIT_VS_INCLUDE_x86=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt\""
+echo-info "DEVKIT_VS_LIB_x86=\"\$DEVKIT_ROOT/VC/lib;\$DEVKIT_ROOT/VC/atlmfc/lib;\$DEVKIT_ROOT/$SDK_VERSION/lib/x86\""
+echo-info "DEVKIT_MSVCR_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL\""
+echo-info "DEVKIT_MSVCP_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL\""
+echo-info ""
+echo-info "DEVKIT_TOOLCHAIN_PATH_x86_64=\"\$DEVKIT_ROOT/VC/bin/amd64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\""
+echo-info "DEVKIT_VS_INCLUDE_x86_64=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt\""
+echo-info "DEVKIT_VS_LIB_x86_64=\"\$DEVKIT_ROOT/VC/lib/amd64;\$DEVKIT_ROOT/VC/atlmfc/lib/amd64;\$DEVKIT_ROOT/$SDK_VERSION/lib/x64\""
+echo-info "DEVKIT_MSVCR_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL\""
+echo-info "DEVKIT_MSVCP_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL\""
+
+################################################################################
+# Copy this script
+
+echo "Copying this script..."
+cp $0 $DEVKIT_ROOT/
+
+################################################################################
+# Create bundle
+
+echo "Creating bundle: $DEVKIT_BUNDLE"
+(cd "$DEVKIT_ROOT" && tar zcf "$DEVKIT_BUNDLE" .)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/devkit/createWindowsDevkit2015.sh	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,142 @@
+#!/bin/bash
+#
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# This script copies parts of a Visual Studio installation into a devkit
+# suitable for building OpenJDK and OracleJDK. Needs to run in Cygwin.
+# erik.joelsson@oracle.com
+
+VS_VERSION="2015"
+VS_VERSION_NUM="14.0"
+VS_VERSION_NUM_NODOT="140"
+SDK_VERSION="8.1"
+VS_VERSION_SP="update3"
+
+SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)"
+BUILD_DIR="${SCRIPT_DIR}/../../build/devkit"
+DEVKIT_ROOT="${BUILD_DIR}/VS${VS_VERSION}${VS_VERSION_SP}-devkit"
+DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz"
+
+echo "Creating devkit in $DEVKIT_ROOT"
+
+MSVCR_DLL=Microsoft.VC${VS_VERSION_NUM_NODOT}.CRT/vcruntime${VS_VERSION_NUM_NODOT}.dll
+MSVCP_DLL=Microsoft.VC${VS_VERSION_NUM_NODOT}.CRT/msvcp${VS_VERSION_NUM_NODOT}.dll
+
+################################################################################
+# Copy Visual Studio files
+
+eval VSNNNCOMNTOOLS="\"\${VS${VS_VERSION_NUM_NODOT}COMNTOOLS}\""
+VS_INSTALL_DIR="$(cygpath "$VSNNNCOMNTOOLS/../..")"
+echo "VS_INSTALL_DIR: $VS_INSTALL_DIR"
+
+if [ ! -d $DEVKIT_ROOT/VC ]; then
+    echo "Copying VC..."
+    mkdir -p $DEVKIT_ROOT/VC/bin
+    cp -r "$VS_INSTALL_DIR/VC/bin/amd64" $DEVKIT_ROOT/VC/bin/
+    cp    "$VS_INSTALL_DIR/VC/bin/"*.* $DEVKIT_ROOT/VC/bin/
+    cp -r "$VS_INSTALL_DIR/VC/bin/1033/" $DEVKIT_ROOT/VC/bin/
+    mkdir -p $DEVKIT_ROOT/VC/lib
+    cp -r "$VS_INSTALL_DIR/VC/lib/amd64" $DEVKIT_ROOT/VC/lib/
+    cp    "$VS_INSTALL_DIR/VC/lib/"*.* $DEVKIT_ROOT/VC/lib/
+    cp -r "$VS_INSTALL_DIR/VC/include" $DEVKIT_ROOT/VC/
+    mkdir -p $DEVKIT_ROOT/VC/atlmfc/lib
+    cp -r "$VS_INSTALL_DIR/VC/atlmfc/include" $DEVKIT_ROOT/VC/atlmfc/
+    cp -r "$VS_INSTALL_DIR/VC/atlmfc/lib/amd64" $DEVKIT_ROOT/VC/atlmfc/lib/
+    cp    "$VS_INSTALL_DIR/VC/atlmfc/lib/"*.* $DEVKIT_ROOT/VC/atlmfc/lib/
+    mkdir -p $DEVKIT_ROOT/VC/redist
+    cp -r "$VS_INSTALL_DIR/VC/redist/x64" $DEVKIT_ROOT/VC/redist/
+    cp -r "$VS_INSTALL_DIR/VC/redist/x86" $DEVKIT_ROOT/VC/redist/
+    # The redist runtime libs are needed to run the compiler but may not be
+    # installed on the machine where the devkit will be used.
+    cp $DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/
+    cp $DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/
+    cp $DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/amd64/
+    cp $DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/amd64/
+    # The msvcdis dll is needed to run some of the tools in VC/bin but is not
+    # shipped in that directory. Copy it from the common dir.
+    cp "$VS_INSTALL_DIR/Common7/IDE/msvcdis${VS_VERSION_NUM_NODOT}.dll" \
+        $DEVKIT_ROOT/VC/bin/
+fi
+
+################################################################################
+# Copy SDK files
+
+PROGRAMFILES_X86="`env | sed -n 's/^ProgramFiles(x86)=//p'`"
+SDK_INSTALL_DIR="$(cygpath "$PROGRAMFILES_X86/Windows Kits/$SDK_VERSION")"
+echo "SDK_INSTALL_DIR: $SDK_INSTALL_DIR"
+
+if [ ! -d $DEVKIT_ROOT/$SDK_VERSION ]; then
+    echo "Copying SDK..."
+    mkdir -p $DEVKIT_ROOT/$SDK_VERSION/bin
+    cp -r "$SDK_INSTALL_DIR/bin/x64" $DEVKIT_ROOT/$SDK_VERSION/bin/
+    cp -r "$SDK_INSTALL_DIR/bin/x86" $DEVKIT_ROOT/$SDK_VERSION/bin/
+    mkdir -p $DEVKIT_ROOT/$SDK_VERSION/lib
+    cp -r "$SDK_INSTALL_DIR/lib/"winv*/um/x64 $DEVKIT_ROOT/$SDK_VERSION/lib/
+    cp -r "$SDK_INSTALL_DIR/lib/"winv*/um/x86 $DEVKIT_ROOT/$SDK_VERSION/lib/
+    cp -r "$SDK_INSTALL_DIR/include" $DEVKIT_ROOT/$SDK_VERSION/
+    # In 2015, the new Universal CRT is delivered in the sdk 10 directory
+    # so need to include that as well.
+    mkdir -p $DEVKIT_ROOT/10/lib
+    cp -r "$SDK_INSTALL_DIR/../10/lib/10.0.10240.0/ucrt" $DEVKIT_ROOT/10/lib/
+    mkdir -p $DEVKIT_ROOT/10/include
+    cp -r "$SDK_INSTALL_DIR/../10/include/10.0.10240.0/ucrt" $DEVKIT_ROOT/10/include/
+fi
+
+################################################################################
+# Generate devkit.info
+
+echo-info() {
+    echo "$1" >> $DEVKIT_ROOT/devkit.info
+}
+
+echo "Generating devkit.info..."
+rm -f $DEVKIT_ROOT/devkit.info
+echo-info "# This file describes to configure how to interpret the contents of this devkit"
+echo-info "DEVKIT_NAME=\"Microsoft Visual Studio $VS_VERSION $VS_VERSION_SP (devkit)\""
+echo-info "DEVKIT_VS_VERSION=\"$VS_VERSION\""
+echo-info ""
+echo-info "DEVKIT_TOOLCHAIN_PATH_x86=\"\$DEVKIT_ROOT/VC/bin:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\""
+echo-info "DEVKIT_VS_INCLUDE_x86=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt;\$DEVKIT_ROOT/10/include/ucrt\""
+echo-info "DEVKIT_VS_LIB_x86=\"\$DEVKIT_ROOT/VC/lib;\$DEVKIT_ROOT/VC/atlmfc/lib;\$DEVKIT_ROOT/$SDK_VERSION/lib/x86;\$DEVKIT_ROOT/10/lib/ucrt/x86\""
+echo-info "DEVKIT_MSVCR_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL\""
+echo-info "DEVKIT_MSVCP_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL\""
+echo-info ""
+echo-info "DEVKIT_TOOLCHAIN_PATH_x86_64=\"\$DEVKIT_ROOT/VC/bin/amd64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\""
+echo-info "DEVKIT_VS_INCLUDE_x86_64=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt;\$DEVKIT_ROOT/10/include/ucrt\""
+echo-info "DEVKIT_VS_LIB_x86_64=\"\$DEVKIT_ROOT/VC/lib/amd64;\$DEVKIT_ROOT/VC/atlmfc/lib/amd64;\$DEVKIT_ROOT/$SDK_VERSION/lib/x64;\$DEVKIT_ROOT/10/lib/ucrt/x64\""
+echo-info "DEVKIT_MSVCR_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL\""
+echo-info "DEVKIT_MSVCP_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL\""
+
+################################################################################
+# Copy this script
+
+echo "Copying this script..."
+cp $0 $DEVKIT_ROOT/
+
+################################################################################
+# Create bundle
+
+echo "Creating bundle: $DEVKIT_BUNDLE"
+(cd "$DEVKIT_ROOT" && tar zcf "$DEVKIT_BUNDLE" .)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/devkit/createWindowsDevkit2017.sh	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,172 @@
+#!/bin/bash
+#
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# This script copies parts of a Visual Studio installation into a devkit
+# suitable for building OpenJDK and OracleJDK. Needs to run in Cygwin.
+# erik.joelsson@oracle.com
+
+VS_VERSION="2017"
+VS_VERSION_NUM_NODOT="150"
+VS_DLL_VERSION="140"
+SDK_VERSION="10"
+SDK_FULL_VERSION="10.0.16299.0"
+MSVC_DIR="Microsoft.VC141.CRT"
+
+SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)"
+BUILD_DIR="${SCRIPT_DIR}/../../build/devkit"
+
+################################################################################
+# Prepare settings
+
+# Work around the insanely named ProgramFiles(x86) env variable
+PROGRAMFILES_X86="$(cygpath "$(env | sed -n 's/^ProgramFiles(x86)=//p')")"
+
+# Find Visual Studio installation dir
+eval VSNNNCOMNTOOLS="\"\${VS${VS_VERSION_NUM_NODOT}COMNTOOLS}\""
+if [ -d "$VSNNNCOMNTOOLS" ]; then
+    VS_INSTALL_DIR="$(cygpath "$VSNNNCOMNTOOLS/../..")"
+else
+    VS_INSTALL_DIR="${PROGRAMFILES_X86}/Microsoft Visual Studio/2017"
+    VS_INSTALL_DIR="$(ls -d "${VS_INSTALL_DIR}/"{Community,Professional} 2>/dev/null | head -n1)"
+    VS_INSTALL_DIR="$(cygpath "$VS_INSTALL_DIR")"
+fi
+echo "VS_INSTALL_DIR: $VS_INSTALL_DIR"
+
+# Extract semantic version
+POTENTIAL_INI_FILES="Common7\IDE\wdexpress.isolation.ini Common7\IDE\devenv.isolation.ini"
+for f in $POTENTIAL_INI_FILES; do
+    if [ -f "$VS_INSTALL_DIR/$f" ]; then
+        VS_VERSION_SP="$(grep ^SemanticVersion= "$VS_INSTALL_DIR/$f")"
+        # Remove SemnaticVersion=
+        VS_VERSION_SP="${VS_VERSION_SP#*=}"
+        # Remove suffix of too detailed numbering starting with +
+        VS_VERSION_SP="${VS_VERSION_SP%+*}"
+        break
+    fi
+done
+if [ -z "$VS_VERSION_SP" ]; then
+    echo "Failed to find SP version"
+    exit 1
+fi
+echo "Found Version SP: $VS_VERSION_SP"
+
+# Setup output dirs
+DEVKIT_ROOT="${BUILD_DIR}/VS${VS_VERSION}-${VS_VERSION_SP}-devkit"
+DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz"
+
+echo "Creating devkit in $DEVKIT_ROOT"
+
+MSVCR_DLL=${MSVC_DIR}/vcruntime${VS_DLL_VERSION}.dll
+MSVCP_DLL=${MSVC_DIR}/msvcp${VS_DLL_VERSION}.dll
+
+################################################################################
+# Copy Visual Studio files
+
+if [ ! -d $DEVKIT_ROOT/VC ]; then
+    VC_SUBDIR="VC/Tools/MSVC/14.12.25827"
+    REDIST_SUBDIR="VC/Redist/MSVC/14.12.25810"
+    echo "Copying VC..."
+    mkdir -p $DEVKIT_ROOT/VC/bin
+    cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx64/x64" $DEVKIT_ROOT/VC/bin/
+    cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx86/x86" $DEVKIT_ROOT/VC/bin/
+    mkdir -p $DEVKIT_ROOT/VC/lib
+    cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/lib/x64" $DEVKIT_ROOT/VC/lib/
+    cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/lib/x86" $DEVKIT_ROOT/VC/lib/
+    cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/include" $DEVKIT_ROOT/VC/
+    mkdir -p $DEVKIT_ROOT/VC/atlmfc/lib
+    cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/lib/x64" $DEVKIT_ROOT/VC/atlmfc/lib/
+    cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/lib/x86" $DEVKIT_ROOT/VC/atlmfc/lib/
+    cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/include" $DEVKIT_ROOT/VC/atlmfc/
+    mkdir -p $DEVKIT_ROOT/VC/Auxiliary
+    cp -r "$VS_INSTALL_DIR/VC/Auxiliary/Build" $DEVKIT_ROOT/VC/Auxiliary/
+    mkdir -p $DEVKIT_ROOT/VC/redist
+    cp -r "$VS_INSTALL_DIR/$REDIST_SUBDIR/x64" $DEVKIT_ROOT/VC/redist/
+    cp -r "$VS_INSTALL_DIR/$REDIST_SUBDIR/x86" $DEVKIT_ROOT/VC/redist/
+
+    # The redist runtime libs are needed to run the compiler but may not be
+    # installed on the machine where the devkit will be used.
+    cp $DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/x86
+    cp $DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/x86
+    cp $DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/x64
+    cp $DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/x64
+fi
+
+################################################################################
+# Copy SDK files
+
+SDK_INSTALL_DIR="$(cygpath "$PROGRAMFILES_X86/Windows Kits/$SDK_VERSION")"
+echo "SDK_INSTALL_DIR: $SDK_INSTALL_DIR"
+
+if [ ! -d $DEVKIT_ROOT/$SDK_VERSION ]; then
+    echo "Copying SDK..."
+    mkdir -p $DEVKIT_ROOT/$SDK_VERSION/bin
+    cp -r "$SDK_INSTALL_DIR/bin/$SDK_FULL_VERSION/x64" $DEVKIT_ROOT/$SDK_VERSION/bin/
+    cp -r "$SDK_INSTALL_DIR/bin/$SDK_FULL_VERSION/x86" $DEVKIT_ROOT/$SDK_VERSION/bin/
+    mkdir -p $DEVKIT_ROOT/$SDK_VERSION/lib
+    cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/um/x64" $DEVKIT_ROOT/$SDK_VERSION/lib/
+    cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/um/x86" $DEVKIT_ROOT/$SDK_VERSION/lib/
+    cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/ucrt/x64" $DEVKIT_ROOT/$SDK_VERSION/lib/
+    cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/ucrt/x86" $DEVKIT_ROOT/$SDK_VERSION/lib/
+    mkdir -p $DEVKIT_ROOT/$SDK_VERSION/include
+    cp -r "$SDK_INSTALL_DIR/include/$SDK_FULL_VERSION/"* $DEVKIT_ROOT/$SDK_VERSION/include/
+fi
+
+################################################################################
+# Generate devkit.info
+
+echo-info() {
+    echo "$1" >> $DEVKIT_ROOT/devkit.info
+}
+
+echo "Generating devkit.info..."
+rm -f $DEVKIT_ROOT/devkit.info
+echo-info "# This file describes to configure how to interpret the contents of this devkit"
+echo-info "DEVKIT_NAME=\"Microsoft Visual Studio $VS_VERSION $VS_VERSION_SP (devkit)\""
+echo-info "DEVKIT_VS_VERSION=\"$VS_VERSION\""
+echo-info ""
+echo-info "DEVKIT_TOOLCHAIN_PATH_x86=\"\$DEVKIT_ROOT/VC/bin/x86:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\""
+echo-info "DEVKIT_VS_INCLUDE_x86=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/ucrt;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt\""
+echo-info "DEVKIT_VS_LIB_x86=\"\$DEVKIT_ROOT/VC/lib/x86;\$DEVKIT_ROOT/VC/atlmfc/lib/x86;\$DEVKIT_ROOT/$SDK_VERSION/lib/x86\""
+echo-info "DEVKIT_MSVCR_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL\""
+echo-info "DEVKIT_MSVCP_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL\""
+echo-info ""
+echo-info "DEVKIT_TOOLCHAIN_PATH_x86_64=\"\$DEVKIT_ROOT/VC/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\""
+echo-info "DEVKIT_VS_INCLUDE_x86_64=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/ucrt;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt\""
+echo-info "DEVKIT_VS_LIB_x86_64=\"\$DEVKIT_ROOT/VC/lib/x64;\$DEVKIT_ROOT/VC/atlmfc/lib/x64;\$DEVKIT_ROOT/$SDK_VERSION/lib/x64\""
+echo-info "DEVKIT_MSVCR_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL\""
+echo-info "DEVKIT_MSVCP_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL\""
+
+################################################################################
+# Copy this script
+
+echo "Copying this script..."
+cp $0 $DEVKIT_ROOT/
+
+################################################################################
+# Create bundle
+
+echo "Creating bundle: $DEVKIT_BUNDLE"
+(cd "$DEVKIT_ROOT" && tar zcf "$DEVKIT_BUNDLE" .)
--- a/make/idea/idea.gmk	Tue Jan 30 11:53:00 2018 +0530
+++ b/make/idea/idea.gmk	Tue Jan 30 09:03:47 2018 -0800
@@ -20,16 +20,9 @@
     SEL_MODULES := $(MODULES)
   endif
 
-  # Find all source dirs for a particular module
-  # $1 - Module to find source dirs for
-  FindIdeaModuleSrcDirs = \
-    $(strip $(addsuffix /$(strip $1), $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
-        $(wildcard $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
-
-
   idea:
 	$(ECHO) "SUPPORT=$(SUPPORT_OUTPUTDIR)" >> $(OUT)
-	$(ECHO) "MODULE_ROOTS=\"$(foreach mod, $(SEL_MODULES), $(call FindIdeaModuleSrcDirs,$(mod)))\"" >> $(OUT)
+	$(ECHO) "MODULE_ROOTS=\"$(foreach mod, $(SEL_MODULES), $(call FindModuleSrcDirs,$(mod)))\"" >> $(OUT)
 	$(ECHO) "MODULE_NAMES=\"$(strip $(foreach mod, $(SEL_MODULES), $(mod)))\"" >> $(OUT)
 	$(ECHO) "SEL_MODULES=\"$(SEL_MODULES)\"" >> $(OUT)
 	$(ECHO) "BOOT_JDK=\"$(BOOT_JDK)\"" >> $(OUT)
--- a/make/idea/template/ant.xml	Tue Jan 30 11:53:00 2018 +0530
+++ b/make/idea/template/ant.xml	Tue Jan 30 09:03:47 2018 -0800
@@ -3,7 +3,6 @@
   <component name="AntConfiguration">
     <buildFile url="file://$PROJECT_DIR$/.idea/build.xml">
       <properties>
-        <property name="boot.java.home" value="$JDKPath$" />
         <property name="intellij.ismake" value="$IsMake$" />
         <property name="build.target.dir" value="specDir" /> <!-- this will be replaced -->
         <property name="module.name" value="java.base" /> <!-- this will be replaced -->
--- a/make/idea/template/build.xml	Tue Jan 30 11:53:00 2018 +0530
+++ b/make/idea/template/build.xml	Tue Jan 30 09:03:47 2018 -0800
@@ -6,32 +6,16 @@
         new JdkLogger(project)
     </script>
 
-     <!-- java.marker is set to a marker file to check for within a Java install dir.
-         The best file to check for across Solaris/Linux/Windows/MacOS is one of the
-         executables; regrettably, that is OS-specific. -->
-    <condition property="java.marker" value="bin/java">
-        <os family="unix"/>
-    </condition>
-    <condition property="java.marker" value="bin/java.exe">
-        <os family="windows"/>
-    </condition>
-
-    <target name="-check-jtreg.home" depends="-def-check">
-        <check name="jtreg" property="jtreg.home" marker="lib/jtreg.jar"/>
-    </target>
-
-    <property name="test.dir" value="${basedir}/jdk/test"/>
-
     <macrodef name="call-make">
-            <attribute name="dir"/>
-            <attribute name="args"/>
-            <sequential>
-                <exec executable="make" dir="@{dir}" failonerror="true">
-                    <arg line="@{args}"/>
-                    <env key="CLASSPATH" value = ""/>
-                </exec>
-            </sequential>
-        </macrodef>
+        <attribute name="dir"/>
+        <attribute name="args"/>
+        <sequential>
+            <exec executable="make" dir="@{dir}" failonerror="true">
+                <arg line="@{args}"/>
+                <env key="CLASSPATH" value = ""/>
+            </exec>
+        </sequential>
+    </macrodef>
 
     <target name="cond-clean" unless="${intellij.ismake}">
         <antcall target="clean"/>
@@ -43,71 +27,17 @@
         **** Global JDK Build Targets
     -->
 
-    <target name="clean" depends="-do-configure">
-        <echo message="base = ${basedir}"/>
-        <call-make dir = "${build.target.dir}" args = "clean"/>
-    </target>
-
-    <target name="-do-configure">
+    <target name="clean">
         <echo message="base = ${basedir}"/>
-        <fail message="Not part of a full JDK forest">
-            <condition>
-                <not>
-                    <available file="${basedir}/configure" />
-                </not>
-            </condition>
-        </fail>
-        <exec executable="sh" dir="${basedir}" failonerror="true">
-            <arg line="configure --with-boot-jdk=${boot.java.home}"/>
-        </exec>
+        <call-make dir = "${build.target.dir}" args = "reconfigure"/>
+        <call-make dir = "${build.target.dir}" args = "clean"/>
     </target>
 
     <target name="images">
         <call-make dir = "${build.target.dir}" args = "images"/>
     </target>
 
-    <target name="jimages">
-        <call-make dir = "${build.target.dir}" args = "jimages"/>
-    </target>
-
-    <target name="check-env">
-        <exec executable="env" dir="${basedir}"/>
-    </target>
-
     <target name="build-module">
         <call-make dir = "${build.target.dir}" args = "${module.name}"/>
     </target>
-
-    <target name="-check-boot.java.home" depends="-def-check">
-        <check name="bootstrap java" property="boot.java.home" marker="${java.marker}"/>
-    </target>
-
-    <target name="-def-check">
-        <macrodef name="check">
-            <attribute name="name"/>
-            <attribute name="property"/>
-            <attribute name="marker" default=""/>
-            <sequential>
-                <fail message="Cannot locate @{name}: please set @{property} to its location">
-                    <condition>
-                        <not>
-                            <isset property="@{property}"/>
-                        </not>
-                    </condition>
-                </fail>
-                <fail message="@{name} is not installed in ${@{property}}">
-                    <condition>
-                        <and>
-                            <not>
-                                <equals arg1="@{marker}" arg2=""/>
-                            </not>
-                            <not>
-                                <available file="${@{property}}/@{marker}"/>
-                            </not>
-                        </and>
-                    </condition>
-                </fail>
-            </sequential>
-        </macrodef>
-    </target>
 </project>
--- a/make/idea/template/jdk.iml	Tue Jan 30 11:53:00 2018 +0530
+++ b/make/idea/template/jdk.iml	Tue Jan 30 09:03:47 2018 -0800
@@ -4,11 +4,9 @@
     <exclude-output />
     <content url="file://$MODULE_DIR$">
       <sourceFolder url="file://$MODULE_DIR$/####" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
-      <excludeFolder url="file://$MODULE_DIR$/src" />
       <excludeFolder url="file://$MODULE_DIR$/build" />
       <excludeFolder url="file://$MODULE_DIR$/make" />
-    </content>    
+    </content>
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="inheritedJdk" />
   </component>
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Tue Jan 30 09:03:47 2018 -0800
@@ -963,8 +963,12 @@
                                              RegisterOrConstant itable_index,
                                              Register method_result,
                                              Register scan_temp,
-                                             Label& L_no_such_interface) {
-  assert_different_registers(recv_klass, intf_klass, method_result, scan_temp);
+                                             Label& L_no_such_interface,
+                         bool return_method) {
+  assert_different_registers(recv_klass, intf_klass, scan_temp);
+  assert_different_registers(method_result, intf_klass, scan_temp);
+  assert(recv_klass != method_result || !return_method,
+     "recv_klass can be destroyed when method isn't needed");
   assert(itable_index.is_constant() || itable_index.as_register() == method_result,
          "caller must use same register for non-constant itable index as for method");
 
@@ -982,12 +986,14 @@
   lea(scan_temp, Address(recv_klass, scan_temp, Address::lsl(3)));
   add(scan_temp, scan_temp, vtable_base);
 
-  // Adjust recv_klass by scaled itable_index, so we can free itable_index.
-  assert(itableMethodEntry::size() * wordSize == wordSize, "adjust the scaling in the code below");
-  // lea(recv_klass, Address(recv_klass, itable_index, Address::times_ptr, itentry_off));
-  lea(recv_klass, Address(recv_klass, itable_index, Address::lsl(3)));
-  if (itentry_off)
-    add(recv_klass, recv_klass, itentry_off);
+  if (return_method) {
+    // Adjust recv_klass by scaled itable_index, so we can free itable_index.
+    assert(itableMethodEntry::size() * wordSize == wordSize, "adjust the scaling in the code below");
+    // lea(recv_klass, Address(recv_klass, itable_index, Address::times_ptr, itentry_off));
+    lea(recv_klass, Address(recv_klass, itable_index, Address::lsl(3)));
+    if (itentry_off)
+      add(recv_klass, recv_klass, itentry_off);
+  }
 
   // for (scan = klass->itable(); scan->interface() != NULL; scan += scan_step) {
   //   if (scan->interface() == intf) {
@@ -1021,8 +1027,10 @@
   bind(found_method);
 
   // Got a hit.
-  ldr(scan_temp, Address(scan_temp, itableOffsetEntry::offset_offset_in_bytes()));
-  ldr(method_result, Address(recv_klass, scan_temp));
+  if (return_method) {
+    ldrw(scan_temp, Address(scan_temp, itableOffsetEntry::offset_offset_in_bytes()));
+    ldr(method_result, Address(recv_klass, scan_temp, Address::uxtw(0)));
+  }
 }
 
 // virtual method calling
@@ -1041,7 +1049,8 @@
     ldr(method_result, Address(method_result, vtable_offset_in_bytes));
   } else {
     vtable_offset_in_bytes += vtable_index.as_constant() * wordSize;
-    ldr(method_result, Address(recv_klass, vtable_offset_in_bytes));
+    ldr(method_result,
+        form_address(rscratch1, recv_klass, vtable_offset_in_bytes, 0));
   }
 }
 
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp	Tue Jan 30 09:03:47 2018 -0800
@@ -875,7 +875,8 @@
                                RegisterOrConstant itable_index,
                                Register method_result,
                                Register scan_temp,
-                               Label& no_such_interface);
+                               Label& no_such_interface,
+                   bool return_method = true);
 
   // virtual method calling
   // n.b. x86 allows RegisterOrConstant for vtable_index
--- a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp	Tue Jan 30 09:03:47 2018 -0800
@@ -3279,11 +3279,11 @@
   transition(vtos, vtos);
   assert(byte_no == f1_byte, "use this argument");
 
-  prepare_invoke(byte_no, r0, rmethod,  // get f1 Klass*, f2 itable index
+  prepare_invoke(byte_no, r0, rmethod,  // get f1 Klass*, f2 Method*
                  r2, r3); // recv, flags
 
   // r0: interface klass (from f1)
-  // rmethod: itable index (from f2)
+  // rmethod: method (from f2)
   // r2: receiver
   // r3: flags
 
@@ -3302,10 +3302,27 @@
   __ null_check(r2, oopDesc::klass_offset_in_bytes());
   __ load_klass(r3, r2);
 
+  Label no_such_interface, no_such_method;
+
+  // Receiver subtype check against REFC.
+  // Superklass in r0. Subklass in r3. Blows rscratch2, r13
+  __ lookup_interface_method(// inputs: rec. class, interface, itable index
+                             r3, r0, noreg,
+                             // outputs: scan temp. reg, scan temp. reg
+                             rscratch2, r13,
+                             no_such_interface,
+                             /*return_method=*/false);
+
   // profile this call
   __ profile_virtual_call(r3, r13, r19);
 
-  Label no_such_interface, no_such_method;
+  // Get declaring interface class from method, and itable index
+  __ ldr(r0, Address(rmethod, Method::const_offset()));
+  __ ldr(r0, Address(r0, ConstMethod::constants_offset()));
+  __ ldr(r0, Address(r0, ConstantPool::pool_holder_offset_in_bytes()));
+  __ ldrw(rmethod, Address(rmethod, Method::itable_index_offset()));
+  __ subw(rmethod, rmethod, Method::itable_index_max);
+  __ negw(rmethod, rmethod);
 
   __ lookup_interface_method(// inputs: rec. class, interface, itable index
                              r3, r0, rmethod,
--- a/src/hotspot/cpu/aarch64/vtableStubs_aarch64.cpp	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/hotspot/cpu/aarch64/vtableStubs_aarch64.cpp	Tue Jan 30 09:03:47 2018 -0800
@@ -29,6 +29,7 @@
 #include "code/vtableStubs.hpp"
 #include "interp_masm_aarch64.hpp"
 #include "memory/resourceArea.hpp"
+#include "oops/compiledICHolder.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/klassVtable.hpp"
 #include "runtime/sharedRuntime.hpp"
@@ -62,8 +63,8 @@
 
 #ifndef PRODUCT
   if (CountCompiledCalls) {
-    __ lea(r19, ExternalAddress((address) SharedRuntime::nof_megamorphic_calls_addr()));
-    __ incrementw(Address(r19));
+    __ lea(r16, ExternalAddress((address) SharedRuntime::nof_megamorphic_calls_addr()));
+    __ incrementw(Address(r16));
   }
 #endif
 
@@ -72,13 +73,13 @@
 
   // get receiver klass
   address npe_addr = __ pc();
-  __ load_klass(r19, j_rarg0);
+  __ load_klass(r16, j_rarg0);
 
 #ifndef PRODUCT
   if (DebugVtables) {
     Label L;
     // check offset vs vtable length
-    __ ldrw(rscratch1, Address(r19, Klass::vtable_length_offset()));
+    __ ldrw(rscratch1, Address(r16, Klass::vtable_length_offset()));
     __ cmpw(rscratch1, vtable_index * vtableEntry::size());
     __ br(Assembler::GT, L);
     __ enter();
@@ -90,7 +91,7 @@
   }
 #endif // PRODUCT
 
-  __ lookup_virtual_method(r19, vtable_index, rmethod);
+  __ lookup_virtual_method(r16, vtable_index, rmethod);
 
   if (DebugVtables) {
     Label L;
@@ -140,28 +141,44 @@
 #endif
 
   // Entry arguments:
-  //  rscratch2: Interface
+  //  rscratch2: CompiledICHolder
   //  j_rarg0: Receiver
 
-  // Free registers (non-args) are r0 (interface), rmethod
+
+  // Most registers are in use; we'll use r16, rmethod, r10, r11
+  const Register recv_klass_reg     = r10;
+  const Register holder_klass_reg   = r16; // declaring interface klass (DECC)
+  const Register resolved_klass_reg = rmethod; // resolved interface klass (REFC)
+  const Register temp_reg           = r11;
+  const Register icholder_reg       = rscratch2;
+
+  Label L_no_such_interface;
+
+  __ ldr(resolved_klass_reg, Address(icholder_reg, CompiledICHolder::holder_klass_offset()));
+  __ ldr(holder_klass_reg,   Address(icholder_reg, CompiledICHolder::holder_metadata_offset()));
 
   // get receiver (need to skip return address on top of stack)
-
   assert(VtableStub::receiver_location() == j_rarg0->as_VMReg(), "receiver expected in j_rarg0");
   // get receiver klass (also an implicit null-check)
   address npe_addr = __ pc();
-
-  // Most registers are in use; we'll use r0, rmethod, r10, r11
-  __ load_klass(r10, j_rarg0);
-
-  Label throw_icce;
+  __ load_klass(recv_klass_reg, j_rarg0);
 
-  // Get Method* and entrypoint for compiler
+  // Receiver subtype check against REFC.
+  // Destroys recv_klass_reg value.
+  __ lookup_interface_method(// inputs: rec. class, interface
+                             recv_klass_reg, resolved_klass_reg, noreg,
+                             // outputs:  scan temp. reg1, scan temp. reg2
+                             recv_klass_reg, temp_reg,
+                             L_no_such_interface,
+                             /*return_method=*/false);
+
+  // Get selected method from declaring class and itable index
+  __ load_klass(recv_klass_reg, j_rarg0);   // restore recv_klass_reg
   __ lookup_interface_method(// inputs: rec. class, interface, itable index
-                             r10, rscratch2, itable_index,
-                             // outputs: method, scan temp. reg
-                             rmethod, r11,
-                             throw_icce);
+                       recv_klass_reg, holder_klass_reg, itable_index,
+                       // outputs: method, scan temp. reg
+                       rmethod, temp_reg,
+                       L_no_such_interface);
 
   // method (rmethod): Method*
   // j_rarg0: receiver
@@ -183,7 +200,7 @@
   __ ldr(rscratch1, Address(rmethod, Method::from_compiled_offset()));
   __ br(rscratch1);
 
-  __ bind(throw_icce);
+  __ bind(L_no_such_interface);
   __ far_jump(RuntimeAddress(StubRoutines::throw_IncompatibleClassChangeError_entry()));
 
   __ flush();
@@ -205,11 +222,11 @@
   int size = DebugVtables ? 216 : 0;
   if (CountCompiledCalls)
     size += 6 * 4;
-  // FIXME
+  // FIXME: vtable stubs only need 36 bytes
   if (is_vtable_stub)
     size += 52;
   else
-    size += 104;
+    size += 176;
   return size;
 
   // In order to tune these parameters, run the JVM with VM options
@@ -217,33 +234,58 @@
   // actual itable stubs.  Run it with -Xmx31G -XX:+UseCompressedOops.
   //
   // If Universe::narrow_klass_base is nonzero, decoding a compressed
-  // class can take zeveral instructions.  Run it with -Xmx31G
-  // -XX:+UseCompressedOops.
+  // class can take zeveral instructions.
   //
   // The JVM98 app. _202_jess has a megamorphic interface call.
   // The itable code looks like this:
-  // Decoding VtableStub itbl[1]@12
-  //     ldr     w10, [x1,#8]
-  //     lsl     x10, x10, #3
-  //     ldr     w11, [x10,#280]
-  //     add     x11, x10, x11, uxtx #3
-  //     add     x11, x11, #0x1b8
-  //     ldr     x12, [x11]
-  //     cmp     x9, x12
-  //     b.eq    success
-  // loop:
-  //     cbz     x12, throw_icce
-  //     add     x11, x11, #0x10
-  //     ldr     x12, [x11]
-  //     cmp     x9, x12
-  //     b.ne    loop
-  // success:
-  //     ldr     x11, [x11,#8]
-  //     ldr     x12, [x10,x11]
-  //     ldr     x8, [x12,#72]
-  //     br      x8
-  // throw_icce:
-  //     b      throw_ICCE_entry
+
+  //    ldr    xmethod, [xscratch2,#CompiledICHolder::holder_klass_offset]
+  //    ldr    x0, [xscratch2]
+  //    ldr    w10, [x1,#oopDesc::klass_offset_in_bytes]
+  //    mov    xheapbase, #0x3c000000                //   #narrow_klass_base
+  //    movk    xheapbase, #0x3f7, lsl #32
+  //    add    x10, xheapbase, x10
+  //    mov    xheapbase, #0xe7ff0000                //   #heapbase
+  //    movk    xheapbase, #0x3f7, lsl #32
+  //    ldr    w11, [x10,#vtable_length_offset]
+  //    add    x11, x10, x11, uxtx #3
+  //    add    x11, x11, #itableMethodEntry::method_offset_in_bytes
+  //    ldr    x10, [x11]
+  //    cmp    xmethod, x10
+  //    b.eq    found_method
+  // search:
+  //    cbz    x10, no_such_interface
+  //    add    x11, x11, #0x10
+  //    ldr    x10, [x11]
+  //    cmp    xmethod, x10
+  //    b.ne    search
+  // found_method:
+  //    ldr    w10, [x1,#oopDesc::klass_offset_in_bytes]
+  //    mov    xheapbase, #0x3c000000                //   #narrow_klass_base
+  //    movk    xheapbase, #0x3f7, lsl #32
+  //    add    x10, xheapbase, x10
+  //    mov    xheapbase, #0xe7ff0000                //   #heapbase
+  //    movk    xheapbase, #0x3f7, lsl #32
+  //    ldr    w11, [x10,#vtable_length_offset]
+  //    add    x11, x10, x11, uxtx #3
+  //    add    x11, x11, #itableMethodEntry::method_offset_in_bytes
+  //    add    x10, x10, #itentry_off
+  //    ldr    xmethod, [x11]
+  //    cmp    x0, xmethod
+  //    b.eq    found_method2
+  // search2:
+  //    cbz    xmethod, 0x000003ffa872e6cc
+  //    add    x11, x11, #0x10
+  //    ldr    xmethod, [x11]
+  //    cmp    x0, xmethod
+  //    b.ne    search2
+  // found_method2:
+  //    ldr    w11, [x11,#itableOffsetEntry::offset_offset_in_bytes]
+  //    ldr    xmethod, [x10,w11,uxtw]
+  //    ldr    xscratch1, [xmethod,#Method::from_compiled_offset]
+  //    br    xscratch1
+  // no_such_interface:
+  //    b      throw_ICCE_entry
 
 }
 
--- a/src/java.base/share/classes/java/lang/ClassLoader.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.base/share/classes/java/lang/ClassLoader.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1876,14 +1876,15 @@
      * value until the system is fully initialized.
      *
      * <p> The name of the built-in system class loader is {@code "app"}.
-     * The class path used by the built-in system class loader is determined
-     * by the system property "{@code java.class.path}" during early
-     * initialization of the VM. If the system property is not defined,
-     * or its value is an empty string, then there is no class path
-     * when the initial module is a module on the application module path,
-     * i.e. <em>a named module</em>. If the initial module is not on
-     * the application module path then the class path defaults to
-     * the current working directory.
+     * The system property "{@code java.class.path}" is read during early
+     * initialization of the VM to determine the class path.
+     * An empty value of "{@code java.class.path}" property is interpreted
+     * differently depending on whether the initial module (the module
+     * containing the main class) is named or unnamed:
+     * If named, the built-in system class loader will have no class path and
+     * will search for classes and resources using the application module path;
+     * otherwise, if unnamed, it will set the class path to the current
+     * working directory.
      *
      * @return  The system {@code ClassLoader}
      *
--- a/src/java.base/share/classes/java/lang/System.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.base/share/classes/java/lang/System.java	Tue Jan 30 09:03:47 2018 -0800
@@ -631,7 +631,8 @@
      * <tr><th scope="row"><code>java.class.version</code></th>
      *     <td>Java class format version number</td></tr>
      * <tr><th scope="row"><code>java.class.path</code></th>
-     *     <td>Java class path</td></tr>
+     *     <td>Java class path  (refer to
+     *        {@link ClassLoader#getSystemClassLoader()} for details)</td></tr>
      * <tr><th scope="row"><code>java.library.path</code></th>
      *     <td>List of paths to search when loading libraries</td></tr>
      * <tr><th scope="row"><code>java.io.tmpdir</code></th>
--- a/src/java.base/share/classes/java/lang/VersionProps.java.template	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.base/share/classes/java/lang/VersionProps.java.template	Tue Jan 30 09:03:47 2018 -0800
@@ -166,15 +166,8 @@
      * Print version info.
      */
     private static void print(boolean err, boolean newln) {
-        boolean isHeadless = false;
         PrintStream ps = err ? System.err : System.out;
 
-        /* Report that we're running headless if the property is true */
-        String headless = System.getProperty("java.awt.headless");
-        if ( (headless != null) && (headless.equalsIgnoreCase("true")) ) {
-            isHeadless = true;
-        }
-
         /* First line: platform version. */
         if (err) {
             ps.println(launcher_name + " version \"" + java_version + "\""
--- a/src/java.base/share/classes/java/net/Inet6Address.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.base/share/classes/java/net/Inet6Address.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -595,7 +595,7 @@
         }
 
         ObjectInputStream.GetField gf = s.readFields();
-        byte[] ipaddress = (byte[])gf.get("ipaddress", null);
+        byte[] ipaddress = (byte[])gf.get("ipaddress", new byte[0]);
         int scope_id = gf.get("scope_id", -1);
         boolean scope_id_set = gf.get("scope_id_set", false);
         boolean scope_ifname_set = gf.get("scope_ifname_set", false);
--- a/src/java.base/share/classes/java/text/DateFormatSymbols.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.base/share/classes/java/text/DateFormatSymbols.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -394,6 +394,12 @@
 
     /**
      * Gets month strings. For example: "January", "February", etc.
+     * An array with either 12 or 13 elements will be returned depending
+     * on whether or not {@link java.util.Calendar#UNDECIMBER Calendar.UNDECIMBER}
+     * is supported. Use
+     * {@link java.util.Calendar#JANUARY Calendar.JANUARY},
+     * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY},
+     * etc. to index the result array.
      *
      * <p>If the language requires different forms for formatting and
      * stand-alone usages, this method returns month names in the
@@ -405,10 +411,9 @@
      * Calendar Elements in the Unicode Locale Data Markup Language
      * (LDML) specification</a> for more details.
      *
-     * @return the month strings. Use
-     * {@link java.util.Calendar#JANUARY Calendar.JANUARY},
-     * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY},
-     * etc. to index the result array.
+     * @implSpec This method returns 13 elements since
+     * {@link java.util.Calendar#UNDECIMBER Calendar.UNDECIMBER} is supported.
+     * @return the month strings.
      */
     public String[] getMonths() {
         return Arrays.copyOf(months, months.length);
@@ -427,6 +432,12 @@
 
     /**
      * Gets short month strings. For example: "Jan", "Feb", etc.
+     * An array with either 12 or 13 elements will be returned depending
+     * on whether or not {@link java.util.Calendar#UNDECIMBER Calendar.UNDECIMBER}
+     * is supported. Use
+     * {@link java.util.Calendar#JANUARY Calendar.JANUARY},
+     * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY},
+     * etc. to index the result array.
      *
      * <p>If the language requires different forms for formatting and
      * stand-alone usages, this method returns short month names in
@@ -438,10 +449,9 @@
      * Calendar Elements in the Unicode Locale Data Markup Language
      * (LDML) specification</a> for more details.
      *
-     * @return the short month strings. Use
-     * {@link java.util.Calendar#JANUARY Calendar.JANUARY},
-     * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY},
-     * etc. to index the result array.
+     * @implSpec This method returns 13 elements since
+     * {@link java.util.Calendar#UNDECIMBER Calendar.UNDECIMBER} is supported.
+     * @return the short month strings.
      */
     public String[] getShortMonths() {
         return Arrays.copyOf(shortMonths, shortMonths.length);
--- a/src/java.base/share/classes/java/time/temporal/IsoFields.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.base/share/classes/java/time/temporal/IsoFields.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -708,9 +708,8 @@
                     return (R) temporal.with(WEEK_BASED_YEAR,
                             Math.addExact(temporal.get(WEEK_BASED_YEAR), amount));
                 case QUARTER_YEARS:
-                    // no overflow (256 is multiple of 4)
-                    return (R) temporal.plus(amount / 256, YEARS)
-                            .plus((amount % 256) * 3, MONTHS);
+                    return (R) temporal.plus(amount / 4, YEARS)
+                            .plus((amount % 4) * 3, MONTHS);
                 default:
                     throw new IllegalStateException("Unreachable");
             }
--- a/src/java.logging/share/classes/java/util/logging/LogManager.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.logging/share/classes/java/util/logging/LogManager.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -396,12 +396,6 @@
                         // Create and retain Logger for the root of the namespace.
                         owner.addLogger(root);
 
-                        // For backward compatibility: add any handlers configured using
-                        // ".handlers"
-                        owner.createLoggerHandlers("", ".handlers")
-                                .stream()
-                                .forEach(root::addHandler);
-
                         // Initialize level if not yet initialized
                         if (!root.isLevelInitialized()) {
                             root.setLevel(defaultLevel);
@@ -995,7 +989,8 @@
         }
     }
 
-    private List<Handler> createLoggerHandlers(final String name, final String handlersPropertyName)
+    private List<Handler> createLoggerHandlers(final String name,
+                                               final String handlersPropertyName)
     {
         String names[] = parseClassNames(handlersPropertyName);
         List<Handler> handlers = new ArrayList<>(names.length);
@@ -1198,7 +1193,7 @@
         }
         drainLoggerRefQueueBounded();
         LoggerContext cx = getUserContext();
-        if (cx.addLocalLogger(logger)) {
+        if (cx.addLocalLogger(logger) || forceLoadHandlers(logger)) {
             // Do we have a per logger handler too?
             // Note: this will add a 200ms penalty
             loadLoggerHandlers(logger, name, name + ".handlers");
@@ -1208,6 +1203,26 @@
         }
     }
 
+
+    // Checks whether the given logger is a special logger
+    // that still requires handler initialization.
+    // This method will only return true for the root and
+    // global loggers and only if called by the thread that
+    // performs initialization of the LogManager, during that
+    // initialization. Must only be called by addLogger.
+    @SuppressWarnings("deprecation")
+    private boolean forceLoadHandlers(Logger logger) {
+        // Called just after reading the primordial configuration, in
+        // the same thread that reads it.
+        // The root and global logger would already be present in the context
+        // by this point, but we would not have called loadLoggerHandlers
+        // yet.
+        return (logger == rootLogger ||  logger == Logger.global)
+                && !initializationDone
+                && initializedCalled
+                && configurationLock.isHeldByCurrentThread();
+    }
+
     // Private method to set a level on a logger.
     // If necessary, we raise privilege before doing the call.
     private static void doSetLevel(final Logger logger, final Level level) {
--- a/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KeyImpl.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KeyImpl.java	Tue Jan 30 09:03:47 2018 -0800
@@ -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
@@ -138,6 +138,12 @@
         case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96:
             return "aes256-cts-hmac-sha1-96";
 
+        case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA256_128:
+            return "aes128-cts-hmac-sha256-128";
+
+        case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA384_192:
+            return "aes256-cts-hmac-sha384-192";
+
         case EncryptedData.ETYPE_NULL:
             return "none";
 
--- a/src/java.security.jgss/share/classes/sun/security/jgss/krb5/CipherHelper.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.security.jgss/share/classes/sun/security/jgss/krb5/CipherHelper.java	Tue Jan 30 09:03:47 2018 -0800
@@ -40,6 +40,8 @@
 import java.security.GeneralSecurityException;
 import java.security.NoSuchAlgorithmException;
 import sun.security.krb5.*;
+import sun.security.krb5.internal.crypto.Aes128Sha2;
+import sun.security.krb5.internal.crypto.Aes256Sha2;
 import sun.security.krb5.internal.crypto.Des3;
 import sun.security.krb5.internal.crypto.Aes128;
 import sun.security.krb5.internal.crypto.Aes256;
@@ -101,6 +103,8 @@
 
         case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96:
         case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96:
+        case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA256_128:
+        case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA384_192:
             sgnAlg = -1;
             sealAlg = -1;
             break;
@@ -365,6 +369,33 @@
                 throw ge;
             }
 
+        case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA256_128:
+            try {
+                byte[] answer = Aes128Sha2.calculateChecksum(keybytes, key_usage,
+                        buf, 0, total);
+                return answer;
+            } catch (GeneralSecurityException e) {
+                GSSException ge = new GSSException(GSSException.FAILURE, -1,
+                        "Could not use AES128 signing algorithm - " +
+                                e.getMessage());
+                ge.initCause(e);
+                throw ge;
+            }
+
+        case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA384_192:
+            try {
+                byte[] answer = Aes256Sha2.calculateChecksum(keybytes, key_usage,
+                        buf, 0, total);
+                return answer;
+            } catch (GeneralSecurityException e) {
+                GSSException ge = new GSSException(GSSException.FAILURE, -1,
+                        "Could not use AES256 signing algorithm - " +
+                                e.getMessage());
+                ge.initCause(e);
+                throw ge;
+            }
+
+
         default:
             throw new GSSException(GSSException.FAILURE, -1,
                 "Unsupported encryption type: " + etype);
@@ -517,6 +548,11 @@
         case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96:
             return Aes256.getChecksumLength();
 
+        case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA256_128:
+            return Aes128Sha2.getChecksumLength();
+        case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA384_192:
+            return Aes256Sha2.getChecksumLength();
+
         case EncryptedData.ETYPE_ARCFOUR_HMAC:
             // only first 8 octets of HMAC Sgn_Cksum are used
             return HMAC_CHECKSUM_SIZE;
@@ -574,6 +610,14 @@
                     aes256Decrypt(token, ciphertext, cStart, cLen,
                                 plaintext, pStart, key_usage);
                     break;
+            case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA256_128:
+                    aes128Sha2Decrypt(token, ciphertext, cStart, cLen,
+                            plaintext, pStart, key_usage);
+                    break;
+            case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA384_192:
+                    aes256Sha2Decrypt(token, ciphertext, cStart, cLen,
+                            plaintext, pStart, key_usage);
+                    break;
             default:
                     throw new GSSException(GSSException.FAILURE, -1,
                         "Unsupported etype: " + etype);
@@ -654,6 +698,14 @@
                     aes256Decrypt(token, ciphertext, 0, cLen,
                                 plaintext, pStart, key_usage);
                     break;
+            case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA256_128:
+                    aes128Sha2Decrypt(token, ciphertext, 0, cLen,
+                            plaintext, pStart, key_usage);
+                    break;
+            case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA384_192:
+                    aes256Sha2Decrypt(token, ciphertext, 0, cLen,
+                            plaintext, pStart, key_usage);
+                    break;
             default:
                     throw new GSSException(GSSException.FAILURE, -1,
                         "Unsupported etype: " + etype);
@@ -720,6 +772,12 @@
             case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96:
                 return aes256Encrypt(confounder, tokenHeader,
                             plaintext, start, len, key_usage);
+            case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA256_128:
+                return aes128Sha2Encrypt(confounder, tokenHeader,
+                        plaintext, start, len, key_usage);
+            case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA384_192:
+                return aes256Sha2Encrypt(confounder, tokenHeader,
+                        plaintext, start, len, key_usage);
             default:
                 throw new GSSException(GSSException.FAILURE, -1,
                     "Unsupported etype: " + etype);
@@ -796,6 +854,14 @@
                     ctext = aes256Encrypt(confounder, tokenHeader,
                                 plaintext, pStart, pLen, key_usage);
                     break;
+            case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA256_128:
+                    ctext = aes128Sha2Encrypt(confounder, tokenHeader,
+                            plaintext, pStart, pLen, key_usage);
+                    break;
+            case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA384_192:
+                    ctext = aes256Sha2Encrypt(confounder, tokenHeader,
+                            plaintext, pStart, pLen, key_usage);
+                    break;
             default:
                     throw new GSSException(GSSException.FAILURE, -1,
                         "Unsupported etype: " + etype);
@@ -1317,6 +1383,38 @@
         }
     }
 
+    private byte[] aes128Sha2Encrypt(byte[] confounder, byte[] tokenHeader,
+            byte[] plaintext, int start, int len, int key_usage)
+            throws GSSException {
+
+        // encrypt { AES-plaintext-data | filler | header }
+        // AES-plaintext-data { confounder | plaintext }
+        // WrapToken = { tokenHeader |
+        //      Encrypt (confounder | plaintext | tokenHeader ) | HMAC }
+
+        byte[] all = new byte[confounder.length + len + tokenHeader.length];
+        System.arraycopy(confounder, 0, all, 0, confounder.length);
+        System.arraycopy(plaintext, start, all, confounder.length, len);
+        System.arraycopy(tokenHeader, 0, all, confounder.length+len,
+                tokenHeader.length);
+
+        // Krb5Token.debug("\naes128Sha2Encrypt:" + Krb5Token.getHexBytes(all));
+        try {
+            byte[] answer = Aes128Sha2.encryptRaw(keybytes, key_usage,
+                    ZERO_IV_AES,
+                    all, 0, all.length);
+            // Krb5Token.debug("\naes128Sha2Encrypt encrypted:" +
+            //                  Krb5Token.getHexBytes(answer));
+            return answer;
+        } catch (Exception e) {
+            // GeneralSecurityException, KrbCryptoException
+            GSSException ge = new GSSException(GSSException.FAILURE, -1,
+                    "Could not use Aes128Sha2 Cipher - " + e.getMessage());
+            ge.initCause(e);
+            throw ge;
+        }
+    }
+
     private void aes128Decrypt(WrapToken_v2 token, byte[] ciphertext,
         int cStart, int cLen, byte[] plaintext, int pStart, int key_usage)
         throws GSSException {
@@ -1354,6 +1452,43 @@
         */
     }
 
+    private void aes128Sha2Decrypt(WrapToken_v2 token, byte[] ciphertext,
+            int cStart, int cLen, byte[] plaintext, int pStart, int key_usage)
+            throws GSSException {
+
+        byte[] ptext = null;
+
+        try {
+            ptext = Aes128Sha2.decryptRaw(keybytes, key_usage,
+                    ZERO_IV_AES, ciphertext, cStart, cLen);
+        } catch (GeneralSecurityException e) {
+            GSSException ge = new GSSException(GSSException.FAILURE, -1,
+                    "Could not use AES128Sha2 Cipher - " + e.getMessage());
+            ge.initCause(e);
+            throw ge;
+        }
+
+        /*
+        Krb5Token.debug("\naes128Sha2Decrypt in: " +
+            Krb5Token.getHexBytes(ciphertext, cStart, cLen));
+        Krb5Token.debug("\naes128Sha2Decrypt plain: " +
+            Krb5Token.getHexBytes(ptext));
+        Krb5Token.debug("\naes128Sha2Decrypt ptext: " +
+            Krb5Token.getHexBytes(ptext));
+        */
+
+        // Strip out confounder and token header
+        int len = ptext.length - WrapToken_v2.CONFOUNDER_SIZE -
+                WrapToken_v2.TOKEN_HEADER_SIZE;
+        System.arraycopy(ptext, WrapToken_v2.CONFOUNDER_SIZE,
+                plaintext, pStart, len);
+
+        /*
+        Krb5Token.debug("\naes128Sha2Decrypt plaintext: " +
+            Krb5Token.getHexBytes(plaintext, pStart, len));
+        */
+    }
+
     private byte[] aes256Encrypt(byte[] confounder, byte[] tokenHeader,
         byte[] plaintext, int start, int len, int key_usage)
         throws GSSException {
@@ -1386,6 +1521,38 @@
         }
     }
 
+    private byte[] aes256Sha2Encrypt(byte[] confounder, byte[] tokenHeader,
+            byte[] plaintext, int start, int len, int key_usage)
+            throws GSSException {
+
+        // encrypt { AES-plaintext-data | filler | header }
+        // AES-plaintext-data { confounder | plaintext }
+        // WrapToken = { tokenHeader |
+        //       Encrypt (confounder | plaintext | tokenHeader ) | HMAC }
+
+        byte[] all = new byte[confounder.length + len + tokenHeader.length];
+        System.arraycopy(confounder, 0, all, 0, confounder.length);
+        System.arraycopy(plaintext, start, all, confounder.length, len);
+        System.arraycopy(tokenHeader, 0, all, confounder.length+len,
+                tokenHeader.length);
+
+        // Krb5Token.debug("\naes256Sha2Encrypt:" + Krb5Token.getHexBytes(all));
+
+        try {
+            byte[] answer = Aes256Sha2.encryptRaw(keybytes, key_usage,
+                    ZERO_IV_AES, all, 0, all.length);
+            // Krb5Token.debug("\naes256Sha2Encrypt encrypted:" +
+            //  Krb5Token.getHexBytes(answer));
+            return answer;
+        } catch (Exception e) {
+            // GeneralSecurityException, KrbCryptoException
+            GSSException ge = new GSSException(GSSException.FAILURE, -1,
+                    "Could not use Aes256Sha2 Cipher - " + e.getMessage());
+            ge.initCause(e);
+            throw ge;
+        }
+    }
+
     private void aes256Decrypt(WrapToken_v2 token, byte[] ciphertext,
         int cStart, int cLen, byte[] plaintext, int pStart, int key_usage)
         throws GSSException {
@@ -1423,6 +1590,43 @@
 
     }
 
+    private void aes256Sha2Decrypt(WrapToken_v2 token, byte[] ciphertext,
+            int cStart, int cLen, byte[] plaintext, int pStart, int key_usage)
+            throws GSSException {
+
+        byte[] ptext;
+        try {
+            ptext = Aes256Sha2.decryptRaw(keybytes, key_usage,
+                    ZERO_IV_AES, ciphertext, cStart, cLen);
+        } catch (GeneralSecurityException e) {
+            GSSException ge = new GSSException(GSSException.FAILURE, -1,
+                    "Could not use AES256Sha2 Cipher - " + e.getMessage());
+            ge.initCause(e);
+            throw ge;
+        }
+
+        /*
+        Krb5Token.debug("\naes256Sha2Decrypt in: " +
+            Krb5Token.getHexBytes(ciphertext, cStart, cLen));
+        Krb5Token.debug("\naes256Sha2Decrypt plain: " +
+            Krb5Token.getHexBytes(ptext));
+        Krb5Token.debug("\naes256Sha2Decrypt ptext: " +
+            Krb5Token.getHexBytes(ptext));
+        */
+
+        // Strip out confounder and token header
+        int len = ptext.length - WrapToken_v2.CONFOUNDER_SIZE -
+                WrapToken_v2.TOKEN_HEADER_SIZE;
+        System.arraycopy(ptext, WrapToken_v2.CONFOUNDER_SIZE,
+                plaintext, pStart, len);
+
+        /*
+        Krb5Token.debug("\naes256Sha2Decrypt plaintext: " +
+            Krb5Token.getHexBytes(plaintext, pStart, len));
+        */
+
+    }
+
     /**
      * This class provides a truncated inputstream needed by WrapToken. The
      * truncated inputstream is passed to CipherInputStream. It prevents
--- a/src/java.security.jgss/share/classes/sun/security/krb5/Checksum.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/Checksum.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, 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,6 +66,10 @@
     public static final int CKSUMTYPE_HMAC_SHA1_96_AES128 = 15;        // 96
     public static final int CKSUMTYPE_HMAC_SHA1_96_AES256 = 16;        // 96
 
+    // rfc8009
+    public static final int CKSUMTYPE_HMAC_SHA256_128_AES128 = 19;        // 96
+    public static final int CKSUMTYPE_HMAC_SHA384_192_AES256 = 20;        // 96
+
     // draft-brezak-win2k-krb-rc4-hmac-04.txt
     public static final int CKSUMTYPE_HMAC_MD5_ARCFOUR = -138;
 
--- a/src/java.security.jgss/share/classes/sun/security/krb5/Config.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/Config.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -578,7 +578,8 @@
                             if (Files.isDirectory(p)) continue;
                             String name = p.getFileName().toString();
                             if (name.matches("[a-zA-Z0-9_-]+") ||
-                                    name.endsWith(".conf")) {
+                                    (!name.startsWith(".") &&
+                                            name.endsWith(".conf"))) {
                                 // if dir is absolute, so is p
                                 readConfigFileLines(p, content, dups);
                             }
@@ -1030,11 +1031,19 @@
         } else if (input.startsWith("a") || (input.startsWith("A"))) {
             // AES
             if (input.equalsIgnoreCase("aes128-cts") ||
-                input.equalsIgnoreCase("aes128-cts-hmac-sha1-96")) {
+                    input.equalsIgnoreCase("aes128-sha1") ||
+                    input.equalsIgnoreCase("aes128-cts-hmac-sha1-96")) {
                 result = EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96;
             } else if (input.equalsIgnoreCase("aes256-cts") ||
-                input.equalsIgnoreCase("aes256-cts-hmac-sha1-96")) {
+                    input.equalsIgnoreCase("aes256-sha1") ||
+                    input.equalsIgnoreCase("aes256-cts-hmac-sha1-96")) {
                 result = EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96;
+            } else if (input.equalsIgnoreCase("aes128-sha2") ||
+                    input.equalsIgnoreCase("aes128-cts-hmac-sha256-128")) {
+                result = EncryptedData.ETYPE_AES128_CTS_HMAC_SHA256_128;
+            } else if (input.equalsIgnoreCase("aes256-sha2") ||
+                    input.equalsIgnoreCase("aes256-cts-hmac-sha384-192")) {
+                result = EncryptedData.ETYPE_AES256_CTS_HMAC_SHA384_192;
             // ARCFOUR-HMAC
             } else if (input.equalsIgnoreCase("arcfour-hmac") ||
                    input.equalsIgnoreCase("arcfour-hmac-md5")) {
@@ -1057,6 +1066,10 @@
             result = Checksum.CKSUMTYPE_HMAC_SHA1_96_AES128;
         } else if (input.equalsIgnoreCase("hmac-sha1-96-aes256")) {
             result = Checksum.CKSUMTYPE_HMAC_SHA1_96_AES256;
+        } else if (input.equalsIgnoreCase("hmac-sha256-128-aes128")) {
+            result = Checksum.CKSUMTYPE_HMAC_SHA256_128_AES128;
+        } else if (input.equalsIgnoreCase("hmac-sha384-192-aes256")) {
+            result = Checksum.CKSUMTYPE_HMAC_SHA384_192_AES256;
         } else if (input.equalsIgnoreCase("hmac-md5-rc4") ||
                 input.equalsIgnoreCase("hmac-md5-arcfour") ||
                 input.equalsIgnoreCase("hmac-md5-enc")) {
--- a/src/java.security.jgss/share/classes/sun/security/krb5/EncryptedData.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/EncryptedData.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, 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
@@ -79,6 +79,12 @@
     public static final int
          ETYPE_AES256_CTS_HMAC_SHA1_96 = 18; // 16      0           16
 
+    // rfc8009
+    public static final int
+        ETYPE_AES128_CTS_HMAC_SHA256_128 = 19; // 16      0           16
+    public static final int
+        ETYPE_AES256_CTS_HMAC_SHA384_192 = 20; // 16      0           16
+
     /* used by self */
     private EncryptedData() {
     }
--- a/src/java.security.jgss/share/classes/sun/security/krb5/EncryptionKey.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/EncryptionKey.java	Tue Jan 30 09:03:47 2018 -0800
@@ -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
@@ -252,6 +252,12 @@
                 case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96:
                         return Aes256.stringToKey(password, salt, s2kparams);
 
+                case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA256_128:
+                        return Aes128Sha2.stringToKey(password, salt, s2kparams);
+
+                case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA384_192:
+                    return Aes256Sha2.stringToKey(password, salt, s2kparams);
+
                 default:
                         throw new IllegalArgumentException("encryption type " +
                         EType.toString(keyType) + " not supported");
@@ -293,6 +299,15 @@
                 throw new IllegalArgumentException("Algorithm " + algorithm +
                         " not enabled");
             }
+        } else if (algorithm.equalsIgnoreCase("aes128-cts-hmac-sha256-128")) {
+            keyType = EncryptedData.ETYPE_AES128_CTS_HMAC_SHA256_128;
+        } else if (algorithm.equalsIgnoreCase("aes256-cts-hmac-sha384-192")) {
+            keyType = EncryptedData.ETYPE_AES256_CTS_HMAC_SHA384_192;
+            // validate if AES256 is enabled
+            if (!EType.isSupported(keyType)) {
+                throw new IllegalArgumentException("Algorithm " + algorithm +
+                        " not enabled");
+            }
         } else {
             throw new IllegalArgumentException("Algorithm " + algorithm +
                 " not supported");
--- a/src/java.security.jgss/share/classes/sun/security/krb5/KrbTgsReq.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/KrbTgsReq.java	Tue Jan 30 09:03:47 2018 -0800
@@ -356,6 +356,8 @@
         case Checksum.CKSUMTYPE_HMAC_MD5_ARCFOUR:
         case Checksum.CKSUMTYPE_HMAC_SHA1_96_AES128:
         case Checksum.CKSUMTYPE_HMAC_SHA1_96_AES256:
+        case Checksum.CKSUMTYPE_HMAC_SHA256_128_AES128:
+        case Checksum.CKSUMTYPE_HMAC_SHA384_192_AES256:
             cksum = new Checksum(Checksum.CKSUMTYPE_DEFAULT, temp, key,
                 KeyUsage.KU_PA_TGS_REQ_CKSUM);
             break;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/crypto/Aes128CtsHmacSha2EType.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.krb5.internal.crypto;
+
+import sun.security.krb5.KrbCryptoException;
+import sun.security.krb5.internal.*;
+import java.security.GeneralSecurityException;
+import sun.security.krb5.EncryptedData;
+import sun.security.krb5.Checksum;
+
+/*
+ * This class encapsulates the encryption type for aes128-cts-hmac-sha256-128
+ */
+
+public final class Aes128CtsHmacSha2EType extends EType {
+
+    public int eType() {
+        return EncryptedData.ETYPE_AES128_CTS_HMAC_SHA256_128;
+    }
+
+    public int minimumPadSize() {
+        return 0;
+    }
+
+    public int confounderSize() {
+        return blockSize();
+    }
+
+    public int checksumType() {
+        return Checksum.CKSUMTYPE_HMAC_SHA256_128_AES128;
+    }
+
+    public int checksumSize() {
+        return Aes128Sha2.getChecksumLength();
+    }
+
+    public int blockSize() {
+        return 16;
+    }
+
+    public int keyType() {
+        return Krb5.KEYTYPE_AES;
+    }
+
+    public int keySize() {
+        return 16; // bytes
+    }
+
+    public byte[] encrypt(byte[] data, byte[] key, int usage)
+        throws KrbCryptoException {
+        byte[] ivec = new byte[blockSize()];
+        return encrypt(data, key, ivec, usage);
+    }
+
+    public byte[] encrypt(byte[] data, byte[] key, byte[] ivec, int usage)
+        throws KrbCryptoException {
+        try {
+            return Aes128Sha2.encrypt(key, usage, ivec, data, 0, data.length);
+        } catch (GeneralSecurityException e) {
+            KrbCryptoException ke = new KrbCryptoException(e.getMessage());
+            ke.initCause(e);
+            throw ke;
+        }
+    }
+
+    public byte[] decrypt(byte[] cipher, byte[] key, int usage)
+        throws KrbApErrException, KrbCryptoException {
+        byte[] ivec = new byte[blockSize()];
+        return decrypt(cipher, key, ivec, usage);
+    }
+
+    public byte[] decrypt(byte[] cipher, byte[] key, byte[] ivec, int usage)
+        throws KrbApErrException, KrbCryptoException {
+        try {
+            return Aes128Sha2.decrypt(key, usage, ivec, cipher, 0, cipher.length);
+        } catch (GeneralSecurityException e) {
+            KrbCryptoException ke = new KrbCryptoException(e.getMessage());
+            ke.initCause(e);
+            throw ke;
+        }
+    }
+
+    // Override default, because our decrypted data does not return confounder
+    // Should eventually get rid of EType.decryptedData and
+    // EncryptedData.decryptedData altogether
+    public byte[] decryptedData(byte[] data) {
+        return data;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/crypto/Aes128Sha2.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.krb5.internal.crypto;
+
+import sun.security.krb5.internal.crypto.dk.AesSha2DkCrypto;
+import sun.security.krb5.KrbCryptoException;
+import java.security.GeneralSecurityException;
+
+/**
+ * Class with static methods for doing aes128-cts-hmac-sha256-128 operations.
+ */
+
+public class Aes128Sha2 {
+    private static final AesSha2DkCrypto CRYPTO = new AesSha2DkCrypto(128);
+
+    private Aes128Sha2() {
+    }
+
+    public static byte[] stringToKey(char[] password, String salt, byte[] params)
+        throws GeneralSecurityException {
+        return CRYPTO.stringToKey(password, salt, params);
+    }
+
+    // in bytes
+    public static int getChecksumLength() {
+        return CRYPTO.getChecksumLength();
+    }
+
+    public static byte[] calculateChecksum(byte[] baseKey, int usage,
+        byte[] input, int start, int len) throws GeneralSecurityException {
+            return CRYPTO.calculateChecksum(baseKey, usage, input, start, len);
+    }
+
+    public static byte[] encrypt(byte[] baseKey, int usage,
+        byte[] ivec, byte[] plaintext, int start, int len)
+        throws GeneralSecurityException, KrbCryptoException {
+            return CRYPTO.encrypt(baseKey, usage, ivec, null /* new_ivec */,
+                plaintext, start, len);
+    }
+
+    /* Encrypt plaintext; do not add confounder, or checksum */
+    public static byte[] encryptRaw(byte[] baseKey, int usage,
+        byte[] ivec, byte[] plaintext, int start, int len)
+        throws GeneralSecurityException, KrbCryptoException {
+        return CRYPTO.encryptRaw(baseKey, usage, ivec, plaintext, start, len);
+    }
+
+    public static byte[] decrypt(byte[] baseKey, int usage, byte[] ivec,
+        byte[] ciphertext, int start, int len)
+        throws GeneralSecurityException {
+        return CRYPTO.decrypt(baseKey, usage, ivec, ciphertext, start, len);
+    }
+
+    /* Decrypt ciphertext; do not remove confounder, or check checksum */
+    public static byte[] decryptRaw(byte[] baseKey, int usage, byte[] ivec,
+        byte[] ciphertext, int start, int len)
+        throws GeneralSecurityException {
+        return CRYPTO.decryptRaw(baseKey, usage, ivec, ciphertext, start, len);
+    }
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/crypto/Aes256CtsHmacSha2EType.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.krb5.internal.crypto;
+
+import sun.security.krb5.KrbCryptoException;
+import sun.security.krb5.internal.*;
+import java.security.GeneralSecurityException;
+import sun.security.krb5.EncryptedData;
+import sun.security.krb5.Checksum;
+
+/*
+ * This class encapsulates the encryption type for aes256-cts-hmac-sha384-192
+ */
+
+public final class Aes256CtsHmacSha2EType extends EType {
+
+    public int eType() {
+        return EncryptedData.ETYPE_AES256_CTS_HMAC_SHA384_192;
+    }
+
+    public int minimumPadSize() {
+        return 0;
+    }
+
+    public int confounderSize() {
+        return blockSize();
+    }
+
+    public int checksumType() {
+        return Checksum.CKSUMTYPE_HMAC_SHA384_192_AES256;
+    }
+
+    public int checksumSize() {
+        return Aes256Sha2.getChecksumLength();
+    }
+
+    public int blockSize() {
+        return 16;
+    }
+
+    public int keyType() {
+        return Krb5.KEYTYPE_AES;
+    }
+
+    public int keySize() {
+        return 32; // bytes
+    }
+
+    public byte[] encrypt(byte[] data, byte[] key, int usage)
+        throws KrbCryptoException {
+        byte[] ivec = new byte[blockSize()];
+        return encrypt(data, key, ivec, usage);
+    }
+
+    public byte[] encrypt(byte[] data, byte[] key, byte[] ivec, int usage)
+        throws KrbCryptoException {
+        try {
+            return Aes256Sha2.encrypt(key, usage, ivec, data, 0, data.length);
+        } catch (GeneralSecurityException e) {
+            KrbCryptoException ke = new KrbCryptoException(e.getMessage());
+            ke.initCause(e);
+            throw ke;
+        }
+    }
+
+    public byte[] decrypt(byte[] cipher, byte[] key, int usage)
+        throws KrbApErrException, KrbCryptoException {
+        byte[] ivec = new byte[blockSize()];
+        return decrypt(cipher, key, ivec, usage);
+    }
+
+    public byte[] decrypt(byte[] cipher, byte[] key, byte[] ivec, int usage)
+        throws KrbApErrException, KrbCryptoException {
+        try {
+            return Aes256Sha2.decrypt(key, usage, ivec, cipher, 0, cipher.length);
+        } catch (GeneralSecurityException e) {
+            KrbCryptoException ke = new KrbCryptoException(e.getMessage());
+            ke.initCause(e);
+            throw ke;
+        }
+    }
+
+    // Override default, because our decrypted data does not return confounder
+    // Should eventually get rid of EType.decryptedData and
+    // EncryptedData.decryptedData altogether
+    public byte[] decryptedData(byte[] data) {
+        return data;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/crypto/Aes256Sha2.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.krb5.internal.crypto;
+
+import sun.security.krb5.internal.crypto.dk.AesSha2DkCrypto;
+import sun.security.krb5.KrbCryptoException;
+import java.security.GeneralSecurityException;
+
+/**
+ * Class with static methods for doing aes256-cts-hmac-sha384-192 operations.
+ */
+
+public class Aes256Sha2 {
+    private static final AesSha2DkCrypto CRYPTO = new AesSha2DkCrypto(256);
+
+    private Aes256Sha2() {
+    }
+
+    public static byte[] stringToKey(char[] password, String salt, byte[] params)
+        throws GeneralSecurityException {
+        return CRYPTO.stringToKey(password, salt, params);
+    }
+
+    // in bytes
+    public static int getChecksumLength() {
+        return CRYPTO.getChecksumLength();
+    }
+
+    public static byte[] calculateChecksum(byte[] baseKey, int usage,
+        byte[] input, int start, int len) throws GeneralSecurityException {
+            return CRYPTO.calculateChecksum(baseKey, usage, input, start, len);
+    }
+
+    public static byte[] encrypt(byte[] baseKey, int usage,
+        byte[] ivec, byte[] plaintext, int start, int len)
+        throws GeneralSecurityException, KrbCryptoException {
+            return CRYPTO.encrypt(baseKey, usage, ivec, null /* new_ivec */,
+                plaintext, start, len);
+    }
+
+    /* Encrypt plaintext; do not add confounder, padding, or checksum */
+    public static byte[] encryptRaw(byte[] baseKey, int usage,
+        byte[] ivec, byte[] plaintext, int start, int len)
+        throws GeneralSecurityException, KrbCryptoException {
+        return CRYPTO.encryptRaw(baseKey, usage, ivec, plaintext, start, len);
+    }
+
+    public static byte[] decrypt(byte[] baseKey, int usage, byte[] ivec,
+        byte[] ciphertext, int start, int len)
+        throws GeneralSecurityException {
+        return CRYPTO.decrypt(baseKey, usage, ivec, ciphertext, start, len);
+    }
+
+    /*
+     * Decrypt ciphertext; do not remove confounder, padding, or check
+     * checksum
+     */
+    public static byte[] decryptRaw(byte[] baseKey, int usage, byte[] ivec,
+        byte[] ciphertext, int start, int len)
+        throws GeneralSecurityException {
+        return CRYPTO.decryptRaw(baseKey, usage, ivec, ciphertext, start, len);
+    }
+};
--- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/crypto/EType.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/crypto/EType.java	Tue Jan 30 09:03:47 2018 -0800
@@ -106,7 +106,19 @@
                 "sun.security.krb5.internal.crypto.Aes256CtsHmacSha1EType";
             break;
 
-        case EncryptedData.ETYPE_ARCFOUR_HMAC:
+        case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA256_128:
+            eType = new Aes128CtsHmacSha2EType();
+            eTypeName =
+                    "sun.security.krb5.internal.crypto.Aes128CtsHmacSha2EType";
+            break;
+
+        case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA384_192:
+            eType = new Aes256CtsHmacSha2EType();
+            eTypeName =
+                    "sun.security.krb5.internal.crypto.Aes256CtsHmacSha2EType";
+            break;
+
+            case EncryptedData.ETYPE_ARCFOUR_HMAC:
             eType = new ArcFourHmacEType();
             eTypeName = "sun.security.krb5.internal.crypto.ArcFourHmacEType";
             break;
@@ -189,20 +201,23 @@
     // is set to false.
 
     private static final int[] BUILTIN_ETYPES = new int[] {
-        EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96,
-        EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96,
-        EncryptedData.ETYPE_DES3_CBC_HMAC_SHA1_KD,
-        EncryptedData.ETYPE_ARCFOUR_HMAC,
-        EncryptedData.ETYPE_DES_CBC_CRC,
-        EncryptedData.ETYPE_DES_CBC_MD5,
+            EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96,
+            EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96,
+            EncryptedData.ETYPE_AES256_CTS_HMAC_SHA384_192,
+            EncryptedData.ETYPE_AES128_CTS_HMAC_SHA256_128,
+            EncryptedData.ETYPE_DES3_CBC_HMAC_SHA1_KD,
+            EncryptedData.ETYPE_ARCFOUR_HMAC,
+            EncryptedData.ETYPE_DES_CBC_CRC,
+            EncryptedData.ETYPE_DES_CBC_MD5,
     };
 
     private static final int[] BUILTIN_ETYPES_NOAES256 = new int[] {
-        EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96,
-        EncryptedData.ETYPE_DES3_CBC_HMAC_SHA1_KD,
-        EncryptedData.ETYPE_ARCFOUR_HMAC,
-        EncryptedData.ETYPE_DES_CBC_CRC,
-        EncryptedData.ETYPE_DES_CBC_MD5,
+            EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96,
+            EncryptedData.ETYPE_AES128_CTS_HMAC_SHA256_128,
+            EncryptedData.ETYPE_DES3_CBC_HMAC_SHA1_KD,
+            EncryptedData.ETYPE_ARCFOUR_HMAC,
+            EncryptedData.ETYPE_DES_CBC_CRC,
+            EncryptedData.ETYPE_DES_CBC_MD5,
     };
 
 
@@ -363,7 +378,10 @@
             return "RC4 with HMAC";
         case 24:
             return "RC4 with HMAC EXP";
-
+        case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA256_128:
+            return "AES128 CTS mode with HMAC SHA256-128";
+        case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA384_192:
+            return "AES256 CTS mode with HMAC SHA384-192";
         }
         return "Unknown (" + type + ")";
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/crypto/HmacSha2Aes128CksumType.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.krb5.internal.crypto;
+
+import sun.security.krb5.Checksum;
+import sun.security.krb5.KrbCryptoException;
+import sun.security.krb5.internal.*;
+import java.security.GeneralSecurityException;
+
+/*
+ * This class encapsulates the checksum type for aes128-cts-sha256
+ */
+
+public class HmacSha2Aes128CksumType extends CksumType {
+
+    public HmacSha2Aes128CksumType() {
+    }
+
+    public int confounderSize() {
+        return 16;
+    }
+
+    public int cksumType() {
+        return Checksum.CKSUMTYPE_HMAC_SHA256_128_AES128;
+    }
+
+    public boolean isSafe() {
+        return true;
+    }
+
+    public int cksumSize() {
+        return 16;  // bytes
+    }
+
+    public int keyType() {
+        return Krb5.KEYTYPE_AES;
+    }
+
+    public int keySize() {
+        return 16;   // bytes
+    }
+
+    public byte[] calculateChecksum(byte[] data, int size) {
+        return null;
+    }
+
+    /**
+     * Calculates keyed checksum.
+     * @param data the data used to generate the checksum.
+     * @param size length of the data.
+     * @param key the key used to encrypt the checksum.
+     * @return keyed checksum.
+     */
+    public byte[] calculateKeyedChecksum(byte[] data, int size, byte[] key,
+        int usage) throws KrbCryptoException {
+
+         try {
+            return Aes128Sha2.calculateChecksum(key, usage, data, 0, size);
+         } catch (GeneralSecurityException e) {
+            KrbCryptoException ke = new KrbCryptoException(e.getMessage());
+            ke.initCause(e);
+            throw ke;
+         }
+    }
+
+    /**
+     * Verifies keyed checksum.
+     * @param data the data.
+     * @param size the length of data.
+     * @param key the key used to encrypt the checksum.
+     * @param checksum the checksum.
+     * @return true if verification is successful.
+     */
+    public boolean verifyKeyedChecksum(byte[] data, int size,
+        byte[] key, byte[] checksum, int usage) throws KrbCryptoException {
+
+         try {
+            byte[] newCksum = Aes128Sha2.calculateChecksum(key, usage,
+                                                        data, 0, size);
+            return isChecksumEqual(checksum, newCksum);
+         } catch (GeneralSecurityException e) {
+            KrbCryptoException ke = new KrbCryptoException(e.getMessage());
+            ke.initCause(e);
+            throw ke;
+         }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/crypto/HmacSha2Aes256CksumType.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.krb5.internal.crypto;
+
+import sun.security.krb5.Checksum;
+import sun.security.krb5.KrbCryptoException;
+import sun.security.krb5.internal.*;
+import java.security.GeneralSecurityException;
+
+/*
+ * This class encapsulates the checksum type for aes256-cts-sha384
+ */
+
+public class HmacSha2Aes256CksumType extends CksumType {
+
+    public HmacSha2Aes256CksumType() {
+    }
+
+    public int confounderSize() {
+        return 16;
+    }
+
+    public int cksumType() {
+        return Checksum.CKSUMTYPE_HMAC_SHA384_192_AES256;
+    }
+
+    public boolean isSafe() {
+        return true;
+    }
+
+    public int cksumSize() {
+        return 24;  // bytes
+    }
+
+    public int keyType() {
+        return Krb5.KEYTYPE_AES;
+    }
+
+    public int keySize() {
+        return 32;   // bytes
+    }
+
+    public byte[] calculateChecksum(byte[] data, int size) {
+        return null;
+    }
+
+    /**
+     * Calculates keyed checksum.
+     * @param data the data used to generate the checksum.
+     * @param size length of the data.
+     * @param key the key used to encrypt the checksum.
+     * @return keyed checksum.
+     */
+    public byte[] calculateKeyedChecksum(byte[] data, int size, byte[] key,
+        int usage) throws KrbCryptoException {
+
+         try {
+            return Aes256Sha2.calculateChecksum(key, usage, data, 0, size);
+         } catch (GeneralSecurityException e) {
+            KrbCryptoException ke = new KrbCryptoException(e.getMessage());
+            ke.initCause(e);
+            throw ke;
+         }
+    }
+
+    /**
+     * Verifies keyed checksum.
+     * @param data the data.
+     * @param size the length of data.
+     * @param key the key used to encrypt the checksum.
+     * @param checksum the checksum.
+     * @return true if verification is successful.
+     */
+    public boolean verifyKeyedChecksum(byte[] data, int size,
+        byte[] key, byte[] checksum, int usage) throws KrbCryptoException {
+
+         try {
+            byte[] newCksum = Aes256Sha2.calculateChecksum(key, usage, data,
+                                                        0, size);
+            return isChecksumEqual(checksum, newCksum);
+         } catch (GeneralSecurityException e) {
+            KrbCryptoException ke = new KrbCryptoException(e.getMessage());
+            ke.initCause(e);
+            throw ke;
+         }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/crypto/dk/AesSha2DkCrypto.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,541 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ */
+
+package sun.security.krb5.internal.crypto.dk;
+
+import javax.crypto.Cipher;
+import javax.crypto.Mac;
+import javax.crypto.SecretKeyFactory;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.SecretKeySpec;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.PBEKeySpec;
+import java.security.GeneralSecurityException;
+import sun.security.krb5.KrbCryptoException;
+import sun.security.krb5.Confounder;
+import sun.security.krb5.internal.crypto.KeyUsage;
+import java.util.Arrays;
+
+/**
+ * This class provides the implementation of AES Encryption with
+ * HMAC-SHA2 for Kerberos 5
+ * https://tools.ietf.org/html/rfc8009
+ *
+ * Algorithm profile described in [KCRYPTO]:
+ * +--------------------------------------------------------------------+
+ * |               protocol key format          128- or 256-bit string  |
+ * |                                                                    |
+ * |            string-to-key function          PBKDF2+DK with variable |
+ * |                                          iteration count (see      |
+ * |                                          above)                    |
+ * |                                                                    |
+ * |  default string-to-key parameters          00 00 80 00             |
+ * |                                                                    |
+ * |        key-generation seed length          key size                |
+ * |                                                                    |
+ * |            random-to-key function          identity function       |
+ * |                                                                    |
+ * |                  hash function, H          SHA-256 / SHA-384       |
+ * |                                                                    |
+ * |               HMAC output size, h          16/24 octets            |
+ * |                                                                    |
+ * |             message block size, m          1 octet                 |
+ * |                                                                    |
+ * |  encryption/decryption functions,          AES in CBC-CTS mode     |
+ * |  E and D                                 (cipher block size 16     |
+ * |                                          octets), with next to     |
+ * |                                          last block as CBC-style   |
+ * |                                          ivec                      |
+ * +--------------------------------------------------------------------+
+ *
+ * Supports aes128-cts-hmac-sha256-128 and aes256-cts-hmac-sha384-192
+ */
+
+public class AesSha2DkCrypto extends DkCrypto {
+
+    private static final boolean debug = false;
+
+    private static final int BLOCK_SIZE = 16;
+    private static final int DEFAULT_ITERATION_COUNT = 32768;
+    private static final byte[] ZERO_IV = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0,
+                                                       0, 0, 0, 0, 0, 0, 0, 0 };
+
+    private static final byte[] ETYPE_NAME_128 =
+            "aes128-cts-hmac-sha256-128".getBytes();
+    private static final byte[] ETYPE_NAME_256 =
+            "aes256-cts-hmac-sha384-192".getBytes();
+
+    private final int hashSize;
+    private final int keyLength;
+
+    public AesSha2DkCrypto(int length) {
+        keyLength = length;
+        hashSize = (length == 128?128:192)/8;
+    }
+
+    protected int getKeySeedLength() {
+        return keyLength;   // bits; AES key material
+    }
+
+    public byte[] stringToKey(char[] password, String salt, byte[] s2kparams)
+        throws GeneralSecurityException {
+
+        byte[] saltUtf8 = null;
+        try {
+            saltUtf8 = salt.getBytes("UTF-8");
+            return stringToKey(password, saltUtf8, s2kparams);
+        } catch (Exception e) {
+            return null;
+        } finally {
+            if (saltUtf8 != null) {
+                Arrays.fill(saltUtf8, (byte)0);
+            }
+        }
+    }
+
+    // https://tools.ietf.org/html/rfc8009#section-4
+    private byte[] stringToKey(char[] secret, byte[] salt, byte[] params)
+        throws GeneralSecurityException {
+
+        int iter_count = DEFAULT_ITERATION_COUNT;
+        if (params != null) {
+            if (params.length != 4) {
+                throw new RuntimeException("Invalid parameter to stringToKey");
+            }
+            iter_count = readBigEndian(params, 0, 4);
+        }
+
+        byte[] saltp = new byte[26 + 1 + salt.length];
+        if (keyLength == 128) {
+            System.arraycopy(ETYPE_NAME_128, 0, saltp, 0, 26);
+        } else {
+            System.arraycopy(ETYPE_NAME_256, 0, saltp, 0, 26);
+        }
+        System.arraycopy(salt, 0, saltp, 27, salt.length);
+        byte[] tmpKey = randomToKey(PBKDF2(secret, saltp, iter_count,
+                                        getKeySeedLength()));
+        byte[] result = dk(tmpKey, KERBEROS_CONSTANT);
+        return result;
+    }
+
+    protected byte[] randomToKey(byte[] in) {
+        // simple identity operation
+        return in;
+    }
+
+    /*
+     * https://tools.ietf.org/html/rfc8009#section-3 defines
+     * a new key derivation function:
+     *
+     * KDF-HMAC-SHA2(key, label, k) = k-truncate(K1)
+     * K1 = HMAC-SHA-256(key, 0x00000001 | label | 0x00 | k) or
+     * K1 = HMAC-SHA-384(key, 0x00000001 | label | 0x00 | k)
+     *
+     * where label is constant below.
+     */
+    protected byte[] dr(byte[] key, byte[] constant)
+            throws GeneralSecurityException {
+        byte[] result;
+        byte[] input = new byte[constant.length + 9];
+        // 0x00000001 at the beginning
+        input[3] = 1;
+        // label follows
+        System.arraycopy(constant, 0, input, 4, constant.length);
+        SecretKeySpec tkey = new SecretKeySpec(key, "HMAC");
+        Mac mac = Mac.getInstance(
+                keyLength == 128? "HmacSHA256": "HmacSHA384");
+        mac.init(tkey);
+
+        int k;
+        if (keyLength == 128) {
+            // key length for enc and hmac both 128
+            k = 128;
+        } else {
+            byte last = constant[constant.length-1];
+            if (last == (byte)0x99 || last == (byte)0x55) {
+                // 192 for hmac
+                k = 192;
+            } else {
+                // 256 for enc
+                k = 256;
+            }
+        }
+        // 0x00 and k at the end
+        input[input.length - 1] = (byte)(k);
+        input[input.length - 2] = (byte)(k / 256);
+
+        result = mac.doFinal(input);
+        return Arrays.copyOf(result, k / 8);
+    }
+
+    protected Cipher getCipher(byte[] key, byte[] ivec, int mode)
+        throws GeneralSecurityException {
+
+        // IV
+        if (ivec == null) {
+           ivec = ZERO_IV;
+        }
+        SecretKeySpec secretKey = new SecretKeySpec(key, "AES");
+        Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
+        IvParameterSpec encIv = new IvParameterSpec(ivec, 0, ivec.length);
+        cipher.init(mode, secretKey, encIv);
+        return cipher;
+    }
+
+    // get an instance of the AES Cipher in CTS mode
+    public int getChecksumLength() {
+        return hashSize;  // bytes
+    }
+
+    /**
+     * Get the truncated HMAC
+     */
+    protected byte[] getHmac(byte[] key, byte[] msg)
+        throws GeneralSecurityException {
+
+        SecretKey keyKi = new SecretKeySpec(key, "HMAC");
+        Mac m = Mac.getInstance(keyLength == 128 ? "HmacSHA256" : "HmacSHA384");
+        m.init(keyKi);
+
+        // generate hash
+        byte[] hash = m.doFinal(msg);
+
+        // truncate hash
+        byte[] output = new byte[hashSize];
+        System.arraycopy(hash, 0, output, 0, hashSize);
+        return output;
+    }
+
+    private byte[] deriveKey(byte[] baseKey, int usage, byte type)
+            throws GeneralSecurityException {
+        byte[] constant = new byte[5];
+        constant[0] = (byte) ((usage>>24)&0xff);
+        constant[1] = (byte) ((usage>>16)&0xff);
+        constant[2] = (byte) ((usage>>8)&0xff);
+        constant[3] = (byte) (usage&0xff);
+        constant[4] = type;
+        return dk(baseKey, constant);
+    }
+
+    /**
+     * Calculate the checksum
+     */
+    public byte[] calculateChecksum(byte[] baseKey, int usage, byte[] input,
+        int start, int len) throws GeneralSecurityException {
+
+        if (!KeyUsage.isValid(usage)) {
+            throw new GeneralSecurityException("Invalid key usage number: "
+                                                + usage);
+        }
+
+        byte[] Kc = deriveKey(baseKey, usage, (byte) 0x99);  // Checksum key
+        if (debug) {
+            System.err.println("usage: " + usage);
+            traceOutput("input", input, start, Math.min(len, 32));
+            traceOutput("baseKey", baseKey, 0, baseKey.length);
+            traceOutput("Kc", Kc, 0, Kc.length);
+        }
+
+        try {
+            // Generate checksum
+            // H1 = HMAC(Kc, input)
+            byte[] hmac = getHmac(Kc, input);
+            if (debug) {
+                traceOutput("hmac", hmac, 0, hmac.length);
+            }
+            if (hmac.length == getChecksumLength()) {
+                return hmac;
+            } else if (hmac.length > getChecksumLength()) {
+                byte[] buf = new byte[getChecksumLength()];
+                System.arraycopy(hmac, 0, buf, 0, buf.length);
+                return buf;
+            } else {
+                throw new GeneralSecurityException("checksum size too short: " +
+                        hmac.length + "; expecting : " + getChecksumLength());
+            }
+        } finally {
+            Arrays.fill(Kc, 0, Kc.length, (byte)0);
+        }
+    }
+
+    /**
+     * Performs encryption using derived key; adds confounder.
+     */
+    public byte[] encrypt(byte[] baseKey, int usage,
+        byte[] ivec, byte[] new_ivec, byte[] plaintext, int start, int len)
+        throws GeneralSecurityException, KrbCryptoException {
+
+        if (!KeyUsage.isValid(usage)) {
+            throw new GeneralSecurityException("Invalid key usage number: "
+                                                 + usage);
+        }
+        byte[] output = encryptCTS(baseKey, usage, ivec, new_ivec, plaintext,
+                                        start, len, true);
+        return output;
+    }
+
+    /**
+     * Performs encryption using derived key; does not add confounder.
+     */
+    public byte[] encryptRaw(byte[] baseKey, int usage,
+        byte[] ivec, byte[] plaintext, int start, int len)
+        throws GeneralSecurityException, KrbCryptoException {
+
+        if (!KeyUsage.isValid(usage)) {
+            throw new GeneralSecurityException("Invalid key usage number: "
+                                                + usage);
+        }
+        byte[] output = encryptCTS(baseKey, usage, ivec, null, plaintext,
+                                        start, len, false);
+        return output;
+    }
+
+    /**
+     * @param baseKey key from which keys are to be derived using usage
+     * @param ciphertext  E(Ke, conf | plaintext | padding, ivec) | H1[1..h]
+     */
+    public byte[] decrypt(byte[] baseKey, int usage, byte[] ivec,
+        byte[] ciphertext, int start, int len) throws GeneralSecurityException {
+
+        if (!KeyUsage.isValid(usage)) {
+            throw new GeneralSecurityException("Invalid key usage number: "
+                                                + usage);
+        }
+        byte[] output = decryptCTS(baseKey, usage, ivec, ciphertext,
+                                        start, len, true);
+        return output;
+    }
+
+    /**
+     * Decrypts data using specified key and initial vector.
+     * @param baseKey encryption key to use
+     * @param ciphertext  encrypted data to be decrypted
+     * @param usage ignored
+     */
+    public byte[] decryptRaw(byte[] baseKey, int usage, byte[] ivec,
+        byte[] ciphertext, int start, int len)
+        throws GeneralSecurityException {
+
+        if (!KeyUsage.isValid(usage)) {
+            throw new GeneralSecurityException("Invalid key usage number: "
+                                                + usage);
+        }
+        byte[] output = decryptCTS(baseKey, usage, ivec, ciphertext,
+                                        start, len, false);
+        return output;
+    }
+
+    /**
+     * Encrypt AES in CBC-CTS mode using derived keys.
+     */
+    private byte[] encryptCTS(byte[] baseKey, int usage, byte[] ivec,
+        byte[] new_ivec, byte[] plaintext, int start, int len,
+        boolean confounder_exists)
+        throws GeneralSecurityException, KrbCryptoException {
+
+        byte[] Ke = null;
+        byte[] Ki = null;
+
+        if (debug) {
+            System.err.println("usage: " + usage);
+            if (ivec != null) {
+                traceOutput("old_state.ivec", ivec, 0, ivec.length);
+            }
+            traceOutput("plaintext", plaintext, start, Math.min(len, 32));
+            traceOutput("baseKey", baseKey, 0, baseKey.length);
+        }
+
+        try {
+            Ke = deriveKey(baseKey, usage, (byte) 0xaa);  // Encryption key
+
+            byte[] toBeEncrypted = null;
+            if (confounder_exists) {
+                byte[] confounder = Confounder.bytes(BLOCK_SIZE);
+                toBeEncrypted = new byte[confounder.length + len];
+                System.arraycopy(confounder, 0, toBeEncrypted,
+                                        0, confounder.length);
+                System.arraycopy(plaintext, start, toBeEncrypted,
+                                        confounder.length, len);
+            } else {
+                toBeEncrypted = new byte[len];
+                System.arraycopy(plaintext, start, toBeEncrypted, 0, len);
+            }
+
+            // encryptedData + HMAC
+            byte[] output = new byte[toBeEncrypted.length + hashSize];
+
+            // AES in JCE
+            Cipher cipher = Cipher.getInstance("AES/CTS/NoPadding");
+            SecretKeySpec secretKey = new SecretKeySpec(Ke, "AES");
+            IvParameterSpec encIv = new IvParameterSpec(ivec, 0, ivec.length);
+            cipher.init(Cipher.ENCRYPT_MODE, secretKey, encIv);
+            cipher.doFinal(toBeEncrypted, 0, toBeEncrypted.length, output);
+
+            Ki = deriveKey(baseKey, usage, (byte) 0x55);
+            if (debug) {
+                traceOutput("Ki", Ki, 0, Ke.length);
+            }
+
+            // Generate checksum
+            // H = HMAC(Ki, IV | C)
+            byte[] msg = Arrays.copyOf(ivec, ivec.length + toBeEncrypted.length);
+            System.arraycopy(output, 0, msg, ivec.length, toBeEncrypted.length);
+            byte[] hmac = getHmac(Ki, msg);
+
+            // encryptedData + HMAC
+            System.arraycopy(hmac, 0, output, toBeEncrypted.length,
+                                hmac.length);
+            return output;
+        } finally {
+            if (Ke != null) {
+                Arrays.fill(Ke, 0, Ke.length, (byte) 0);
+            }
+            if (Ki != null) {
+                Arrays.fill(Ki, 0, Ki.length, (byte) 0);
+            }
+        }
+    }
+
+    /**
+     * Decrypt AES in CBC-CTS mode using derived keys.
+     */
+    private byte[] decryptCTS(byte[] baseKey, int usage, byte[] ivec,
+        byte[] ciphertext, int start, int len, boolean confounder_exists)
+        throws GeneralSecurityException {
+
+        byte[] Ke = null;
+        byte[] Ki = null;
+
+        try {
+            Ke = deriveKey(baseKey, usage, (byte) 0xaa);  // Encryption key
+
+            if (debug) {
+                System.err.println("usage: " + usage);
+                if (ivec != null) {
+                    traceOutput("old_state.ivec", ivec, 0, ivec.length);
+                }
+                traceOutput("ciphertext", ciphertext, start, Math.min(len, 32));
+                traceOutput("baseKey", baseKey, 0, baseKey.length);
+                traceOutput("Ke", Ke, 0, Ke.length);
+            }
+
+            // Decrypt [confounder | plaintext ] (without checksum)
+
+            // AES in JCE
+            Cipher cipher = Cipher.getInstance("AES/CTS/NoPadding");
+            SecretKeySpec secretKey = new SecretKeySpec(Ke, "AES");
+            IvParameterSpec encIv = new IvParameterSpec(ivec, 0, ivec.length);
+            cipher.init(Cipher.DECRYPT_MODE, secretKey, encIv);
+            byte[] plaintext = cipher.doFinal(ciphertext, start, len-hashSize);
+
+            if (debug) {
+                traceOutput("AES PlainText", plaintext, 0,
+                                Math.min(plaintext.length, 32));
+            }
+
+            Ki = deriveKey(baseKey, usage, (byte) 0x55);  // Integrity key
+            if (debug) {
+                traceOutput("Ki", Ki, 0, Ke.length);
+            }
+
+            // Verify checksum
+            // H = HMAC(Ki, IV | C)
+            byte[] msg = Arrays.copyOf(ivec, ivec.length + len-hashSize);
+            System.arraycopy(ciphertext, start, msg, ivec.length, len-hashSize);
+            byte[] calculatedHmac = getHmac(Ki, msg);
+            int hmacOffset = start + len - hashSize;
+            if (debug) {
+                traceOutput("calculated Hmac", calculatedHmac,
+                                0, calculatedHmac.length);
+                traceOutput("message Hmac", ciphertext, hmacOffset, hashSize);
+            }
+            boolean cksumFailed = false;
+            if (calculatedHmac.length >= hashSize) {
+                for (int i = 0; i < hashSize; i++) {
+                    if (calculatedHmac[i] != ciphertext[hmacOffset+i]) {
+                        cksumFailed = true;
+                        if (debug) {
+                            System.err.println("Checksum failed !");
+                        }
+                        break;
+                    }
+                }
+            }
+            if (cksumFailed) {
+                throw new GeneralSecurityException("Checksum failed");
+            }
+
+            if (confounder_exists) {
+                // Get rid of confounder
+                // [ confounder | plaintext ]
+                byte[] output = new byte[plaintext.length - BLOCK_SIZE];
+                System.arraycopy(plaintext, BLOCK_SIZE, output,
+                                        0, output.length);
+                return output;
+            } else {
+                return plaintext;
+            }
+        } finally {
+            if (Ke != null) {
+                Arrays.fill(Ke, 0, Ke.length, (byte) 0);
+            }
+            if (Ki != null) {
+                Arrays.fill(Ki, 0, Ki.length, (byte) 0);
+            }
+        }
+    }
+
+    /*
+     * Invoke the PKCS#5 PBKDF2 algorithm
+     */
+    private static byte[] PBKDF2(char[] secret, byte[] salt,
+        int count, int keyLength) throws GeneralSecurityException {
+
+        PBEKeySpec keySpec = new PBEKeySpec(secret, salt, count, keyLength);
+        SecretKeyFactory skf =
+                SecretKeyFactory.getInstance(keyLength == 128 ?
+                        "PBKDF2WithHmacSHA256" : "PBKDF2WithHmacSHA384");
+        SecretKey key = skf.generateSecret(keySpec);
+        byte[] result = key.getEncoded();
+
+        return result;
+    }
+
+    public static final int readBigEndian(byte[] data, int pos, int size) {
+        int retVal = 0;
+        int shifter = (size-1)*8;
+        while (size > 0) {
+            retVal += (data[pos] & 0xff) << shifter;
+            shifter -= 8;
+            pos++;
+            size--;
+        }
+        return retVal;
+    }
+
+}
--- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
  */
 
 /*
@@ -478,7 +478,7 @@
      *
      * DR(Key, Constant) = k-truncate(K1 | K2 | K3 | K4 ...)
      */
-    private byte[] dr(byte[] key, byte[] constant)
+    protected byte[] dr(byte[] key, byte[] constant)
         throws GeneralSecurityException {
 
         Cipher encCipher = getCipher(key, null, Cipher.ENCRYPT_MODE);
@@ -667,7 +667,7 @@
             new HexDumpEncoder().encodeBuffer(
                 new ByteArrayInputStream(output, offset, len), out);
 
-            System.err.println(traceTag + ":" + out.toString());
+            System.err.println(traceTag + ":\n" + out.toString());
         } catch (Exception e) {
         }
     }
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/Translet.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/Translet.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/output/TransletOutputHandlerFactory.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/output/TransletOutputHandlerFactory.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
--- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPathContext.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPathContext.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java	Tue Jan 30 09:03:47 2018 -0800
@@ -633,6 +633,7 @@
         boolean haveSourcePath = includeSourcePath && fileManager.hasLocation(SOURCE_PATH);
 
         if (verbose && verbosePath) {
+            verbosePath = false; // print once per compile
             if (fileManager instanceof StandardJavaFileManager) {
                 StandardJavaFileManager fm = (StandardJavaFileManager)fileManager;
                 if (haveSourcePath && wantSourceFiles) {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1889,7 +1889,7 @@
                     Name paramName = name.table.fromString("arg" + i);
                     VarSymbol param = new VarSymbol(PARAMETER, paramName, t, this);
                     newParams.append(param);
-
+                    i++;
                 }
                 params = newParams.toList();
             }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java	Tue Jan 30 09:03:47 2018 -0800
@@ -2107,9 +2107,8 @@
                 List<Type> prevBounds = bounds.get(ib);
                 if (bound == qtype) return;
                 for (Type b : prevBounds) {
-                    //check for redundancy - use strict version of isSameType on tvars
-                    //(as the standard version will lead to false positives w.r.t. clones ivars)
-                    if (types.isSameType(b, bound2, true)) return;
+                    //check for redundancy - do not add same bound twice
+                    if (types.isSameType(b, bound2)) return;
                 }
                 bounds.put(ib, prevBounds.prepend(bound2));
                 notifyBoundChange(ib, bound2, false);
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1291,12 +1291,9 @@
      * lists are of different length, return false.
      */
     public boolean isSameTypes(List<Type> ts, List<Type> ss) {
-        return isSameTypes(ts, ss, false);
-    }
-    public boolean isSameTypes(List<Type> ts, List<Type> ss, boolean strict) {
         while (ts.tail != null && ss.tail != null
                /*inlined: ts.nonEmpty() && ss.nonEmpty()*/ &&
-               isSameType(ts.head, ss.head, strict)) {
+               isSameType(ts.head, ss.head)) {
             ts = ts.tail;
             ss = ss.tail;
         }
@@ -1325,15 +1322,15 @@
      * Is t the same type as s?
      */
     public boolean isSameType(Type t, Type s) {
-        return isSameType(t, s, false);
-    }
-    public boolean isSameType(Type t, Type s, boolean strict) {
-        return strict ?
-                isSameTypeStrict.visit(t, s) :
-                isSameTypeLoose.visit(t, s);
+        return isSameTypeVisitor.visit(t, s);
     }
     // where
-        abstract class SameTypeVisitor extends TypeRelation {
+
+        /**
+         * Type-equality relation - type variables are considered
+         * equals if they share the same object identity.
+         */
+        TypeRelation isSameTypeVisitor = new TypeRelation() {
 
             public Boolean visitType(Type t, Type s) {
                 if (t.equalsIgnoreMetadata(s))
@@ -1350,7 +1347,7 @@
                     if (s.hasTag(TYPEVAR)) {
                         //type-substitution does not preserve type-var types
                         //check that type var symbols and bounds are indeed the same
-                        return sameTypeVars((TypeVar)t, (TypeVar)s);
+                        return t == s;
                     }
                     else {
                         //special case for s == ? super X, where upper(s) = u
@@ -1365,8 +1362,6 @@
                 }
             }
 
-            abstract boolean sameTypeVars(TypeVar tv1, TypeVar tv2);
-
             @Override
             public Boolean visitWildcardType(WildcardType t, Type s) {
                 if (!s.hasTag(WILDCARD)) {
@@ -1374,7 +1369,7 @@
                 } else {
                     WildcardType t2 = (WildcardType)s;
                     return (t.kind == t2.kind || (t.isExtendsBound() && s.isExtendsBound())) &&
-                            isSameType(t.type, t2.type, true);
+                            isSameType(t.type, t2.type);
                 }
             }
 
@@ -1411,10 +1406,8 @@
                 }
                 return t.tsym == s.tsym
                     && visit(t.getEnclosingType(), s.getEnclosingType())
-                    && containsTypes(t.getTypeArguments(), s.getTypeArguments());
-            }
-
-            abstract protected boolean containsTypes(List<Type> ts1, List<Type> ts2);
+                    && containsTypeEquivalent(t.getTypeArguments(), s.getTypeArguments());
+            }
 
             @Override
             public Boolean visitArrayType(ArrayType t, Type s) {
@@ -1471,70 +1464,6 @@
             public Boolean visitErrorType(ErrorType t, Type s) {
                 return true;
             }
-        }
-
-        /**
-         * Standard type-equality relation - type variables are considered
-         * equals if they share the same type symbol.
-         */
-        TypeRelation isSameTypeLoose = new LooseSameTypeVisitor();
-
-        private class LooseSameTypeVisitor extends SameTypeVisitor {
-
-            /** cache of the type-variable pairs being (recursively) tested. */
-            private Set<TypePair> cache = new HashSet<>();
-
-            @Override
-            boolean sameTypeVars(TypeVar tv1, TypeVar tv2) {
-                return tv1.tsym == tv2.tsym && checkSameBounds(tv1, tv2);
-            }
-            @Override
-            protected boolean containsTypes(List<Type> ts1, List<Type> ts2) {
-                return containsTypeEquivalent(ts1, ts2);
-            }
-
-            /**
-             * Since type-variable bounds can be recursive, we need to protect against
-             * infinite loops - where the same bounds are checked over and over recursively.
-             */
-            private boolean checkSameBounds(TypeVar tv1, TypeVar tv2) {
-                TypePair p = new TypePair(tv1, tv2, true);
-                if (cache.add(p)) {
-                    try {
-                        return visit(tv1.getUpperBound(), tv2.getUpperBound());
-                    } finally {
-                        cache.remove(p);
-                    }
-                } else {
-                    return false;
-                }
-            }
-        };
-
-        /**
-         * Strict type-equality relation - type variables are considered
-         * equals if they share the same object identity.
-         */
-        TypeRelation isSameTypeStrict = new SameTypeVisitor() {
-            @Override
-            boolean sameTypeVars(TypeVar tv1, TypeVar tv2) {
-                return tv1 == tv2;
-            }
-            @Override
-            protected boolean containsTypes(List<Type> ts1, List<Type> ts2) {
-                return isSameTypes(ts1, ts2, true);
-            }
-
-            @Override
-            public Boolean visitWildcardType(WildcardType t, Type s) {
-                if (!s.hasTag(WILDCARD)) {
-                    return false;
-                } else {
-                    WildcardType t2 = (WildcardType)s;
-                    return t.kind == t2.kind &&
-                            isSameType(t.type, t2.type, true);
-                }
-            }
         };
 
     // </editor-fold>
@@ -3848,17 +3777,11 @@
     // where
         class TypePair {
             final Type t1;
-            final Type t2;
-            boolean strict;
+            final Type t2;;
 
             TypePair(Type t1, Type t2) {
-                this(t1, t2, false);
-            }
-
-            TypePair(Type t1, Type t2, boolean strict) {
                 this.t1 = t1;
                 this.t2 = t2;
-                this.strict = strict;
             }
             @Override
             public int hashCode() {
@@ -3869,8 +3792,8 @@
                 if (!(obj instanceof TypePair))
                     return false;
                 TypePair typePair = (TypePair)obj;
-                return isSameType(t1, typePair.t1, strict)
-                    && isSameType(t2, typePair.t2, strict);
+                return isSameType(t1, typePair.t1)
+                    && isSameType(t2, typePair.t2);
             }
         }
         Set<TypePair> mergeCache = new HashSet<>();
@@ -4460,7 +4383,7 @@
                 Type tmpLower = Si.lower.hasTag(UNDETVAR) ? ((UndetVar)Si.lower).qtype : Si.lower;
                 if (!Si.bound.hasTag(ERROR) &&
                     !Si.lower.hasTag(ERROR) &&
-                    isSameType(tmpBound, tmpLower, false)) {
+                    isSameType(tmpBound, tmpLower)) {
                     currentS.head = Si.bound;
                 }
             }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java	Tue Jan 30 09:03:47 2018 -0800
@@ -565,7 +565,7 @@
                                             List<Type> argtypes) {
         final Type restype;
 
-        if (spMethod == null || types.isSameType(spMethod.getReturnType(), syms.objectType, true)) {
+        if (spMethod == null || types.isSameType(spMethod.getReturnType(), syms.objectType)) {
             // The return type of the polymorphic signature is polymorphic,
             // and is computed from the enclosing tree E, as follows:
             // if E is a cast, then use the target type of the cast expression
@@ -1227,8 +1227,8 @@
             } else {
                 IncorporationBinaryOp that = (IncorporationBinaryOp)o;
                 return opKind == that.opKind &&
-                        types.isSameType(op1, that.op1, true) &&
-                        types.isSameType(op2, that.op2, true);
+                        types.isSameType(op1, that.op1) &&
+                        types.isSameType(op2, that.op2);
             }
         }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java	Tue Jan 30 09:03:47 2018 -0800
@@ -788,7 +788,7 @@
             JCTypeCast typeCast = newExpression.hasTag(Tag.TYPECAST)
                 ? (JCTypeCast) newExpression
                 : null;
-            tree.expr = typeCast != null && types.isSameType(typeCast.type, originalTarget, true)
+            tree.expr = typeCast != null && types.isSameType(typeCast.type, originalTarget)
                 ? typeCast.expr
                 : newExpression;
         }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -358,6 +358,6 @@
             }
         }
         buf.append(")");
-        return foundTypeVariable ? configuration.links.getName(buf.toString()) : null;
+        return foundTypeVariable ? writer.links.getName(buf.toString()) : null;
     }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -90,7 +90,7 @@
         this.utils = configuration.utils;
         this.contents = configuration.contents;
         this.resources = configuration.resources;
-        this.links = configuration.links;
+        this.links = writer.links;
     }
 
     public AbstractMemberWriter(SubWriterHolderWriter writer) {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,6 @@
 
 import jdk.javadoc.internal.doclets.formats.html.markup.Table;
 
-import java.util.Arrays;
-
 import javax.lang.model.element.Element;
 import javax.lang.model.element.ExecutableElement;
 import javax.lang.model.element.TypeElement;
@@ -292,7 +290,7 @@
      */
     protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
         if (link) {
-            return Links.createLink(
+            return links.createLink(
                     SectionName.ANNOTATION_TYPE_FIELD_SUMMARY,
                     contents.navField);
         } else {
@@ -305,7 +303,7 @@
      */
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(Links.createLink(
+            liNav.addContent(links.createLink(
                     SectionName.ANNOTATION_TYPE_FIELD_DETAIL,
                     contents.navField));
         } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -159,7 +159,7 @@
     @Override
     protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
         if (link) {
-            return Links.createLink(
+            return links.createLink(
                     SectionName.ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY,
                     contents.navAnnotationTypeOptionalMember);
         } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,9 +27,6 @@
 
 import jdk.javadoc.internal.doclets.formats.html.markup.Table;
 
-import java.util.Arrays;
-import java.util.List;
-
 import javax.lang.model.element.Element;
 import javax.lang.model.element.ExecutableElement;
 import javax.lang.model.element.TypeElement;
@@ -308,7 +305,7 @@
      */
     protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
         if (link) {
-            return Links.createLink(
+            return links.createLink(
                     SectionName.ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY,
                     contents.navAnnotationTypeRequiredMember);
         } else {
@@ -321,7 +318,7 @@
      */
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(Links.createLink(
+            liNav.addContent(links.createLink(
                     SectionName.ANNOTATION_TYPE_ELEMENT_DETAIL,
                     contents.navAnnotationTypeMember));
         } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -109,7 +109,7 @@
      */
     @Override
     protected Content getNavLinkPackage() {
-        Content linkContent = Links.createLink(DocPaths.PACKAGE_SUMMARY,
+        Content linkContent = links.createLink(DocPaths.PACKAGE_SUMMARY,
                 contents.packageLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
@@ -133,7 +133,7 @@
      */
     @Override
     protected Content getNavLinkClassUse() {
-        Content linkContent = Links.createLink(DocPaths.CLASS_USE.resolve(filename), contents.useLabel);
+        Content linkContent = links.createLink(DocPaths.CLASS_USE.resolve(filename), contents.useLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
     }
@@ -347,7 +347,7 @@
      */
     @Override
     protected Content getNavLinkTree() {
-        Content treeLinkContent = Links.createLink(DocPaths.PACKAGE_TREE,
+        Content treeLinkContent = links.createLink(DocPaths.PACKAGE_TREE,
                 contents.treeLabel, "", "");
         Content li = HtmlTree.LI(treeLinkContent);
         return li;
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -515,7 +515,7 @@
      */
     protected Content getNavLinkPackage() {
         Content linkContent =
-                Links.createLink(DocPath.parent.resolve(DocPaths.PACKAGE_SUMMARY), contents.packageLabel);
+                links.createLink(DocPath.parent.resolve(DocPaths.PACKAGE_SUMMARY), contents.packageLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
     }
@@ -550,8 +550,8 @@
      */
     protected Content getNavLinkTree() {
         Content linkContent = utils.isEnclosingPackageIncluded(typeElement)
-                ? Links.createLink(DocPath.parent.resolve(DocPaths.PACKAGE_TREE), contents.treeLabel)
-                : Links.createLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), contents.treeLabel);
+                ? links.createLink(DocPath.parent.resolve(DocPaths.PACKAGE_TREE), contents.treeLabel)
+                : links.createLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), contents.treeLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
     }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -120,7 +120,7 @@
      */
     @Override
     protected Content getNavLinkPackage() {
-        Content linkContent = Links.createLink(DocPaths.PACKAGE_SUMMARY,
+        Content linkContent = links.createLink(DocPaths.PACKAGE_SUMMARY,
                 contents.packageLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
@@ -144,7 +144,7 @@
      */
     @Override
     protected Content getNavLinkClassUse() {
-        Content linkContent = Links.createLink(DocPaths.CLASS_USE.resolve(filename), contents.useLabel);
+        Content linkContent = links.createLink(DocPaths.CLASS_USE.resolve(filename), contents.useLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
     }
@@ -660,7 +660,7 @@
      */
     @Override
     protected Content getNavLinkTree() {
-        Content treeLinkContent = Links.createLink(DocPaths.PACKAGE_TREE,
+        Content treeLinkContent = links.createLink(DocPaths.PACKAGE_TREE,
                 contents.treeLabel, "", "");
         Content li = HtmlTree.LI(treeLinkContent);
         return li;
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -135,13 +135,13 @@
         //add link to summary
         Content link;
         if (pkg.isUnnamed()) {
-            link = Links.createLink(SectionName.UNNAMED_PACKAGE_ANCHOR,
+            link = links.createLink(SectionName.UNNAMED_PACKAGE_ANCHOR,
                     contents.defaultPackageLabel, "", "");
         } else {
             String parsedPackageName = utils.parsePackageName(pkg);
             Content packageNameContent = getPackageLabel(parsedPackageName);
             packageNameContent.addContent(".*");
-            link = Links.createLink(DocLink.fragment(parsedPackageName),
+            link = links.createLink(DocLink.fragment(parsedPackageName),
                     packageNameContent, "", "");
             PackageElement abbrevPkg = configuration.workArounds.getAbbreviatedPackageElement(pkg);
             printedPackageHeaders.add(abbrevPkg);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -300,7 +300,7 @@
     @Override
     protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
         if (link) {
-            return Links.createLink(SectionName.CONSTRUCTOR_SUMMARY,
+            return links.createLink(SectionName.CONSTRUCTOR_SUMMARY,
                     contents.navConstructor);
         } else {
             return contents.navConstructor;
@@ -313,7 +313,7 @@
     @Override
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(Links.createLink(
+            liNav.addContent(links.createLink(
                     SectionName.CONSTRUCTOR_DETAIL,
                     contents.navConstructor));
         } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -281,7 +281,7 @@
     protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
         if (link) {
             if (typeElement == null) {
-                return Links.createLink(SectionName.ENUM_CONSTANT_SUMMARY,
+                return links.createLink(SectionName.ENUM_CONSTANT_SUMMARY,
                         contents.navEnum);
             } else {
                 return links.createLink(
@@ -299,7 +299,7 @@
     @Override
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(Links.createLink(
+            liNav.addContent(links.createLink(
                     SectionName.ENUM_CONSTANT_DETAIL,
                     contents.navEnum));
         } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -310,7 +310,7 @@
     protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
         if (link) {
             if (typeElement == null) {
-                return Links.createLink(
+                return links.createLink(
                         SectionName.FIELD_SUMMARY,
                         contents.navField);
             } else {
@@ -329,7 +329,7 @@
     @Override
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(Links.createLink(
+            liNav.addContent(links.createLink(
                     SectionName.FIELD_DETAIL,
                     contents.navField));
         } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
 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.Links;
 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
 import jdk.javadoc.internal.doclets.toolkit.Content;
 import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
@@ -54,6 +53,7 @@
 
     /**
      * Constructor to construct HelpWriter object.
+     * @param configuration the configuration
      * @param filename File to be generated.
      */
     public HelpWriter(HtmlConfiguration configuration,
@@ -67,6 +67,7 @@
      * will get generated if and only if "-helpfile" and "-nohelp" is not used
      * on the command line.
      *
+     * @param configuration the configuration
      * @throws DocFileIOException if there is a problem while generating the documentation
      */
     public static void generate(HtmlConfiguration configuration) throws DocFileIOException {
@@ -133,7 +134,7 @@
                     ? HtmlTree.SECTION(overviewHeading)
                     : HtmlTree.LI(HtmlStyle.blockList, overviewHeading);
             Content line3 = contents.getContent("doclet.Help_line_3",
-                    Links.createLink(DocPaths.overviewSummary(configuration.frames),
+                    links.createLink(DocPaths.overviewSummary(configuration.frames),
                     configuration.getText("doclet.Overview")));
             Content overviewPara = HtmlTree.P(line3);
             htmlTree.addContent(overviewPara);
@@ -283,7 +284,7 @@
                     ? HtmlTree.SECTION(treeHead)
                     : HtmlTree.LI(HtmlStyle.blockList, treeHead);
             Content line17 = contents.getContent("doclet.Help_line_17_with_tree_link",
-                    Links.createLink(DocPaths.OVERVIEW_TREE,
+                    links.createLink(DocPaths.OVERVIEW_TREE,
                     configuration.getText("doclet.Class_Hierarchy")),
                     HtmlTree.CODE(new StringContent("java.lang.Object")));
             Content treePara = HtmlTree.P(line17);
@@ -308,7 +309,7 @@
                     ? HtmlTree.SECTION(dHead)
                     : HtmlTree.LI(HtmlStyle.blockList, dHead);
             Content line20 = contents.getContent("doclet.Help_line_20_with_deprecated_api_link",
-                    Links.createLink(DocPaths.DEPRECATED_LIST,
+                    links.createLink(DocPaths.DEPRECATED_LIST,
                     configuration.getText("doclet.Deprecated_API")));
             Content dPara = HtmlTree.P(line20);
             htmlTree.addContent(dPara);
@@ -321,10 +322,10 @@
         if (configuration.createindex) {
             Content indexlink;
             if (configuration.splitindex) {
-                indexlink = Links.createLink(DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1)),
+                indexlink = links.createLink(DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1)),
                         configuration.getText("doclet.Index"));
             } else {
-                indexlink = Links.createLink(DocPaths.INDEX_ALL,
+                indexlink = links.createLink(DocPaths.INDEX_ALL,
                         configuration.getText("doclet.Index"));
             }
             Content indexHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
@@ -378,7 +379,7 @@
                 ? HtmlTree.SECTION(allclassesHead)
                 : HtmlTree.LI(HtmlStyle.blockList, allclassesHead);
         Content line27 = contents.getContent("doclet.Help_line_27",
-                Links.createLink(DocPaths.AllClasses(configuration.frames),
+                links.createLink(DocPaths.AllClasses(configuration.frames),
                 resources.getText("doclet.All_Classes")));
         Content allclassesPara = HtmlTree.P(line27);
         htmlTree.addContent(allclassesPara);
@@ -406,7 +407,7 @@
                 ? HtmlTree.SECTION(constHead)
                 : HtmlTree.LI(HtmlStyle.blockList, constHead);
         Content line29 = contents.getContent("doclet.Help_line_29",
-                Links.createLink(DocPaths.CONSTANT_VALUES,
+                links.createLink(DocPaths.CONSTANT_VALUES,
                 resources.getText("doclet.Constants_Summary")));
         Content constPara = HtmlTree.P(line29);
         htmlTree.addContent(constPara);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java	Tue Jan 30 09:03:47 2018 -0800
@@ -245,8 +245,6 @@
 
     protected final Messages messages;
 
-    protected Links links;
-
     /**
      * Creates an object to hold the configuration for a doclet.
      *
@@ -363,7 +361,6 @@
         setTopFile(docEnv);
         workArounds.initDocLint(doclintOpts.values(), tagletManager.getCustomTagNames(),
                 Utils.toLowerCase(htmlVersion.name()));
-        links = new Links(htmlVersion);
         return true;
     }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -197,7 +197,7 @@
         this.contents = configuration.contents;
         this.messages = configuration.messages;
         this.resources = configuration.resources;
-        this.links = configuration.links;
+        this.links = new Links(path, configuration.htmlVersion);
         this.utils = configuration.utils;
         this.path = path;
         this.pathToRoot = path.parent().invert();
@@ -371,7 +371,7 @@
      */
     public Content getTargetPackageLink(PackageElement pkg, String target,
             Content label) {
-        return Links.createLink(pathString(pkg, DocPaths.PACKAGE_SUMMARY), label, "", target);
+        return links.createLink(pathString(pkg, DocPaths.PACKAGE_SUMMARY), label, "", target);
     }
 
     /**
@@ -385,7 +385,7 @@
      */
     public Content getTargetModulePackageLink(PackageElement pkg, String target,
             Content label, ModuleElement mdle) {
-        return Links.createLink(pathString(pkg, DocPaths.PACKAGE_SUMMARY),
+        return links.createLink(pathString(pkg, DocPaths.PACKAGE_SUMMARY),
                 label, "", target);
     }
 
@@ -398,7 +398,7 @@
      * @return a content for the target module link
      */
     public Content getTargetModuleLink(String target, Content label, ModuleElement mdle) {
-        return Links.createLink(pathToRoot.resolve(
+        return links.createLink(pathToRoot.resolve(
                 DocPaths.moduleSummary(mdle)), label, "", target);
     }
 
@@ -509,7 +509,7 @@
                 //WCAG - Hyperlinks should contain text or an image with alt text - for AT tools
                 navDiv.addContent(a);
                 Content skipLinkContent = HtmlTree.DIV(HtmlStyle.skipNav,
-                        Links.createLink(SectionName.SKIP_NAVBAR_TOP, skipNavLinks,
+                        links.createLink(SectionName.SKIP_NAVBAR_TOP, skipNavLinks,
                         skipNavLinks.toString(), ""));
                 navDiv.addContent(skipLinkContent);
             } else {
@@ -519,7 +519,7 @@
                 Content a = links.createAnchor(SectionName.NAVBAR_BOTTOM);
                 navDiv.addContent(a);
                 Content skipLinkContent = HtmlTree.DIV(HtmlStyle.skipNav,
-                        Links.createLink(SectionName.SKIP_NAVBAR_BOTTOM, skipNavLinks,
+                        links.createLink(SectionName.SKIP_NAVBAR_BOTTOM, skipNavLinks,
                         skipNavLinks.toString(), ""));
                 navDiv.addContent(skipLinkContent);
             }
@@ -651,7 +651,7 @@
      * @return a content tree for the link
      */
     protected Content getNavLinkContents() {
-        Content linkContent = Links.createLink(pathToRoot.resolve(DocPaths.overviewSummary(configuration.frames)),
+        Content linkContent = links.createLink(pathToRoot.resolve(DocPaths.overviewSummary(configuration.frames)),
                 contents.overviewLabel, "", "");
         Content li = HtmlTree.LI(linkContent);
         return li;
@@ -720,7 +720,7 @@
     public Content getNavLinkPrevious(DocPath prev) {
         Content li;
         if (prev != null) {
-            li = HtmlTree.LI(Links.createLink(prev, contents.prevLabel, "", ""));
+            li = HtmlTree.LI(links.createLink(prev, contents.prevLabel, "", ""));
         }
         else
             li = HtmlTree.LI(contents.prevLabel);
@@ -737,7 +737,7 @@
     public Content getNavLinkNext(DocPath next) {
         Content li;
         if (next != null) {
-            li = HtmlTree.LI(Links.createLink(next, contents.nextLabel, "", ""));
+            li = HtmlTree.LI(links.createLink(next, contents.nextLabel, "", ""));
         }
         else
             li = HtmlTree.LI(contents.nextLabel);
@@ -752,7 +752,7 @@
      */
     protected Content getNavShowLists(DocPath link) {
         DocLink dl = new DocLink(link, path.getPath(), null);
-        Content framesContent = Links.createLink(dl, contents.framesLabel, "", "_top");
+        Content framesContent = links.createLink(dl, contents.framesLabel, "", "_top");
         Content li = HtmlTree.LI(framesContent);
         return li;
     }
@@ -773,7 +773,7 @@
      * @return a content tree for the link
      */
     protected Content getNavHideLists(DocPath link) {
-        Content noFramesContent = Links.createLink(link, contents.noFramesLabel, "", "_top");
+        Content noFramesContent = links.createLink(link, contents.noFramesLabel, "", "_top");
         Content li = HtmlTree.LI(noFramesContent);
         return li;
     }
@@ -791,7 +791,7 @@
         DocPath docPath = packages.size() == 1 && configuration.getSpecifiedTypeElements().isEmpty()
                 ? pathString(packages.get(0), DocPaths.PACKAGE_TREE)
                 : pathToRoot.resolve(DocPaths.OVERVIEW_TREE);
-        return HtmlTree.LI(Links.createLink(docPath, contents.treeLabel, "", ""));
+        return HtmlTree.LI(links.createLink(docPath, contents.treeLabel, "", ""));
     }
 
     /**
@@ -801,7 +801,7 @@
      * @return a content tree for the link
      */
     protected Content getNavLinkMainTree(String label) {
-        Content mainTreeContent = Links.createLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE),
+        Content mainTreeContent = links.createLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE),
                 new StringContent(label));
         Content li = HtmlTree.LI(mainTreeContent);
         return li;
@@ -823,7 +823,7 @@
      * @return a content tree for the link
      */
     protected Content getNavLinkDeprecated() {
-        Content linkContent = Links.createLink(pathToRoot.resolve(DocPaths.DEPRECATED_LIST),
+        Content linkContent = links.createLink(pathToRoot.resolve(DocPaths.DEPRECATED_LIST),
                 contents.deprecatedLabel, "", "");
         Content li = HtmlTree.LI(linkContent);
         return li;
@@ -837,7 +837,7 @@
      * @return a content tree for the link
      */
     protected Content getNavLinkClassIndex() {
-        Content allClassesContent = Links.createLink(pathToRoot.resolve(
+        Content allClassesContent = links.createLink(pathToRoot.resolve(
                 DocPaths.AllClasses(configuration.frames)),
                 contents.allClassesLabel, "", "");
         Content li = HtmlTree.LI(allClassesContent);
@@ -850,7 +850,7 @@
      * @return a content tree for the link
      */
     protected Content getNavLinkIndex() {
-        Content linkContent = Links.createLink(pathToRoot.resolve(
+        Content linkContent = links.createLink(pathToRoot.resolve(
                 (configuration.splitindex
                     ? DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1))
                     : DocPaths.INDEX_ALL)),
@@ -875,7 +875,7 @@
             DocFile file = DocFile.createFileForInput(configuration, helpfile);
             helpfilenm = DocPath.create(file.getName());
         }
-        Content linkContent = Links.createLink(pathToRoot.resolve(helpfilenm),
+        Content linkContent = links.createLink(pathToRoot.resolve(helpfilenm),
                 contents.helpLabel, "", "");
         Content li = HtmlTree.LI(linkContent);
         return li;
@@ -999,12 +999,12 @@
             }
         }
         if (included || packageElement == null) {
-            return Links.createLink(pathString(packageElement, DocPaths.PACKAGE_SUMMARY),
+            return links.createLink(pathString(packageElement, DocPaths.PACKAGE_SUMMARY),
                     label);
         } else {
             DocLink crossPkgLink = getCrossPackageLink(utils.getPackageName(packageElement));
             if (crossPkgLink != null) {
-                return Links.createLink(crossPkgLink, label);
+                return links.createLink(crossPkgLink, label);
             } else {
                 return label;
             }
@@ -1021,7 +1021,7 @@
     public Content getModuleLink(ModuleElement mdle, Content label) {
         boolean included = utils.isIncluded(mdle);
         return (included)
-                ? Links.createLink(pathToRoot.resolve(DocPaths.moduleSummary(mdle)), label, "", "")
+                ? links.createLink(pathToRoot.resolve(DocPaths.moduleSummary(mdle)), label, "", "")
                 : label;
     }
 
@@ -1051,7 +1051,7 @@
         DocPath href = pathToRoot
                 .resolve(DocPaths.SOURCE_OUTPUT)
                 .resolve(DocPath.forClass(utils, te));
-        Content linkContent = Links.createLink(href
+        Content linkContent = links.createLink(href
                 .fragment(SourceToHTMLConverter.getAnchorName(utils, typeElement)), label, "", "");
         htmltree.addContent(linkContent);
     }
@@ -1115,7 +1115,7 @@
                 */
                 DocLink link = configuration.extern.getExternalLink(packageName, pathToRoot,
                                 className + ".html", refMemName);
-                return Links.createLink(link,
+                return links.createLink(link,
                     (label == null) || label.isEmpty() ? defaultLabel : label,
                     strong,
                     resources.getText("doclet.Href_Class_Or_Interface_Title", packageName),
@@ -1422,7 +1422,7 @@
                         ? getCrossModuleLink(refClassName) : getCrossPackageLink(refClassName);
                 if (elementCrossLink != null) {
                     // Element cross link found
-                    return Links.createLink(elementCrossLink,
+                    return links.createLink(elementCrossLink,
                             (label.isEmpty() ? text : label), true);
                 } else if ((classCrossLink = getCrossClassLink(refClassName,
                         refMemName, label, false, !isLinkPlain)) != null) {
@@ -1752,8 +1752,9 @@
                     result.addContent(sb);
                     Content docRootContent = new ContentBuilder();
 
+                    boolean isHRef = inAnAtag() && node.getName().toString().equalsIgnoreCase("href");
                     for (DocTree dt : node.getValue()) {
-                        if (utils.isText(dt) && inAnAtag()) {
+                        if (utils.isText(dt) && isHRef) {
                             String text = ((TextTree) dt).getBody();
                             if (text.startsWith("/..") && !configuration.docrootparent.isEmpty()) {
                                 result.addContent(configuration.docrootparent);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@
 import javax.lang.model.type.TypeMirror;
 
 import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
-import jdk.javadoc.internal.doclets.formats.html.markup.Links;
 import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
 import jdk.javadoc.internal.doclets.toolkit.Content;
 import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
@@ -93,7 +92,7 @@
                 DocPath filename = getPath(classLinkInfo);
                 if (linkInfo.linkToSelf ||
                                 !(DocPath.forName(utils, typeElement)).equals(m_writer.filename)) {
-                        link.addContent(Links.createLink(
+                        link.addContent(m_writer.links.createLink(
                                 filename.fragment(classLinkInfo.where),
                                 label,
                                 classLinkInfo.isStrong,
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java	Tue Jan 30 09:03:47 2018 -0800
@@ -432,7 +432,7 @@
     protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
         if (link) {
             if (typeElement == null) {
-                return Links.createLink(
+                return links.createLink(
                         SectionName.METHOD_SUMMARY,
                         contents.navMethod);
             } else {
@@ -451,7 +451,7 @@
     @Override
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(Links.createLink(
+            liNav.addContent(links.createLink(
                     SectionName.METHOD_DETAIL, contents.navMethod));
         } else {
             liNav.addContent(contents.navMethod);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -101,7 +101,7 @@
                 ? HtmlTree.MAIN()
                 : body;
         Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar,
-                Links.createLink(DocPaths.moduleSummary(moduleElement), mdlLabel, "", "classFrame"));
+                mdlgen.links.createLink(DocPaths.moduleSummary(moduleElement), mdlLabel, "", "classFrame"));
         htmlTree.addContent(heading);
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
         div.setStyle(HtmlStyle.indexContainer);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -152,7 +152,7 @@
      * @param ul the Content object to which the all classes link should be added
      */
     protected void addAllClassesLink(Content ul) {
-        Content linkContent = Links.createLink(DocPaths.ALLCLASSES_FRAME,
+        Content linkContent = links.createLink(DocPaths.ALLCLASSES_FRAME,
                 contents.allClassesLabel, "", "packageFrame");
         Content li = HtmlTree.LI(linkContent);
         ul.addContent(li);
@@ -165,7 +165,7 @@
      * @param ul the Content object to which the all packages link should be added
      */
     protected void addAllPackagesLink(Content ul) {
-        Content linkContent = Links.createLink(DocPaths.OVERVIEW_FRAME,
+        Content linkContent = links.createLink(DocPaths.OVERVIEW_FRAME,
                 contents.allPackagesLabel, "", "packageListFrame");
         Content li = HtmlTree.LI(linkContent);
         ul.addContent(li);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -143,12 +143,12 @@
         Content pkgLabel;
         if (!pkg.isUnnamed()) {
             pkgLabel = getPackageLabel(utils.getPackageName(pkg));
-            packageLinkContent = Links.createLink(pathString(pkg,
+            packageLinkContent = links.createLink(pathString(pkg,
                      DocPaths.PACKAGE_FRAME), pkgLabel, "",
                     "packageFrame");
         } else {
             pkgLabel = new StringContent("<unnamed package>");
-            packageLinkContent = Links.createLink(DocPaths.PACKAGE_FRAME,
+            packageLinkContent = links.createLink(DocPaths.PACKAGE_FRAME,
                     pkgLabel, "", "packageFrame");
         }
         Content li = HtmlTree.LI(packageLinkContent);
@@ -189,7 +189,7 @@
      * @param ul the Content object to which the all classes link should be added
      */
     protected void addAllClassesLink(Content ul) {
-        Content linkContent = Links.createLink(DocPaths.ALLCLASSES_FRAME,
+        Content linkContent = links.createLink(DocPaths.ALLCLASSES_FRAME,
                 contents.allClassesLabel, "", "packageFrame");
         Content li = HtmlTree.LI(linkContent);
         ul.addContent(li);
@@ -202,7 +202,7 @@
      * @param ul the Content object to which the all packages link should be added
      */
     protected void addAllPackagesLink(Content ul) {
-        Content linkContent = Links.createLink(DocPaths.OVERVIEW_FRAME,
+        Content linkContent = links.createLink(DocPaths.OVERVIEW_FRAME,
                 contents.allPackagesLabel, "", "packageListFrame");
         Content li = HtmlTree.LI(linkContent);
         ul.addContent(li);
@@ -215,7 +215,7 @@
      * @param ul the Content object to which the all modules link should be added
      */
     protected void addAllModulesLink(Content ul) {
-        Content linkContent = Links.createLink(DocPaths.MODULE_OVERVIEW_FRAME,
+        Content linkContent = links.createLink(DocPaths.MODULE_OVERVIEW_FRAME,
                 contents.allModulesLabel, "", "packageListFrame");
         Content li = HtmlTree.LI(linkContent);
         ul.addContent(li);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -951,20 +951,20 @@
         Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
         Content liNav = new HtmlTree(HtmlTag.LI);
         liNav.addContent(!utils.getFullBody(mdle).isEmpty() && !configuration.nocomment
-                ? Links.createLink(SectionName.MODULE_DESCRIPTION, contents.navModuleDescription)
+                ? links.createLink(SectionName.MODULE_DESCRIPTION, contents.navModuleDescription)
                 : contents.navModuleDescription);
         addNavGap(liNav);
         liNav.addContent((display(requires) || display(indirectModules))
-                ? Links.createLink(SectionName.MODULES, contents.navModules)
+                ? links.createLink(SectionName.MODULES, contents.navModules)
                 : contents.navModules);
         addNavGap(liNav);
         liNav.addContent((display(packages)
                 || display(indirectPackages) || display(indirectOpenPackages))
-                ? Links.createLink(SectionName.PACKAGES, contents.navPackages)
+                ? links.createLink(SectionName.PACKAGES, contents.navPackages)
                 : contents.navPackages);
         addNavGap(liNav);
         liNav.addContent((displayServices(uses, usesTrees) || displayServices(provides.keySet(), providesTrees))
-                ? Links.createLink(SectionName.SERVICES, contents.navServices)
+                ? links.createLink(SectionName.SERVICES, contents.navServices)
                 : contents.navServices);
         ulNav.addContent(liNav);
         return ulNav;
@@ -1056,7 +1056,7 @@
         if (prevModule == null) {
             li = HtmlTree.LI(contents.prevModuleLabel);
         } else {
-            li = HtmlTree.LI(Links.createLink(pathToRoot.resolve(DocPaths.moduleSummary(
+            li = HtmlTree.LI(links.createLink(pathToRoot.resolve(DocPaths.moduleSummary(
                     prevModule)), contents.prevModuleLabel, "", ""));
         }
         return li;
@@ -1073,7 +1073,7 @@
         if (nextModule == null) {
             li = HtmlTree.LI(contents.nextModuleLabel);
         } else {
-            li = HtmlTree.LI(Links.createLink(pathToRoot.resolve(DocPaths.moduleSummary(
+            li = HtmlTree.LI(links.createLink(pathToRoot.resolve(DocPaths.moduleSummary(
                     nextModule)), contents.nextModuleLabel, "", ""));
         }
         return li;
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -213,7 +213,7 @@
     protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
         if (link) {
             if (typeElement == null) {
-                return Links.createLink(
+                return links.createLink(
                         SectionName.NESTED_CLASS_SUMMARY,
                         contents.navNested);
             } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,6 @@
 
 package jdk.javadoc.internal.doclets.formats.html;
 
-import java.util.Collection;
-
 import javax.lang.model.element.PackageElement;
 
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
@@ -110,11 +108,11 @@
         Content packageLabel;
         if (pe.isUnnamed()) {
             packageLabel = new StringContent("<unnamed package>");
-            packageLinkContent = Links.createLink(DocPaths.PACKAGE_FRAME,
+            packageLinkContent = links.createLink(DocPaths.PACKAGE_FRAME,
                     packageLabel, "", "packageFrame");
         } else {
             packageLabel = getPackageLabel(pe.getQualifiedName());
-            packageLinkContent = Links.createLink(pathString(pe,
+            packageLinkContent = links.createLink(pathString(pe,
                      DocPaths.PACKAGE_FRAME), packageLabel, "",
                     "packageFrame");
         }
@@ -153,7 +151,7 @@
      */
     @Override
     protected void addAllClassesLink(Content ul) {
-        Content linkContent = Links.createLink(DocPaths.ALLCLASSES_FRAME,
+        Content linkContent = links.createLink(DocPaths.ALLCLASSES_FRAME,
                 contents.allClassesLabel, "", "packageFrame");
         Content li = HtmlTree.LI(linkContent);
         ul.addContent(li);
@@ -167,7 +165,7 @@
      */
     @Override
     protected void addAllModulesLink(Content ul) {
-        Content linkContent = Links.createLink(DocPaths.MODULE_OVERVIEW_FRAME,
+        Content linkContent = links.createLink(DocPaths.MODULE_OVERVIEW_FRAME,
                 contents.allModulesLabel, "", "packageListFrame");
         Content li = HtmlTree.LI(linkContent);
         ul.addContent(li);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -232,7 +232,7 @@
      */
     @Override
     protected Content getNavLinkPackage() {
-        Content linkContent = Links.createLink(DocPaths.PACKAGE_SUMMARY,
+        Content linkContent = links.createLink(DocPaths.PACKAGE_SUMMARY,
                 contents.packageLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -223,7 +223,7 @@
                 DocPath dp = pathString(te,
                         DocPaths.CLASS_USE.resolve(DocPath.forName(utils, te)));
                 Content stringContent = new StringContent(utils.getSimpleName(te));
-                Content typeContent = Links.createLink(dp.fragment(getPackageAnchorName(usingPackage)),
+                Content typeContent = links.createLink(dp.fragment(getPackageAnchorName(usingPackage)),
                         stringContent);
                 Content summary = new ContentBuilder();
                 addIndexComment(te, summary);
@@ -288,7 +288,7 @@
      */
     @Override
     protected Content getNavLinkPackage() {
-        Content linkContent = Links.createLink(DocPaths.PACKAGE_SUMMARY,
+        Content linkContent = links.createLink(DocPaths.PACKAGE_SUMMARY,
                 contents.packageLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
@@ -312,7 +312,7 @@
      */
     @Override
     protected Content getNavLinkTree() {
-        Content linkContent = Links.createLink(DocPaths.PACKAGE_TREE,
+        Content linkContent = links.createLink(DocPaths.PACKAGE_TREE,
                 contents.treeLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -385,7 +385,7 @@
      */
     @Override
     protected Content getNavLinkClassUse() {
-        Content useLink = Links.createLink(DocPaths.PACKAGE_USE,
+        Content useLink = links.createLink(DocPaths.PACKAGE_USE,
                 contents.useLabel, "", "");
         Content li = HtmlTree.LI(useLink);
         return li;
@@ -403,7 +403,7 @@
             li = HtmlTree.LI(contents.prevPackageLabel);
         } else {
             DocPath p = DocPath.relativePath(packageElement, prev);
-            li = HtmlTree.LI(Links.createLink(p.resolve(DocPaths.PACKAGE_SUMMARY),
+            li = HtmlTree.LI(links.createLink(p.resolve(DocPaths.PACKAGE_SUMMARY),
                 contents.prevPackageLabel, "", ""));
         }
         return li;
@@ -421,7 +421,7 @@
             li = HtmlTree.LI(contents.nextPackageLabel);
         } else {
             DocPath p = DocPath.relativePath(packageElement, next);
-            li = HtmlTree.LI(Links.createLink(p.resolve(DocPaths.PACKAGE_SUMMARY),
+            li = HtmlTree.LI(links.createLink(p.resolve(DocPaths.PACKAGE_SUMMARY),
                 contents.nextPackageLabel, "", ""));
         }
         return li;
@@ -435,7 +435,7 @@
      */
     @Override
     protected Content getNavLinkTree() {
-        Content useLink = Links.createLink(DocPaths.PACKAGE_TREE,
+        Content useLink = links.createLink(DocPaths.PACKAGE_TREE,
                 contents.treeLabel, "", "");
         Content li = HtmlTree.LI(useLink);
         return li;
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -332,7 +332,7 @@
     protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
         if (link) {
             if (typeElement == null) {
-                return Links.createLink(
+                return links.createLink(
                         SectionName.PROPERTY_SUMMARY,
                         contents.navProperty);
             } else {
@@ -351,7 +351,7 @@
     @Override
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(Links.createLink(
+            liNav.addContent(links.createLink(
                     SectionName.PROPERTY_DETAIL,
                     contents.navProperty));
         } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -177,7 +177,7 @@
     protected void addLinksForIndexes(Content contentTree) {
         for (int i = 0; i < indexElements.size(); i++) {
             int j = i + 1;
-            contentTree.addContent(Links.createLink(DocPaths.indexN(j),
+            contentTree.addContent(links.createLink(DocPaths.indexN(j),
                     new StringContent(indexElements.get(i).toString())));
             contentTree.addContent(Contents.SPACE);
         }
@@ -195,7 +195,7 @@
             return HtmlTree.LI(prevletterLabel);
         }
         else {
-            Content prevLink = Links.createLink(DocPaths.indexN(prev),
+            Content prevLink = links.createLink(DocPaths.indexN(prev),
                     prevletterLabel);
             return HtmlTree.LI(prevLink);
         }
@@ -213,7 +213,7 @@
             return HtmlTree.LI(nextletterLabel);
         }
         else {
-            Content nextLink = Links.createLink(DocPaths.indexN(next),
+            Content nextLink = links.createLink(DocPaths.indexN(next),
                     nextletterLabel);
             return HtmlTree.LI(nextLink);
         }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -106,7 +106,7 @@
         }
         String desc = ch.getText(itt.getDescription());
 
-        String anchorName = configuration.links.getName(tagText);
+        String anchorName = htmlWriter.links.getName(tagText);
         Content result = HtmlTree.A_ID(HtmlStyle.searchTagResult, anchorName, new StringContent(tagText));
         if (configuration.createindex && !tagText.isEmpty()) {
             SearchIndexItem si = new SearchIndexItem();
@@ -288,7 +288,7 @@
                     ((ClassWriterImpl) htmlWriter).getTypeElement().getQualifiedName() + "." +
                     utils.getSimpleName(holder);
             DocLink link = constantsPath.fragment(whichConstant);
-            body.addContent(Links.createLink(link,
+            body.addContent(htmlWriter.links.createLink(link,
                     new StringContent(configuration.getText("doclet.Constants_Summary"))));
         }
         if (utils.isClass(holder) && utils.isSerializable((TypeElement)holder)) {
@@ -298,7 +298,7 @@
                 appendSeparatorIfNotEmpty(body);
                 DocPath serialPath = htmlWriter.pathToRoot.resolve(DocPaths.SERIALIZED_FORM);
                 DocLink link = serialPath.fragment(utils.getFullyQualifiedName(holder));
-                body.addContent(Links.createLink(link,
+                body.addContent(htmlWriter.links.createLink(link,
                         new StringContent(configuration.getText("doclet.Serialized_Form"))));
             }
         }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -162,7 +162,7 @@
                     continue;
                 }
                 DocPath link = pathString(pkg, DocPaths.PACKAGE_TREE);
-                Content li = HtmlTree.LI(Links.createLink(link,
+                Content li = HtmlTree.LI(links.createLink(link,
                         new StringContent(utils.getPackageName(pkg))));
                 if (i < packages.size() - 1) {
                     li.addContent(", ");
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,17 +46,20 @@
  */
 public class Links {
 
+    private final DocPath file;
     private final HtmlVersion version;
 
     /**
-     * Creates a {@code Links} object for a specific HTML version.
+     * Creates a {@code Links} object for a specific file, to be written in a specific HTML version.
      * The version is used by the {@link #getName(String) getName} method
      * to help determine valid HTML names (ids), and to determine whether
      * to use an {@code id} or {@code name} attribute when creating anchors.
      *
+     * @param file the file
      * @param version the HTML version
      */
-    public Links(HtmlVersion version) {
+    public Links(DocPath file, HtmlVersion version) {
+        this.file = file;
         this.version = version;
     }
 
@@ -118,7 +121,7 @@
      */
     public Content createLink(String where, Content label) {
         DocLink l = DocLink.fragment(getName(where));
-        return Links.createLink(l, label, "", "");
+        return createLink(l, label, "", "");
     }
 
     /**
@@ -128,9 +131,9 @@
      * @param label         the content for the link
      * @return a content tree for the link
      */
-    public static Content createLink(SectionName sectionName, Content label) {
+    public Content createLink(SectionName sectionName, Content label) {
         DocLink l =  DocLink.fragment(sectionName.getName());
-        return Links.createLink(l, label, "", "");
+        return createLink(l, label, "", "");
     }
 
     /**
@@ -145,7 +148,7 @@
      */
     public Content createLink(SectionName sectionName, String where, Content label) {
         DocLink l =  DocLink.fragment(sectionName.getName() + getName(where));
-        return Links.createLink(l, label, "", "");
+        return createLink(l, label, "", "");
     }
 
     /**
@@ -157,7 +160,7 @@
      * @param target    the target for the link, or null
      * @return a content tree for the link
      */
-    public static Content createLink(SectionName sectionName, Content label, String title, String target) {
+    public Content createLink(SectionName sectionName, Content label, String title, String target) {
         DocLink l = DocLink.fragment(sectionName.getName());
         return createLink(l, label, title, target);
     }
@@ -169,8 +172,8 @@
      * @param label  the content for the link
      * @return a content tree for the link
      */
-    public static Content createLink(DocPath path, String label) {
-        return Links.createLink(path, new StringContent(label), false, "", "");
+    public Content createLink(DocPath path, String label) {
+        return createLink(path, new StringContent(label), false, "", "");
     }
 
     /**
@@ -180,8 +183,8 @@
      * @param label  the content for the link
      * @return a content tree for the link
      */
-    public static Content createLink(DocPath path, Content label) {
-        return Links.createLink(path, label, "", "");
+    public Content createLink(DocPath path, Content label) {
+        return createLink(path, label, "", "");
     }
 
     /**
@@ -196,7 +199,7 @@
      * @param target    the target for the link, or null
      * @return a content tree for the link
      */
-    public static Content createLink(DocPath path, Content label, boolean strong,
+    public Content createLink(DocPath path, Content label, boolean strong,
             String title, String target) {
         return createLink(new DocLink(path), label, strong, title, target);
     }
@@ -210,8 +213,8 @@
      * @param target    the target for the link, or null
      * @return a content tree for the link
      */
-    public static Content createLink(DocPath path, Content label, String title, String target) {
-        return Links.createLink(new DocLink(path), label, title, target);
+    public Content createLink(DocPath path, Content label, String title, String target) {
+        return createLink(new DocLink(path), label, title, target);
     }
 
     /**
@@ -221,8 +224,8 @@
      * @param label     the content for the link
      * @return a content tree for the link
      */
-    public static Content createLink(DocLink link, Content label) {
-        return Links.createLink(link, label, "", "");
+    public Content createLink(DocLink link, Content label) {
+        return createLink(link, label, "", "");
     }
 
     /**
@@ -234,8 +237,8 @@
      * @param target    the target for the link, or null
      * @return a content tree for the link
      */
-    public static Content createLink(DocLink link, Content label, String title, String target) {
-        HtmlTree anchor = HtmlTree.A(link.toString(), label);
+    public Content createLink(DocLink link, Content label, String title, String target) {
+        HtmlTree anchor = HtmlTree.A(link.relativizeAgainst(file).toString(), label);
         if (title != null && title.length() != 0) {
             anchor.addAttr(HtmlAttr.TITLE, title);
         }
@@ -257,7 +260,7 @@
      * @param target    the target for the link, or null
      * @return a content tree for the link
      */
-    public static Content createLink(DocLink link, Content label, boolean strong,
+    public Content createLink(DocLink link, Content label, boolean strong,
             String title, String target) {
         return createLink(link, label, strong, title, target, false);
     }
@@ -275,13 +278,13 @@
      * @param isExternal is the link external to the generated documentation
      * @return a content tree for the link
      */
-    public static Content createLink(DocLink link, Content label, boolean strong,
+    public Content createLink(DocLink link, Content label, boolean strong,
             String title, String target, boolean isExternal) {
         Content body = label;
         if (strong) {
             body = HtmlTree.SPAN(HtmlStyle.typeNameLink, body);
         }
-        HtmlTree l = HtmlTree.A(link.toString(), body);
+        HtmlTree l = HtmlTree.A(link.relativizeAgainst(file).toString(), body);
         if (title != null && title.length() != 0) {
             l.addAttr(HtmlAttr.TITLE, title);
         }
@@ -302,13 +305,12 @@
      * @param isExternal is the link external to the generated documentation
      * @return a content tree for the link
      */
-    public static Content createLink(DocLink link, Content label, boolean isExternal) {
-        HtmlTree anchor = HtmlTree.A(link.toString(), label);
+    public Content createLink(DocLink link, Content label, boolean isExternal) {
+        HtmlTree anchor = HtmlTree.A(link.relativizeAgainst(file).toString(), label);
         anchor.setStyle(HtmlStyle.externalLink);
         return anchor;
     }
 
-
     /**
      * Converts a name to a valid HTML name (id).
      * This depends on the HTML version specified when the {@code Links} object was created.
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocLink.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocLink.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,51 +39,101 @@
  *
  */
 public class DocLink {
-    final String path;
+    final DocPath path;
     final String query;
     final String fragment;
 
-    /** Create a DocLink representing the URI {@code #fragment}. */
+    /**
+     * Creates a DocLink representing the URI {@code #fragment}.
+     * @param fragment the fragment
+     * @return the DocLink
+     */
     public static DocLink fragment(String fragment) {
-        return new DocLink((String) null, (String) null, fragment);
-    }
-
-    /** Create a DocLink representing the URI {@code path}. */
-    public DocLink(DocPath path) {
-        this(path.getPath(), null, null);
+        return new DocLink((DocPath) null, (String) null, fragment);
     }
 
     /**
-     * Create a DocLink representing the URI {@code path?query#fragment}.
-     * query and fragment may be null.
+     * Creates a DocLink representing the URI {@code path}.
+     * @param path the path
      */
-    public DocLink(DocPath path, String query, String fragment) {
-        this(path.getPath(), query, fragment);
+    public DocLink(DocPath path) {
+        this(path, null, null);
     }
 
     /**
-     * Create a DocLink representing the URI {@code path?query#fragment}.
+     * Creates a DocLink representing the URI {@code path?query#fragment}.
      * Any of the component parts may be null.
+     * @param path the path
+     * @param query the query
+     * @param fragment the fragment
      */
-    public DocLink(String path, String query, String fragment) {
+    public DocLink(DocPath path, String query, String fragment) {
         this.path = path;
         this.query = query;
         this.fragment = fragment;
     }
 
     /**
-     * Return the link in the form "path?query#fragment", omitting any empty
+     * Creates a DocLink representing the URI {@code path?query#fragment}.
+     * Any of the component parts may be null.
+     * @param path the path
+     * @param query the query
+     * @param fragment the fragment
+     */
+    public DocLink(String path, String query, String fragment) {
+        this(DocPath.create(path), query, fragment);
+    }
+
+    /**
+     * Creates a DocLink formed by relativizing the path against a given base.
+     * @param base the base
+     * @return the DocLink
+     */
+    public DocLink relativizeAgainst(DocPath base) {
+        if (base.isEmpty() || path == null) {
+            return this;
+        }
+
+        // The following guards against the (ugly) use-case of using DocPath to contain a URL
+        if (isAbsoluteURL(path)) {
+            return this;
+        }
+
+        DocPath newPath = base.relativize(path);
+        // avoid generating an empty link by using the basename of the path if necessary
+        if (newPath.isEmpty() && isEmpty(query) && isEmpty(fragment)) {
+            newPath = path.basename();
+        }
+        return new DocLink(newPath, query, fragment);
+    }
+
+    // return true if the path begins <letters>://
+    private boolean isAbsoluteURL(DocPath path) {
+        String s = path.getPath();
+        for (int i = 0; i < s.length(); i++) {
+            char c = s.charAt(i);
+            if (Character.isLetter(c)) {
+                continue;
+            }
+            return (c == ':' && i + 2 < s.length() && s.charAt(i + 1)== '/' && s.charAt(i + 2)== '/');
+        }
+        return false;
+    }
+
+    /**
+     * Returns the link in the form "path?query#fragment", omitting any empty
      * components.
+     * @return the string
      */
     @Override
     public String toString() {
         // common fast path
         if (path != null && isEmpty(query) && isEmpty(fragment))
-            return path;
+            return path.getPath();
 
         StringBuilder sb = new StringBuilder();
         if (path != null)
-            sb.append(path);
+            sb.append(path.getPath());
         if (!isEmpty(query))
             sb.append("?").append(query);
         if (!isEmpty(fragment))
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPath.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPath.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,11 @@
 
 package jdk.javadoc.internal.doclets.toolkit.util;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
 import javax.lang.model.element.ModuleElement;
 import javax.lang.model.element.PackageElement;
 import javax.lang.model.element.TypeElement;
@@ -48,16 +53,21 @@
     public static final DocPath parent = new DocPath("..");
 
     /**
-     * Create a path from a string.
+     * Creates a path from a string.
+     * @param p the string
+     * @return the path
      */
     public static DocPath create(String p) {
         return (p == null) || p.isEmpty() ? empty : new DocPath(p);
     }
 
     /**
-     * Return the path for a class.
+     * Returns the path for a class.
      * For example, if the class is java.lang.Object,
      * the path is java/lang/Object.html.
+     * @param utils utility class for handling type elements
+     * @param typeElement the type element
+     * @return the path
      */
     public static DocPath forClass(Utils utils, TypeElement typeElement) {
         return (typeElement == null)
@@ -66,14 +76,24 @@
     }
 
     /**
-     * Return the path for the simple name of the class.
+     * Returns the path for the simple name of a class.
      * For example, if the class is java.lang.Object,
      * the path is Object.html.
+     * @param utils utility class for handling type elements
+     * @param typeElement the type element
+     * @return the path
      */
     public static DocPath forName(Utils utils, TypeElement typeElement) {
         return (typeElement == null) ? empty : new DocPath(utils.getSimpleName(typeElement) + ".html");
     }
 
+    /**
+     * Returns the path for the name of a module.
+     * For example, if the module is java.base,
+     * the path is java.base.
+     * @param mdle the module element
+     * @return the path
+     */
     public static DocPath forModule(ModuleElement mdle) {
         return mdle == null || mdle.isUnnamed()
                 ? empty
@@ -81,18 +101,23 @@
     }
 
     /**
-     * Return the path for the package of a class.
+     * Returns the path for the package of a class.
      * For example, if the class is java.lang.Object,
      * the path is java/lang.
+     * @param utils utility class for handling type elements
+     * @param typeElement the type element
+     * @return the path
      */
     public static DocPath forPackage(Utils utils, TypeElement typeElement) {
         return (typeElement == null) ? empty : forPackage(utils.containingPackage(typeElement));
     }
 
     /**
-     * Return the path for a package.
+     * Returns the path for a package.
      * For example, if the package is java.lang,
      * the path is java/lang.
+     * @param pkgElement the package element
+     * @return the path
      */
     public static DocPath forPackage(PackageElement pkgElement) {
         return pkgElement == null || pkgElement.isUnnamed()
@@ -101,9 +126,11 @@
     }
 
     /**
-     * Return the inverse path for a package.
+     * Returns the inverse path for a package.
      * For example, if the package is java.lang,
      * the inverse path is ../...
+     * @param pkgElement the package element
+     * @return the path
      */
     public static DocPath forRoot(PackageElement pkgElement) {
         String name = (pkgElement == null || pkgElement.isUnnamed())
@@ -113,7 +140,10 @@
     }
 
     /**
-     * Return the relative path from one package to another.
+     * Returns the relative path from one package to another.
+     * @param from the initial package
+     * @param to the target package
+     * @return the path
      */
     public static DocPath relativePath(PackageElement from, PackageElement to) {
         return forRoot(from).resolve(forPackage(to));
@@ -146,7 +176,9 @@
     }
 
     /**
-     * Return the path formed by appending the specified string to the current path.
+     * Returns the path formed by appending the specified string to the current path.
+     * @param p the string
+     * @return the path
      */
     public DocPath resolve(String p) {
         if (p == null || p.isEmpty())
@@ -157,7 +189,9 @@
     }
 
     /**
-     * Return the path by appending the specified path to the current path.
+     * Returns the path by appending the specified path to the current path.
+     * @param p the path
+     * @return the path
      */
     public DocPath resolve(DocPath p) {
         if (p == null || p.isEmpty())
@@ -170,28 +204,121 @@
     /**
      * Return the inverse path for this path.
      * For example, if the path is a/b/c, the inverse path is ../../..
+     * @return the path
      */
     public DocPath invert() {
         return new DocPath(path.replaceAll("[^/]+", ".."));
     }
 
     /**
+     * Returns the path formed by eliminating empty components,
+     * '.' components, and redundant name/.. components.
+     * @return the path
+     */
+    public DocPath normalize() {
+        return path.isEmpty()
+                ? this
+                : new DocPath(String.join("/", normalize(path)));
+    }
+
+    private static List<String> normalize(String path) {
+        return normalize(Arrays.asList(path.split("/")));
+    }
+
+    private static List<String> normalize(List<String> parts) {
+        if (parts.stream().noneMatch(s -> s.isEmpty() || s.equals(".") || s.equals(".."))) {
+            return parts;
+        }
+        List<String> normalized = new ArrayList<>();
+        for (String part : parts) {
+            switch (part) {
+                case "":
+                case ".":
+                    break;
+                case "..":
+                    int n = normalized.size();
+                    if (n > 0 && !normalized.get(n - 1).equals("..")) {
+                        normalized.remove(n - 1);
+                    } else {
+                        normalized.add(part);
+                    }
+                    break;
+                default:
+                    normalized.add(part);
+            }
+        }
+        return normalized;
+    }
+
+    /**
+     * Normalize and relativize a path against this path,
+     * assuming that this path is for a file (not a directory),
+     * in which the other path will appear.
+     *
+     * @param other the path to be relativized.
+     * @return the simplified path
+     */
+    public DocPath relativize(DocPath other) {
+        if (other == null || other.path.isEmpty()) {
+            return this;
+        }
+
+        if (path.isEmpty()) {
+            return other;
+        }
+
+        List<String> originParts = normalize(path);
+        int sep = path.lastIndexOf("/");
+        List<String> destParts = sep == -1
+                ? normalize(other.path)
+                : normalize(path.substring(0, sep + 1) + other.path);
+        int common = 0;
+        while (common < originParts.size()
+                && common < destParts.size()
+                && originParts.get(common).equals(destParts.get(common))) {
+            common++;
+        }
+
+        List<String> newParts;
+        if (common == originParts.size()) {
+            newParts = destParts.subList(common, destParts.size());
+        } else {
+            newParts = new ArrayList<>();
+            newParts.addAll(Collections.nCopies(originParts.size() - common - 1, ".."));
+            newParts.addAll(destParts.subList(common, destParts.size()));
+        }
+        return new DocPath(String.join("/", newParts));
+    }
+
+    /**
      * Return true if this path is empty.
+     * @return true if this path is empty
      */
     public boolean isEmpty() {
         return path.isEmpty();
     }
 
+    /**
+     * Creates a DocLink formed from this path and a fragment identifier.
+     * @param fragment the fragment
+     * @return the link
+     */
     public DocLink fragment(String fragment) {
         return new DocLink(path, null, fragment);
     }
 
+    /**
+     * Creates a DocLink formed from this path and a query string.
+     * @param query the query string
+     * @return the link
+     */
     public DocLink query(String query) {
         return new DocLink(path, query, null);
     }
 
     /**
-     * Return this path as a string.
+     * Returns this path as a string.
+     * @return the path
      */
     // This is provided instead of using toString() to help catch
     // unintended use of toString() in string concatenation sequences.
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -180,10 +180,11 @@
         if (fnd == null)
             return null;
 
+        // The following is somewhat questionable since we are using DocPath
+        // to contain external URLs!
         DocPath p = fnd.relative ?
                 relativepath.resolve(fnd.path).resolve(filename) :
                 DocPath.create(fnd.path).resolve(filename);
-
         return new DocLink(p, "is-external=true", memberName);
     }
 
--- a/src/jdk.jdi/share/classes/com/sun/tools/jdi/InvokableTypeImpl.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.jdi/share/classes/com/sun/tools/jdi/InvokableTypeImpl.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -77,9 +77,6 @@
      * a member of this type, if the size of the argument list
      * does not match the number of declared arguments for the method, or
      * if the method is not static or is a static initializer.
-     * @throws InvalidTypeException if any argument in the
-     * argument list is not assignable to the corresponding method argument
-     * type.
      * @throws ClassNotLoadedException if any argument type has not yet been loaded
      * through the appropriate class loader.
      * @throws IncompatibleThreadStateException if the specified thread has not
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IRTranslator.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IRTranslator.java	Tue Jan 30 09:03:47 2018 -0800
@@ -473,9 +473,9 @@
     @Override
     public boolean enterClassNode(final ClassNode classNode) {
         assert !classNode.isStatement(): "should not reach here for class declaration";
-
+        final IdentNode className = classNode.getIdent();
         curExpr = new ClassExpressionTreeImpl(classNode,
-            translateIdent(classNode.getIdent()),
+            className != null? translateIdent(className) : null,
             translateExpr(classNode.getClassHeritage()),
             translateProperty(classNode.getConstructor()),
             translateProperties(classNode.getClassElements()));
--- a/test/TestCommon.gmk	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/TestCommon.gmk	Tue Jan 30 09:03:47 2018 -0800
@@ -332,9 +332,45 @@
   TEST_SELECTION = $(TESTDIRS)
 endif
 
-ifdef CONCURRENCY
-  JTREG_BASIC_OPTIONS += -concurrency:$(CONCURRENCY)
+ifeq ($(UNAME_S), SunOS)
+  NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line)
+endif
+ifeq ($(UNAME_S), Linux)
+  NUM_CORES := $(shell cat /proc/cpuinfo  | grep -c processor)
+endif
+ifeq ($(UNAME_S), Darwin)
+  NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
+endif
+ifeq ($(findstring CYGWIN,$(UNAME_S)), CYGWIN)
+  ifneq ($(NUMBER_OF_PROCESSORS), )
+    NUM_CORES := $(NUMBER_OF_PROCESSORS)
+  else
+    ifneq ($(HOTSPOT_BUILD_JOBS), )
+      NUM_CORES := $(HOTSPOT_BUILD_JOBS)
+    else
+      NUM_CORES := 1 # fallback
+    endif
+  endif
 endif
+
+ifndef CONCURRENCY_FACTOR
+  CONCURRENCY_FACTOR = 1
+endif
+
+# Concurrency based on min(cores / 2, 12) * CONCURRENCY_FACTOR
+CONCURRENCY := $(shell awk \
+  'BEGIN { \
+    c = $(NUM_CORES) / 2; \
+    if (c > 12) c = 12; \
+    c = c * $(CONCURRENCY_FACTOR); \
+    if (c < 1) c = 1; \
+    printf "%.0f", c; \
+  }')
+JTREG_BASIC_OPTIONS += -concurrency:$(CONCURRENCY)
+
+# Make sure MaxRAMPercentage is high enough to not cause OOM or swapping since we may end up with a lot of JVM's
+JTREG_BASIC_OPTIONS += -vmoption:-XX:MaxRAMPercentage=$(shell expr 25 / $(CONCURRENCY))
+
 ifdef EXTRA_JTREG_OPTIONS
   JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
 endif
--- a/test/hotspot/jtreg/Makefile	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/hotspot/jtreg/Makefile	Tue Jan 30 09:03:47 2018 -0800
@@ -38,47 +38,6 @@
 
 IGNORE_MARKED_TESTS := true
 
-# Get OS name from uname (Cygwin inexplicably adds _NT-5.1)
-UNAME_S := $(shell uname -s | cut -f1 -d_)
-
-ifeq ($(UNAME_S), SunOS)
-  NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line)
-endif
-ifeq ($(UNAME_S), Linux)
-  NUM_CORES := $(shell cat /proc/cpuinfo  | grep -c processor)
-endif
-ifeq ($(UNAME_S), Darwin)
-  NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
-endif
-ifeq ($(findstring CYGWIN,$(UNAME_S)), CYGWIN)
-  ifneq ($(NUMBER_OF_PROCESSORS), )
-    NUM_CORES := $(NUMBER_OF_PROCESSORS)
-  else
-    ifneq ($(HOTSPOT_BUILD_JOBS), )
-      NUM_CORES := $(HOTSPOT_BUILD_JOBS)
-    else
-      NUM_CORES := 1 # fallback
-    endif
-  endif
-endif
-
-ifndef CONCURRENCY_FACTOR
-  CONCURRENCY_FACTOR = 1
-endif
-
-# Concurrency based on min(cores / 2, 12) * CONCURRENCY_FACTOR
-CONCURRENCY := $(shell awk \
-  'BEGIN { \
-    c = $(NUM_CORES) / 2; \
-    if (c > 12) c = 12; \
-    c = c * $(CONCURRENCY_FACTOR); \
-    if (c < 1) c = 1; \
-    printf "%.0f", c; \
-  }')
-
-# Make sure MaxRAMPercentage is high enough to not cause OOM or swapping since we may end up with a lot of JVM's
-JTREG_BASIC_OPTIONS += -vmoption:-XX:MaxRAMPercentage=$(shell expr 25 / $(CONCURRENCY))
-
 # Include the common base file with most of the logic
 include ../../TestCommon.gmk
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/net/Inet6Address/serialize/Inet6AddressSerTest.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
+import java.io.ObjectStreamConstants;
+import static java.io.ObjectStreamConstants.STREAM_MAGIC;
+import static java.io.ObjectStreamConstants.TC_CLASSDESC;
+import static java.io.ObjectStreamConstants.TC_ENDBLOCKDATA;
+import static java.io.ObjectStreamConstants.TC_NULL;
+import static java.io.ObjectStreamConstants.TC_OBJECT;
+import java.net.Inet6Address;
+/**
+ * @test
+ * @bug 8194676
+ * @summary NullPointerException is thrown if ipaddress is not set.
+ * @run main Inet6AddressSerTest
+ */
+public class Inet6AddressSerTest implements ObjectStreamConstants {
+
+    static class PayloadTest {
+
+        private static byte[] serialize(String className) throws IOException {
+            try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                    DataOutputStream dos = new DataOutputStream(baos)) {
+                // stream headers
+                dos.writeShort(STREAM_MAGIC);
+                dos.writeShort(5); // version
+
+                // Inet6Address
+                dos.writeByte(TC_OBJECT);
+                dos.writeByte(TC_CLASSDESC);
+                dos.writeUTF(className);
+                dos.writeLong(6880410070516793377L);
+                dos.writeByte(2);
+                dos.writeShort(0);
+                dos.writeByte(TC_ENDBLOCKDATA);
+                dos.writeByte(TC_NULL);
+                return baos.toByteArray();
+            }
+        }
+
+        private static Object deserialize(final byte[] buffer)
+                throws IOException, ClassNotFoundException {
+            try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(buffer))) {
+                return ois.readObject();
+            }
+        }
+
+        void test(String className) throws IOException, ClassNotFoundException {
+            deserialize(serialize(className));
+        }
+    }
+
+    public static void main(String[] args) throws IOException, ClassNotFoundException {
+        try {
+            new PayloadTest().test(Inet6Address.class.getName());
+            throw new RuntimeException("Expected exception not raised");
+        } catch (InvalidObjectException ioe) {
+            if (ioe.getMessage().contains("invalid address length")) {
+                System.out.println(String.format("Got expected exception: %s", ioe));
+            } else {
+                throw new RuntimeException("Expected exception not raised");
+            }
+        } catch (RuntimeException re) {
+            throw new RuntimeException("Expected exception not raised");
+        }
+    }
+}
--- a/test/jdk/java/time/test/java/time/TestLocalDate.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/java/time/test/java/time/TestLocalDate.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -67,6 +67,7 @@
 import java.time.LocalDate;
 import java.time.Month;
 import java.time.temporal.ChronoUnit;
+import java.time.temporal.IsoFields;
 
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.DataProvider;
@@ -444,4 +445,40 @@
         }
     }
 
+    @DataProvider(name="quarterYearsToAdd")
+    Object[][] provider_quarterYearsToAdd() {
+        return new Object[][] {
+            {Long.valueOf(-1000000000)},
+            {Long.valueOf(-256)},
+            {Long.valueOf(-255)},
+            {Long.valueOf(-1)},
+            {Long.valueOf(0)},
+            {Long.valueOf(1)},
+            {Long.valueOf(255)},
+            {Long.valueOf(256)},
+            {Long.valueOf(1000000000)},
+        };
+    }
+
+    @Test(dataProvider="quarterYearsToAdd")
+    public void test_plus_QuarterYears(long quarterYears) {
+        LocalDate t0 = TEST_2007_07_15
+                .plus(quarterYears, IsoFields.QUARTER_YEARS);
+        LocalDate t1 = TEST_2007_07_15
+                .plus(quarterYears, ChronoUnit.MONTHS)
+                .plus(quarterYears, ChronoUnit.MONTHS)
+                .plus(quarterYears, ChronoUnit.MONTHS);
+        assertEquals(t0, t1);
+    }
+
+    @Test(dataProvider="quarterYearsToAdd")
+    public void test_minus_QuarterYears(long quarterYears) {
+        LocalDate t0 = TEST_2007_07_15
+                .minus(quarterYears, IsoFields.QUARTER_YEARS);
+        LocalDate t1 = TEST_2007_07_15
+                .minus(quarterYears, ChronoUnit.MONTHS)
+                .minus(quarterYears, ChronoUnit.MONTHS)
+                .minus(quarterYears, ChronoUnit.MONTHS);
+        assertEquals(t0, t1);
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/BlankLines.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 4218776
+ * @summary Test loading of properties files with blank lines
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+/**
+ * This class tests to see if a properties object correctly handles blank
+ * lines in a properties file
+ */
+public class BlankLines {
+    public static void main(String []args)
+    {
+        try {
+            // create test file
+            File file = new File("test.properties");
+
+            // write a single space to the test file
+            FileOutputStream fos = new FileOutputStream(file);
+            fos.write(' ');
+            fos.close();
+
+            // test empty properties
+            Properties prop1 = new Properties();
+
+            // now load the file we just created, into a
+            // properties object.
+            // the properties object should have no elements,
+            // but due to a bug, it has an empty key/value.
+            // key = "", value = ""
+            Properties prop2 = new Properties();
+            InputStream is = new FileInputStream(file);
+            try {
+                prop2.load(is);
+            } finally {
+                is.close();
+            }
+            if (!prop1.equals(prop2))
+                throw new RuntimeException("Incorrect properties loading.");
+
+            // cleanup
+            file.delete();
+        }
+        catch(IOException e) {}
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/CloseXMLStream.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6270682
+ * @summary Test the input stream is closed after loadtoXML returns.
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.util.Properties;
+
+public class CloseXMLStream {
+    public static void main(String[] args) throws Throwable {
+        class ExpectedClosingException extends RuntimeException {};
+        Properties props = new Properties();
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        props.storeToXML(out, null);
+        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()) {
+            public void close() {
+                throw new ExpectedClosingException();
+            }
+        };
+        try {
+            props.loadFromXML(in);
+            throw new Exception("Failed: loadFromXML does not close the is!");
+        } catch (ExpectedClosingException ex) { /*OK*/ }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/EscapeSpace.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 4219644
+ * @summary Escaping of spaces required only for leading spaces in the value
+ *          part of the property.
+ */
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+public class EscapeSpace {
+
+    static String props =
+        "key1=\\ \\ Value1, has leading and trailing spaces\\  \n" +
+        "key2=Value2,\\ does not have\\ leading or trailing\\ spaces\n" +
+        "key3=Value3,has,no,spaces\n" +
+        "key4=Value4, does not have leading spaces\\  \n" +
+        "key5=\\t\\ \\ Value5, has leading tab and no trailing spaces\n" +
+        "key6=\\ \\ Value6,doesnothaveembeddedspaces\\ \\ \n" +
+        "\\ key1\\ test\\ =key1, has leading and trailing spaces  \n" +
+        "key2\\ test=key2, does not have leading or trailing spaces\n" +
+        "key3test=key3,has,no,spaces\n" +
+        "key4\\ test\\ =key4, does not have leading spaces  \n" +
+        "\\t\\ key5\\ test=key5, has leading tab and no trailing spaces\n" +
+        "\\ \\ key6\\ \\ =\\  key6,doesnothaveembeddedspaces  ";
+    static void load(Properties p, String file) throws Exception
+    {
+        FileInputStream     fis = null;
+        BufferedInputStream bis = null;
+
+        try {
+            fis = new FileInputStream(file);
+            bis = new BufferedInputStream( fis );
+
+            p.load(bis);
+        }
+        catch (IOException e) {
+            throw new RuntimeException(e.getMessage());
+        } finally {
+            if (fis != null)
+                fis.close();
+        }
+    }
+
+    static void store(Properties p, String file) throws Exception
+    {
+
+        FileOutputStream     fos = null;
+        BufferedOutputStream bos = null;
+
+        try {
+            fos = new FileOutputStream(file);
+            bos = new BufferedOutputStream( fos );
+
+            p.store( bos, "Omitting escape characters for non leading space \" \" in properties");
+        }
+        catch (IOException e) {
+            throw new RuntimeException(e.getMessage());
+        } finally {
+            if (fos != null)
+                fos.close();
+        }
+    }
+
+    public static void main( String args[] ) throws Exception
+    {
+        ByteArrayInputStream bais = new ByteArrayInputStream(props.getBytes());
+        Properties props0 = new Properties();
+        // Load properties with escape character '\' before space characters
+        try {
+            props0.load(bais);
+        } catch (IOException e) {
+            throw new RuntimeException(e.getMessage());
+        }
+
+        Properties props1 = new Properties();
+        /*
+         * Put the same properties, but without the escape char for space in
+         * value part.
+         */
+        props1.put( "key1", "  Value1, has leading and trailing spaces  " );
+        props1.put( "key2",
+            "Value2, does not have leading or trailing spaces" );
+        props1.put( "key3", "Value3,has,no,spaces" );
+        props1.put( "key4", "Value4, does not have leading spaces  " );
+        props1.put( "key5",
+            "\t  Value5, has leading tab and no trailing spaces" );
+        props1.put( "key6", "  Value6,doesnothaveembeddedspaces  " );
+        props1.put( " key1 test ", "key1, has leading and trailing spaces  " );
+        props1.put( "key2 test",
+            "key2, does not have leading or trailing spaces" );
+        props1.put( "key3test", "key3,has,no,spaces" );
+        props1.put( "key4 test ", "key4, does not have leading spaces  " );
+        props1.put( "\t key5 test",
+            "key5, has leading tab and no trailing spaces" );
+        props1.put( "  key6  ", "  key6,doesnothaveembeddedspaces  " );
+
+        // Check if both the properties match
+        if (!props0.equals(props1))
+            throw new RuntimeException("Test failed");
+
+
+        // Also store the new properties to a file
+        store(props1, "out1.props");
+
+        Properties props2 = new Properties();
+        // Reread the properties from the file
+        load(props2, "out1.props");
+
+        // Make sure that the properties match
+        if (!props1.equals(props2))
+            throw new RuntimeException("Test failed");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/GenerifiedUses.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 5060820 5054615 5056707 5061476
+ * @modules java.desktop
+ *          java.naming
+ * @compile GenerifiedUses.java
+ */
+
+import java.awt.image.CropImageFilter;
+import java.awt.image.ImageFilter;
+import java.awt.image.PixelGrabber;
+import java.awt.image.ReplicateScaleFilter;
+import java.util.Properties;
+import javax.naming.InitialContext;
+import javax.naming.directory.InitialDirContext;
+import javax.naming.spi.NamingManager;
+
+public class GenerifiedUses {
+
+    static void foo() throws Exception {
+
+        Properties props = new Properties();
+
+        // 5060820
+        new InitialDirContext(props);
+
+        // 5054615
+        new InitialContext(props);
+
+        // 5056707
+        NamingManager.getObjectInstance(null, null, null, props);
+
+        // 5061476
+        new CropImageFilter(0, 0, 0, 0).setProperties(props);
+        new ImageFilter().setProperties(props);
+        new PixelGrabber(null, 0, 0, 0, 0, false).setProperties(props);
+        new ReplicateScaleFilter(1, 1).setProperties(props);
+
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/LoadParsing.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4115936 4385195 4972297
+ * @summary checks for processing errors in properties.load
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Properties;
+
+public class LoadParsing {
+    public static void main(String[] argv) throws Exception {
+        File f = new File(System.getProperty("test.src", "."), "input.txt");
+        FileInputStream myIn = new FileInputStream(f);
+        Properties myProps = new Properties();
+        int size = 0;
+        try {
+            myProps.load(myIn);
+        } finally {
+            myIn.close();
+        }
+
+        if (!myProps.getProperty("key1").equals("value1"))
+            throw new RuntimeException("Bad comment parsing");
+        if (!myProps.getProperty("key2").equals("abc\\defg\\"))
+            throw new RuntimeException("Bad slash parsing");
+        if (!myProps.getProperty("key3").equals("value3"))
+            throw new RuntimeException("Adds spaces to key");
+        if (!myProps.getProperty("key4").equals(":value4"))
+            throw new RuntimeException("Bad separator parsing");
+        if (myProps.getProperty("#") != null)
+            throw new RuntimeException(
+                "Does not recognize comments with leading spaces");
+        if ((size=myProps.size()) != 4)
+            throw new RuntimeException(
+                 "Wrong number of keys in Properties; expected 4, got " +
+                size + ".");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/LoadParsing2.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4881291 4094886
+ * @summary checks for processing errors in properties.load
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Properties;
+
+public class LoadParsing2 {
+    public static void main(String[] argv) throws Exception {
+        for (int i = 0; i < dfiles.length; i++) {
+            test(dfiles[i], keys[i], values[i], true);
+            test(dfiles[i], keys[i], values[i], false);
+        }
+    }
+
+    private static Properties getLoadedProperties(InputStream is,
+                                                  boolean doStream)
+        throws Exception
+    {
+        Properties props = new Properties();
+        if (doStream)
+            props.load(is);
+        else
+            props.load(new InputStreamReader(is, "UTF-8"));
+        return props;
+    }
+
+    private static void test(String fnData,
+                             String[] keys,
+                             String[] values,
+                             boolean doStream)
+        throws Exception
+    {
+        File f = new File(System.getProperty("test.src", "."), fnData);
+        FileInputStream myIn = new FileInputStream(f);
+        Properties myProps = getLoadedProperties(myIn, doStream);
+        for (int i = 0; i < keys.length; i++) {
+            if (!myProps.getProperty(keys[i]).equals(values[i])) {
+                throw new RuntimeException("Test1: Bad parsing at " + i);
+            }
+        }
+    }
+
+    static String[] keys1 = {
+        "\\",
+        "\\:key12",
+        "key16 b",
+        "key14_asdfa",
+        "\\\\",
+        "key8notassign",
+        "key17",
+        "key15",
+        "keyabcdef",
+        "key13dialog.3",
+        "key7",
+        "key6",
+        "key5",
+        "key3",
+        "key2",
+        "key1",
+        "key9 Term",
+        "key0"
+    };
+
+    static String[] keys2 = {
+        "key1",
+        "key2"
+    };
+
+    static String[] keys3 = {
+        "key1",
+        "key2"
+    };
+
+    static String[] values1 = {
+        "key10=bar",
+        "bar2",
+        " abcdef",
+        "",
+        "key11=bar2",
+        "abcdef",
+        "#barbaz",
+        " abcdef",
+        "",
+        "",
+        "Symbol,SYMBOL_CHARSET ",
+        "WingDings,SYMBOL_CHARSET \\abc",
+        "==Arial,ANSI_CHARSET",
+        "",
+        "= abcde",
+        "value1",
+        "ABCDE",
+        "abcd"
+    };
+
+    static String[] values2 = {
+        "-monotype-timesnewroman-regular-r---*-%d-*-*-p-*-iso8859-1serif.1a-monotype-timesnewroman-regular-r-normal--*-%d-*-*-p-*-iso8859-2serif.2a-b&h-LucidaBrightLat4-Normal-r-normal--*-%d-*-*-p-*-iso8859-4serif.3a-monotype-times-regular-r-normal--*-%d-*-*-p-*-iso8859-5serif.4a-monotype-timesnewromangreek-regular-r-normal--*-%d-*-*-p-*-iso8859-7serif.5a-monotype-times-regular-r-normal--*-%d-*-*-p-*-iso8859-9serif.6a-monotype-times-regular-r-normal--*-%d-*-*-p-*-iso8859-15serif.7a-hanyi-ming-medium-r-normal--*-%d-*-*-m-*-big5-1serif.8a-sun-song-medium-r-normal--*-%d-*-*-c-*-gb2312.1980-0serif.9a-ricoh-hgminchol-medium-r-normal--*-%d-*-*-m-*-jisx0201.1976-0serif.10a-ricoh-hgminchol-medium-r-normal--*-%d-*-*-m-*-jisx0208.1983-0serif.11a-ricoh-heiseimin-w3-r-normal--*-%d-*-*-m-*-jisx0212.1990-0serif.12a-hanyang-myeongjo-medium-r-normal--*-%d-*-*-m-*-ksc5601.1992-3serif.13a-urw-itczapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecificserif.14a-*-symbol-medium-r-normal--*-%d-*-*-p-*-sun-fontspecificbserif.italic.0=-monotype-timesbnewbroman-regular-i---*-%d-*-*-p-*-iso8859-1bserif.italic.1=-monotype-timesbnewbroman-regular-i-normal-italic-*-%d-*-*-p-*-iso8859-2",
+        "-b&h-LucidaBrightLat4-normal-i-normal-Italic-*-%d-*-*-p-*-iso8859-4"
+    };
+
+    static String[] values3 = {
+        "-monotype-times new roman-regular-r---*-%d-*-*-p-*-iso8859-1, -monotype-times new roman-regular-r-normal--*-%d-*-*-p-*-iso8859-2, -b&h-LucidaBrightLat4-Normal-r-normal--*-%d-*-*-p-*-iso8859-4, -monotype-times-regular-r-normal--*-%d-*-*-p-*-iso8859-5, -monotype-times new roman greek-regular-r-normal--*-%d-*-*-p-*-iso8859-7, -monotype-times-regular-r-normal--*-%d-*-*-p-*-iso8859-9, -monotype-times-regular-r-normal--*-%d-*-*-p-*-iso8859-15, -hanyi-ming-medium-r-normal--*-%d-*-*-m-*-big5-1, -sun-song-medium-r-normal--*-%d-*-*-c-*-gb2312.1980-0, -ricoh-hg gothic b-medium-r-normal--*-%d-*-*-m-*-jisx0201.1976-0, -ricoh-hg gothic b-medium-r-normal-*-*-%d-*-*-m-*-jisx0208.1983-0, -ricoh-heiseimin-w3-r-normal--*-%d-*-*-m-*-jisx0212.1990-0, -hanyang-myeongjo-medium-r-normal--*-%d-*-*-m-*-ksc5601.1992-3",
+        "-monotype-times new roman-regular-i---*-%d-*-*-p-*-iso8859-1, -monotype-times new roman-regular-i-normal-italic-*-%d-*-*-p-*-iso8859-2, -b&h-LucidaBrightLat4-normal-i-normal-Italic-*-%d-*-*-p-*-iso8859-4, -monotype-times-regular-i-normal-italic-*-%d-*-*-p-*-iso8859-5, -monotype-times new roman greek-regular-i-normal--*-%d-*-*-p-*-iso8859-7, -monotype-times-regular-i-normal-italic-*-%d-*-*-p-*-iso8859-9, -monotype-times-regular-i-normal--*-%d-*-*-p-*-iso8859-15, -hanyi-ming-medium-r-normal--*-%d-*-*-m-*-big5-1, -sun-song-medium-r-normal--*-%d-*-*-c-*-gb2312.1980-0, -ricoh-hg gothic b-medium-r-normal--*-%d-*-*-m-*-jisx0201.1976-0, -ricoh-hg gothic b-medium-r-normal-*-*-%d-*-*-m-*-jisx0208.1983-0, -ricoh-heiseimin-w3-r-normal--*-%d-*-*-m-*-jisx0212.1990-0, -hanyang-myeongjo-medium-r-normal--*-%d-*-*-m-*-ksc5601.1992-3"
+    };
+
+    static String[][] keys = {keys1, keys1, keys2, keys2, keys3};
+    static String[][] values = {values1, values1, values2, values2, values3};
+    static String[] dfiles = {
+        "testData1",
+        "testData1.dos",
+        "testData2",
+        "testData2.dos",
+        "testData3.dos"
+    };
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/LoadSeparators.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 4192678
+ * @summary Test loading of values that are key value separators
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+/**
+ * This class tests to see if a properties object can successfully save and
+ * load properties with a non-escaped value that is also a key value separator
+ *
+ */
+public class LoadSeparators {
+    public static void main(String[] argv) throws Exception {
+        try {
+            // Destroy old test file if any
+            // Create a properties file
+            File propFile = new File("testout");
+            propFile.delete();
+
+            // Create a properties file
+            FileOutputStream myOut = new FileOutputStream(propFile);
+            String testProperty = "Test3==";
+            myOut.write(testProperty.getBytes());
+            myOut.close();
+
+            // Load the properties set
+            FileInputStream myIn = new FileInputStream("testout");
+            Properties myNewProps = new Properties();
+            try {
+                myNewProps.load(myIn);
+            } finally {
+                myIn.close();
+            }
+
+            // Read in the test property
+            String equalSign = myNewProps.getProperty("Test3");
+
+            // Clean up
+            propFile.delete();
+
+            if (!equalSign.equals("="))
+                throw new Exception("Cannot read key-value separators.");
+        } catch (IOException e) {
+            System.err.println(e);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/PropertiesTest.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,494 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary tests the load and store methods of Properties class
+ * @author Xueming Shen
+ * @bug 4094886
+ * @modules jdk.charsets
+ * @key randomness
+ */
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.Writer;
+import java.util.Properties;
+import java.util.Random;
+
+public class PropertiesTest {
+
+    private static boolean failure = false;
+    private static int failCount = 0;
+
+    /**
+     * Main to interpret arguments and run several tests.
+     *
+     */
+    public static void main(String[] args) throws Exception {
+        BlankLines();
+        EscapeSpace();
+        LoadParsing();
+        SaveEncoding();
+        SaveLoadBasher();
+        SaveSeparator();
+        SaveClose();
+        SaveComments();
+        UnicodeEscape();
+
+        if (failure)
+            throw new RuntimeException("Failure in Properties testing.");
+        else
+            System.err.println("OKAY: All tests passed.");
+    }
+
+    private static void report(String testName) {
+        int spacesToAdd = 30 - testName.length();
+        StringBuffer paddedNameBuffer = new StringBuffer(testName);
+        for (int i=0; i<spacesToAdd; i++)
+            paddedNameBuffer.append(" ");
+        String paddedName = paddedNameBuffer.toString();
+        System.err.println(paddedName + ": " +
+                           (failCount==0 ? "Passed":"Failed("+failCount+")"));
+        if (failCount > 0)
+            failure = true;
+        failCount = 0;
+    }
+
+    private static void check(Properties prop1, Properties prop2) {
+        if (!prop1.equals(prop2))
+            failCount++;
+    }
+
+    private static Reader getReader(String src, String csn)
+        throws Exception {
+        return new InputStreamReader(
+                   new ByteArrayInputStream(src.getBytes()),
+                   csn);
+    }
+
+    private static OutputStream getFOS(String name)
+        throws Exception
+    {
+        return new FileOutputStream(name);
+    }
+
+    private static Writer getFOSW(String name, String csn)
+        throws Exception
+    {
+        return new OutputStreamWriter(
+                   new FileOutputStream(name),
+                   csn);
+    }
+
+    private static Reader getReader(byte[] src, String csn)
+        throws Exception {
+        return new InputStreamReader(new ByteArrayInputStream(src), csn);
+    }
+
+    private static InputStream getInputStream(String src) {
+        return new ByteArrayInputStream(src.getBytes());
+    }
+
+    private static InputStream getInputStream(byte[] src) {
+        return new ByteArrayInputStream(src);
+    }
+
+    private static void BlankLines() throws Exception {
+        // write a single space to the output stream
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        baos.write(' ');
+        // test empty properties
+        Properties prop1 = new Properties();
+
+        // now load the file we just created, into a properties object.
+        // the properties object should have no elements, but due to a
+        // bug, it has an empty key/value. key = "", value = ""
+        Properties prop2 = new Properties();
+        prop2.load(getInputStream(baos.toByteArray()));
+        check(prop1, prop2);
+
+        // test reader
+        prop2 = new Properties();
+        prop2.load(getReader(baos.toByteArray(), "UTF-8"));
+        check(prop1, prop2);
+
+        report("BlinkLine");
+    }
+
+    private static void EscapeSpace() throws Exception {
+        String propsCases =
+            "key1=\\ \\ Value\\u4e001, has leading and trailing spaces\\  \n" +
+            "key2=Value\\u4e002,\\ does not have\\ leading or trailing\\ spaces\n" +
+            "key3=Value\\u4e003,has,no,spaces\n" +
+            "key4=Value\\u4e004, does not have leading spaces\\  \n" +
+            "key5=\\t\\ \\ Value\\u4e005, has leading tab and no trailing spaces\n" +
+            "key6=\\ \\ Value\\u4e006,doesnothaveembeddedspaces\\ \\ \n" +
+            "\\ key1\\ test\\ =key1, has leading and trailing spaces  \n" +
+            "key2\\ test=key2, does not have leading or trailing spaces\n" +
+            "key3test=key3,has,no,spaces\n" +
+            "key4\\ test\\ =key4, does not have leading spaces  \n" +
+            "\\t\\ key5\\ test=key5, has leading tab and no trailing spaces\n" +
+            "\\ \\ key6\\ \\ =\\  key6,doesnothaveembeddedspaces  ";
+
+        // Put the same properties, but without the escape char for space in
+        // value part.
+        Properties props = new Properties();
+        props.put("key1", "  Value\u4e001, has leading and trailing spaces  ");
+        props.put("key2", "Value\u4e002, does not have leading or trailing spaces");
+        props.put("key3", "Value\u4e003,has,no,spaces");
+        props.put("key4", "Value\u4e004, does not have leading spaces  ");
+        props.put("key5", "\t  Value\u4e005, has leading tab and no trailing spaces");
+        props.put("key6", "  Value\u4e006,doesnothaveembeddedspaces  ");
+        props.put(" key1 test ", "key1, has leading and trailing spaces  ");
+        props.put("key2 test", "key2, does not have leading or trailing spaces");
+        props.put("key3test", "key3,has,no,spaces");
+        props.put("key4 test ", "key4, does not have leading spaces  ");
+        props.put("\t key5 test", "key5, has leading tab and no trailing spaces");
+        props.put("  key6  ", "  key6,doesnothaveembeddedspaces  ");
+
+        // Load properties with escape character '\' before space characters
+        Properties props1 = new Properties();
+        props1.load(getInputStream(propsCases));
+        check(props1, props);
+
+        // Test Reader
+        props1 = new Properties();
+        props1.load(getReader(propsCases, "UTF-8"));
+        check(props1, props);
+
+        // Also store the new properties to a storage
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        props.store(baos, "EscapeSpace Test");
+
+        props1 = new Properties();
+        props1.load(getInputStream(baos.toByteArray()));
+        check(props1, props);
+
+        // Reader should work as well
+        props1 = new Properties();
+        props1.load(getReader(baos.toByteArray(), "UTF-8"));
+        check(props1, props);
+
+        // Try Writer
+        baos = new ByteArrayOutputStream();
+        props.store(new OutputStreamWriter(baos, "UTF-8"),
+                     "EscapeSpace Test");
+
+        props1 = new Properties();
+        props1.load(getReader(baos.toByteArray(), "UTF-8"));
+        check(props1, props);
+
+        report("EscapeSpace");
+    }
+
+    private static void LoadParsing() throws Exception {
+        File f = new File(System.getProperty("test.src", "."), "input.txt");
+        FileInputStream myIn = new FileInputStream(f);
+        Properties myProps = new Properties();
+        int size = 0;
+        try {
+            myProps.load(myIn);
+        } finally {
+            myIn.close();
+        }
+
+        if (!myProps.getProperty("key1").equals("value1")      || // comment
+            !myProps.getProperty("key2").equals("abc\\defg\\") || // slash
+            !myProps.getProperty("key3").equals("value3")      || // spaces in key
+            !myProps.getProperty("key4").equals(":value4")     || // separator
+            // Does not recognize comments with leading spaces
+            (myProps.getProperty("#") != null)                 ||
+            // Wrong number of keys in Properties
+            ((size=myProps.size()) != 4))
+            failCount++;
+        report("LoadParsing");
+    }
+
+    private static void SaveEncoding() throws Exception {
+        // Create a properties object to save
+        Properties props = new Properties();
+        props.put("signal", "val\u0019");
+        props.put("ABC 10", "value0");
+        props.put("\uff10test", "value\u0020");
+        props.put("key with spaces", "value with spaces");
+        props.put("key with space and Chinese_\u4e00", "valueWithChinese_\u4e00");
+        props.put(" special#=key ", "value3");
+
+        // Save the properties and check output
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        props.store(baos,"A test");
+
+        // Read properties file and verify \u0019
+        BufferedReader in = new BufferedReader(
+                                new InputStreamReader(
+                                    new ByteArrayInputStream(
+                                        baos.toByteArray())));
+        String firstLine = "foo";
+        while (!firstLine.startsWith("signal"))
+            firstLine = in.readLine();
+        if (firstLine.length() != 16)
+            failCount++;
+
+        // Load the properties set
+        Properties newProps = new Properties();
+        newProps.load(getInputStream(baos.toByteArray()));
+        check(newProps, props);
+
+        // Store(Writer)/Load(Reader)
+        baos = new ByteArrayOutputStream();
+        props.store(new OutputStreamWriter(baos, "EUC_JP"), "A test");
+        newProps = new Properties();
+        newProps.load(getReader(baos.toByteArray(), "EUC_JP"));
+        check(newProps, props);
+
+        report("SaveEncoding");
+    }
+
+   /**
+    * This class tests to see if a properties object
+    * can successfully save and load properties
+    * using character encoding
+    */
+    private static void SaveLoadBasher() throws Exception {
+        String keyValueSeparators = "=: \t\r\n\f#!\\";
+
+        Properties originalProps = new Properties();
+        Properties loadedProps = new Properties();
+
+        // Generate a unicode key and value
+        Random generator = new Random();
+        int achar=0;
+        StringBuffer aKeyBuffer = new StringBuffer(120);
+        StringBuffer aValueBuffer = new StringBuffer(120);
+        String aKey;
+        String aValue;
+        int maxKeyLen = 100;
+        int maxValueLen = 100;
+        int maxPropsNum = 300;
+        for (int x=0; x<maxPropsNum; x++) {
+            for(int y=0; y<maxKeyLen; y++) {
+                achar = generator.nextInt();
+                char test;
+                if(achar < 99999) {
+                    test = (char)(achar);
+                }
+                else {
+                    int zz = achar % 10;
+                    test = keyValueSeparators.charAt(zz);
+                }
+                if (Character.isHighSurrogate(test)) {
+                    aKeyBuffer.append(test);
+                    aKeyBuffer.append('\udc00');
+                    y++;
+                } else if (Character.isLowSurrogate(test)) {
+                    aKeyBuffer.append('\ud800');
+                    aKeyBuffer.append(test);
+                    y++;
+                } else
+                    aKeyBuffer.append(test);
+            }
+            aKey = aKeyBuffer.toString();
+            for(int y=0; y<maxValueLen; y++) {
+                achar = generator.nextInt();
+                char test = (char)(achar);
+                if (Character.isHighSurrogate(test)) {
+                    aKeyBuffer.append(test);
+                    aKeyBuffer.append('\udc00');
+                    y++;
+                } else if (Character.isLowSurrogate(test)) {
+                    aKeyBuffer.append('\ud800');
+                    aKeyBuffer.append(test);
+                    y++;
+                } else {
+                    aValueBuffer.append(test);
+                }
+            }
+            aValue = aValueBuffer.toString();
+
+            // Attempt to add to original
+            try {
+                originalProps.put(aKey, aValue);
+            }
+            catch (IllegalArgumentException e) {
+                System.err.println("disallowing...");
+            }
+            aKeyBuffer.setLength(0);
+            aValueBuffer.setLength(0);
+        }
+
+        // Store(OutputStream)/Load(InputStream)
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        originalProps.store(baos, "test properties");
+        loadedProps.load(getInputStream(baos.toByteArray()));
+        check(loadedProps, originalProps);
+
+        // Store(Writer)/Load(Reader)
+        baos = new ByteArrayOutputStream();
+        originalProps.store(new OutputStreamWriter(baos, "UTF-8"),
+                            "test properties");
+        loadedProps.load(getReader(baos.toByteArray(), "UTF-8"));
+        check(loadedProps, originalProps);
+
+        report("SaveLoadBasher");
+    }
+
+
+    /* Note: this regression test only detects incorrect line
+     * separator on platform running the test
+     */
+    private static void SaveSeparator() throws Exception {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        Properties props = new Properties();
+        props.store(baos, "A test");
+
+        // Examine the result to verify that line.separator was used
+        String theSeparator = System.getProperty("line.separator");
+        String content = baos.toString();
+        if (!content.endsWith(theSeparator))
+            failCount++;
+
+        // store(Writer)
+        baos = new ByteArrayOutputStream();
+        props.store(new OutputStreamWriter(baos, "UTF-8"), "A test");
+        content = baos.toString();
+        if (!content.endsWith(theSeparator))
+            failCount++;
+
+        report("SaveSeparator");
+    }
+
+    // Ensure that the save method doesn't close its output stream
+    private static void SaveClose() throws Exception {
+        Properties p = new Properties();
+        p.put("Foo", "Bar");
+        class MyOS extends ByteArrayOutputStream {
+            boolean closed = false;
+            public void close() throws IOException {
+                this.closed = true;
+            }
+        }
+        MyOS myos = new MyOS();
+        p.store(myos, "Test");
+        if (myos.closed)
+            failCount++;
+
+        p.store(new OutputStreamWriter(myos, "UTF-8"), "Test");
+        if (myos.closed)
+            failCount++;
+
+        report ("SaveClose");
+    }
+
+    private static void UnicodeEscape() throws Exception {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        OutputStreamWriter osw = new OutputStreamWriter(baos);
+        osw.write("a=b\nb=\\u0\n");
+        osw.close();
+        Properties props = new Properties();
+        boolean failed = true;
+        try {
+            props.load(getInputStream(baos.toByteArray()));
+        } catch (IllegalArgumentException iae) {
+            failed = false;
+        }
+        if (failed)
+            failCount++;
+
+        failed = true;
+        props = new Properties();
+        try {
+            props.load(getReader(baos.toByteArray(), "UTF-8"));
+        } catch (IllegalArgumentException iae) {
+            failed = false;
+        }
+        if (failed)
+            failCount++;
+        report("UnicodeEscape");
+    }
+
+    private static void SaveComments() throws Exception {
+        String ls = System.getProperty("line.separator");
+        String[] input = new String[] {
+          "Comments with \u4e2d\u6587\u6c49\u5b57 included",
+          "Comments with \n Second comments line",
+          "Comments with \n# Second comments line",
+          "Comments with \n! Second comments line",
+          "Comments with last character is \n",
+          "Comments with last character is \r\n",
+          "Comments with last two characters are \n\n",
+          "Comments with last four characters are \r\n\r\n",
+          "Comments with \nkey4=value4",
+          "Comments with \n#key4=value4"};
+
+        String[] output = new String[] {
+          "#Comments with \\u4E2D\\u6587\\u6C49\\u5B57 included" + ls,
+          "#Comments with " + ls + "# Second comments line" + ls,
+          "#Comments with " + ls + "# Second comments line" + ls,
+          "#Comments with " + ls + "! Second comments line" + ls,
+          "#Comments with last character is " + ls+"#"+ls,
+          "#Comments with last character is " + ls+"#"+ls,
+          "#Comments with last two characters are " + ls+"#"+ls+"#"+ls,
+          "#Comments with last four characters are " + ls+"#"+ls+"#"+ls};
+
+        Properties props = new Properties();
+        ByteArrayOutputStream baos;
+        int i = 0;
+        for (i = 0; i < output.length; i++) {
+            baos = new ByteArrayOutputStream();
+            props.store(baos, input[i]);
+            String result = baos.toString("iso8859-1");
+            if (result.indexOf(output[i]) == -1) {
+                failCount++;
+            }
+        }
+        props.put("key1", "value1");
+        props.put("key2", "value2");
+        props.put("key3", "value3");
+        for (; i < input.length; i++) {
+            baos = new ByteArrayOutputStream();
+            props.store(baos, input[i]);
+            Properties propsNew = new Properties();
+            propsNew.load(getInputStream(baos.toByteArray()));
+            check(propsNew, props);
+
+            baos = new ByteArrayOutputStream();
+            props.store(new OutputStreamWriter(baos, "UTF-8"),
+                        input[i]);
+            propsNew = new Properties();
+            propsNew.load(getReader(baos.toByteArray(), "UTF-8"));
+            check(propsNew, props);
+        }
+        report("SaveComments");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/Save.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4034428
+ * @summary Test for leading space in values output from properties
+ */
+
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+/**
+ * This class tests to see if the properties object saves
+ * leading space in the value of a property as it should
+ * do according to the JLS
+ */
+public class Save {
+
+    public static void main(String argv[]) {
+        int testSucceeded=0;
+        FileOutputStream myOutput;
+
+        // create a properties object to save
+        Properties myProperties = new Properties();
+        String value = "   spacesfirst";
+        myProperties.put("atest", value);
+
+        try {
+            // save the object and check output
+            myOutput = new FileOutputStream("testout");
+            myProperties.store(myOutput,"A test");
+            myOutput.close();
+
+            //load the properties set
+            FileInputStream myIn = new FileInputStream("testout");
+            Properties myNewProps = new Properties();
+            try {
+                myNewProps.load(myIn);
+            } finally {
+                myIn.close();
+            }
+
+            //check the results
+            String newValue = (String) myNewProps.get("atest");
+            if (!newValue.equals(value))
+                throw new RuntimeException(
+                    "Properties does not save leading spaces in values correctly.");
+         } catch (IOException e) { //do nothing
+         }
+     }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/SaveClose.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4095273
+ * @summary Ensure that the save method doesn't close its output stream
+ * @author Mark Reinhold
+ */
+
+import java.util.Properties;
+import java.io.OutputStream;
+import java.io.FilterOutputStream;
+import java.io.IOException;
+
+
+public class SaveClose {
+
+
+    static class O extends FilterOutputStream {
+
+        boolean closed = false;
+
+        O(OutputStream o) {
+            super(o);
+        }
+
+        public void close() throws IOException {
+            this.closed = true;
+        }
+
+    }
+
+
+    public static void main(String argv[]) throws Exception {
+        Properties p = new Properties();
+        p.put("Foo", "Bar");
+        O o = new O(System.err);
+        p.store(o, "Test");
+        if (o.closed)
+            throw new Exception("Properties.save closed its output stream");
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/SaveComments.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 5087448
+ * @summary Verify that property.save saves comments correctly
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+public class SaveComments {
+
+    public static void main(String[] argv) throws IOException {
+        String ls = System.getProperty("line.separator");
+        String[] input = new String[] {
+          "Comments with \u4e2d\u6587\u6c49\u5b57 included",
+          "Comments with \n Second comments line",
+          "Comments with \n# Second comments line",
+          "Comments with \n! Second comments line",
+          "Comments with last character is \n",
+          "Comments with last character is \r\n",
+          "Comments with last two characters are \n\n",
+          "Comments with last four characters are \r\n\r\n",
+          "Comments with \nkey4=value4",
+          "Comments with \n#key4=value4"};
+
+        String[] output = new String[] {
+          "#Comments with \\u4E2D\\u6587\\u6C49\\u5B57 included" + ls,
+          "#Comments with " + ls + "# Second comments line" + ls,
+          "#Comments with " + ls + "# Second comments line" + ls,
+          "#Comments with " + ls + "! Second comments line" + ls,
+          "#Comments with last character is " + ls+"#"+ls,
+          "#Comments with last character is " + ls+"#"+ls,
+          "#Comments with last two characters are " + ls+"#"+ls+"#"+ls,
+          "#Comments with last four characters are " + ls+"#"+ls+"#"+ls};
+
+        Properties props = new Properties();
+        boolean failed = false;
+        int i = 0;
+        for (i = 0; i < output.length; i++) {
+            ByteArrayOutputStream baos = new ByteArrayOutputStream(200);
+            props.store(baos, input[i]);
+            String result = baos.toString("iso8859-1");
+            if (result.indexOf(output[i]) == -1) {
+                System.out.println("Wrong \"store()\" output:");
+                System.out.println(result);
+                failed = true;
+            }
+        }
+
+        props.put("key1", "value1");
+        props.put("key2", "value2");
+        props.put("key3", "value3");
+        for (; i < input.length; i++) {
+            ByteArrayOutputStream baos = new ByteArrayOutputStream(200);
+            props.store(baos, input[i]);
+            Properties propsNew = new Properties();
+            propsNew.load(new ByteArrayInputStream(baos.toByteArray()));
+            /*
+            Set<Map.Entry<Object, Object>> kvsetNew = propsNew.entrySet();
+            Set<Map.Entry<Object, Object>> kvset = props.entrySet();
+            if (!kvsetNew.containsAll(kvset) || !kvset.containsAll(kvsetNew)) {
+            */
+            if (!props.equals (propsNew)) {
+                System.out.println("Wrong output:");
+                System.out.println(baos.toString("iso8859-1"));
+                failed = true;
+            }
+        }
+        if (failed)
+            throw new RuntimeException("Incorrect Properties Comment Output.");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/SaveEncoding.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+ /*
+  * @test
+  * @bug 4026910 4011163 4077980 4096786 4213537
+  * @summary Test for saving and loading encoded keys and values
+  */
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.Properties;
+
+/**
+ * This class tests to see if the properties object saves
+ * and loads keys and values properly
+ */
+public class SaveEncoding {
+
+    public static void main(String argv[]) {
+        int testSucceeded=0;
+        FileOutputStream myOutput;
+
+        // Create a properties object to save
+        Properties myProperties = new Properties();
+        myProperties.put("signal", "val\u0019");
+        myProperties.put("ABC 10", "value0");
+        myProperties.put("\uff10test", "value\u0020");
+        myProperties.put("key with spaces", "value with spaces");
+        myProperties.put(" special#=key ", "value3");
+
+        try {
+            // Destroy old test file if any
+            File myFile = new File("testout");
+            myFile.delete();
+
+            // Save the object and check output
+            myOutput = new FileOutputStream("testout");
+            myProperties.store(myOutput,"A test");
+            myOutput.close();
+
+            // Read properties file and verify \u0019
+            FileInputStream inFile = new FileInputStream("testout");
+            BufferedReader in = new BufferedReader(
+                                new InputStreamReader(inFile));
+            String firstLine = "foo";
+            while (!firstLine.startsWith("signal"))
+                firstLine = in.readLine();
+            inFile.close();
+            if (firstLine.length() != 16)
+                throw new RuntimeException(
+                    "Incorrect storage of values < 32.");
+
+            // Load the properties set
+            FileInputStream myIn = new FileInputStream("testout");
+            Properties myNewProps = new Properties();
+            try {
+                myNewProps.load(myIn);
+            } finally {
+                myIn.close();
+            }
+
+            // Check the results
+            if (!myNewProps.equals(myProperties))
+                throw new RuntimeException(
+                    "Properties is not character encoding safe.");
+        } catch (IOException e) { // Do nothing
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/SaveLoadBasher.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4077980 4011163 4096786 4075955
+ * @summary Test properties save and load methods
+ * @key randomness
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Properties;
+import java.util.Random;
+
+/**
+ * This class tests to see if a properties object
+ * can successfully save and load properties
+ * using character encoding
+ */
+public class SaveLoadBasher {
+
+    private static String keyValueSeparators = "=: \t\r\n\f#!\\";
+
+    public static void main(String[] args) throws Exception {
+
+        Properties originalProps = new Properties();
+        Properties loadedProps = new Properties();
+
+        // Generate a unicode key and value
+        Random generator = new Random();
+        int achar=0;
+        StringBuffer aKeyBuffer = new StringBuffer(120);
+        StringBuffer aValueBuffer = new StringBuffer(120);
+        String aKey;
+        String aValue;
+        for (int x=0; x<300; x++) {
+            for(int y=0; y<100; y++) {
+                achar = generator.nextInt();
+                char test;
+                if(achar < 99999) {
+                    test = (char)(achar);
+                }
+                else {
+                    int zz = achar % 10;
+                    test = keyValueSeparators.charAt(zz);
+                }
+                aKeyBuffer.append(test);
+            }
+            aKey = aKeyBuffer.toString();
+            for(int y=0; y<100; y++) {
+                achar = generator.nextInt();
+                char test = (char)(achar);
+                aValueBuffer.append(test);
+            }
+            aValue = aValueBuffer.toString();
+
+            // Attempt to add to original
+            try {
+                originalProps.put(aKey, aValue);
+            }
+            catch (IllegalArgumentException e) {
+                System.err.println("disallowing...");
+            }
+            aKeyBuffer.setLength(0);
+            aValueBuffer.setLength(0);
+        }
+
+        // Destroy old test file if it exists
+        File oldTestFile = new File("props3");
+        oldTestFile.delete();
+
+        // Save original
+        System.out.println("Saving...");
+        OutputStream out = new FileOutputStream("props3");
+        originalProps.store(out, "test properties");
+        out.close();
+
+        // Load in the set
+        System.out.println("Loading...");
+        InputStream in = new FileInputStream("props3");
+        try {
+            loadedProps.load(in);
+        } finally {
+            in.close();
+        }
+
+        // Compare results
+        if (!originalProps.equals(loadedProps))
+           throw new RuntimeException("Properties load and save failed");
+
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/SaveSeparator.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4062657
+ * @summary Verify that property.save uses local lineseparator
+ */
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+/* Note: this regression test only detects incorrect line
+ * separator on platform running the test
+ */
+
+public class SaveSeparator {
+
+    public static void main(String[] argv) throws IOException {
+        // Save a property set
+        Properties myProps = new Properties();
+        ByteArrayOutputStream myOut = new ByteArrayOutputStream(40);
+        myProps.store(myOut, "A test");
+
+        // Examine the result to verify that line.separator was used
+        String theSeparator = System.getProperty("line.separator");
+        String content = myOut.toString();
+        if (!content.endsWith(theSeparator))
+            throw new RuntimeException("Incorrect Properties line separator.");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/StoreDeadlock.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6199320
+ * @summary Properties.store() causes deadlock when concurrently calling TimeZone apis
+ * @run main/timeout=20 StoreDeadlock
+ * @author Xueming Shen
+ */
+
+import java.io.IOException;
+import java.util.Properties;
+import java.util.TimeZone;
+
+public class StoreDeadlock {
+    public StoreDeadlock() {
+        Properties sysproperty = System.getProperties();
+        Thread1 t1 = new Thread1(sysproperty);
+        Thread2 t2 = new Thread2();
+        t1.start();
+        t2.start();
+    }
+    public static void main(String[] args) {
+        StoreDeadlock deadlock = new StoreDeadlock();
+    }
+    class Thread1 extends Thread {
+        Properties sp;
+        public Thread1(Properties p) {
+            sp = p;
+        }
+        public void run() {
+            try {
+                sp.store(System.out, null);
+            } catch (IOException e) {
+                System.out.println("IOException : " + e);
+            }
+        }
+    }
+    class Thread2 extends Thread {
+        public void run() {
+            System.out.println("tz=" + TimeZone.getTimeZone("PST"));
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/StringPropertyNames.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug     6253413 8059361
+ * @summary Test for Properties.stringPropertyNames() if the system
+ *          properties contain another list of properties as the defaults.
+ * @author  Mandy Chung
+ *
+ * @run build StringPropertyNames
+ * @run main  StringPropertyNames
+ */
+
+import java.util.Properties;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.Set;
+
+public class StringPropertyNames {
+    private static int NUM_SHARE_PROPS = 2;
+    private static int NUM_PROPS1 = 3;
+    private static int NUM_PROPS2 = 5;
+    private static String KEY = "good.property.";
+    private static String VALUE = "good.value.";
+    public static void main(String[] argv) throws Exception {
+        Properties props1 = new Properties();
+        Properties props2 = new Properties(props1);
+
+        // add several new properties
+        for (int i = 0; i < NUM_PROPS1; i++) {
+            props1.put(KEY + "1." + i, VALUE + "1." + i);
+        }
+        for (int i = 0; i < NUM_PROPS2; i++) {
+            props2.put(KEY + "2." + i, VALUE + "2." + i);
+        }
+
+        // add the same properties in both props1 and props2
+        for (int i = 0; i < NUM_SHARE_PROPS; i++) {
+            props1.put(KEY + i, VALUE + "1." + i);
+            props2.put(KEY + i, VALUE + "2." + i);
+        }
+        checkProperties(props1,
+                        NUM_PROPS1 + NUM_SHARE_PROPS, // size of props1
+                        NUM_PROPS1 + NUM_SHARE_PROPS, // num of string keys
+                        NUM_PROPS1 + NUM_SHARE_PROPS, // num of keys in propertyName(),
+                        false);
+        checkProperties(props2,
+                        NUM_PROPS2 + NUM_SHARE_PROPS, // size of props2
+                        NUM_PROPS1 + NUM_PROPS2 + NUM_SHARE_PROPS, // num of string keys
+                        NUM_PROPS1 + NUM_PROPS2 + NUM_SHARE_PROPS, // num of keys in propertyName(),
+                        false);
+
+        // Add non-String value
+        props1.put(KEY + "9", new Integer(4));
+        checkProperties(props1,
+                        NUM_PROPS1 + NUM_SHARE_PROPS + 1, // size of props1
+                        NUM_PROPS1 + NUM_SHARE_PROPS, // num of string keys
+                        NUM_PROPS1 + NUM_SHARE_PROPS + 1, // num of keys in propertyName(),
+                        false);
+        checkProperties(props2,
+                        NUM_PROPS2 + NUM_SHARE_PROPS, // size of props2
+                        NUM_PROPS1 + NUM_PROPS2 + NUM_SHARE_PROPS, // num of string keys
+                        NUM_PROPS1 + NUM_PROPS2 + NUM_SHARE_PROPS + 1, // num of keys in propertyName(),
+                        false);
+        Object v = props1.remove(KEY + "9");
+        if (v == null) {
+            throw new RuntimeException("Test Failed: " +
+                "Key " + KEY + "9" + " not found");
+        }
+
+        // Add a non-String key
+        props1.put(new Integer(5), "good.value.5");
+        props2.put(new Object(), new Object());
+        checkProperties(props1,
+                        NUM_PROPS1 + NUM_SHARE_PROPS + 1, // size of props1
+                        NUM_PROPS1 + NUM_SHARE_PROPS, // num of string keys
+                        NUM_PROPS1 + NUM_SHARE_PROPS + 1, // num of keys in propertyName(),
+                        true);
+        checkProperties(props2,
+                        NUM_PROPS2 + NUM_SHARE_PROPS + 1, // size of props2
+                        NUM_PROPS1 + NUM_PROPS2 + NUM_SHARE_PROPS, // num of string keys
+                        NUM_PROPS1 + NUM_PROPS2 + NUM_SHARE_PROPS + 2, // num of keys in propertyName(),
+                        true);
+        System.out.println("Test passed.");
+    }
+
+    private static void checkProperties(Properties props,
+                                        int propSize,
+                                        int numStringKeys,
+                                        int enumerateSize,
+                                        boolean hasNonStringKeys) {
+        // check the size of the properties
+        if (props.size() != propSize) {
+            throw new RuntimeException("Test Failed: " +
+                "Expected number of properties = " +
+                propSize + " but found = " + props.size());
+        }
+
+        // check the number of properties whose key and value
+        // are both strings
+        Set<String> keys = props.stringPropertyNames();
+        if (keys.size() != numStringKeys) {
+            throw new RuntimeException("Test Failed: " +
+                "Expected number of String keys = " +
+                numStringKeys + " but found = " + keys.size());
+        }
+        boolean cceThrown = false;
+        try {
+            // check the number of properties whose key are strings
+            // but its value can be anything in the current impl
+            int count = 0;
+            Enumeration<?> e = props.propertyNames();
+            for (;e.hasMoreElements(); e.nextElement()) {
+                count++;
+            }
+            if (count != enumerateSize) {
+                throw new RuntimeException("Test Failed: " +
+                    "Expected number of enumerated keys = " +
+                    enumerateSize + " but found = " + count);
+            }
+        } catch (ClassCastException e) {
+            if (!hasNonStringKeys) {
+                RuntimeException re = new RuntimeException("Test Failed: " +
+                    "ClassCastException is expected not to be thrown");
+                re.initCause(e);
+                throw re;
+            }
+            cceThrown = true;
+        }
+
+        if ((hasNonStringKeys && !cceThrown)) {
+            throw new RuntimeException("Test Failed: " +
+                "ClassCastException is expected to be thrown");
+        }
+
+        // make sure the set cannot be modified
+        try {
+            keys.add("xyzzy");
+            throw new RuntimeException("Test Failed: " +
+                "add() should have thrown UnsupportedOperationException");
+        } catch (UnsupportedOperationException ignore) { }
+
+        Iterator<String> it = keys.iterator();
+        if (it.hasNext()) {
+            try {
+                keys.remove(it.next());
+                throw new RuntimeException("Test Failed: " +
+                    "remove() should have thrown UnsupportedOperationException");
+            } catch (UnsupportedOperationException ignore) { }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/UnicodeEscape.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4792682
+ * @summary Test for correct exception with a short unicode escape
+*/
+
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.InputStream;
+import java.util.Properties;
+
+public class UnicodeEscape {
+
+    public static void main(String argv[]) throws Exception {
+        save();
+        load();
+    }
+
+    private static void save() throws Exception {
+        FileWriter out = new FileWriter("a.properties");
+        out.write("a=b\nb=\\u0\n");
+        out.close();
+    }
+
+    private static void load() throws Exception {
+        Properties properties = new Properties();
+        InputStream in = new FileInputStream("a.properties");
+        try {
+            properties.load(in);
+        } catch (IllegalArgumentException iae) {
+            // Correct result
+        } finally {
+            in.close();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/XMLSaveLoadBasher.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4749531 5015114 5055738
+ * @summary Test properties XML save and load methods
+ * @key randomness
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Properties;
+import java.util.Random;
+
+/**
+ * This class tests to see if a properties object
+ * can successfully save and load properties in XML
+ */
+public class XMLSaveLoadBasher {
+
+    private static final int MAX_KEY_SIZE = 120;
+    private static final int MIN_KEY_SIZE = 1;
+    private static final int MAX_VALUE_SIZE = 120;
+    private static final int MIN_VALUE_SIZE = 0;
+
+    public static void main(String[] args) throws Exception {
+        testSaveLoad("UTF-8", "test save");
+        testSaveLoad("UTF-8", null);
+        testSaveLoad("ISO-8859-1", "test save");
+        testSaveLoad("KOI8-R", "test save");
+    }
+
+    private static void testSaveLoad(String encoding, String comment)
+        throws Exception
+    {
+        Properties originalProps = new Properties();
+        Properties loadedProps = new Properties();
+
+        // Generate a unicode key and value
+        Random generator = new Random();
+
+        for (int x=0; x<10; x++) {
+            String aKey;
+            String aValue;
+
+            // Assumes MAX_KEY_SIZE >> MIN_KEY_SIZE
+            int keyLen = generator.nextInt(MAX_KEY_SIZE - MIN_KEY_SIZE + 1) +
+                         MIN_KEY_SIZE;
+            int valLen = generator.nextInt(
+                MAX_VALUE_SIZE - MIN_VALUE_SIZE + 1) + MIN_VALUE_SIZE;
+
+            StringBuffer aKeyBuffer = new StringBuffer(keyLen);
+            StringBuffer aValueBuffer = new StringBuffer(valLen);
+
+            for(int y=0; y<keyLen; y++) {
+                char test = (char)(generator.nextInt(6527) + 32);
+                aKeyBuffer.append(test);
+            }
+            aKey = aKeyBuffer.toString();
+
+            for(int y=0; y<valLen; y++) {
+                char test = (char)(generator.nextInt(6527) + 32);
+                aValueBuffer.append(test);
+            }
+            aValue = aValueBuffer.toString();
+
+            // Attempt to add to original
+            try {
+                originalProps.setProperty(aKey, aValue);
+            } catch (IllegalArgumentException e) {
+                System.err.println("disallowing...");
+            }
+        }
+
+        //originalProps.put("squid", "kraken");
+        //originalProps.put("demon", "furnace");
+
+        // Destroy old test file if it exists
+        File oldTestFile = new File("props3");
+        oldTestFile.delete();
+
+        // Save original
+        System.err.println("Saving...");
+        try (OutputStream out = new FileOutputStream("props3")) {
+            originalProps.storeToXML(out, comment, encoding);
+        }
+
+        // Load in the set
+        System.err.println("Loading...");
+        try (InputStream in = new FileInputStream("props3")) {
+            loadedProps.loadFromXML(in);
+        }
+
+        // Compare results
+        if (!originalProps.equals(loadedProps))
+           throw new RuntimeException("Properties load and save failed");
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/input.txt	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,10 @@
+# this input file is used for the LoadParsing.java test
+# comment ending with slash \
+key1 = value1
+key2 = abc\\\
+def\
+g\\
+   key3 =   value3
+key4 = :value4
+ # comment with leading space
+#key = comment without line terminator
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/testData1	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,35 @@
+# testcases
+key0=abcd\
+
+\
+key1=value1
+
+key2 \= abcde
+key3
+
+   #key4=abcde
+key5 ===Arial,ANSI_CHARSET
+key6= WingDings,SYMBOL_CHARSET \\\
+ abc
+key7 Symbol,SYMBOL_CHARSET \
+
+	keyabcdef
+
+key8notassign   abcdef
+key9\ Term=ABCDE
+
+\\:key10=bar
+
+\\\\:key11=bar2
+
+\\\:key12=bar2
+
+key13dialog.3=
+key14_asdfa    
+key15  \ abcdef
+key16\ b=  \ abcdef
+key17=\
+#bar\
+baz
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/testData1.dos	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,35 @@
+# testcases
+key0=abcd\
+
+\
+key1=value1
+
+key2 \= abcde
+key3
+
+   #key4=abcde
+key5 ===Arial,ANSI_CHARSET
+key6= WingDings,SYMBOL_CHARSET \\\
+ abc
+key7 Symbol,SYMBOL_CHARSET \
+
+	keyabcdef
+
+key8notassign   abcdef
+key9\ Term=ABCDE
+
+\\:key10=bar
+
+\\\\:key11=bar2
+
+\\\:key12=bar2
+
+key13dialog.3=
+key14_asdfa    
+key15  \ abcdef
+key16\ b=  \ abcdef
+key17=\
+#bar\
+baz
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/testData2	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,4 @@
+#
+key1=-monotype-timesnewroman-regular-r---*-%d-*-*-p-*-iso8859-1serif.1a-monotype-timesnewroman-regular-r-normal--*-%d-*-*-p-*-iso8859-2serif.2a-b&h-LucidaBrightLat4-Normal-r-normal--*-%d-*-*-p-*-iso8859-4serif.3a-monotype-times-regular-r-normal--*-%d-*-*-p-*-iso8859-5serif.4a-monotype-timesnewromangreek-regular-r-normal--*-%d-*-*-p-*-iso8859-7serif.5a-monotype-times-regular-r-normal--*-%d-*-*-p-*-iso8859-9serif.6a-monotype-times-regular-r-normal--*-%d-*-*-p-*-iso8859-15serif.7a-hanyi-ming-medium-r-normal--*-%d-*-*-m-*-big5-1serif.8a-sun-song-medium-r-normal--*-%d-*-*-c-*-gb2312.1980-0serif.9a-ricoh-hgminchol-medium-r-normal--*-%d-*-*-m-*-jisx0201.1976-0serif.10a-ricoh-hgminchol-medium-r-normal--*-%d-*-*-m-*-jisx0208.1983-0serif.11a-ricoh-heiseimin-w3-r-normal--*-%d-*-*-m-*-jisx0212.1990-0serif.12a-hanyang-myeongjo-medium-r-normal--*-%d-*-*-m-*-ksc5601.1992-3serif.13a-urw-itczapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecificserif.14a-*-symbol-medium-r-normal--*-%d-*-*-p-*-sun-fontspecificbserif.italic.0=-monotype-timesbnewbroman-regular-i---*-%d-*-*-p-*-iso8859-1bserif.italic.1=-monotype-timesbnewbroman-regular-i-normal-italic-*-%d-*-*-p-*-iso8859-2
+
+key2=-b&h-LucidaBrightLat4-normal-i-normal-Italic-*-%d-*-*-p-*-iso8859-4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/testData2.dos	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,4 @@
+#
+key1=-monotype-timesnewroman-regular-r---*-%d-*-*-p-*-iso8859-1serif.1a-monotype-timesnewroman-regular-r-normal--*-%d-*-*-p-*-iso8859-2serif.2a-b&h-LucidaBrightLat4-Normal-r-normal--*-%d-*-*-p-*-iso8859-4serif.3a-monotype-times-regular-r-normal--*-%d-*-*-p-*-iso8859-5serif.4a-monotype-timesnewromangreek-regular-r-normal--*-%d-*-*-p-*-iso8859-7serif.5a-monotype-times-regular-r-normal--*-%d-*-*-p-*-iso8859-9serif.6a-monotype-times-regular-r-normal--*-%d-*-*-p-*-iso8859-15serif.7a-hanyi-ming-medium-r-normal--*-%d-*-*-m-*-big5-1serif.8a-sun-song-medium-r-normal--*-%d-*-*-c-*-gb2312.1980-0serif.9a-ricoh-hgminchol-medium-r-normal--*-%d-*-*-m-*-jisx0201.1976-0serif.10a-ricoh-hgminchol-medium-r-normal--*-%d-*-*-m-*-jisx0208.1983-0serif.11a-ricoh-heiseimin-w3-r-normal--*-%d-*-*-m-*-jisx0212.1990-0serif.12a-hanyang-myeongjo-medium-r-normal--*-%d-*-*-m-*-ksc5601.1992-3serif.13a-urw-itczapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecificserif.14a-*-symbol-medium-r-normal--*-%d-*-*-p-*-sun-fontspecificbserif.italic.0=-monotype-timesbnewbroman-regular-i---*-%d-*-*-p-*-iso8859-1bserif.italic.1=-monotype-timesbnewbroman-regular-i-normal-italic-*-%d-*-*-p-*-iso8859-2
+
+key2=-b&h-LucidaBrightLat4-normal-i-normal-Italic-*-%d-*-*-p-*-iso8859-4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Properties/testData3.dos	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,29 @@
+key1=\
+-monotype-times new roman-regular-r---*-%d-*-*-p-*-iso8859-1, \
+-monotype-times new roman-regular-r-normal--*-%d-*-*-p-*-iso8859-2, \
+-b&h-LucidaBrightLat4-Normal-r-normal--*-%d-*-*-p-*-iso8859-4, \
+-monotype-times-regular-r-normal--*-%d-*-*-p-*-iso8859-5, \
+-monotype-times new roman greek-regular-r-normal--*-%d-*-*-p-*-iso8859-7, \
+-monotype-times-regular-r-normal--*-%d-*-*-p-*-iso8859-9, \
+-monotype-times-regular-r-normal--*-%d-*-*-p-*-iso8859-15, \
+-hanyi-ming-medium-r-normal--*-%d-*-*-m-*-big5-1, \
+-sun-song-medium-r-normal--*-%d-*-*-c-*-gb2312.1980-0, \
+-ricoh-hg gothic b-medium-r-normal--*-%d-*-*-m-*-jisx0201.1976-0, \
+-ricoh-hg gothic b-medium-r-normal-*-*-%d-*-*-m-*-jisx0208.1983-0, \
+-ricoh-heiseimin-w3-r-normal--*-%d-*-*-m-*-jisx0212.1990-0, \
+-hanyang-myeongjo-medium-r-normal--*-%d-*-*-m-*-ksc5601.1992-3
+
+key2=\
+-monotype-times new roman-regular-i---*-%d-*-*-p-*-iso8859-1, \
+-monotype-times new roman-regular-i-normal-italic-*-%d-*-*-p-*-iso8859-2, \
+-b&h-LucidaBrightLat4-normal-i-normal-Italic-*-%d-*-*-p-*-iso8859-4, \
+-monotype-times-regular-i-normal-italic-*-%d-*-*-p-*-iso8859-5, \
+-monotype-times new roman greek-regular-i-normal--*-%d-*-*-p-*-iso8859-7, \
+-monotype-times-regular-i-normal-italic-*-%d-*-*-p-*-iso8859-9, \
+-monotype-times-regular-i-normal--*-%d-*-*-p-*-iso8859-15, \
+-hanyi-ming-medium-r-normal--*-%d-*-*-m-*-big5-1, \
+-sun-song-medium-r-normal--*-%d-*-*-c-*-gb2312.1980-0, \
+-ricoh-hg gothic b-medium-r-normal--*-%d-*-*-m-*-jisx0201.1976-0, \
+-ricoh-hg gothic b-medium-r-normal-*-*-%d-*-*-m-*-jisx0208.1983-0, \
+-ricoh-heiseimin-w3-r-normal--*-%d-*-*-m-*-jisx0212.1990-0, \
+-hanyang-myeongjo-medium-r-normal--*-%d-*-*-m-*-ksc5601.1992-3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/logging/LogManager/Configuration/rootLoggerHandlers/BadRootLoggerHandlers.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,304 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Objects;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.logging.Handler;
+import java.util.logging.Level;
+import java.util.logging.LogManager;
+import java.util.logging.Logger;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * @test
+ * @bug 8191033
+ * @build custom.DotHandler custom.Handler
+ * @run main/othervm -Dlogging.properties=badlogging.properties -Dclz=1custom.DotHandler BadRootLoggerHandlers CUSTOM
+ * @run main/othervm -Dlogging.properties=badlogging.properties -Dclz=1custom.DotHandler BadRootLoggerHandlers DEFAULT
+ * @run main/othervm -Dlogging.properties=badglobal.properties -Dclz=1custom.GlobalHandler BadRootLoggerHandlers CUSTOM
+ * @run main/othervm -Dlogging.properties=badglobal.properties -Dclz=1custom.GlobalHandler BadRootLoggerHandlers DEFAULT
+ * @run main/othervm/java.security.policy==test.policy -Dlogging.properties=badlogging.properties -Dclz=1custom.DotHandler BadRootLoggerHandlers CUSTOM
+ * @run main/othervm/java.security.policy==test.policy  -Dlogging.properties=badlogging.properties -Dclz=1custom.DotHandler BadRootLoggerHandlers DEFAULT
+ * @run main/othervm/java.security.policy==test.policy  -Dlogging.properties=badglobal.properties -Dclz=1custom.GlobalHandler BadRootLoggerHandlers CUSTOM
+ * @run main/othervm/java.security.policy==test.policy  -Dlogging.properties=badglobal.properties -Dclz=1custom.GlobalHandler BadRootLoggerHandlers DEFAULT
+ * @author danielfuchs
+ */
+public class BadRootLoggerHandlers {
+
+    public static final Path SRC_DIR =
+            Paths.get(System.getProperty("test.src", "src"));
+    public static final Path USER_DIR =
+            Paths.get(System.getProperty("user.dir", "."));
+    public static final Path CONFIG_FILE = Paths.get(
+            Objects.requireNonNull(System.getProperty("logging.properties")));
+    public static final String BAD_HANDLER_NAME =
+            Objects.requireNonNull(System.getProperty("clz"));
+
+    static enum TESTS { CUSTOM, DEFAULT}
+    public static final class CustomLogManager extends LogManager {
+        final ConcurrentMap<String, Logger> loggers = new ConcurrentHashMap<>();
+        @Override
+        public boolean addLogger(Logger logger) {
+            return loggers.putIfAbsent(logger.getName(), logger) == null;
+        }
+
+        @Override
+        public Enumeration<String> getLoggerNames() {
+            return Collections.enumeration(loggers.keySet());
+        }
+
+        @Override
+        public Logger getLogger(String name) {
+            return loggers.get(name);
+        }
+    }
+
+    public static class SystemErr extends OutputStream {
+        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        final OutputStream wrapped;
+        public SystemErr(OutputStream out) {
+            this.wrapped = out;
+        }
+
+        @Override
+        public void write(int b) throws IOException {
+            baos.write(b);
+            wrapped.write(b);
+        }
+
+        public void close() throws IOException {
+            flush();
+            super.close();
+        }
+
+        public void flush() throws IOException {
+            super.flush();
+            wrapped.flush();
+        }
+
+    }
+
+    // Uncomment this to run the test on Java 8. Java 8 does not have
+    // List.of(...)
+    //    static final class List {
+    //        static <T> java.util.List<T> of(T... items) {
+    //            return Collections.unmodifiableList(Arrays.asList(items));
+    //        }
+    //    }
+
+    public static void main(String[] args) throws IOException {
+        Path initialProps = SRC_DIR.resolve(CONFIG_FILE);
+        Path loggingProps = USER_DIR.resolve(CONFIG_FILE);
+        if (args.length != 1) {
+            throw new IllegalArgumentException("expected (only) one of " + List.of(TESTS.values()));
+        }
+
+        TESTS test = TESTS.valueOf(args[0]);
+        System.setProperty("java.util.logging.config.file", loggingProps.toString());
+        if (test == TESTS.CUSTOM) {
+            System.setProperty("java.util.logging.manager", CustomLogManager.class.getName());
+        }
+
+        Files.copy(initialProps, loggingProps, StandardCopyOption.REPLACE_EXISTING);
+
+        SystemErr err = new SystemErr(System.err);
+        System.setErr(new PrintStream(err));
+
+        System.out.println("Root level is: " + Logger.getLogger("").getLevel());
+        if (Logger.getLogger("").getLevel() != Level.INFO) {
+            throw new RuntimeException("Expected root level INFO, got: "
+                                        + Logger.getLogger("").getLevel());
+        }
+
+        Class<? extends LogManager> logManagerClass =
+                LogManager.getLogManager().getClass();
+        Class<? extends LogManager> expectedClass =
+                test == TESTS.CUSTOM ? CustomLogManager.class : LogManager.class;
+        if (logManagerClass != expectedClass) {
+            throw new RuntimeException("Bad class for log manager: " + logManagerClass
+                                        + " expected " + expectedClass + " for " + test);
+        }
+
+        if (test == TESTS.DEFAULT) {
+            // Verify that we have two handlers. One was configured with
+            // handlers=custom.Handler, the other with
+            // .handlers=custom.DotHandler
+            // Verify that exactly one of the two handlers is a custom.Handler
+            // Verify that exactly one of the two handlers is a custom.DotHandler
+            // Verify that the two handlers have an id of '1'
+            checkHandlers(Logger.getLogger(""),
+                    Logger.getLogger("").getHandlers(),
+                    1L,
+                    custom.Handler.class,
+                    custom.DotHandler.class);
+        } else {
+            // Verify that we have one handler, configured with
+            // handlers=custom.Handler.
+            // Verify that it is a custom.Handler
+            // Verify that the handler have an id of '1'
+            checkHandlers(Logger.getLogger(""),
+                    Logger.getLogger("").getHandlers(),
+                    1L,
+                    custom.Handler.class);
+
+        }
+
+        // DEFAULT: The log message "hi" should appear twice on the console.
+        // CUSTOM: The log message "hi" should appear twice on the console.
+        // We don't check that. This is just for log analysis in case
+        // of test failure.
+        Logger.getAnonymousLogger().info("hi (" + test +")");
+
+        // Change the root logger level to FINE in the properties file
+        // and reload the configuration.
+        Files.write(loggingProps,
+                Files.lines(initialProps)
+                        .map((s) -> s.replace("INFO", "FINE"))
+                        .collect(Collectors.toList()));
+        LogManager.getLogManager().readConfiguration();
+
+        System.out.println("Root level is: " + Logger.getLogger("").getLevel());
+        if (Logger.getLogger("").getLevel() != Level.FINE) {
+            throw new RuntimeException("Expected root level FINE, got: "
+                    + Logger.getLogger("").getLevel());
+        }
+
+        // Verify that we have now only one handler, configured with
+        // handlers=custom.Handler, and that the other configured with
+        // .handlers=custom.DotHandler was ignored.
+        // Verify that the handler is a custom.Handler
+        // Verify that the handler has an id of '2'
+        checkHandlers(Logger.getLogger(""),
+                Logger.getLogger("").getHandlers(),
+                2L,
+                custom.Handler.class);
+
+        // The log message "there" should appear only once on the console.
+        // We don't check that. This is just for log analysis in case
+        // of test failure.
+        Logger.getAnonymousLogger().info("there!");
+
+        // Change the root logger level to FINER in the properties file
+        // and reload the configuration.
+        Files.write(loggingProps,
+                Files.lines(initialProps)
+                        .map((s) -> s.replace("INFO", "FINER"))
+                        .collect(Collectors.toList()));
+        LogManager.getLogManager().readConfiguration();
+
+        System.out.println("Root level is: " + Logger.getLogger("").getLevel());
+        if (Logger.getLogger("").getLevel() != Level.FINER) {
+            throw new RuntimeException("Expected root level FINER, got: "
+                    + Logger.getLogger("").getLevel());
+        }
+
+        // Verify that we have only one handler, configured with
+        // handlers=custom.Handler, and that the other configured with
+        // .handlers=custom.DotHandler was ignored.
+        // Verify that the handler is a custom.Handler
+        // Verify that the handler has an id of '3'
+        checkHandlers(Logger.getLogger(""),
+                Logger.getLogger("").getHandlers(),
+                3L,
+                custom.Handler.class);
+
+        // The log message "done" should appear only once on the console.
+        // We don't check that. This is just for log analysis in case
+        // of test failure.
+        Logger.getAnonymousLogger().info("done!");
+
+        byte[] errBytes = err.baos.toByteArray();
+        String errText = new String(errBytes);
+        switch(test) {
+            case CUSTOM:
+                if (errText.contains("java.lang.ClassNotFoundException: "
+                        + BAD_HANDLER_NAME)) {
+                    throw new RuntimeException("Error message found on System.err");
+                }
+                System.out.println("OK: ClassNotFoundException error message not found for " + test);
+                break;
+            case DEFAULT:
+                if (!errText.contains("java.lang.ClassNotFoundException: "
+                        + BAD_HANDLER_NAME)) {
+                    throw new RuntimeException("Error message not found on System.err");
+                }
+                System.err.println("OK: ClassNotFoundException error message found for " + test);
+                break;
+            default:
+                throw new InternalError("unknown test case: " + test);
+        }
+    }
+
+    static void checkHandlers(Logger logger, Handler[] handlers, Long expectedID, Class<?>... clz) {
+        // Verify that we have the expected number of handlers.
+        if (Stream.of(handlers).count() != clz.length) {
+            throw new RuntimeException("Expected " + clz.length + " handlers, got: "
+                    + List.of(logger.getHandlers()));
+        }
+        for (Class<?> cl : clz) {
+            // Verify that the handlers are of the expected class.
+            // For each class, we should have exactly one handler
+            // of that class.
+            if (Stream.of(handlers)
+                    .map(Object::getClass)
+                    .filter(cl::equals)
+                    .count() != 1) {
+                throw new RuntimeException("Expected one " + cl +", got: "
+                        + List.of(logger.getHandlers()));
+            }
+        }
+        // Verify that all handlers have the expected ID
+        if (Stream.of(logger.getHandlers())
+                .map(BadRootLoggerHandlers::getId)
+                .filter(expectedID::equals)
+                .count() != clz.length) {
+            throw new RuntimeException("Expected ids to be " + expectedID + ", got: "
+                    + List.of(logger.getHandlers()));
+        }
+    }
+
+    static long getId(Handler h) {
+        if (h instanceof custom.Handler) {
+            return ((custom.Handler)h).id;
+        }
+        if (h instanceof custom.DotHandler) {
+            return ((custom.DotHandler)h).id;
+        }
+        if (h instanceof custom.GlobalHandler) {
+            return ((custom.GlobalHandler)h).id;
+        }
+        return -1;
+    }
+}
--- a/test/jdk/java/util/logging/LogManager/Configuration/rootLoggerHandlers/RootLoggerHandlers.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/java/util/logging/LogManager/Configuration/rootLoggerHandlers/RootLoggerHandlers.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
-import java.util.Arrays;
+import java.nio.file.StandardCopyOption;
 import java.util.Collections;
 import java.util.List;
 import java.util.logging.Handler;
@@ -39,6 +39,7 @@
  * @bug 8191033
  * @build custom.DotHandler custom.Handler
  * @run main/othervm RootLoggerHandlers
+ * @run main/othervm/java.security.policy==test.policy RootLoggerHandlers
  * @author danielfuchs
  */
 public class RootLoggerHandlers {
@@ -61,7 +62,7 @@
         Path initialProps = SRC_DIR.resolve(CONFIG_FILE);
         Path loggingProps = USER_DIR.resolve(CONFIG_FILE);
         System.setProperty("java.util.logging.config.file", loggingProps.toString());
-        Files.copy(initialProps, loggingProps);
+        Files.copy(initialProps, loggingProps, StandardCopyOption.REPLACE_EXISTING);
         System.out.println("Root level is: " + Logger.getLogger("").getLevel());
         if (Logger.getLogger("").getLevel() != Level.INFO) {
             throw new RuntimeException("Expected root level INFO, got: "
@@ -73,10 +74,15 @@
         // Verify that exactly one of the two handlers is a custom.Handler
         // Verify that exactly one of the two handlers is a custom.DotHandler
         // Verify that the two handlers has an id of '1'
-        checkHandlers(Logger.getLogger("").getHandlers(),
+        checkHandlers(Logger.getLogger(""),
+                Logger.getLogger("").getHandlers(),
                 1L,
                 custom.Handler.class,
                 custom.DotHandler.class);
+        checkHandlers(Logger.getLogger("global"),
+                Logger.getGlobal().getHandlers(),
+                1L,
+                custom.GlobalHandler.class);
 
         // The log message "hi" should appear twice on the console.
         // We don't check that. This is just for log analysis in case
@@ -102,9 +108,13 @@
         // .handlers=custom.DotHandler was ignored.
         // Verify that the handler is a custom.Handler
         // Verify that the handler has an id of '2'
-        checkHandlers(Logger.getLogger("").getHandlers(),
+        checkHandlers(Logger.getLogger(""),
+                Logger.getLogger("").getHandlers(),
                 2L,
                 custom.Handler.class);
+        checkHandlers(Logger.getGlobal(),
+                Logger.getGlobal().getHandlers(),
+                1L);
 
         // The log message "there" should appear only once on the console.
         // We don't check that. This is just for log analysis in case
@@ -130,9 +140,45 @@
         // .handlers=custom.DotHandler was ignored.
         // Verify that the handler is a custom.Handler
         // Verify that the handler has an id of '3'
-        checkHandlers(Logger.getLogger("").getHandlers(),
+        checkHandlers(Logger.getLogger(""),
+                Logger.getLogger("").getHandlers(),
                 3L,
                 custom.Handler.class);
+        checkHandlers(Logger.getGlobal(),
+                Logger.getGlobal().getHandlers(),
+                1L);
+
+        LogManager.getLogManager().reset();
+        LogManager.getLogManager().updateConfiguration((s) -> (o,n) -> n);
+        // Verify that we have only one handler, configured with
+        // handlers=custom.Handler, and that the other configured with
+        // .handlers=custom.DotHandler was ignored.
+        // Verify that the handler is a custom.Handler
+        // Verify that the handler has an id of '4'
+        checkHandlers(Logger.getLogger(""),
+                Logger.getLogger("").getHandlers(),
+                4L,
+                custom.Handler.class);
+        checkHandlers(Logger.getGlobal(),
+                Logger.getGlobal().getHandlers(),
+                2L,
+                custom.GlobalHandler.class);
+
+        LogManager.getLogManager().updateConfiguration((s) -> (o,n) -> n);
+        // Verify that we have only one handler, configured with
+        // handlers=custom.Handler, and that the other configured with
+        // .handlers=custom.DotHandler was ignored.
+        // Verify that the handler is a custom.Handler
+        // Verify that the handler has an id of '4'
+        checkHandlers(Logger.getLogger(""),
+                Logger.getLogger("").getHandlers(),
+                4L,
+                custom.Handler.class);
+        checkHandlers(Logger.getGlobal(),
+                Logger.getGlobal().getHandlers(),
+                2L,
+                custom.GlobalHandler.class);
+
 
         // The log message "done" should appear only once on the console.
         // We don't check that. This is just for log analysis in case
@@ -140,11 +186,11 @@
         Logger.getAnonymousLogger().info("done!");
     }
 
-    static void checkHandlers(Handler[] handlers, Long expectedID, Class<?>... clz) {
+    static void checkHandlers(Logger logger, Handler[] handlers, Long expectedID, Class<?>... clz) {
         // Verify that we have the expected number of handlers.
         if (Stream.of(handlers).count() != clz.length) {
             throw new RuntimeException("Expected " + clz.length + " handlers, got: "
-                    + List.of(Logger.getLogger("").getHandlers()));
+                    + List.of(logger.getHandlers()));
         }
         for (Class<?> cl : clz) {
             // Verify that the handlers are of the expected class.
@@ -155,16 +201,16 @@
                     .filter(cl::equals)
                     .count() != 1) {
                 throw new RuntimeException("Expected one " + cl +", got: "
-                        + List.of(Logger.getLogger("").getHandlers()));
+                        + List.of(logger.getHandlers()));
             }
         }
         // Verify that all handlers have the expected ID
-        if (Stream.of(Logger.getLogger("").getHandlers())
+        if (Stream.of(logger.getHandlers())
                 .map(RootLoggerHandlers::getId)
                 .filter(expectedID::equals)
                 .count() != clz.length) {
             throw new RuntimeException("Expected ids to be " + expectedID + ", got: "
-                    + List.of(Logger.getLogger("").getHandlers()));
+                    + List.of(logger.getHandlers()));
         }
     }
 
@@ -175,6 +221,9 @@
         if (h instanceof custom.DotHandler) {
             return ((custom.DotHandler)h).id;
         }
+        if (h instanceof custom.GlobalHandler) {
+            return ((custom.GlobalHandler)h).id;
+        }
         return -1;
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/logging/LogManager/Configuration/rootLoggerHandlers/badglobal.properties	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,19 @@
+############################################################
+#  	Global properties
+############################################################
+
+# "handlers" specifies a comma separated list of log Handler
+# classes.  These handlers will be installed during VM startup.
+#handlers= java.util.logging.ConsoleHandler
+handlers= custom.Handler
+.handlers= custom.DotHandler
+global.handlers = 1custom.GlobalHandler, custom.GlobalHandler
+
+# Default global logging level.
+.level= INFO
+
+# Other configuration
+custom.Handler.level=ALL
+custom.DotHandler.level=ALL
+java.util.logging.SimpleFormatter.format=%4$s [%1$tc]: %2$s: %5$s%n
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/logging/LogManager/Configuration/rootLoggerHandlers/badlogging.properties	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,18 @@
+############################################################
+#  	Global properties
+############################################################
+
+# "handlers" specifies a comma separated list of log Handler
+# classes.  These handlers will be installed during VM startup.
+#handlers= java.util.logging.ConsoleHandler
+handlers= custom.Handler
+.handlers= 1custom.DotHandler,custom.DotHandler
+
+# Default global logging level.
+.level= INFO
+
+# Other configuration
+custom.Handler.level=ALL
+custom.DotHandler.level=ALL
+java.util.logging.SimpleFormatter.format=%4$s [%1$tc]: %2$s: %5$s%n
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/logging/LogManager/Configuration/rootLoggerHandlers/custom/GlobalHandler.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package custom;
+
+import java.util.concurrent.atomic.AtomicLong;
+
+/**
+ *
+ * @author danielfuchs
+ */
+public class GlobalHandler extends java.util.logging.ConsoleHandler {
+
+    public static final AtomicLong IDS = new AtomicLong();
+    public final long id = IDS.incrementAndGet();
+    public GlobalHandler() {
+        System.out.println("GlobalHandler(" + id + ") created");
+        //new Exception("GlobalHandler").printStackTrace();
+    }
+
+    @Override
+    public void close() {
+        System.out.println("GlobalHandler(" + id + ") closed");
+        super.close();
+    }
+
+    @Override
+    public String toString() {
+        return this.getClass().getName() + '(' + id + ')';
+    }
+}
--- a/test/jdk/java/util/logging/LogManager/Configuration/rootLoggerHandlers/logging.properties	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/java/util/logging/LogManager/Configuration/rootLoggerHandlers/logging.properties	Tue Jan 30 09:03:47 2018 -0800
@@ -7,6 +7,7 @@
 #handlers= java.util.logging.ConsoleHandler
 handlers= custom.Handler
 .handlers= custom.DotHandler
+global.handlers= custom.GlobalHandler
 
 # Default global logging level.
 .level= INFO
@@ -14,5 +15,6 @@
 # Other configuration
 custom.Handler.level=ALL
 custom.DotHandler.level=ALL
+custom.GlobalHandler.level=ALL
 java.util.logging.SimpleFormatter.format=%4$s [%1$tc]: %2$s: %5$s%n
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/logging/LogManager/Configuration/rootLoggerHandlers/test.policy	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,13 @@
+grant {
+    // permissions for RootLoggerHandlers
+    permission java.util.PropertyPermission "*", "read";
+    permission java.util.PropertyPermission "java.util.logging.config.file", "write";
+    permission java.io.FilePermission "<<ALL FILES>>", "read,write,delete";
+    permission java.util.logging.LoggingPermission "control";
+
+    // additional permissions for BadRootLoggerHandlers
+    permission java.util.PropertyPermission "java.util.logging.manager", "write";
+    permission java.lang.RuntimePermission "setIO";
+    permission java.lang.RuntimePermission "shutdownHooks";
+    permission java.lang.RuntimePermission "setContextClassLoader";
+};
--- a/test/jdk/sun/security/krb5/auto/AcceptPermissions.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/AcceptPermissions.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 9999999
+ * @bug 8005447 8194486
  * @summary default principal can act as anyone
+ * @library /test/lib
  * @compile -XDignore.symbol.file AcceptPermissions.java
- * @run main/othervm AcceptPermissions two
- * @run main/othervm AcceptPermissions unbound
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts AcceptPermissions two
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts AcceptPermissions unbound
  */
 
 import java.nio.file.Files;
--- a/test/jdk/sun/security/krb5/auto/AcceptorSubKey.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/AcceptorSubKey.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 7077646
+ * @bug 7077646 8194486
  * @summary gssapi wrap for CFX per-message tokens always set FLAG_ACCEPTOR_SUBKEY
+ * @library /test/lib
  * @compile -XDignore.symbol.file AcceptorSubKey.java
- * @run main/othervm AcceptorSubKey 0
- * @run main/othervm AcceptorSubKey 4
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts AcceptorSubKey 0
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts AcceptorSubKey 4
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/Addresses.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/Addresses.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8031111
+ * @bug 8031111 8194486
  * @summary fix krb5 caddr
+ * @library /test/lib
  * @compile -XDignore.symbol.file Addresses.java
- * @run main/othervm Addresses
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts Addresses
  */
 
 import sun.security.krb5.Config;
--- a/test/jdk/sun/security/krb5/auto/AddressesAndNameType.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/AddressesAndNameType.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 4501327 4868379 8039132
- * @run main/othervm AddressesAndNameType 1
- * @run main/othervm AddressesAndNameType 2
- * @run main/othervm AddressesAndNameType 3
+ * @bug 4501327 4868379 8039132 8194486
  * @summary noaddresses settings and server name type
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts AddressesAndNameType 1
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts AddressesAndNameType 2
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts AddressesAndNameType 3
  */
 
 import java.net.InetAddress;
--- a/test/jdk/sun/security/krb5/auto/Basic.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/Basic.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7152176
+ * @bug 7152176 8194486
  * @summary More krb5 tests
+ * @library /test/lib
  * @compile -XDignore.symbol.file Basic.java
- * @run main/othervm Basic
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts Basic
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/BasicKrb5Test.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/BasicKrb5Test.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,44 +23,62 @@
 
 /*
  * @test
- * @bug 6706974
+ * @bug 6706974 8014628 8194486
  * @summary Add krb5 test infrastructure
+ * @library /test/lib
  * @compile -XDignore.symbol.file BasicKrb5Test.java
- * @run main/othervm BasicKrb5Test
- * @run main/othervm BasicKrb5Test des-cbc-crc
- * @run main/othervm BasicKrb5Test des-cbc-md5
- * @run main/othervm BasicKrb5Test des3-cbc-sha1
- * @run main/othervm BasicKrb5Test aes128-cts
- * @run main/othervm BasicKrb5Test aes256-cts
- * @run main/othervm BasicKrb5Test rc4-hmac
- * @run main/othervm BasicKrb5Test -s
- * @run main/othervm BasicKrb5Test des-cbc-crc -s
- * @run main/othervm BasicKrb5Test des-cbc-md5 -s
- * @run main/othervm BasicKrb5Test des3-cbc-sha1 -s
- * @run main/othervm BasicKrb5Test aes128-cts -s
- * @run main/othervm BasicKrb5Test aes256-cts -s
- * @run main/othervm BasicKrb5Test rc4-hmac -s
- * @run main/othervm BasicKrb5Test -C
- * @run main/othervm BasicKrb5Test des-cbc-crc -C
- * @run main/othervm BasicKrb5Test des-cbc-md5 -C
- * @run main/othervm BasicKrb5Test des3-cbc-sha1 -C
- * @run main/othervm BasicKrb5Test aes128-cts -C
- * @run main/othervm BasicKrb5Test aes256-cts -C
- * @run main/othervm BasicKrb5Test rc4-hmac -C
- * @run main/othervm BasicKrb5Test -s -C
- * @run main/othervm BasicKrb5Test des-cbc-crc -s -C
- * @run main/othervm BasicKrb5Test des-cbc-md5 -s -C
- * @run main/othervm BasicKrb5Test des3-cbc-sha1 -s -C
- * @run main/othervm BasicKrb5Test aes128-cts -s -C
- * @run main/othervm BasicKrb5Test aes256-cts -s -C
- * @run main/othervm BasicKrb5Test rc4-hmac -s -C
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test des-cbc-crc
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test des-cbc-md5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test des3-cbc-sha1
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes128-sha1
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes256-sha1
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes128-sha2
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes256-sha2
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test rc4-hmac
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test -s
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test des-cbc-crc -s
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test des-cbc-md5 -s
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   des3-cbc-sha1 -s
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes128-sha1 -s
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes256-sha1 -s
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes128-sha2 -s
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes256-sha2 -s
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test rc4-hmac -s
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test des-cbc-crc -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test des-cbc-md5 -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   des3-cbc-sha1 -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes128-sha1 -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes256-sha1 -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes128-sha2 -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test aes256-sha2 -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test rc4-hmac -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test -s -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   des-cbc-crc -s -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   des-cbc-md5 -s -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   des3-cbc-sha1 -s -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   aes128-sha1 -s -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   aes256-sha1 -s -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   aes128-sha2 -s -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   aes256-sha2 -s -C
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicKrb5Test
+ *                   rc4-hmac -s -C
  */
 
 import org.ietf.jgss.GSSName;
 import sun.security.jgss.GSSUtil;
-import sun.security.krb5.Config;
 import sun.security.krb5.KrbException;
-import sun.security.krb5.internal.crypto.EType;
 
 /**
  * Basic JGSS/krb5 test with 3 parties: client, server, backend server. Each
--- a/test/jdk/sun/security/krb5/auto/BasicProc.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/BasicProc.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,13 @@
 
 /*
  * @test
- * @bug 8009977 8186884
+ * @bug 8009977 8186884 8194486
  * @summary A test to launch multiple Java processes using either Java GSS
  *          or native GSS
- * @library ../../../../java/security/testlibrary/
+ * @library ../../../../java/security/testlibrary/ /test/lib
  * @compile -XDignore.symbol.file BasicProc.java
- * @run main/othervm BasicProc launcher
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BasicProc launcher
  */
 
 import java.nio.file.Files;
@@ -304,6 +305,7 @@
      */
     private static Proc proc(String lib) throws Exception {
         Proc p = Proc.create("BasicProc")
+                .inheritProp("jdk.net.hosts.file")
                 .prop("java.security.manager", "")
                 .perm(new javax.security.auth.AuthPermission("doAs"));
         if (lib != null) {
--- a/test/jdk/sun/security/krb5/auto/BogusKDC.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/BogusKDC.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,10 +33,12 @@
 
 /*
  * @test
- * @bug 4515853 8075297
+ * @bug 4515853 8075297 8194486
  * @summary Checks that Kerberos client tries slave KDC
  *          if master KDC is not responding
- * @run main/othervm BogusKDC
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts BogusKDC
  */
 public class BogusKDC {
 
--- a/test/jdk/sun/security/krb5/auto/CleanState.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/CleanState.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 6716534
+ * @bug 6716534 8194486
+ * @summary Krb5LoginModule has not cleaned temp info between authentication attempts
+ * @library /test/lib
  * @compile -XDignore.symbol.file CleanState.java
- * @run main/othervm CleanState
- * @summary Krb5LoginModule has not cleaned temp info between authentication attempts
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts CleanState
  */
 import com.sun.security.auth.module.Krb5LoginModule;
 import java.util.HashMap;
--- a/test/jdk/sun/security/krb5/auto/CrossRealm.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/CrossRealm.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 6706974
+ * @bug 6706974 8194486
+ * @summary Add krb5 test infrastructure
+ * @library /test/lib
  * @compile -XDignore.symbol.file CrossRealm.java
- * @run main/othervm CrossRealm
- * @summary Add krb5 test infrastructure
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts CrossRealm
  */
 import java.io.File;
 import java.io.FileOutputStream;
--- a/test/jdk/sun/security/krb5/auto/DiffNameSameKey.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/DiffNameSameKey.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 8005447
+ * @bug 8005447 8194486
  * @summary default principal can act as anyone
+ * @library /test/lib
  * @compile -XDignore.symbol.file DiffNameSameKey.java
- * @run main/othervm/fail DiffNameSameKey a
- * @run main/othervm DiffNameSameKey b
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts DiffNameSameKey a
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts DiffNameSameKey b
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/DiffSaltParams.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/DiffSaltParams.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,13 @@
 
 /*
  * @test
- * @bug 8186831
+ * @bug 8186831 8194486
  * @summary Kerberos ignores PA-DATA with a non-null s2kparams
+ * @library /test/lib
  * @compile -XDignore.symbol.file DiffSaltParams.java
- * @run main/othervm -Dsun.security.krb5.debug=true DiffSaltParams
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Dsun.security.krb5.debug=true
+ *      -Djdk.net.hosts.file=TestHosts DiffSaltParams
  */
 
 public class DiffSaltParams {
--- a/test/jdk/sun/security/krb5/auto/DupEtypes.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/DupEtypes.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,14 +23,16 @@
 
 /*
  * @test
- * @bug 7067974
+ * @bug 7067974 8194486
  * @summary multiple ETYPE-INFO-ENTRY with same etype and different salt
+ * @library /test/lib
  * @compile -XDignore.symbol.file DupEtypes.java
- * @run main/othervm DupEtypes 1
- * @run main/othervm DupEtypes 2
- * @run main/othervm/fail DupEtypes 3
- * @run main/othervm DupEtypes 4
- * @run main/othervm DupEtypes 5
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts DupEtypes 1
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts DupEtypes 2
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts DupEtypes 3
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts DupEtypes 4
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts DupEtypes 5
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/DynamicKeytab.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/DynamicKeytab.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 6894072
+ * @bug 6894072 8194486
+ * @summary always refresh keytab
+ * @library /test/lib
  * @compile -XDignore.symbol.file DynamicKeytab.java
- * @run main/othervm DynamicKeytab
- * @summary always refresh keytab
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts DynamicKeytab
  */
 
 import java.io.File;
--- a/test/jdk/sun/security/krb5/auto/EmptyPassword.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/EmptyPassword.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 6879540
+ * @bug 6879540 8194486
  * @summary enable empty password for kerberos 5
+ * @library /test/lib
  * @compile -XDignore.symbol.file EmptyPassword.java
- * @run main/othervm EmptyPassword
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts EmptyPassword
  */
 
 public class EmptyPassword {
--- a/test/jdk/sun/security/krb5/auto/FileKeyTab.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/FileKeyTab.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7152121
+ * @bug 7152121 8194486
  * @summary Krb5LoginModule no longer handles keyTabNames with "file:" prefix
+ * @library /test/lib
  * @compile -XDignore.symbol.file FileKeyTab.java
- * @run main/othervm FileKeyTab
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts FileKeyTab
  */
 
 import java.io.File;
--- a/test/jdk/sun/security/krb5/auto/ForwardableCheck.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/ForwardableCheck.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8022582
+ * @bug 8022582 8194486
  * @summary Relax response flags checking in sun.security.krb5.KrbKdcRep.check.
+ * @library /test/lib
  * @compile -XDignore.symbol.file ForwardableCheck.java
- * @run main/othervm ForwardableCheck
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts ForwardableCheck
  */
 
 import org.ietf.jgss.GSSException;
--- a/test/jdk/sun/security/krb5/auto/Forwarded.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/Forwarded.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8031111
+ * @bug 8031111 8194486
  * @summary fix krb5 caddr
+ * @library /test/lib
  * @compile -XDignore.symbol.file Forwarded.java
- * @run main/othervm Forwarded
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts Forwarded
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/GSS.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/GSS.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7152176
+ * @bug 7152176 8194486
  * @summary More krb5 tests
+ * @library /test/lib
  * @compile -XDignore.symbol.file GSS.java
- * @run main/othervm GSS
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts GSS
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/GSSUnbound.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/GSSUnbound.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8001104
+ * @bug 8001104 8194486
  * @summary Unbound SASL service: the GSSAPI/krb5 mech
+ * @library /test/lib
  * @compile -XDignore.symbol.file GSSUnbound.java
- * @run main/othervm GSSUnbound
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts GSSUnbound
  */
 
 import java.security.Security;
--- a/test/jdk/sun/security/krb5/auto/HttpNegotiateServer.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/HttpNegotiateServer.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 6578647 6829283 8171340
+ * @bug 6578647 6829283 8171340 8194486
  * @modules java.base/sun.security.util
  *          java.security.jgss/sun.security.krb5.internal:+open
  *          java.security.jgss/sun.security.jgss
@@ -35,11 +35,13 @@
  *          jdk.security.auth
  *          jdk.security.jgss
  *          jdk.httpserver
- * @run main/othervm HttpNegotiateServer
  * @summary Undefined requesting URL in java.net.Authenticator
  *          .getPasswordAuthentication()
  * @summary HTTP/Negotiate: Authenticator triggered again when
  *          user cancels the first one
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts HttpNegotiateServer
  */
 
 import com.sun.net.httpserver.Headers;
--- a/test/jdk/sun/security/krb5/auto/IgnoreChannelBinding.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/IgnoreChannelBinding.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,11 @@
 
 /*
  * @test
- * @bug 6851973
- * @run main/othervm IgnoreChannelBinding
+ * @bug 6851973 8194486
  * @summary ignore incoming channel binding if acceptor does not set one
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts IgnoreChannelBinding
  */
 
 import java.net.InetAddress;
--- a/test/jdk/sun/security/krb5/auto/KDC.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/KDC.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -241,14 +241,6 @@
         CHECK_ADDRESSES,
     };
 
-    static {
-        if (System.getProperty("jdk.net.hosts.file") == null) {
-            String hostsFileName
-                    = System.getProperty("test.src", ".") + "/TestHosts";
-            System.setProperty("jdk.net.hosts.file", hostsFileName);
-        }
-    }
-
     /**
      * A standalone KDC server.
      */
@@ -604,19 +596,7 @@
      */
     private static EncryptionKey generateRandomKey(int eType)
             throws KrbException  {
-        // Is 32 enough for AES256? I should have generated the keys directly
-        // but different cryptos have different rules on what keys are valid.
-        char[] pass = randomPassword();
-        String algo;
-        switch (eType) {
-            case EncryptedData.ETYPE_DES_CBC_MD5: algo = "DES"; break;
-            case EncryptedData.ETYPE_DES3_CBC_HMAC_SHA1_KD: algo = "DESede"; break;
-            case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96: algo = "AES128"; break;
-            case EncryptedData.ETYPE_ARCFOUR_HMAC: algo = "ArcFourHMAC"; break;
-            case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96: algo = "AES256"; break;
-            default: algo = "DES"; break;
-        }
-        return new EncryptionKey(pass, "NOTHING", algo);    // Silly
+        return genKey0(randomPassword(), "NOTHING", null, eType, null);
     }
 
     /**
@@ -680,6 +660,8 @@
         switch (etype) {
             case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96:
             case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96:
+            case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA256_128:
+            case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA384_192:
                 String pn = p.toString();
                 if (p.getRealmString() == null) {
                     pn = pn + "@" + getRealm();
@@ -687,7 +669,11 @@
                 if (s2kparamses.containsKey(pn)) {
                     return s2kparamses.get(pn);
                 }
-                return new byte[] {0, 0, 0x10, 0};
+                if (etype < EncryptedData.ETYPE_AES128_CTS_HMAC_SHA256_128) {
+                    return new byte[]{0, 0, 0x10, 0};
+                } else {
+                    return new byte[]{0, 0, (byte) 0x80, 0};
+                }
             default:
                 return null;
         }
@@ -715,9 +701,8 @@
                     kvno = pass[pass.length-1] - '0';
                 }
             }
-            return new EncryptionKey(EncryptionKeyDotStringToKey(
-                    getPassword(p, server), getSalt(p), getParams(p, etype), etype),
-                    etype, kvno);
+            return genKey0(getPassword(p, server), getSalt(p),
+                    getParams(p, etype), etype, kvno);
         } catch (KrbException ke) {
             throw ke;
         } catch (Exception e) {
@@ -735,6 +720,17 @@
     }
 
     /**
+     * Generates key from password.
+     */
+    private static EncryptionKey genKey0(
+            char[] pass, String salt, byte[] s2kparams,
+            int etype, Integer kvno) throws KrbException {
+        return new EncryptionKey(EncryptionKeyDotStringToKey(
+                pass, salt, s2kparams, etype),
+                etype, kvno);
+    }
+
+    /**
      * Processes an incoming request and generates a response.
      * @param in the request
      * @return the response
@@ -1181,8 +1177,8 @@
                 }
                 boolean allOld = true;
                 for (int i: eTypes) {
-                    if (i == EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96 ||
-                            i == EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96) {
+                    if (i >= EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96 &&
+                            i != EncryptedData.ETYPE_ARCFOUR_HMAC) {
                         allOld = false;
                         break;
                     }
--- a/test/jdk/sun/security/krb5/auto/KPEquals.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/KPEquals.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8015669
+ * @bug 8015669 8194486
  * @summary KerberosPrincipal::equals should ignore name-type
+ * @library /test/lib
  * @compile -XDignore.symbol.file KPEquals.java
- * @run main/othervm KPEquals
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts KPEquals
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/KdcPolicy.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/KdcPolicy.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,10 +38,12 @@
 
 /*
  * @test
- * @bug 8164656 8181461
- * @run main/othervm KdcPolicy udp
- * @run main/othervm KdcPolicy tcp
+ * @bug 8164656 8181461 8194486
  * @summary krb5.kdc.bad.policy test
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts KdcPolicy udp
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts KdcPolicy tcp
  */
 public class KdcPolicy {
 
--- a/test/jdk/sun/security/krb5/auto/KeyPermissions.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/KeyPermissions.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8004488
+ * @bug 8004488 8194486
  * @summary wrong permissions checked in krb5
+ * @library /test/lib
  * @compile -XDignore.symbol.file KeyPermissions.java
- * @run main/othervm KeyPermissions
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts KeyPermissions
  */
 
 import java.security.AccessControlException;
--- a/test/jdk/sun/security/krb5/auto/KeyTabCompat.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/KeyTabCompat.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,12 @@
 
 /*
  * @test
- * @bug 6894072
- * @bug 8004488
+ * @bug 6894072 8004488 8194486
+ * @summary always refresh keytab
+ * @library /test/lib
  * @compile -XDignore.symbol.file KeyTabCompat.java
- * @run main/othervm KeyTabCompat
- * @summary always refresh keytab
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts KeyTabCompat
  */
 
 import javax.security.auth.kerberos.KerberosKey;
--- a/test/jdk/sun/security/krb5/auto/KrbTicket.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/KrbTicket.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,9 +35,11 @@
 
 /*
  * @test
- * @bug 6857795 8075299
+ * @bug 6857795 8075299 8194486
  * @summary Checks Kerberos ticket properties
- * @run main/othervm KrbTicket
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts KrbTicket
  */
 public class KrbTicket {
 
--- a/test/jdk/sun/security/krb5/auto/KvnoNA.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/KvnoNA.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7197159
+ * @bug 7197159 8194486
+ * @summary accept different kvno if there no match
+ * @library /test/lib
  * @compile -XDignore.symbol.file KvnoNA.java
- * @run main/othervm KvnoNA
- * @summary accept different kvno if there no match
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts KvnoNA
  */
 
 import org.ietf.jgss.GSSException;
--- a/test/jdk/sun/security/krb5/auto/LifeTimeInSeconds.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/LifeTimeInSeconds.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,11 @@
 
 /*
  * @test
- * @bug 6857802
- * @run main/othervm LifeTimeInSeconds
+ * @bug 6857802 8194486
  * @summary GSS getRemainingInitLifetime method returns milliseconds not seconds
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts LifeTimeInSeconds
  */
 import org.ietf.jgss.GSSCredential;
 import org.ietf.jgss.GSSManager;
--- a/test/jdk/sun/security/krb5/auto/LoginModuleOptions.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/LoginModuleOptions.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,11 @@
 
 /*
  * @test
- * @bug 6765491
- * @run main/othervm LoginModuleOptions
+ * @bug 6765491 8194486
  * @summary Krb5LoginModule a little too restrictive, and the doc is not clear.
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts LoginModuleOptions
  */
 import com.sun.security.auth.module.Krb5LoginModule;
 import java.util.HashMap;
--- a/test/jdk/sun/security/krb5/auto/LoginNoPass.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/LoginNoPass.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8028351
+ * @bug 8028351 8194486
  * @summary JWS doesn't get authenticated when using kerberos auth proxy
+ * @library /test/lib
  * @compile -XDignore.symbol.file LoginNoPass.java
- * @run main/othervm LoginNoPass
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts LoginNoPass
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/LongLife.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/LongLife.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8131051
+ * @bug 8131051 8194486
  * @summary KDC might issue a renewable ticket even if not requested
+ * @library /test/lib
  * @compile -XDignore.symbol.file LongLife.java
- * @run main/othervm LongLife
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts LongLife
  */
 
 import sun.security.krb5.Config;
--- a/test/jdk/sun/security/krb5/auto/MSOID2.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/MSOID2.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8078439
+ * @bug 8078439 8194486
  * @summary SPNEGO auth fails if client proposes MS krb5 OID
+ * @library /test/lib
  * @compile -XDignore.symbol.file MSOID2.java
- * @run main/othervm MSOID2
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts MSOID2
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/ModuleName.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/ModuleName.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8164437
+ * @bug 8164437 8194486
  * @summary GSSContext type when jdk.security.jgss is not available
  * @library /test/lib
  * @compile -XDignore.symbol.file ModuleName.java
@@ -33,7 +33,8 @@
  *        jdk.test.lib.JDKToolLauncher
  *        jdk.test.lib.Platform
  *        jdk.test.lib.process.*
- * @run main/othervm ModuleName
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts ModuleName
  */
 
 import jdk.test.lib.process.ProcessTools;
@@ -58,6 +59,7 @@
                             arg.startsWith("--add-opens="))
                     .forEach(cmd::add);
             cmd.addAll(List.of(
+                    "-Djdk.net.hosts.file=TestHosts",
                     "-Dtest.src=" + System.getProperty("test.src"),
                     "--add-modules",
                         "java.base,java.security.jgss,jdk.security.auth",
--- a/test/jdk/sun/security/krb5/auto/MoreKvno.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/MoreKvno.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,11 @@
 
 /*
  * @test
- * @bug 6893158 6907425 7197159
- * @run main/othervm MoreKvno
+ * @bug 6893158 6907425 7197159 8194486
  * @summary AP_REQ check should use key version number
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts MoreKvno
  */
 
 import org.ietf.jgss.GSSException;
--- a/test/jdk/sun/security/krb5/auto/NewInquireTypes.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/NewInquireTypes.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8043071
+ * @bug 8043071 8194486
  * @summary Expose session key and KRB_CRED through extended GSS-API
+ * @library /test/lib
  * @compile -XDignore.symbol.file NewInquireTypes.java
- * @run main/othervm NewInquireTypes
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts NewInquireTypes
  */
 
 import com.sun.security.jgss.ExtendedGSSContext;
--- a/test/jdk/sun/security/krb5/auto/NewSalt.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/NewSalt.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 6960894
+ * @bug 6960894 8194486
  * @summary Better AS-REQ creation and processing
- * @run main/othervm NewSalt
- * @run main/othervm -Dnopreauth NewSalt
- * @run main/othervm -Donlyonepreauth NewSalt
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts NewSalt
+ * @run main/othervm -Dnopreauth -Djdk.net.hosts.file=TestHosts NewSalt
+ * @run main/othervm -Donlyonepreauth -Djdk.net.hosts.file=TestHosts NewSalt
  */
 
 import java.util.Locale;
--- a/test/jdk/sun/security/krb5/auto/NoInitNoKeytab.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/NoInitNoKeytab.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7089889
+ * @bug 7089889 8194486
  * @summary Krb5LoginModule.login() throws an exception if used without a keytab
+ * @library /test/lib
  * @compile -XDignore.symbol.file NoInitNoKeytab.java
- * @run main/othervm NoInitNoKeytab
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts NoInitNoKeytab
  */
 
 import java.io.FileOutputStream;
--- a/test/jdk/sun/security/krb5/auto/NonMutualSpnego.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/NonMutualSpnego.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,11 @@
 
 /*
  * @test
- * @bug 6733095
- * @run main/othervm NonMutualSpnego
+ * @bug 6733095 8194486
  * @summary Failure when SPNEGO request non-Mutual
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts NonMutualSpnego
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/NoneReplayCacheTest.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/NoneReplayCacheTest.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,14 @@
 
 /*
  * @test
- * @bug 8001326
- * @run main/othervm NoneReplayCacheTest
+ * @bug 8001326 8194486
  * @summary the replaycache type none cannot stop an authenticator replay,
  * but it can stop a message replay when s.s.k.acceptor.subkey is true.
  * You should not really use none in production environment. This test merely
  * shows there can be other protections when replay cache is not working fine.
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts NoneReplayCacheTest
  */
 
 import org.ietf.jgss.GSSException;
--- a/test/jdk/sun/security/krb5/auto/NullRenewUntil.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/NullRenewUntil.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,14 @@
 
 /*
  * @test
- * @bug 8186576
+ * @bug 8186576 8194486
  * @summary KerberosTicket does not properly handle renewable tickets
  *          at the end of their lifetime
  * @library /test/lib
  * @compile -XDignore.symbol.file NullRenewUntil.java
- * @run main/othervm -Dtest.set.null.renew NullRenewUntil
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dtest.set.null.renew NullRenewUntil
  */
 
 import jdk.test.lib.Asserts;
--- a/test/jdk/sun/security/krb5/auto/OkAsDelegate.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/OkAsDelegate.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,29 +23,49 @@
 
 /*
  * @test
- * @bug 6853328 7172701
- * @run main/othervm OkAsDelegate false true true false false false
+ * @bug 6853328 7172701 8194486
+ * @summary Support OK-AS-DELEGATE flag
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts OkAsDelegate
+ *      false true true false false false
  *      FORWARDABLE ticket not allowed, always fail
- * @run main/othervm OkAsDelegate true false false false false false
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts OkAsDelegate
+ *      true false false false false false
  *      Service ticket no OK-AS-DELEGATE. Request nothing, gain nothing
- * @run main/othervm OkAsDelegate true false true false false false
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts OkAsDelegate
+ *      true false true false false false
  *      Service ticket no OK-AS-DELEGATE. Request deleg policy, gain nothing
- * @run main/othervm OkAsDelegate true true false true false true
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts OkAsDelegate
+ *      true true false true false true
  *      Service ticket no OK-AS-DELEGATE. Request deleg, granted
- * @run main/othervm OkAsDelegate true true true true false true
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      OkAsDelegate true true true true false true
  *      Service ticket no OK-AS-DELEGATE. Request deleg and deleg policy, granted, with info not by policy
- * @run main/othervm -Dtest.kdc.policy.ok-as-delegate OkAsDelegate true false true true true true
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dtest.kdc.policy.ok-as-delegate OkAsDelegate
+ *      true false true true true true
  *      Service ticket has OK-AS-DELEGATE. Request deleg policy, granted
- * @run main/othervm -Dtest.kdc.policy.ok-as-delegate OkAsDelegate true true true true true true
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dtest.kdc.policy.ok-as-delegate OkAsDelegate
+ *      true true true true true true
  *      Service ticket has OK-AS-DELEGATE. granted, with info by policy
- * @run main/othervm -Dtest.spnego OkAsDelegate false true true false false false
- * @run main/othervm -Dtest.spnego OkAsDelegate true false false false false false
- * @run main/othervm -Dtest.spnego OkAsDelegate true false true false false false
- * @run main/othervm -Dtest.spnego OkAsDelegate true true false true false true
- * @run main/othervm -Dtest.spnego OkAsDelegate true true true true false true
- * @run main/othervm -Dtest.spnego -Dtest.kdc.policy.ok-as-delegate OkAsDelegate true false true true true true
- * @run main/othervm -Dtest.spnego -Dtest.kdc.policy.ok-as-delegate OkAsDelegate true true true true true true
- * @summary Support OK-AS-DELEGATE flag
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
+ *      OkAsDelegate false true true false false false
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
+ *      OkAsDelegate true false false false false false
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
+ *      OkAsDelegate true false true false false false
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
+ *      OkAsDelegate true true false true false true
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
+ *      OkAsDelegate true true true true false true
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
+ *      -Dtest.kdc.policy.ok-as-delegate OkAsDelegate
+ *      true false true true true true
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
+ *      -Dtest.kdc.policy.ok-as-delegate OkAsDelegate
+ *      true true true true true true
  */
 import com.sun.security.jgss.ExtendedGSSContext;
 import org.ietf.jgss.GSSContext;
--- a/test/jdk/sun/security/krb5/auto/OkAsDelegateXRealm.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/OkAsDelegateXRealm.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,16 +23,23 @@
 
 /*
  * @test
- * @bug 6853328 7172701
- * @run main/othervm OkAsDelegateXRealm false
+ * @bug 6853328 7172701 8194486
+ * @summary Support OK-AS-DELEGATE flag
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts OkAsDelegateXRealm false
  *      KDC no OK-AS-DELEGATE, fail
- * @run main/othervm -Dtest.kdc.policy.ok-as-delegate OkAsDelegateXRealm true
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dtest.kdc.policy.ok-as-delegate OkAsDelegateXRealm true
  *      KDC set OK-AS-DELEGATE for all, succeed
- * @run main/othervm -Dtest.kdc.policy.ok-as-delegate=host/host.r3.local OkAsDelegateXRealm false
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dtest.kdc.policy.ok-as-delegate=host/host.r3.local
+ *      OkAsDelegateXRealm false
  *      KDC set OK-AS-DELEGATE for host/host.r3.local only, fail
- * @run main/othervm -Dtest.kdc.policy.ok-as-delegate=host/host.r3.local,krbtgt/R2,krbtgt/R3 OkAsDelegateXRealm true
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dtest.kdc.policy.ok-as-delegate=host/host.r3.local,krbtgt/R2,krbtgt/R3
+ *      OkAsDelegateXRealm true
  *      KDC set OK-AS-DELEGATE for all three, succeed
- * @summary Support OK-AS-DELEGATE flag
  */
 import java.io.FileOutputStream;
 import java.io.IOException;
--- a/test/jdk/sun/security/krb5/auto/OnlyDesLogin.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/OnlyDesLogin.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,13 @@
 
 /*
  * @test
- * @bug 8014310
- * @summary JAAS/Krb5LoginModule using des encytypes failure with NPE after JDK-8012679
+ * @bug 8014310 8194486
+ * @summary JAAS/Krb5LoginModule using des encytypes failure with NPE
+ *          after JDK-8012679
+ * @library /test/lib
  * @compile -XDignore.symbol.file OnlyDesLogin.java
- * @run main/othervm OnlyDesLogin
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts OnlyDesLogin
  */
 
 import sun.security.krb5.Config;
--- a/test/jdk/sun/security/krb5/auto/PrincipalNameEquals.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/PrincipalNameEquals.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7061379
+ * @bug 7061379 8194486
  * @summary [Kerberos] Cross-realm authentication fails, due to nameType problem
+ * @library /test/lib
  * @compile -XDignore.symbol.file PrincipalNameEquals.java
- * @run main/othervm PrincipalNameEquals
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts PrincipalNameEquals
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/RRC.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/RRC.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7077640
+ * @bug 7077640 8194486
  * @summary gss wrap for cfx doesn't handle rrc != 0
+ * @library /test/lib
  * @compile -XDignore.symbol.file RRC.java
- * @run main/othervm RRC
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts RRC
  */
 
 import java.util.Arrays;
--- a/test/jdk/sun/security/krb5/auto/RefreshKrb5Config.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/RefreshKrb5Config.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,10 +31,12 @@
 
 /*
  * @test
- * @bug 4745056 8075297
+ * @bug 4745056 8075297 8194486
  * @summary Checks if refreshKrb5Config is set to true for Krb5LoginModule,
  *          then configuration will be refreshed before login() method is called
- * @run main/othervm RefreshKrb5Config
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts RefreshKrb5Config
  */
 public class RefreshKrb5Config {
 
--- a/test/jdk/sun/security/krb5/auto/Renew.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/Renew.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,13 +23,15 @@
 
 /*
  * @test
- * @bug 8058290
+ * @bug 8058290 8194486
  * @summary JAAS Krb5LoginModule has suspect ticket-renewal logic,
  *          relies on clockskew grace
+ * @library /test/lib
  * @compile -XDignore.symbol.file Renew.java
- * @run main/othervm Renew 1
- * @run main/othervm Renew 2
- * @run main/othervm Renew 3
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts Renew 1
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts Renew 2
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts Renew 3
  */
 
 import sun.security.krb5.Config;
--- a/test/jdk/sun/security/krb5/auto/Renewal.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/Renewal.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,13 @@
 
 /*
  * @test
- * @bug 8044500
+ * @bug 8044500 8194486
  * @summary Add kinit options and krb5.conf flags that allow users to
  *          obtain renewable tickets and specify ticket lifetimes
- * @library ../../../../java/security/testlibrary/
+ * @library ../../../../java/security/testlibrary/ /test/lib
  * @compile -XDignore.symbol.file Renewal.java
- * @run main/othervm Renewal
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts Renewal
  */
 
 import sun.security.krb5.Config;
--- a/test/jdk/sun/security/krb5/auto/ReplayCacheTest.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/ReplayCacheTest.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7118809 8001326
- * @run main/othervm ReplayCacheTest jvm
- * @run main/othervm ReplayCacheTest dfl
+ * @bug 7118809 8001326 8194486
  * @summary rcache deadlock
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts ReplayCacheTest jvm
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts ReplayCacheTest dfl
  */
 
 import java.io.File;
--- a/test/jdk/sun/security/krb5/auto/ReplayCacheTestProc.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/ReplayCacheTestProc.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 7152176 8168518 8172017
+ * @bug 7152176 8168518 8172017 8014628 8194486
  * @summary More krb5 tests
  * @library ../../../../java/security/testlibrary/ /test/lib
  * @build jdk.test.lib.Platform
- * @run main/othervm/timeout=300 ReplayCacheTestProc
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm/timeout=300 -Djdk.net.hosts.file=TestHosts
+ *      ReplayCacheTestProc
  */
 
 import java.io.*;
@@ -132,8 +134,13 @@
                 kdc.addPrincipalRandKey(service(i));
             }
 
+            // Native lib might not support aes-sha2
+            KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
+                    "default_tkt_enctypes = aes128-cts",
+                    "default_tgs_enctypes = aes128-cts");
+
+            // Write KTAB after krb5.conf so it contains no aes-sha2 keys
             kdc.writeKtab(OneKDC.KTAB);
-            KDC.saveConfig(OneKDC.KRB5_CONF, kdc);
 
             // User-provided libs
             String userLibs = System.getProperty("test.libs");
@@ -155,6 +162,7 @@
             }
 
             pi = Proc.create("ReplayCacheTestProc").debug("C")
+                    .inheritProp("jdk.net.hosts.file")
                     .args("initiator")
                     .start();
 
@@ -367,9 +375,11 @@
         }
         if (type.startsWith("J")) {
             if (lib == null) {
-                p = Proc.create("ReplayCacheTestProc");
+                p = Proc.create("ReplayCacheTestProc")
+                        .inheritProp("jdk.net.hosts.file");
             } else {
-                p = Proc.create("ReplayCacheTestProc", lib);
+                p = Proc.create("ReplayCacheTestProc", lib)
+                        .inheritProp("jdk.net.hosts.file");
             }
             p.prop("sun.security.krb5.rcache", "dfl")
                     .prop("java.io.tmpdir", cwd);
@@ -382,6 +392,7 @@
                     .env("KRB5_CONFIG", OneKDC.KRB5_CONF)
                     .env("KRB5_KTNAME", OneKDC.KTAB)
                     .env("KRB5RCACHEDIR", cwd)
+                    .inheritProp("jdk.net.hosts.file")
                     .prop("sun.security.jgss.native", "true")
                     .prop("javax.security.auth.useSubjectCredsOnly", "false")
                     .prop("sun.security.nativegss.debug", "true");
--- a/test/jdk/sun/security/krb5/auto/S4U2proxy.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/S4U2proxy.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 6355584 8044215
+ * @bug 6355584 8044215 8194486
  * @summary Introduce constrained Kerberos delegation
+ * @library /test/lib
  * @compile -XDignore.symbol.file S4U2proxy.java
- * @run main/othervm S4U2proxy krb5
- * @run main/othervm S4U2proxy spnego
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts S4U2proxy krb5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts S4U2proxy spnego
  */
 
 import java.util.Arrays;
--- a/test/jdk/sun/security/krb5/auto/S4U2proxyGSS.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/S4U2proxyGSS.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,15 @@
 
 /*
  * @test
- * @bug 6355584
+ * @bug 6355584 8194486
  * @summary Introduce constrained Kerberos delegation
+ * @library /test/lib
  * @compile -XDignore.symbol.file S4U2proxyGSS.java
- * @run main/othervm -Djavax.security.auth.useSubjectCredsOnly=false S4U2proxyGSS krb5
- * @run main/othervm -Djavax.security.auth.useSubjectCredsOnly=false S4U2proxyGSS spnego
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Djavax.security.auth.useSubjectCredsOnly=false S4U2proxyGSS krb5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Djavax.security.auth.useSubjectCredsOnly=false S4U2proxyGSS spnego
  */
 
 import java.io.File;
--- a/test/jdk/sun/security/krb5/auto/S4U2self.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/S4U2self.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,16 +23,25 @@
 
 /*
  * @test
- * @bug 6355584
+ * @bug 6355584 8194486
  * @summary Introduce constrained Kerberos delegation
+ * @library /test/lib
  * @compile -XDignore.symbol.file S4U2self.java
- * @run main/othervm -Dsun.security.krb5.debug=false S4U2self krb5 0
- * @run main/othervm/fail -Dsun.security.krb5.debug=false S4U2self krb5 1
- * @run main/othervm/fail -Dsun.security.krb5.debug=false S4U2self krb5 2
- * @run main/othervm/fail -Dsun.security.krb5.debug=false S4U2self krb5 3
- * @run main/othervm/fail -Dsun.security.krb5.debug=false S4U2self krb5 4
- * @run main/othervm/fail -Dsun.security.krb5.debug=false S4U2self krb5 5
- * @run main/othervm -Dsun.security.krb5.debug=false S4U2self spnego
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dsun.security.krb5.debug=false S4U2self krb5 0
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts
+ *      -Dsun.security.krb5.debug=false S4U2self krb5 1
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts
+ *      -Dsun.security.krb5.debug=false S4U2self krb5 2
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts
+ *      -Dsun.security.krb5.debug=false S4U2self krb5 3
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts
+ *      -Dsun.security.krb5.debug=false S4U2self krb5 4
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts
+ *      -Dsun.security.krb5.debug=false S4U2self krb5 5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dsun.security.krb5.debug=false S4U2self spnego
  */
 
 import java.util.Arrays;
--- a/test/jdk/sun/security/krb5/auto/S4U2selfAsServer.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/S4U2selfAsServer.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 6355584
+ * @bug 6355584 8194486
  * @summary Introduce constrained Kerberos delegation
+ * @library /test/lib
  * @compile -XDignore.symbol.file S4U2selfAsServer.java
- * @run main/othervm S4U2selfAsServer krb5
- * @run main/othervm S4U2selfAsServer spnego
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts S4U2selfAsServer krb5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts S4U2selfAsServer spnego
  */
 
 import java.util.Arrays;
--- a/test/jdk/sun/security/krb5/auto/S4U2selfAsServerGSS.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/S4U2selfAsServerGSS.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,17 @@
 
 /*
  * @test
- * @bug 6355584
+ * @bug 6355584 8194486
  * @summary Introduce constrained Kerberos delegation
+ * @library /test/lib
  * @compile -XDignore.symbol.file S4U2selfAsServerGSS.java
- * @run main/othervm -Djavax.security.auth.useSubjectCredsOnly=false S4U2selfAsServerGSS krb5
- * @run main/othervm -Djavax.security.auth.useSubjectCredsOnly=false S4U2selfAsServerGSS spnego
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Djavax.security.auth.useSubjectCredsOnly=false
+ *      S4U2selfAsServerGSS krb5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Djavax.security.auth.useSubjectCredsOnly=false
+ *      S4U2selfAsServerGSS spnego
  */
 
 import java.io.File;
--- a/test/jdk/sun/security/krb5/auto/S4U2selfGSS.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/S4U2selfGSS.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,15 @@
 
 /*
  * @test
- * @bug 6355584
+ * @bug 6355584 8194486
  * @summary Introduce constrained Kerberos delegation
+ * @library /test/lib
  * @compile -XDignore.symbol.file S4U2selfGSS.java
- * @run main/othervm -Dsun.security.krb5.debug=false S4U2selfGSS krb5
- * @run main/othervm -Dsun.security.krb5.debug=false S4U2selfGSS spnego
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dsun.security.krb5.debug=false S4U2selfGSS krb5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts
+ *      -Dsun.security.krb5.debug=false S4U2selfGSS spnego
  */
 
 import java.util.Arrays;
--- a/test/jdk/sun/security/krb5/auto/SPNEGO.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/SPNEGO.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7040151
+ * @bug 7040151 8194486
  * @summary SPNEGO GSS code does not parse tokens in accordance to RFC 2478
+ * @library /test/lib
  * @compile -XDignore.symbol.file SPNEGO.java
- * @run main/othervm SPNEGO
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SPNEGO
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/SSL.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/SSL.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,19 +23,32 @@
 
 /*
  * @test
- * @bug 6894643 6913636 8005523 8025123
+ * @bug 6894643 6913636 8005523 8025123 8194486
  * @summary Test JSSE Kerberos ciphersuite
- * @run main/othervm SSL TLS_KRB5_WITH_RC4_128_SHA
- * @run main/othervm SSL TLS_KRB5_WITH_RC4_128_SHA unbound
- * @run main/othervm SSL TLS_KRB5_WITH_RC4_128_SHA unbound sni
- * @run main/othervm SSL TLS_KRB5_WITH_3DES_EDE_CBC_SHA
- * @run main/othervm SSL TLS_KRB5_WITH_3DES_EDE_CBC_MD5
- * @run main/othervm SSL TLS_KRB5_WITH_DES_CBC_SHA
- * @run main/othervm SSL TLS_KRB5_WITH_DES_CBC_MD5
- * @run main/othervm SSL TLS_KRB5_EXPORT_WITH_RC4_40_SHA
- * @run main/othervm SSL TLS_KRB5_EXPORT_WITH_RC4_40_MD5
- * @run main/othervm SSL TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA
- * @run main/othervm SSL TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_WITH_RC4_128_SHA
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_WITH_RC4_128_SHA unbound
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_WITH_RC4_128_SHA unbound sni
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_WITH_3DES_EDE_CBC_SHA
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_WITH_3DES_EDE_CBC_MD5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_WITH_DES_CBC_SHA
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_WITH_DES_CBC_MD5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_EXPORT_WITH_RC4_40_SHA
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_EXPORT_WITH_RC4_40_MD5
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL
+ *      TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5
  */
 import java.io.*;
 import java.security.Permission;
--- a/test/jdk/sun/security/krb5/auto/SSLwithPerms.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/SSLwithPerms.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,11 @@
 
 /*
  * @test
- * @bug 8038089
+ * @bug 8038089 8194486
  * @summary TLS optional support for Kerberos cipher suites needs to be re-examined
- * @library ../../../../java/security/testlibrary/
- * @run main/othervm SSLwithPerms
+ * @library ../../../../java/security/testlibrary/ /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SSLwithPerms
  */
 import java.io.*;
 import javax.net.ssl.*;
--- a/test/jdk/sun/security/krb5/auto/SaslBasic.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/SaslBasic.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,14 @@
 
 /*
  * @test
- * @bug 7110803 8170732
+ * @bug 7110803 8170732 8194486
  * @summary SASL service for multiple hostnames
+ * @library /test/lib
  * @compile -XDignore.symbol.file SaslBasic.java
- * @run main/othervm SaslBasic bound auth-int
- * @run main/othervm SaslBasic unbound auth-conf
- * @run main/othervm SaslBasic bound auth
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SaslBasic bound auth-int
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SaslBasic unbound auth-conf
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SaslBasic bound auth
  */
 import java.io.IOException;
 import java.util.Arrays;
--- a/test/jdk/sun/security/krb5/auto/SaslGSS.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/SaslGSS.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 8012082 8019267
+ * @bug 8012082 8019267 8194486
  * @summary SASL: auth-conf negotiated, but unencrypted data is accepted,
   *         reset to unencrypt
+ * @library /test/lib
  * @compile -XDignore.symbol.file SaslGSS.java
- * @run main/othervm SaslGSS
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SaslGSS
  */
 
 import javax.security.auth.callback.Callback;
--- a/test/jdk/sun/security/krb5/auto/SaslUnbound.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/SaslUnbound.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,14 +23,16 @@
 
 /*
  * @test
- * @bug 8001104
+ * @bug 8001104 8194486
  * @summary Unbound SASL service: the GSSAPI/krb5 mech
+ * @library /test/lib
  * @compile -XDignore.symbol.file SaslUnbound.java
- * @run main/othervm SaslUnbound 0
- * @run main/othervm/fail SaslUnbound 1
- * @run main/othervm/fail SaslUnbound 2
- * @run main/othervm/fail SaslUnbound 3
- * @run main/othervm/fail SaslUnbound 4
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SaslUnbound 0
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts SaslUnbound 1
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts SaslUnbound 2
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts SaslUnbound 3
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts SaslUnbound 4
  */
 import java.io.IOException;
 import java.util.Arrays;
--- a/test/jdk/sun/security/krb5/auto/SpnegoLifeTime.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/SpnegoLifeTime.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 8000653
+ * @bug 8000653 8194486
  * @summary SPNEGO tests fail at context.getDelegCred().getRemainingInitLifetime(mechOid)
+ * @library /test/lib
  * @compile -XDignore.symbol.file SpnegoLifeTime.java
- * @run main/othervm SpnegoLifeTime
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SpnegoLifeTime
  */
 
 import org.ietf.jgss.Oid;
--- a/test/jdk/sun/security/krb5/auto/SpnegoReqFlags.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/SpnegoReqFlags.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,11 @@
 
 /*
  * @test
- * @bug 6815182
- * @run main/othervm SpnegoReqFlags
+ * @bug 6815182 8194486
  * @summary GSSAPI/SPNEGO does not work with server using MIT Kerberos library
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts SpnegoReqFlags
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/Test5653.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/Test5653.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,11 @@
 
 /*
  * @test
- * @bug 6895424
- * @run main/othervm Test5653
+ * @bug 6895424 8194486
  * @summary RFC 5653
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts Test5653
  */
 
 import org.ietf.jgss.GSSContext;
--- a/test/jdk/sun/security/krb5/auto/TicketSName.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/TicketSName.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,13 @@
 
 /*
  * @test
- * @bug 8178794
+ * @bug 8178794 8194486
  * @summary krb5 client should ignore sname in incoming tickets
+ * @library /test/lib
  * @compile -XDignore.symbol.file TicketSName.java
- * @run main/othervm -Dtest.kdc.diff.sname TicketSName
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.kdc.diff.sname
+ *      TicketSName
  */
 
 import sun.security.jgss.GSSUtil;
--- a/test/jdk/sun/security/krb5/auto/TwoOrThree.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/TwoOrThree.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,14 +23,16 @@
 
 /*
  * @test
- * @bug 8005447
+ * @bug 8005447 8194486
  * @summary default principal can act as anyone
+ * @library /test/lib
  * @compile -XDignore.symbol.file TwoOrThree.java
- * @run main/othervm TwoOrThree first first
- * @run main/othervm/fail TwoOrThree first second
- * @run main/othervm TwoOrThree - first
- * @run main/othervm TwoOrThree - second
- * @run main/othervm/fail TwoOrThree - third
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts TwoOrThree first first
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts TwoOrThree first second
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts TwoOrThree - first
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts TwoOrThree - second
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts TwoOrThree - third
  */
 
 import java.nio.file.Files;
--- a/test/jdk/sun/security/krb5/auto/TwoPrinces.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/TwoPrinces.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 6894072
+ * @bug 6894072 8194486
+ * @summary always refresh keytab
+ * @library /test/lib
  * @compile -XDignore.symbol.file TwoPrinces.java
- * @run main/othervm TwoPrinces
- * @summary always refresh keytab
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts TwoPrinces
  */
 
 import java.io.File;
--- a/test/jdk/sun/security/krb5/auto/TwoTab.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/TwoTab.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7152176
+ * @bug 7152176 8194486
  * @summary More krb5 tests
+ * @library /test/lib
  * @compile -XDignore.symbol.file TwoTab.java
- * @run main/othervm TwoTab
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts TwoTab
  */
 
 import java.io.File;
--- a/test/jdk/sun/security/krb5/auto/UnboundSSL.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/UnboundSSL.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,13 +31,15 @@
 
 /*
  * @test
- * @bug 8025123
+ * @bug 8025123 8194486
  * @summary Checks if an unbound server can handle connections
  *          only for allowed service principals
- * @run main/othervm/policy=unbound.ssl.policy UnboundSSL
- *                              unbound.ssl.jaas.conf server_star
- * @run main/othervm/policy=unbound.ssl.policy UnboundSSL
- *                              unbound.ssl.jaas.conf server_multiple_principals
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm/policy=unbound.ssl.policy -Djdk.net.hosts.file=TestHosts
+ *      UnboundSSL unbound.ssl.jaas.conf server_star
+ * @run main/othervm/policy=unbound.ssl.policy -Djdk.net.hosts.file=TestHosts
+ *      UnboundSSL unbound.ssl.jaas.conf server_multiple_principals
  */
 public class UnboundSSL {
 
--- a/test/jdk/sun/security/krb5/auto/UnboundSSLMultipleKeys.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/UnboundSSLMultipleKeys.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,11 +31,13 @@
 
 /*
  * @test
- * @bug 8025123
+ * @bug 8025123 8194486
  * @summary Checks if an unbound server pick up a correct key from keytab
- * @run main/othervm UnboundSSLMultipleKeys
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundSSLMultipleKeys
  *                              unbound.ssl.jaas.conf server_star
- * @run main/othervm UnboundSSLMultipleKeys
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundSSLMultipleKeys
  *                              unbound.ssl.jaas.conf server_multiple_principals
  */
 public class UnboundSSLMultipleKeys {
--- a/test/jdk/sun/security/krb5/auto/UnboundSSLPrincipalProperty.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/UnboundSSLPrincipalProperty.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,12 +30,14 @@
 
 /*
  * @test
- * @bug 8025123
+ * @bug 8025123 8194486
  * @summary Checks if an unbound server uses a service principal
  *          from sun.security.krb5.principal system property if specified
- * @run main/othervm UnboundSSLPrincipalProperty
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundSSLPrincipalProperty
  *                              unbound.ssl.jaas.conf server_star
- * @run main/othervm UnboundSSLPrincipalProperty
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundSSLPrincipalProperty
  *                              unbound.ssl.jaas.conf server_multiple_principals
  */
 public class UnboundSSLPrincipalProperty {
--- a/test/jdk/sun/security/krb5/auto/UnboundService.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/UnboundService.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,17 +23,26 @@
 
 /*
  * @test
- * @bug 8001104
+ * @bug 8001104 8194486
  * @summary Unbound SASL service: the GSSAPI/krb5 mech
+ * @library /test/lib
  * @compile -XDignore.symbol.file UnboundService.java
- * @run main/othervm UnboundService null null
- * @run main/othervm UnboundService server/host.rabbit.hole null
- * @run main/othervm UnboundService server/host.rabbit.hole@RABBIT.HOLE null
- * @run main/othervm/fail UnboundService backend/host.rabbit.hole null
- * @run main/othervm UnboundService null server@host.rabbit.hole
- * @run main/othervm UnboundService server/host.rabbit.hole server@host.rabbit.hole
- * @run main/othervm UnboundService server/host.rabbit.hole@RABBIT.HOLE server@host.rabbit.hole
- * @run main/othervm/fail UnboundService backend/host.rabbit.hole server@host.rabbit.hole
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundService null null
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundService
+ *      server/host.rabbit.hole null
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundService
+ *      server/host.rabbit.hole@RABBIT.HOLE null
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts UnboundService
+ *      backend/host.rabbit.hole null
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundService
+ *      null server@host.rabbit.hole
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundService
+ *      server/host.rabbit.hole server@host.rabbit.hole
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundService
+ *      server/host.rabbit.hole@RABBIT.HOLE server@host.rabbit.hole
+ * @run main/othervm/fail -Djdk.net.hosts.file=TestHosts UnboundService
+ *      backend/host.rabbit.hole server@host.rabbit.hole
  */
 
 import java.io.File;
--- a/test/jdk/sun/security/krb5/auto/Unreachable.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/Unreachable.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,12 @@
 
 /*
  * @test
- * @bug 7162687 8015595
+ * @bug 7162687 8015595 8194486
  * @summary enhance KDC server availability detection
+ * @library /test/lib
  * @compile -XDignore.symbol.file Unreachable.java
- * @run main/othervm Unreachable
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts Unreachable
  */
 import java.net.PortUnreachableException;
 import java.net.SocketTimeoutException;
--- a/test/jdk/sun/security/krb5/auto/UseCacheAndStoreKey.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/UseCacheAndStoreKey.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 7201053
+ * @bug 7201053 8194486
  * @summary Krb5LoginModule shows NPE when both useTicketCache and storeKey
  *          are set to true
+ * @library /test/lib
  * @compile -XDignore.symbol.file UseCacheAndStoreKey.java
- * @run main/othervm UseCacheAndStoreKey
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -Djdk.net.hosts.file=TestHosts UseCacheAndStoreKey
  */
 
 import java.io.FileOutputStream;
--- a/test/jdk/sun/security/krb5/auto/W83.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/W83.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,13 @@
 
 /*
  * @test
- * @bug 6932525 6951366 6959292
+ * @bug 6932525 6951366 6959292 8194486
  * @summary kerberos login failure on win2008 with AD set to win2000 compat mode
  * and cannot login if session key and preauth does not use the same etype
- * @run main/othervm -D6932525 W83
- * @run main/othervm -D6959292 W83
+ * @library /test/lib
+ * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+ * @run main/othervm -D6932525 -Djdk.net.hosts.file=TestHosts W83
+ * @run main/othervm -D6959292 -Djdk.net.hosts.file=TestHosts W83
  */
 import com.sun.security.auth.module.Krb5LoginModule;
 import java.io.File;
--- a/test/jdk/sun/security/krb5/auto/principalProperty/TestHosts	Tue Jan 30 11:53:00 2018 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-127.0.0.1 localhost
--- a/test/jdk/sun/security/krb5/auto/rcache_usemd5.sh	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/auto/rcache_usemd5.sh	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -22,11 +22,13 @@
 #
 
 # @test
-# @bug 8168518
-# @library ../../../../java/security/testlibrary/ /test/lib
-# @build jdk.test.lib.Platform
-# @run main/othervm/timeout=300 -Djdk.krb5.rcache.useMD5=true
-#           -Dtest.service=host ReplayCacheTestProc
+# @bug 8168518 8194486
 # @summary  testing jdk.krb5.rcache.useMD5. This action is put in a separate
 #           test so that ReplayCacheTestProc.java can be launched with special
 #           test.* system properties easily.
+# @library ../../../../java/security/testlibrary/ /test/lib
+# @build jdk.test.lib.Platform
+# @run main jdk.test.lib.FileInstaller TestHosts TestHosts
+# @run main/othervm/timeout=300 -Djdk.krb5.rcache.useMD5=true
+#           -Djdk.net.hosts.file=TestHosts
+#           -Dtest.service=host ReplayCacheTestProc
--- a/test/jdk/sun/security/krb5/config/Include.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/config/Include.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8029994 8177085
+ * @bug 8029994 8177085 8177398
  * @summary Support "include" and "includedir" in krb5.conf
  * @modules java.security.jgss/sun.security.krb5
  * @compile -XDignore.symbol.file Include.java
@@ -53,6 +53,7 @@
         Path df2 = Paths.get("d/f2");       // another file
         Path df3 = Paths.get("d/f.3");      // third file bad name
         Path df4 = Paths.get("d/f4.conf");  // fourth file
+        Path df5 = Paths.get("d/.f5.conf"); // fifth file is dotfile
 
         // OK: The base file can be missing
         System.setProperty("java.security.krb5.conf", "no-such-file");
@@ -103,6 +104,8 @@
         Files.write(ddf, (krb5Conf + "ddf").getBytes());
         // fx4 will be loaded
         Files.write(df4, (krb5Conf + "df4").getBytes());
+        // fx5 will be excluded
+        Files.write(df5, (krb5Conf + "df5").getBytes());
 
         // OK: All good files read
         tryReload(true);
--- a/test/jdk/sun/security/krb5/etype/ETypeOrder.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/krb5/etype/ETypeOrder.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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 @@
         int[] etypes = EType.getBuiltInDefaults();
 
         // Reference order, note that 2 is not implemented in Java
-        int correct[] = { 18, 17, 16, 23, 1, 3, 2 };
+        int correct[] = { 18, 17, 20, 19, 16, 23, 1, 3, 2 };
 
         int match = 0;
         loopi: for (int i=0; i<etypes.length; i++) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sun/security/krb5/etype/KerberosAesSha2.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,209 @@
+/*
+ * 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 8014628
+ * @modules java.base/sun.security.util
+ *          java.security.jgss/sun.security.krb5.internal.crypto.dk:+open
+ * @summary https://tools.ietf.org/html/rfc8009 Test Vectors
+ */
+
+import javax.crypto.Cipher;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+
+import sun.security.krb5.internal.crypto.dk.AesSha2DkCrypto;
+import sun.security.util.HexDumpEncoder;
+
+public class KerberosAesSha2 {
+
+    public static void main(String[] args) throws Exception {
+
+        AesSha2DkCrypto dk128 = new AesSha2DkCrypto(128);
+        AesSha2DkCrypto dk256 = new AesSha2DkCrypto(256);
+
+        boolean aes256ok = Cipher.getMaxAllowedKeyLength("AES") >= 256;
+
+        // Sample results for string-to-key conversion:
+        char[] pass = "password".toCharArray();
+        byte[] salt = cat(
+                hex("10 DF 9D D7 83 E5 BC 8A CE A1 73 0E 74 35 5F 61"),
+                "ATHENA.MIT.EDUraeburn".getBytes());
+
+        check(stringToKey(dk128, pass, salt, null),
+                hex("08 9B CA 48 B1 05 EA 6E A7 7C A5 D2 F3 9D C5 E7"));
+
+        check(stringToKey(dk256, pass, salt, null),
+                hex("45 BD 80 6D BF 6A 83 3A 9C FF C1 C9 45 89 A2 22\n" +
+                    "36 7A 79 BC 21 C4 13 71 89 06 E9 F5 78 A7 84 67"));
+
+        // Sample results for key derivation:
+        byte[] bk16 = hex("37 05 D9 60 80 C1 77 28 A0 E8 00 EA B6 E0 D2 3C");
+
+        check(deriveKey(dk128, bk16, 2, (byte) 0x99),
+                hex("B3 1A 01 8A 48 F5 47 76 F4 03 E9 A3 96 32 5D C3"));
+        check(deriveKey(dk128, bk16, 2, (byte) 0xaa),
+                hex("9B 19 7D D1 E8 C5 60 9D 6E 67 C3 E3 7C 62 C7 2E"));
+        check(deriveKey(dk128, bk16, 2, (byte) 0x55),
+                hex("9F DA 0E 56 AB 2D 85 E1 56 9A 68 86 96 C2 6A 6C"));
+
+        byte[] bk32 = hex(
+                "6D 40 4D 37 FA F7 9F 9D F0 D3 35 68 D3 20 66 98\n" +
+                "00 EB 48 36 47 2E A8 A0 26 D1 6B 71 82 46 0C 52");
+
+        check(deriveKey(dk256, bk32, 2, (byte) 0x99), hex(
+                "EF 57 18 BE 86 CC 84 96 3D 8B BB 50 31 E9 F5 C4\n" +
+                "BA 41 F2 8F AF 69 E7 3D"));
+        check(deriveKey(dk256, bk32, 2, (byte) 0xaa), hex(
+                "56 AB 22 BE E6 3D 82 D7 BC 52 27 F6 77 3F 8E A7\n" +
+                "A5 EB 1C 82 51 60 C3 83 12 98 0C 44 2E 5C 7E 49"));
+        check(deriveKey(dk256, bk32, 2, (byte) 0x55), hex(
+                "69 B1 65 14 E3 CD 8E 56 B8 20 10 D5 C7 30 12 B6\n" +
+                "22 C4 D0 0F FC 23 ED 1F"));
+
+        // Sample encryptions (all using the default cipher state):
+
+        check(enc(dk128, hex("7E 58 95 EA F2 67 24 35 BA D8 17 F5 45 A3 71 48"),
+                    bk16, hex("")),
+                hex("EF 85 FB 89 0B B8 47 2F 4D AB 20 39 4D CA 78 1D\n" +
+                    "AD 87 7E DA 39 D5 0C 87 0C 0D 5A 0A 8E 48 C7 18"));
+
+        check(enc(dk128, hex("7B CA 28 5E 2F D4 13 0F B5 5B 1A 5C 83 BC 5B 24"),
+                    bk16, hex("00 01 02 03 04 05")),
+                hex("84 D7 F3 07 54 ED 98 7B AB 0B F3 50 6B EB 09 CF\n" +
+                    "B5 54 02 CE F7 E6 87 7C E9 9E 24 7E 52 D1 6E D4\n" +
+                    "42 1D FD F8 97 6C"));
+
+        check(enc(dk128, hex("56 AB 21 71 3F F6 2C 0A 14 57 20 0F 6F A9 94 8F"),
+                    bk16, hex("00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F")),
+                hex("35 17 D6 40 F5 0D DC 8A D3 62 87 22 B3 56 9D 2A\n" +
+                    "E0 74 93 FA 82 63 25 40 80 EA 65 C1 00 8E 8F C2\n" +
+                    "95 FB 48 52 E7 D8 3E 1E 7C 48 C3 7E EB E6 B0 D3"));
+
+        check(enc(dk128, hex("A7 A4 E2 9A 47 28 CE 10 66 4F B6 4E 49 AD 3F AC"),
+                    bk16, hex("00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n" +
+                              "10 11 12 13 14")),
+                hex("72 0F 73 B1 8D 98 59 CD 6C CB 43 46 11 5C D3 36\n" +
+                    "C7 0F 58 ED C0 C4 43 7C 55 73 54 4C 31 C8 13 BC\n" +
+                    "E1 E6 D0 72 C1 86 B3 9A 41 3C 2F 92 CA 9B 83 34\n" +
+                    "A2 87 FF CB FC\n"));
+
+        if (aes256ok) {
+            check(enc(dk256, hex("F7 64 E9 FA 15 C2 76 47 8B 2C 7D 0C 4E 5F 58 E4"),
+                        bk32, hex("")),
+                    hex("41 F5 3F A5 BF E7 02 6D 91 FA F9 BE 95 91 95 A0\n" +
+                        "58 70 72 73 A9 6A 40 F0 A0 19 60 62 1A C6 12 74\n" +
+                        "8B 9B BF BE 7E B4 CE 3C\n"));
+
+            check(enc(dk256, hex("B8 0D 32 51 C1 F6 47 14 94 25 6F FE 71 2D 0B 9A"),
+                        bk32, hex("00 01 02 03 04 05")),
+                    hex("4E D7 B3 7C 2B CA C8 F7 4F 23 C1 CF 07 E6 2B C7\n" +
+                        "B7 5F B3 F6 37 B9 F5 59 C7 F6 64 F6 9E AB 7B 60\n" +
+                        "92 23 75 26 EA 0D 1F 61 CB 20 D6 9D 10 F2\n"));
+
+            check(enc(dk256, hex("53 BF 8A 0D 10 52 65 D4 E2 76 42 86 24 CE 5E 63"),
+                        bk32, hex("00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F")),
+                    hex("BC 47 FF EC 79 98 EB 91 E8 11 5C F8 D1 9D AC 4B\n" +
+                        "BB E2 E1 63 E8 7D D3 7F 49 BE CA 92 02 77 64 F6\n" +
+                        "8C F5 1F 14 D7 98 C2 27 3F 35 DF 57 4D 1F 93 2E\n" +
+                        "40 C4 FF 25 5B 36 A2 66\n"));
+
+            check(enc(dk256, hex("76 3E 65 36 7E 86 4F 02 F5 51 53 C7 E3 B5 8A F1"),
+                        bk32, hex("00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n" +
+                                  "10 11 12 13 14")),
+                    hex("40 01 3E 2D F5 8E 87 51 95 7D 28 78 BC D2 D6 FE\n" +
+                        "10 1C CF D5 56 CB 1E AE 79 DB 3C 3E E8 64 29 F2\n" +
+                        "B2 A6 02 AC 86 FE F6 EC B6 47 D6 29 5F AE 07 7A\n" +
+                        "1F EB 51 75 08 D2 C1 6B 41 92 E0 1F 62\n"));
+        }
+
+        // Sample checksums:
+
+        byte[] msg = hex(
+                "00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n" +
+                "10 11 12 13 14");
+
+        check(checksum(dk128, bk16, msg), hex(
+                "D7 83 67 18 66 43 D6 7B 41 1C BA 91 39 FC 1D EE"));
+
+        check(checksum(dk256, bk32, msg), hex(
+                "45 EE 79 15 67 EE FC A3 7F 4A C1 E0 22 2D E8 0D\n" +
+                "43 C3 BF A0 66 99 67 2A"));
+
+        // Sample pseudorandom function (PRF) invocations:
+        // Java does not support PRF. Skipped.
+    }
+
+    private static byte[] stringToKey(AesSha2DkCrypto dk,
+            char[] pass, byte[] salt, byte[] params) throws Exception {
+        Method m = AesSha2DkCrypto.class.getDeclaredMethod("stringToKey",
+                char[].class, byte[].class, byte[].class);
+        m.setAccessible(true);
+        return (byte[])m.invoke(dk, pass, salt, params);
+    }
+
+    private static byte[] deriveKey(AesSha2DkCrypto dk, byte[] baseKey,
+            int usage, byte type) throws Exception {
+        Method m = AesSha2DkCrypto.class.getDeclaredMethod("deriveKey",
+                byte[].class, int.class, byte.class);
+        m.setAccessible(true);
+        return (byte[]) m.invoke(dk, baseKey, usage, type);
+    }
+
+    private static byte[] cat(byte[] b1, byte[] b2) {
+        byte[] result = Arrays.copyOf(b1, b1.length + b2.length);
+        System.arraycopy(b2, 0, result, b1.length, b2.length);
+        return result;
+    }
+
+    private static byte[] enc(AesSha2DkCrypto dk, byte[] confounder,
+            byte[] bk, byte[] text) throws Exception {
+        return dk.encryptRaw(bk, 2, new byte[16], cat(confounder, text),
+                0, confounder.length + text.length);
+    }
+
+    private static byte[] checksum(AesSha2DkCrypto dk, byte[] baseKey, byte[] text)
+            throws Exception {
+        return dk.calculateChecksum(baseKey, 2, text, 0, text.length);
+    }
+
+    private static byte[] hex(String var) {
+        var = var.replaceAll("\\s", "");
+        byte[] data = new byte[var.length()/2];
+        for (int i=0; i<data.length; i++) {
+            data[i] = Integer.valueOf(var.substring(2*i,2*i+2), 16).byteValue();
+        }
+        return data;
+    }
+
+    private static void check(byte[] b1, byte[] b2) throws Exception {
+        if (!Arrays.equals(b1, b2)) {
+            dump(b1); dump(b2);
+            throw new Exception("Failure");
+        }
+    }
+
+    private static void dump(byte[] data) throws Exception {
+        new HexDumpEncoder().encodeBuffer(data, System.err);
+    }
+}
--- a/test/jdk/sun/security/pkcs11/PKCS11Test.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/sun/security/pkcs11/PKCS11Test.java	Tue Jan 30 09:03:47 2018 -0800
@@ -31,6 +31,7 @@
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.StringReader;
+import java.nio.charset.StandardCharsets;
 import java.security.AlgorithmParameters;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.KeyPairGenerator;
@@ -387,6 +388,11 @@
         getNSSInfo(nss_library);
     }
 
+    // Try to parse the version for the specified library.
+    // Assuming the library contains either of the following patterns:
+    // $Header: NSS <version>
+    // Version: NSS <version>
+    // Here, <version> stands for NSS version.
     static double getNSSInfo(String library) {
         // look for two types of headers in NSS libraries
         String nssHeader1 = "$Header: NSS";
@@ -417,7 +423,7 @@
                         read = 100 + is.read(data, 100, 900);
                     }
 
-                    s = new String(data, 0, read);
+                    s = new String(data, 0, read, StandardCharsets.US_ASCII);
                     i = s.indexOf(nssHeader1);
                     if (i > 0 || (i = s.indexOf(nssHeader2)) > 0) {
                         found = true;
@@ -443,18 +449,13 @@
 
         // the index after whitespace after nssHeader
         int afterheader = s.indexOf("NSS", i) + 4;
-        int nextSpaceIndex = s.indexOf(' ', afterheader);
-
-        // If the next space is not found,
-        // it has to print the content for further investigation.
-        if (nextSpaceIndex == -1) {
-            System.out.println("===== Content start =====");
-            System.out.println(s);
-            System.out.println("===== Content end =====");
+        String version = String.valueOf(s.charAt(afterheader));
+        for (char c = s.charAt(++afterheader);
+                c == '.' || (c >= '0' && c <= '9');
+                c = s.charAt(++afterheader)) {
+            version += c;
         }
 
-        String version = s.substring(afterheader, nextSpaceIndex);
-
         // If a "dot dot" release, strip the extra dots for double parsing
         String[] dot = version.split("\\.");
         if (dot.length > 2) {
@@ -468,6 +469,9 @@
         try {
             nss_version = Double.parseDouble(version);
         } catch (NumberFormatException e) {
+            System.out.println("===== Content start =====");
+            System.out.println(s);
+            System.out.println("===== Content end =====");
             System.out.println("Failed to parse lib" + library +
                     " version. Set to 0.0");
             e.printStackTrace();
--- a/test/jdk/tools/jlink/DefaultProviderTest.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/tools/jlink/DefaultProviderTest.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,7 @@
  * @test
  * @summary Test plugins enabled by default
  * @author Jean-Francois Denise
+ * @requires vm.compMode != "Xcomp"
  * @library ../lib
  * @modules java.base/jdk.internal.jimage
  *          jdk.jdeps/com.sun.tools.classfile
--- a/test/jdk/tools/jlink/JLinkPluginsTest.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/tools/jlink/JLinkPluginsTest.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
  * @test
  * @summary Test image creation
  * @author Jean-Francois Denise
+ * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g)
  * @library ../lib
  * @modules java.base/jdk.internal.jimage
  *          jdk.jdeps/com.sun.tools.classfile
--- a/test/jdk/tools/jlink/JLinkTest.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/tools/jlink/JLinkTest.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,6 +44,7 @@
  * @summary Test image creation
  * @bug 8189777
  * @author Jean-Francois Denise
+ * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g)
  * @library ../lib
  * @modules java.base/jdk.internal.jimage
  *          jdk.jdeps/com.sun.tools.classfile
--- a/test/jdk/tools/jlink/JLinkToolProviderTest.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/tools/jlink/JLinkToolProviderTest.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 
 /*
  * @test
+ * @modules jdk.jlink
  * @build JLinkToolProviderTest
  * @run main/othervm/java.security.policy=toolprovider.policy JLinkToolProviderTest
  */
--- a/test/jdk/tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,10 @@
  * @library /test/lib
  * @modules java.base/jdk.internal.jimage
  *          java.base/jdk.internal.module
+ *          jdk.compiler
+ *          jdk.jartool
+ *          jdk.jlink
+ *          jdk.zipfs
  * @build jdk.test.lib.Utils
  *        jdk.test.lib.Asserts
  *        jdk.test.lib.JDKToolFinder
--- a/test/jdk/tools/jlink/plugins/IncludeLocalesPluginTest.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/tools/jlink/plugins/IncludeLocalesPluginTest.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@
  * @bug 8152143 8152704 8155649 8165804 8185841 8176841 8190918
  * @summary IncludeLocalesPlugin tests
  * @author Naoto Sato
+ * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g)
  * @library ../../lib
  * @modules java.base/jdk.internal.jimage
  *          jdk.jdeps/com.sun.tools.classfile
--- a/test/jdk/tools/launcher/HelpFlagsTest.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/tools/launcher/HelpFlagsTest.java	Tue Jan 30 09:03:47 2018 -0800
@@ -73,7 +73,13 @@
         // mentioned in the help text.
         "kinit",
         "klist",
-        "ktab"
+        "ktab",
+        // Oracle proprietary tools without help message.
+        "javacpl",
+        "jmc",
+        "jweblauncher",
+        "jcontrol",
+        "ssvagent"
     };
 
     // Lists which tools support which flags.
@@ -113,12 +119,7 @@
         // that way.
         int exitcodeOfWrongFlag;
 
-        // Some tools accept the invalid argument and thus hang the test.
-        // Don't execute these with the wrong flags.
-        // This actually should be considered a bug in the corresponding tool.
-        boolean dontExecuteWithWrongFlags;
-
-        ToolHelpSpec(String n, int q, int h, int hp, int ex1, int l, int dl, int ex2, int hangs) {
+        ToolHelpSpec(String n, int q, int h, int hp, int ex1, int l, int dl, int ex2) {
             toolname = n;
             supportsQuestionMark = ( q  == 1 ? true : false );
             supportsH            = ( h  == 1 ? true : false );
@@ -128,48 +129,48 @@
             supportsLegacyHelp   = (  l == 1 ? true : false );
             documentsLegacyHelp  = ( dl == 1 ? true : false );
             exitcodeOfWrongFlag  = ex2;
-
-            dontExecuteWithWrongFlags = ( hangs == 1 ? true : false );
         }
     }
 
     static ToolHelpSpec[] jdkTools = {
-        //               name          -?   -h --help exitcode   -help -help  exitcode  Don't
-        //                                            of help          docu   of wrong  test
-        //                                                             mented flag      inv flag
-        new ToolHelpSpec("jabswitch",   0,   0,   0,   0,         0,    0,     0,       0),   // /?, prints help message anyways, win only
-        new ToolHelpSpec("jaotc",       1,   1,   1,   0,         0,    0,     2,       0),   // -?, -h, --help
-        new ToolHelpSpec("jar",         1,   1,   1,   0,         0,    0,     1,       0),   // -?, -h, --help
-        new ToolHelpSpec("jarsigner",   1,   1,   1,   0,         1,    0,     1,       0),   // -?, -h, --help, -help accepted but not documented.
-        new ToolHelpSpec("java",        1,   1,   1,   0,         1,    1,     1,       0),   // -?, -h, --help -help, Documents -help
-        new ToolHelpSpec("javac",       1,   0,   1,   0,         1,    1,     2,       0),   // -?,     --help -help, Documents -help, -h is already taken for "native header output directory".
-        new ToolHelpSpec("javadoc",     1,   1,   1,   0,         1,    1,     1,       0),   // -?, -h, --help -help, Documents -help
-        new ToolHelpSpec("javap",       1,   1,   1,   0,         1,    1,     2,       0),   // -?, -h, --help, -help accepted but not documented.
-        new ToolHelpSpec("javaw",       1,   1,   1,   0,         1,    1,     1,       0),   // -?, -h, --help -help, win only
-        new ToolHelpSpec("jcmd",        1,   1,   1,   0,         1,    0,     1,       0),   // -?, -h, --help, -help accepted but not documented.
-        new ToolHelpSpec("jdb",         1,   1,   1,   0,         1,    1,     0,       0),   // -?, -h, --help, -help accepted but not documented.
-        new ToolHelpSpec("jdeprscan",   1,   1,   1,   0,         0,    0,     1,       0),   // -?, -h, --help
-        new ToolHelpSpec("jdeps",       1,   1,   1,   0,         1,    0,     2,       0),   // -?, -h, --help, -help accepted but not documented.
-        new ToolHelpSpec("jhsdb",       0,   0,   0,   0,         0,    0,     0,       0),   // none, prints help message anyways.
-        new ToolHelpSpec("jimage",      1,   1,   1,   0,         0,    0,     2,       0),   // -?, -h, --help
-        new ToolHelpSpec("jinfo",       1,   1,   1,   0,         1,    1,     1,       0),   // -?, -h, --help, -help accepted but not documented.
-        new ToolHelpSpec("jjs",         0,   1,   1, 100,         0,    0,   100,       0),   //     -h, --help, return code 100
-        new ToolHelpSpec("jlink",       1,   1,   1,   0,         0,    0,     2,       0),   // -?, -h, --help
-        new ToolHelpSpec("jmap",        1,   1,   1,   0,         1,    0,     1,       0),   // -?, -h, --help, -help accepted but not documented.
-        new ToolHelpSpec("jmod",        1,   1,   1,   0,         1,    0,     2,       0),   // -?, -h, --help, -help accepted but not documented.
-        new ToolHelpSpec("jps",         1,   1,   1,   0,         1,    1,     1,       0),   // -?, -h, --help, -help accepted but not documented.
-        new ToolHelpSpec("jrunscript",  1,   1,   1,   0,         1,    1,     7,       0),   // -?, -h, --help, -help accepted but not documented.
-        new ToolHelpSpec("jshell",      1,   1,   1,   0,         1,    0,     1,       0),   // -?, -h, --help, -help accepted but not documented.
-        new ToolHelpSpec("jstack",      1,   1,   1,   0,         1,    1,     1,       0),   // -?, -h, --help, -help accepted but not documented.
-        new ToolHelpSpec("jstat",       1,   1,   1,   0,         1,    1,     1,       0),   // -?, -h, --help, -help accepted but not documented.
-        new ToolHelpSpec("jstatd",      1,   1,   1,   0,         0,    0,     1,       0),   // -?, -h, --help
-        new ToolHelpSpec("keytool",     1,   1,   1,   0,         1,    0,     1,       0),   // none, prints help message anyways.
-        new ToolHelpSpec("pack200",     1,   1,   1,   0,         1,    0,     2,       0),   // -?, -h, --help, -help accepted but not documented.
-        new ToolHelpSpec("rmic",        0,   0,   0,   0,         0,    0,     1,       0),   // none, pirnts help message anyways.
-        new ToolHelpSpec("rmid",        0,   0,   0,   0,         0,    0,     1,       0),   // none, prints help message anyways.
-        new ToolHelpSpec("rmiregistry", 0,   0,   0,   0,         0,    0,     1,       0),   // none, prints help message anyways.
-        new ToolHelpSpec("serialver",   0,   0,   0,   0,         0,    0,     1,       0),   // none, prints help message anyways.
-        new ToolHelpSpec("unpack200",   1,   1,   1,   0,         1,    0,     2,       0),   // -?, -h, --help, -help accepted but not documented.
+        //               name          -?   -h --help exitcode   -help -help  exitcode
+        //                                            of help          docu   of wrong
+        //                                                             mented flag
+        new ToolHelpSpec("jabswitch",   0,   0,   0,   0,         0,    0,     0),     // /?, prints help message anyways, win only
+        new ToolHelpSpec("jaotc",       1,   1,   1,   0,         0,    0,     2),     // -?, -h, --help
+        new ToolHelpSpec("jar",         1,   1,   1,   0,         0,    0,     1),     // -?, -h, --help
+        new ToolHelpSpec("jarsigner",   1,   1,   1,   0,         1,    0,     1),     // -?, -h, --help, -help accepted but not documented.
+        new ToolHelpSpec("java",        1,   1,   1,   0,         1,    1,     1),     // -?, -h, --help -help, Documents -help
+        new ToolHelpSpec("javac",       1,   0,   1,   0,         1,    1,     2),     // -?,     --help -help, Documents -help, -h is already taken for "native header output directory".
+        new ToolHelpSpec("javadoc",     1,   1,   1,   0,         1,    1,     1),     // -?, -h, --help -help, Documents -help
+        new ToolHelpSpec("javap",       1,   1,   1,   0,         1,    1,     2),     // -?, -h, --help -help, Documents -help
+        new ToolHelpSpec("javaw",       1,   1,   1,   0,         1,    1,     1),     // -?, -h, --help -help, Documents -help, win only
+        new ToolHelpSpec("jcmd",        1,   1,   1,   0,         1,    0,     1),     // -?, -h, --help, -help accepted but not documented.
+        new ToolHelpSpec("jdb",         1,   1,   1,   0,         1,    1,     0),     // -?, -h, --help -help, Documents -help
+        new ToolHelpSpec("jdeprscan",   1,   1,   1,   0,         0,    0,     1),     // -?, -h, --help
+        new ToolHelpSpec("jdeps",       1,   1,   1,   0,         1,    0,     2),     // -?, -h, --help, -help accepted but not documented.
+        new ToolHelpSpec("jhsdb",       0,   0,   0,   0,         0,    0,     0),     // none, prints help message anyways.
+        new ToolHelpSpec("jimage",      1,   1,   1,   0,         0,    0,     2),     // -?, -h, --help
+        new ToolHelpSpec("jinfo",       1,   1,   1,   0,         1,    1,     1),     // -?, -h, --help -help, Documents -help
+        new ToolHelpSpec("jjs",         0,   1,   1, 100,         0,    0,   100),     //     -h, --help, return code 100
+        new ToolHelpSpec("jlink",       1,   1,   1,   0,         0,    0,     2),     // -?, -h, --help
+        new ToolHelpSpec("jmap",        1,   1,   1,   0,         1,    0,     1),     // -?, -h, --help, -help accepted but not documented.
+        new ToolHelpSpec("jmod",        1,   1,   1,   0,         1,    0,     2),     // -?, -h, --help, -help accepted but not documented.
+        new ToolHelpSpec("jps",         1,   1,   1,   0,         1,    1,     1),     // -?, -h, --help -help, Documents -help
+        new ToolHelpSpec("jrunscript",  1,   1,   1,   0,         1,    1,     7),     // -?, -h, --help -help, Documents -help
+        new ToolHelpSpec("jshell",      1,   1,   1,   0,         1,    0,     1),     // -?, -h, --help, -help accepted but not documented.
+        new ToolHelpSpec("jstack",      1,   1,   1,   0,         1,    1,     1),     // -?, -h, --help -help, Documents -help
+        new ToolHelpSpec("jstat",       1,   1,   1,   0,         1,    1,     1),     // -?, -h, --help -help, Documents -help
+        new ToolHelpSpec("jstatd",      1,   1,   1,   0,         0,    0,     1),     // -?, -h, --help
+        new ToolHelpSpec("keytool",     1,   1,   1,   0,         1,    0,     1),     // none, prints help message anyways.
+        new ToolHelpSpec("pack200",     1,   1,   1,   0,         1,    0,     2),     // -?, -h, --help, -help accepted but not documented.
+        new ToolHelpSpec("rmic",        0,   0,   0,   0,         0,    0,     1),     // none, pirnts help message anyways.
+        new ToolHelpSpec("rmid",        0,   0,   0,   0,         0,    0,     1),     // none, prints help message anyways.
+        new ToolHelpSpec("rmiregistry", 0,   0,   0,   0,         0,    0,     1),     // none, prints help message anyways.
+        new ToolHelpSpec("serialver",   0,   0,   0,   0,         0,    0,     1),     // none, prints help message anyways.
+        new ToolHelpSpec("unpack200",   1,   1,   1,   0,         1,    0,     2),     // -?, -h, --help, -help accepted but not documented.
+        // Oracle proprietary tools:
+        new ToolHelpSpec("javapackager",0,   0,   0,   0,         1,    0,   255),     // -help accepted but not documented.
     };
 
     // Returns true if the file is not a tool.
@@ -400,18 +401,14 @@
 
             // Check that the return code listing in jdkTools[] is
             // correct for an invalid flag.
-            if (!tool.dontExecuteWithWrongFlags) {
-                errorMessage += testInvalidFlag(f, "-asdfxgr", tool.exitcodeOfWrongFlag, tool.documentsLegacyHelp);
-            }
+            errorMessage += testInvalidFlag(f, "-asdfxgr", tool.exitcodeOfWrongFlag, tool.documentsLegacyHelp);
 
             // Test for legacy -help flag.
             if (!tool.documentsLegacyHelp) {
                 if (tool.supportsLegacyHelp == true) {
                     errorMessage += testLegacyFlag(f, tool.exitcodeOfHelp);
                 } else {
-                    if (!tool.dontExecuteWithWrongFlags) {
-                        errorMessage += testInvalidFlag(f, "-help", tool.exitcodeOfWrongFlag, false);
-                    }
+                    errorMessage += testInvalidFlag(f, "-help", tool.exitcodeOfWrongFlag, false);
                 }
             }
         }
--- a/test/jdk/tools/launcher/modules/addexports/manifest/AddExportsAndOpensInManifest.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/tools/launcher/modules/addexports/manifest/AddExportsAndOpensInManifest.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
  *          manifest of a main application JAR
  */
 
+import java.lang.reflect.Method;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -41,6 +42,7 @@
 import jdk.testlibrary.OutputAnalyzer;
 import jdk.testlibrary.ProcessTools;
 
+import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 import static org.testng.Assert.*;
 
@@ -48,6 +50,15 @@
 @Test
 public class AddExportsAndOpensInManifest {
 
+    private String testName;
+    private int testCaseNum;
+
+    @BeforeMethod
+    public void getTestName(Method m){
+        testName = m.getName();
+        testCaseNum = 0;
+    }
+
     /**
      * Package Test1 and Test2 into a JAR file with the given attributes
      * in the JAR manifest, then execute the JAR file with `java -jar`.
@@ -67,7 +78,7 @@
         }
 
         // create the JAR file with Test1 and Test2
-        Path jarfile = Paths.get("test.jar");
+        Path jarfile = Paths.get(String.format("%s-%s.jar", testName, ++testCaseNum));
         Files.deleteIfExists(jarfile);
 
         Path classes = Paths.get(System.getProperty("test.classes", ""));
@@ -172,5 +183,4 @@
         attrs = "Main-Class=Test1,Add-Opens=java.base/jdk.internal.DoesNotExit";
         runExpectingFail(attrs, "IllegalAccessError");
     }
-
 }
--- a/test/jdk/tools/pack200/ModuleAttributes.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/tools/pack200/ModuleAttributes.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,8 @@
  * @test
  * @bug 8048100
  * @summary test the new Module attributes
+ * @modules jdk.compiler
+ *          jdk.zipfs
  * @compile -XDignore.symbol.file Utils.java ModuleAttributes.java
  * @run main ModuleAttributes
  */
--- a/test/jdk/tools/pack200/Pack200Props.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/jdk/tools/pack200/Pack200Props.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @bug 6575373 6969063
  * @summary verify default properties of the packer/unpacker and segment limit
+ * @modules jdk.compiler
+ *          jdk.zipfs
  * @compile -XDignore.symbol.file Utils.java Pack200Props.java
  * @run main Pack200Props
  * @author ksrini
--- a/test/langtools/jdk/javadoc/doclet/AccessAsciiArt/AccessAsciiArt.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/AccessAsciiArt/AccessAsciiArt.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,9 +48,9 @@
 
         checkOutput("p1/subpkg/SSC.html", true,
                 // Test the top line of the class tree
-                "<li><a href=\"../../p1/C.html\" title=\"class in p1\">p1.C</a></li>",
+                "<li><a href=\"../C.html\" title=\"class in p1\">p1.C</a></li>",
                 // Test the second line of the class tree
-                "<li><a href=\"../../p1/SC.html\" title=\"class in p1\">p1.SC</a></li>",
+                "<li><a href=\"../SC.html\" title=\"class in p1\">p1.SC</a></li>",
                 // Test the third line of the class tree
                 "<li>p1.subpkg.SSC</li>");
     }
--- a/test/langtools/jdk/javadoc/doclet/testAnchorNames/TestAnchorNames.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testAnchorNames/TestAnchorNames.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -82,63 +82,63 @@
         // Test some fields
         checkOutput("pkg1/RegClass.html", true,
                 "<a name=\"Z:Z_\">",
-                "<a href=\"../pkg1/RegClass.html#Z:Z_\">",
+                "<a href=\"#Z:Z_\">",
                 "<a name=\"Z:Z_:D\">",
-                "<a href=\"../pkg1/RegClass.html#Z:Z_:D\">",
+                "<a href=\"#Z:Z_:D\">",
                 "<a name=\"Z:Z:D_\">",
-                "<a href=\"../pkg1/RegClass.html#Z:Z:D_\">",
+                "<a href=\"#Z:Z:D_\">",
                 "<a name=\"Z:Z:Dfield\">",
-                "<a href=\"../pkg1/RegClass.html#Z:Z:Dfield\">",
+                "<a href=\"#Z:Z:Dfield\">",
                 "<a name=\"fieldInCla:D:D\">",
-                "<a href=\"../pkg1/RegClass.html#fieldInCla:D:D\">",
+                "<a href=\"#fieldInCla:D:D\">",
                 "<a name=\"S_:D:D:D:D:DINT\">",
-                "<a href=\"../pkg1/RegClass.html#S_:D:D:D:D:DINT\">",
+                "<a href=\"#S_:D:D:D:D:DINT\">",
                 "<a name=\"method:D:D\">",
-                "<a href=\"../pkg1/RegClass.html#method:D:D\">");
+                "<a href=\"#method:D:D\">");
 
         checkOutput("pkg1/DeprMemClass.html", true,
                 "<a name=\"Z:Z_field_In_Class\">",
-                "<a href=\"../pkg1/DeprMemClass.html#Z:Z_field_In_Class\">");
+                "<a href=\"#Z:Z_field_In_Class\">");
 
         // Test constructor
         checkOutput("pkg1/RegClass.html", true,
                 "<a name=\"RegClass-java.lang.String-int-\">",
-                "<a href=\"../pkg1/RegClass.html#RegClass-java.lang.String-int-\">");
+                "<a href=\"#RegClass-java.lang.String-int-\">");
 
         // Test some methods
         checkOutput("pkg1/RegClass.html", true,
                 "<a name=\"Z:Z_methodInClass-java.lang.String-\">",
-                "<a href=\"../pkg1/RegClass.html#Z:Z_methodInClass-java.lang.String-\">",
+                "<a href=\"#Z:Z_methodInClass-java.lang.String-\">",
                 "<a name=\"method--\">",
-                "<a href=\"../pkg1/RegClass.html#method--\">",
+                "<a href=\"#method--\">",
                 "<a name=\"foo-java.util.Map-\">",
-                "<a href=\"../pkg1/RegClass.html#foo-java.util.Map-\">",
+                "<a href=\"#foo-java.util.Map-\">",
                 "<a name=\"methodInCla:Ds-java.lang.String:A-\">",
-                "<a href=\"../pkg1/RegClass.html#methodInCla:Ds-java.lang.String:A-\">",
+                "<a href=\"#methodInCla:Ds-java.lang.String:A-\">",
                 "<a name=\"Z:Z_methodInClas:D-java.lang.String-int-\">",
-                "<a href=\"../pkg1/RegClass.html#Z:Z_methodInClas:D-java.lang.String-int-\">",
+                "<a href=\"#Z:Z_methodInClas:D-java.lang.String-int-\">",
                 "<a name=\"methodD-pkg1.RegClass.:DA-\">",
-                "<a href=\"../pkg1/RegClass.html#methodD-pkg1.RegClass.:DA-\">",
+                "<a href=\"#methodD-pkg1.RegClass.:DA-\">",
                 "<a name=\"methodD-pkg1.RegClass.D:A-\">",
-                "<a href=\"../pkg1/RegClass.html#methodD-pkg1.RegClass.D:A-\">");
+                "<a href=\"#methodD-pkg1.RegClass.D:A-\">");
 
         checkOutput("pkg1/DeprMemClass.html", true,
                 "<a name=\"Z:Z:Dmethod_In_Class--\">",
-                "<a href=\"../pkg1/DeprMemClass.html#Z:Z:Dmethod_In_Class--\">");
+                "<a href=\"#Z:Z:Dmethod_In_Class--\">");
 
         // Test enum
         checkOutput("pkg1/RegClass.Te$t_Enum.html", true,
                 "<a name=\"Z:Z:DFLD2\">",
-                "<a href=\"../pkg1/RegClass.Te$t_Enum.html#Z:Z:DFLD2\">");
+                "<a href=\"#Z:Z:DFLD2\">");
 
         // Test nested class
         checkOutput("pkg1/RegClass._NestedClas$.html", true,
                 "<a name=\"Z:Z_NestedClas:D--\">",
-                "<a href=\"../pkg1/RegClass._NestedClas$.html#Z:Z_NestedClas:D--\">");
+                "<a href=\"#Z:Z_NestedClas:D--\">");
 
         // Test class use page
         checkOutput("pkg1/class-use/DeprMemClass.html", true,
-                "<a href=\"../../pkg1/RegClass.html#d____mc\">");
+                "<a href=\"../RegClass.html#d____mc\">");
 
         // Test deprecated list page
         checkOutput("deprecated-list.html", true,
@@ -201,63 +201,63 @@
         // Test some fields
         checkOutput("pkg1/RegClass.html", true,
                 "<a id=\"_\">",
-                "<a href=\"../pkg1/RegClass.html#_\">",
+                "<a href=\"#_\">",
                 "<a id=\"_$\">",
-                "<a href=\"../pkg1/RegClass.html#_$\">",
+                "<a href=\"#_$\">",
                 "<a id=\"$_\">",
-                "<a href=\"../pkg1/RegClass.html#$_\">",
+                "<a href=\"#$_\">",
                 "<a id=\"$field\">",
-                "<a href=\"../pkg1/RegClass.html#$field\">",
+                "<a href=\"#$field\">",
                 "<a id=\"fieldInCla$$\">",
-                "<a href=\"../pkg1/RegClass.html#fieldInCla$$\">",
+                "<a href=\"#fieldInCla$$\">",
                 "<a id=\"S_$$$$$INT\">",
-                "<a href=\"../pkg1/RegClass.html#S_$$$$$INT\">",
+                "<a href=\"#S_$$$$$INT\">",
                 "<a id=\"method$$\">",
-                "<a href=\"../pkg1/RegClass.html#method$$\">");
+                "<a href=\"#method$$\">");
 
         checkOutput("pkg1/DeprMemClass.html", true,
                 "<a id=\"_field_In_Class\">",
-                "<a href=\"../pkg1/DeprMemClass.html#_field_In_Class\">");
+                "<a href=\"#_field_In_Class\">");
 
         // Test constructor
         checkOutput("pkg1/RegClass.html", true,
                 "<a id=\"&lt;init&gt;(java.lang.String,int)\">",
-                "<a href=\"../pkg1/RegClass.html#%3Cinit%3E(java.lang.String,int)\">");
+                "<a href=\"#%3Cinit%3E(java.lang.String,int)\">");
 
         // Test some methods
         checkOutput("pkg1/RegClass.html", true,
                 "<a id=\"_methodInClass(java.lang.String)\">",
-                "<a href=\"../pkg1/RegClass.html#_methodInClass(java.lang.String)\">",
+                "<a href=\"#_methodInClass(java.lang.String)\">",
                 "<a id=\"method()\">",
-                "<a href=\"../pkg1/RegClass.html#method()\">",
+                "<a href=\"#method()\">",
                 "<a id=\"foo(java.util.Map)\">",
-                "<a href=\"../pkg1/RegClass.html#foo(java.util.Map)\">",
+                "<a href=\"#foo(java.util.Map)\">",
                 "<a id=\"methodInCla$s(java.lang.String[])\">",
-                "<a href=\"../pkg1/RegClass.html#methodInCla$s(java.lang.String%5B%5D)\">",
+                "<a href=\"#methodInCla$s(java.lang.String%5B%5D)\">",
                 "<a id=\"_methodInClas$(java.lang.String,int)\">",
-                "<a href=\"../pkg1/RegClass.html#_methodInClas$(java.lang.String,int)\">",
+                "<a href=\"#_methodInClas$(java.lang.String,int)\">",
                 "<a id=\"methodD(pkg1.RegClass.$A)\">",
-                "<a href=\"../pkg1/RegClass.html#methodD(pkg1.RegClass.$A)\">",
+                "<a href=\"#methodD(pkg1.RegClass.$A)\">",
                 "<a id=\"methodD(pkg1.RegClass.D[])\">",
-                "<a href=\"../pkg1/RegClass.html#methodD(pkg1.RegClass.D%5B%5D)\">");
+                "<a href=\"#methodD(pkg1.RegClass.D%5B%5D)\">");
 
         checkOutput("pkg1/DeprMemClass.html", true,
                 "<a id=\"$method_In_Class()\">",
-                "<a href=\"../pkg1/DeprMemClass.html#$method_In_Class()\">");
+                "<a href=\"#$method_In_Class()\">");
 
         // Test enum
         checkOutput("pkg1/RegClass.Te$t_Enum.html", true,
                 "<a id=\"$FLD2\">",
-                "<a href=\"../pkg1/RegClass.Te$t_Enum.html#$FLD2\">");
+                "<a href=\"#$FLD2\">");
 
         // Test nested class
         checkOutput("pkg1/RegClass._NestedClas$.html", true,
                 "<a id=\"&lt;init&gt;()\">",
-                "<a href=\"../pkg1/RegClass._NestedClas$.html#%3Cinit%3E()\">");
+                "<a href=\"#%3Cinit%3E()\">");
 
         // Test class use page
         checkOutput("pkg1/class-use/DeprMemClass.html", true,
-                "<a href=\"../../pkg1/RegClass.html#d____mc\">");
+                "<a href=\"../RegClass.html#d____mc\">");
 
         // Test deprecated list page
         checkOutput("deprecated-list.html", true,
@@ -320,10 +320,10 @@
                 "<a id=\"\u0391\u0392\u0393()\">");
 
         checkOutput("p/Ref.html", true,
-                "<a href=\"../p/Def.html#%C3%A0%C3%A9\"><code>&agrave;&eacute;</code></a>",
-                "<a href=\"../p/Def.html#%C3%80%C3%89()\"><code>&Agrave;&Eacute;</code></a>",
-                "<a href=\"../p/Def.html#%CE%B1%CE%B2%CE%B3\"><code>&alpha;&beta;&gamma;</code></a>",
-                "<a href=\"../p/Def.html#%CE%91%CE%92%CE%93()\"><code>&Alpha;&Beta;&Gamma;</code></a>");
+                "<a href=\"Def.html#%C3%A0%C3%A9\"><code>&agrave;&eacute;</code></a>",
+                "<a href=\"Def.html#%C3%80%C3%89()\"><code>&Agrave;&Eacute;</code></a>",
+                "<a href=\"Def.html#%CE%B1%CE%B2%CE%B3\"><code>&alpha;&beta;&gamma;</code></a>",
+                "<a href=\"Def.html#%CE%91%CE%92%CE%93()\"><code>&Alpha;&Beta;&Gamma;</code></a>");
 
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,8 +56,7 @@
                 + "field.detail\">Field</a>&nbsp;|&nbsp;</li>",
                 "<!-- =========== ANNOTATION TYPE FIELD SUMMARY =========== -->",
                 "<h3>Field Summary</h3>",
-                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../"
-                + "pkg/AnnotationTypeField.html#DEFAULT_NAME\">DEFAULT_NAME</a></span>"
+                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#DEFAULT_NAME\">DEFAULT_NAME</a></span>"
                 + "</code></th>",
                 "<!-- ============ ANNOTATION TYPE FIELD DETAIL =========== -->",
                 "<h4>DEFAULT_NAME</h4>\n"
--- a/test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,38 +50,38 @@
         checkExit(Exit.OK);
 
         checkOutput("p/C1.html", true,
-                "<code><a href=\"../p/C2.html\" title=\"class in p\">C2</a></code>",
-                "<code><span class=\"memberNameLink\"><a href=\"../p/C1.html#C1--\">C1</a></span>()</code>");
+                "<code><a href=\"C2.html\" title=\"class in p\">C2</a></code>",
+                "<code><span class=\"memberNameLink\"><a href=\"#C1--\">C1</a></span>()</code>");
 
         checkOutput("p/C2.html", true,
-                "<code><a href=\"../p/C3.html\" title=\"class in p\">C3</a></code>",
-                "<code><span class=\"memberNameLink\"><a href=\"../p/C2.html#C2--\">C2</a></span>()</code>");
+                "<code><a href=\"C3.html\" title=\"class in p\">C3</a></code>",
+                "<code><span class=\"memberNameLink\"><a href=\"#C2--\">C2</a></span>()</code>");
 
         checkOutput("p/C3.html", true,
-                "<code><a href=\"../p/I1.html\" title=\"interface in p\">I1</a></code>, "
-                + "<code><a href=\"../p/I12.html\" title=\"interface in p\">I12</a></code>, "
-                + "<code><a href=\"../p/I2.html\" title=\"interface in p\">I2</a></code>, "
-                + "<code><a href=\"../p/IT1.html\" title=\"interface in p\">IT1</a>&lt;T&gt;</code>, "
-                + "<code><a href=\"../p/IT2.html\" title=\"interface in p\">IT2</a>&lt;java.lang.String&gt;</code>",
-                "<code><span class=\"memberNameLink\"><a href=\"../p/C3.html#C3--\">C3</a></span>()</code>");
+                "<code><a href=\"I1.html\" title=\"interface in p\">I1</a></code>, "
+                + "<code><a href=\"I12.html\" title=\"interface in p\">I12</a></code>, "
+                + "<code><a href=\"I2.html\" title=\"interface in p\">I2</a></code>, "
+                + "<code><a href=\"IT1.html\" title=\"interface in p\">IT1</a>&lt;T&gt;</code>, "
+                + "<code><a href=\"IT2.html\" title=\"interface in p\">IT2</a>&lt;java.lang.String&gt;</code>",
+                "<code><span class=\"memberNameLink\"><a href=\"#C3--\">C3</a></span>()</code>");
 
         checkOutput("p/I1.html", true,
-                "<code><a href=\"../p/C3.html\" title=\"class in p\">C3</a></code>",
-                "<code><a href=\"../p/I12.html\" title=\"interface in p\">I12</a></code>");
+                "<code><a href=\"C3.html\" title=\"class in p\">C3</a></code>",
+                "<code><a href=\"I12.html\" title=\"interface in p\">I12</a></code>");
 
         checkOutput("p/I2.html", true,
-                "<code><a href=\"../p/C3.html\" title=\"class in p\">C3</a></code>",
-                "<code><a href=\"../p/I12.html\" title=\"interface in p\">I12</a></code>");
+                "<code><a href=\"C3.html\" title=\"class in p\">C3</a></code>",
+                "<code><a href=\"I12.html\" title=\"interface in p\">I12</a></code>");
 
         checkOutput("p/I12.html", true,
-                "<code><a href=\"../p/C3.html\" title=\"class in p\">C3</a></code>",
-                "<code><a href=\"../p/I1.html\" title=\"interface in p\">I1</a></code>, <code><a href=\"../p/I2.html\" title=\"interface in p\">I2</a></code>");
+                "<code><a href=\"C3.html\" title=\"class in p\">C3</a></code>",
+                "<code><a href=\"I1.html\" title=\"interface in p\">I1</a></code>, <code><a href=\"I2.html\" title=\"interface in p\">I2</a></code>");
 
         checkOutput("p/IT1.html", true,
-                "<code><a href=\"../p/C3.html\" title=\"class in p\">C3</a></code>");
+                "<code><a href=\"C3.html\" title=\"class in p\">C3</a></code>");
 
         checkOutput("p/IT2.html", true,
-                "code><a href=\"../p/C3.html\" title=\"class in p\">C3</a></code>");
+                "code><a href=\"C3.html\" title=\"class in p\">C3</a></code>");
 
     }
 
--- a/test/langtools/jdk/javadoc/doclet/testClassTree/TestClassTree.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testClassTree/TestClassTree.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,11 +51,11 @@
 
         checkOutput("pkg/package-tree.html", true,
                 "<ul>\n"
-                + "<li class=\"circle\">pkg.<a href=\"../pkg/ParentClass.html\" "
+                + "<li class=\"circle\">pkg.<a href=\"ParentClass.html\" "
                 + "title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a>",
                 "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>\n"
                 + "<ul>\n"
-                + "<li class=\"circle\">pkg.<a href=\"../pkg/AnnotationType.html\" "
+                + "<li class=\"circle\">pkg.<a href=\"AnnotationType.html\" "
                 + "title=\"annotation in pkg\"><span class=\"typeNameLink\">AnnotationType</span></a> "
                 + "(implements java.lang.annotation.Annotation)</li>\n"
                 + "</ul>",
@@ -66,7 +66,7 @@
                 + "<li class=\"circle\">java.lang.Enum&lt;E&gt; (implements java.lang."
                 + "Comparable&lt;T&gt;, java.io.Serializable)\n"
                 + "<ul>\n"
-                + "<li class=\"circle\">pkg.<a href=\"../pkg/Coin.html\" "
+                + "<li class=\"circle\">pkg.<a href=\"Coin.html\" "
                 + "title=\"enum in pkg\"><span class=\"typeNameLink\">Coin</span></a></li>\n"
                 + "</ul>\n"
                 + "</li>\n"
@@ -75,7 +75,7 @@
                 + "</ul>");
 
         checkOutput("pkg/package-tree.html", false,
-                "<li class=\"circle\">class pkg.<a href=\"../pkg/ParentClass.html\" "
+                "<li class=\"circle\">class pkg.<a href=\".ParentClass.html\" "
                 + "title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a></li>");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,31 +48,31 @@
 
         checkOutput("pkg1/Outer.html", true,
                 "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg1/Outer.Inner.html#Inner--\"><code>Inner()</code></a>, \n"
-                + "<a href=\"../pkg1/Outer.Inner.html#Inner-int-\"><code>Inner(int)</code></a>, \n"
-                + "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner--\"><code>NestedInner()</code></a>, \n"
-                + "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\"><code>NestedInner(int)</code></a>, \n"
-                + "<a href=\"../pkg1/Outer.html#Outer--\"><code>Outer()</code></a>, \n"
-                + "<a href=\"../pkg1/Outer.html#Outer-int-\"><code>Outer(int)</code></a>",
-                "Link: <a href=\"../pkg1/Outer.Inner.html#Inner--\"><code>Inner()</code></a>, "
-                + "<a href=\"../pkg1/Outer.html#Outer-int-\"><code>Outer(int)</code></a>, "
-                + "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\"><code>"
+                + "<dd><a href=\"Outer.Inner.html#Inner--\"><code>Inner()</code></a>, \n"
+                + "<a href=\"Outer.Inner.html#Inner-int-\"><code>Inner(int)</code></a>, \n"
+                + "<a href=\"Outer.Inner.NestedInner.html#NestedInner--\"><code>NestedInner()</code></a>, \n"
+                + "<a href=\"Outer.Inner.NestedInner.html#NestedInner-int-\"><code>NestedInner(int)</code></a>, \n"
+                + "<a href=\"#Outer--\"><code>Outer()</code></a>, \n"
+                + "<a href=\"#Outer-int-\"><code>Outer(int)</code></a>",
+                "Link: <a href=\"Outer.Inner.html#Inner--\"><code>Inner()</code></a>, "
+                + "<a href=\"#Outer-int-\"><code>Outer(int)</code></a>, "
+                + "<a href=\"Outer.Inner.NestedInner.html#NestedInner-int-\"><code>"
                 + "NestedInner(int)</code></a>",
-                "<a href=\"../pkg1/Outer.html#Outer--\">Outer</a></span>()",
+                "<a href=\"#Outer--\">Outer</a></span>()",
                 "<a name=\"Outer--\">",
-                "<a href=\"../pkg1/Outer.html#Outer-int-\">Outer</a></span>&#8203;(int&nbsp;i)",
+                "<a href=\"#Outer-int-\">Outer</a></span>&#8203;(int&nbsp;i)",
                 "<a name=\"Outer-int-\">");
 
         checkOutput("pkg1/Outer.Inner.html", true,
-                "<a href=\"../pkg1/Outer.Inner.html#Inner--\">Inner</a></span>()",
+                "<a href=\"#Inner--\">Inner</a></span>()",
                 "<a name=\"Inner--\">",
-                "<a href=\"../pkg1/Outer.Inner.html#Inner-int-\">Inner</a></span>&#8203;(int&nbsp;i)",
+                "<a href=\"#Inner-int-\">Inner</a></span>&#8203;(int&nbsp;i)",
                 "<a name=\"Inner-int-\">");
 
         checkOutput("pkg1/Outer.Inner.NestedInner.html", true,
-                "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner--\">NestedInner</a></span>()",
+                "<a href=\"#NestedInner--\">NestedInner</a></span>()",
                 "<a name=\"NestedInner--\">",
-                "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\">NestedInner</a></span>&#8203;(int&nbsp;i)",
+                "<a href=\"#NestedInner-int-\">NestedInner</a></span>&#8203;(int&nbsp;i)",
                 "<a name=\"NestedInner-int-\">");
 
         checkOutput("pkg1/Outer.Inner.html", false,
@@ -84,9 +84,9 @@
                 "Outer.Inner.NestedInner-int-");
 
         checkOutput("pkg1/Outer.html", false,
-                "<a href=\"../pkg1/Outer.Inner.html#Outer.Inner--\"><code>Outer.Inner()</code></a>",
-                "<a href=\"../pkg1/Outer.Inner.html#Outer.Inner-int-\"><code>Outer.Inner(int)</code></a>",
-                "<a href=\"../pkg1/Outer.Inner.NestedInner.html#Outer.Inner.NestedInner--\"><code>Outer.Inner.NestedInner()</code></a>",
-                "<a href=\"../pkg1/Outer.Inner.NestedInner.html#Outer.Inner.NestedInner-int-\"><code>Outer.Inner.NestedInner(int)</code></a>");
+                "<a href=\"Outer.Inner.html#Outer.Inner--\"><code>Outer.Inner()</code></a>",
+                "<a href=\"Outer.Inner.html#Outer.Inner-int-\"><code>Outer.Inner(int)</code></a>",
+                "<a href=\"Outer.Inner.NestedInner.html#Outer.Inner.NestedInner--\"><code>Outer.Inner.NestedInner()</code></a>",
+                "<a href=\"Outer.Inner.NestedInner.html#Outer.Inner.NestedInner-int-\"><code>Outer.Inner.NestedInner(int)</code></a>");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/TestCopyFiles.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/TestCopyFiles.java	Tue Jan 30 09:03:47 2018 -0800
@@ -54,18 +54,18 @@
                 "phi-TOP-phi",
                 // check top navbar
                 "<a href=\"../../acme.mdle-summary.html\">Module</a>",
-                "<a href=\"../../p/package-summary.html\">Package</a>",
+                "<a href=\"../package-summary.html\">Package</a>",
                 "<a href=\"../../overview-tree.html\">Tree</a>",
                 "<a href=\"../../deprecated-list.html\">Deprecated</a>",
                 "<a href=\"../../index-all.html\">Index</a>",
                 "phi-HEADER-phi",
                 "In a named module acme.module and named package "
-                        + "<a href=\"../../p/package-summary.html\"><code>p</code></a>.",
+                        + "<a href=\"../package-summary.html\"><code>p</code></a>.",
                 "\"simpleTagLabel\">Since:</",
                 "1940",
                 // check bottom navbar
                 "<a href=\"../../acme.mdle-summary.html\">Module</a>",
-                "<a href=\"../../p/package-summary.html\">Package</a>",
+                "<a href=\"../package-summary.html\">Package</a>",
                 "<a href=\"../../overview-tree.html\">Tree</a>",
                 "<a href=\"../../deprecated-list.html\">Deprecated</a>",
                 "<a href=\"../../index-all.html\">Index</a>",
@@ -91,18 +91,18 @@
                 "phi-TOP-phi",
                 // check top navbar
                 "<a href=\"../../acme.mdle-summary.html\">Module</a>",
-                "<a href=\"../../p/package-summary.html\">Package</a>",
+                "<a href=\"../package-summary.html\">Package</a>",
                 "<a href=\"../../overview-tree.html\">Tree</a>",
                 "<a href=\"../../deprecated-list.html\">Deprecated</a>",
                 "<a href=\"../../index-all.html\">Index</a>",
                 "phi-HEADER-phi",
                 "In a named module acme.module and named package "
-                        + "<a href=\"../../p/package-summary.html\"><code>p</code></a>.",
+                        + "<a href=\"../package-summary.html\"><code>p</code></a>.",
                 "\"simpleTagLabel\">Since:</",
                 "1940",
                 // check bottom navbar
                 "<a href=\"../../acme.mdle-summary.html\">Module</a>",
-                "<a href=\"../../p/package-summary.html\">Package</a>",
+                "<a href=\"../package-summary.html\">Package</a>",
                 "<a href=\"../../overview-tree.html\">Tree</a>",
                 "<a href=\"../../deprecated-list.html\">Deprecated</a>",
                 "<a href=\"../../index-all.html\">Index</a>",
@@ -116,7 +116,7 @@
                 "phi-TOP-phi",
                 // check top navbar
                 "<a href=\"../../../../acme2.mdle-summary.html\">Module</a>",
-                "<a href=\"../../../../p2/package-summary.html\">Package</a>",
+                "<a href=\"../../../package-summary.html\">Package</a>",
                 "<a href=\"../../../../overview-tree.html\">Tree</a>",
                 "<a href=\"../../../../deprecated-list.html\">Deprecated</a>",
                 "<a href=\"../../../../index-all.html\">Index</a>",
@@ -124,7 +124,7 @@
                 "SubSubReadme.html at third level of doc-file directory.",
                 // check bottom navbar
                 "<a href=\"../../../../acme2.mdle-summary.html\">Module</a>",
-                "<a href=\"../../../../p2/package-summary.html\">Package</a>",
+                "<a href=\"../../../package-summary.html\">Package</a>",
                 "<a href=\"../../../../overview-tree.html\">Tree</a>",
                 "<a href=\"../../../../deprecated-list.html\">Deprecated</a>",
                 "<a href=\"../../../../index-all.html\">Index</a>",
@@ -141,7 +141,7 @@
         checkExit(Exit.OK);
         checkOutput("p/doc-files/inpackage.html", true,
                 "In a named module acme.module and named package "
-                + "<a href=\"../../p/package-summary.html\"><code>p</code></a>."
+                + "<a href=\"../package-summary.html\"><code>p</code></a>."
         );
     }
 
@@ -155,7 +155,7 @@
         checkExit(Exit.OK);
         checkOutput("p/doc-files/inpackage.html", true,
                 "In a named module acme.module and named package "
-                + "<a href=\"../../p/package-summary.html\"><code>p</code></a>."
+                + "<a href=\"../package-summary.html\"><code>p</code></a>."
         );
     }
 
--- a/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -158,12 +158,12 @@
                 "<hr>\n"
                 + "<pre>@Deprecated(forRemoval=true)\n"
                 + "public enum <span class=\"typeNameLabel\">TestEnum</span>\n"
-                + "extends java.lang.Enum&lt;<a href=\"../pkg/TestEnum.html\" title=\"enum in pkg\">TestEnum</a>&gt;</pre>\n"
+                + "extends java.lang.Enum&lt;<a href=\"TestEnum.html\" title=\"enum in pkg\">TestEnum</a>&gt;</pre>\n"
                 + "<div class=\"deprecationBlock\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version.</span>\n"
                 + "<div class=\"deprecationComment\">enum_test1 passes.</div>\n"
                 + "</div>",
                 "<pre>@Deprecated(forRemoval=true)\n"
-                + "public static final&nbsp;<a href=\"../pkg/TestEnum.html\" title=\"enum in pkg\">TestEnum</a> FOR_REMOVAL</pre>\n"
+                + "public static final&nbsp;<a href=\"TestEnum.html\" title=\"enum in pkg\">TestEnum</a> FOR_REMOVAL</pre>\n"
                 + "<div class=\"deprecationBlock\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version.</span>\n"
                 + "<div class=\"deprecationComment\">enum_test3 passes.</div>\n"
                 + "</div>");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/jdk/javadoc/doclet/testDocPaths/TestDocPaths.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8195796
+ * @summary Add normalize and relative methods to DocPath
+ * @library /tools/lib
+ * @modules jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util
+ * @build toolbox.TestRunner
+ * @run main TestDocPaths
+ */
+
+import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
+import toolbox.TestRunner;
+
+public class TestDocPaths extends TestRunner {
+
+    public static void main(String... args) throws Exception {
+        TestDocPaths tester = new TestDocPaths();
+        tester.runTests();
+    }
+
+    TestDocPaths() {
+        super(System.err);
+    }
+
+    @Test
+    public void testNormalize() {
+        testNormalize("", "");
+        testNormalize(".", "");
+        testNormalize("a/b", "a/b");
+        testNormalize("a//b", "a/b");
+        testNormalize("./b", "b");
+        testNormalize("a/.", "a");
+        testNormalize("a/./b", "a/b");
+        testNormalize("../b", "../b");
+        testNormalize("a/..", "");
+        testNormalize("a/../b", "b");
+        testNormalize("a/../../b", "../b");
+        testNormalize("a/./../b", "b");
+        testNormalize("./../b", "../b");
+        testNormalize("a/./../b", "b");
+    }
+
+    private void testNormalize(String p, String expect) {
+        out.println("test " + p);
+        String found = DocPath.create(p).normalize().getPath();
+        out.println("  result: " + found);
+        if (!expect.equals(found)) {
+            error("Mismatch:\n"
+                + "  expect: " + expect);
+        }
+        out.println();
+    }
+
+    @Test
+    public void testRelativize() {
+        testRelativize("a/b/c/file.html", "file.html", "");
+        testRelativize("a/b/c/file.html", "file2.html", "file2.html");
+        testRelativize("a/b/c/file.html", "../../../a/b/file.html", "../file.html");
+        testRelativize("a/b/c/file.html", "../../../a/b/c/file.html", "");
+        testRelativize("a/b/c/file.html", "../../../a/b/c2/file.html", "../c2/file.html");
+        testRelativize("a/b/c/file.html", "../../../a/b/c/d/file.html", "d/file.html");
+    }
+
+    private void testRelativize(String file, String href, String expect) {
+        out.println("test " + file + " " + href);
+        String found = DocPath.create(file)
+                .relativize(DocPath.create(href))
+                .getPath();
+        out.println("  result: " + found);
+        if (!expect.equals(found)) {
+            error("Mismatch:\n"
+                + "  expect: " + expect);
+        }
+        out.println();
+    }
+}
--- a/test/langtools/jdk/javadoc/doclet/testHiddenTag/TestHiddenTag.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testHiddenTag/TestHiddenTag.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,8 +54,8 @@
                 "<a name=\"visibleField\">",
                 "<a name=\"visibleMethod--\">",
                 "<dt>Direct Known Subclasses:</dt>\n" +
-                "<dd><code><a href=\"../pkg1/A.VisibleInner.html\" title=\"class in pkg1\">" +
-                "A.VisibleInner</a></code>, <code><a href=\"../pkg1/A.VisibleInnerExtendsInvisibleInner.html\" " +
+                "<dd><code><a href=\"A.VisibleInner.html\" title=\"class in pkg1\">" +
+                "A.VisibleInner</a></code>, <code><a href=\"A.VisibleInnerExtendsInvisibleInner.html\" " +
                 "title=\"class in pkg1\">A.VisibleInnerExtendsInvisibleInner</a></code></dd>");
 
         checkOutput("pkg1/A.html", false,
@@ -63,12 +63,12 @@
                 "<a name=\"inVisibleMethod--\">");
 
         checkOutput("pkg1/A.VisibleInner.html", true,
-                "<code><a href=\"../pkg1/A.html#visibleField\">visibleField</a></code>",
-                "<code><a href=\"../pkg1/A.html#visibleMethod--\">visibleMethod</a></code>",
+                "<code><a href=\"A.html#visibleField\">visibleField</a></code>",
+                "<code><a href=\"A.html#visibleMethod--\">visibleMethod</a></code>",
                 "<h3>Nested classes/interfaces inherited from class&nbsp;pkg1." +
-                "<a href=\"../pkg1/A.html\" title=\"class in pkg1\">A</a></h3>\n" +
-                "<code><a href=\"../pkg1/A.VisibleInner.html\" title=\"class in pkg1\">" +
-                "A.VisibleInner</a>, <a href=\"../pkg1/A.VisibleInnerExtendsInvisibleInner.html\" " +
+                "<a href=\"A.html\" title=\"class in pkg1\">A</a></h3>\n" +
+                "<code><a href=\"A.VisibleInner.html\" title=\"class in pkg1\">" +
+                "A.VisibleInner</a>, <a href=\"A.VisibleInnerExtendsInvisibleInner.html\" " +
                 "title=\"class in pkg1\">A.VisibleInnerExtendsInvisibleInner</a></code></li>\n" +
                 "</ul>");
 
@@ -80,9 +80,9 @@
         checkOutput("pkg1/A.VisibleInnerExtendsInvisibleInner.html", true,
                 "<pre>public static class <span class=\"typeNameLabel\">" +
                 "A.VisibleInnerExtendsInvisibleInner</span>\n" +
-                "extends <a href=\"../pkg1/A.html\" title=\"class in pkg1\">A</a></pre>",
-                "<code><a href=\"../pkg1/A.html#visibleField\">visibleField</a></code></li>",
-                "<code><a href=\"../pkg1/A.html#visibleMethod--\">visibleMethod</a></code>");
+                "extends <a href=\"A.html\" title=\"class in pkg1\">A</a></pre>",
+                "<code><a href=\"A.html#visibleField\">visibleField</a></code></li>",
+                "<code><a href=\"A.html#visibleMethod--\">visibleMethod</a></code>");
 
         checkOutput("pkg1/A.VisibleInnerExtendsInvisibleInner.html", false,
                 "invisibleField",
--- a/test/langtools/jdk/javadoc/doclet/testHref/TestHref.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testHref/TestHref.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@
                 //External link.
                 "href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true#wait-long-int-\"",
                 //Member summary table link.
-                "href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\"",
+                "href=\"#method-int-int-java.util.ArrayList-\"",
                 //Anchor test.
                 "<a name=\"method-int-int-java.util.ArrayList-\">\n"
                 + "<!--   -->\n"
@@ -64,10 +64,10 @@
 
         checkOutput("pkg/C2.html", true,
                 //{@link} test.
-                "Link: <a href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\">",
+                "Link: <a href=\"C1.html#method-int-int-java.util.ArrayList-\">",
                 //@see test.
                 "See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\">"
+                + "<dd><a href=\"C1.html#method-int-int-java.util.ArrayList-\">"
         );
 
         checkOutput("pkg/C4.html", true,
--- a/test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -157,7 +157,7 @@
                 + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
                 + "<dd>JDK1.0</dd>\n"
                 + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg1/C2.html\" title=\"class in pkg1\"><code>"
+                + "<dd><a href=\"C2.html\" title=\"class in pkg1\"><code>"
                 + "C2</code></a>, \n"
                 + "<a href=\"../serialized-form.html#pkg1.C1\">"
                 + "Serialized Form</a></dd>\n"
@@ -166,7 +166,7 @@
                 + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
                 + "<dd>1.4</dd>\n"
                 + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">"
+                + "<dd><a href=\"#setUndecorated-boolean-\">"
                 + "<code>setUndecorated(boolean)</code></a></dd>\n"
                 + "</dl>",
                 "<dl>\n"
@@ -193,7 +193,7 @@
                 + "<dd>1.4</dd>\n"
                 + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
                 + "<dd>"
-                + "<a href=\"../pkg1/C1.html#readObject--\"><code>readObject()"
+                + "<a href=\"#readObject--\"><code>readObject()"
                 + "</code></a></dd>\n"
                 + "</dl>",
                 "<dl>\n"
@@ -201,7 +201,7 @@
                 + "<dd><code>java.io.IOException</code></dd>\n"
                 + "<dt><span class=\"seeLabel\">See Also:"
                 + "</span></dt>\n"
-                + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">"
+                + "<dd><a href=\"#setUndecorated-boolean-\">"
                 + "<code>setUndecorated(boolean)</code></a></dd>\n"
                 + "</dl>");
 
@@ -277,7 +277,7 @@
                 "<dd>JDK1.0</dd>\n" +
                 "<dt><span class=\"seeLabel\">See Also:" +
                 "</span></dt>\n" +
-                "<dd><a href=\"../pkg1/C2.html\" title=\"class in pkg1\">" +
+                "<dd><a href=\"C2.html\" title=\"class in pkg1\">" +
                 "<code>C2</code></a>, \n" +
                 "<a href=\"../serialized-form.html#pkg1.C1\">" +
                 "Serialized Form</a></dd>\n" +
@@ -310,7 +310,7 @@
                 + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
                 + "<dd>1.4</dd>\n"
                 + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg1/C1.html#readObject--\">"
+                + "<dd><a href=\"#readObject--\">"
                 + "<code>readObject()</code></a></dd>\n"
                 + "</dl>",
                 "<dl>\n"
@@ -319,7 +319,7 @@
                 + "<dd><code>java.io.IOException</code></dd>\n"
                 + "<dt>"
                 + "<span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">"
+                + "<dd><a href=\"#setUndecorated-boolean-\">"
                 + "<code>setUndecorated(boolean)</code></a></dd>\n"
                 + "</dl>");
 
@@ -381,7 +381,7 @@
 
         checkOutput("pkg1/C1.ModalExclusionType.html", expectFound,
                 "<pre>public " +
-                "static final&nbsp;<a href=\"../pkg1/C1.ModalExclusionType.html\" " +
+                "static final&nbsp;<a href=\"C1.ModalExclusionType.html\" " +
                 "title=\"enum in pkg1\">C1.ModalExclusionType</a> " +
                 "APPLICATION_EXCLUDE</pre>\n" +
                 "</li>");
--- a/test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -192,48 +192,48 @@
 
         // Class use documentation
         checkOutput("pkg1/class-use/I1.html", true,
-                "<caption><span>Packages that use <a href=\"../../pkg1/I1.html\" "
+                "<caption><span>Packages that use <a href=\"../I1.html\" "
                 + "title=\"interface in pkg1\">I1</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>");
 
         checkOutput("pkg1/class-use/C1.html", true,
                 "<caption><span>Fields in <a href=\"../../pkg2/package-summary.html\">"
-                + "pkg2</a> declared as <a href=\"../../pkg1/C1.html\" "
+                + "pkg2</a> declared as <a href=\"../C1.html\" "
                 + "title=\"class in pkg1\">C1</a></span><span class=\"tabEnd\">&nbsp;"
                 + "</span></caption>",
                 "<caption><span>Methods in <a href=\"../../pkg2/package-summary.html\">"
-                + "pkg2</a> that return <a href=\"../../pkg1/C1.html\" "
+                + "pkg2</a> that return <a href=\"../C1.html\" "
                 + "title=\"class in pkg1\">C1</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>");
 
         checkOutput("pkg2/class-use/C2.html", true,
                 "<caption><span>Fields in <a href=\"../../pkg1/package-summary.html\">"
-                + "pkg1</a> declared as <a href=\"../../pkg2/C2.html\" "
+                + "pkg1</a> declared as <a href=\"../C2.html\" "
                 + "title=\"class in pkg2\">C2</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
                 "<caption><span>Methods in <a href=\"../../pkg1/package-summary.html\">"
-                + "pkg1</a> that return <a href=\"../../pkg2/C2.html\" "
+                + "pkg1</a> that return <a href=\"../C2.html\" "
                 + "title=\"class in pkg2\">C2</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>");
 
         checkOutput("pkg2/class-use/C2.ModalExclusionType.html", true,
-                "<caption><span>Methods in <a href=\"../../pkg2/package-summary.html\">"
-                + "pkg2</a> that return <a href=\"../../pkg2/C2.ModalExclusionType.html\" "
+                "<caption><span>Methods in <a href=\"../package-summary.html\">"
+                + "pkg2</a> that return <a href=\"../C2.ModalExclusionType.html\" "
                 + "title=\"enum in pkg2\">C2.ModalExclusionType</a></span>"
                 + "<span class=\"tabEnd\">&nbsp;</span></caption>");
 
         // Package use documentation
         checkOutput("pkg1/package-use.html", true,
-                "<caption><span>Packages that use <a href=\"../pkg1/package-summary.html\">"
+                "<caption><span>Packages that use <a href=\"package-summary.html\">"
                 + "pkg1</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
-                "<caption><span>Classes in <a href=\"../pkg1/package-summary.html\">"
-                + "pkg1</a> used by <a href=\"../pkg1/package-summary.html\">pkg1</a>"
+                "<caption><span>Classes in <a href=\"package-summary.html\">"
+                + "pkg1</a> used by <a href=\"package-summary.html\">pkg1</a>"
                 + "</span><span class=\"tabEnd\">&nbsp;</span></caption>");
 
         checkOutput("pkg2/package-use.html", true,
-                "<caption><span>Packages that use <a href=\"../pkg2/package-summary.html\">"
+                "<caption><span>Packages that use <a href=\"package-summary.html\">"
                 + "pkg2</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
-                "<caption><span>Classes in <a href=\"../pkg2/package-summary.html\">"
+                "<caption><span>Classes in <a href=\"package-summary.html\">"
                 + "pkg2</a> used by <a href=\"../pkg1/package-summary.html\">pkg1</a>"
                 + "</span><span class=\"tabEnd\">&nbsp;</span></caption>");
 
--- a/test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -119,11 +119,11 @@
                 + "\n"
                 + " <p>\n"
                 + " A new instance of the <code>DatatypeFactory</code> is created through the\n"
-                + " <a href=\"../pkg3/A.DatatypeFactory.html#newInstance--\"><code>newInstance()</code></a> method that uses the following implementation\n"
+                + " <a href=\"#newInstance--\"><code>newInstance()</code></a> method that uses the following implementation\n"
                 + " resolution mechanisms to determine an implementation:</p>\n"
                 + " <ol>\n"
                 + " <li>\n"
-                + " If the system property specified by <a href=\"../pkg3/A.DatatypeFactory.html#DATATYPEFACTORY_PROPERTY\"><code>DATATYPEFACTORY_PROPERTY</code></a>,\n"
+                + " If the system property specified by <a href=\"#DATATYPEFACTORY_PROPERTY\"><code>DATATYPEFACTORY_PROPERTY</code></a>,\n"
                 + " \"<code>javax.xml.datatype.DatatypeFactory</code>\", exists, a class with\n"
                 + " the name of the property value is instantiated. Any Exception thrown\n"
                 + " during the instantiation process is wrapped as a\n"
@@ -148,7 +148,7 @@
                 + " </li>\n"
                 + " <li>\n"
                 + " The final mechanism is to attempt to instantiate the <code>Class</code>\n"
-                + " specified by <a href=\"../pkg3/A.DatatypeFactory.html#DATATYPEFACTORY_IMPLEMENTATION_CLASS\">"
+                + " specified by <a href=\"#DATATYPEFACTORY_IMPLEMENTATION_CLASS\">"
                 + "<code>DATATYPEFACTORY_IMPLEMENTATION_CLASS</code></a>. Any Exception\n"
                 + " thrown during the instantiation process is wrapped as a\n"
                 + " <code>IllegalStateException</code>.\n"
--- a/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -133,7 +133,7 @@
                 "<!DOCTYPE HTML>",
                 "<meta name=\"dc.created\"",
                 "<main role=\"main\">\n"
-                + "<h1 class=\"bar\"><a href=\"../pkg/package-summary.html\" target=\"classFrame\">pkg</a></h1>",
+                + "<h1 class=\"bar\"><a href=\"package-summary.html\" target=\"classFrame\">pkg</a></h1>",
                 "<section role=\"region\">\n"
                 + "<h2 title=\"Interfaces\">Interfaces</h2>",
                 "<section role=\"region\">\n"
@@ -598,7 +598,7 @@
                 "<section role=\"region\"><a id=\"pkg\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
-                + "<h3>Uses of <a href=\"../../pkg1/RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
+                + "<h3>Uses of <a href=\"../RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
                 + "<table class=\"useSummary\">",
                 "<footer role=\"contentinfo\">\n"
                 + "<nav role=\"navigation\">\n"
@@ -667,7 +667,7 @@
                 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
                 "<meta name=\"date\"",
                 "<body>\n"
-                + "<h1 class=\"bar\"><a href=\"../pkg/package-summary.html\" target=\"classFrame\">pkg</a></h1>");
+                + "<h1 class=\"bar\"><a href=\"package-summary.html\" target=\"classFrame\">pkg</a></h1>");
 
         // Negated test for package-summary page
         checkOutput("pkg/package-summary.html", false,
@@ -1040,7 +1040,7 @@
                 "<li class=\"blockList\"><a name=\"pkg\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
-                + "<h3>Uses of <a href=\"../../pkg1/RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
+                + "<h3>Uses of <a href=\"../RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
                 + "<table class=\"useSummary\" summary=\"Use table, listing fields, and an explanation\">");
 
         // Negated test for main index page
@@ -1100,7 +1100,7 @@
                 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
                 "<meta name=\"date\"",
                 "<body>\n"
-                + "<h1 class=\"bar\"><a href=\"../pkg/package-summary.html\" target=\"classFrame\">pkg</a></h1>");
+                + "<h1 class=\"bar\"><a href=\"package-summary.html\" target=\"classFrame\">pkg</a></h1>");
 
         // Test for package-summary page
         checkOutput("pkg/package-summary.html", true,
@@ -1486,7 +1486,7 @@
                 "<li class=\"blockList\"><a name=\"pkg\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
-                + "<h3>Uses of <a href=\"../../pkg1/RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
+                + "<h3>Uses of <a href=\"../RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
                 + "<table class=\"useSummary\" summary=\"Use table, listing fields, and an explanation\">");
 
         // Test for main index page
@@ -1551,7 +1551,7 @@
                 "<!DOCTYPE HTML>",
                 "<meta name=\"dc.created\"",
                 "<main role=\"main\">\n"
-                + "<h1 class=\"bar\"><a href=\"../pkg/package-summary.html\" target=\"classFrame\">pkg</a></h1>",
+                + "<h1 class=\"bar\"><a href=\"package-summary.html\" target=\"classFrame\">pkg</a></h1>",
                 "<section role=\"region\">\n"
                 + "<h2 title=\"Interfaces\">Interfaces</h2>",
                 "<section role=\"region\">\n"
@@ -1988,7 +1988,7 @@
                 "<section role=\"region\"><a id=\"pkg\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
-                + "<h3>Uses of <a href=\"../../pkg1/RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
+                + "<h3>Uses of <a href=\"../RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
                 + "\n"
                 + "<table class=\"useSummary\">",
                 "<footer role=\"contentinfo\">\n"
--- a/test/langtools/jdk/javadoc/doclet/testInlineLinkLabel/TestInlineLinkLabel.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testInlineLinkLabel/TestInlineLinkLabel.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,8 +48,8 @@
 
         checkOutput("pkg/C1.html", true,
                 //Search for the label to the package link.
-                "<a href=\"../pkg/package-summary.html\"><code>Here is a link to a package</code></a>",
+                "<a href=\"package-summary.html\"><code>Here is a link to a package</code></a>",
                 //Search for the label to the class link
-                "<a href=\"../pkg/C2.html\" title=\"class in pkg\"><code>Here is a link to a class</code></a>");
+                "<a href=\"C2.html\" title=\"class in pkg\"><code>Here is a link to a class</code></a>");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -70,8 +70,8 @@
                 // Make sure known implementing class list is correct and omits type parameters.
                 "<dl>\n"
                 + "<dt>All Known Implementing Classes:</dt>\n"
-                + "<dd><code><a href=\"../pkg/Child.html\" title=\"class in pkg\">Child"
-                + "</a></code>, <code><a href=\"../pkg/Parent.html\" title=\"class in pkg\">Parent"
+                + "<dd><code><a href=\"Child.html\" title=\"class in pkg\">Child"
+                + "</a></code>, <code><a href=\"Parent.html\" title=\"class in pkg\">Parent"
                 + "</a></code></dd>\n"
                 + "</dl>");
 
@@ -79,7 +79,7 @@
                 // Make sure "All Implemented Interfaces": has substituted type parameters
                 "<dl>\n"
                 + "<dt>All Implemented Interfaces:</dt>\n"
-                + "<dd><code><a href=\"../pkg/Interface.html\" title=\"interface in pkg\">"
+                + "<dd><code><a href=\"Interface.html\" title=\"interface in pkg\">"
                 + "Interface</a>&lt;CE&gt;</code></dd>\n"
                 + "</dl>",
                 //Make sure Class Tree has substituted type parameters.
@@ -87,7 +87,7 @@
                 + "<li>java.lang.Object</li>\n"
                 + "<li>\n"
                 + "<ul class=\"inheritance\">\n"
-                + "<li><a href=\"../pkg/Parent.html\" title=\"class in pkg\">"
+                + "<li><a href=\"Parent.html\" title=\"class in pkg\">"
                 + "pkg.Parent</a>&lt;CE&gt;</li>\n"
                 + "<li>\n"
                 + "<ul class=\"inheritance\">\n"
@@ -99,23 +99,23 @@
                 + "</ul>",
                 //Make sure "Specified By" has substituted type parameters.
                 "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg/Interface.html#method--\">method</a>"
+                + "<dd><code><a href=\"Interface.html#method--\">method</a>"
                 + "</code>&nbsp;in interface&nbsp;<code>"
-                + "<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">"
-                + "Interface</a>&lt;<a href=\"../pkg/Child.html\" title=\"type parameter in Child\">"
+                + "<a href=\"Interface.html\" title=\"interface in pkg\">"
+                + "Interface</a>&lt;<a href=\"Child.html\" title=\"type parameter in Child\">"
                 + "CE</a>&gt;</code></dd>",
                 //Make sure "Overrides" has substituted type parameters.
                 "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg/Parent.html#method--\">method</a>"
-                + "</code>&nbsp;in class&nbsp;<code><a href=\"../pkg/Parent.html\" "
-                + "title=\"class in pkg\">Parent</a>&lt;<a href=\"../pkg/Child.html\" "
+                + "<dd><code><a href=\"Parent.html#method--\">method</a>"
+                + "</code>&nbsp;in class&nbsp;<code><a href=\"Parent.html\" "
+                + "title=\"class in pkg\">Parent</a>&lt;<a href=\"Child.html\" "
                 + "title=\"type parameter in Child\">CE</a>&gt;</code></dd>");
 
         checkOutput("pkg/Parent.html", true,
                 //Make sure "Direct Know Subclasses" omits type parameters
                 "<dl>\n"
                 + "<dt>Direct Known Subclasses:</dt>\n"
-                + "<dd><code><a href=\"../pkg/Child.html\" title=\"class in pkg\">Child"
+                + "<dd><code><a href=\"Child.html\" title=\"class in pkg\">Child"
                 + "</a></code></dd>\n"
                 + "</dl>");
 
@@ -135,7 +135,7 @@
 
                 "<td class=\"colFirst\"><code>static void</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg/ClassWithStaticMembers.html#m--\">m</a></span>()</code></th>\n"
+                + "<a href=\"#m--\">m</a></span>()</code></th>\n"
                 + "<td class=\"colLast\">\n"
                 + "<div class=\"block\">A hider method</div>\n"
                 + "</td>\n",
@@ -144,7 +144,7 @@
                 + "<pre>public static&nbsp;void&nbsp;staticMethod()</pre>\n"
                 + "<div class=\"block\"><span class=\"descfrmTypeLabel\">"
                 + "Description copied from interface:&nbsp;<code>"
-                + "<a href=\"../pkg/InterfaceWithStaticMembers.html#staticMethod--\">"
+                + "<a href=\"InterfaceWithStaticMembers.html#staticMethod--\">"
                 + "InterfaceWithStaticMembers</a></code></span></div>\n"
                 + "<div class=\"block\">A static method</div>\n");
 
@@ -165,10 +165,10 @@
         checkOutput("pkg1/Child.html", true,
             // Ensure the correct Overrides in the inheritance hierarchy is reported
             "<span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
-            "<dd><code><a href=\"../pkg1/GrandParent.html#method1--\">method1</a></code>" +
+            "<dd><code><a href=\"GrandParent.html#method1--\">method1</a></code>" +
             "&nbsp;in class&nbsp;" +
-            "<code><a href=\"../pkg1/GrandParent.html\" title=\"class in pkg1\">GrandParent</a>" +
-            "&lt;<a href=\"../pkg1/Child.html\" title=\"type parameter in Child\">CE</a>&gt;</code>");
+            "<code><a href=\"GrandParent.html\" title=\"class in pkg1\">GrandParent</a>" +
+            "&lt;<a href=\"Child.html\" title=\"type parameter in Child\">CE</a>&gt;</code>");
     }
 
     @Test
@@ -182,21 +182,21 @@
         checkOutput("pkg2/Spliterator.OfDouble.html", true,
             // Ensure the correct type parameters are displayed correctly
             "<h3>Nested classes/interfaces inherited from interface&nbsp;pkg2."
-            + "<a href=\"../pkg2/Spliterator.html\" title=\"interface in pkg2\">Spliterator</a></h3>\n"
-            + "<code><a href=\"../pkg2/Spliterator.OfDouble.html\" title=\"interface in pkg2\">"
-            + "Spliterator.OfDouble</a>, <a href=\"../pkg2/Spliterator.OfInt.html\" "
+            + "<a href=\"Spliterator.html\" title=\"interface in pkg2\">Spliterator</a></h3>\n"
+            + "<code><a href=\"Spliterator.OfDouble.html\" title=\"interface in pkg2\">"
+            + "Spliterator.OfDouble</a>, <a href=\"Spliterator.OfInt.html\" "
             + "title=\"interface in pkg2\">Spliterator.OfInt</a>&lt;"
-            + "<a href=\"../pkg2/Spliterator.OfInt.html\" title=\"type parameter in Spliterator.OfInt\">"
-            + "Integer</a>&gt;, <a href=\"../pkg2/Spliterator.OfPrimitive.html\" title=\"interface in pkg2\">"
-            + "Spliterator.OfPrimitive</a>&lt;<a href=\"../pkg2/Spliterator.OfPrimitive.html\" "
-            + "title=\"type parameter in Spliterator.OfPrimitive\">T</a>,<a href=\"../pkg2/Spliterator.OfPrimitive.html\" "
+            + "<a href=\"Spliterator.OfInt.html\" title=\"type parameter in Spliterator.OfInt\">"
+            + "Integer</a>&gt;, <a href=\"Spliterator.OfPrimitive.html\" title=\"interface in pkg2\">"
+            + "Spliterator.OfPrimitive</a>&lt;<a href=\"Spliterator.OfPrimitive.html\" "
+            + "title=\"type parameter in Spliterator.OfPrimitive\">T</a>,<a href=\"Spliterator.OfPrimitive.html\" "
             + "title=\"type parameter in Spliterator.OfPrimitive\">T_CONS</a>,"
-            + "<a href=\"../pkg2/Spliterator.OfPrimitive.html\" title=\"type parameter in Spliterator.OfPrimitive\">"
-            + "T_SPLITR</a> extends <a href=\"../pkg2/Spliterator.OfPrimitive.html\" title=\"interface in pkg2\">"
-            + "Spliterator.OfPrimitive</a>&lt;<a href=\"../pkg2/Spliterator.OfPrimitive.html\" "
+            + "<a href=\"Spliterator.OfPrimitive.html\" title=\"type parameter in Spliterator.OfPrimitive\">"
+            + "T_SPLITR</a> extends <a href=\"Spliterator.OfPrimitive.html\" title=\"interface in pkg2\">"
+            + "Spliterator.OfPrimitive</a>&lt;<a href=\"Spliterator.OfPrimitive.html\" "
             + "title=\"type parameter in Spliterator.OfPrimitive\">T</a>,"
-            + "<a href=\"../pkg2/Spliterator.OfPrimitive.html\" title=\"type parameter in Spliterator.OfPrimitive\">"
-            + "T_CONS</a>,<a href=\"../pkg2/Spliterator.OfPrimitive.html\" title=\"type parameter in Spliterator.OfPrimitive\">"
+            + "<a href=\"Spliterator.OfPrimitive.html\" title=\"type parameter in Spliterator.OfPrimitive\">"
+            + "T_CONS</a>,<a href=\"Spliterator.OfPrimitive.html\" title=\"type parameter in Spliterator.OfPrimitive\">"
             + "T_SPLITR</a>&gt;&gt;</code>");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,8 +51,8 @@
 
         checkOutput("pkg1/C.html", true,
                 "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg1/C.html#getRate--\"><code>getRate()</code></a>, \n"
-                + "<a href=\"../pkg1/C.html#setRate-double-\">"
+                + "<dd><a href=\"#getRate--\"><code>getRate()</code></a>, \n"
+                + "<a href=\"#setRate-double-\">"
                 + "<code>setRate(double)</code></a></dd>",
                 "<pre>public final&nbsp;void&nbsp;setRate&#8203;(double&nbsp;value)</pre>\n"
                 + "<div class=\"block\">Sets the value of the property rate.</div>\n"
@@ -62,10 +62,10 @@
                 + "<div class=\"block\">Gets the value of the property rate.</div>\n"
                 + "<dl>\n"
                 + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>",
-                "<td class=\"colFirst\"><code><a href=\"../pkg1/C.DoubleProperty.html\" "
+                "<td class=\"colFirst\"><code><a href=\"C.DoubleProperty.html\" "
                 + "title=\"class in pkg1\">C.DoubleProperty</a></code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg1/C.html#rateProperty\">rate</a></span></code></th>\n"
+                + "<a href=\"#rateProperty\">rate</a></span></code></th>\n"
                 + "<td class=\"colLast\">\n"
                 + "<div class=\"block\">Defines the direction/speed at which the "
                 + "<code>Timeline</code> is expected to\n"
@@ -77,14 +77,14 @@
                 "<p>Gets the value of the property <code>Property</code>",
                 "<span class=\"simpleTagLabel\">Property description:</span>",
                 "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg1/C.html#setTestMethodProperty--\">"
+                + "<a href=\"#setTestMethodProperty--\">"
                 + "setTestMethodProperty</a></span>()</code></th>",
                 "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg1/C.html#pausedProperty\">paused</a></span></code></th>\n"
+                + "<a href=\"#pausedProperty\">paused</a></span></code></th>\n"
                 + "<td class=\"colLast\">\n"
                 + "<div class=\"block\">Defines if paused.</div>",
                 "<h4>paused</h4>\n"
-                + "<pre>public final&nbsp;<a href=\"../pkg1/C.BooleanProperty.html\" "
+                + "<pre>public final&nbsp;<a href=\"C.BooleanProperty.html\" "
                 + "title=\"class in pkg1\">C.BooleanProperty</a> pausedProperty</pre>\n"
                 + "<div class=\"block\">Defines if paused. The second line.</div>",
                 "<h4>isPaused</h4>\n"
@@ -107,7 +107,7 @@
                 + "<dt><span class=\"simpleTagLabel\">Default value:</span></dt>\n"
                 + "<dd>false</dd>",
                 "<h4>rate</h4>\n"
-                + "<pre>public final&nbsp;<a href=\"../pkg1/C.DoubleProperty.html\" "
+                + "<pre>public final&nbsp;<a href=\"C.DoubleProperty.html\" "
                 + "title=\"class in pkg1\">C.DoubleProperty</a> rateProperty</pre>\n"
                 + "<div class=\"block\">Defines the direction/speed at which the "
                 + "<code>Timeline</code> is expected to\n"
@@ -138,9 +138,9 @@
                 + "<table class=\"memberSummary\" summary=\"Property Summary table, listing properties, and an explanation\">\n"
                 + "<caption><span>Properties</span><span class=\"tabEnd\">&nbsp;</span></caption>",
                 "<tr class=\"altColor\">\n"
-                + "<td class=\"colFirst\"><code><a href=\"../pkg1/C.BooleanProperty.html\" title=\"class in pkg1\">C.BooleanProperty</a></code></td>\n",
+                + "<td class=\"colFirst\"><code><a href=\"C.BooleanProperty.html\" title=\"class in pkg1\">C.BooleanProperty</a></code></td>\n",
                 "<tr class=\"rowColor\">\n"
-                + "<td class=\"colFirst\"><code><a href=\"../pkg1/C.DoubleProperty.html\" title=\"class in pkg1\">C.DoubleProperty</a></code></td>\n");
+                + "<td class=\"colFirst\"><code><a href=\"C.DoubleProperty.html\" title=\"class in pkg1\">C.DoubleProperty</a></code></td>\n");
 
         checkOutput("pkg1/C.html", false,
                 "A()",
@@ -152,9 +152,9 @@
                 + "<a href=\"javascript:show(8);\">Concrete Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>"
                 + "</caption>",
                 "<tr id=\"i0\" class=\"altColor\">\n"
-                + "<td class=\"colFirst\"><code><a href=\"../pkg1/C.BooleanProperty.html\" title=\"class in pkg1\">C.BooleanProperty</a></code></td>\n",
+                + "<td class=\"colFirst\"><code><a href=\"C.BooleanProperty.html\" title=\"class in pkg1\">C.BooleanProperty</a></code></td>\n",
                 "<tr id=\"i1\" class=\"rowColor\">\n"
-                + "<td class=\"colFirst\"><code><a href=\"../pkg1/C.DoubleProperty.html\" title=\"class in pkg1\">C.DoubleProperty</a></code></td>\n");
+                + "<td class=\"colFirst\"><code><a href=\"C.DoubleProperty.html\" title=\"class in pkg1\">C.DoubleProperty</a></code></td>\n");
 
         checkOutput("index-all.html", true,
                 "<div class=\"block\">Gets the value of the property paused.</div>",
@@ -162,9 +162,9 @@
 
         checkOutput("pkg1/D.html", true,
                 "<h3>Properties inherited from class&nbsp;pkg1."
-                    + "<a href=\"../pkg1/C.html\" title=\"class in pkg1\">C</a></h3>\n"
-                    + "<code><a href=\"../pkg1/C.html#pausedProperty\">"
-                    + "paused</a>, <a href=\"../pkg1/C.html#rateProperty\">rate</a></code></li>");
+                    + "<a href=\"C.html\" title=\"class in pkg1\">C</a></h3>\n"
+                    + "<code><a href=\"C.html#pausedProperty\">"
+                    + "paused</a>, <a href=\"C.html#rateProperty\">rate</a></code></li>");
 
         checkOutput("pkg1/D.html", false, "shouldNotAppear");
     }
@@ -246,27 +246,27 @@
                 + "<tr id=\"i0\" class=\"altColor\">\n"
                 + "<td class=\"colFirst\"><code>&lt;T&gt;&nbsp;java.lang.Object</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg2/Test.html#alphaProperty-java.util.List-\">alphaProperty</a>"
+                + "<a href=\"#alphaProperty-java.util.List-\">alphaProperty</a>"
                 + "</span>&#8203;(java.util.List&lt;T&gt;&nbsp;foo)</code></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "<tr id=\"i1\" class=\"rowColor\">\n"
                 + "<td class=\"colFirst\"><code>java.lang.Object</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg2/Test.html#betaProperty--\">betaProperty</a></span>()</code></th>\n"
+                + "<a href=\"#betaProperty--\">betaProperty</a></span>()</code></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "<tr id=\"i2\" class=\"altColor\">\n"
                 + "<td class=\"colFirst\"><code>java.util.List&lt;java.util.Set&lt;? super java.lang.Object&gt;&gt;"
                 + "</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg2/Test.html#deltaProperty--\">deltaProperty</a></span>()</code></th>\n"
+                + "<a href=\"#deltaProperty--\">deltaProperty</a></span>()</code></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "<tr id=\"i3\" class=\"rowColor\">\n"
                 + "<td class=\"colFirst\"><code>java.util.List&lt;java.lang.String&gt;</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg2/Test.html#gammaProperty--\">gammaProperty</a></span>()</code></th>\n"
+                + "<a href=\"#gammaProperty--\">gammaProperty</a></span>()</code></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>"
         );
     }
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -86,7 +86,7 @@
                 + " title=\"class or interface in java.lang\" class=\"externalLink\"><code><tt>getSystemClassLoader()</tt>"
                 + "</code></a> as the parent class loader.</div>",
                 "<div class=\"block\">is equivalent to invoking <code>"
-                + "<a href=\"../pkg/B.html#createTempFile-java.lang.String-java.lang.String-java.io.File-\">"
+                + "<a href=\"#createTempFile-java.lang.String-java.lang.String-java.io.File-\">"
                 + "<code>createTempFile(prefix,&nbsp;suffix,&nbsp;null)</code></a></code>.</div>",
                 "<a href=\"" + url + "java/lang/String.html?is-external=true\" "
                 + "title=\"class or interface in java.lang\" class=\"externalLink\">Link-Plain to String Class</a>",
--- a/test/langtools/jdk/javadoc/doclet/testLinkTaglet/TestLinkTaglet.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testLinkTaglet/TestLinkTaglet.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,23 +49,23 @@
         checkExit(Exit.OK);
 
         checkOutput("pkg/C.html", true,
-                "Qualified Link: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
-                + " Unqualified Link1: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
-                + " Unqualified Link2: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
-                + " Qualified Link: <a href=\"../pkg/C.html#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(pkg.C.InnerC, pkg.C.InnerC2)</code></a>.<br/>\n"
-                + " Unqualified Link: <a href=\"../pkg/C.html#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(C.InnerC, C.InnerC2)</code></a>.<br/>\n"
-                + " Unqualified Link: <a href=\"../pkg/C.html#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(InnerC, InnerC2)</code></a>.<br/>\n"
-                + " Package Link: <a href=\"../pkg/package-summary.html\"><code>pkg</code></a>.<br/>");
+                "Qualified Link: <a href=\"C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
+                + " Unqualified Link1: <a href=\"C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
+                + " Unqualified Link2: <a href=\"C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
+                + " Qualified Link: <a href=\"#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(pkg.C.InnerC, pkg.C.InnerC2)</code></a>.<br/>\n"
+                + " Unqualified Link: <a href=\"#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(C.InnerC, C.InnerC2)</code></a>.<br/>\n"
+                + " Unqualified Link: <a href=\"#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(InnerC, InnerC2)</code></a>.<br/>\n"
+                + " Package Link: <a href=\"package-summary.html\"><code>pkg</code></a>.<br/>");
 
         checkOutput("pkg/C.InnerC.html", true,
-                "Link to member in outer class: <a href=\"../pkg/C.html#MEMBER\"><code>C.MEMBER</code></a> <br/>\n"
-                + " Link to member in inner class: <a href=\"../pkg/C.InnerC2.html#MEMBER2\"><code>C.InnerC2.MEMBER2</code></a> <br/>\n"
-                + " Link to another inner class: <a href=\"../pkg/C.InnerC2.html\" title=\"class in pkg\"><code>C.InnerC2</code></a>");
+                "Link to member in outer class: <a href=\"C.html#MEMBER\"><code>C.MEMBER</code></a> <br/>\n"
+                + " Link to member in inner class: <a href=\"C.InnerC2.html#MEMBER2\"><code>C.InnerC2.MEMBER2</code></a> <br/>\n"
+                + " Link to another inner class: <a href=\"C.InnerC2.html\" title=\"class in pkg\"><code>C.InnerC2</code></a>");
 
         checkOutput("pkg/C.InnerC2.html", true,
                 "<dl>\n"
                 + "<dt>Enclosing class:</dt>\n"
-                + "<dd><a href=\"../pkg/C.html\" title=\"class in pkg\">C</a></dd>\n"
+                + "<dd><a href=\"C.html\" title=\"class in pkg\">C</a></dd>\n"
                 + "</dl>");
 
         checkOutput(Output.OUT, false,
--- a/test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,56 +50,56 @@
 
         checkOutput("pkg/SubClass.html", true,
                 // Public field should be inherited
-                "<a href=\"../pkg/BaseClass.html#pubField\">",
+                "<a href=\"BaseClass.html#pubField\">",
                 // Public method should be inherited
-                "<a href=\"../pkg/BaseClass.html#pubMethod--\">",
+                "<a href=\"BaseClass.html#pubMethod--\">",
                 // Public inner class should be inherited.
-                "<a href=\"../pkg/BaseClass.pubInnerClass.html\" title=\"class in pkg\">",
+                "<a href=\"BaseClass.pubInnerClass.html\" title=\"class in pkg\">",
                 // Protected field should be inherited
-                "<a href=\"../pkg/BaseClass.html#proField\">",
+                "<a href=\"BaseClass.html#proField\">",
                 // Protected method should be inherited
-                "<a href=\"../pkg/BaseClass.html#proMethod--\">",
+                "<a href=\"BaseClass.html#proMethod--\">",
                 // Protected inner class should be inherited.
-                "<a href=\"../pkg/BaseClass.proInnerClass.html\" title=\"class in pkg\">",
+                "<a href=\"BaseClass.proInnerClass.html\" title=\"class in pkg\">",
                 // New labels as of 1.5.0
                 "Nested classes/interfaces inherited from class&nbsp;pkg."
-                + "<a href=\"../pkg/BaseClass.html\" title=\"class in pkg\">BaseClass</a>",
+                + "<a href=\"BaseClass.html\" title=\"class in pkg\">BaseClass</a>",
                 "Nested classes/interfaces inherited from interface&nbsp;pkg."
-                + "<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">BaseInterface</a>");
+                + "<a href=\"BaseInterface.html\" title=\"interface in pkg\">BaseInterface</a>");
 
         checkOutput("pkg/BaseClass.html", true,
                 // Test overriding/implementing methods with generic parameters.
                 "<dl>\n"
                 + "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg/BaseInterface.html#getAnnotation-java.lang.Class-\">"
+                + "<dd><code><a href=\"BaseInterface.html#getAnnotation-java.lang.Class-\">"
                 + "getAnnotation</a></code>&nbsp;in interface&nbsp;<code>"
-                + "<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">"
+                + "<a href=\"BaseInterface.html\" title=\"interface in pkg\">"
                 + "BaseInterface</a></code></dd>\n"
                 + "</dl>");
 
         checkOutput("diamond/Z.html", true,
                 // Test diamond inheritance member summary (6256068)
-                "<code><a href=\"../diamond/A.html#aMethod--\">aMethod</a></code>");
+                "<code><a href=\"A.html#aMethod--\">aMethod</a></code>");
 
         checkOutput("inheritDist/C.html", true,
                 // Test that doc is inherited from closed parent (6270645)
                 "<div class=\"block\">m1-B</div>");
 
         checkOutput("pkg/SubClass.html", false,
-                "<a href=\"../pkg/BaseClass.html#staticMethod--\">staticMethod</a></code>");
+                "<a href=\"BaseClass.html#staticMethod--\">staticMethod</a></code>");
 
         checkOutput("pkg1/Implementer.html", true,
                 // ensure the method makes it
                 "<td class=\"colFirst\"><code>static java.time.Period</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg1/Implementer.html#between-java.time.LocalDate-java.time.LocalDate-\">"
+                + "<a href=\"#between-java.time.LocalDate-java.time.LocalDate-\">"
                 + "between</a></span>&#8203;(java.time.LocalDate&nbsp;startDateInclusive,\n"
                 + "       java.time.LocalDate&nbsp;endDateExclusive)</code></th>");
 
         checkOutput("pkg1/Implementer.html", false,
-                "<h3>Methods inherited from interface&nbsp;pkg1.<a href=\"../pkg1/Interface.html\""
+                "<h3>Methods inherited from interface&nbsp;pkg1.<a href=\"Interface.html\""
                 + " title=\"interface in pkg1\">Interface</a></h3>\n"
-                + "<code><a href=\"../pkg1/Interface.html#between-java.time.chrono.ChronoLocalDate"
+                + "<code><a href=\"Interface.html#between-java.time.chrono.ChronoLocalDate"
                 + "-java.time.chrono.ChronoLocalDate-\">between</a></code>"
         );
     }
--- a/test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,19 +50,19 @@
 
         checkOutput("pkg/PublicChild.html", true,
                 // Check return type in member summary.
-                "<code><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>\n"
-                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../pkg/PublicChild.html#returnTypeTest--\">"
+                "<code><a href=\"PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>\n"
+                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#returnTypeTest--\">"
                 + "returnTypeTest</a></span>()</code>",
                 // Check return type in member detail.
-                "<pre>public&nbsp;<a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">"
+                "<pre>public&nbsp;<a href=\"PublicChild.html\" title=\"class in pkg\">"
                 + "PublicChild</a>&nbsp;returnTypeTest()</pre>",
                 "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg/PublicChild.html#PublicChild--\">PublicChild</a></span>()</code></th>");
+                + "<a href=\"#PublicChild--\">PublicChild</a></span>()</code></th>");
 
         checkOutput("pkg/PrivateParent.html", true,
                 "<td class=\"colFirst\"><code>private </code></td>\n"
                 + "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg/PrivateParent.html#PrivateParent-int-\">PrivateParent</a></span>&#8203;(int&nbsp;i)</code>"
+                + "<a href=\"#PrivateParent-int-\">PrivateParent</a></span>&#8203;(int&nbsp;i)</code>"
                 + "</th>");
 
         // Legacy anchor dimensions (6290760)
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -854,7 +854,7 @@
                 "<div class=\"subTitle\"><span class=\"moduleLabelInType\">Module</span>&nbsp;"
                 + "<a href=\"../moduleB-summary.html\">moduleB</a></div>",
                 "<div class=\"subTitle\"><span class=\"packageLabelInType\">"
-                + "Package</span>&nbsp;<a href=\"../testpkgmdlB/package-summary.html\">testpkgmdlB</a></div>");
+                + "Package</span>&nbsp;<a href=\"package-summary.html\">testpkgmdlB</a></div>");
         checkFiles(found,
                 "moduleA-frame.html",
                 "moduleA-summary.html",
--- a/test/langtools/jdk/javadoc/doclet/testNavigation/TestNavigation.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testNavigation/TestNavigation.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,21 +49,21 @@
 
         checkOutput("pkg/A.html", true,
                 "<li>Prev&nbsp;Class</li>",
-                "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>",
+                "<a href=\"C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>",
                 "<li><a href=\"../overview-summary.html\">Overview</a></li>");
 
         checkOutput("pkg/C.html", true,
-                "<a href=\"../pkg/A.html\" title=\"annotation in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>",
-                "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>",
+                "<a href=\"A.html\" title=\"annotation in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>",
+                "<a href=\"E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>",
                 "<li><a href=\"../overview-summary.html\">Overview</a></li>");
 
         checkOutput("pkg/E.html", true,
-                "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>",
-                "<a href=\"../pkg/I.html\" title=\"interface in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>",
+                "<a href=\"C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>",
+                "<a href=\"I.html\" title=\"interface in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>",
                 "<li><a href=\"../overview-summary.html\">Overview</a></li>");
 
         checkOutput("pkg/I.html", true,
-                "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>",
+                "<a href=\"E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>",
                 "<li>Next&nbsp;Class</li>",
                 // Test for 4664607
                 "<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n"
--- a/test/langtools/jdk/javadoc/doclet/testNestedGenerics/TestNestedGenerics.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testNestedGenerics/TestNestedGenerics.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@
 
         checkOutput("pkg/NestedGenerics.html", true,
             "<div class=\"block\">Contains <a " +
-            "href=\"../pkg/NestedGenerics.html#foo-java.util.Map-\"><code>foo" +
+            "href=\"#foo-java.util.Map-\"><code>foo" +
             "(java.util.Map&lt;A, java.util.Map&lt;A, A&gt;&gt;)</code></a></div>");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -67,20 +67,20 @@
                 // Make sure enum signature is correct.
                 "<pre>public enum "
                 + "<span class=\"typeNameLabel\">Coin</span>\n"
-                + "extends java.lang.Enum&lt;<a href=\"../pkg/Coin.html\" "
+                + "extends java.lang.Enum&lt;<a href=\"Coin.html\" "
                 + "title=\"enum in pkg\">Coin</a>&gt;</pre>",
                 // Check for enum constant section
                 "<caption><span>Enum Constants"
                 + "</span><span class=\"tabEnd\">&nbsp;</span></caption>",
                 // Detail for enum constant
-                "<span class=\"memberNameLink\"><a href=\"../pkg/Coin.html#Dime\">Dime</a></span>",
+                "<span class=\"memberNameLink\"><a href=\"#Dime\">Dime</a></span>",
                 // Automatically insert documentation for values() and valueOf().
                 "Returns an array containing the constants of this enum type,",
                 "Returns the enum constant of this type with the specified name",
                 "for (Coin c : Coin.values())",
                 "Overloaded valueOf() method has correct documentation.",
                 "Overloaded values method  has correct documentation.",
-                "<pre>public static&nbsp;<a href=\"../pkg/Coin.html\" title=\"enum in pkg\">Coin</a>" +
+                "<pre>public static&nbsp;<a href=\"Coin.html\" title=\"enum in pkg\">Coin</a>" +
                 "&nbsp;valueOf&#8203;(java.lang.String&nbsp;name)</pre>\n" +
                 "<div class=\"block\">Returns the enum constant of this type with the specified name.\n" +
                 "The string must match <i>exactly</i> an identifier used to declare an\n" +
@@ -117,11 +117,11 @@
                 "<dl>\n"
                 + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
                 + "<dd>"
-                + "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">"
+                + "<a href=\"TypeParameters.html\" title=\"class in pkg\">"
                 + "<code>TypeParameters</code></a></dd>\n"
                 + "</dl>",
                 // Method that uses class type parameter.
-                "(<a href=\"../pkg/TypeParameters.html\" title=\"type "
+                "(<a href=\"TypeParameters.html\" title=\"type "
                 + "parameter in TypeParameters\">E</a>&nbsp;param)",
                 // Method type parameter section.
                 "<span class=\"paramLabel\">Type Parameters:</span></dt>\n"
@@ -133,38 +133,38 @@
                 "public&nbsp;&lt;T extends java.util.List,V&gt;&nbsp;"
                 + "java.lang.String[]&nbsp;methodThatHasTypeParameters",
                 // Method that returns TypeParameters
-                "<td class=\"colFirst\"><code><a href=\"../pkg/TypeParameters.html\" "
+                "<td class=\"colFirst\"><code><a href=\"TypeParameters.html\" "
                 + "title=\"type parameter in TypeParameters\">E</a>[]</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg/TypeParameters.html#methodThatReturnsTypeParameterA-E:A-\">"
-                + "methodThatReturnsTypeParameterA</a></span>&#8203;(<a href=\"../pkg/TypeParameters.html\" "
+                + "<a href=\"#methodThatReturnsTypeParameterA-E:A-\">"
+                + "methodThatReturnsTypeParameterA</a></span>&#8203;(<a href=\"TypeParameters.html\" "
                 + "title=\"type parameter in TypeParameters\">E</a>[]&nbsp;e)</code>",
-                "<pre>public&nbsp;<a href=\"../pkg/TypeParameters.html\" "
+                "<pre>public&nbsp;<a href=\"TypeParameters.html\" "
                 + "title=\"type parameter in TypeParameters\">E</a>[]&nbsp;"
-                + "methodThatReturnsTypeParameterA&#8203;(<a href=\"../pkg/TypeParameters.html\" "
+                + "methodThatReturnsTypeParameterA&#8203;(<a href=\"TypeParameters.html\" "
                 + "title=\"type parameter in TypeParameters\">E</a>[]&nbsp;e)</pre>\n",
                 "<td class=\"colFirst\"><code>&lt;T extends java.lang.Object &amp; java.lang.Comparable&lt;? super T&gt;&gt;"
                 + "<br>T</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg/TypeParameters.html#methodtThatReturnsTypeParametersB-java.util.Collection-\">"
+                + "<a href=\"#methodtThatReturnsTypeParametersB-java.util.Collection-\">"
                 + "methodtThatReturnsTypeParametersB</a></span>&#8203;(java.util.Collection&lt;? extends T&gt;&nbsp;coll)</code>",
                 "<div class=\"block\">Returns TypeParameters</div>\n",
                 // Method takes a TypeVariable
                 "<td class=\"colFirst\"><code>&lt;X extends java.lang.Throwable&gt;<br>"
-                + "<a href=\"../pkg/TypeParameters.html\" title=\"type parameter in TypeParameters\">E</a>"
+                + "<a href=\"TypeParameters.html\" title=\"type parameter in TypeParameters\">E</a>"
                 + "</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg/TypeParameters.html#orElseThrow-java.util.function.Supplier-\">"
+                + "<a href=\"#orElseThrow-java.util.function.Supplier-\">"
                 + "orElseThrow</a></span>&#8203;(java.util.function.Supplier&lt;? extends X&gt;&nbsp;exceptionSupplier)</code>"
                 );
 
         checkOutput("pkg/Wildcards.html", true,
                 // Wildcard testing.
-                "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">"
+                "<a href=\"TypeParameters.html\" title=\"class in pkg\">"
                 + "TypeParameters</a>&lt;? super java.lang.String&gt;&nbsp;a",
-                "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">"
+                "<a href=\"TypeParameters.html\" title=\"class in pkg\">"
                 + "TypeParameters</a>&lt;? extends java.lang.StringBuffer&gt;&nbsp;b",
-                "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">"
+                "<a href=\"TypeParameters.html\" title=\"class in pkg\">"
                 + "TypeParameters</a>&nbsp;c");
 
         checkOutput(Output.OUT, true,
@@ -179,7 +179,7 @@
                 "<pre>public class <span class=\"typeNameLabel\">TypeParameterSubClass&lt;T extends "
                 + "java.lang.String&gt;</span>\n"
                 + "extends "
-                + "<a href=\"../pkg/TypeParameterSuperClass.html\" title=\"class in pkg\">"
+                + "<a href=\"TypeParameterSuperClass.html\" title=\"class in pkg\">"
                 + "TypeParameterSuperClass</a>&lt;T&gt;</pre>");
 
         // Interface generic parameter substitution
@@ -187,21 +187,21 @@
         checkOutput("pkg/TypeParameters.html", true,
                 "<dl>\n"
                 + "<dt>All Implemented Interfaces:</dt>\n"
-                + "<dd><code><a href=\"../pkg/SubInterface.html\" title=\"interface in pkg\">"
-                + "SubInterface</a>&lt;E&gt;</code>, <code><a href=\"../pkg/SuperInterface.html\" "
+                + "<dd><code><a href=\"SubInterface.html\" title=\"interface in pkg\">"
+                + "SubInterface</a>&lt;E&gt;</code>, <code><a href=\"SuperInterface.html\" "
                 + "title=\"interface in pkg\">SuperInterface</a>&lt;E&gt;</code></dd>\n"
                 + "</dl>");
 
         checkOutput("pkg/SuperInterface.html", true,
                 "<dl>\n"
                 + "<dt>All Known Subinterfaces:</dt>\n"
-                + "<dd><code><a href=\"../pkg/SubInterface.html\" title=\"interface in pkg\">"
+                + "<dd><code><a href=\"SubInterface.html\" title=\"interface in pkg\">"
                 + "SubInterface</a>&lt;V&gt;</code></dd>\n"
                 + "</dl>");
         checkOutput("pkg/SubInterface.html", true,
                 "<dl>\n"
                 + "<dt>All Superinterfaces:</dt>\n"
-                + "<dd><code><a href=\"../pkg/SuperInterface.html\" title=\"interface in pkg\">"
+                + "<dd><code><a href=\"SuperInterface.html\" title=\"interface in pkg\">"
                 + "SuperInterface</a>&lt;V&gt;</code></dd>\n"
                 + "</dl>");
 
@@ -216,212 +216,212 @@
         //==============================================================
         // ClassUseTest1: <T extends Foo & Foo2>
         checkOutput("pkg2/class-use/Foo.html", true,
-                "<caption><span>Classes in <a href=\"../../pkg2/"
+                "<caption><span>Classes in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">"
+                + "type <a href=\"../Foo.html\" title=\"class in pkg2\">"
                 + "Foo</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
-                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest1.html\" "
+                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest1.html\" "
                 + "title=\"class in pkg2\">ClassUseTest1</a>&lt;T extends "
-                + "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo"
-                + "</a> &amp; <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">"
+                + "<a href=\"../Foo.html\" title=\"class in pkg2\">Foo"
+                + "</a> &amp; <a href=\"../Foo2.html\" title=\"interface in pkg2\">"
                 + "Foo2</a>&gt;</span></code></th>",
-                "<caption><span>Methods in <a href=\"../../pkg2/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/Foo.html\" title=\"class in "
+                + "type <a href=\"../Foo.html\" title=\"class in "
                 + "pkg2\">Foo</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
                 "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest1."
-                + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/"
+                + "</span><code><span class=\"memberNameLink\"><a href=\"../"
                 + "ClassUseTest1.html#method-T-\">method</a></span>"
                 + "&#8203;(T&nbsp;t)</code></th>",
-                "<caption><span>Fields in <a href=\"../../pkg2/"
+                "<caption><span>Fields in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">"
+                + "type <a href=\"../Foo.html\" title=\"class in pkg2\">"
                 + "Foo</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
-                "td class=\"colFirst\"><code><a href=\"../../pkg2/"
+                "td class=\"colFirst\"><code><a href=\"../"
                 + "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>"
-                + "&lt;<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\""
+                + "&lt;<a href=\"../Foo.html\" title=\"class in pkg2\""
                 + ">Foo</a>&gt;</code></td>"
         );
 
         checkOutput("pkg2/class-use/ParamTest.html", true,
-                "<caption><span>Fields in <a href=\"../../pkg2/"
+                "<caption><span>Fields in <a href=\"../"
                 + "package-summary.html\">pkg2</a> declared as <a href=\"../"
-                + "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest"
+                + "ParamTest.html\" title=\"class in pkg2\">ParamTest"
                 + "</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
-                "<td class=\"colFirst\"><code><a href=\"../../pkg2/"
+                "<td class=\"colFirst\"><code><a href=\"../"
                 + "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>&lt;<a "
-                + "href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</a"
+                + "href=\"../Foo.html\" title=\"class in pkg2\">Foo</a"
                 + ">&gt;</code></td>"
         );
 
         checkOutput("pkg2/class-use/Foo2.html", true,
-                "<caption><span>Classes in <a href=\"../../pkg2/"
+                "<caption><span>Classes in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/Foo2.html\" title=\"interface "
+                + "type <a href=\"../Foo2.html\" title=\"interface "
                 + "in pkg2\">Foo2</a></span><span class=\"tabEnd\">&nbsp;"
                 + "</span></caption>",
-                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest1.html\" "
+                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest1.html\" "
                 + "title=\"class in pkg2\">ClassUseTest1</a>&lt;T extends "
-                + "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo"
-                + "</a> &amp; <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">"
+                + "<a href=\"../Foo.html\" title=\"class in pkg2\">Foo"
+                + "</a> &amp; <a href=\"../Foo2.html\" title=\"interface in pkg2\">"
                 + "Foo2</a>&gt;</span></code></th>",
-                "<caption><span>Methods in <a href=\"../../pkg2/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/Foo2.html\" title=\"interface "
+                + "type <a href=\"../Foo2.html\" title=\"interface "
                 + "in pkg2\">Foo2</a></span><span class=\"tabEnd\">&nbsp;"
                 + "</span></caption>",
                 "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">"
-                + "ClassUseTest1.</span><code><span class=\"memberNameLink\"><a href=\"../../"
-                + "pkg2/ClassUseTest1.html#method-T-\">method</a></span>"
+                + "ClassUseTest1.</span><code><span class=\"memberNameLink\"><a href=\"../"
+                + "ClassUseTest1.html#method-T-\">method</a></span>"
                 + "&#8203;(T&nbsp;t)</code></th>"
         );
 
         // ClassUseTest2: <T extends ParamTest<Foo3>>
         checkOutput("pkg2/class-use/ParamTest.html", true,
-                "<caption><span>Classes in <a href=\"../../pkg2/"
+                "<caption><span>Classes in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/ParamTest.html\" title=\"class "
+                + "type <a href=\"../ParamTest.html\" title=\"class "
                 + "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
-                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest2.html\" "
+                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest2.html\" "
                 + "title=\"class in pkg2\">ClassUseTest2</a>&lt;T extends "
-                + "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">"
-                + "ParamTest</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">"
+                + "<a href=\"../ParamTest.html\" title=\"class in pkg2\">"
+                + "ParamTest</a>&lt;<a href=\"../Foo3.html\" title=\"class in pkg2\">"
                 + "Foo3</a>&gt;&gt;</span></code></th>",
-                "<caption><span>Methods in <a href=\"../../pkg2/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/ParamTest.html\" title=\"class "
+                + "type <a href=\"../ParamTest.html\" title=\"class "
                 + "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
                 "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest2."
-                + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/"
+                + "</span><code><span class=\"memberNameLink\"><a href=\"../"
                 + "ClassUseTest2.html#method-T-\">method</a></span>"
                 + "&#8203;(T&nbsp;t)</code></th>",
-                "<caption><span>Fields in <a href=\"../../pkg2/"
+                "<caption><span>Fields in <a href=\"../"
                 + "package-summary.html\">pkg2</a> declared as <a href=\"../"
-                + "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest"
+                + "ParamTest.html\" title=\"class in pkg2\">ParamTest"
                 + "</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
-                "<td class=\"colFirst\"><code><a href=\"../../pkg2/"
+                "<td class=\"colFirst\"><code><a href=\"../"
                 + "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>"
-                + "&lt;<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">"
+                + "&lt;<a href=\"../Foo.html\" title=\"class in pkg2\">"
                 + "Foo</a>&gt;</code></td>",
-                "<caption><span>Methods in <a href=\"../../pkg2/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/ParamTest.html\" title=\"class "
+                + "type <a href=\"../ParamTest.html\" title=\"class "
                 + "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
                 "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../"
-                + "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest"
-                + "</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in "
-                + "pkg2\">Foo3</a>&gt;&gt;<br><a href=\"../../pkg2/"
+                + "ParamTest.html\" title=\"class in pkg2\">ParamTest"
+                + "</a>&lt;<a href=\"../Foo3.html\" title=\"class in "
+                + "pkg2\">Foo3</a>&gt;&gt;<br><a href=\"../"
                 + "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>"
-                + "&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in "
+                + "&lt;<a href=\"../Foo3.html\" title=\"class in "
                 + "pkg2\">Foo3</a>&gt;</code></td>"
         );
 
         checkOutput("pkg2/class-use/Foo3.html", true,
-                "<caption><span>Classes in <a href=\"../../pkg2/"
+                "<caption><span>Classes in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">"
+                + "type <a href=\"../Foo3.html\" title=\"class in pkg2\">"
                 + "Foo3</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
-                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest2.html\" "
+                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest2.html\" "
                 + "title=\"class in pkg2\">ClassUseTest2</a>&lt;T extends "
-                + "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">"
-                + "ParamTest</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">"
+                + "<a href=\"../ParamTest.html\" title=\"class in pkg2\">"
+                + "ParamTest</a>&lt;<a href=\"../Foo3.html\" title=\"class in pkg2\">"
                 + "Foo3</a>&gt;&gt;</span></code></th>",
-                "<caption><span>Methods in <a href=\"../../pkg2/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/Foo3.html\" title=\"class in "
+                + "type <a href=\"../Foo3.html\" title=\"class in "
                 + "pkg2\">Foo3</a></span><span class=\"tabEnd\">&nbsp;"
                 + "</span></caption>",
                 "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest2."
-                + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/"
+                + "</span><code><span class=\"memberNameLink\"><a href=\"../"
                 + "ClassUseTest2.html#method-T-\">method</a></span>"
                 + "&#8203;(T&nbsp;t)</code></th>",
-                "<caption><span>Methods in <a href=\"../../pkg2/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg2</a> that return types with "
-                + "arguments of type <a href=\"../../pkg2/Foo3.html\" title"
+                + "arguments of type <a href=\"../Foo3.html\" title"
                 + "=\"class in pkg2\">Foo3</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
-                "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../../"
-                + "pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</a>&lt;"
-                + "<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3"
-                + "</a>&gt;&gt;<br><a href=\"../../pkg2/ParamTest.html\" "
-                + "title=\"class in pkg2\">ParamTest</a>&lt;<a href=\"../../pkg2/"
+                "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../"
+                + "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>&lt;"
+                + "<a href=\"../Foo3.html\" title=\"class in pkg2\">Foo3"
+                + "</a>&gt;&gt;<br><a href=\"../ParamTest.html\" "
+                + "title=\"class in pkg2\">ParamTest</a>&lt;<a href=\"../"
                 + "Foo3.html\" title=\"class in pkg2\">Foo3</a>&gt;</code></td>"
         );
 
         // ClassUseTest3: <T extends ParamTest2<List<? extends Foo4>>>
         checkOutput("pkg2/class-use/ParamTest2.html", true,
-                "<caption><span>Classes in <a href=\"../../pkg2/"
+                "<caption><span>Classes in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/ParamTest2.html\" title=\"class "
+                + "type <a href=\"../ParamTest2.html\" title=\"class "
                 + "in pkg2\">ParamTest2</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
-                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3.html\" "
+                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3.html\" "
                 + "title=\"class in pkg2\">ClassUseTest3</a>&lt;T extends "
-                + "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">"
+                + "<a href=\"../ParamTest2.html\" title=\"class in pkg2\">"
                 + "ParamTest2</a>&lt;java.util.List&lt;? extends "
-                + "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">"
+                + "<a href=\"../Foo4.html\" title=\"class in pkg2\">"
                 + "Foo4</a>&gt;&gt;&gt;</span></code></th>",
-                "<caption><span>Methods in <a href=\"../../pkg2/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/ParamTest2.html\" title=\"class "
+                + "type <a href=\"../ParamTest2.html\" title=\"class "
                 + "in pkg2\">ParamTest2</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
                 "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest3"
-                + ".</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3."
+                + ".</span><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3."
                 + "html#method-T-\">method</a></span>&#8203;(T&nbsp;t)</code></th>",
                 "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../"
-                + "../pkg2/ParamTest2.html\" title=\"class in pkg2\">"
+                + "ParamTest2.html\" title=\"class in pkg2\">"
                 + "ParamTest2</a>&lt;java.util.List&lt;? extends <a href=\".."
-                + "/../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</a>&gt;"
-                + "&gt;&gt;<br><a href=\"../../pkg2/ParamTest2.html\" "
+                + "/Foo4.html\" title=\"class in pkg2\">Foo4</a>&gt;"
+                + "&gt;&gt;<br><a href=\"../ParamTest2.html\" "
                 + "title=\"class in pkg2\">ParamTest2</a>&lt;java.util.List"
-                + "&lt;? extends <a href=\"../../pkg2/Foo4.html\" title=\""
+                + "&lt;? extends <a href=\"../Foo4.html\" title=\""
                 + "class in pkg2\">Foo4</a>&gt;&gt;</code></td>"
         );
 
         checkOutput("pkg2/class-use/Foo4.html", true,
-                "<caption><span>Classes in <a href=\"../../pkg2/"
+                "<caption><span>Classes in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/Foo4.html\" title=\"class in "
+                + "type <a href=\"../Foo4.html\" title=\"class in "
                 + "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;"
                 + "</span></caption>",
-                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3.html\" "
+                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3.html\" "
                 + "title=\"class in pkg2\">ClassUseTest3</a>&lt;T extends "
-                + "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">"
+                + "<a href=\"../ParamTest2.html\" title=\"class in pkg2\">"
                 + "ParamTest2</a>&lt;java.util.List&lt;? extends "
-                + "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">"
+                + "<a href=\"../Foo4.html\" title=\"class in pkg2\">"
                 + "Foo4</a>&gt;&gt;&gt;</span></code></th>",
-                "<caption><span>Methods in <a href=\"../../pkg2/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type parameters of "
-                + "type <a href=\"../../pkg2/Foo4.html\" title=\"class in "
+                + "type <a href=\"../Foo4.html\" title=\"class in "
                 + "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
                 "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest3."
-                + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3."
+                + "</span><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3."
                 + "html#method-T-\">method</a></span>&#8203;(T&nbsp;t)</code>"
                 + "</th>",
-                "<caption><span>Methods in <a href=\"../../pkg2/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg2</a> that return types with "
-                + "arguments of type <a href=\"../../pkg2/Foo4.html\" "
+                + "arguments of type <a href=\"../Foo4.html\" "
                 + "title=\"class in pkg2\">Foo4</a></span><span class=\""
                 + "tabEnd\">&nbsp;</span></caption>",
                 "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../"
-                + "../pkg2/ParamTest2.html\" title=\"class in pkg2\">"
+                + "ParamTest2.html\" title=\"class in pkg2\">"
                 + "ParamTest2</a>&lt;java.util.List&lt;? extends <a href=\".."
-                + "/../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</a>&gt;"
-                + "&gt;&gt;<br><a href=\"../../pkg2/ParamTest2.html\" "
+                + "/Foo4.html\" title=\"class in pkg2\">Foo4</a>&gt;"
+                + "&gt;&gt;<br><a href=\"../ParamTest2.html\" "
                 + "title=\"class in pkg2\">ParamTest2</a>&lt;java.util.List"
-                + "&lt;? extends <a href=\"../../pkg2/Foo4.html\" title=\""
+                + "&lt;? extends <a href=\"../Foo4.html\" title=\""
                 + "class in pkg2\">Foo4</a>&gt;&gt;</code></td>"
         );
 
         // Type parameters in constructor and method args
         checkOutput("pkg2/class-use/Foo4.html", true,
-                "<caption><span>Method parameters in <a href=\"../../pkg2/"
+                "<caption><span>Method parameters in <a href=\"../"
                 + "package-summary.html\">pkg2</a> with type arguments of "
-                + "type <a href=\"../../pkg2/Foo4.html\" title=\"class in "
+                + "type <a href=\"../Foo4.html\" title=\"class in "
                 + "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;"
                 + "</span></caption>\n"
                 + "<tr>\n"
@@ -433,13 +433,13 @@
                 + "<tr class=\"altColor\">\n"
                 + "<td class=\"colFirst\"><code>void</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest3."
-                + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3."
+                + "</span><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3."
                 + "html#method-java.util.Set-\">method</a></span>&#8203;(java."
-                + "util.Set&lt;<a href=\"../../pkg2/Foo4.html\" title=\""
+                + "util.Set&lt;<a href=\"../Foo4.html\" title=\""
                 + "class in pkg2\">Foo4</a>&gt;&nbsp;p)</code></th>",
-                "<caption><span>Constructor parameters in <a href=\"../../"
-                + "pkg2/package-summary.html\">pkg2</a> with type arguments "
-                + "of type <a href=\"../../pkg2/Foo4.html\" title=\"class in "
+                "<caption><span>Constructor parameters in <a href=\"../"
+                + "package-summary.html\">pkg2</a> with type arguments "
+                + "of type <a href=\"../Foo4.html\" title=\"class in "
                 + "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;"
                 + "</span></caption>"
         );
@@ -478,7 +478,7 @@
                 "(int...&nbsp;i)",
                 "(int[][]...&nbsp;i)",
                 "-int:A...-",
-                "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">"
+                "<a href=\"TypeParameters.html\" title=\"class in pkg\">"
                 + "TypeParameters</a>...&nbsp;t");
     }
 
@@ -520,58 +520,58 @@
     void checkAnnotationTypeUsage() {
         checkOutput("pkg/package-summary.html", true,
                 // PACKAGE
-                "<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>=\"Package Annotation\",\n"
-                + "                <a href=\"../pkg/AnnotationType.html#required--\">required</a>=1994)");
+                "<a href=\"AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"AnnotationType.html#optional--\">optional</a>=\"Package Annotation\",\n"
+                + "                <a href=\"AnnotationType.html#required--\">required</a>=1994)");
 
         checkOutput("pkg/AnnotationTypeUsage.html", true,
                 // CLASS
-                "<pre><a href=\"../pkg/AnnotationType.html\" "
+                "<pre><a href=\"AnnotationType.html\" "
                 + "title=\"annotation in pkg\">@AnnotationType</a>("
-                + "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>"
+                + "<a href=\"AnnotationType.html#optional--\">optional</a>"
                 + "=\"Class Annotation\",\n"
-                + "                <a href=\"../pkg/AnnotationType.html#required--\">"
+                + "                <a href=\"AnnotationType.html#required--\">"
                 + "required</a>=1994)\n"
                 + "public class <span class=\"typeNameLabel\">"
                 + "AnnotationTypeUsage</span>\n"
                 + "extends java.lang.Object</pre>",
                 // FIELD
-                "<pre><a href=\"../pkg/AnnotationType.html\" "
+                "<pre><a href=\"AnnotationType.html\" "
                 + "title=\"annotation in pkg\">@AnnotationType</a>("
-                + "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>"
+                + "<a href=\"AnnotationType.html#optional--\">optional</a>"
                 + "=\"Field Annotation\",\n"
-                + "                <a href=\"../pkg/AnnotationType.html#required--\">"
+                + "                <a href=\"AnnotationType.html#required--\">"
                 + "required</a>=1994)\n"
                 + "public&nbsp;int field</pre>",
                 // CONSTRUCTOR
-                "<pre><a href=\"../pkg/AnnotationType.html\" "
+                "<pre><a href=\"AnnotationType.html\" "
                 + "title=\"annotation in pkg\">@AnnotationType</a>("
-                + "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>"
+                + "<a href=\"AnnotationType.html#optional--\">optional</a>"
                 + "=\"Constructor Annotation\",\n"
-                + "                <a href=\"../pkg/AnnotationType.html#required--\">"
+                + "                <a href=\"AnnotationType.html#required--\">"
                 + "required</a>=1994)\n"
                 + "public&nbsp;AnnotationTypeUsage()</pre>",
                 // METHOD
-                "<pre><a href=\"../pkg/AnnotationType.html\" "
+                "<pre><a href=\"AnnotationType.html\" "
                 + "title=\"annotation in pkg\">@AnnotationType</a>("
-                + "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>"
+                + "<a href=\"AnnotationType.html#optional--\">optional</a>"
                 + "=\"Method Annotation\",\n"
-                + "                <a href=\"../pkg/AnnotationType.html#required--\">"
+                + "                <a href=\"AnnotationType.html#required--\">"
                 + "required</a>=1994)\n"
                 + "public&nbsp;void&nbsp;method()</pre>",
                 // METHOD PARAMS
                 "<pre>public&nbsp;void&nbsp;methodWithParams&#8203;("
-                + "<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">"
-                + "@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">"
+                + "<a href=\"AnnotationType.html\" title=\"annotation in pkg\">"
+                + "@AnnotationType</a>(<a href=\"AnnotationType.html#optional--\">"
                 + "optional</a>=\"Parameter Annotation\",<a "
-                + "href=\"../pkg/AnnotationType.html#required--\">required</a>=1994)\n"
+                + "href=\"AnnotationType.html#required--\">required</a>=1994)\n"
                 + "                             int&nbsp;documented,\n"
                 + "                             int&nbsp;undocmented)</pre>",
                 // CONSTRUCTOR PARAMS
                 "<pre>public&nbsp;AnnotationTypeUsage&#8203;(<a "
-                + "href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">"
-                + "@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">"
+                + "href=\"AnnotationType.html\" title=\"annotation in pkg\">"
+                + "@AnnotationType</a>(<a href=\"AnnotationType.html#optional--\">"
                 + "optional</a>=\"Constructor Param Annotation\",<a "
-                + "href=\"../pkg/AnnotationType.html#required--\">required</a>=1994)\n"
+                + "href=\"AnnotationType.html#required--\">required</a>=1994)\n"
                 + "                           int&nbsp;documented,\n"
                 + "                           int&nbsp;undocmented)</pre>");
 
@@ -580,37 +580,37 @@
         //=================================
         checkOutput("pkg/class-use/AnnotationType.html", true,
                 "<caption><span>Packages with annotations of type <a href=\""
-                + "../../pkg/AnnotationType.html\" title=\"annotation in pkg\">"
+                + "../AnnotationType.html\" title=\"annotation in pkg\">"
                 + "AnnotationType</a></span><span class=\"tabEnd\">&nbsp;"
                 + "</span></caption>",
-                "<caption><span>Classes in <a href=\"../../pkg/"
+                "<caption><span>Classes in <a href=\"../"
                 + "package-summary.html\">pkg</a> with annotations of type "
-                + "<a href=\"../../pkg/AnnotationType.html\" title=\""
+                + "<a href=\"../AnnotationType.html\" title=\""
                 + "annotation in pkg\">AnnotationType</a></span><span class"
                 + "=\"tabEnd\">&nbsp;</span></caption>",
-                "<caption><span>Fields in <a href=\"../../pkg/"
+                "<caption><span>Fields in <a href=\"../"
                 + "package-summary.html\">pkg</a> with annotations of type "
-                + "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation "
+                + "<a href=\"../AnnotationType.html\" title=\"annotation "
                 + "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
-                "<caption><span>Methods in <a href=\"../../pkg/"
+                "<caption><span>Methods in <a href=\"../"
                 + "package-summary.html\">pkg</a> with annotations of type "
-                + "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation "
+                + "<a href=\"../AnnotationType.html\" title=\"annotation "
                 + "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
-                "<caption><span>Method parameters in <a href=\"../../pkg/"
+                "<caption><span>Method parameters in <a href=\"../"
                 + "package-summary.html\">pkg</a> with annotations of type "
-                + "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation "
+                + "<a href=\"../AnnotationType.html\" title=\"annotation "
                 + "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
-                "<caption><span>Constructors in <a href=\"../../pkg/"
+                "<caption><span>Constructors in <a href=\"../"
                 + "package-summary.html\">pkg</a> with annotations of type "
-                + "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation "
+                + "<a href=\"../AnnotationType.html\" title=\"annotation "
                 + "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">"
                 + "&nbsp;</span></caption>",
-                "<caption><span>Constructor parameters in <a href=\"../../"
-                + "pkg/package-summary.html\">pkg</a> with annotations of "
-                + "type <a href=\"../../pkg/AnnotationType.html\" title=\""
+                "<caption><span>Constructor parameters in <a href=\"../"
+                + "package-summary.html\">pkg</a> with annotations of "
+                + "type <a href=\"../AnnotationType.html\" title=\""
                 + "annotation in pkg\">AnnotationType</a></span><span class=\""
                 + "tabEnd\">&nbsp;</span></caption>"
         );
@@ -620,20 +620,20 @@
         //===============================================================
         checkOutput("pkg/AnnotationTypeUsage.html", false,
                 // CLASS
-                "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Class Annotation\",\n"
-                + "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)\n"
+                "<a href=\"AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"AnnotationType.html#optional\">optional</a>=\"Class Annotation\",\n"
+                + "                <a href=\"AnnotationType.html#required\">required</a>=1994)\n"
                 + "public class <span class=\"typeNameLabel\">AnnotationTypeUsage</span></dt><dt>extends java.lang.Object</dt>",
                 // FIELD
-                "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Field Annotation\",\n"
-                + "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)\n"
+                "<a href=\"AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"AnnotationType.html#optional\">optional</a>=\"Field Annotation\",\n"
+                + "                <a href=\"AnnotationType.html#required\">required</a>=1994)\n"
                 + "public int <span class=\"memberNameLabel\">field</span>",
                 // CONSTRUCTOR
-                "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Constructor Annotation\",\n"
-                + "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)\n"
+                "<a href=\"AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"AnnotationType.html#optional\">optional</a>=\"Constructor Annotation\",\n"
+                + "                <a href=\"AnnotationType.html#required\">required</a>=1994)\n"
                 + "public <span class=\"typeNameLabel\">AnnotationTypeUsage</span>()",
                 // METHOD
-                "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Method Annotation\",\n"
-                + "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)\n"
+                "<a href=\"AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"AnnotationType.html#optional\">optional</a>=\"Method Annotation\",\n"
+                + "                <a href=\"AnnotationType.html#required\">required</a>=1994)\n"
                 + "public void <span class=\"memberNameLabel\">method</span>()");
 
         //=================================
@@ -648,31 +648,31 @@
         //=================================
         checkOutput("pkg1/B.html", true,
                 // Integer
-                "<a href=\"../pkg1/A.html#d--\">d</a>=3.14,",
+                "<a href=\"A.html#d--\">d</a>=3.14,",
                 // Double
-                "<a href=\"../pkg1/A.html#d--\">d</a>=3.14,",
+                "<a href=\"A.html#d--\">d</a>=3.14,",
                 // Boolean
-                "<a href=\"../pkg1/A.html#b--\">b</a>=true,",
+                "<a href=\"A.html#b--\">b</a>=true,",
                 // String
-                "<a href=\"../pkg1/A.html#s--\">s</a>=\"sigh\",",
+                "<a href=\"A.html#s--\">s</a>=\"sigh\",",
                 // Class
-                "<a href=\"../pkg1/A.html#c--\">c</a>=<a href=\"../pkg2/Foo.html\" title=\"class in pkg2\">Foo.class</a>,",
+                "<a href=\"A.html#c--\">c</a>=<a href=\"../pkg2/Foo.html\" title=\"class in pkg2\">Foo.class</a>,",
                 // Bounded Class
-                "<a href=\"../pkg1/A.html#w--\">w</a>=<a href=\"../pkg/TypeParameterSubClass.html\" title=\"class in pkg\">TypeParameterSubClass.class</a>,",
+                "<a href=\"A.html#w--\">w</a>=<a href=\"../pkg/TypeParameterSubClass.html\" title=\"class in pkg\">TypeParameterSubClass.class</a>,",
                 // Enum
-                "<a href=\"../pkg1/A.html#e--\">e</a>=<a href=\"../pkg/Coin.html#Penny\">Penny</a>,",
+                "<a href=\"A.html#e--\">e</a>=<a href=\"../pkg/Coin.html#Penny\">Penny</a>,",
                 // Annotation Type
-                "<a href=\"../pkg1/A.html#a--\">a</a>=<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>=\"foo\",<a href=\"../pkg/AnnotationType.html#required--\">required</a>=1994),",
+                "<a href=\"A.html#a--\">a</a>=<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>=\"foo\",<a href=\"../pkg/AnnotationType.html#required--\">required</a>=1994),",
                 // String Array
-                "<a href=\"../pkg1/A.html#sa--\">sa</a>={\"up\",\"down\"},",
+                "<a href=\"A.html#sa--\">sa</a>={\"up\",\"down\"},",
                 // Primitive
-                "<a href=\"../pkg1/A.html#primitiveClassTest--\">primitiveClassTest</a>=boolean.class,");
+                "<a href=\"A.html#primitiveClassTest--\">primitiveClassTest</a>=boolean.class,");
 
         // XXX:  Add array test case after this if fixed:
         //5020899: Incorrect internal representation of class-valued annotation elements
         // Make sure that annotations are surrounded by <pre> and </pre>
         checkOutput("pkg1/B.html", true,
-                "<pre><a href=\"../pkg1/A.html\" title=\"annotation in pkg1\">@A</a>",
+                "<pre><a href=\"A.html\" title=\"annotation in pkg1\">@A</a>",
                 "public interface <span class=\"typeNameLabel\">B</span></pre>");
 
     }
--- a/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -236,10 +236,10 @@
                 + "public int method() {</a>");
 
         checkOutput("linksource/SomeEnum.html", true,
-                "<pre>public static final&nbsp;<a href=\"../linksource/SomeEnum.html\" "
+                "<pre>public static final&nbsp;<a href=\"SomeEnum.html\" "
                 + "title=\"enum in linksource\">SomeEnum</a> <a href="
                 + "\"../src-html/linksource/SomeEnum.html#line.29\">VALUE1</a></pre>",
-                "<pre>public static final&nbsp;<a href=\"../linksource/SomeEnum.html\" "
+                "<pre>public static final&nbsp;<a href=\"SomeEnum.html\" "
                 + "title=\"enum in linksource\">SomeEnum</a> <a href="
                 + "\"../src-html/linksource/SomeEnum.html#line.30\">VALUE2</a></pre>");
 
--- a/test/langtools/jdk/javadoc/doclet/testOrdering/TestOrdering.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testOrdering/TestOrdering.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -135,42 +135,42 @@
             checkClassUseOrdering("pkg1/class-use/UsedClass.html");
 
             tester.checkOrder("pkg1/class-use/UsedClass.html",
-                    "../../pkg1/MethodOrder.html#m--",
-                    "../../pkg1/MethodOrder.html#m-byte:A-",
-                    "../../pkg1/MethodOrder.html#m-double-",
-                    "../../pkg1/MethodOrder.html#m-double-double-",
-                    "../../pkg1/MethodOrder.html#m-double-java.lang.Double-",
-                    "../../pkg1/MethodOrder.html#m-int-",
-                    "../../pkg1/MethodOrder.html#m-int-int-",
-                    "../../pkg1/MethodOrder.html#m-int-java.lang.Integer-",
-                    "../../pkg1/MethodOrder.html#m-long-",
-                    "../../pkg1/MethodOrder.html#m-long-long-",
-                    "../../pkg1/MethodOrder.html#m-long-java.lang.Long-",
-                    "../../pkg1/MethodOrder.html#m-long-java.lang.Long...-",
-                    "../../pkg1/MethodOrder.html#m-java.lang.Double-",
-                    "../../pkg1/MethodOrder.html#m-java.lang.Double-double-",
-                    "../../pkg1/MethodOrder.html#m-java.lang.Double-java.lang.Double-",
-                    "../../pkg1/MethodOrder.html#m-java.lang.Integer-",
-                    "../../pkg1/MethodOrder.html#m-java.lang.Integer-int-",
-                    "../../pkg1/MethodOrder.html#m-java.lang.Integer-java.lang.Integer-",
-                    "../../pkg1/MethodOrder.html#m-java.lang.Object:A-",
-                    "../../pkg1/MethodOrder.html#m-java.util.ArrayList-",
-                    "../../pkg1/MethodOrder.html#m-java.util.Collection-",
-                    "../../pkg1/MethodOrder.html#m-java.util.List-");
+                    "../MethodOrder.html#m--",
+                    "../MethodOrder.html#m-byte:A-",
+                    "../MethodOrder.html#m-double-",
+                    "../MethodOrder.html#m-double-double-",
+                    "../MethodOrder.html#m-double-java.lang.Double-",
+                    "../MethodOrder.html#m-int-",
+                    "../MethodOrder.html#m-int-int-",
+                    "../MethodOrder.html#m-int-java.lang.Integer-",
+                    "../MethodOrder.html#m-long-",
+                    "../MethodOrder.html#m-long-long-",
+                    "../MethodOrder.html#m-long-java.lang.Long-",
+                    "../MethodOrder.html#m-long-java.lang.Long...-",
+                    "../MethodOrder.html#m-java.lang.Double-",
+                    "../MethodOrder.html#m-java.lang.Double-double-",
+                    "../MethodOrder.html#m-java.lang.Double-java.lang.Double-",
+                    "../MethodOrder.html#m-java.lang.Integer-",
+                    "../MethodOrder.html#m-java.lang.Integer-int-",
+                    "../MethodOrder.html#m-java.lang.Integer-java.lang.Integer-",
+                    "../MethodOrder.html#m-java.lang.Object:A-",
+                    "../MethodOrder.html#m-java.util.ArrayList-",
+                    "../MethodOrder.html#m-java.util.Collection-",
+                    "../MethodOrder.html#m-java.util.List-");
 
             tester.checkOrder("pkg1/class-use/UsedClass.html",
-                    "../../pkg1/MethodOrder.html#tpm-pkg1.UsedClass-",
-                    "../../pkg1/MethodOrder.html#tpm-pkg1.UsedClass-pkg1.UsedClass-",
-                    "../../pkg1/MethodOrder.html#tpm-pkg1.UsedClass-pkg1.UsedClass:A-",
-                    "../../pkg1/MethodOrder.html#tpm-pkg1.UsedClass-java.lang.String-");
+                    "../MethodOrder.html#tpm-pkg1.UsedClass-",
+                    "../MethodOrder.html#tpm-pkg1.UsedClass-pkg1.UsedClass-",
+                    "../MethodOrder.html#tpm-pkg1.UsedClass-pkg1.UsedClass:A-",
+                    "../MethodOrder.html#tpm-pkg1.UsedClass-java.lang.String-");
 
             tester.checkOrder("pkg1/class-use/UsedClass.html",
-                    "../../pkg1/A.html#A-pkg1.UsedClass-",
-                    "../../pkg1/B.A.html#A-pkg1.UsedClass-",
-                    "../../pkg1/B.html#B-pkg1.UsedClass-",
-                    "../../pkg1/A.C.html#C-pkg1.UsedClass-java.lang.Object:A-",
-                    "../../pkg1/A.C.html#C-pkg1.UsedClass-java.util.Collection-",
-                    "../../pkg1/A.C.html#C-pkg1.UsedClass-java.util.List-");
+                    "../A.html#A-pkg1.UsedClass-",
+                    "../B.A.html#A-pkg1.UsedClass-",
+                    "../B.html#B-pkg1.UsedClass-",
+                    "../A.C.html#C-pkg1.UsedClass-java.lang.Object:A-",
+                    "../A.C.html#C-pkg1.UsedClass-java.util.Collection-",
+                    "../A.C.html#C-pkg1.UsedClass-java.util.List-");
 
             tester.checkOrder("pkg1/ImplementsOrdering.html",
                     "<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.lang.AutoCloseable</code></dd>",
@@ -211,10 +211,10 @@
         }
 
         void checkClassUseOrdering(String usePage) {
-            checkClassUseOrdering(usePage, "pkg1/C#ITERATION#.html#zfield");
-            checkClassUseOrdering(usePage, "pkg1/C#ITERATION#.html#fieldInC#ITERATION#");
-            checkClassUseOrdering(usePage, "pkg1/C#ITERATION#.html#zmethod-pkg1.UsedClass");
-            checkClassUseOrdering(usePage, "pkg1/C#ITERATION#.html#methodInC#ITERATION#");
+            checkClassUseOrdering(usePage, "C#ITERATION#.html#zfield");
+            checkClassUseOrdering(usePage, "C#ITERATION#.html#fieldInC#ITERATION#");
+            checkClassUseOrdering(usePage, "C#ITERATION#.html#zmethod-pkg1.UsedClass");
+            checkClassUseOrdering(usePage, "C#ITERATION#.html#methodInC#ITERATION#");
         }
 
         void checkClassUseOrdering(String usePage, String searchString) {
@@ -405,8 +405,8 @@
             tester.checkExit(Exit.OK);
             tester.checkOrder("index-all.html", composeTestVectors());
             tester.checkOrder("add0/add/package-tree.html",
-                    "<a href=\"../../add0/add/Add.add.html\" title=\"enum in add0.add\">",
-                    "<a href=\"../../add0/add/Add.ADD.html\" title=\"enum in add0.add\">");
+                    "<a href=\"Add.add.html\" title=\"enum in add0.add\">",
+                    "<a href=\"Add.ADD.html\" title=\"enum in add0.add\">");
             tester.checkOrder("overview-tree.html",
                     "<a href=\"Add.add.html\" title=\"enum in &lt;Unnamed&gt;\">",
                     "<a href=\"add0/Add.add.html\" title=\"enum in add0\">",
@@ -593,10 +593,10 @@
 
             tester.checkOrder("pkg5/AnnoOptionalTest.html",
                     "<h3>Optional Element Summary</h3>",
-                    "<a href=\"../pkg5/AnnoOptionalTest.html#four--\">four</a>",
-                    "<a href=\"../pkg5/AnnoOptionalTest.html#one--\">one</a>",
-                    "<a href=\"../pkg5/AnnoOptionalTest.html#three--\">three</a>",
-                    "<a href=\"../pkg5/AnnoOptionalTest.html#two--\">two</a>",
+                    "<a href=\"#four--\">four</a>",
+                    "<a href=\"#one--\">one</a>",
+                    "<a href=\"#three--\">three</a>",
+                    "<a href=\"#two--\">two</a>",
                     "<h3>Element Detail</h3>",
                     "<h4>one</h4>",
                     "<h4>two</h4>",
@@ -605,10 +605,10 @@
 
             tester.checkOrder("pkg5/AnnoRequiredTest.html",
                     "<h3>Required Element Summary</h3>",
-                    "<a href=\"../pkg5/AnnoRequiredTest.html#four--\">four</a>",
-                    "<a href=\"../pkg5/AnnoRequiredTest.html#one--\">one</a>",
-                    "<a href=\"../pkg5/AnnoRequiredTest.html#three--\">three</a>",
-                    "<a href=\"../pkg5/AnnoRequiredTest.html#two--\">two</a>",
+                    "<a href=\"#four--\">four</a>",
+                    "<a href=\"#one--\">one</a>",
+                    "<a href=\"#three--\">three</a>",
+                    "<a href=\"#two--\">two</a>",
                     "<h3>Element Detail</h3>",
                     "<h4>one</h4>",
                     "<h4>two</h4>",
@@ -617,10 +617,10 @@
 
             tester.checkOrder("pkg5/CtorTest.html",
                     "<h3>Constructor Summary</h3>",
-                    "<a href=\"../pkg5/CtorTest.html#CtorTest-int-\"",
-                    "<a href=\"../pkg5/CtorTest.html#CtorTest-int-int-\"",
-                    "<a href=\"../pkg5/CtorTest.html#CtorTest-int-int-int-\"",
-                    "<a href=\"../pkg5/CtorTest.html#CtorTest-int-int-int-int-\"",
+                    "<a href=\"#CtorTest-int-\"",
+                    "<a href=\"#CtorTest-int-int-\"",
+                    "<a href=\"#CtorTest-int-int-int-\"",
+                    "<a href=\"#CtorTest-int-int-int-int-\"",
                     "<h3>Constructor Detail</h3>",
                     "<a name=\"CtorTest-int-int-int-int-\">",
                     "<a name=\"CtorTest-int-int-int-\">",
@@ -629,10 +629,10 @@
 
             tester.checkOrder("pkg5/EnumTest.html",
                     "<h3>Enum Constant Summary</h3>",
-                    "<a href=\"../pkg5/EnumTest.html#FOUR\">FOUR</a>",
-                    "<a href=\"../pkg5/EnumTest.html#ONE\">ONE</a>",
-                    "<a href=\"../pkg5/EnumTest.html#THREE\">THREE</a>",
-                    "<a href=\"../pkg5/EnumTest.html#TWO\">TWO</a>",
+                    "<a href=\"#FOUR\">FOUR</a>",
+                    "<a href=\"#ONE\">ONE</a>",
+                    "<a href=\"#THREE\">THREE</a>",
+                    "<a href=\"#TWO\">TWO</a>",
                     "<h3>Enum Constant Detail</h3>",
                     "<h4>ONE</h4>",
                     "<h4>TWO</h4>",
@@ -641,10 +641,10 @@
 
             tester.checkOrder("pkg5/FieldTest.html",
                     "<h3>Field Summary</h3>",
-                    "<a href=\"../pkg5/FieldTest.html#four\">four</a>",
-                    "<a href=\"../pkg5/FieldTest.html#one\">one</a>",
-                    "<a href=\"../pkg5/FieldTest.html#three\">three</a>",
-                    "<a href=\"../pkg5/FieldTest.html#two\">two</a>",
+                    "<a href=\"#four\">four</a>",
+                    "<a href=\"#one\">one</a>",
+                    "<a href=\"#three\">three</a>",
+                    "<a href=\"#two\">two</a>",
                     "<h3>Field Detail</h3>",
                     "<h4>one</h4>",
                     "<h4>two</h4>",
@@ -653,10 +653,10 @@
 
             tester.checkOrder("pkg5/IntfTest.html",
                     "<h3>Method Summary</h3>",
-                    "<a href=\"../pkg5/IntfTest.html#four--\">four</a>",
-                    "<a href=\"../pkg5/IntfTest.html#one--\">one</a>",
-                    "<a href=\"../pkg5/IntfTest.html#three--\">three</a>",
-                    "<a href=\"../pkg5/IntfTest.html#two--\">two</a>",
+                    "<a href=\"#four--\">four</a>",
+                    "<a href=\"#one--\">one</a>",
+                    "<a href=\"#three--\">three</a>",
+                    "<a href=\"#two--\">two</a>",
                     "<h3>Method Detail</h3>",
                     "<h4>one</h4>",
                     "<h4>two</h4>",
@@ -665,10 +665,10 @@
 
             tester.checkOrder("pkg5/MethodTest.html",
                     "<h3>Method Summary</h3>",
-                    "<a href=\"../pkg5/MethodTest.html#four--\">four</a>",
-                    "<a href=\"../pkg5/MethodTest.html#one--\">one</a>",
-                    "<a href=\"../pkg5/MethodTest.html#three--\">three</a>",
-                    "<a href=\"../pkg5/MethodTest.html#two--\">two</a>",
+                    "<a href=\"#four--\">four</a>",
+                    "<a href=\"#one--\">one</a>",
+                    "<a href=\"#three--\">three</a>",
+                    "<a href=\"#two--\">two</a>",
                     "<h3>Method Detail</h3>",
                     "<h4>one</h4>",
                     "<h4>two</h4>",
@@ -677,10 +677,10 @@
 
             tester.checkOrder("pkg5/PropertyTest.html",
                     "<h3>Property Summary</h3>",
-                    "<a href=\"../pkg5/PropertyTest.html#fourProperty\">four</a>",
-                    "<a href=\"../pkg5/PropertyTest.html#oneProperty\">one</a>",
-                    "<a href=\"../pkg5/PropertyTest.html#threeProperty\">three</a>",
-                    "<a href=\"../pkg5/PropertyTest.html#twoProperty\">two</a>",
+                    "<a href=\"#fourProperty\">four</a>",
+                    "<a href=\"#oneProperty\">one</a>",
+                    "<a href=\"#threeProperty\">three</a>",
+                    "<a href=\"#twoProperty\">two</a>",
                     "<h3>Property Detail</h3>",
                     "<h4>oneProperty</h4>",
                     "<h4>twoProperty</h4>",
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestMultiInheritance.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestMultiInheritance.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,30 +51,30 @@
 
         checkOutput("pkg3/I1.html", true,
                 "Methods inherited from interface&nbsp;pkg3."
-                + "<a href=\"../pkg3/I2.html\" title=\"interface in pkg3\">"
+                + "<a href=\"I2.html\" title=\"interface in pkg3\">"
                 + "I2</a>",
                 "Methods inherited from interface&nbsp;pkg3."
-                + "<a href=\"../pkg3/I3.html\" title=\"interface in pkg3\">"
+                + "<a href=\"I3.html\" title=\"interface in pkg3\">"
                 + "I3</a>");
 
         checkOutput("pkg3/I0.html", true,
                 "Methods inherited from interface&nbsp;pkg3."
-                + "<a href=\"../pkg3/I2.html\" title=\"interface in pkg3\">"
+                + "<a href=\"I2.html\" title=\"interface in pkg3\">"
                 + "I2</a>",
                 "Methods inherited from interface&nbsp;pkg3."
-                + "<a href=\"../pkg3/I3.html\" title=\"interface in pkg3\">"
+                + "<a href=\"I3.html\" title=\"interface in pkg3\">"
                 + "I3</a>");
 
         // Method foo() is NOT inherited from I4 because it is overriden by I3.
 
         checkOutput("pkg3/I1.html", false,
                 "Methods inherited from interface&nbsp;pkg3."
-                + "<a href=\"../pkg3/I4.html\" title=\"interface in pkg3\">"
+                + "<a href=\"I4.html\" title=\"interface in pkg3\">"
                 + "I4</a>");
 
         checkOutput("pkg3/I0.html", false,
                 "Methods inherited from interface&nbsp;pkg3."
-                + "<a href=\"../pkg3/I4.html\" title=\"interface in pkg3\">"
+                + "<a href=\"I4.html\" title=\"interface in pkg3\">"
                 + "I4</a>");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenMethodDocCopy.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenMethodDocCopy.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@
 
         checkOutput("pkg1/SubClass.html", true,
                 "<span class=\"descfrmTypeLabel\">Description copied from class:&nbsp;<code>"
-                + "<a href=\"../pkg1/BaseClass.html#overridenMethodWithDocsToCopy--\">"
+                + "<a href=\"BaseClass.html#overridenMethodWithDocsToCopy--\">"
                 + "BaseClass</a></code></span>");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethods.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethods.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
         // The public method should be overridden
         checkOutput("pkg1/SubClass.html", true,
                 "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod");
+                + "<dd><code><a href=\"BaseClass.html#publicMethod");
 
         // The public method in different package should be overridden
         checkOutput("pkg2/SubClass.html", true,
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPackageFlag.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPackageFlag.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,9 +51,9 @@
         // The public method should be overridden
         checkOutput("pkg1/SubClass.html", true,
                 "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod--\">"
+                + "<dd><code><a href=\"BaseClass.html#publicMethod--\">"
                 + "publicMethod</a></code>&nbsp;in class&nbsp;<code>"
-                + "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>");
+                + "<a href=\"BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>");
 
         // The public method in different package should be overridden
         checkOutput("pkg2/SubClass.html", true,
@@ -66,14 +66,14 @@
         // package.
         checkOutput("pkg1/SubClass.html", true,
                 "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod--\">"
+                + "<dd><code><a href=\"BaseClass.html#packagePrivateMethod--\">"
                 + "packagePrivateMethod</a></code>&nbsp;in class&nbsp;<code>"
-                + "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>");
+                + "<a href=\"BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>");
 
         // The private method in should not be overridden
         checkOutput("pkg1/SubClass.html", false,
                 "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">");
+                + "<dd><code><a href=\"BaseClass.html#privateMethod()\">");
 
         // The private method in different package should not be overridden
         checkOutput("pkg2/SubClass.html", false,
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPrivateFlag.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPrivateFlag.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,13 +51,13 @@
         // The public method should be overridden
         checkOutput("pkg1/SubClass.html", true,
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
-                 "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod");
+                 "<dd><code><a href=\"BaseClass.html#publicMethod");
 
         // The package private method should be overridden since the base and sub class are in the same
         // package.
         checkOutput("pkg1/SubClass.html", true,
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
-                 "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod");
+                 "<dd><code><a href=\"BaseClass.html#packagePrivateMethod");
 
         // The public method in different package should be overridden
         checkOutput("pkg2/SubClass.html", true,
@@ -67,7 +67,7 @@
         // The private method in should not be overridden
         checkOutput("pkg1/SubClass.html", false,
          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
-                 "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod");
+                 "<dd><code><a href=\"BaseClass.html#privateMethod");
 
         // The private method in different package should not be overridden
         checkOutput("pkg2/SubClass.html", false,
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverrideMethods.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverrideMethods.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -73,94 +73,94 @@
 
         checkOrder("pkg5/Classes.C.html",
                 // Check properties
-                "Properties declared in class&nbsp;pkg5.<a href=\"../pkg5/Classes.P.html",
+                "Properties declared in class&nbsp;pkg5.<a href=\"Classes.P.html",
                 "Classes.P",
-                "../pkg5/Classes.P.html#rateProperty\">rate",
+                "Classes.P.html#rateProperty\">rate",
 
                 // Check nested classes
                 "Nested classes/interfaces declared in class&nbsp;pkg5.",
                 "Classes.P",
-                "./pkg5/Classes.P.PN.html",
+                "Classes.P.PN.html",
                 "Classes.P.PN.html",
                 "type parameter in Classes.P.PN\">K",
                 "type parameter in Classes.P.PN",
                 "V",
 
                 // Check fields
-                "Fields declared in class&nbsp;pkg5.<a href=\"../pkg5/Classes.P.html",
+                "Fields declared in class&nbsp;pkg5.<a href=\"Classes.P.html",
                 "Classes.P",
-                "../pkg5/Classes.P.html#field0\">field0",
+                "Classes.P.html#field0\">field0",
 
                 // Check method summary
                 "Method Summary",
                 "void",
-                "../pkg5/Classes.C.html#m1--\">m1",
+                "#m1--\">m1",
                 "A modified method",
 
                 "void",
-                "../pkg5/Classes.C.html#m4-java.lang.String-java.lang.String-\">m4",
+                "#m4-java.lang.String-java.lang.String-\">m4",
                 "java.lang.String&nbsp;k,",
                 "java.lang.String",
                 "&nbsp;v)",
 
                 // Check footnotes
-                "Methods declared in class&nbsp;pkg5.<a href=\"../pkg5/Classes.GP.html",
+                "Methods declared in class&nbsp;pkg5.<a href=\"Classes.GP.html",
                 "Classes.GP",
-                "../pkg5/Classes.GP.html#m0--\">m0",
+                "Classes.GP.html#m0--\">m0",
 
                 // Check method details for override
                 "overrideSpecifyLabel",
                 "Overrides:",
-                "../pkg5/Classes.GP.html#m7--\">m7",
+                "Classes.GP.html#m7--\">m7",
                 "in class",
-                "../pkg5/Classes.GP.html",
+                "Classes.GP.html",
                 "Classes.GP"
         );
 
         checkOrder("pkg5/Classes.C.html",
                 // Check footnotes 2
                 "Methods declared in class&nbsp;pkg5.",
-                "../pkg5/Classes.P.html#getRate--\">getRate",
-                "../pkg5/Classes.P.html#m2--\">m2",
-                "../pkg5/Classes.P.html#m3--\">m3",
-                "../pkg5/Classes.P.html#m4-K-V-\">m4",
-                "../pkg5/Classes.P.html#rateProperty--\">rateProperty",
-                "../pkg5/Classes.P.html#setRate-double-\">setRate",
+                "Classes.P.html#getRate--\">getRate",
+                "Classes.P.html#m2--\">m2",
+                "Classes.P.html#m3--\">m3",
+                "Classes.P.html#m4-K-V-\">m4",
+                "Classes.P.html#rateProperty--\">rateProperty",
+                "Classes.P.html#setRate-double-\">setRate",
 
                 // Check @link
                 "A test of links to the methods in this class. <p>\n",
-                "../pkg5/Classes.GP.html#m0--",
+                "Classes.GP.html#m0--",
                 "Classes.GP.m0()",
-                "../pkg5/Classes.C.html#m1--",
+                "#m1--",
                 "m1()",
-                "../pkg5/Classes.P.html#m2--",
+                "Classes.P.html#m2--",
                 "Classes.P.m2()",
-                "../pkg5/Classes.P.html#m3--",
+                "Classes.P.html#m3--",
                 "Classes.P.m3()",
                 "m4(java.lang.String,java.lang.String)",
-                "../pkg5/Classes.P.html#m5--",
+                "Classes.P.html#m5--",
                 "Classes.P.m5()",
-                "../pkg5/Classes.C.html#m6--",
+                "#m6--",
                 "m6()",
-                "../pkg5/Classes.C.html#m7--",
+                "#m7--",
                 "m7()",
                 "End of links",
 
                 // Check @see
                 "See Also:",
-                "../pkg5/Classes.GP.html#m0--",
+                "Classes.GP.html#m0--",
                 "Classes.GP.m0()",
-                "../pkg5/Classes.C.html#m1--",
+                "#m1--",
                 "m1()",
-                "../pkg5/Classes.P.html#m2--",
+                "Classes.P.html#m2--",
                 "Classes.P.m2()",
-                "../pkg5/Classes.P.html#m3--",
+                "Classes.P.html#m3--",
                 "Classes.P.m3()",
-                "../pkg5/Classes.C.html#m4-java.lang.String-java.lang.String-",
+                "#m4-java.lang.String-java.lang.String-",
                 "m4(String k, String v)",
-                "../pkg5/Classes.P.html#m5--\"><code>Classes.P.m5()",
-                "../pkg5/Classes.C.html#m6--\"><code>m6()",
-                "../pkg5/Classes.C.html#m7--\"><code>m7()"
+                "Classes.P.html#m5--\"><code>Classes.P.m5()",
+                "#m6--\"><code>m6()",
+                "#m7--\"><code>m7()"
         );
 
         // Tests for interfaces
@@ -172,56 +172,56 @@
 
         checkOrder("pkg5/Interfaces.D.html",
                 "Start of links <p>",
-                "../pkg5/Interfaces.A.html#m0--\"><code>Interfaces.A.m0()",
-                "../pkg5/Interfaces.A.html#m1--\"><code>Interfaces.A.m1()",
-                "../pkg5/Interfaces.A.html#m2--\"><code>Interfaces.A.m2()",
-                "../pkg5/Interfaces.A.html#m3--\"><code>Interfaces.A.m3()",
-                "../pkg5/Interfaces.D.html#m--\"><code>m()",
-                "../pkg5/Interfaces.D.html#n--\"><code>n()",
-                "../pkg5/Interfaces.C.html#o--\"><code>Interfaces.C.o()",
+                "Interfaces.A.html#m0--\"><code>Interfaces.A.m0()",
+                "Interfaces.A.html#m1--\"><code>Interfaces.A.m1()",
+                "Interfaces.A.html#m2--\"><code>Interfaces.A.m2()",
+                "Interfaces.A.html#m3--\"><code>Interfaces.A.m3()",
+                "#m--\"><code>m()",
+                "#n--\"><code>n()",
+                "Interfaces.C.html#o--\"><code>Interfaces.C.o()",
                 "End of links",
 
                 // Check @see links
                 "See Also:",
-                "../pkg5/Interfaces.A.html#m0--\"><code>Interfaces.A.m0()",
-                "../pkg5/Interfaces.A.html#m1--\"><code>Interfaces.A.m1()",
-                "../pkg5/Interfaces.A.html#m2--\"><code>Interfaces.A.m2()",
-                "../pkg5/Interfaces.A.html#m3--\"><code>Interfaces.A.m3()",
-                "../pkg5/Interfaces.D.html#m--\"><code>m()",
-                "../pkg5/Interfaces.D.html#n--\"><code>n()",
-                "../pkg5/Interfaces.C.html#o--\"><code>Interfaces.C.o()",
+                "Interfaces.A.html#m0--\"><code>Interfaces.A.m0()",
+                "Interfaces.A.html#m1--\"><code>Interfaces.A.m1()",
+                "Interfaces.A.html#m2--\"><code>Interfaces.A.m2()",
+                "Interfaces.A.html#m3--\"><code>Interfaces.A.m3()",
+                "#m--\"><code>m()",
+                "#n--\"><code>n()",
+                "Interfaces.C.html#o--\"><code>Interfaces.C.o()",
 
                 // Check properties
-                "Properties declared in interface&nbsp;pkg5.<a href=\"../pkg5/Interfaces.A.html\" "
+                "Properties declared in interface&nbsp;pkg5.<a href=\"Interfaces.A.html\" "
                 + "title=\"interface in pkg5\">Interfaces.A</a>",
 
                 // Check nested classes
                 "Nested classes/interfaces declared in interface&nbsp;pkg5.",
                 "Interfaces.A",
-                "../pkg5/Interfaces.A.AA.html",
+                "Interfaces.A.AA.html",
                 "Interfaces.A.AA",
 
                 // Check Fields
-                "Fields declared in interface&nbsp;pkg5.<a href=\"../pkg5/Interfaces.A.html",
-                "../pkg5/Interfaces.A.html#f",
-                "../pkg5/Interfaces.A.html#QUOTE\">QUOTE",
-                "../pkg5/Interfaces.A.html#rate\">rate",
+                "Fields declared in interface&nbsp;pkg5.<a href=\"Interfaces.A.html",
+                "Interfaces.A.html#f",
+                "Interfaces.A.html#QUOTE\">QUOTE",
+                "Interfaces.A.html#rate\">rate",
 
                 // Check Method Summary
                 "Method Summary",
-                "../pkg5/Interfaces.D.html#m--\">m",
-                "../pkg5/Interfaces.D.html#n--\">n",
+                "#m--\">m",
+                "#n--\">n",
 
                 // Check footnotes
-                "Methods declared in interface&nbsp;pkg5.<a href=\"../pkg5/Interfaces.A.html",
-                "../pkg5/Interfaces.A.html#getRate--\">getRate",
-                "../pkg5/Interfaces.A.html#rateProperty--\">rateProperty",
-                "../pkg5/Interfaces.A.html#setRate-double-",
-                "Methods declared in interface&nbsp;pkg5.<a href=\"../pkg5/Interfaces.B.html",
-                "../pkg5/Interfaces.B.html#m1--\">m1",
-                "../pkg5/Interfaces.B.html#m3--\">m3",
-                "Methods declared in interface&nbsp;pkg5.<a href=\"../pkg5/Interfaces.C.html",
-                "<a href=\"../pkg5/Interfaces.C.html#o--\">o</a>"
+                "Methods declared in interface&nbsp;pkg5.<a href=\"Interfaces.A.html",
+                "Interfaces.A.html#getRate--\">getRate",
+                "Interfaces.A.html#rateProperty--\">rateProperty",
+                "Interfaces.A.html#setRate-double-",
+                "Methods declared in interface&nbsp;pkg5.<a href=\"Interfaces.B.html",
+                "Interfaces.B.html#m1--\">m1",
+                "Interfaces.B.html#m3--\">m3",
+                "Methods declared in interface&nbsp;pkg5.<a href=\"Interfaces.C.html",
+                "<a href=\"Interfaces.C.html#o--\">o</a>"
         );
 
         // Test synthetic values and valuesof of an enum.
--- a/test/langtools/jdk/javadoc/doclet/testPackagePage/TestPackagePage.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testPackagePage/TestPackagePage.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,9 +53,9 @@
 
         // With just one package, all general pages link to the single package page.
         checkOutput("com/pkg/C.html", true,
-            "<a href=\"../../com/pkg/package-summary.html\">Package</a>");
+            "<a href=\"package-summary.html\">Package</a>");
         checkOutput("com/pkg/package-tree.html", true,
-            "<li><a href=\"../../com/pkg/package-summary.html\">Package</a></li>");
+            "<li><a href=\"package-summary.html\">Package</a></li>");
         checkOutput("deprecated-list.html", true,
             "<li><a href=\"com/pkg/package-summary.html\">Package</a></li>");
         checkOutput("index-all.html", true,
--- a/test/langtools/jdk/javadoc/doclet/testPackageSummary/TestPackageSummary.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testPackageSummary/TestPackageSummary.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,23 +49,23 @@
         checkOutput("pkg/package-summary.html", true,
                 "<tbody>\n"
                 + "<tr class=\"altColor\">\n"
-                + "<th class=\"colFirst\" scope=\"row\"><a href=\"../pkg/C0.html\" title=\"class in pkg\">C0</a></th>\n"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"C0.html\" title=\"class in pkg\">C0</a></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "<tr class=\"rowColor\">\n"
-                + "<th class=\"colFirst\" scope=\"row\"><a href=\"../pkg/C1.html\" title=\"class in pkg\">C1</a></th>\n"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"C1.html\" title=\"class in pkg\">C1</a></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "<tr class=\"altColor\">\n"
-                + "<th class=\"colFirst\" scope=\"row\"><a href=\"../pkg/C2.html\" title=\"class in pkg\">C2</a></th>\n"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"C2.html\" title=\"class in pkg\">C2</a></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "<tr class=\"rowColor\">\n"
-                + "<th class=\"colFirst\" scope=\"row\"><a href=\"../pkg/C3.html\" title=\"class in pkg\">C3</a></th>\n"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"C3.html\" title=\"class in pkg\">C3</a></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "<tr class=\"altColor\">\n"
-                + "<th class=\"colFirst\" scope=\"row\"><a href=\"../pkg/C4.html\" title=\"class in pkg\">C4</a></th>\n"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"C4.html\" title=\"class in pkg\">C4</a></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "</tbody>\n"
--- a/test/langtools/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,10 +59,10 @@
 
         checkOutput("pkg/PublicChild.html", true,
                 // Field inheritence from non-public superclass.
-                "<a href=\"../pkg/PublicChild.html#fieldInheritedFromParent\">"
+                "<a href=\"#fieldInheritedFromParent\">"
                 + "fieldInheritedFromParent</a>",
                 // Method inheritance from non-public superclass.
-                "<a href=\"../pkg/PublicChild.html#methodInheritedFromParent-int-\">"
+                "<a href=\"#methodInheritedFromParent-int-\">"
                 + "methodInheritedFromParent</a>",
                 // private class does not show up in tree
                 "<ul class=\"inheritance\">\n"
@@ -77,7 +77,7 @@
                 "<pre>public&nbsp;void&nbsp;methodInheritedFromParent&#8203;(int&nbsp;p1)",
                 "<dl>\n"
                 + "<dt>All Implemented Interfaces:</dt>\n"
-                + "<dd><code><a href=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">"
+                + "<dd><code><a href=\"PublicInterface.html\" title=\"interface in pkg\">"
                 + "PublicInterface</a></code></dd>\n"
                 + "</dl>");
 
@@ -95,27 +95,27 @@
         checkOutput("pkg/PublicChild.html", false,
                 // Should not document comments from private inherited interfaces
                 "<td class=\"colLast\"><code><span class=\"memberNameLink\">" +
-                "<a href=\"../pkg/PublicChild.html#methodInterface-int-\">" +
+                "<a href=\"#methodInterface-int-\">" +
                 "methodInterface</a></span>&#8203;(int&nbsp;p1)</code>\n" +
                 "<div class=\"block\">Comment from interface.</div>\n</td>",
                 // and similarly one more
                 "<td class=\"colLast\"><code><span class=\"memberNameLink\">" +
-                "<a href=\"../pkg/PublicChild.html#methodInterface2-int-\">" +
+                "<a href=\"#methodInterface2-int-\">" +
                 "methodInterface2</a></span>&#8203;(int&nbsp;p1)</code>\n" +
                 "<div class=\"block\">Comment from interface.</div>\n</td>"
         );
 
         checkOutput("pkg/PublicInterface.html", true,
                 // Field inheritance from non-public superinterface.
-                "<a href=\"../pkg/PublicInterface.html#fieldInheritedFromInterface\">"
+                "<a href=\"#fieldInheritedFromInterface\">"
                 + "fieldInheritedFromInterface</a>",
                 // Method inheritance from non-public superinterface.
-                "<a href=\"../pkg/PublicInterface.html#methodInterface-int-\">"
+                "<a href=\"#methodInterface-int-\">"
                 + "methodInterface</a>",
                 //Make sure implemented interfaces from private superclass are inherited
                 "<dl>\n"
                 + "<dt>All Known Implementing Classes:</dt>\n"
-                + "<dd><code><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">"
+                + "<dd><code><a href=\"PublicChild.html\" title=\"class in pkg\">"
                 + "PublicChild</a></code></dd>\n"
                 + "</dl>");
 
@@ -132,7 +132,7 @@
         checkOutput("pkg2/C.html", false,
                 //Do not inherit private interface method with generic parameters.
                 //This method has been implemented.
-                "<span class=\"memberNameLink\"><a href=\"../pkg2/I.html#hello-T-\">hello</a></span>");
+                "<span class=\"memberNameLink\"><a href=\"I.html#hello-T-\">hello</a></span>");
 
         checkOutput("constant-values.html", false,
                 // Make inherited constant are documented correctly.
@@ -150,27 +150,27 @@
         checkOutput("pkg/PublicChild.html", true,
                 // Field inheritence from non-public superclass.
                 "Fields inherited from class&nbsp;pkg."
-                + "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">"
+                + "<a href=\"PrivateParent.html\" title=\"class in pkg\">"
                 + "PrivateParent</a>",
-                "<a href=\"../pkg/PrivateParent.html#fieldInheritedFromParent\">"
+                "<a href=\"PrivateParent.html#fieldInheritedFromParent\">"
                 + "fieldInheritedFromParent</a>",
                 // Method inheritence from non-public superclass.
                 "Methods inherited from class&nbsp;pkg."
-                + "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">"
+                + "<a href=\"PrivateParent.html\" title=\"class in pkg\">"
                 + "PrivateParent</a>",
-                "<a href=\"../pkg/PrivateParent.html#methodInheritedFromParent-int-\">"
+                "<a href=\"PrivateParent.html#methodInheritedFromParent-int-\">"
                 + "methodInheritedFromParent</a>",
                 // Should document that a method overrides method from private class.
                 "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg/PrivateParent.html#methodOverridenFromParent-char:A-int-T-V-java.util.List-\">"
+                + "<dd><code><a href=\"PrivateParent.html#methodOverridenFromParent-char:A-int-T-V-java.util.List-\">"
                 + "methodOverridenFromParent</a></code>&nbsp;in class&nbsp;<code>"
-                + "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">"
+                + "<a href=\"PrivateParent.html\" title=\"class in pkg\">"
                 + "PrivateParent</a></code></dd>",
                 // Should document that a method is specified by private interface.
                 "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg/PrivateInterface.html#methodInterface-int-\">"
+                + "<dd><code><a href=\"PrivateInterface.html#methodInterface-int-\">"
                 + "methodInterface</a></code>&nbsp;in interface&nbsp;<code>"
-                + "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">"
+                + "<a href=\"PrivateInterface.html\" title=\"interface in pkg\">"
                 + "PrivateInterface</a></code></dd>",
                 // Should mention that any documentation was copied.
                 "Description copied from",
@@ -178,9 +178,9 @@
                 "extends",
                 "<dl>\n"
                 + "<dt>All Implemented Interfaces:</dt>\n"
-                + "<dd><code><a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">"
+                + "<dd><code><a href=\"PrivateInterface.html\" title=\"interface in pkg\">"
                 + "PrivateInterface</a></code>, "
-                + "<code><a href=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">"
+                + "<code><a href=\"PublicInterface.html\" title=\"interface in pkg\">"
                 + "PublicInterface</a></code></dd>\n"
                 + "</dl>",
                 "<pre>public class <span class=\"typeNameLabel\">PublicChild</span>");
@@ -188,13 +188,13 @@
         checkOutput("pkg/PublicInterface.html", true,
                 // Field inheritence from non-public superinterface.
                 "Fields inherited from interface&nbsp;pkg."
-                + "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">"
+                + "<a href=\"PrivateInterface.html\" title=\"interface in pkg\">"
                 + "PrivateInterface</a>",
-                "<a href=\"../pkg/PrivateInterface.html#fieldInheritedFromInterface\">"
+                "<a href=\"PrivateInterface.html#fieldInheritedFromInterface\">"
                 + "fieldInheritedFromInterface</a>",
                 // Method inheritance from non-public superinterface.
                 "Methods inherited from interface&nbsp;pkg."
-                + "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">"
+                + "<a href=\"PrivateInterface.html\" title=\"interface in pkg\">"
                 + "PrivateInterface</a>",
                 // Extend documented private classes or interfaces
                 "extends",
@@ -202,14 +202,14 @@
                 //Make sure implemented interfaces from private superclass are inherited
                 "<dl>\n"
                 + "<dt>All Known Implementing Classes:</dt>\n"
-                + "<dd><code><a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">"
+                + "<dd><code><a href=\"PrivateParent.html\" title=\"class in pkg\">"
                 + "PrivateParent</a></code>, "
-                + "<code><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild"
+                + "<code><a href=\"PublicChild.html\" title=\"class in pkg\">PublicChild"
                 + "</a></code></dd>\n"
                 + "</dl>");
 
         checkOutput("pkg/PrivateInterface.html", true,
-                "<a href=\"../pkg/PrivateInterface.html#methodInterface-int-\">"
+                "<a href=\"#methodInterface-int-\">"
                 + "methodInterface</a>"
         );
 
@@ -217,11 +217,11 @@
                 //Since private flag is used, we can document that private interface method
                 //with generic parameters has been implemented.
                 "<span class=\"descfrmTypeLabel\">Description copied from interface:&nbsp;<code>"
-                + "<a href=\"../pkg2/I.html#hello-T-\">I</a></code></span>",
+                + "<a href=\"I.html#hello-T-\">I</a></code></span>",
                 "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg2/I.html#hello-T-\">hello</a></code>"
+                + "<dd><code><a href=\"I.html#hello-T-\">hello</a></code>"
                 + "&nbsp;in interface&nbsp;<code>"
-                + "<a href=\"../pkg2/I.html\" title=\"interface in pkg2\">I</a>"
+                + "<a href=\"I.html\" title=\"interface in pkg2\">I</a>"
                 + "&lt;java.lang.String&gt;</code></dd>");
 
         checkOutput("pkg/PrivateParent.html", true,
--- a/test/langtools/jdk/javadoc/doclet/testProperty/TestProperty.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testProperty/TestProperty.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,62 +47,62 @@
         checkExit(Exit.OK);
 
         checkOutput("pkg/MyClass.html", true,
-                "<pre>public final&nbsp;<a href=\"../pkg/ObjectProperty.html\" "
+                "<pre>public final&nbsp;<a href=\"ObjectProperty.html\" "
                 + "title=\"class in pkg\">ObjectProperty</a>"
-                + "&lt;<a href=\"../pkg/MyObj.html\" "
+                + "&lt;<a href=\"MyObj.html\" "
                 + "title=\"class in pkg\">MyObj</a>&gt; goodProperty</pre>\n"
                 + "<div class=\"block\">This is an Object property where the "
                 + "Object is a single Object.</div>\n"
                 + "<dl>\n"
                 + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg/MyClass.html#getGood--\"><code>getGood()</code></a>, \n"
-                + "<a href=\"../pkg/MyClass.html#setGood-pkg.MyObj-\">"
+                + "<dd><a href=\"#getGood--\"><code>getGood()</code></a>, \n"
+                + "<a href=\"#setGood-pkg.MyObj-\">"
                 + "<code>setGood(MyObj)</code></a></dd>\n"
                 + "</dl>",
 
-                "<pre>public final&nbsp;<a href=\"../pkg/ObjectProperty.html\" "
+                "<pre>public final&nbsp;<a href=\"ObjectProperty.html\" "
                 + "title=\"class in pkg\">ObjectProperty</a>"
-                + "&lt;<a href=\"../pkg/MyObj.html\" "
+                + "&lt;<a href=\"MyObj.html\" "
                 + "title=\"class in pkg\">MyObj</a>[]&gt; badProperty</pre>\n"
                 + "<div class=\"block\">This is an Object property where the "
                 + "Object is an array.</div>\n"
                 + "<dl>\n"
                 + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg/MyClass.html#getBad--\"><code>getBad()</code></a>, \n"
-                + "<a href=\"../pkg/MyClass.html#setBad-pkg.MyObj:A-\">"
+                + "<dd><a href=\"#getBad--\"><code>getBad()</code></a>, \n"
+                + "<a href=\"#setBad-pkg.MyObj:A-\">"
                 + "<code>setBad(MyObj[])</code></a></dd>\n"
                 + "</dl>",
 
                 // id should not be used in the property table
                 "<tr class=\"altColor\">\n"
-                + "<td class=\"colFirst\"><code><a href=\"../pkg/ObjectProperty.html\" "
-                + "title=\"class in pkg\">ObjectProperty</a>&lt;<a href=\"../pkg/MyObj.html\" "
+                + "<td class=\"colFirst\"><code><a href=\"ObjectProperty.html\" "
+                + "title=\"class in pkg\">ObjectProperty</a>&lt;<a href=\"MyObj.html\" "
                 + "title=\"class in pkg\">MyObj</a>[]&gt;</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg/MyClass.html#badProperty\">bad</a></span></code></th>",
+                + "<a href=\"#badProperty\">bad</a></span></code></th>",
 
                 // id should be used in the method table
                 "<tr id=\"i0\" class=\"altColor\">\n"
-                + "<td class=\"colFirst\"><code><a href=\"../pkg/ObjectProperty.html\" "
-                + "title=\"class in pkg\">ObjectProperty</a>&lt;<a href=\"../pkg/MyObj.html\" "
+                + "<td class=\"colFirst\"><code><a href=\"ObjectProperty.html\" "
+                + "title=\"class in pkg\">ObjectProperty</a>&lt;<a href=\"MyObj.html\" "
                 + "title=\"class in pkg\">MyObj</a>[]&gt;</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg/MyClass.html#badProperty--\">badProperty</a></span>()</code></th>"
+                + "<a href=\"#badProperty--\">badProperty</a></span>()</code></th>"
         );
 
         checkOutput("pkg/MyClassT.html", true,
-                "<pre>public final&nbsp;<a href=\"../pkg/ObjectProperty.html\" "
+                "<pre>public final&nbsp;<a href=\"ObjectProperty.html\" "
                 + "title=\"class in pkg\">ObjectProperty</a>"
-                + "&lt;java.util.List&lt;<a href=\"../pkg/MyClassT.html\" "
+                + "&lt;java.util.List&lt;<a href=\"MyClassT.html\" "
                 + "title=\"type parameter in MyClassT\">T</a>&gt;&gt; "
                 + "listProperty</pre>\n"
                 + "<div class=\"block\">This is an Object property where the "
                 + "Object is a single <code>List&lt;T&gt;</code>.</div>\n"
                 + "<dl>\n"
                 + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"../pkg/MyClassT.html#getList--\">"
+                + "<dd><a href=\"#getList--\">"
                 + "<code>getList()</code></a>, \n"
-                + "<a href=\"../pkg/MyClassT.html#setList-java.util.List-\">"
+                + "<a href=\"#setList-java.util.List-\">"
                 + "<code>setList(List)</code></a></dd>\n"
                 + "</dl>"
         );
--- a/test/langtools/jdk/javadoc/doclet/testRelativeLinks/TestRelativeLinks.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testRelativeLinks/TestRelativeLinks.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4460354 8014636 8043186
+ * @bug      4460354 8014636 8043186 8195805
  * @summary  Test to make sure that relative paths are redirected in the
  *           output so that they are not broken.
  * @author   jamieh
@@ -67,7 +67,12 @@
             "<a href=\"./pkg/relative-field-link.html\">relative field link</a>",
             "<a href=\"./pkg/relative-method-link.html\">relative method link</a>",
             "<a href=\"./pkg/relative-package-link.html\">relative package link</a>",
-            " <a href=\"./pkg/relative-multi-line-link.html\">relative-multi-line-link</a>.",
+            " <a href=\"./pkg/relative-multi-line-link.html\">relative-multi-line-link</a>.");
+
+        // This is not a relative path and should not be redirected.
+        checkOutput("index-all.html", true,
+            "<div class=\"block\"><a name=\"masters\"></a>");
+        checkOutput("index-all.html", false,
             "<div class=\"block\"><a name=\"./pkg/masters\"></a>");
 
         // PACKAGE USE
--- a/test/langtools/jdk/javadoc/doclet/testRepeatedAnnotations/TestRepeatedAnnotations.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testRepeatedAnnotations/TestRepeatedAnnotations.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,91 +47,91 @@
         checkExit(Exit.OK);
 
         checkOutput("pkg/C.html", true,
-                "<a href=\"../pkg/ContaineeSynthDoc.html\" "
+                "<a href=\"ContaineeSynthDoc.html\" "
                 + "title=\"annotation in pkg\">@ContaineeSynthDoc</a> "
-                + "<a href=\"../pkg/ContaineeSynthDoc.html\" "
+                + "<a href=\"ContaineeSynthDoc.html\" "
                 + "title=\"annotation in pkg\">@ContaineeSynthDoc</a>",
-                "<a href=\"../pkg/ContaineeRegDoc.html\" "
+                "<a href=\"ContaineeRegDoc.html\" "
                 + "title=\"annotation in pkg\">@ContaineeRegDoc</a> "
-                + "<a href=\"../pkg/ContaineeRegDoc.html\" "
+                + "<a href=\"ContaineeRegDoc.html\" "
                 + "title=\"annotation in pkg\">@ContaineeRegDoc</a>",
-                "<a href=\"../pkg/RegContainerDoc.html\" "
+                "<a href=\"RegContainerDoc.html\" "
                 + "title=\"annotation in pkg\">@RegContainerDoc</a>"
                 + "({"
-                + "<a href=\"../pkg/RegContaineeNotDoc.html\" "
+                + "<a href=\"RegContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg\">@RegContaineeNotDoc</a>,"
-                + "<a href=\"../pkg/RegContaineeNotDoc.html\" "
+                + "<a href=\"RegContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg\">@RegContaineeNotDoc</a>})");
 
         checkOutput("pkg/D.html", true,
-                "<a href=\"../pkg/RegDoc.html\" title=\"annotation in pkg\">@RegDoc</a>"
-                + "(<a href=\"../pkg/RegDoc.html#x--\">x</a>=1)",
-                "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>"
-                + "(<a href=\"../pkg/RegArryDoc.html#y--\">y</a>=1)",
-                "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>"
-                + "(<a href=\"../pkg/RegArryDoc.html#y--\">y</a>={1,2})",
-                "<a href=\"../pkg/NonSynthDocContainer.html\" "
+                "<a href=\"RegDoc.html\" title=\"annotation in pkg\">@RegDoc</a>"
+                + "(<a href=\"RegDoc.html#x--\">x</a>=1)",
+                "<a href=\"RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>"
+                + "(<a href=\"RegArryDoc.html#y--\">y</a>=1)",
+                "<a href=\"RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>"
+                + "(<a href=\"RegArryDoc.html#y--\">y</a>={1,2})",
+                "<a href=\"NonSynthDocContainer.html\" "
                 + "title=\"annotation in pkg\">@NonSynthDocContainer</a>"
                 + "("
-                + "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>"
-                + "(<a href=\"../pkg/RegArryDoc.html#y--\">y</a>=1))");
+                + "<a href=\"RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>"
+                + "(<a href=\"RegArryDoc.html#y--\">y</a>=1))");
 
         checkOutput("pkg1/C.html", true,
-                "<a href=\"../pkg1/RegContainerValDoc.html\" "
+                "<a href=\"RegContainerValDoc.html\" "
                 + "title=\"annotation in pkg1\">@RegContainerValDoc</a>"
-                + "(<a href=\"../pkg1/RegContainerValDoc.html#value--\">value</a>={"
-                + "<a href=\"../pkg1/RegContaineeNotDoc.html\" "
+                + "(<a href=\"RegContainerValDoc.html#value--\">value</a>={"
+                + "<a href=\"RegContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg1\">@RegContaineeNotDoc</a>,"
-                + "<a href=\"../pkg1/RegContaineeNotDoc.html\" "
+                + "<a href=\"RegContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg1\">@RegContaineeNotDoc</a>},"
-                + "<a href=\"../pkg1/RegContainerValDoc.html#y--\">y</a>=3)",
-                "<a href=\"../pkg1/ContainerValDoc.html\" "
+                + "<a href=\"RegContainerValDoc.html#y--\">y</a>=3)",
+                "<a href=\"ContainerValDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContainerValDoc</a>"
-                + "(<a href=\"../pkg1/ContainerValDoc.html#value--\">value</a>={"
-                + "<a href=\"../pkg1/ContaineeNotDoc.html\" "
+                + "(<a href=\"ContainerValDoc.html#value--\">value</a>={"
+                + "<a href=\"ContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContaineeNotDoc</a>,"
-                + "<a href=\"../pkg1/ContaineeNotDoc.html\" "
+                + "<a href=\"ContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContaineeNotDoc</a>},"
-                + "<a href=\"../pkg1/ContainerValDoc.html#x--\">x</a>=1)");
+                + "<a href=\"ContainerValDoc.html#x--\">x</a>=1)");
 
         checkOutput("pkg/C.html", false,
-                "<a href=\"../pkg/RegContaineeDoc.html\" "
+                "<a href=\"RegContaineeDoc.html\" "
                 + "title=\"annotation in pkg\">@RegContaineeDoc</a> "
-                + "<a href=\"../pkg/RegContaineeDoc.html\" "
+                + "<a href=\"RegContaineeDoc.html\" "
                 + "title=\"annotation in pkg\">@RegContaineeDoc</a>",
-                "<a href=\"../pkg/RegContainerNotDoc.html\" "
+                "<a href=\"RegContainerNotDoc.html\" "
                 + "title=\"annotation in pkg\">@RegContainerNotDoc</a>"
-                + "(<a href=\"../pkg/RegContainerNotDoc.html#value--\">value</a>={"
-                + "<a href=\"../pkg/RegContaineeNotDoc.html\" "
+                + "(<a href=\"RegContainerNotDoc.html#value--\">value</a>={"
+                + "<a href=\"RegContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg\">@RegContaineeNotDoc</a>,"
-                + "<a href=\"../pkg/RegContaineeNotDoc.html\" "
+                + "<a href=\"RegContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg\">@RegContaineeNotDoc</a>})");
 
         checkOutput("pkg1/C.html", false,
-                "<a href=\"../pkg1/ContaineeSynthDoc.html\" "
+                "<a href=\"ContaineeSynthDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContaineeSynthDoc</a> "
-                + "<a href=\"../pkg1/ContaineeSynthDoc.html\" "
+                + "<a href=\"ContaineeSynthDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContaineeSynthDoc</a>",
-                "<a href=\"../pkg1/RegContainerValNotDoc.html\" "
+                "<a href=\"RegContainerValNotDoc.html\" "
                 + "title=\"annotation in pkg1\">@RegContainerValNotDoc</a>"
-                + "(<a href=\"../pkg1/RegContainerValNotDoc.html#value--\">value</a>={"
-                + "<a href=\"../pkg1/RegContaineeDoc.html\" "
+                + "(<a href=\"RegContainerValNotDoc.html#value--\">value</a>={"
+                + "<a href=\"RegContaineeDoc.html\" "
                 + "title=\"annotation in pkg1\">@RegContaineeDoc</a>,"
-                + "<a href=\"../pkg1/RegContaineeDoc.html\" "
+                + "<a href=\"RegContaineeDoc.html\" "
                 + "title=\"annotation in pkg1\">@RegContaineeDoc</a>},"
-                + "<a href=\"../pkg1/RegContainerValNotDoc.html#y--\">y</a>=4)",
-                "<a href=\"../pkg1/ContainerValNotDoc.html\" "
+                + "<a href=\"RegContainerValNotDoc.html#y--\">y</a>=4)",
+                "<a href=\"ContainerValNotDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContainerValNotDoc</a>"
-                + "(<a href=\"../pkg1/ContainerValNotDoc.html#value--\">value</a>={"
-                + "<a href=\"../pkg1/ContaineeNotDoc.html\" "
+                + "(<a href=\"ContainerValNotDoc.html#value--\">value</a>={"
+                + "<a href=\"ContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContaineeNotDoc</a>,"
-                + "<a href=\"../pkg1/ContaineeNotDoc.html\" "
+                + "<a href=\"ContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContaineeNotDoc</a>},"
-                + "<a href=\"../pkg1/ContainerValNotDoc.html#x--\">x</a>=2)",
-                "<a href=\"../pkg1/ContainerSynthNotDoc.html\" "
+                + "<a href=\"ContainerValNotDoc.html#x--\">x</a>=2)",
+                "<a href=\"ContainerSynthNotDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContainerSynthNotDoc</a>("
-                + "<a href=\"../pkg1/ContainerSynthNotDoc.html#value--\">value</a>="
-                + "<a href=\"../pkg1/ContaineeSynthDoc.html\" "
+                + "<a href=\"ContainerSynthNotDoc.html#value--\">value</a>="
+                + "<a href=\"ContaineeSynthDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContaineeSynthDoc</a>)");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testSeeTag/TestSeeTag.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testSeeTag/TestSeeTag.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,10 +50,10 @@
             "<code>List</code>",
             "<dl>\n"
             + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-            + "<dd><a href=\"../pkg/Test.InnerOne.html#foo--\"><code>Test.InnerOne.foo()</code></a>, \n"
-            + "<a href=\"../pkg/Test.InnerOne.html#bar-java.lang.Object-\"><code>Test.InnerOne.bar(Object)</code></a>, \n"
+            + "<dd><a href=\"Test.InnerOne.html#foo--\"><code>Test.InnerOne.foo()</code></a>, \n"
+            + "<a href=\"Test.InnerOne.html#bar-java.lang.Object-\"><code>Test.InnerOne.bar(Object)</code></a>, \n"
             + "<a href=\"http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#see\">Javadoc</a>, \n"
-            + "<a href=\"../pkg/Test.InnerOne.html#baz-float-\"><code>something</code></a></dd>\n"
+            + "<a href=\"Test.InnerOne.html#baz-float-\"><code>something</code></a></dd>\n"
             + "</dl>");
 
         checkOutput("pkg/Test.html", false,
--- a/test/langtools/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,7 @@
 
         checkOutput("pkg/C.html", true,
                 "<div class=\"subTitle\"><span class=\"packageLabelInType\">" +
-                "Package</span>&nbsp;<a href=\"../pkg/package-summary.html\">pkg</a></div>");
+                "Package</span>&nbsp;<a href=\"package-summary.html\">pkg</a></div>");
 
         checkOutput("pkg/package-summary.html", false,
             "<p class=\"subTitle\">\n" +
--- a/test/langtools/jdk/javadoc/doclet/testThrowsTag/TestThrowsTag.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testThrowsTag/TestThrowsTag.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,14 +48,14 @@
         checkExit(Exit.OK);
 
         checkOutput("pkg/C.html", true,
-            "<dd><code><a href=\"../pkg/T1.html\" title=\"class in pkg\">T1</a></code> - the first throws tag.</dd>\n" +
-            "<dd><code><a href=\"../pkg/T2.html\" title=\"class in pkg\">T2</a></code> - the second throws tag.</dd>\n" +
-            "<dd><code><a href=\"../pkg/T3.html\" title=\"class in pkg\">T3</a></code> - the third throws tag.</dd>\n" +
-            "<dd><code><a href=\"../pkg/T4.html\" title=\"class in pkg\">T4</a></code> - the fourth throws tag.</dd>\n" +
-            "<dd><code><a href=\"../pkg/T5.html\" title=\"class in pkg\">T5</a></code> - the first inherited throws tag.</dd>\n" +
-            "<dd><code><a href=\"../pkg/T6.html\" title=\"class in pkg\">T6</a></code> - the second inherited throws tag.</dd>\n" +
-            "<dd><code><a href=\"../pkg/T7.html\" title=\"class in pkg\">T7</a></code> - the third inherited throws tag.</dd>\n" +
-            "<dd><code><a href=\"../pkg/T8.html\" title=\"class in pkg\">T8</a></code> - the fourth inherited throws tag.</dd>"
+            "<dd><code><a href=\"T1.html\" title=\"class in pkg\">T1</a></code> - the first throws tag.</dd>\n" +
+            "<dd><code><a href=\"T2.html\" title=\"class in pkg\">T2</a></code> - the second throws tag.</dd>\n" +
+            "<dd><code><a href=\"T3.html\" title=\"class in pkg\">T3</a></code> - the third throws tag.</dd>\n" +
+            "<dd><code><a href=\"T4.html\" title=\"class in pkg\">T4</a></code> - the fourth throws tag.</dd>\n" +
+            "<dd><code><a href=\"T5.html\" title=\"class in pkg\">T5</a></code> - the first inherited throws tag.</dd>\n" +
+            "<dd><code><a href=\"T6.html\" title=\"class in pkg\">T6</a></code> - the second inherited throws tag.</dd>\n" +
+            "<dd><code><a href=\"T7.html\" title=\"class in pkg\">T7</a></code> - the third inherited throws tag.</dd>\n" +
+            "<dd><code><a href=\"T8.html\" title=\"class in pkg\">T8</a></code> - the fourth inherited throws tag.</dd>"
         );
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testTitleInHref/TestTitleInHref.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testTitleInHref/TestTitleInHref.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,9 +50,9 @@
 
         checkOutput("pkg/Links.html", true,
                 //Test to make sure that the title shows up in a class link.
-                "<a href=\"../pkg/Class.html\" title=\"class in pkg\">",
+                "<a href=\"Class.html\" title=\"class in pkg\">",
                 //Test to make sure that the title shows up in an interface link.
-                "<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">",
+                "<a href=\"Interface.html\" title=\"interface in pkg\">",
                 //Test to make sure that the title shows up in cross link shows up
                 "<a href=\"" + uri + "/java/io/File.html?is-external=true\" "
                 + "title=\"class or interface in java.io\" class=\"externalLink\">"
--- a/test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,675 +49,675 @@
 
         // Test for type annotations on Class Extends (ClassExtends.java).
         checkOutput("typeannos/MyClass.html", true,
-                "extends <a href=\"../typeannos/ClassExtA.html\" title=\"annotation "
-                + "in typeannos\">@ClassExtA</a> <a href=\"../typeannos/ParameterizedClass.html\" "
+                "extends <a href=\"ClassExtA.html\" title=\"annotation "
+                + "in typeannos\">@ClassExtA</a> <a href=\"ParameterizedClass.html\" "
                 + "title=\"class in typeannos\">ParameterizedClass</a>&lt;<a href=\""
-                + "../typeannos/ClassExtB.html\" title=\"annotation in typeannos\">"
+                + "ClassExtB.html\" title=\"annotation in typeannos\">"
                 + "@ClassExtB</a> java.lang.String&gt;",
 
-                "implements <a href=\"../typeannos/ClassExtB.html\" title=\""
+                "implements <a href=\"ClassExtB.html\" title=\""
                 + "annotation in typeannos\">@ClassExtB</a> java.lang.CharSequence, "
-                + "<a href=\"../typeannos/ClassExtA.html\" title=\"annotation in "
-                + "typeannos\">@ClassExtA</a> <a href=\"../typeannos/ParameterizedInterface.html\" "
+                + "<a href=\"ClassExtA.html\" title=\"annotation in "
+                + "typeannos\">@ClassExtA</a> <a href=\"ParameterizedInterface.html\" "
                 + "title=\"interface in typeannos\">ParameterizedInterface</a>&lt;"
-                + "<a href=\"../typeannos/ClassExtB.html\" title=\"annotation in "
+                + "<a href=\"ClassExtB.html\" title=\"annotation in "
                 + "typeannos\">@ClassExtB</a> java.lang.String&gt;</pre>");
 
         checkOutput("typeannos/MyInterface.html", true,
-                "extends <a href=\"../typeannos/ClassExtA.html\" title=\"annotation "
-                + "in typeannos\">@ClassExtA</a> <a href=\"../typeannos/"
+                "extends <a href=\"ClassExtA.html\" title=\"annotation "
+                + "in typeannos\">@ClassExtA</a> <a href=\""
                 + "ParameterizedInterface.html\" title=\"interface in typeannos\">"
-                + "ParameterizedInterface</a>&lt;<a href=\"../typeannos/ClassExtA.html\" "
+                + "ParameterizedInterface</a>&lt;<a href=\"ClassExtA.html\" "
                 + "title=\"annotation in typeannos\">@ClassExtA</a> java.lang.String&gt;, "
-                + "<a href=\"../typeannos/ClassExtB.html\" title=\"annotation in "
+                + "<a href=\"ClassExtB.html\" title=\"annotation in "
                 + "typeannos\">@ClassExtB</a> java.lang.CharSequence</pre>");
 
         // Test for type annotations on Class Parameters (ClassParameters.java).
         checkOutput("typeannos/ExtendsBound.html", true,
                 "class <span class=\"typeNameLabel\">ExtendsBound&lt;K extends <a "
-                + "href=\"../typeannos/ClassParamA.html\" title=\"annotation in "
+                + "href=\"ClassParamA.html\" title=\"annotation in "
                 + "typeannos\">@ClassParamA</a> java.lang.String&gt;</span>");
 
         checkOutput("typeannos/ExtendsGeneric.html", true,
                 "<pre>class <span class=\"typeNameLabel\">ExtendsGeneric&lt;K extends "
-                + "<a href=\"../typeannos/ClassParamA.html\" title=\"annotation in "
-                + "typeannos\">@ClassParamA</a> <a href=\"../typeannos/Unannotated.html\" "
+                + "<a href=\"ClassParamA.html\" title=\"annotation in "
+                + "typeannos\">@ClassParamA</a> <a href=\"Unannotated.html\" "
                 + "title=\"class in typeannos\">Unannotated</a>&lt;<a href=\""
-                + "../typeannos/ClassParamB.html\" title=\"annotation in typeannos\">"
+                + "ClassParamB.html\" title=\"annotation in typeannos\">"
                 + "@ClassParamB</a> java.lang.String&gt;&gt;</span>");
 
         checkOutput("typeannos/TwoBounds.html", true,
                 "<pre>class <span class=\"typeNameLabel\">TwoBounds&lt;K extends <a href=\""
-                + "../typeannos/ClassParamA.html\" title=\"annotation in typeannos\">"
-                + "@ClassParamA</a> java.lang.String,V extends <a href=\"../typeannos/"
+                + "ClassParamA.html\" title=\"annotation in typeannos\">"
+                + "@ClassParamA</a> java.lang.String,V extends <a href=\""
                 + "ClassParamB.html\" title=\"annotation in typeannos\">@ClassParamB"
                 + "</a> java.lang.String&gt;</span>");
 
         checkOutput("typeannos/Complex1.html", true,
-                "class <span class=\"typeNameLabel\">Complex1&lt;K extends <a href=\"../"
-                + "typeannos/ClassParamA.html\" title=\"annotation in typeannos\">"
+                "class <span class=\"typeNameLabel\">Complex1&lt;K extends <a href=\""
+                + "ClassParamA.html\" title=\"annotation in typeannos\">"
                 + "@ClassParamA</a> java.lang.String &amp; java.lang.Runnable&gt;</span>");
 
         checkOutput("typeannos/Complex2.html", true,
                 "class <span class=\"typeNameLabel\">Complex2&lt;K extends java.lang."
-                + "String &amp; <a href=\"../typeannos/ClassParamB.html\" title=\""
+                + "String &amp; <a href=\"ClassParamB.html\" title=\""
                 + "annotation in typeannos\">@ClassParamB</a> java.lang.Runnable&gt;</span>");
 
         checkOutput("typeannos/ComplexBoth.html", true,
                 "class <span class=\"typeNameLabel\">ComplexBoth&lt;K extends <a href=\""
-                + "../typeannos/ClassParamA.html\" title=\"annotation in typeannos\""
-                + ">@ClassParamA</a> java.lang.String &amp; <a href=\"../typeannos/"
+                + "ClassParamA.html\" title=\"annotation in typeannos\""
+                + ">@ClassParamA</a> java.lang.String &amp; <a href=\""
                 + "ClassParamA.html\" title=\"annotation in typeannos\">@ClassParamA"
                 + "</a> java.lang.Runnable&gt;</span>");
 
         // Test for type annotations on fields (Fields.java).
         checkOutput("typeannos/DefaultScope.html", true,
-                "<pre><a href=\"../typeannos/Parameterized.html\" title=\"class in "
-                + "typeannos\">Parameterized</a>&lt;<a href=\"../typeannos/FldA.html\" "
+                "<pre><a href=\"Parameterized.html\" title=\"class in "
+                + "typeannos\">Parameterized</a>&lt;<a href=\"FldA.html\" "
                 + "title=\"annotation in typeannos\">@FldA</a> java.lang.String,<a "
-                + "href=\"../typeannos/FldB.html\" title=\"annotation in typeannos\">"
+                + "href=\"FldB.html\" title=\"annotation in typeannos\">"
                 + "@FldB</a> java.lang.String&gt; bothTypeArgs</pre>",
 
-                "<pre><a href=\"../typeannos/FldA.html\" title=\"annotation in "
-                + "typeannos\">@FldA</a> java.lang.String <a href=\"../typeannos/"
+                "<pre><a href=\"FldA.html\" title=\"annotation in "
+                + "typeannos\">@FldA</a> java.lang.String <a href=\""
                 + "FldB.html\" title=\"annotation in typeannos\">@FldB</a> [] "
                 + "array1Deep</pre>",
 
-                "<pre>java.lang.String <a href=\"../typeannos/FldB.html\" "
+                "<pre>java.lang.String <a href=\"FldB.html\" "
                 + "title=\"annotation in typeannos\">@FldB</a> [][] array2SecondOld</pre>",
 
                 // When JDK-8068737, we should change the order
-                "<pre><a href=\"../typeannos/FldD.html\" title=\"annotation in typeannos\">"
+                "<pre><a href=\"FldD.html\" title=\"annotation in typeannos\">"
                 + "@FldD</a> java.lang.String "
-                + "<a href=\"../typeannos/FldC.html\" title=\"annotation in typeannos\">@FldC</a> "
-                + "<a href=\"../typeannos/FldB.html\" title=\"annotation in typeannos\">@FldB</a> [] "
-                + "<a href=\"../typeannos/FldC.html\" title=\"annotation in typeannos\">@FldC</a> "
-                + "<a href=\"../typeannos/FldA.html\" title=\"annotation in typeannos\">@FldA</a> [] "
+                + "<a href=\"FldC.html\" title=\"annotation in typeannos\">@FldC</a> "
+                + "<a href=\"FldB.html\" title=\"annotation in typeannos\">@FldB</a> [] "
+                + "<a href=\"FldC.html\" title=\"annotation in typeannos\">@FldC</a> "
+                + "<a href=\"FldA.html\" title=\"annotation in typeannos\">@FldA</a> [] "
                 + "array2Deep</pre>");
 
         checkOutput("typeannos/ModifiedScoped.html", true,
-                "<pre>public final&nbsp;<a href=\"../typeannos/Parameterized.html\" "
-                + "title=\"class in typeannos\">Parameterized</a>&lt;<a href=\"../"
-                + "typeannos/FldA.html\" title=\"annotation in typeannos\">@FldA</a> "
-                + "<a href=\"../typeannos/Parameterized.html\" title=\"class in "
-                + "typeannos\">Parameterized</a>&lt;<a href=\"../typeannos/FldA.html\" "
+                "<pre>public final&nbsp;<a href=\"Parameterized.html\" "
+                + "title=\"class in typeannos\">Parameterized</a>&lt;<a href=\""
+                + "FldA.html\" title=\"annotation in typeannos\">@FldA</a> "
+                + "<a href=\"Parameterized.html\" title=\"class in "
+                + "typeannos\">Parameterized</a>&lt;<a href=\"FldA.html\" "
                 + "title=\"annotation in typeannos\">@FldA</a> java.lang.String,<a "
-                + "href=\"../typeannos/FldB.html\" title=\"annotation in typeannos\">"
-                + "@FldB</a> java.lang.String&gt;,<a href=\"../typeannos/FldB.html\" "
+                + "href=\"FldB.html\" title=\"annotation in typeannos\">"
+                + "@FldB</a> java.lang.String&gt;,<a href=\"FldB.html\" "
                 + "title=\"annotation in typeannos\">@FldB</a> java.lang.String&gt; "
                 + "nestedParameterized</pre>",
 
-                "<pre>public final&nbsp;<a href=\"../typeannos/FldA.html\" "
+                "<pre>public final&nbsp;<a href=\"FldA.html\" "
                 + "title=\"annotation in typeannos\">@FldA</a> java.lang.String[][] "
                 + "array2</pre>");
 
         // Test for type annotations on method return types (MethodReturnType.java).
         checkOutput("typeannos/MtdDefaultScope.html", true,
-                "<pre>public&nbsp;&lt;T&gt;&nbsp;<a href=\"../typeannos/MRtnA.html\" "
+                "<pre>public&nbsp;&lt;T&gt;&nbsp;<a href=\"MRtnA.html\" "
                 + "title=\"annotation in typeannos\">@MRtnA</a> java.lang.String"
                 + "&nbsp;method()</pre>",
 
                 // When JDK-8068737 is fixed, we should change the order
-                "<pre><a href=\"../typeannos/MRtnA.html\" title=\"annotation in typeannos\">"
+                "<pre><a href=\"MRtnA.html\" title=\"annotation in typeannos\">"
                 + "@MRtnA</a> java.lang.String "
-                + "<a href=\"../typeannos/MRtnB.html\" title=\"annotation in typeannos\">@MRtnB</a> [] "
-                + "<a href=\"../typeannos/MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> []"
+                + "<a href=\"MRtnB.html\" title=\"annotation in typeannos\">@MRtnB</a> [] "
+                + "<a href=\"MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> []"
                 + "&nbsp;array2Deep()</pre>",
 
-                "<pre><a href=\"../typeannos/MRtnA.html\" title=\"annotation in "
+                "<pre><a href=\"MRtnA.html\" title=\"annotation in "
                 + "typeannos\">@MRtnA</a> java.lang.String[][]&nbsp;array2()</pre>");
 
         checkOutput("typeannos/MtdModifiedScoped.html", true,
-                "<pre>public final&nbsp;<a href=\"../typeannos/MtdParameterized.html\" "
-                + "title=\"class in typeannos\">MtdParameterized</a>&lt;<a href=\"../"
-                + "typeannos/MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> "
-                + "<a href=\"../typeannos/MtdParameterized.html\" title=\"class in "
-                + "typeannos\">MtdParameterized</a>&lt;<a href=\"../typeannos/MRtnA."
+                "<pre>public final&nbsp;<a href=\"MtdParameterized.html\" "
+                + "title=\"class in typeannos\">MtdParameterized</a>&lt;<a href=\""
+                + "MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> "
+                + "<a href=\"MtdParameterized.html\" title=\"class in "
+                + "typeannos\">MtdParameterized</a>&lt;<a href=\"MRtnA."
                 + "html\" title=\"annotation in typeannos\">@MRtnA</a> java.lang."
-                + "String,<a href=\"../typeannos/MRtnB.html\" title=\"annotation in "
-                + "typeannos\">@MRtnB</a> java.lang.String&gt;,<a href=\"../typeannos/"
+                + "String,<a href=\"MRtnB.html\" title=\"annotation in "
+                + "typeannos\">@MRtnB</a> java.lang.String&gt;,<a href=\""
                 + "MRtnB.html\" title=\"annotation in typeannos\">@MRtnB</a> java."
                 + "lang.String&gt;&nbsp;nestedMtdParameterized()</pre>");
 
         // Test for type annotations on method type parameters (MethodTypeParameters.java).
         checkOutput("typeannos/UnscopedUnmodified.html", true,
-                "<pre>&lt;K extends <a href=\"../typeannos/MTyParamA.html\" title=\""
+                "<pre>&lt;K extends <a href=\"MTyParamA.html\" title=\""
                 + "annotation in typeannos\">@MTyParamA</a> java.lang.String&gt;"
                 + "&nbsp;void&nbsp;methodExtends()</pre>",
 
-                "<pre>&lt;K extends <a href=\"../typeannos/MTyParamA.html\" title=\""
-                + "annotation in typeannos\">@MTyParamA</a> <a href=\"../typeannos/"
+                "<pre>&lt;K extends <a href=\"MTyParamA.html\" title=\""
+                + "annotation in typeannos\">@MTyParamA</a> <a href=\""
                 + "MtdTyParameterized.html\" title=\"class in typeannos\">"
-                + "MtdTyParameterized</a>&lt;<a href=\"../typeannos/MTyParamB.html\" "
+                + "MtdTyParameterized</a>&lt;<a href=\"MTyParamB.html\" "
                 + "title=\"annotation in typeannos\">@MTyParamB</a> java.lang.String"
                 + "&gt;&gt;&nbsp;void&nbsp;nestedExtends()</pre>");
 
         checkOutput("typeannos/PublicModifiedMethods.html", true,
-                "<pre>public final&nbsp;&lt;K extends <a href=\"../typeannos/"
+                "<pre>public final&nbsp;&lt;K extends <a href=\""
                 + "MTyParamA.html\" title=\"annotation in typeannos\">@MTyParamA</a> "
                 + "java.lang.String&gt;&nbsp;void&nbsp;methodExtends()</pre>",
 
-                "<pre>public final&nbsp;&lt;K extends <a href=\"../typeannos/"
+                "<pre>public final&nbsp;&lt;K extends <a href=\""
                 + "MTyParamA.html\" title=\"annotation in typeannos\">@MTyParamA</a> "
-                + "java.lang.String,V extends <a href=\"../typeannos/MTyParamA.html\" "
-                + "title=\"annotation in typeannos\">@MTyParamA</a> <a href=\"../"
-                + "typeannos/MtdTyParameterized.html\" title=\"class in typeannos\">"
-                + "MtdTyParameterized</a>&lt;<a href=\"../typeannos/MTyParamB.html\" "
+                + "java.lang.String,V extends <a href=\"MTyParamA.html\" "
+                + "title=\"annotation in typeannos\">@MTyParamA</a> <a href=\""
+                + "MtdTyParameterized.html\" title=\"class in typeannos\">"
+                + "MtdTyParameterized</a>&lt;<a href=\"MTyParamB.html\" "
                 + "title=\"annotation in typeannos\">@MTyParamB</a> java.lang.String"
                 + "&gt;&gt;&nbsp;void&nbsp;dual()</pre>");
 
         // Test for type annotations on parameters (Parameters.java).
         checkOutput("typeannos/Parameters.html", true,
-                "<pre>void&nbsp;unannotated&#8203;(<a href=\"../typeannos/"
+                "<pre>void&nbsp;unannotated&#8203;(<a href=\""
                 + "ParaParameterized.html\" title=\"class in typeannos\">"
                 + "ParaParameterized</a>&lt;java.lang.String,java.lang.String&gt;"
                 + "&nbsp;a)</pre>",
 
-                "<pre>void&nbsp;nestedParaParameterized&#8203;(<a href=\"../typeannos/"
+                "<pre>void&nbsp;nestedParaParameterized&#8203;(<a href=\""
+                + "ParaParameterized.html\" title=\"class in typeannos\">"
+                + "ParaParameterized</a>&lt;<a href=\"ParamA.html\" "
+                + "title=\"annotation in typeannos\">@ParamA</a> <a href=\""
                 + "ParaParameterized.html\" title=\"class in typeannos\">"
-                + "ParaParameterized</a>&lt;<a href=\"../typeannos/ParamA.html\" "
-                + "title=\"annotation in typeannos\">@ParamA</a> <a href=\"../"
-                + "typeannos/ParaParameterized.html\" title=\"class in typeannos\">"
-                + "ParaParameterized</a>&lt;<a href=\"../typeannos/ParamA.html\" "
+                + "ParaParameterized</a>&lt;<a href=\"ParamA.html\" "
                 + "title=\"annotation in typeannos\">@ParamA</a> java.lang.String,"
-                + "<a href=\"../typeannos/ParamB.html\" title=\"annotation in "
-                + "typeannos\">@ParamB</a> java.lang.String&gt;,<a href=\"../"
-                + "typeannos/ParamB.html\" title=\"annotation in typeannos\">@ParamB"
+                + "<a href=\"ParamB.html\" title=\"annotation in "
+                + "typeannos\">@ParamB</a> java.lang.String&gt;,<a href=\""
+                + "ParamB.html\" title=\"annotation in typeannos\">@ParamB"
                 + "</a> java.lang.String&gt;&nbsp;a)</pre>",
 
                 // When JDK-8068737 is fixed, we should change the order
-                "<pre>void&nbsp;array2Deep&#8203;(<a href=\"../typeannos/ParamA.html\" "
+                "<pre>void&nbsp;array2Deep&#8203;(<a href=\"ParamA.html\" "
                 + "title=\"annotation in typeannos\">@ParamA</a> java.lang.String "
-                + "<a href=\"../typeannos/ParamB.html\" title=\"annotation in typeannos\">"
+                + "<a href=\"ParamB.html\" title=\"annotation in typeannos\">"
                 + "@ParamB</a> [] "
-                + "<a href=\"../typeannos/ParamA.html\" title=\"annotation in typeannos\">"
+                + "<a href=\"ParamA.html\" title=\"annotation in typeannos\">"
                 + "@ParamA</a> []"
                 + "&nbsp;a)</pre>");
 
         // Test for type annotations on throws (Throws.java).
         checkOutput("typeannos/ThrDefaultUnmodified.html", true,
                 "<pre>void&nbsp;oneException()\n"
-                + "           throws <a href=\"../typeannos/ThrA.html\" title=\""
+                + "           throws <a href=\"ThrA.html\" title=\""
                 + "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>",
 
                 "<pre>void&nbsp;twoExceptions()\n"
-                + "            throws <a href=\"../typeannos/ThrA.html\" title=\""
+                + "            throws <a href=\"ThrA.html\" title=\""
                 + "annotation in typeannos\">@ThrA</a> java.lang.RuntimeException,\n"
-                + "                   <a href=\"../typeannos/ThrA.html\" title=\""
+                + "                   <a href=\"ThrA.html\" title=\""
                 + "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>");
 
         checkOutput("typeannos/ThrPublicModified.html", true,
                 "<pre>public final&nbsp;void&nbsp;oneException&#8203;(java.lang.String&nbsp;a)\n"
-                + "                        throws <a href=\"../typeannos/ThrA.html\" "
+                + "                        throws <a href=\"ThrA.html\" "
                 + "title=\"annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>",
 
                 "<pre>public final&nbsp;void&nbsp;twoExceptions&#8203;(java.lang.String&nbsp;a)\n"
-                + "                         throws <a href=\"../typeannos/ThrA.html\" "
+                + "                         throws <a href=\"ThrA.html\" "
                 + "title=\"annotation in typeannos\">@ThrA</a> java.lang.RuntimeException,\n"
-                + "                                <a href=\"../typeannos/ThrA.html\" "
+                + "                                <a href=\"ThrA.html\" "
                 + "title=\"annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>");
 
         checkOutput("typeannos/ThrWithValue.html", true,
                 "<pre>void&nbsp;oneException()\n"
-                + "           throws <a href=\"../typeannos/ThrB.html\" title=\""
+                + "           throws <a href=\"ThrB.html\" title=\""
                 + "annotation in typeannos\">@ThrB</a>("
                 + "\"m\") java.lang.Exception</pre>",
 
                 "<pre>void&nbsp;twoExceptions()\n"
-                + "            throws <a href=\"../typeannos/ThrB.html\" title=\""
+                + "            throws <a href=\"ThrB.html\" title=\""
                 + "annotation in typeannos\">@ThrB</a>("
                 + "\"m\") java.lang.RuntimeException,\n"
-                + "                   <a href=\"../typeannos/ThrA.html\" title=\""
+                + "                   <a href=\"ThrA.html\" title=\""
                 + "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>");
 
         // Test for type annotations on type parameters (TypeParameters.java).
         checkOutput("typeannos/TestMethods.html", true,
-                "<pre>&lt;K,<a href=\"../typeannos/TyParaA.html\" title=\"annotation in typeannos\">"
-                + "@TyParaA</a> V extends <a href=\"../typeannos/TyParaA.html\" "
+                "<pre>&lt;K,<a href=\"TyParaA.html\" title=\"annotation in typeannos\">"
+                + "@TyParaA</a> V extends <a href=\"TyParaA.html\" "
                 + "title=\"annotation in typeannos\">@TyParaA</a> "
                 + "java.lang.String&gt;&nbsp;void&nbsp;secondAnnotated()</pre>"
         );
 
         // Test for type annotations on wildcard type (Wildcards.java).
         checkOutput("typeannos/BoundTest.html", true,
-                "<pre>void&nbsp;wcExtends&#8203;(<a href=\"../typeannos/MyList.html\" "
+                "<pre>void&nbsp;wcExtends&#8203;(<a href=\"MyList.html\" "
                 + "title=\"class in typeannos\">MyList</a>&lt;? extends <a href=\""
-                + "../typeannos/WldA.html\" title=\"annotation in typeannos\">@WldA"
+                + "WldA.html\" title=\"annotation in typeannos\">@WldA"
                 + "</a> java.lang.String&gt;&nbsp;l)</pre>",
 
-                "<pre><a href=\"../typeannos/MyList.html\" title=\"class in "
-                + "typeannos\">MyList</a>&lt;? super <a href=\"../typeannos/WldA.html\" "
+                "<pre><a href=\"MyList.html\" title=\"class in "
+                + "typeannos\">MyList</a>&lt;? super <a href=\"WldA.html\" "
                 + "title=\"annotation in typeannos\">@WldA</a> java.lang.String&gt;"
                 + "&nbsp;returnWcSuper()</pre>");
 
         checkOutput("typeannos/BoundWithValue.html", true,
-                "<pre>void&nbsp;wcSuper&#8203;(<a href=\"../typeannos/MyList.html\" title=\""
-                + "class in typeannos\">MyList</a>&lt;? super <a href=\"../typeannos/"
+                "<pre>void&nbsp;wcSuper&#8203;(<a href=\"MyList.html\" title=\""
+                + "class in typeannos\">MyList</a>&lt;? super <a href=\""
                 + "WldB.html\" title=\"annotation in typeannos\">@WldB</a>("
                 + "\"m\") java.lang."
                 + "String&gt;&nbsp;l)</pre>",
 
-                "<pre><a href=\"../typeannos/MyList.html\" title=\"class in "
-                + "typeannos\">MyList</a>&lt;? extends <a href=\"../typeannos/WldB."
+                "<pre><a href=\"MyList.html\" title=\"class in "
+                + "typeannos\">MyList</a>&lt;? extends <a href=\"WldB."
                 + "html\" title=\"annotation in typeannos\">@WldB</a>("
                 + "\"m\") java.lang.String"
                 + "&gt;&nbsp;returnWcExtends()</pre>");
 
         // Test for receiver annotations (Receivers.java).
         checkOutput("typeannos/DefaultUnmodified.html", true,
-                "<pre>void&nbsp;withException&#8203;(<a href=\"../typeannos/RcvrA.html\" "
+                "<pre>void&nbsp;withException&#8203;(<a href=\"RcvrA.html\" "
                 + "title=\"annotation in typeannos\">@RcvrA</a>&nbsp;"
                 + "DefaultUnmodified&nbsp;this)\n"
                 + "            throws java."
                 + "lang.Exception</pre>",
 
-                "<pre>java.lang.String&nbsp;nonVoid&#8203;(<a href=\"../typeannos/RcvrA."
-                + "html\" title=\"annotation in typeannos\">@RcvrA</a> <a href=\"../"
-                + "typeannos/RcvrB.html\" title=\"annotation in typeannos\">@RcvrB"
+                "<pre>java.lang.String&nbsp;nonVoid&#8203;(<a href=\"RcvrA."
+                + "html\" title=\"annotation in typeannos\">@RcvrA</a> <a href=\""
+                + "RcvrB.html\" title=\"annotation in typeannos\">@RcvrB"
                 + "</a>(\"m\")"
                 + "&nbsp;DefaultUnmodified&nbsp;this)</pre>",
 
                 "<pre>&lt;T extends java.lang.Runnable&gt;&nbsp;void&nbsp;accept&#8203;("
-                + "<a href=\"../typeannos/RcvrA.html\" title=\"annotation in "
+                + "<a href=\"RcvrA.html\" title=\"annotation in "
                 + "typeannos\">@RcvrA</a>&nbsp;DefaultUnmodified&nbsp;this,\n"
                 + "                                           T&nbsp;r)\n"
                 + "                                    throws java.lang.Exception</pre>");
 
         checkOutput("typeannos/PublicModified.html", true,
                 "<pre>public final&nbsp;java.lang.String&nbsp;nonVoid&#8203;(<a href=\""
-                + "../typeannos/RcvrA.html\" title=\"annotation in typeannos\">"
+                + "RcvrA.html\" title=\"annotation in typeannos\">"
                 + "@RcvrA</a>&nbsp;PublicModified&nbsp;this)</pre>",
 
                 "<pre>public final&nbsp;&lt;T extends java.lang.Runnable&gt;&nbsp;"
-                + "void&nbsp;accept&#8203;(<a href=\"../typeannos/RcvrA.html\" title=\""
+                + "void&nbsp;accept&#8203;(<a href=\"RcvrA.html\" title=\""
                 + "annotation in typeannos\">@RcvrA</a>&nbsp;PublicModified&nbsp;this,\n"
                 + "                                                        T&nbsp;r)\n"
                 + "                                                 throws java.lang.Exception</pre>");
 
         checkOutput("typeannos/WithValue.html", true,
                 "<pre>&lt;T extends java.lang.Runnable&gt;&nbsp;void&nbsp;accept&#8203;("
-                + "<a href=\"../typeannos/RcvrB.html\" title=\"annotation in "
+                + "<a href=\"RcvrB.html\" title=\"annotation in "
                 + "typeannos\">@RcvrB</a>("
                 + "\"m\")&nbsp;WithValue&nbsp;this,\n"
                 + "                                           T&nbsp;r)\n"
                 + "                                    throws java.lang.Exception</pre>");
 
         checkOutput("typeannos/WithFinal.html", true,
-                "<pre>java.lang.String&nbsp;nonVoid&#8203;(<a href=\"../typeannos/RcvrB.html\" "
+                "<pre>java.lang.String&nbsp;nonVoid&#8203;(<a href=\"RcvrB.html\" "
                 + "title=\"annotation in typeannos\">@RcvrB</a>(\"m\") "
-                + "<a href=\"../typeannos/WithFinal.html\" title=\"class in typeannos\">"
+                + "<a href=\"WithFinal.html\" title=\"class in typeannos\">"
                 + "WithFinal</a>&nbsp;afield)</pre>");
 
         checkOutput("typeannos/WithBody.html", true,
-                "<pre>void&nbsp;field&#8203;(<a href=\"../typeannos/RcvrA.html\" title=\""
+                "<pre>void&nbsp;field&#8203;(<a href=\"RcvrA.html\" title=\""
                 + "annotation in typeannos\">@RcvrA</a>&nbsp;WithBody&nbsp;this)</pre>");
 
         checkOutput("typeannos/Generic2.html", true,
-                "<pre>void&nbsp;test2&#8203;(<a href=\"../typeannos/RcvrA.html\" title=\""
+                "<pre>void&nbsp;test2&#8203;(<a href=\"RcvrA.html\" title=\""
                 + "annotation in typeannos\">@RcvrA</a>&nbsp;Generic2&lt;X&gt;&nbsp;this)</pre>");
 
 
         // Test for repeated type annotations (RepeatedAnnotations.java).
         checkOutput("typeannos/RepeatingAtClassLevel.html", true,
-                "<pre><a href=\"../typeannos/RepTypeA.html\" title=\"annotation in "
-                + "typeannos\">@RepTypeA</a> <a href=\"../typeannos/RepTypeA.html\" "
+                "<pre><a href=\"RepTypeA.html\" title=\"annotation in "
+                + "typeannos\">@RepTypeA</a> <a href=\"RepTypeA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeA</a>\n<a href="
-                + "\"../typeannos/RepTypeB.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeB</a> <a href=\"../typeannos/RepTypeB.html\" title="
+                + "\"RepTypeB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeB</a> <a href=\"RepTypeB.html\" title="
                 + "\"annotation in typeannos\">@RepTypeB</a>\nclass <span class="
                 + "\"typeNameLabel\">RepeatingAtClassLevel</span>\nextends "
                 + "java.lang.Object</pre>");
 
 // @ignore 8146008
 //        checkOutput("typeannos/RepeatingAtClassLevel2.html", true,
-//                "<pre><a href=\"../typeannos/RepTypeUseA.html\" title=\"annotation "
-//                + "in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html"
+//                "<pre><a href=\"RepTypeUseA.html\" title=\"annotation "
+//                + "in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseA.html"
 //                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a>\n<a href="
-//                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos"
-//                + "\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+//                + "\"RepTypeUseB.html\" title=\"annotation in typeannos"
+//                + "\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" "
 //                + "title=\"annotation in typeannos\">@RepTypeUseB</a>\nclass <span "
 //                + "class=\"typeNameLabel\">RepeatingAtClassLevel2</span>\nextends "
 //                + "java.lang.Object</pre>");
 //
 //        checkOutput("typeannos/RepeatingAtClassLevel2.html", true,
-//                "<pre><a href=\"../typeannos/RepAllContextsA.html\" title=\"annotation"
-//                + " in typeannos\">@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html"
+//                "<pre><a href=\"RepAllContextsA.html\" title=\"annotation"
+//                + " in typeannos\">@RepAllContextsA</a> <a href=\"RepAllContextsA.html"
 //                + "\" title=\"annotation in typeannos\">@RepAllContextsA</a>\n<a href="
-//                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos"
-//                + "\">@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html"
+//                + "\"RepAllContextsB.html\" title=\"annotation in typeannos"
+//                + "\">@RepAllContextsB</a> <a href=\"RepAllContextsB.html"
 //                + "\" title=\"annotation in typeannos\">@RepAllContextsB</a>\n"
 //                + "class <span class=\"typeNameLabel\">RepeatingAtClassLevel3</span>\n"
 //                + "extends java.lang.Object</pre>");
 
         checkOutput("typeannos/RepeatingOnConstructor.html", true,
-                "<pre><a href=\"../typeannos/RepConstructorA.html\" title=\"annotation "
-                + "in typeannos\">@RepConstructorA</a> <a href=\"../typeannos/RepConstructorA.html"
+                "<pre><a href=\"RepConstructorA.html\" title=\"annotation "
+                + "in typeannos\">@RepConstructorA</a> <a href=\"RepConstructorA.html"
                 + "\" title=\"annotation in typeannos\">@RepConstructorA</a>\n<a href="
-                + "\"../typeannos/RepConstructorB.html\" title=\"annotation in typeannos"
-                + "\">@RepConstructorB</a> <a href=\"../typeannos/RepConstructorB.html"
+                + "\"RepConstructorB.html\" title=\"annotation in typeannos"
+                + "\">@RepConstructorB</a> <a href=\"RepConstructorB.html"
                 + "\" title=\"annotation in typeannos\">@RepConstructorB</a>\n"
                 + "RepeatingOnConstructor()</pre>",
 
-                "<pre><a href=\"../typeannos/RepConstructorA.html\" title=\"annotation in typeannos"
-                + "\">@RepConstructorA</a> <a href=\"../typeannos/RepConstructorA.html"
+                "<pre><a href=\"RepConstructorA.html\" title=\"annotation in typeannos"
+                + "\">@RepConstructorA</a> <a href=\"RepConstructorA.html"
                 + "\" title=\"annotation in typeannos\">@RepConstructorA</a>\n<a href="
-                + "\"../typeannos/RepConstructorB.html\" title=\"annotation in typeannos"
-                + "\">@RepConstructorB</a> <a href=\"../typeannos/RepConstructorB.html"
+                + "\"RepConstructorB.html\" title=\"annotation in typeannos"
+                + "\">@RepConstructorB</a> <a href=\"RepConstructorB.html"
                 + "\" title=\"annotation in typeannos\">@RepConstructorB</a>\n"
                 + "RepeatingOnConstructor&#8203;(int&nbsp;i,\n                       int&nbsp;j)</pre>",
 
-                "<pre><a href=\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos"
-                + "\">@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html"
+                "<pre><a href=\"RepAllContextsA.html\" title=\"annotation in typeannos"
+                + "\">@RepAllContextsA</a> <a href=\"RepAllContextsA.html"
                 + "\" title=\"annotation in typeannos\">@RepAllContextsA</a>\n"
-                + "<a href=\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos"
-                + "\">@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html"
+                + "<a href=\"RepAllContextsB.html\" title=\"annotation in typeannos"
+                + "\">@RepAllContextsB</a> <a href=\"RepAllContextsB.html"
                 + "\" title=\"annotation in typeannos\">@RepAllContextsB</a>\n"
                 + "RepeatingOnConstructor&#8203;(int&nbsp;i,\n                       int&nbsp;j,\n"
                 + "                       int&nbsp;k)</pre>",
 
-                "<pre>RepeatingOnConstructor&#8203;(<a href=\"../typeannos/RepParameterA.html"
+                "<pre>RepeatingOnConstructor&#8203;(<a href=\"RepParameterA.html"
                 + "\" title=\"annotation in typeannos\">@RepParameterA</a> <a href="
-                + "\"../typeannos/RepParameterA.html\" title=\"annotation in typeannos"
-                + "\">@RepParameterA</a> <a href=\"../typeannos/RepParameterB.html"
+                + "\"RepParameterA.html\" title=\"annotation in typeannos"
+                + "\">@RepParameterA</a> <a href=\"RepParameterB.html"
                 + "\" title=\"annotation in typeannos\">@RepParameterB</a> "
-                + "<a href=\"../typeannos/RepParameterB.html\" title=\"annotation in typeannos"
+                + "<a href=\"RepParameterB.html\" title=\"annotation in typeannos"
                 + "\">@RepParameterB</a>\n                       java.lang.String&nbsp;parameter,\n"
-                + "                       <a href=\"../typeannos/RepParameterA.html\" "
+                + "                       <a href=\"RepParameterA.html\" "
                 + "title=\"annotation in typeannos\">@RepParameterA</a> <a href="
-                + "\"../typeannos/RepParameterA.html\" title=\"annotation in typeannos\">"
-                + "@RepParameterA</a> <a href=\"../typeannos/RepParameterB.html\" "
+                + "\"RepParameterA.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterA</a> <a href=\"RepParameterB.html\" "
                 + "title=\"annotation in typeannos\">@RepParameterB</a> <a href="
-                + "\"../typeannos/RepParameterB.html\" title=\"annotation in typeannos\">"
+                + "\"RepParameterB.html\" title=\"annotation in typeannos\">"
                 + "@RepParameterB</a>\n                       java.lang.String "
-                + "<a href=\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" "
+                + "<a href=\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">@RepTypeUseB</a> "
-                + "<a href=\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">@RepTypeUseB</a> "
+                + "<a href=\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseB</a> ...&nbsp;vararg)</pre>"
         );
 
         checkOutput("typeannos/RepeatingOnConstructor.Inner.html", true,
-                "<code><span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnConstructor.Inner.html"
+                "<code><span class=\"memberNameLink\"><a href=\""
                 + "#Inner-java.lang.String-java.lang.String...-\">Inner</a></span>"
                 + "&#8203;(java.lang.String&nbsp;parameter,\n     java.lang.String <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseB</a> ...&nbsp;vararg)</code>",
 
-                "Inner&#8203;(<a href=\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
+                "Inner&#8203;(<a href=\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseB</a>&nbsp;RepeatingOnConstructor&nbsp;this,\n      <a href="
-                + "\"../typeannos/RepParameterA.html\" title=\"annotation in typeannos\">"
-                + "@RepParameterA</a> <a href=\"../typeannos/RepParameterA.html\" title="
-                + "\"annotation in typeannos\">@RepParameterA</a> <a href=\"../typeannos/RepParameterB.html"
+                + "\"RepParameterA.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterA</a> <a href=\"RepParameterA.html\" title="
+                + "\"annotation in typeannos\">@RepParameterA</a> <a href=\"RepParameterB.html"
                 + "\" title=\"annotation in typeannos\">@RepParameterB</a> <a href="
-                + "\"../typeannos/RepParameterB.html\" title=\"annotation in typeannos\">"
+                + "\"RepParameterB.html\" title=\"annotation in typeannos\">"
                 + "@RepParameterB</a>\n      java.lang.String&nbsp;parameter,\n"
-                + "      <a href=\"../typeannos/RepParameterA.html\" title=\"annotation in typeannos\">"
-                + "@RepParameterA</a> <a href=\"../typeannos/RepParameterA.html\" title="
-                + "\"annotation in typeannos\">@RepParameterA</a> <a href=\"../typeannos/RepParameterB.html"
+                + "      <a href=\"RepParameterA.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterA</a> <a href=\"RepParameterA.html\" title="
+                + "\"annotation in typeannos\">@RepParameterA</a> <a href=\"RepParameterB.html"
                 + "\" title=\"annotation in typeannos\">@RepParameterB</a> <a href="
-                + "\"../typeannos/RepParameterB.html\" title=\"annotation in typeannos\">"
-                + "@RepParameterB</a>\n      java.lang.String <a href=\"../typeannos/RepTypeUseA.html"
+                + "\"RepParameterB.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterB</a>\n      java.lang.String <a href=\"RepTypeUseA.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> ...&nbsp;vararg)");
 
         checkOutput("typeannos/RepeatingOnField.html", true,
                 "<code>(package private) java.lang.Integer</code></td>\n<th class=\"colSecond\" scope=\"row\">"
-                + "<code><span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnField.html#i1"
+                + "<code><span class=\"memberNameLink\"><a href=\"#i1"
                 + "\">i1</a></span></code>",
 
-                "<code>(package private) <a href=\"../typeannos/RepTypeUseA.html\" "
+                "<code>(package private) <a href=\"RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href=\""
-                + "../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> java.lang.Integer</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href="
-                + "\"../typeannos/RepeatingOnField.html#i2\">i2</a></span></code>",
+                + "\"#i2\">i2</a></span></code>",
 
-                "<code>(package private) <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" "
+                "<code>(package private) <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" title="
                 + "\"annotation in typeannos\">@RepTypeUseB</a> java.lang.Integer</code>"
                 + "</td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../typeannos/RepeatingOnField.html#i3\">i3</a></span></code>",
+                + "<a href=\"#i3\">i3</a></span></code>",
 
-                "<code>(package private) <a href=\"../typeannos/RepAllContextsA.html\" title=\""
-                + "annotation in typeannos\">@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html"
+                "<code>(package private) <a href=\"RepAllContextsA.html\" title=\""
+                + "annotation in typeannos\">@RepAllContextsA</a> <a href=\"RepAllContextsA.html"
                 + "\" title=\"annotation in typeannos\">@RepAllContextsA</a> <a href="
-                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html\" title="
+                + "\"RepAllContextsB.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsB</a> <a href=\"RepAllContextsB.html\" title="
                 + "\"annotation in typeannos\">@RepAllContextsB</a> java.lang.Integer</code>"
                 + "</td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../typeannos/RepeatingOnField.html#i4\">i4</a></span></code>",
+                + "<a href=\"#i4\">i4</a></span></code>",
 
-                "<code>(package private) java.lang.String <a href=\"../typeannos/RepTypeUseA.html"
+                "<code>(package private) java.lang.String <a href=\"RepTypeUseA.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> [] <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseB</a> []</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class="
-                + "\"memberNameLink\"><a href=\"../typeannos/RepeatingOnField.html#sa"
+                + "\"memberNameLink\"><a href=\"#sa"
                 + "\">sa</a></span></code>",
 
-                "<pre><a href=\"../typeannos/RepFieldA.html\" title=\"annotation in typeannos\">"
-                + "@RepFieldA</a> <a href=\"../typeannos/RepFieldA.html\" title="
-                + "\"annotation in typeannos\">@RepFieldA</a>\n<a href=\"../typeannos/RepFieldB.html"
+                "<pre><a href=\"RepFieldA.html\" title=\"annotation in typeannos\">"
+                + "@RepFieldA</a> <a href=\"RepFieldA.html\" title="
+                + "\"annotation in typeannos\">@RepFieldA</a>\n<a href=\"RepFieldB.html"
                 + "\" title=\"annotation in typeannos\">@RepFieldB</a> <a href="
-                + "\"../typeannos/RepFieldB.html\" title=\"annotation in typeannos\">"
+                + "\"RepFieldB.html\" title=\"annotation in typeannos\">"
                 + "@RepFieldB</a>\njava.lang.Integer i1</pre>",
 
-                "<pre><a href=\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos"
-                + "\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html"
+                "<pre><a href=\"RepTypeUseA.html\" title=\"annotation in typeannos"
+                + "\">@RepTypeUseA</a> <a href=\"RepTypeUseA.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> "
-                + "<a href=\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "<a href=\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" title="
                 + "\"annotation in typeannos\">@RepTypeUseB</a> java.lang.Integer i2</pre>",
 
-                "<pre><a href=\"../typeannos/RepFieldA.html\" title=\"annotation in typeannos\">"
-                + "@RepFieldA</a> <a href=\"../typeannos/RepFieldA.html\" title="
-                + "\"annotation in typeannos\">@RepFieldA</a>\n<a href=\"../typeannos/RepFieldB.html"
+                "<pre><a href=\"RepFieldA.html\" title=\"annotation in typeannos\">"
+                + "@RepFieldA</a> <a href=\"RepFieldA.html\" title="
+                + "\"annotation in typeannos\">@RepFieldA</a>\n<a href=\"RepFieldB.html"
                 + "\" title=\"annotation in typeannos\">@RepFieldB</a> <a href="
-                + "\"../typeannos/RepFieldB.html\" title=\"annotation in typeannos\">"
-                + "@RepFieldB</a>\n<a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html"
+                + "\"RepFieldB.html\" title=\"annotation in typeannos\">"
+                + "@RepFieldB</a>\n<a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseA.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" title="
                 + "\"annotation in typeannos\">@RepTypeUseB</a> java.lang.Integer i3</pre>",
 
-                "<pre><a href=\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html"
+                "<pre><a href=\"RepAllContextsA.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsA</a> <a href=\"RepAllContextsA.html"
                 + "\" title=\"annotation in typeannos\">@RepAllContextsA</a>\n<a href="
-                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html"
+                + "\"RepAllContextsB.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsB</a> <a href=\"RepAllContextsB.html"
                 + "\" title=\"annotation in typeannos\">@RepAllContextsB</a>\n"
-                + "<a href=\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html\" "
+                + "<a href=\"RepAllContextsA.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsA</a> <a href=\"RepAllContextsA.html\" "
                 + "title=\"annotation in typeannos\">@RepAllContextsA</a> <a href="
-                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html"
+                + "\"RepAllContextsB.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsB</a> <a href=\"RepAllContextsB.html"
                 + "\" title=\"annotation in typeannos\">@RepAllContextsB</a> java.lang.Integer i4</pre>",
 
-                "<pre>java.lang.String <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html"
+                "<pre>java.lang.String <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseA.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" title="
                 + "\"annotation in typeannos\">@RepTypeUseB</a> [] <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseB</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseB</a> [] sa</pre>");
 
         checkOutput("typeannos/RepeatingOnMethod.html", true,
                 "<code>(package private) java.lang.String</code></td>\n<th class=\"colSecond\" scope=\"row\">"
                 + "<code><span class=\"memberNameLink\"><a href="
-                + "\"../typeannos/RepeatingOnMethod.html#test1--\">test1</a></span>()</code>",
+                + "\"#test1--\">test1</a></span>()</code>",
 
-                "<code>(package private) <a href=\"../typeannos/RepTypeUseA.html\" "
+                "<code>(package private) <a href=\"RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String</code>"
                 + "</td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../typeannos/RepeatingOnMethod.html#test2--\">test2</a>"
+                + "<a href=\"#test2--\">test2</a>"
                 + "</span>()</code>",
 
-                "<code>(package private) <a href=\"../typeannos/RepTypeUseA.html\" "
+                "<code>(package private) <a href=\"RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String</code>"
                 + "</td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../typeannos/RepeatingOnMethod.html#test3--\">test3</a>"
+                + "<a href=\"#test3--\">test3</a>"
                 + "</span>()</code>",
 
-                "<code>(package private) <a href=\"../typeannos/RepAllContextsA.html\" "
+                "<code>(package private) <a href=\"RepAllContextsA.html\" "
                 + "title=\"annotation in typeannos\">@RepAllContextsA</a> <a href="
-                + "\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsB.html\" "
+                + "\"RepAllContextsA.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsA</a> <a href=\"RepAllContextsB.html\" "
                 + "title=\"annotation in typeannos\">@RepAllContextsB</a> <a href="
-                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
+                + "\"RepAllContextsB.html\" title=\"annotation in typeannos\">"
                 + "@RepAllContextsB</a> java.lang.String</code></td>\n<th class=\"colSecond\" scope=\"row\">"
-                + "<code><span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnMethod.html"
+                + "<code><span class=\"memberNameLink\"><a href=\""
                 + "#test4--\">test4</a></span>()</code>",
 
-                "<code><span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnMethod.html"
+                "<code><span class=\"memberNameLink\"><a href=\""
                 + "#test5-java.lang.String-java.lang.String...-\">test5</a></span>"
                 + "&#8203;(java.lang.String&nbsp;parameter,\n     java.lang.String <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseB</a> ...&nbsp;vararg)</code>",
 
-                "<a href=\"../typeannos/RepMethodA.html\" title=\"annotation in typeannos\">"
-                + "@RepMethodA</a> <a href=\"../typeannos/RepMethodA.html\" title="
-                + "\"annotation in typeannos\">@RepMethodA</a>\n<a href=\"../typeannos/RepMethodB.html\""
+                "<a href=\"RepMethodA.html\" title=\"annotation in typeannos\">"
+                + "@RepMethodA</a> <a href=\"RepMethodA.html\" title="
+                + "\"annotation in typeannos\">@RepMethodA</a>\n<a href=\"RepMethodB.html\""
                 + " title=\"annotation in typeannos\">@RepMethodB</a> <a href="
-                + "\"../typeannos/RepMethodB.html\" title=\"annotation in typeannos\">"
+                + "\"RepMethodB.html\" title=\"annotation in typeannos\">"
                 + "@RepMethodB</a>\njava.lang.String&nbsp;test1()",
 
-                "<a href=\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" "
-                + "title=\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                "<a href=\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" "
+                + "title=\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String&nbsp;test2()",
 
-                "<a href=\"../typeannos/RepMethodA.html\" title=\"annotation in typeannos\">"
-                + "@RepMethodA</a> <a href=\"../typeannos/RepMethodA.html\" title="
-                + "\"annotation in typeannos\">@RepMethodA</a>\n<a href=\"../typeannos/RepMethodB.html\" "
+                "<a href=\"RepMethodA.html\" title=\"annotation in typeannos\">"
+                + "@RepMethodA</a> <a href=\"RepMethodA.html\" title="
+                + "\"annotation in typeannos\">@RepMethodA</a>\n<a href=\"RepMethodB.html\" "
                 + "title=\"annotation in typeannos\">@RepMethodB</a> <a href="
-                + "\"../typeannos/RepMethodB.html\" title=\"annotation in typeannos\">"
-                + "@RepMethodB</a>\n<a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" "
+                + "\"RepMethodB.html\" title=\"annotation in typeannos\">"
+                + "@RepMethodB</a>\n<a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" title="
                 + "\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String&nbsp;test3()",
 
-                "<a href=\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html\" "
+                "<a href=\"RepAllContextsA.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsA</a> <a href=\"RepAllContextsA.html\" "
                 + "title=\"annotation in typeannos\">@RepAllContextsA</a>\n<a href="
-                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html\" "
+                + "\"RepAllContextsB.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsB</a> <a href=\"RepAllContextsB.html\" "
                 + "title=\"annotation in typeannos\">@RepAllContextsB</a>\n<a href="
-                + "\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html\" "
+                + "\"RepAllContextsA.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsA</a> <a href=\"RepAllContextsA.html\" "
                 + "title=\"annotation in typeannos\">@RepAllContextsA</a> <a href="
-                + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html\" "
+                + "\"RepAllContextsB.html\" title=\"annotation in typeannos\">"
+                + "@RepAllContextsB</a> <a href=\"RepAllContextsB.html\" "
                 + "title=\"annotation in typeannos\">@RepAllContextsB</a> java.lang.String&nbsp;test4()",
 
-                "java.lang.String&nbsp;test5&#8203;(<a href=\"../typeannos/RepTypeUseA.html\" "
+                "java.lang.String&nbsp;test5&#8203;(<a href=\"RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseB</a>&nbsp;RepeatingOnMethod&nbsp;"
-                + "this,\n                       <a href=\"../typeannos/RepParameterA.html\" "
+                + "this,\n                       <a href=\"RepParameterA.html\" "
                 + "title=\"annotation in typeannos\">@RepParameterA</a> <a href="
-                + "\"../typeannos/RepParameterA.html\" title=\"annotation in typeannos\">"
-                + "@RepParameterA</a> <a href=\"../typeannos/RepParameterB.html\" "
+                + "\"RepParameterA.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterA</a> <a href=\"RepParameterB.html\" "
                 + "title=\"annotation in typeannos\">@RepParameterB</a> <a href="
-                + "\"../typeannos/RepParameterB.html\" title=\"annotation in typeannos\">"
+                + "\"RepParameterB.html\" title=\"annotation in typeannos\">"
                 + "@RepParameterB</a>\n                       java.lang.String&nbsp;parameter,\n"
-                + "                       <a href=\"../typeannos/RepParameterA.html\" title="
-                + "\"annotation in typeannos\">@RepParameterA</a> <a href=\"../typeannos/RepParameterA.html\""
+                + "                       <a href=\"RepParameterA.html\" title="
+                + "\"annotation in typeannos\">@RepParameterA</a> <a href=\"RepParameterA.html\""
                 + " title=\"annotation in typeannos\">@RepParameterA</a> <a href="
-                + "\"../typeannos/RepParameterB.html\" title=\"annotation in typeannos\">"
-                + "@RepParameterB</a> <a href=\"../typeannos/RepParameterB.html\" title="
+                + "\"RepParameterB.html\" title=\"annotation in typeannos\">"
+                + "@RepParameterB</a> <a href=\"RepParameterB.html\" title="
                 + "\"annotation in typeannos\">@RepParameterB</a>\n                       "
-                + "java.lang.String <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" "
+                + "java.lang.String <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
+                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" title="
                 + "\"annotation in typeannos\">@RepTypeUseB</a> ...&nbsp;vararg)");
 
         checkOutput("typeannos/RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod.html", true,
                 "<code>(package private) &lt;T&gt;&nbsp;java.lang.String</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href="
-                + "\"../typeannos/RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod.html#"
+                + "\"#"
                 + "genericMethod-T-\">genericMethod</a></span>&#8203;(T&nbsp;t)</code>",
 
                 "<code>(package private) &lt;T&gt;&nbsp;java.lang.String</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href="
-                + "\"../typeannos/RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod.html#"
-                + "genericMethod2-T-\">genericMethod2</a></span>&#8203;(<a href=\"../typeannos/RepTypeUseA.html"
-                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html"
-                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
-                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html"
+                + "\"#"
+                + "genericMethod2-T-\">genericMethod2</a></span>&#8203;(<a href=\"RepTypeUseA.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseA.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> T&nbsp;t)</code>",
 
                 "<code>(package private) java.lang.String</code></td>\n<th class=\"colSecond\" scope=\"row\"><code>"
-                + "<span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod.html#"
+                + "<span class=\"memberNameLink\"><a href=\"#"
                 + "test--\">test</a></span>()</code>",
 
-                "java.lang.String&nbsp;test&#8203;(<a href=\"../typeannos/RepTypeUseA.html\" "
+                "java.lang.String&nbsp;test&#8203;(<a href=\"RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseB</a>&nbsp;"
                 + "RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod&lt;<a href="
-                + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
-                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
+                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                + "@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" title="
+                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html"
+                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseB</a> T&gt;&nbsp;this)");
 
         checkOutput("typeannos/RepeatingOnVoidMethodDeclaration.html", true,
-                "<a href=\"../typeannos/RepMethodA.html\" title=\"annotation in typeannos\">"
-                + "@RepMethodA</a> <a href=\"../typeannos/RepMethodA.html\" title="
-                + "\"annotation in typeannos\">@RepMethodA</a>\n<a href=\"../typeannos/RepMethodB.html"
+                "<a href=\"RepMethodA.html\" title=\"annotation in typeannos\">"
+                + "@RepMethodA</a> <a href=\"RepMethodA.html\" title="
+                + "\"annotation in typeannos\">@RepMethodA</a>\n<a href=\"RepMethodB.html"
                 + "\" title=\"annotation in typeannos\">@RepMethodB</a> <a href="
-                + "\"../typeannos/RepMethodB.html\" title=\"annotation in typeannos\">"
+                + "\"RepMethodB.html\" title=\"annotation in typeannos\">"
                 + "@RepMethodB</a>\nvoid&nbsp;test()");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testTypeParams/TestTypeParameters.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testTypeParams/TestTypeParameters.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,14 +57,14 @@
                 "<code>&lt;T&gt;&nbsp;java.lang.Object</code>");
 
         checkOutput("pkg/package-summary.html", true,
-                "C</a>&lt;E extends <a href=\"../pkg/Parent.html\" "
+                "C</a>&lt;E extends <a href=\"Parent.html\" "
                 + "title=\"class in pkg\">Parent</a>&gt;");
 
         checkOutput("pkg/class-use/Foo4.html", true,
-                "<a href=\"../../pkg/ClassUseTest3.html\" title=\"class in pkg\">"
-                + "ClassUseTest3</a>&lt;T extends <a href=\"../../pkg/ParamTest2.html\" "
+                "<a href=\"../ClassUseTest3.html\" title=\"class in pkg\">"
+                + "ClassUseTest3</a>&lt;T extends <a href=\"../ParamTest2.html\" "
                 + "title=\"class in pkg\">ParamTest2</a>&lt;java.util.List&lt;? extends "
-                + "<a href=\"../../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>&gt;&gt;&gt;");
+                + "<a href=\"../Foo4.html\" title=\"class in pkg\">Foo4</a>&gt;&gt;&gt;");
 
         // Nested type parameters
         checkOutput("pkg/C.html", true,
@@ -84,8 +84,8 @@
 
         checkOutput("pkg/ClassUseTest3.html", true,
             "public class <a href=\"../src-html/pkg/ClassUseTest3.html#line.28\">" +
-            "ClassUseTest3</a>&lt;T extends <a href=\"../pkg/ParamTest2.html\" " +
+            "ClassUseTest3</a>&lt;T extends <a href=\"ParamTest2.html\" " +
             "title=\"class in pkg\">ParamTest2</a>&lt;java.util.List&lt;? extends " +
-            "<a href=\"../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>&gt;&gt;&gt;");
+            "<a href=\"Foo4.html\" title=\"class in pkg\">Foo4</a>&gt;&gt;&gt;");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testTypeVariableLinks/TestTypeVariableLinks.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testTypeVariableLinks/TestTypeVariableLinks.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,8 +48,8 @@
         checkOutput("pkg1/C.html", true,
                 "<div class=\"block\">Linking to List.clear() <code>List.clear()</code></div>");
         checkOutput("pkg1/C.html", true,
-                "<div class=\"block\">Linking to Additional.doAction() <a href=\"../pkg1/Additional.html#doAction--\"><code>Additional.doAction()</code></a></div>");
+                "<div class=\"block\">Linking to Additional.doAction() <a href=\"Additional.html#doAction--\"><code>Additional.doAction()</code></a></div>");
         checkOutput("pkg1/C.html", true,
-                "<div class=\"block\">Linking to I.abstractAction() <a href=\"../pkg1/I.html#abstractAction--\"><code>I.abstractAction()</code></a></div>");
+                "<div class=\"block\">Linking to I.abstractAction() <a href=\"I.html#abstractAction--\"><code>I.abstractAction()</code></a></div>");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -84,56 +84,56 @@
           "that return types with arguments of type"
         );
         checkOutput("pkg1/class-use/UsedClass.html", true,
-          "<a href=\"../../pkg1/C1.html#methodInC1ReturningType--\">methodInC1ReturningType</a>"
+          "<a href=\"../C1.html#methodInC1ReturningType--\">methodInC1ReturningType</a>"
         );
         checkOutput("pkg1/class-use/UsedInterface.html", true,
-          "Classes in <a href=\"../../pkg1/package-summary.html\">pkg1</a> that implement " +
-          "<a href=\"../../pkg1/UsedInterface.html\" title=\"interface in pkg1\">UsedInterface</a>"
+          "Classes in <a href=\"../package-summary.html\">pkg1</a> that implement " +
+          "<a href=\"../UsedInterface.html\" title=\"interface in pkg1\">UsedInterface</a>"
         );
         checkOutput("pkg1/class-use/UsedInterfaceA.html", true,
-          "Classes in <a href=\"../../pkg1/package-summary.html\">pkg1</a> that implement " +
-          "<a href=\"../../pkg1/UsedInterfaceA.html\" title=\"interface in pkg1\">UsedInterfaceA</a>"
+          "Classes in <a href=\"../package-summary.html\">pkg1</a> that implement " +
+          "<a href=\"../UsedInterfaceA.html\" title=\"interface in pkg1\">UsedInterfaceA</a>"
         );
         checkOutput("pkg1/class-use/UsedClass.html", false,
            "methodInC1Protected"
         );
         checkOutput("pkg1/class-use/UsedInterface.html", true,
-           "<a href=\"../../pkg1/AnAbstract.html\" title=\"class in pkg1\">AnAbstract</a>"
+           "<a href=\"../AnAbstract.html\" title=\"class in pkg1\">AnAbstract</a>"
         );
         checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "../../pkg1/C10.html#withReturningTypeParameters--"
+            "../C10.html#withReturningTypeParameters--"
         );
         checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "../../pkg1/C10.html#withTypeParametersOfType-java.lang.Class-"
+            "../C10.html#withTypeParametersOfType-java.lang.Class-"
         );
         checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "\"../../pkg1/package-summary.html\">pkg1</a> that return " +
-            "<a href=\"../../pkg1/UsedInterface.html\" title=\"interface in pkg1\""
+            "\"../package-summary.html\">pkg1</a> that return " +
+            "<a href=\"../UsedInterface.html\" title=\"interface in pkg1\""
         );
         checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "<a href=\"../../pkg1/C10.html#addAll-pkg1.UsedInterface...-\">addAll</a>"
+            "<a href=\"../C10.html#addAll-pkg1.UsedInterface...-\">addAll</a>"
         );
         checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "<a href=\"../../pkg1/C10.html#create-pkg1.UsedInterfaceA-pkg1." +
+            "<a href=\"../C10.html#create-pkg1.UsedInterfaceA-pkg1." +
             "UsedInterface-java.lang.String-\">"
         );
         checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "<a href=\"../../pkg1/C10.html#withTypeParametersOfType-java.lang.Class-\">" +
+            "<a href=\"../C10.html#withTypeParametersOfType-java.lang.Class-\">" +
             "withTypeParametersOfType</a>"
         );
         checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "Subinterfaces of <a href=\"../../pkg1/UsedInterface.html\" title=\"interface in pkg1\">"
-            + "UsedInterface</a> in <a href=\"../../pkg1/package-summary.html\">pkg1",
+            "Subinterfaces of <a href=\"../UsedInterface.html\" title=\"interface in pkg1\">"
+            + "UsedInterface</a> in <a href=\"../package-summary.html\">pkg1",
             "<td class=\"colFirst\"><code>interface&nbsp;</code></td>\n<th class=\"colSecond\" scope=\"row\">"
-            + "<code><span class=\"memberNameLink\"><a href=\"../../pkg1/SubInterface.html\" "
+            + "<code><span class=\"memberNameLink\"><a href=\"../SubInterface.html\" "
             + "title=\"interface in pkg1\">SubInterface</a>&lt;T&gt;</span></code></th>"
         );
         checkOutput("pkg1/class-use/UsedThrowable.html", true,
-            "Methods in <a href=\"../../pkg1/package-summary.html\">pkg1</a> that throw "
-            + "<a href=\"../../pkg1/UsedThrowable.html\" title=\"class in pkg1\">UsedThrowable</a>",
+            "Methods in <a href=\"../package-summary.html\">pkg1</a> that throw "
+            + "<a href=\"../UsedThrowable.html\" title=\"class in pkg1\">UsedThrowable</a>",
             "<td class=\"colFirst\"><code>void</code></td>\n<th class=\"colSecond\" scope=\"row\"><span class="
             + "\"typeNameLabel\">C1.</span><code><span class=\"memberNameLink\">"
-            + "<a href=\"../../pkg1/C1.html#methodInC1ThrowsThrowable--\">methodInC1ThrowsThrowable"
+            + "<a href=\"../C1.html#methodInC1ThrowsThrowable--\">methodInC1ThrowsThrowable"
             + "</a></span>()</code></th>"
         );
     }
@@ -169,9 +169,9 @@
                 "-package", "unique");
         checkExit(Exit.OK);
         checkUnique("unique/class-use/UseMe.html",
-                "<a href=\"../../unique/C1.html#umethod1-unique.UseMe-unique.UseMe:A-\">",
-                "<a href=\"../../unique/C1.html#umethod2-unique.UseMe-unique.UseMe-\">",
-                "<a href=\"../../unique/C1.html#umethod3-unique.UseMe-unique.UseMe-\">",
-                "<a href=\"../../unique/C1.html#C1-unique.UseMe-unique.UseMe-\">");
+                "<a href=\"../C1.html#umethod1-unique.UseMe-unique.UseMe:A-\">",
+                "<a href=\"../C1.html#umethod2-unique.UseMe-unique.UseMe-\">",
+                "<a href=\"../C1.html#umethod3-unique.UseMe-unique.UseMe-\">",
+                "<a href=\"../C1.html#C1-unique.UseMe-unique.UseMe-\">");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testValueTag/TestValueTag.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testValueTag/TestValueTag.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,19 +52,19 @@
                 // Base case:  using @value on a constant.
                 "Result:  \"Test 1 passes\"",
                 // Retrieve value of constant in same class.
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_2_PASSES\">\"Test 2 passes\"</a>",
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_3_PASSES\">\"Test 3 passes\"</a>",
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_4_PASSES\">\"Test 4 passes\"</a>",
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_5_PASSES\">\"Test 5 passes\"</a>",
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_6_PASSES\">\"Test 6 passes\"</a>");
+                "Result:  <a href=\"#TEST_2_PASSES\">\"Test 2 passes\"</a>",
+                "Result:  <a href=\"#TEST_3_PASSES\">\"Test 3 passes\"</a>",
+                "Result:  <a href=\"#TEST_4_PASSES\">\"Test 4 passes\"</a>",
+                "Result:  <a href=\"#TEST_5_PASSES\">\"Test 5 passes\"</a>",
+                "Result:  <a href=\"#TEST_6_PASSES\">\"Test 6 passes\"</a>");
 
         checkOutput("pkg1/Class2.html", true,
                 // Retrieve value of constant in different class.
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_7_PASSES\">\"Test 7 passes\"</a>",
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_8_PASSES\">\"Test 8 passes\"</a>",
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_9_PASSES\">\"Test 9 passes\"</a>",
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_10_PASSES\">\"Test 10 passes\"</a>",
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_11_PASSES\">\"Test 11 passes\"</a>",
+                "Result:  <a href=\"Class1.html#TEST_7_PASSES\">\"Test 7 passes\"</a>",
+                "Result:  <a href=\"Class1.html#TEST_8_PASSES\">\"Test 8 passes\"</a>",
+                "Result:  <a href=\"Class1.html#TEST_9_PASSES\">\"Test 9 passes\"</a>",
+                "Result:  <a href=\"Class1.html#TEST_10_PASSES\">\"Test 10 passes\"</a>",
+                "Result:  <a href=\"Class1.html#TEST_11_PASSES\">\"Test 11 passes\"</a>",
                 // Retrieve value of constant in different package
                 "Result:  <a href=\"../pkg2/Class3.html#TEST_12_PASSES\">\"Test 12 passes\"</a>",
                 "Result:  <a href=\"../pkg2/Class3.html#TEST_13_PASSES\">\"Test 13 passes\"</a>",
@@ -74,7 +74,7 @@
 
         checkOutput("pkg2/package-summary.html", true,
                 // Retrieve value of constant from a package page
-                "Result: <a href=\"../pkg2/Class3.html#TEST_17_PASSES\">\"Test 17 passes\"</a>");
+                "Result: <a href=\"Class3.html#TEST_17_PASSES\">\"Test 17 passes\"</a>");
 
         checkOutput("pkg1/CustomTagUsage.html", true,
                 // Test @value tag used with custom tag.
@@ -104,7 +104,7 @@
 
         checkOutput("pkg1/Class1.html", false,
                 // Base case:  using @value on a constant.
-                "Result:  <a href=\"../pkg1/Class1.html#TEST_12_ERROR\">\"Test 12 "
+                "Result:  <a href=\"#TEST_12_ERROR\">\"Test 12 "
                 + "generates an error message\"</a>");
 
         checkForException();
@@ -141,9 +141,9 @@
         checkExit(Exit.OK);
 
         checkOrder("pkg3/RT.html",
-                "The value is <a href=\"../pkg3/RT.html#CONSTANT\">\"constant\"</a>.",
-                "The value1 is <a href=\"../pkg3/RT.html#CONSTANT\">\"constant\"</a>.",
-                "The value2 is <a href=\"../pkg3/RT.html#CONSTANT\">\"constant\"</a>.",
+                "The value is <a href=\"#CONSTANT\">\"constant\"</a>.",
+                "The value1 is <a href=\"#CONSTANT\">\"constant\"</a>.",
+                "The value2 is <a href=\"#CONSTANT\">\"constant\"</a>.",
                 "The value3 is <a href=\"../pkg2/Class3.html#TEST_12_PASSES\">"
                 + "\"Test 12 passes\"</a>.");
     }
--- a/test/langtools/jdk/javadoc/doclet/testWarnings/TestWarnings.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/javadoc/doclet/testWarnings/TestWarnings.java	Tue Jan 30 09:03:47 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -78,8 +78,8 @@
         checkExit(Exit.ERROR);
 
         checkOutput("pkg/X.html", true,
-            "<a href=\"../pkg/X.html#m--\"><code>m()</code></a><br/>",
-            "<a href=\"../pkg/X.html#X--\"><code>X()</code></a><br/>",
-            "<a href=\"../pkg/X.html#f\"><code>f</code></a><br/>");
+            "<a href=\"#m--\"><code>m()</code></a><br/>",
+            "<a href=\"#X--\"><code>X()</code></a><br/>",
+            "<a href=\"#f\"><code>f</code></a><br/>");
     }
 }
--- a/test/langtools/jdk/jshell/VariablesTest.java	Tue Jan 30 11:53:00 2018 +0530
+++ b/test/langtools/jdk/jshell/VariablesTest.java	Tue Jan 30 09:03:47 2018 -0800
@@ -26,6 +26,9 @@
  * @bug 8144903 8177466 8191842
  * @summary Tests for EvaluationState.variables
  * @library /tools/lib
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.main
+ *          jdk.jshell
  * @build Compiler KullaTesting TestingInputStream ExpectedDiagnostic
  * @run testng VariablesTest
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/MethodParameters/DefaultParamNames.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2017 Google Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8194268
+ * @summary Incorrect parameter names for synthetic methods
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.code
+ *          jdk.compiler/com.sun.tools.javac.tree
+ *          jdk.compiler/com.sun.tools.javac.util
+ * @compile DefaultParamNames.java
+ * @run main DefaultParamNames
+ */
+
+import static java.util.stream.Collectors.joining;
+
+import com.sun.tools.javac.api.BasicJavacTask;
+import com.sun.tools.javac.code.Flags;
+import com.sun.tools.javac.code.Symbol.MethodSymbol;
+import com.sun.tools.javac.code.Symtab;
+import com.sun.tools.javac.code.Type.MethodType;
+import com.sun.tools.javac.util.Assert;
+import com.sun.tools.javac.util.Context;
+import com.sun.tools.javac.util.List;
+import com.sun.tools.javac.util.Names;
+import java.util.Objects;
+import javax.tools.JavaCompiler;
+import javax.tools.ToolProvider;
+
+public class DefaultParamNames {
+
+    public static void main(String[] args) {
+        JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
+        BasicJavacTask task = (BasicJavacTask) compiler.getTask(null, null, null, null, null, null);
+        Context context = task.getContext();
+        Names names = Names.instance(context);
+        Symtab symtab = Symtab.instance(context);
+        MethodType mt =
+                new MethodType(
+                        List.of(symtab.intType, symtab.stringType, symtab.objectType),
+                        symtab.voidType,
+                        List.nil(),
+                        symtab.methodClass);
+        MethodSymbol ms =
+                new MethodSymbol(Flags.SYNTHETIC, names.fromString("test"), mt, symtab.methodClass);
+        String paramNames =
+                ms.params().stream().map(p -> p.getSimpleName().toString()).collect(joining(","));
+        assertEquals("arg0,arg1,arg2", paramNames);
+    }
+
+    static void assertEquals(Object expected, Object actual) {
+        Assert.check(
+                Objects.equals(expected, actual),
+                String.format("expected: %s, but was: %s", expected, actual));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/jvm/VerboseClassPathTest.java	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Google Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8179373
+ * @summary javac -verbose logs the class path multiple times
+ * @modules jdk.compiler
+ * @run main VerboseClassPathTest
+ */
+
+import java.io.BufferedReader;
+import java.io.PrintWriter;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.spi.ToolProvider;
+
+public class VerboseClassPathTest {
+    public static void main(String... args) throws Exception {
+        new VerboseClassPathTest().run();
+    }
+
+    void run() throws Exception {
+        String className = getClass().getName();
+        Path testSrc = Paths.get(System.getProperty("test.src"));
+        Path file = testSrc.resolve(className + ".java");
+        ToolProvider javac = ToolProvider.findFirst("javac").orElseThrow();
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw, true);
+        int rc =
+                javac.run(
+                        pw,
+                        pw,
+                        "-d",
+                        ",",
+                        "-source",
+                        "8",
+                        "-target",
+                        "8",
+                        "-verbose",
+                        file.toString());
+        String log = sw.toString();
+        System.out.println(log);
+        if (rc != 0) {
+            throw new Exception("compilation failed: rc=" + rc);
+        }
+        String expect = "[search path for class files:";
+        long count =
+                new BufferedReader(new StringReader(log))
+                        .lines()
+                        .filter(line -> line.startsWith(expect))
+                        .count();
+        if (count != 1) {
+            throw new Exception("expected '" + expect + "' to appear once, actual: " + count);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/nashorn/script/basic/JDK-8195829.js	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8195829 : Parsing a nameless ES6 class results in a thrown NullPointerException.
+ *
+ * @test
+ * @run
+ */
+
+var Parser = Java.type("jdk.nashorn.api.tree.Parser");
+var SimpleTreeVisitor = Java.type("jdk.nashorn.api.tree.SimpleTreeVisitorES6");
+var parser = Parser.create("--language=es6"); 
+var ast = parser.parse("test.js", "(class {});", print);
+var reachedClassExpr = false;
+ast.accept(new (Java.extend(SimpleTreeVisitor)) {
+    visitClassExpression: function(node, extra) {
+        reachedClassExpr = true;
+        Assert.assertTrue(node.name === null);
+    }
+}, null);
+
+Assert.assertTrue(reachedClassExpr);
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/nashorn/script/nosecurity/jjs-option-t.js	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8147614: add jjs test for -t option.
+ * @test
+ * @option -scripting
+ * @run
+ * @summary Test -t flag and its basic functionality
+ */
+
+load(__DIR__ + "jjs-common.js")
+
+var timezone = Java.type("java.util.TimeZone")
+var currentTimezone = timezone.getDefault().getID()
+var msg_flag = "print($OPTIONS._timezone.ID)"
+var e_outp = "Asia/Tokyo"
+var e_outn = currentTimezone
+
+var msg_func=<<EOD
+var d= new Date(0)
+print(d.getTimezoneOffset())
+EOD
+
+var func_cond_p = <<'EOD'
+out==-540
+EOD
+
+var func_cond_n = <<'EOD'
+out==-timezone.getDefault().getRawOffset()/60000
+EOD
+
+var arg_p = "-t=Asia/Tokyo ${testfunc_file}"
+var arg_n = "${testfunc_file}"
+
+testjjs_flag_and_func("-t","=Asia/Tokyo")
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/nashorn/script/nosecurity/jjs-option-t.js.EXPECTED	Tue Jan 30 09:03:47 2018 -0800
@@ -0,0 +1,6 @@
+-t flag positive test:
+flag test PASSED
+functionality test PASSED
+-t flag negative test:
+flag test PASSED
+functionality test PASSED