changeset 42243:efa5b6fbe372

Merge
author duke
date Wed, 05 Jul 2017 22:30:12 +0200
parents abc849d57c6c e781bad6f134
children a74bc7057efc
files jdk/src/jdk.accessibility/windows/native/include/bridge/AccessBridgeCalls.c jdk/src/jdk.localedata/share/classes/sun/util/resources/ext/CurrencyNames_de_GR.properties jdk/test/java/util/Locale/LocaleTestFmwk.java jdk/test/javax/net/ssl/templates/SSLSocketSample.java jdk/test/javax/net/ssl/templates/SSLTest.java make/common/CORE_PKGS.gmk make/common/NON_CORE_PKGS.gmk
diffstat 272 files changed, 9849 insertions(+), 6501 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags-top-repo	Wed Nov 23 19:14:47 2016 +0000
+++ b/.hgtags-top-repo	Wed Jul 05 22:30:12 2017 +0200
@@ -388,3 +388,4 @@
 1fc62b1c629fb80fdaa639d3b59452a184f0d705 jdk-9+143
 8d337fd6333e28c48aa87880144b840aad82baaf jdk-9+144
 ff98aa9ec9fae991e426ce5926fc9036d25f5562 jdk-9+145
+a22e2671d88f6b22a4aa82e3966986542ed2a381 jdk-9+146
--- a/common/autoconf/basics.m4	Wed Nov 23 19:14:47 2016 +0000
+++ b/common/autoconf/basics.m4	Wed Jul 05 22:30:12 2017 +0200
@@ -1048,7 +1048,9 @@
   # These tools might not be installed by default,
   # need hint on how to install them.
   BASIC_REQUIRE_PROGS(UNZIP, unzip)
-  BASIC_REQUIRE_PROGS(ZIP, zip)
+  # Since zip uses "ZIP" as a environment variable for passing options, we need
+  # to name our variable differently, hence ZIPEXE.
+  BASIC_REQUIRE_PROGS(ZIPEXE, zip)
 
   # Non-required basic tools
 
--- a/common/autoconf/flags.m4	Wed Nov 23 19:14:47 2016 +0000
+++ b/common/autoconf/flags.m4	Wed Jul 05 22:30:12 2017 +0200
@@ -311,7 +311,11 @@
       SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
     fi
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-    PICFLAG="-KPIC"
+    if test "x$OPENJDK_TARGET_CPU" = xsparcv9; then
+      PICFLAG="-xcode=pic32"
+    else
+      PICFLAG="-KPIC"
+    fi
     C_FLAG_REORDER='-xF'
     CXX_FLAG_REORDER='-xF'
     SHARED_LIBRARY_FLAGS="-G"
@@ -838,7 +842,6 @@
     fastdebug | slowdebug )
       $2CFLAGS_JDK="[$]$2CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS $CFLAGS_DEBUG_OPTIONS"
       $2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS $CXXFLAGS_DEBUG_OPTIONS"
-      JAVAC_FLAGS="$JAVAC_FLAGS -g"
       ;;
     release )
       ;;
@@ -894,12 +897,12 @@
   # Set some additional per-OS defines.
   if test "x$OPENJDK_$1_OS" = xlinux; then
     $2JVM_CFLAGS="[$]$2JVM_CFLAGS -DLINUX"
-    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -pipe -fPIC -fno-rtti -fno-exceptions \
+    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -pipe $PICFLAG -fno-rtti -fno-exceptions \
         -fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer"
   elif test "x$OPENJDK_$1_OS" = xsolaris; then
     $2JVM_CFLAGS="[$]$2JVM_CFLAGS -DSOLARIS"
     $2JVM_CFLAGS="[$]$2JVM_CFLAGS -template=no%extdef -features=no%split_init \
-        -D_Crun_inline_placement -library=%none -KPIC -mt -features=no%except"
+        -D_Crun_inline_placement -library=%none $PICFLAG -mt -features=no%except"
   elif test "x$OPENJDK_$1_OS" = xmacosx; then
     $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
     $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_ALLBSD_SOURCE"
@@ -1310,7 +1313,7 @@
   AC_MSG_CHECKING([if both compilers support "ARG_ARGUMENT"])
   supports=no
   if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi
-  
+
   AC_MSG_RESULT([$supports])
   if test "x$supports" = "xyes" ; then
     :
--- a/common/autoconf/generated-configure.sh	Wed Nov 23 19:14:47 2016 +0000
+++ b/common/autoconf/generated-configure.sh	Wed Jul 05 22:30:12 2017 +0200
@@ -945,7 +945,7 @@
 READELF
 OTOOL
 LDD
-ZIP
+ZIPEXE
 UNZIP
 TAR_SUPPORTS_TRANSFORM
 TAR_INCLUDE_PARAM
@@ -1292,7 +1292,7 @@
 NICE
 MAKE
 UNZIP
-ZIP
+ZIPEXE
 LDD
 OTOOL
 READELF
@@ -2236,7 +2236,7 @@
   NICE        Override default value for NICE
   MAKE        Override default value for MAKE
   UNZIP       Override default value for UNZIP
-  ZIP         Override default value for ZIP
+  ZIPEXE      Override default value for ZIPEXE
   LDD         Override default value for LDD
   OTOOL       Override default value for OTOOL
   READELF     Override default value for READELF
@@ -5093,7 +5093,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1479120453
+DATE_WHEN_GENERATED=1479997904
 
 ###############################################################################
 #
@@ -21373,13 +21373,15 @@
   fi
 
 
-
-
-
-  # Publish this variable in the help.
-
-
-  if [ -z "${ZIP+x}" ]; then
+  # Since zip uses "ZIP" as a environment variable for passing options, we need
+  # to name our variable differently, hence ZIPEXE.
+
+
+
+  # Publish this variable in the help.
+
+
+  if [ -z "${ZIPEXE+x}" ]; then
     # The variable is not set by user, try to locate tool using the code snippet
     for ac_prog in zip
 do
@@ -21387,56 +21389,56 @@
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ZIP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $ZIP in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ZIP="$ZIP" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_ZIP="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-ZIP=$ac_cv_path_ZIP
-if test -n "$ZIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP" >&5
-$as_echo "$ZIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ZIP" && break
-done
-
-  else
-    # The variable is set, but is it from the command line or the environment?
-
-    # Try to remove the string !ZIP! from our list.
-    try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!ZIP!/}
-    if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then
-      # If it failed, the variable was not from the command line. Ignore it,
-      # but warn the user (except for BASH, which is always set by the calling BASH).
-      if test "xZIP" != xBASH; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of ZIP from the environment. Use command line variables instead." >&5
-$as_echo "$as_me: WARNING: Ignoring value of ZIP from the environment. Use command line variables instead." >&2;}
+if ${ac_cv_path_ZIPEXE+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ZIPEXE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ZIPEXE="$ZIPEXE" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ZIPEXE="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ZIPEXE=$ac_cv_path_ZIPEXE
+if test -n "$ZIPEXE"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIPEXE" >&5
+$as_echo "$ZIPEXE" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ZIPEXE" && break
+done
+
+  else
+    # The variable is set, but is it from the command line or the environment?
+
+    # Try to remove the string !ZIPEXE! from our list.
+    try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!ZIPEXE!/}
+    if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then
+      # If it failed, the variable was not from the command line. Ignore it,
+      # but warn the user (except for BASH, which is always set by the calling BASH).
+      if test "xZIPEXE" != xBASH; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of ZIPEXE from the environment. Use command line variables instead." >&5
+$as_echo "$as_me: WARNING: Ignoring value of ZIPEXE from the environment. Use command line variables instead." >&2;}
       fi
       # Try to locate tool using the code snippet
       for ac_prog in zip
@@ -21445,135 +21447,135 @@
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ZIP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $ZIP in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ZIP="$ZIP" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_ZIP="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-ZIP=$ac_cv_path_ZIP
-if test -n "$ZIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP" >&5
-$as_echo "$ZIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ZIP" && break
-done
-
-    else
-      # If it succeeded, then it was overridden by the user. We will use it
-      # for the tool.
-
-      # First remove it from the list of overridden variables, so we can test
-      # for unknown variables in the end.
-      CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var"
-
-      # Check if we try to supply an empty value
-      if test "x$ZIP" = x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool ZIP= (no value)" >&5
-$as_echo "$as_me: Setting user supplied tool ZIP= (no value)" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZIP" >&5
-$as_echo_n "checking for ZIP... " >&6; }
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
-$as_echo "disabled" >&6; }
-      else
-        # Check if the provided tool contains a complete path.
-        tool_specified="$ZIP"
-        tool_basename="${tool_specified##*/}"
-        if test "x$tool_basename" = "x$tool_specified"; then
-          # A command without a complete path is provided, search $PATH.
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool ZIP=$tool_basename" >&5
-$as_echo "$as_me: Will search for user supplied tool ZIP=$tool_basename" >&6;}
-          # Extract the first word of "$tool_basename", so it can be a program name with args.
-set dummy $tool_basename; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ZIP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $ZIP in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ZIP="$ZIP" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_ZIP="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-ZIP=$ac_cv_path_ZIP
-if test -n "$ZIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP" >&5
-$as_echo "$ZIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-          if test "x$ZIP" = x; then
-            as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5
-          fi
-        else
-          # Otherwise we believe it is a complete path. Use it as it is.
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool ZIP=$tool_specified" >&5
-$as_echo "$as_me: Will use user supplied tool ZIP=$tool_specified" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZIP" >&5
-$as_echo_n "checking for ZIP... " >&6; }
-          if test ! -x "$tool_specified"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
-            as_fn_error $? "User supplied tool ZIP=$tool_specified does not exist or is not executable" "$LINENO" 5
-          fi
-          { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5
-$as_echo "$tool_specified" >&6; }
-        fi
-      fi
-    fi
-
-  fi
-
-
-
-  if test "x$ZIP" = x; then
-    as_fn_error $? "Could not find required tool for ZIP" "$LINENO" 5
+if ${ac_cv_path_ZIPEXE+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ZIPEXE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ZIPEXE="$ZIPEXE" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ZIPEXE="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ZIPEXE=$ac_cv_path_ZIPEXE
+if test -n "$ZIPEXE"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIPEXE" >&5
+$as_echo "$ZIPEXE" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ZIPEXE" && break
+done
+
+    else
+      # If it succeeded, then it was overridden by the user. We will use it
+      # for the tool.
+
+      # First remove it from the list of overridden variables, so we can test
+      # for unknown variables in the end.
+      CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var"
+
+      # Check if we try to supply an empty value
+      if test "x$ZIPEXE" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool ZIPEXE= (no value)" >&5
+$as_echo "$as_me: Setting user supplied tool ZIPEXE= (no value)" >&6;}
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZIPEXE" >&5
+$as_echo_n "checking for ZIPEXE... " >&6; }
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
+$as_echo "disabled" >&6; }
+      else
+        # Check if the provided tool contains a complete path.
+        tool_specified="$ZIPEXE"
+        tool_basename="${tool_specified##*/}"
+        if test "x$tool_basename" = "x$tool_specified"; then
+          # A command without a complete path is provided, search $PATH.
+          { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool ZIPEXE=$tool_basename" >&5
+$as_echo "$as_me: Will search for user supplied tool ZIPEXE=$tool_basename" >&6;}
+          # Extract the first word of "$tool_basename", so it can be a program name with args.
+set dummy $tool_basename; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ZIPEXE+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ZIPEXE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ZIPEXE="$ZIPEXE" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ZIPEXE="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ZIPEXE=$ac_cv_path_ZIPEXE
+if test -n "$ZIPEXE"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIPEXE" >&5
+$as_echo "$ZIPEXE" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+          if test "x$ZIPEXE" = x; then
+            as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5
+          fi
+        else
+          # Otherwise we believe it is a complete path. Use it as it is.
+          { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool ZIPEXE=$tool_specified" >&5
+$as_echo "$as_me: Will use user supplied tool ZIPEXE=$tool_specified" >&6;}
+          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZIPEXE" >&5
+$as_echo_n "checking for ZIPEXE... " >&6; }
+          if test ! -x "$tool_specified"; then
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+            as_fn_error $? "User supplied tool ZIPEXE=$tool_specified does not exist or is not executable" "$LINENO" 5
+          fi
+          { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5
+$as_echo "$tool_specified" >&6; }
+        fi
+      fi
+    fi
+
+  fi
+
+
+
+  if test "x$ZIPEXE" = x; then
+    as_fn_error $? "Could not find required tool for ZIPEXE" "$LINENO" 5
   fi
 
 
@@ -49101,7 +49103,11 @@
       SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=$1'
     fi
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-    PICFLAG="-KPIC"
+    if test "x$OPENJDK_TARGET_CPU" = xsparcv9; then
+      PICFLAG="-xcode=pic32"
+    else
+      PICFLAG="-KPIC"
+    fi
     C_FLAG_REORDER='-xF'
     CXX_FLAG_REORDER='-xF'
     SHARED_LIBRARY_FLAGS="-G"
@@ -50020,7 +50026,6 @@
     fastdebug | slowdebug )
       CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS $CFLAGS_DEBUG_OPTIONS"
       CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS $CXXFLAGS_DEBUG_OPTIONS"
-      JAVAC_FLAGS="$JAVAC_FLAGS -g"
       ;;
     release )
       ;;
@@ -50076,12 +50081,12 @@
   # Set some additional per-OS defines.
   if test "x$OPENJDK_TARGET_OS" = xlinux; then
     JVM_CFLAGS="$JVM_CFLAGS -DLINUX"
-    JVM_CFLAGS="$JVM_CFLAGS -pipe -fPIC -fno-rtti -fno-exceptions \
+    JVM_CFLAGS="$JVM_CFLAGS -pipe $PICFLAG -fno-rtti -fno-exceptions \
         -fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer"
   elif test "x$OPENJDK_TARGET_OS" = xsolaris; then
     JVM_CFLAGS="$JVM_CFLAGS -DSOLARIS"
     JVM_CFLAGS="$JVM_CFLAGS -template=no%extdef -features=no%split_init \
-        -D_Crun_inline_placement -library=%none -KPIC -mt -features=no%except"
+        -D_Crun_inline_placement -library=%none $PICFLAG -mt -features=no%except"
   elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
     COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
     JVM_CFLAGS="$JVM_CFLAGS -D_ALLBSD_SOURCE"
@@ -50844,7 +50849,6 @@
     fastdebug | slowdebug )
       OPENJDK_BUILD_CFLAGS_JDK="$OPENJDK_BUILD_CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS $CFLAGS_DEBUG_OPTIONS"
       OPENJDK_BUILD_CXXFLAGS_JDK="$OPENJDK_BUILD_CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS $CXXFLAGS_DEBUG_OPTIONS"
-      JAVAC_FLAGS="$JAVAC_FLAGS -g"
       ;;
     release )
       ;;
@@ -50900,12 +50904,12 @@
   # Set some additional per-OS defines.
   if test "x$OPENJDK_BUILD_OS" = xlinux; then
     OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -DLINUX"
-    OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -pipe -fPIC -fno-rtti -fno-exceptions \
+    OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -pipe $PICFLAG -fno-rtti -fno-exceptions \
         -fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer"
   elif test "x$OPENJDK_BUILD_OS" = xsolaris; then
     OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -DSOLARIS"
     OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -template=no%extdef -features=no%split_init \
-        -D_Crun_inline_placement -library=%none -KPIC -mt -features=no%except"
+        -D_Crun_inline_placement -library=%none $PICFLAG -mt -features=no%except"
   elif test "x$OPENJDK_BUILD_OS" = xmacosx; then
     OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
     OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -D_ALLBSD_SOURCE"
--- a/common/autoconf/spec.gmk.in	Wed Nov 23 19:14:47 2016 +0000
+++ b/common/autoconf/spec.gmk.in	Wed Jul 05 22:30:12 2017 +0200
@@ -657,8 +657,7 @@
 UNIQ:=@UNIQ@
 WC:=@WC@
 XARGS:=@XARGS@
-ZIPEXE:=@ZIP@
-ZIP:=@ZIP@
+ZIPEXE:=@ZIPEXE@
 UNZIP:=@UNZIP@
 MT:=@FIXPATH@ @MT@
 RC:=@FIXPATH@ @RC@
--- a/corba/.hgtags	Wed Nov 23 19:14:47 2016 +0000
+++ b/corba/.hgtags	Wed Jul 05 22:30:12 2017 +0200
@@ -388,3 +388,4 @@
 6211236ef15ec796806357608b1dd1b70c258ece jdk-9+143
 d4f1dae174098e799c48948e866054c52e11a186 jdk-9+144
 a44b156ae7f06bf41b9bece30df7775e482395dd jdk-9+145
+ecd74b41ab65bf228837b5bdf99690638d55425c jdk-9+146
--- a/hotspot/.hgtags	Wed Nov 23 19:14:47 2016 +0000
+++ b/hotspot/.hgtags	Wed Jul 05 22:30:12 2017 +0200
@@ -548,3 +548,4 @@
 d87d5d430c42342f0320ca7f5cbe0cbd1f9d62ba jdk-9+143
 6187b582d02aee38341dc8ce4011906e9b364e9f jdk-9+144
 61e7ea56312351657e69198c503a6f7bf865af83 jdk-9+145
+a82cb5350cad96a0b4de496afebe3ded89f27efa jdk-9+146
--- a/hotspot/make/gensrc/GensrcJvmti.gmk	Wed Nov 23 19:14:47 2016 +0000
+++ b/hotspot/make/gensrc/GensrcJvmti.gmk	Wed Jul 05 22:30:12 2017 +0200
@@ -130,8 +130,6 @@
 TARGETS += $(JVMTI_OUTPUTDIR)/jvmtiEnvRecommended.cpp
 
 ################################################################################
-# Disable copy of jvmti.h from hotspot until this has been cleared up. The file
-# is currently being copied from the jdk repository. See JDK-8167078.
 # Copy jvmti.h to include dir
 
 # The file is the same regardless of jvm variant. Only let one do the copy.
--- a/hotspot/make/lib/CompileLibjsig.gmk	Wed Nov 23 19:14:47 2016 +0000
+++ b/hotspot/make/lib/CompileLibjsig.gmk	Wed Jul 05 22:30:12 2017 +0200
@@ -129,7 +129,7 @@
         ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
           $(LIB_OUTPUTDIR)/$1/$(LIBRARY_PREFIX)jsig.diz: \
               $(LIB_OUTPUTDIR)/$1/$(LIBRARY_PREFIX)jsig$(DEBUG_INFO_SUFFIX)
-			$(CD) $$(@D) && $(ZIP) -q -y $$@ $$(basename $$(@F))$(DEBUG_INFO_SUFFIX)
+			$(CD) $$(@D) && $(ZIPEXE) -q -y $$@ $$(basename $$(@F))$(DEBUG_INFO_SUFFIX)
 
           TARGETS += $(LIB_OUTPUTDIR)/$1/$(LIBRARY_PREFIX)jsig.diz
         endif
--- a/hotspot/test/Makefile	Wed Nov 23 19:14:47 2016 +0000
+++ b/hotspot/test/Makefile	Wed Jul 05 22:30:12 2017 +0200
@@ -50,7 +50,7 @@
 UNAME     = uname
 UNIQ      = uniq
 WC        = wc
-ZIP       = zip
+ZIPEXE    = zip
 
 define NEWLINE
 
@@ -213,7 +213,7 @@
 ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)`     \
 	           && $(CD) $(ABS_TEST_OUTPUT_DIR)             \
 	           && $(CHMOD) -R a+r . \
-	           && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
+	           && $(ZIPEXE) -q -r $(ARCHIVE_BUNDLE) . )
 
 # important results files
 SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport/text/summary.txt")
@@ -327,7 +327,7 @@
   else ifeq ($(shell expr $(CONCURRENCY) \> 12), 1)
     CONCURRENCY := 12
   endif
-else 
+else
   CONCURRENCY := 1
 endif
 JTREG_BASIC_OPTIONS += -concurrency:$(CONCURRENCY)
--- a/jdk/.hgtags	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/.hgtags	Wed Jul 05 22:30:12 2017 +0200
@@ -388,3 +388,4 @@
 8dbc8594f9d5149bf1c22221272284609408227a jdk-9+143
 efa71dc820eb8bd5a6c9f2f66f39c383ac3ee99d jdk-9+144
 99b7853cfbd8227c4441de4b6119c10742556840 jdk-9+145
+6e4ff59afb5d0adf21a72c4ff534326594a99e5d jdk-9+146
--- a/jdk/make/copy/Copy-java.base.gmk	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/make/copy/Copy-java.base.gmk	Wed Jul 05 22:30:12 2017 +0200
@@ -181,6 +181,7 @@
 DEF_POLICY_DST := $(LIB_DST_DIR)/security/default.policy
 
 DEF_POLICY_SRC_LIST := $(DEF_POLICY_SRC)
+DEF_POLICY_SRC_LIST += $(CUSTOM_POLICY_SRC_LIST)
 
 ifneq ($(filter $(OPENJDK_TARGET_OS), windows solaris), )
   DEF_POLICY_SRC_LIST += $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/lib/security/default.policy
--- a/jdk/make/copy/Copy-jdk.accessibility.gmk	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/make/copy/Copy-jdk.accessibility.gmk	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2104, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2104, 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
@@ -30,8 +30,7 @@
 ifeq ($(OPENJDK_TARGET_OS), windows)
   TARGETS += $(INCLUDE_DST_OS_DIR)/bridge/AccessBridgeCallbacks.h \
       $(INCLUDE_DST_OS_DIR)/bridge/AccessBridgeCalls.h \
-      $(INCLUDE_DST_OS_DIR)/bridge/AccessBridgePackages.h \
-      $(INCLUDE_DST_OS_DIR)/bridge/AccessBridgeCalls.c
+      $(INCLUDE_DST_OS_DIR)/bridge/AccessBridgePackages.h
 
   $(INCLUDE_DST_OS_DIR)/bridge/%: \
       $(JDK_TOPDIR)/src/jdk.accessibility/windows/native/include/bridge/%
--- a/jdk/make/launcher/Launcher-jdk.accessibility.gmk	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/make/launcher/Launcher-jdk.accessibility.gmk	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@
 
     $$(eval $$(call SetupNativeCompilation, BUILD_JACCESSINSPECTOR$1, \
       SRC := $(TOPDIR)/jaccessinspector $(TOPDIR)/common \
-          $(TOPDIR)/toolscommon $(TOPDIR)/include/bridge, \
+          $(TOPDIR)/toolscommon $(TOPDIR)/bridge, \
       CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \
       LDFLAGS := $$(LDFLAGS_JDKEXE) -stack:655360, \
       LIBS := advapi32.lib user32.lib, \
@@ -98,7 +98,7 @@
 
     $$(eval $$(call SetupNativeCompilation,BUILD_JACCESSWALKER$1, \
       SRC := $(TOPDIR)/jaccesswalker $(TOPDIR)/common \
-          $(TOPDIR)/toolscommon $(TOPDIR)/include/bridge, \
+          $(TOPDIR)/toolscommon $(TOPDIR)/bridge, \
       CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \
       LDFLAGS := $$(LDFLAGS_JDKEXE) -stack:655360, \
       LIBS := advapi32.lib comctl32.lib gdi32.lib user32.lib, \
--- a/jdk/make/lib/Awt2dLibraries.gmk	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/make/lib/Awt2dLibraries.gmk	Wed Jul 05 22:30:12 2017 +0200
@@ -356,7 +356,7 @@
             $(X_CFLAGS), \
         WARNINGS_AS_ERRORS_xlc := false, \
         DISABLED_WARNINGS_gcc := type-limits pointer-to-int-cast \
-            deprecated-declarations unused-result maybe-uninitialized format \
+            unused-result maybe-uninitialized format \
             format-security int-to-pointer-cast parentheses, \
         DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \
             E_ASSIGNMENT_TYPE_MISMATCH E_NON_CONST_INIT, \
--- a/jdk/make/lib/Lib-jdk.accessibility.gmk	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/make/lib/Lib-jdk.accessibility.gmk	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@
         OPTIMIZATION := LOW, \
         CFLAGS := $(CFLAGS_JDKLIB) $(ACCESSBRIDGE_CFLAGS) \
             $(addprefix -I,$(JAVA_AB_SRCDIR)) \
-            -I$(JDK_TOPDIR)/src/jdk.accessibility/windows/native/include/bridge \
+            -I$(ROOT_SRCDIR)/include/bridge \
             -DACCESSBRIDGE_ARCH_$2, \
         LDFLAGS := $(LDFLAGS_JDKLIB) -subsystem:windows, \
         LIBS := kernel32.lib user32.lib gdi32.lib \
@@ -78,7 +78,7 @@
         OPTIMIZATION := LOW, \
         CFLAGS := $(filter-out -MD, $(CFLAGS_JDKLIB)) -MT $(ACCESSBRIDGE_CFLAGS) \
             $(addprefix -I,$(WIN_AB_SRCDIR)) \
-            -I$(JDK_TOPDIR)/src/jdk.accessibility/windows/native/include/bridge \
+            -I$(ROOT_SRCDIR)/include/bridge \
             -DACCESSBRIDGE_ARCH_$2, \
         LDFLAGS := $(LDFLAGS_JDKLIB) -subsystem:windows \
             -def:$(ROOT_SRCDIR)/libwindowsaccessbridge/WinAccessBridge.DEF, \
--- a/jdk/src/java.base/share/classes/java/io/ObjectInputFilter.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/io/ObjectInputFilter.java	Wed Jul 05 22:30:12 2017 +0200
@@ -194,11 +194,17 @@
      * When setting the filter, it should be stateless and idempotent,
      * reporting the same result when passed the same arguments.
      * <p>
-     * The filter is configured using the {@link java.security.Security}
-     * property {@code jdk.serialFilter} and can be overridden by
-     * the System property {@code jdk.serialFilter}.
-     *
-     * The syntax is the same as for the {@link #createFilter(String) createFilter} method.
+     * The filter is configured during the initialization of the {@code ObjectInputFilter.Config}
+     * class. For example, by calling {@link #getSerialFilter() Config.getSerialFilter}.
+     * If the system property {@code jdk.serialFilter} is defined, it is used
+     * to configure the filter.
+     * If the system property is not defined, and the {@link java.security.Security}
+     * property {@code jdk.serialFilter} is defined then it is used to configure the filter.
+     * Otherwise, the filter is not configured during initialization.
+     * The syntax for each property is the same as for the
+     * {@link #createFilter(String) createFilter} method.
+     * If a filter is not configured, it can be set with
+     * {@link #setSerialFilter(ObjectInputFilter) Config.setSerialFilter}.
      *
      * @since 9
      */
--- a/jdk/src/java.base/share/classes/java/lang/CharSequence.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/CharSequence.java	Wed Jul 05 22:30:12 2017 +0200
@@ -121,8 +121,11 @@
      * href="{@docRoot}/java/lang/Character.html#unicode">surrogate code
      * point</a> is passed through uninterpreted.
      *
-     * <p>If the sequence is mutated while the stream is being read, the
-     * result is undefined.
+     * <p>The stream binds to this sequence when the terminal stream operation
+     * commences (specifically, for mutable sequences the spliterator for the
+     * stream is <a href="../Spliterator.html#binding"><em>late-binding</em></a>).
+     * If the sequence is modified during that operation then the result is
+     * undefined.
      *
      * @return an IntStream of char values from this sequence
      * @since 1.8
@@ -168,8 +171,11 @@
      * unpaired surrogates, and undefined code units, are zero-extended to
      * {@code int} values which are then passed to the stream.
      *
-     * <p>If the sequence is mutated while the stream is being read, the result
-     * is undefined.
+     * <p>The stream binds to this sequence when the terminal stream operation
+     * commences (specifically, for mutable sequences the spliterator for the
+     * stream is <a href="../Spliterator.html#binding"><em>late-binding</em></a>).
+     * If the sequence is modified during that operation then the result is
+     * undefined.
      *
      * @return an IntStream of Unicode code points from this sequence
      * @since 1.8
--- a/jdk/src/java.base/share/classes/java/lang/Class.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/Class.java	Wed Jul 05 22:30:12 2017 +0200
@@ -2704,9 +2704,6 @@
      * Reflection support.
      */
 
-    // Caches for certain reflective results
-    private static boolean useCaches = true;
-
     // reflection data that might get invalidated when JVM TI RedefineClasses() is called
     private static class ReflectionData<T> {
         volatile Field[] declaredFields;
@@ -2739,8 +2736,7 @@
         SoftReference<ReflectionData<T>> reflectionData = this.reflectionData;
         int classRedefinedCount = this.classRedefinedCount;
         ReflectionData<T> rd;
-        if (useCaches &&
-            reflectionData != null &&
+        if (reflectionData != null &&
             (rd = reflectionData.get()) != null &&
             rd.redefinedCount == classRedefinedCount) {
             return rd;
@@ -2752,8 +2748,6 @@
 
     private ReflectionData<T> newReflectionData(SoftReference<ReflectionData<T>> oldReflectionData,
                                                 int classRedefinedCount) {
-        if (!useCaches) return null;
-
         while (true) {
             ReflectionData<T> rd = new ReflectionData<>(classRedefinedCount);
             // try to CAS it...
@@ -2819,7 +2813,6 @@
     // be propagated to the outside world, but must instead be copied
     // via ReflectionFactory.copyField.
     private Field[] privateGetDeclaredFields(boolean publicOnly) {
-        checkInitted();
         Field[] res;
         ReflectionData<T> rd = reflectionData();
         if (rd != null) {
@@ -2842,7 +2835,6 @@
     // be propagated to the outside world, but must instead be copied
     // via ReflectionFactory.copyField.
     private Field[] privateGetPublicFields(Set<Class<?>> traversedInterfaces) {
-        checkInitted();
         Field[] res;
         ReflectionData<T> rd = reflectionData();
         if (rd != null) {
@@ -2902,7 +2894,6 @@
     // objects must NOT be propagated to the outside world, but must
     // instead be copied via ReflectionFactory.copyConstructor.
     private Constructor<T>[] privateGetDeclaredConstructors(boolean publicOnly) {
-        checkInitted();
         Constructor<T>[] res;
         ReflectionData<T> rd = reflectionData();
         if (rd != null) {
@@ -2937,7 +2928,6 @@
     // be propagated to the outside world, but must instead be copied
     // via ReflectionFactory.copyMethod.
     private Method[] privateGetDeclaredMethods(boolean publicOnly) {
-        checkInitted();
         Method[] res;
         ReflectionData<T> rd = reflectionData();
         if (rd != null) {
@@ -3134,7 +3124,6 @@
     // be propagated to the outside world, but must instead be copied
     // via ReflectionFactory.copyMethod.
     private Method[] privateGetPublicMethods() {
-        checkInitted();
         Method[] res;
         ReflectionData<T> rd = reflectionData();
         if (rd != null) {
@@ -3445,7 +3434,7 @@
      * @since  1.4
      */
     public boolean desiredAssertionStatus() {
-        ClassLoader loader = getClassLoader();
+        ClassLoader loader = getClassLoader0();
         // If the loader is null this is a system class, so ask the VM
         if (loader == null)
             return desiredAssertionStatus0(this);
@@ -3490,39 +3479,6 @@
     }
     private static ReflectionFactory reflectionFactory;
 
-    // To be able to query system properties as soon as they're available
-    private static boolean initted = false;
-    private static void checkInitted() {
-        if (initted) return;
-        AccessController.doPrivileged(new PrivilegedAction<>() {
-                public Void run() {
-                    // Tests to ensure the system properties table is fully
-                    // initialized. This is needed because reflection code is
-                    // called very early in the initialization process (before
-                    // command-line arguments have been parsed and therefore
-                    // these user-settable properties installed.) We assume that
-                    // if System.out is non-null then the System class has been
-                    // fully initialized and that the bulk of the startup code
-                    // has been run.
-
-                    if (System.out == null) {
-                        // java.lang.System not yet fully initialized
-                        return null;
-                    }
-
-                    // Doesn't use Boolean.getBoolean to avoid class init.
-                    String val =
-                        System.getProperty("sun.reflect.noCaches");
-                    if (val != null && val.equals("true")) {
-                        useCaches = false;
-                    }
-
-                    initted = true;
-                    return null;
-                }
-            });
-    }
-
     /**
      * Returns the elements of this enum class or null if this
      * Class object does not represent an enum type.
--- a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java	Wed Jul 05 22:30:12 2017 +0200
@@ -104,9 +104,9 @@
  * class or resource itself.
  *
  * <p> Class loaders that support concurrent loading of classes are known as
- * <em>{@linkplain #isParallelCapable() parallel capable}</em> class loaders and
- * are required to register themselves at their class initialization time by
- * invoking the {@link
+ * <em>{@linkplain #isRegisteredAsParallelCapable() parallel capable}</em> class
+ * loaders and are required to register themselves at their class initialization
+ * time by invoking the {@link
  * #registerAsParallelCapable <tt>ClassLoader.registerAsParallelCapable</tt>}
  * method. Note that the <tt>ClassLoader</tt> class is registered as parallel
  * capable by default. However, its subclasses still need to register themselves
@@ -1335,10 +1335,12 @@
      * @return  A <tt>URL</tt> object for reading the resource, or
      *          <tt>null</tt> if the resource could not be found or the invoker
      *          doesn't have adequate  privileges to get the resource.
+     * @throws  NullPointerException If {@code name} is {@code null}
      *
      * @since  1.1
      */
     public URL getResource(String name) {
+        Objects.requireNonNull(name);
         URL url;
         if (parent != null) {
             url = parent.getResource(name);
@@ -1382,12 +1384,14 @@
      *
      * @throws  IOException
      *          If I/O errors occur
+     * @throws  NullPointerException If {@code name} is {@code null}
      *
      * @see  #findResources(String)
      *
      * @since  1.2
      */
     public Enumeration<URL> getResources(String name) throws IOException {
+        Objects.requireNonNull(name);
         @SuppressWarnings("unchecked")
         Enumeration<URL>[] tmp = (Enumeration<URL>[]) new Enumeration<?>[2];
         if (parent != null) {
@@ -1434,11 +1438,14 @@
      *          that the class loader doesn't have access to will not be in the
      *          stream.
      *
+     * @throws  NullPointerException If {@code name} is {@code null}
+     *
      * @see  #findResources(String)
      *
      * @since  9
      */
     public Stream<URL> resources(String name) {
+        Objects.requireNonNull(name);
         int characteristics = Spliterator.NONNULL | Spliterator.IMMUTABLE;
         Supplier<Spliterator<URL>> si = () -> {
             try {
@@ -1495,7 +1502,8 @@
     }
 
     /**
-     * Registers the caller as {@linkplain #isParallelCapable() parallel capable}.
+     * Registers the caller as
+     * {@linkplain #isRegisteredAsParallelCapable() parallel capable}.
      * The registration succeeds if and only if all of the following
      * conditions are met:
      * <ol>
@@ -1509,7 +1517,7 @@
      * @return  {@code true} if the caller is successfully registered as
      *          parallel capable and {@code false} if otherwise.
      *
-     * @see #isParallelCapable()
+     * @see #isRegisteredAsParallelCapable()
      *
      * @since   1.7
      */
@@ -1521,7 +1529,7 @@
     }
 
     /**
-     * Returns {@code true} if this class loader is
+     * Returns {@code true} if this class loader is registered as
      * {@linkplain #registerAsParallelCapable parallel capable}, otherwise
      * {@code false}.
      *
@@ -1532,7 +1540,7 @@
      *
      * @since   9
      */
-    public final boolean isParallelCapable() {
+    public final boolean isRegisteredAsParallelCapable() {
         return ParallelLoaders.isRegistered(this.getClass());
     }
 
@@ -1599,10 +1607,12 @@
      *
      * @return  An input stream for reading the resource, or <tt>null</tt>
      *          if the resource could not be found
+     * @throws  NullPointerException If {@code name} is {@code null}
      *
      * @since  1.1
      */
     public InputStream getResourceAsStream(String name) {
+        Objects.requireNonNull(name);
         URL url = getResource(name);
         try {
             return url != null ? url.openStream() : null;
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java	Wed Jul 05 22:30:12 2017 +0200
@@ -200,7 +200,8 @@
     }
 
     /**
-     * {@inheritDoc}
+     * Returns the {@code Class} object representing the class that
+     * declares the constructor represented by this object.
      */
     @Override
     public Class<T> getDeclaringClass() {
@@ -321,6 +322,11 @@
      *    public java.util.Hashtable(int,float)
      * }</pre>
      *
+     * <p>If the constructor is declared to throw exceptions, the
+     * parameter list is followed by a space, followed by the word
+     * "{@code throws}" followed by a comma-separated list of the
+     * thrown exception types.
+     *
      * <p>The only possible modifiers for constructors are the access
      * modifiers {@code public}, {@code protected} or
      * {@code private}.  Only one of these may appear, or none if the
@@ -357,13 +363,13 @@
      * "<code><i>Type</i>...</code>".
      *
      * A space is used to separate access modifiers from one another
-     * and from the type parameters or return type.  If there are no
+     * and from the type parameters or class name.  If there are no
      * type parameters, the type parameter list is elided; if the type
      * parameter list is present, a space separates the list from the
      * class name.  If the constructor is declared to throw
      * exceptions, the parameter list is followed by a space, followed
      * by the word "{@code throws}" followed by a
-     * comma-separated list of the thrown exception types.
+     * comma-separated list of the generic thrown exception types.
      *
      * <p>The only possible modifiers for constructors are the access
      * modifiers {@code public}, {@code protected} or
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Method.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Method.java	Wed Jul 05 22:30:12 2017 +0200
@@ -211,7 +211,8 @@
     }
 
     /**
-     * {@inheritDoc}
+     * Returns the {@code Class} object representing the class or interface
+     * that declares the method represented by this object.
      */
     @Override
     public Class<?> getDeclaringClass() {
@@ -372,7 +373,7 @@
      * the method name, followed by a parenthesized, comma-separated
      * list of the method's formal parameter types. If the method
      * throws checked exceptions, the parameter list is followed by a
-     * space, followed by the word throws followed by a
+     * space, followed by the word "{@code throws}" followed by a
      * comma-separated list of the thrown exception types.
      * For example:
      * <pre>
@@ -428,8 +429,8 @@
      * parameter list is present, a space separates the list from the
      * class name.  If the method is declared to throw exceptions, the
      * parameter list is followed by a space, followed by the word
-     * throws followed by a comma-separated list of the generic thrown
-     * exception types.
+     * "{@code throws}" followed by a comma-separated list of the generic
+     * thrown exception types.
      *
      * <p>The access modifiers are placed in canonical order as
      * specified by "The Java Language Specification".  This is
--- a/jdk/src/java.base/share/classes/java/net/Authenticator.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/net/Authenticator.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -131,6 +131,35 @@
     }
 
     /**
+     * Gets the default authenticator.
+     * First, if there is a security manager, its {@code checkPermission}
+     * method is called with a
+     * {@code NetPermission("requestPasswordAuthentication")} permission.
+     * This may result in a java.lang.SecurityException.
+     * Then the default authenticator, if set, is returned.
+     * Otherwise, {@code null} is returned.
+     *
+     * @return The default authenticator, if set, {@code null} otherwise.
+     *
+     * @throws SecurityException
+     *        if a security manager exists and its
+     *        {@code checkPermission} method doesn't allow
+     *        requesting password authentication.
+     * @since 9
+     * @see SecurityManager#checkPermission
+     * @see java.net.NetPermission
+     */
+    public static Authenticator getDefault() {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            NetPermission requestPermission
+                = new NetPermission("requestPasswordAuthentication");
+            sm.checkPermission(requestPermission);
+        }
+        return theAuthenticator;
+    }
+
+    /**
      * Ask the authenticator that has been registered with the system
      * for a password.
      * <p>
--- a/jdk/src/java.base/share/classes/java/net/URLClassLoader.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/net/URLClassLoader.java	Wed Jul 05 22:30:12 2017 +0200
@@ -42,6 +42,7 @@
 import java.util.Enumeration;
 import java.util.List;
 import java.util.NoSuchElementException;
+import java.util.Objects;
 import java.util.Set;
 import java.util.WeakHashMap;
 import java.util.jar.Attributes;
@@ -301,9 +302,12 @@
      * @return  An input stream for reading the resource, or {@code null}
      *          if the resource could not be found
      *
+     * @throws  NullPointerException If {@code name} is {@code null}
+     *
      * @since  1.7
      */
     public InputStream getResourceAsStream(String name) {
+        Objects.requireNonNull(name);
         URL url = getResource(name);
         try {
             if (url == null) {
--- a/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java	Wed Jul 05 22:30:12 2017 +0200
@@ -32,6 +32,7 @@
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.List;
+import java.util.Objects;
 import java.util.concurrent.ConcurrentHashMap;
 import jdk.internal.misc.JavaSecurityAccess;
 import jdk.internal.misc.JavaSecurityProtectionDomainAccess;
@@ -524,7 +525,7 @@
                             // have some side effects so this manual
                             // comparison is sufficient.
                             if (pdpName.equals(pp.getName()) &&
-                                pdpActions.equals(pp.getActions())) {
+                                Objects.equals(pdpActions, pp.getActions())) {
                                 plVector.remove(i);
                                 break;
                             }
--- a/jdk/src/java.base/share/classes/java/security/SecureRandom.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/security/SecureRandom.java	Wed Jul 05 22:30:12 2017 +0200
@@ -120,6 +120,24 @@
  * gathered, for example, if the entropy source is /dev/random on various
  * Unix-like operating systems.
  *
+ * <h2> Thread safety </h2>
+ * {@code SecureRandom} objects are safe for use by multiple concurrent threads.
+ *
+ * @implSpec
+ * A {@code SecureRandom} service provider can advertise that it is thread-safe
+ * by setting the <a href=
+ * "{@docRoot}/../technotes/guides/security/StandardNames.html#Service">service
+ * provider attribute</a> "ThreadSafe" to "true" when registering the provider.
+ * Otherwise, this class will instead synchronize access to the following
+ * methods of the {@code SecureRandomSpi} implementation:
+ * <ul>
+ * <li>{@link SecureRandomSpi#engineSetSeed(byte[])}
+ * <li>{@link SecureRandomSpi#engineNextBytes(byte[])}
+ * <li>{@link SecureRandomSpi#engineNextBytes(byte[], SecureRandomParameters)}
+ * <li>{@link SecureRandomSpi#engineGenerateSeed(int)}
+ * <li>{@link SecureRandomSpi#engineReseed(SecureRandomParameters)}
+ * </ul>
+ *
  * @see java.security.SecureRandomSpi
  * @see java.util.Random
  *
@@ -150,6 +168,14 @@
      */
     private SecureRandomSpi secureRandomSpi = null;
 
+    /**
+     * Thread safety.
+     *
+     * @serial
+     * @since 9
+     */
+    private final boolean threadSafe;
+
     /*
      * The algorithm name of null if unknown.
      *
@@ -189,6 +215,16 @@
          */
         super(0);
         getDefaultPRNG(false, null);
+        this.threadSafe = getThreadSafe();
+    }
+
+    private boolean getThreadSafe() {
+        if (provider == null || algorithm == null) {
+            return false;
+        } else {
+            return Boolean.parseBoolean(provider.getProperty(
+                    "SecureRandom." + algorithm + " ThreadSafe", "false"));
+        }
     }
 
     /**
@@ -217,6 +253,7 @@
     public SecureRandom(byte[] seed) {
         super(0);
         getDefaultPRNG(true, seed);
+        this.threadSafe = getThreadSafe();
     }
 
     private void getDefaultPRNG(boolean setSeed, byte[] seed) {
@@ -269,6 +306,7 @@
         this.secureRandomSpi = secureRandomSpi;
         this.provider = provider;
         this.algorithm = algorithm;
+        this.threadSafe = getThreadSafe();
 
         if (!skipDebug && pdebug != null) {
             pdebug.println("SecureRandom." + algorithm +
@@ -653,8 +691,14 @@
      *
      * @see #getSeed
      */
-    public synchronized void setSeed(byte[] seed) {
-        secureRandomSpi.engineSetSeed(seed);
+    public void setSeed(byte[] seed) {
+        if (threadSafe) {
+            secureRandomSpi.engineSetSeed(seed);
+        } else {
+            synchronized (this) {
+                secureRandomSpi.engineSetSeed(seed);
+            }
+        }
     }
 
     /**
@@ -679,7 +723,7 @@
          * yet been initialized at that point.
          */
         if (seed != 0) {
-            this.secureRandomSpi.engineSetSeed(longToByteArray(seed));
+            setSeed(longToByteArray(seed));
         }
     }
 
@@ -690,7 +734,13 @@
      */
     @Override
     public void nextBytes(byte[] bytes) {
-        secureRandomSpi.engineNextBytes(bytes);
+        if (threadSafe) {
+            secureRandomSpi.engineNextBytes(bytes);
+        } else {
+            synchronized (this) {
+                secureRandomSpi.engineNextBytes(bytes);
+            }
+        }
     }
 
     /**
@@ -707,12 +757,19 @@
      *
      * @since 9
      */
-    public synchronized void nextBytes(
-            byte[] bytes, SecureRandomParameters params) {
+    public void nextBytes(byte[] bytes, SecureRandomParameters params) {
         if (params == null) {
             throw new IllegalArgumentException("params cannot be null");
         }
-        secureRandomSpi.engineNextBytes(Objects.requireNonNull(bytes), params);
+        if (threadSafe) {
+            secureRandomSpi.engineNextBytes(
+                    Objects.requireNonNull(bytes), params);
+        } else {
+            synchronized (this) {
+                secureRandomSpi.engineNextBytes(
+                        Objects.requireNonNull(bytes), params);
+            }
+        }
     }
 
     /**
@@ -756,6 +813,7 @@
      *
      * @param numBytes the number of seed bytes to generate.
      *
+     * @throws IllegalArgumentException if {@code numBytes} is negative
      * @return the seed bytes.
      *
      * @see #setSeed
@@ -782,7 +840,13 @@
         if (numBytes < 0) {
             throw new IllegalArgumentException("numBytes cannot be negative");
         }
-        return secureRandomSpi.engineGenerateSeed(numBytes);
+        if (threadSafe) {
+            return secureRandomSpi.engineGenerateSeed(numBytes);
+        } else {
+            synchronized (this) {
+                return secureRandomSpi.engineGenerateSeed(numBytes);
+            }
+        }
     }
 
     /**
@@ -917,8 +981,14 @@
      *
      * @since 9
      */
-    public synchronized void reseed() {
-        secureRandomSpi.engineReseed(null);
+    public void reseed() {
+        if (threadSafe) {
+            secureRandomSpi.engineReseed(null);
+        } else {
+            synchronized (this) {
+                secureRandomSpi.engineReseed(null);
+            }
+        }
     }
 
     /**
@@ -937,11 +1007,17 @@
      *
      * @since 9
      */
-    public synchronized void reseed(SecureRandomParameters params) {
+    public void reseed(SecureRandomParameters params) {
         if (params == null) {
             throw new IllegalArgumentException("params cannot be null");
         }
-        secureRandomSpi.engineReseed(params);
+        if (threadSafe) {
+            secureRandomSpi.engineReseed(params);
+        } else {
+            synchronized (this) {
+                secureRandomSpi.engineReseed(params);
+            }
+        }
     }
 
     // Declare serialVersionUID to be compatible with JDK1.1
--- a/jdk/src/java.base/share/classes/java/security/SecureRandomSpi.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/security/SecureRandomSpi.java	Wed Jul 05 22:30:12 2017 +0200
@@ -58,6 +58,26 @@
  * a {@code SecureRandomParameters} argument will never
  * return an instance of this implementation. The
  * {@link #engineGetParameters()} method must return {@code null}.
+ * <p>
+ * See {@link SecureRandom} for additional details on thread safety. By
+ * default, a {@code SecureRandomSpi} implementation is considered to be
+ * not safe for use by multiple concurrent threads and {@code SecureRandom}
+ * will synchronize access to each of the applicable engine methods
+ * (see {@link SecureRandom} for the list of methods). However, if a
+ * {@code SecureRandomSpi} implementation is thread-safe, the <a href=
+ * "{@docRoot}/../technotes/guides/security/StandardNames.html#Service">
+ * service provider attribute</a> "ThreadSafe" should be set to "true" during
+ * its registration, as follows:
+ * <blockquote><pre>
+ * put("SecureRandom.AlgName ThreadSafe", "true");</pre>
+ * </blockquote>
+ * or
+ * <blockquote><pre>
+ * putService(new Service(this, "SecureRandom", "AlgName", className,
+ *          null, Map.of("ThreadSafe", "true")));</pre>
+ * </blockquote>
+ * {@code SecureRandom} will call the applicable engine methods
+ * without any synchronization.
  *
  * @since 1.2
  */
--- a/jdk/src/java.base/share/classes/java/time/ZoneId.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/time/ZoneId.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -76,6 +76,7 @@
 import java.time.zone.ZoneRules;
 import java.time.zone.ZoneRulesException;
 import java.time.zone.ZoneRulesProvider;
+import java.util.HashSet;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Objects;
@@ -284,7 +285,7 @@
      * @return a modifiable copy of the set of zone IDs, not null
      */
     public static Set<String> getAvailableZoneIds() {
-        return ZoneRulesProvider.getAvailableZoneIds();
+        return new HashSet<String>(ZoneRulesProvider.getAvailableZoneIds());
     }
 
     //-----------------------------------------------------------------------
--- a/jdk/src/java.base/share/classes/java/time/format/DateTimePrintContext.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/time/format/DateTimePrintContext.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -302,14 +302,10 @@
      * @throws DateTimeException if the field is not available and the section is not optional
      */
     Long getValue(TemporalField field) {
-        try {
-            return temporal.getLong(field);
-        } catch (DateTimeException ex) {
-            if (optional > 0) {
-                return null;
-            }
-            throw ex;
+        if (optional > 0 && !temporal.isSupported(field)) {
+            return null;
         }
+        return temporal.getLong(field);
     }
 
     //-----------------------------------------------------------------------
--- a/jdk/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -77,6 +77,7 @@
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.Collections;
 
 /**
  * Provider of time-zone rules to the system.
@@ -137,6 +138,11 @@
      */
     private static final ConcurrentMap<String, ZoneRulesProvider> ZONES = new ConcurrentHashMap<>(512, 0.75f, 2);
 
+    /**
+     * The zone ID data
+     */
+    private static volatile Set<String> ZONE_IDS;
+
     static {
         // if the property java.time.zone.DefaultZoneRulesProvider is
         // set then its value is the class name of the default provider
@@ -194,10 +200,10 @@
      * <p>
      * These IDs are the string form of a {@link ZoneId}.
      *
-     * @return a modifiable copy of the set of zone IDs, not null
+     * @return the unmodifiable set of zone IDs, not null
      */
     public static Set<String> getAvailableZoneIds() {
-        return new HashSet<>(ZONES.keySet());
+        return ZONE_IDS;
     }
 
     /**
@@ -303,7 +309,7 @@
      * @param provider  the provider to register, not null
      * @throws ZoneRulesException if unable to complete the registration
      */
-    private static void registerProvider0(ZoneRulesProvider provider) {
+    private static synchronized void registerProvider0(ZoneRulesProvider provider) {
         for (String zoneId : provider.provideZoneIds()) {
             Objects.requireNonNull(zoneId, "zoneId");
             ZoneRulesProvider old = ZONES.putIfAbsent(zoneId, provider);
@@ -313,6 +319,8 @@
                     ", currently loading from provider: " + provider);
             }
         }
+        Set<String> combinedSet = new HashSet<String>(ZONES.keySet());
+        ZONE_IDS = Collections.unmodifiableSet(combinedSet);
     }
 
     /**
--- a/jdk/src/java.base/share/classes/java/util/BitSet.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/util/BitSet.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -29,6 +29,7 @@
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 import java.nio.LongBuffer;
+import java.util.function.IntConsumer;
 import java.util.stream.IntStream;
 import java.util.stream.StreamSupport;
 
@@ -1209,40 +1210,165 @@
      * is the number of bits in the set state, equal to the value
      * returned by the {@link #cardinality()} method.
      *
-     * <p>The bit set must remain constant during the execution of the
-     * terminal stream operation.  Otherwise, the result of the terminal
-     * stream operation is undefined.
+     * <p>The stream binds to this bit set when the terminal stream operation
+     * commences (specifically, the spliterator for the stream is
+     * <a href="../Spliterator.html#binding"><em>late-binding</em></a>).  If the
+     * bit set is modified during that operation then the result is undefined.
      *
      * @return a stream of integers representing set indices
      * @since 1.8
      */
     public IntStream stream() {
-        class BitSetIterator implements PrimitiveIterator.OfInt {
-            int next = nextSetBit(0);
+        class BitSetSpliterator implements Spliterator.OfInt {
+            private int index; // current bit index for a set bit
+            private int fence; // -1 until used; then one past last bit index
+            private int est;   // size estimate
+            private boolean root; // true if root and not split
+            // root == true then size estimate is accurate
+            // index == -1 or index >= fence if fully traversed
+            // Special case when the max bit set is Integer.MAX_VALUE
 
-            @Override
-            public boolean hasNext() {
-                return next != -1;
+            BitSetSpliterator(int origin, int fence, int est, boolean root) {
+                this.index = origin;
+                this.fence = fence;
+                this.est = est;
+                this.root = root;
+            }
+
+            private int getFence() {
+                int hi;
+                if ((hi = fence) < 0) {
+                    // Round up fence to maximum cardinality for allocated words
+                    // This is sufficient and cheap for sequential access
+                    // When splitting this value is lowered
+                    hi = fence = (wordsInUse >= wordIndex(Integer.MAX_VALUE))
+                                 ? Integer.MAX_VALUE
+                                 : wordsInUse << ADDRESS_BITS_PER_WORD;
+                    est = cardinality();
+                    index = nextSetBit(0);
+                }
+                return hi;
             }
 
             @Override
-            public int nextInt() {
-                if (next != -1) {
-                    int ret = next;
-                    next = (next == Integer.MAX_VALUE) ? -1 : nextSetBit(next+1);
-                    return ret;
-                } else {
-                    throw new NoSuchElementException();
+            public boolean tryAdvance(IntConsumer action) {
+                Objects.requireNonNull(action);
+
+                int hi = getFence();
+                int i = index;
+                if (i < 0 || i >= hi) {
+                    // Check if there is a final bit set for Integer.MAX_VALUE
+                    if (i == Integer.MAX_VALUE && hi == Integer.MAX_VALUE) {
+                        index = -1;
+                        action.accept(Integer.MAX_VALUE);
+                        return true;
+                    }
+                    return false;
+                }
+
+                index = nextSetBit(i + 1, wordIndex(hi - 1));
+                action.accept(i);
+                return true;
+            }
+
+            @Override
+            public void forEachRemaining(IntConsumer action) {
+                Objects.requireNonNull(action);
+
+                int hi = getFence();
+                int i = index;
+                int v = wordIndex(hi - 1);
+                index = -1;
+                while (i >= 0 && i < hi) {
+                    action.accept(i);
+                    i = nextSetBit(i + 1, v);
+                }
+                // Check if there is a final bit set for Integer.MAX_VALUE
+                if (i == Integer.MAX_VALUE && hi == Integer.MAX_VALUE) {
+                    action.accept(Integer.MAX_VALUE);
                 }
             }
+
+            @Override
+            public OfInt trySplit() {
+                int hi = getFence();
+                int lo = index;
+                if (lo < 0) {
+                    return null;
+                }
+
+                // Lower the fence to be the upper bound of last bit set
+                // The index is the first bit set, thus this spliterator
+                // covers one bit and cannot be split, or two or more
+                // bits
+                hi = fence = (hi < Integer.MAX_VALUE || !get(Integer.MAX_VALUE))
+                        ? previousSetBit(hi - 1) + 1
+                        : Integer.MAX_VALUE;
+
+                // Find the mid point
+                int mid = (lo + hi) >>> 1;
+                if (lo >= mid) {
+                    return null;
+                }
+
+                // Raise the index of this spliterator to be the next set bit
+                // from the mid point
+                index = nextSetBit(mid, wordIndex(hi - 1));
+                root = false;
+
+                // Don't lower the fence (mid point) of the returned spliterator,
+                // traversal or further splitting will do that work
+                return new BitSetSpliterator(lo, mid, est >>>= 1, false);
+            }
+
+            @Override
+            public long estimateSize() {
+                getFence(); // force init
+                return est;
+            }
+
+            @Override
+            public int characteristics() {
+                // Only sized when root and not split
+                return (root ? Spliterator.SIZED : 0) |
+                    Spliterator.ORDERED | Spliterator.DISTINCT | Spliterator.SORTED;
+            }
+
+            @Override
+            public Comparator<? super Integer> getComparator() {
+                return null;
+            }
         }
+        return StreamSupport.intStream(new BitSetSpliterator(0, -1, 0, true), false);
+    }
 
-        return StreamSupport.intStream(
-                () -> Spliterators.spliterator(
-                        new BitSetIterator(), cardinality(),
-                        Spliterator.ORDERED | Spliterator.DISTINCT | Spliterator.SORTED),
-                Spliterator.SIZED | Spliterator.SUBSIZED |
-                        Spliterator.ORDERED | Spliterator.DISTINCT | Spliterator.SORTED,
-                false);
+    /**
+     * Returns the index of the first bit that is set to {@code true}
+     * that occurs on or after the specified starting index and up to and
+     * including the specified word index
+     * If no such bit exists then {@code -1} is returned.
+     *
+     * @param  fromIndex the index to start checking from (inclusive)
+     * @param  toWordIndex the last word index to check (inclusive)
+     * @return the index of the next set bit, or {@code -1} if there
+     *         is no such bit
+     */
+    private int nextSetBit(int fromIndex, int toWordIndex) {
+        int u = wordIndex(fromIndex);
+        // Check if out of bounds
+        if (u > toWordIndex)
+            return -1;
+
+        long word = words[u] & (WORD_MASK << fromIndex);
+
+        while (true) {
+            if (word != 0)
+                return (u * BITS_PER_WORD) + Long.numberOfTrailingZeros(word);
+            // Check if out of bounds
+            if (++u > toWordIndex)
+                return -1;
+            word = words[u];
+        }
     }
+
 }
--- a/jdk/src/java.base/share/classes/java/util/PriorityQueue.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/util/PriorityQueue.java	Wed Jul 05 22:30:12 2017 +0200
@@ -54,7 +54,8 @@
  * <p>This class and its iterator implement all of the
  * <em>optional</em> methods of the {@link Collection} and {@link
  * Iterator} interfaces.  The Iterator provided in method {@link
- * #iterator()} is <em>not</em> guaranteed to traverse the elements of
+ * #iterator()} and the Spliterator provided in method {@link #spliterator()}
+ * are <em>not</em> guaranteed to traverse the elements of
  * the priority queue in any particular order. If you need ordered
  * traversal, consider using {@code Arrays.sort(pq.toArray())}.
  *
@@ -799,7 +800,8 @@
     /**
      * Creates a <em><a href="Spliterator.html#binding">late-binding</a></em>
      * and <em>fail-fast</em> {@link Spliterator} over the elements in this
-     * queue.
+     * queue. The spliterator does not traverse elements in any particular order
+     * (the {@link Spliterator#ORDERED ORDERED} characteristic is not reported).
      *
      * <p>The {@code Spliterator} reports {@link Spliterator#SIZED},
      * {@link Spliterator#SUBSIZED}, and {@link Spliterator#NONNULL}.
--- a/jdk/src/java.base/share/classes/java/util/concurrent/PriorityBlockingQueue.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/PriorityBlockingQueue.java	Wed Jul 05 22:30:12 2017 +0200
@@ -65,7 +65,8 @@
  * <p>This class and its iterator implement all of the
  * <em>optional</em> methods of the {@link Collection} and {@link
  * Iterator} interfaces.  The Iterator provided in method {@link
- * #iterator()} is <em>not</em> guaranteed to traverse the elements of
+ * #iterator()} and the Spliterator provided in method {@link #spliterator()}
+ * are <em>not</em> guaranteed to traverse the elements of
  * the PriorityBlockingQueue in any particular order. If you need
  * ordered traversal, consider using
  * {@code Arrays.sort(pq.toArray())}.  Also, method {@code drainTo}
@@ -994,6 +995,8 @@
 
     /**
      * Returns a {@link Spliterator} over the elements in this queue.
+     * The spliterator does not traverse elements in any particular order
+     * (the {@link Spliterator#ORDERED ORDERED} characteristic is not reported).
      *
      * <p>The returned spliterator is
      * <a href="package-summary.html#Weakly"><i>weakly consistent</i></a>.
--- a/jdk/src/java.base/share/classes/java/util/stream/Stream.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/util/stream/Stream.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1327,7 +1327,7 @@
      * @param s the {@code Supplier} of generated elements
      * @return a new infinite sequential unordered {@code Stream}
      */
-    public static<T> Stream<T> generate(Supplier<T> s) {
+    public static<T> Stream<T> generate(Supplier<? extends T> s) {
         Objects.requireNonNull(s);
         return StreamSupport.stream(
                 new StreamSpliterators.InfiniteSupplyingSpliterator.OfRef<>(Long.MAX_VALUE, s), false);
--- a/jdk/src/java.base/share/classes/java/util/stream/StreamSpliterators.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/util/stream/StreamSpliterators.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1346,9 +1346,9 @@
         }
 
         static final class OfRef<T> extends InfiniteSupplyingSpliterator<T> {
-            final Supplier<T> s;
+            final Supplier<? extends T> s;
 
-            OfRef(long size, Supplier<T> s) {
+            OfRef(long size, Supplier<? extends T> s) {
                 super(size);
                 this.s = s;
             }
--- a/jdk/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java	Wed Jul 05 22:30:12 2017 +0200
@@ -72,13 +72,13 @@
         // If neither is specified then default to -cp <working directory>
         // If -cp is not specified and -m is specified, the value of
         // java.class.path is an empty string, then no class path.
-        URLClassPath ucp = null;
+        URLClassPath ucp = new URLClassPath(new URL[0]);
         String mainMid = System.getProperty("jdk.module.main");
         String cp = System.getProperty("java.class.path");
         if (cp == null)
             cp = "";
         if (mainMid == null || cp.length() > 0)
-            ucp = toURLClassPath(cp);
+            addClassPathToUCP(cp, ucp);
 
         // create the class loaders
         BOOT_LOADER = new BootClassLoader(bcp);
--- a/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java	Wed Jul 05 22:30:12 2017 +0200
@@ -462,6 +462,8 @@
      * This method:
      * 1. Loads the main class from the module or class path
      * 2. Checks the public static void main method.
+     * 3. If the main class extends FX Application then call on FXHelper to
+     * perform the launch.
      *
      * @param printToStderr if set, all output will be routed to stderr
      * @param mode LaunchMode as determined by the arguments passed on the
@@ -479,12 +481,24 @@
         Class<?> mainClass = (mode == LM_MODULE) ? loadModuleMainClass(what)
                                                  : loadMainClass(mode, what);
 
+        // record the real main class for UI purposes
+        // neither method above can return null, they will abort()
+        appClass = mainClass;
+
+        /*
+         * Check if FXHelper can launch it using the FX launcher. In an FX app,
+         * the main class may or may not have a main method, so do this before
+         * validating the main class.
+         */
+        if (JAVAFX_FXHELPER_CLASS_NAME_SUFFIX.equals(mainClass.getName()) ||
+            doesExtendFXApplication(mainClass)) {
+            // Will abort() if there are problems with FX runtime
+            FXHelper.setFXLaunchParameters(what, mode);
+            mainClass = FXHelper.class;
+        }
+
         validateMainClass(mainClass);
 
-        // record main class if not already set
-        if (appClass == null)
-            appClass = mainClass;
-
         return mainClass;
     }
 
@@ -530,7 +544,6 @@
 
             String cn = Normalizer.normalize(mainClass, Normalizer.Form.NFC);
             c = Class.forName(m, cn);
-
         }
         if (c == null) {
             abort(null, "java.launcher.module.error2", mainClass, mainModule);
@@ -542,8 +555,6 @@
 
     /**
      * Loads the main class from the class path (LM_CLASS or LM_JAR).
-     * If the main class extends FX Application then call on FXHelper to
-     * determine the main class to launch.
      */
     private static Class<?> loadMainClass(int mode, String what) {
         // get the class name
@@ -570,7 +581,7 @@
             if (System.getProperty("os.name", "").contains("OS X")
                     && Normalizer.isNormalized(cn, Normalizer.Form.NFD)) {
                 try {
-                    // On Mac OS X since all names with diacretic symbols are
+                    // On Mac OS X since all names with diacritical marks are
                     // given as decomposed it is possible that main class name
                     // comes incorrectly from the command line and we have
                     // to re-compose it
@@ -583,21 +594,6 @@
                 abort(cnfe, "java.launcher.cls.error1", cn);
             }
         }
-
-        // record the main class
-        appClass = mainClass;
-
-        /*
-         * Check if FXHelper can launch it using the FX launcher. In an FX app,
-         * the main class may or may not have a main method, so do this before
-         * validating the main class.
-         */
-        if (JAVAFX_FXHELPER_CLASS_NAME_SUFFIX.equals(mainClass.getName()) ||
-            doesExtendFXApplication(mainClass)) {
-            // Will abort() if there are problems with FX runtime
-            FXHelper.setFXLaunchParameters(what, mode);
-            return FXHelper.class;
-        }
         return mainClass;
     }
 
@@ -773,9 +769,15 @@
          * java -cp somedir FXClass     N/A               LM_CLASS     "LM_CLASS"
          * java -jar fxapp.jar          Present           LM_JAR       "LM_JAR"
          * java -jar fxapp.jar          Not Present       LM_JAR       "LM_JAR"
+         * java -m module/class [1]     N/A               LM_MODULE    "LM_MODULE"
+         * java -m module               N/A               LM_MODULE    "LM_MODULE"
+         *
+         * [1] - JavaFX-Application-Class is ignored when modular args are used, even
+         * if present in a modular jar
          */
         private static final String JAVAFX_LAUNCH_MODE_CLASS = "LM_CLASS";
         private static final String JAVAFX_LAUNCH_MODE_JAR = "LM_JAR";
+        private static final String JAVAFX_LAUNCH_MODE_MODULE = "LM_MODULE";
 
         /*
          * FX application launcher and launch method, so we can launch
@@ -835,6 +837,9 @@
                 case LM_JAR:
                     fxLaunchMode = JAVAFX_LAUNCH_MODE_JAR;
                     break;
+                case LM_MODULE:
+                    fxLaunchMode = JAVAFX_LAUNCH_MODE_MODULE;
+                    break;
                 default:
                     // should not have gotten this far...
                     throw new InternalError(mode + ": Unknown launch mode");
--- a/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java	Wed Jul 05 22:30:12 2017 +0200
@@ -96,25 +96,32 @@
         if (nativeAvailable && useNativePRNG) {
             map.put("SecureRandom.NativePRNG",
                 "sun.security.provider.NativePRNG");
+            map.put("SecureRandom.NativePRNG ThreadSafe", "true");
         }
 
         map.put("SecureRandom.DRBG", "sun.security.provider.DRBG");
+        map.put("SecureRandom.DRBG ThreadSafe", "true");
 
         map.put("SecureRandom.SHA1PRNG",
              "sun.security.provider.SecureRandom");
+
+        map.put("SecureRandom.SHA1PRNG ThreadSafe", "true");
         if (nativeAvailable && !useNativePRNG) {
             map.put("SecureRandom.NativePRNG",
                 "sun.security.provider.NativePRNG");
+            map.put("SecureRandom.NativePRNG ThreadSafe", "true");
         }
 
         if (NativePRNG.Blocking.isAvailable()) {
             map.put("SecureRandom.NativePRNGBlocking",
                 "sun.security.provider.NativePRNG$Blocking");
+            map.put("SecureRandom.NativePRNGBlocking ThreadSafe", "true");
         }
 
         if (NativePRNG.NonBlocking.isAvailable()) {
             map.put("SecureRandom.NativePRNGNonBlocking",
                 "sun.security.provider.NativePRNG$NonBlocking");
+            map.put("SecureRandom.NativePRNGNonBlocking ThreadSafe", "true");
         }
 
         /*
@@ -329,6 +336,7 @@
         map.put("AlgorithmParameters.DSA ImplementedIn", "Software");
         map.put("KeyFactory.DSA ImplementedIn", "Software");
         map.put("SecureRandom.SHA1PRNG ImplementedIn", "Software");
+        map.put("SecureRandom.DRBG ImplementedIn", "Software");
         map.put("CertificateFactory.X.509 ImplementedIn", "Software");
         map.put("KeyStore.JKS ImplementedIn", "Software");
         map.put("CertPathValidator.PKIX ImplementedIn", "Software");
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java	Wed Jul 05 22:30:12 2017 +0200
@@ -403,6 +403,13 @@
                             EnumSet.of(CryptoPrimitive.KEY_AGREEMENT),
                             suite.name, null)) {
                         suites.add(suite);
+                    } else {
+                        if (debug != null && Debug.isOn("sslctx") &&
+                                Debug.isOn("verbose")) {
+                            System.out.println(
+                                    "Ignoring disabled cipher suite: " +
+                                            suite.name);
+                        }
                     }
                 } else if (debug != null &&
                         Debug.isOn("sslctx") && Debug.isOn("verbose")) {
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java	Wed Jul 05 22:30:12 2017 +0200
@@ -960,17 +960,6 @@
             + "]";
     }
 
-    /**
-     * When SSL sessions are finalized, all values bound to
-     * them are removed.
-     */
-    @Override
-    protected void finalize() throws Throwable {
-        String[] names = getValueNames();
-        for (int i = 0; i < names.length; i++) {
-            removeValue(names[i]);
-        }
-    }
 }
 
 
--- a/jdk/src/java.base/share/lib/security/default.policy	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.base/share/lib/security/default.policy	Wed Jul 05 22:30:12 2017 +0200
@@ -155,7 +155,6 @@
 grant codeBase "jrt:/jdk.localedata" {
     permission java.lang.RuntimePermission "accessClassInPackage.sun.text.*";
     permission java.lang.RuntimePermission "accessClassInPackage.sun.util.*";
-    permission java.util.PropertyPermission "*", "read";
 };
 
 grant codeBase "jrt:/jdk.naming.dns" {
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java	Wed Jul 05 22:30:12 2017 +0200
@@ -431,6 +431,7 @@
         }
 
         @Override
+        @SuppressWarnings("deprecation")
         public void mouseReleased(final MouseEvent e) {
             if (didForwardEvent(e)) return;
 
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldFormattedUI.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldFormattedUI.java	Wed Jul 05 22:30:12 2017 +0200
@@ -55,6 +55,7 @@
         super.uninstallListeners();
     }
 
+    @SuppressWarnings("deprecation")
     public void mouseClicked(final MouseEvent e) {
         if (e.getClickCount() != 1) return;
 
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaUtils.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaUtils.java	Wed Jul 05 22:30:12 2017 +0200
@@ -176,11 +176,12 @@
         }
 
         @Override
+        @SuppressWarnings("deprecation")
         T getInstance() {
             try {
                 ReflectUtil.checkPackageAccess(clazz);
                 return clazz.newInstance();
-            } catch (InstantiationException | IllegalAccessException ignored) {
+            } catch (ReflectiveOperationException ignored) {
             }
             return null;
         }
--- a/jdk/src/java.desktop/macosx/classes/sun/java2d/OSXSurfaceData.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/macosx/classes/sun/java2d/OSXSurfaceData.java	Wed Jul 05 22:30:12 2017 +0200
@@ -672,7 +672,7 @@
                 TexturePaint color = (TexturePaint) sg2d.paint;
                 this.fGraphicsStatesInt.put(kColorStateIndex, kColorTexture);
                 texturePaintImage = color.getImage();
-                SurfaceData textureSurfaceData = BufImgSurfaceData.createData(texturePaintImage);
+                SurfaceData textureSurfaceData = OSXOffScreenSurfaceData.createNewSurface(texturePaintImage);
                 this.fGraphicsStatesInt.put(kColorWidthIndex, texturePaintImage.getWidth());
                 this.fGraphicsStatesInt.put(kColorHeightIndex, texturePaintImage.getHeight());
                 Rectangle2D anchor = color.getAnchorRect();
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibleText.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibleText.java	Wed Jul 05 22:30:12 2017 +0200
@@ -293,6 +293,7 @@
         }, c);
     }
 
+    @SuppressWarnings("deprecation")
     static int[] getVisibleCharacterRange(final Accessible a) {
         final Accessible sa = CAccessible.getSwingAccessible(a);
         if (!(sa instanceof JTextComponent)) return null;
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDataTransferer.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDataTransferer.java	Wed Jul 05 22:30:12 2017 +0200
@@ -38,6 +38,7 @@
 import java.util.*;
 import java.util.regex.*;
 import java.awt.datatransfer.*;
+import java.nio.charset.StandardCharsets;
 import sun.awt.datatransfer.*;
 
 public class CDataTransferer extends DataTransferer {
@@ -132,7 +133,7 @@
             String charset = Charset.defaultCharset().name();
             if (transferable != null && transferable.isDataFlavorSupported(javaTextEncodingFlavor)) {
                 try {
-                    charset = new String((byte[]) transferable.getTransferData(javaTextEncodingFlavor), "UTF-8");
+                    charset = new String((byte[]) transferable.getTransferData(javaTextEncodingFlavor), StandardCharsets.UTF_8);
                 } catch (UnsupportedFlavorException cannotHappen) {
                 }
             }
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Wed Jul 05 22:30:12 2017 +0200
@@ -214,6 +214,7 @@
             this.setDefaultDragImage();
     }
 
+    @SuppressWarnings("deprecation")
     private void setDefaultDragImage(JTextComponent component) {
         DragGestureEvent trigger = getTrigger();
         int selectionStart = component.getSelectionStart();
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformLWWindow.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformLWWindow.java	Wed Jul 05 22:30:12 2017 +0200
@@ -196,7 +196,8 @@
                                   getLocalGraphicsEnvironment();
 
         LWLightweightFramePeer peer = (LWLightweightFramePeer)getPeer();
-        int scale = ((LightweightFrame)peer.getTarget()).getScaleFactor();
+        int scale =(int) Math.round(((LightweightFrame)peer.getTarget())
+                                                            .getScaleFactorX());
 
         Rectangle bounds = ((LightweightFrame)peer.getTarget()).getHostBounds();
         for (GraphicsDevice d : ge.getScreenDevices()) {
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Wed Jul 05 22:30:12 2017 +0200
@@ -25,10 +25,12 @@
 
 package sun.lwawt.macosx;
 
+import com.apple.eawt.FullScreenAdapter;
+import com.apple.eawt.FullScreenUtilities;
+import com.apple.eawt.event.FullScreenEvent;
 import java.awt.*;
 import java.awt.Dialog.ModalityType;
 import java.awt.event.*;
-import java.awt.peer.WindowPeer;
 import java.beans.*;
 import java.lang.reflect.InvocationTargetException;
 
@@ -44,6 +46,7 @@
 import com.apple.laf.*;
 import com.apple.laf.ClientPropertyApplicator.Property;
 import com.sun.awt.AWTUtilities;
+import sun.lwawt.LWWindowPeer.PeerType;
 
 public class CPlatformWindow extends CFRetainedResource implements PlatformWindow {
     private native long nativeCreateNSWindow(long nsViewPtr,long ownerPtr, long styleBits, double x, double y, double w, double h);
@@ -175,10 +178,24 @@
             c.setStyleBits(CLOSEABLE, Boolean.parseBoolean(value.toString()));
         }},
         new Property<CPlatformWindow>(WINDOW_ZOOMABLE) { public void applyProperty(final CPlatformWindow c, final Object value) {
-            c.setStyleBits(ZOOMABLE, Boolean.parseBoolean(value.toString()));
+            boolean zoomable = Boolean.parseBoolean(value.toString());
+            if (c.target instanceof RootPaneContainer
+                    && c.getPeer().getPeerType() == PeerType.FRAME) {
+                if (c.isInFullScreen && !zoomable) {
+                    c.toggleFullScreen();
+                }
+            }
+            c.setStyleBits(ZOOMABLE, zoomable);
         }},
         new Property<CPlatformWindow>(WINDOW_FULLSCREENABLE) { public void applyProperty(final CPlatformWindow c, final Object value) {
-            c.setStyleBits(FULLSCREENABLE, Boolean.parseBoolean(value.toString()));
+            boolean fullscrenable = Boolean.parseBoolean(value.toString());
+            if (c.target instanceof RootPaneContainer
+                    && c.getPeer().getPeerType() == PeerType.FRAME) {
+                if (c.isInFullScreen && !fullscrenable) {
+                    c.toggleFullScreen();
+                }
+            }
+            c.setStyleBits(FULLSCREENABLE, fullscrenable);
         }},
         new Property<CPlatformWindow>(WINDOW_SHADOW_REVALIDATE_NOW) { public void applyProperty(final CPlatformWindow c, final Object value) {
             nativeRevalidateNSWindowShadow(c.getNSWindowPtr());
@@ -210,6 +227,8 @@
     private volatile boolean isFullScreenMode;
     private boolean isFullScreenAnimationOn;
 
+    private volatile boolean isInFullScreen;
+
     private Window target;
     private LWWindowPeer peer;
     protected CPlatformView contentView;
@@ -308,6 +327,8 @@
             styleBits = SET(styleBits, RESIZABLE, resizable);
             if (!resizable) {
                 styleBits = SET(styleBits, ZOOMABLE, false);
+            } else {
+                setCanFullscreen(true);
             }
         }
 
@@ -680,9 +701,25 @@
         updateFocusabilityForAutoRequestFocus(true);
     }
 
+    private void setCanFullscreen(final boolean canFullScreen) {
+        if (target instanceof RootPaneContainer
+                && getPeer().getPeerType() == PeerType.FRAME) {
+
+            if (isInFullScreen && !canFullScreen) {
+                toggleFullScreen();
+            }
+
+            final RootPaneContainer rpc = (RootPaneContainer) target;
+            rpc.getRootPane().putClientProperty(
+                    CPlatformWindow.WINDOW_FULLSCREENABLE, canFullScreen);
+        }
+    }
+
     @Override
     public void setResizable(final boolean resizable) {
+        setCanFullscreen(resizable);
         setStyleBits(RESIZABLE, resizable);
+        setStyleBits(ZOOMABLE, resizable);
     }
 
     @Override
@@ -1074,6 +1111,7 @@
     }
 
     private void windowDidEnterFullScreen() {
+        isInFullScreen = true;
         isFullScreenAnimationOn = false;
     }
 
@@ -1082,6 +1120,7 @@
     }
 
     private void windowDidExitFullScreen() {
+        isInFullScreen = false;
         isFullScreenAnimationOn = false;
     }
 }
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.h	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.h	Wed Jul 05 22:30:12 2017 +0200
@@ -26,6 +26,7 @@
 #include <jni.h>
 #import <Foundation/Foundation.h>
 #import <AppKit/AppKit.h>
+#import <AppKit/NSTrackingArea.h>
 
 #import "CPopupMenu.h"
 
@@ -64,12 +65,14 @@
 @public
     AWTTrayIcon *trayIcon;
     NSImage* image;
+    NSTrackingArea *trackingArea;
     BOOL isHighlighted;
 }
 -(id)initWithTrayIcon:(AWTTrayIcon *)theTrayIcon;
 -(void)setHighlighted:(BOOL)aFlag;
 -(void)setImage:(NSImage*)anImage;
 -(void)setTrayIcon:(AWTTrayIcon*)theTrayIcon;
+-(void)addTrackingArea;
 
 @end //AWTTrayIconView
 
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.m	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.m	Wed Jul 05 22:30:12 2017 +0200
@@ -171,12 +171,27 @@
     [self setTrayIcon: theTrayIcon];
     isHighlighted = NO;
     image = nil;
+    trackingArea = nil;
+	
+    [self addTrackingArea];
+	
+    return self;
+}
 
-    return self;
+- (void)addTrackingArea {
+    NSTrackingAreaOptions options = NSTrackingMouseMoved | 
+                                    NSTrackingInVisibleRect | 
+                                    NSTrackingActiveAlways;
+    trackingArea = [[NSTrackingArea alloc] initWithRect: CGRectZero
+                                                options: options
+                                                owner: self
+                                                userInfo: nil];
+    [self addTrackingArea:trackingArea];
 }
 
 -(void) dealloc {
     [image release];
+    [trackingArea release];
     [super dealloc];
 }
 
@@ -269,6 +284,10 @@
     [trayIcon deliverJavaMouseEvent: event];
 }
 
+- (void) mouseMoved: (NSEvent *)event {
+    [trayIcon deliverJavaMouseEvent: event];
+}
+
 - (void) rightMouseDown:(NSEvent *)event {
     [trayIcon deliverJavaMouseEvent: event];
 }
--- a/jdk/src/java.desktop/share/classes/com/sun/beans/decoder/DocumentHandler.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/com/sun/beans/decoder/DocumentHandler.java	Wed Jul 05 22:30:12 2017 +0200
@@ -277,10 +277,12 @@
      * @param attributes  the attributes attached to the element
      */
     @Override
+    @SuppressWarnings("deprecation")
     public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
         ElementHandler parent = this.handler;
         try {
-            this.handler = getElementHandler(qName).newInstance();
+            this.handler =
+                getElementHandler(qName).newInstance();
             this.handler.setOwner(this);
             this.handler.setParent(parent);
         }
--- a/jdk/src/java.desktop/share/classes/com/sun/beans/finder/InstanceFinder.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/com/sun/beans/finder/InstanceFinder.java	Wed Jul 05 22:30:12 2017 +0200
@@ -86,6 +86,7 @@
         return null;
     }
 
+    @SuppressWarnings("deprecation")
     protected T instantiate(Class<?> type, String name) {
         if (type != null) {
             try {
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFFaxDecompressor.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFFaxDecompressor.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -101,7 +101,8 @@
         0xff  // 8
     };
 
-    // Table to be used when fillOrder = 2, for flipping bytes.
+    // Table to be used for flipping bytes when fillOrder is
+    // BaselineTIFFTagSet.FILL_ORDER_RIGHT_TO_LEFT (2).
     static byte flipTable[] = {
          0,  -128,    64,   -64,    32,   -96,    96,   -32,
         16,  -112,    80,   -48,    48,   -80,   112,   -16,
@@ -597,7 +598,8 @@
             TIFFField f;
 
             f = tmetadata.getTIFFField(BaselineTIFFTagSet.TAG_FILL_ORDER);
-            this.fillOrder = f == null ? 1 : f.getAsInt(0);
+            this.fillOrder = f == null ?
+               BaselineTIFFTagSet.FILL_ORDER_LEFT_TO_RIGHT : f.getAsInt(0);
 
             f = tmetadata.getTIFFField(BaselineTIFFTagSet.TAG_COMPRESSION);
             this.compression = f == null ?
@@ -612,7 +614,7 @@
             f = tmetadata.getTIFFField(BaselineTIFFTagSet.TAG_T6_OPTIONS);
             this.t6Options = f == null ? 0 : f.getAsInt(0);
         } else {
-            this.fillOrder = 1; // MSB-to-LSB
+            this.fillOrder = BaselineTIFFTagSet.FILL_ORDER_LEFT_TO_RIGHT;
 
             this.compression = BaselineTIFFTagSet.COMPRESSION_CCITT_RLE; // RLE
 
@@ -1458,7 +1460,7 @@
         int l = data.length - 1;
         int bp = this.bytePointer;
 
-        if (fillOrder == 1) {
+        if (fillOrder == BaselineTIFFTagSet.FILL_ORDER_LEFT_TO_RIGHT) {
             b = data[bp];
 
             if (bp == l) {
@@ -1471,7 +1473,7 @@
                 next = data[bp + 1];
                 next2next = data[bp + 2];
             }
-        } else if (fillOrder == 2) {
+        } else if (fillOrder == BaselineTIFFTagSet.FILL_ORDER_RIGHT_TO_LEFT) {
             b = flipTable[data[bp] & 0xff];
 
             if (bp == l) {
@@ -1527,14 +1529,14 @@
         int l = data.length - 1;
         int bp = this.bytePointer;
 
-        if (fillOrder == 1) {
+        if (fillOrder == BaselineTIFFTagSet.FILL_ORDER_LEFT_TO_RIGHT) {
             b = data[bp];
             if (bp == l) {
                 next = 0x00;
             } else {
                 next = data[bp + 1];
             }
-        } else if (fillOrder == 2) {
+        } else if (fillOrder == BaselineTIFFTagSet.FILL_ORDER_RIGHT_TO_LEFT) {
             b = flipTable[data[bp] & 0xff];
             if (bp == l) {
                 next = 0x00;
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java	Wed Jul 05 22:30:12 2017 +0200
@@ -49,6 +49,52 @@
     private long stripOrTileOffsetsPosition = -1;
     private long lastPosition = -1;
 
+    //
+    // A set of tag numbers corresponding to tags essential to decoding
+    // the image and metadata required to interpret its samples.
+    //
+    private static volatile Set<Integer> essentialTags = null;
+
+    private static void initializeEssentialTags() {
+        Set<Integer> tags = essentialTags;
+        if (tags == null) {
+            essentialTags = tags = Set.of(
+                BaselineTIFFTagSet.TAG_BITS_PER_SAMPLE,
+                BaselineTIFFTagSet.TAG_COLOR_MAP,
+                BaselineTIFFTagSet.TAG_COMPRESSION,
+                BaselineTIFFTagSet.TAG_EXTRA_SAMPLES,
+                BaselineTIFFTagSet.TAG_FILL_ORDER,
+                BaselineTIFFTagSet.TAG_ICC_PROFILE,
+                BaselineTIFFTagSet.TAG_IMAGE_LENGTH,
+                BaselineTIFFTagSet.TAG_IMAGE_WIDTH,
+                BaselineTIFFTagSet.TAG_JPEG_AC_TABLES,
+                BaselineTIFFTagSet.TAG_JPEG_DC_TABLES,
+                BaselineTIFFTagSet.TAG_JPEG_INTERCHANGE_FORMAT,
+                BaselineTIFFTagSet.TAG_JPEG_INTERCHANGE_FORMAT_LENGTH,
+                BaselineTIFFTagSet.TAG_JPEG_PROC,
+                BaselineTIFFTagSet.TAG_JPEG_Q_TABLES,
+                BaselineTIFFTagSet.TAG_JPEG_RESTART_INTERVAL,
+                BaselineTIFFTagSet.TAG_JPEG_TABLES,
+                BaselineTIFFTagSet.TAG_PHOTOMETRIC_INTERPRETATION,
+                BaselineTIFFTagSet.TAG_PLANAR_CONFIGURATION,
+                BaselineTIFFTagSet.TAG_PREDICTOR,
+                BaselineTIFFTagSet.TAG_REFERENCE_BLACK_WHITE,
+                BaselineTIFFTagSet.TAG_ROWS_PER_STRIP,
+                BaselineTIFFTagSet.TAG_SAMPLES_PER_PIXEL,
+                BaselineTIFFTagSet.TAG_SAMPLE_FORMAT,
+                BaselineTIFFTagSet.TAG_STRIP_BYTE_COUNTS,
+                BaselineTIFFTagSet.TAG_STRIP_OFFSETS,
+                BaselineTIFFTagSet.TAG_T4_OPTIONS,
+                BaselineTIFFTagSet.TAG_T6_OPTIONS,
+                BaselineTIFFTagSet.TAG_TILE_BYTE_COUNTS,
+                BaselineTIFFTagSet.TAG_TILE_LENGTH,
+                BaselineTIFFTagSet.TAG_TILE_OFFSETS,
+                BaselineTIFFTagSet.TAG_TILE_WIDTH,
+                BaselineTIFFTagSet.TAG_Y_CB_CR_COEFFICIENTS,
+                BaselineTIFFTagSet.TAG_Y_CB_CR_SUBSAMPLING
+            );
+        }
+    }
 
     /**
      * Converts a {@code TIFFDirectory} to a {@code TIFFIFD}.
@@ -507,6 +553,15 @@
 
         List<TIFFTagSet> tagSetList = getTagSetList();
 
+        boolean ensureEssentialTags = false;
+        TIFFTagSet baselineTagSet = null;
+        if (isPrimaryIFD && ignoreUnknownFields
+            && !tagSetList.contains(BaselineTIFFTagSet.getInstance())) {
+            ensureEssentialTags = true;
+            initializeEssentialTags();
+            baselineTagSet = BaselineTIFFTagSet.getInstance();
+        }
+
         List<Object> entries = new ArrayList<>();
         Object[] entryData = new Object[1]; // allocate once for later reuse.
 
@@ -530,6 +585,11 @@
             // Get the associated TIFFTag.
             TIFFTag tag = getTag(tagNumber, tagSetList);
 
+            if (tag == null && ensureEssentialTags
+                && essentialTags.contains(tagNumber)) {
+                tag = baselineTagSet.getTag(tagNumber);
+            }
+
             // Ignore unknown fields, fields with unknown type, and fields
             // with count out of int range.
             if((tag == null && ignoreUnknownFields)
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageReader.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageReader.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1174,7 +1174,14 @@
             int predictor = ((predictorField == null)
                     ? BaselineTIFFTagSet.PREDICTOR_NONE
                     : predictorField.getAsInt(0));
-            this.decompressor = new TIFFLZWDecompressor(predictor);
+
+            TIFFField fillOrderField
+                    = imageMetadata.getTIFFField(BaselineTIFFTagSet.TAG_FILL_ORDER);
+            int fillOrder = ((fillOrderField == null)
+                    ? BaselineTIFFTagSet.FILL_ORDER_LEFT_TO_RIGHT
+                    : fillOrderField.getAsInt(0));
+
+            this.decompressor = new TIFFLZWDecompressor(predictor, fillOrder);
         } else if (compression
                 == BaselineTIFFTagSet.COMPRESSION_JPEG) {
             this.decompressor = new TIFFJPEGDecompressor();
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFLZWDecompressor.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFLZWDecompressor.java	Wed Jul 05 22:30:12 2017 +0200
@@ -30,6 +30,10 @@
 
 class TIFFLZWDecompressor extends TIFFDecompressor {
 
+    private static final int CLEAR_CODE = 256;
+    private static final int EOI_CODE   = 257;
+    private static final int FIRST_CODE = 258;
+
     private static final int andTable[] = {
         511,
         1023,
@@ -39,6 +43,10 @@
 
     private int predictor;
 
+    // whether to reverse the bits in each byte of the input data, i.e.,
+    // convert right-to-left fill order (lsb) to left-to-right (msb).
+    private boolean flipBits;
+
     private byte[] srcData;
     private byte[] dstData;
 
@@ -51,7 +59,8 @@
     private int nextData = 0;
     private int nextBits = 0;
 
-    public TIFFLZWDecompressor(int predictor) throws IIOException {
+    public TIFFLZWDecompressor(int predictor, int fillOrder)
+        throws IIOException {
         super();
 
         if (predictor != BaselineTIFFTagSet.PREDICTOR_NONE &&
@@ -62,6 +71,8 @@
         }
 
         this.predictor = predictor;
+
+        flipBits = fillOrder == BaselineTIFFTagSet.FILL_ORDER_RIGHT_TO_LEFT;
     }
 
     public void decodeRaw(byte[] b,
@@ -88,6 +99,12 @@
         byte[] sdata = new byte[byteCount];
         stream.readFully(sdata);
 
+        if (flipBits) {
+            for (int i = 0; i < byteCount; i++) {
+                sdata[i] = TIFFFaxDecompressor.flipTable[sdata[i] & 0xff];
+            }
+        }
+
         int bytesPerRow = (srcWidth*bitsPerPixel + 7)/8;
         byte[] buf;
         int bufOffset;
@@ -133,11 +150,11 @@
         int code, oldCode = 0;
         byte[] string;
 
-        while ((code = getNextCode()) != 257) {
-            if (code == 256) {
+        while ((code = getNextCode()) != EOI_CODE) {
+            if (code == CLEAR_CODE) {
                 initializeStringTable();
                 code = getNextCode();
-                if (code == 257) {
+                if (code == EOI_CODE) {
                     break;
                 }
 
@@ -186,12 +203,12 @@
     public void initializeStringTable() {
         stringTable = new byte[4096][];
 
-        for (int i = 0; i < 256; i++) {
+        for (int i = 0; i < CLEAR_CODE; i++) {
             stringTable[i] = new byte[1];
             stringTable[i][0] = (byte)i;
         }
 
-        tableIndex = 258;
+        tableIndex = FIRST_CODE;
         bitsToGet = 9;
     }
 
@@ -281,7 +298,7 @@
             return code;
         } catch (ArrayIndexOutOfBoundsException e) {
             // Strip not terminated as expected: return EndOfInformation code.
-            return 257;
+            return EOI_CODE;
         }
     }
 }
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/SwingUtilities3.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/SwingUtilities3.java	Wed Jul 05 22:30:12 2017 +0200
@@ -88,6 +88,7 @@
      *  or {@code Applet}
      * @param isRequested the value to set vsyncRequested state to
      */
+    @SuppressWarnings("deprecation")
     public static void setVsyncRequested(Container rootContainer,
                                          boolean isRequested) {
         assert (rootContainer instanceof Applet) || (rootContainer instanceof Window);
@@ -104,6 +105,7 @@
      * @param rootContainer topmost container. Should be either Window or Applet
      * @return {@code true} if vsync painting is requested for {@code rootContainer}
      */
+    @SuppressWarnings("deprecation")
     public static boolean isVsyncRequested(Container rootContainer) {
         assert (rootContainer instanceof Applet) || (rootContainer instanceof Window);
         return Boolean.TRUE == vsyncedMap.get(rootContainer);
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1125,6 +1125,7 @@
             this.methodName = methodName;
         }
 
+        @SuppressWarnings("deprecation")
         public Object createValue(UIDefaults table) {
             try {
                 Class<?> c = Class.forName(className, true,Thread.currentThread().
@@ -1136,11 +1137,7 @@
                 Method m = c.getMethod(methodName, (Class<?>[])null);
 
                 return m.invoke(c, (Object[])null);
-            } catch (ClassNotFoundException cnfe) {
-            } catch (IllegalAccessException iae) {
-            } catch (InvocationTargetException ite) {
-            } catch (NoSuchMethodException nsme) {
-            } catch (InstantiationException ie) {
+            } catch (ReflectiveOperationException e) {
             }
             return null;
         }
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -29,6 +29,7 @@
 import com.sun.java.swing.plaf.gtk.GTKConstants.ShadowType;
 
 import javax.swing.plaf.ColorUIResource;
+import javax.swing.plaf.basic.BasicInternalFrameTitlePane;
 import javax.swing.plaf.synth.*;
 
 import java.awt.*;
@@ -40,7 +41,6 @@
 import java.util.*;
 
 import javax.swing.*;
-import javax.swing.border.*;
 
 import javax.xml.parsers.*;
 import org.xml.sax.SAXException;
@@ -226,12 +226,8 @@
         JComponent titlePane = (JComponent)button.getParent();
         Container titlePaneParent = titlePane.getParent();
 
-        JInternalFrame jif;
-        if (titlePaneParent instanceof JInternalFrame) {
-            jif = (JInternalFrame)titlePaneParent;
-        } else if (titlePaneParent instanceof JInternalFrame.JDesktopIcon) {
-            jif = ((JInternalFrame.JDesktopIcon)titlePaneParent).getInternalFrame();
-        } else {
+        JInternalFrame jif = findInternalFrame(titlePaneParent);
+        if (jif == null) {
             return;
         }
 
@@ -332,6 +328,19 @@
         }
     }
 
+    JInternalFrame findInternalFrame(Component comp) {
+        if (comp.getParent() instanceof BasicInternalFrameTitlePane) {
+            comp = comp.getParent();
+        }
+        if (comp instanceof JInternalFrame) {
+            return  (JInternalFrame)comp;
+        } else if (comp instanceof JInternalFrame.JDesktopIcon) {
+            return ((JInternalFrame.JDesktopIcon)comp).getInternalFrame();
+        }
+        assert false : "cannot find the internal frame";
+        return null;
+    }
+
     void paintFrameBorder(SynthContext context, Graphics g, int x0, int y0, int width, int height) {
         updateFrameGeometry(context);
 
@@ -343,13 +352,8 @@
             return;
         }
 
-        JInternalFrame jif = null;
-        if (comp instanceof JInternalFrame) {
-            jif = (JInternalFrame)comp;
-        } else if (comp instanceof JInternalFrame.JDesktopIcon) {
-            jif = ((JInternalFrame.JDesktopIcon)comp).getInternalFrame();
-        } else {
-            assert false : "component is not JInternalFrame or JInternalFrame.JDesktopIcon";
+        JInternalFrame jif = findInternalFrame(comp);
+        if (jif == null) {
             return;
         }
 
@@ -1467,13 +1471,8 @@
         JComponent comp = context.getComponent();
         JComponent titlePane = findChild(comp, "InternalFrame.northPane");
 
-        JInternalFrame jif = null;
-        if (comp instanceof JInternalFrame) {
-            jif = (JInternalFrame)comp;
-        } else if (comp instanceof JInternalFrame.JDesktopIcon) {
-            jif = ((JInternalFrame.JDesktopIcon)comp).getInternalFrame();
-        } else {
-            assert false : "component is not JInternalFrame or JInternalFrame.JDesktopIcon";
+        JInternalFrame jif = findInternalFrame(comp);
+        if (jif == null) {
             return;
         }
 
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextUI.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextUI.java	Wed Jul 05 22:30:12 2017 +0200
@@ -124,6 +124,7 @@
          * @param g the graphics context
          * @see #damage
          */
+        @SuppressWarnings("deprecation")
         public void paint(Graphics g) {
             if(isVisible()) {
                 try {
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTextFieldUI.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTextFieldUI.java	Wed Jul 05 22:30:12 2017 +0200
@@ -132,6 +132,7 @@
                 this.r = r;
             }
 
+            @SuppressWarnings("deprecation")
             public void run() {
                 JTextField field = (JTextField) getComponent();
                 if (field != null) {
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTextUI.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTextUI.java	Wed Jul 05 22:30:12 2017 +0200
@@ -93,6 +93,7 @@
          * @param bounds the bounding box for the highlight
          * @param c the editor
          */
+        @SuppressWarnings("deprecation")
         public void paint(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c) {
             Rectangle alloc = bounds.getBounds();
             try {
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/JARSoundbankReader.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/JARSoundbankReader.java	Wed Jul 05 22:30:12 2017 +0200
@@ -70,6 +70,7 @@
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public Soundbank getSoundbank(URL url)
             throws InvalidMidiDataException, IOException {
         if (!isZIP(url))
@@ -93,9 +94,7 @@
                             Object o = c.newInstance();
                             soundbanks.add((Soundbank) o);
                         }
-                    } catch (ClassNotFoundException ignored) {
-                    } catch (InstantiationException ignored) {
-                    } catch (IllegalAccessException ignored) {
+                    } catch (ReflectiveOperationException ignored) {
                     }
                 }
                 line = r.readLine();
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java	Wed Jul 05 22:30:12 2017 +0200
@@ -55,6 +55,7 @@
  * @author Arthur van Hoff, Kara Kytle, Jan Borgersen
  * @author Florian Bomers
  */
+@SuppressWarnings("deprecation")
 public final class JavaSoundAudioClip implements AudioClip, MetaEventListener, LineListener {
 
     private static final boolean DEBUG = false;
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/ModelAbstractOscillator.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/ModelAbstractOscillator.java	Wed Jul 05 22:30:12 2017 +0200
@@ -134,13 +134,12 @@
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public ModelOscillatorStream open(float samplerate) {
         ModelAbstractOscillator oscs;
         try {
             oscs = this.getClass().newInstance();
-        } catch (InstantiationException e) {
-            throw new IllegalArgumentException(e);
-        } catch (IllegalAccessException e) {
+        } catch (ReflectiveOperationException e) {
             throw new IllegalArgumentException(e);
         }
         oscs.setSampleRate(samplerate);
--- a/jdk/src/java.desktop/share/classes/java/awt/Component.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/java/awt/Component.java	Wed Jul 05 22:30:12 2017 +0200
@@ -4016,6 +4016,7 @@
          * {@code true}.
          * @see #createBuffers(int, BufferCapabilities)
          */
+        @SuppressWarnings("deprecation")
         protected FlipBufferStrategy(int numBuffers, BufferCapabilities caps)
             throws AWTException
         {
@@ -8133,6 +8134,7 @@
         return res;
     }
 
+    @SuppressWarnings("deprecation")
     final Component getNextFocusCandidate() {
         Container rootAncestor = getTraversalRoot();
         Component comp = this;
--- a/jdk/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java	Wed Jul 05 22:30:12 2017 +0200
@@ -75,6 +75,7 @@
     private LinkedList<KeyEvent> enqueuedKeyEvents = new LinkedList<KeyEvent>();
     private LinkedList<TypeAheadMarker> typeAheadMarkers = new LinkedList<TypeAheadMarker>();
     private boolean consumeNextKeyTyped;
+    private Component restoreFocusTo;
 
     static {
         AWTAccessor.setDefaultKeyboardFocusManagerAccessor(
@@ -145,19 +146,24 @@
     }
     private boolean restoreFocus(Window aWindow, Component vetoedComponent,
                                  boolean clearOnFailure) {
+        restoreFocusTo = null;
         Component toFocus =
             KeyboardFocusManager.getMostRecentFocusOwner(aWindow);
 
         if (toFocus != null && toFocus != vetoedComponent) {
-            Component heavyweight = getHeavyweight(aWindow);
-            if (heavyweight != null) {
-                setNativeFocusOwner(heavyweight);
-                Toolkit.getEventQueue().createSecondaryLoop(
-                        () -> getGlobalFocusedWindow() != aWindow, null, 50)
-                        .enter();
-            }
-            if (getGlobalFocusedWindow() == aWindow &&
-                              doRestoreFocus(toFocus, vetoedComponent, false)) {
+            if (getHeavyweight(aWindow) != getNativeFocusOwner()) {
+                // cannot restore focus synchronously
+                if (!toFocus.isShowing() || !toFocus.canBeFocusOwner()) {
+                    toFocus = toFocus.getNextFocusCandidate();
+                }
+                if (toFocus != null && toFocus != vetoedComponent) {
+                    if (!toFocus.requestFocus(false,
+                                                   FocusEvent.Cause.ROLLBACK)) {
+                        restoreFocusTo = toFocus;
+                    }
+                    return true;
+                }
+            } else if (doRestoreFocus(toFocus, vetoedComponent, false)) {
                 return true;
             }
         }
@@ -423,6 +429,8 @@
                     // may cause deadlock, thus we don't synchronize this block.
                     Component toFocus = KeyboardFocusManager.
                         getMostRecentFocusOwner(newFocusedWindow);
+                    boolean isFocusRestore = restoreFocusTo != null &&
+                                                      toFocus == restoreFocusTo;
                     if ((toFocus == null) &&
                         newFocusedWindow.isFocusableWindow())
                     {
@@ -441,7 +449,10 @@
                                        tempLost, toFocus);
                     }
                     if (tempLost != null) {
-                        tempLost.requestFocusInWindow(FocusEvent.Cause.ACTIVATION);
+                        tempLost.requestFocusInWindow(
+                                    isFocusRestore && tempLost == toFocus ?
+                                                FocusEvent.Cause.ROLLBACK :
+                                                FocusEvent.Cause.ACTIVATION);
                     }
 
                     if (toFocus != null && toFocus != tempLost) {
@@ -450,6 +461,7 @@
                         toFocus.requestFocusInWindow(FocusEvent.Cause.ACTIVATION);
                     }
                 }
+                restoreFocusTo = null;
 
                 Window realOppositeWindow = this.realOppositeWindowWR.get();
                 if (realOppositeWindow != we.getOppositeWindow()) {
@@ -499,6 +511,7 @@
             }
 
             case FocusEvent.FOCUS_GAINED: {
+                restoreFocusTo = null;
                 FocusEvent fe = (FocusEvent)e;
                 Component oldFocusOwner = getGlobalFocusOwner();
                 Component newFocusOwner = fe.getComponent();
--- a/jdk/src/java.desktop/share/classes/java/awt/GraphicsEnvironment.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/java/awt/GraphicsEnvironment.java	Wed Jul 05 22:30:12 2017 +0200
@@ -108,7 +108,7 @@
                 ClassLoader cl = ClassLoader.getSystemClassLoader();
                 geCls = Class.forName(nm, true, cl);
             }
-            ge = (GraphicsEnvironment)geCls.newInstance();
+            ge = (GraphicsEnvironment)geCls.getConstructor().newInstance();
 //          long t1 = System.currentTimeMillis();
 //          System.out.println("GE creation took " + (t1-t0)+ "ms.");
             if (isHeadless()) {
@@ -116,12 +116,9 @@
             }
         } catch (ClassNotFoundException e) {
             throw new Error("Could not find class: "+nm);
-        } catch (InstantiationException e) {
+        } catch (ReflectiveOperationException | IllegalArgumentException e) {
             throw new Error("Could not instantiate Graphics Environment: "
                             + nm);
-        } catch (IllegalAccessException e) {
-            throw new Error ("Could not access Graphics Environment: "
-                             + nm);
         }
         return ge;
     }
--- a/jdk/src/java.desktop/share/classes/java/awt/Taskbar.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/java/awt/Taskbar.java	Wed Jul 05 22:30:12 2017 +0200
@@ -407,10 +407,21 @@
     }
 
     /**
-     * Displays progress for specified window.
+     * Displays a determinate progress bar in the task area for the specified
+     * window.
+     * <br>
+     * The visual behavior is platform and {@link State} dependent.
+     * <br>
+     * This call cancels the {@link State#INDETERMINATE INDETERMINATE} state
+     * of the window.
+     * <br>
+     * Note that when multiple windows is grouped in the task area
+     * the behavior is platform specific.
      *
      * @param w window to update
-     * @param value from 0 to 100, other to disable progress indication
+     * @param value from 0 to 100, other to switch to {@link State#OFF} state
+     *              and disable progress indication
+     * @see #setWindowProgressState(java.awt.Window, State)
      * @throws SecurityException if a security manager exists and it denies the
      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
      * @throws UnsupportedOperationException if the current platform
@@ -426,14 +437,21 @@
 
     /**
      * Sets a progress state for a specified window.
+     * <br>
+     * Each state displays a progress in a platform-dependent way.
+     * <br>
+     * Note than switching from {@link State#INDETERMINATE INDETERMINATE} state
+     * to any of determinate states may reset value set by
+     * {@link #setWindowProgressValue(java.awt.Window, int) setWindowProgressValue}
      *
      * @param w window
      * @param state to change to
      * @see State#OFF
      * @see State#NORMAL
      * @see State#PAUSED
+     * @see State#ERROR
      * @see State#INDETERMINATE
-     * @see State#ERROR
+     * @see #setWindowProgressValue(java.awt.Window, int)
      * @throws SecurityException if a security manager exists and it denies the
      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
      * @throws UnsupportedOperationException if the current platform
--- a/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java	Wed Jul 05 22:30:12 2017 +0200
@@ -468,7 +468,7 @@
     private static void fallbackToLoadClassForAT(String atName) {
         try {
             Class<?> c = Class.forName(atName, false, ClassLoader.getSystemClassLoader());
-            c.newInstance();
+            c.getConstructor().newInstance();
         } catch (ClassNotFoundException e) {
             newAWTError(e, "Assistive Technology not found: " + atName);
         } catch (InstantiationException e) {
@@ -583,15 +583,13 @@
                     }
                     try {
                         if (cls != null) {
-                            toolkit = (Toolkit)cls.newInstance();
+                            toolkit = (Toolkit)cls.getConstructor().newInstance();
                             if (GraphicsEnvironment.isHeadless()) {
                                 toolkit = new HeadlessToolkit(toolkit);
                             }
                         }
-                    } catch (final InstantiationException ignored) {
-                        throw new AWTError("Could not instantiate Toolkit: " + nm);
-                    } catch (final IllegalAccessException ignored) {
-                        throw new AWTError("Could not access Toolkit: " + nm);
+                    } catch (final ReflectiveOperationException ignored) {
+                        throw new AWTError("Could not create Toolkit: " + nm);
                     }
                     return null;
                 }
--- a/jdk/src/java.desktop/share/classes/java/awt/print/PrinterJob.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/java/awt/print/PrinterJob.java	Wed Jul 05 22:30:12 2017 +0200
@@ -79,13 +79,12 @@
             public PrinterJob run() {
                 String nm = System.getProperty("java.awt.printerjob", null);
                 try {
-                    return (PrinterJob)Class.forName(nm).newInstance();
+                    return (PrinterJob)Class.forName(nm).
+                                             getConstructor().newInstance();
                 } catch (ClassNotFoundException e) {
                     throw new AWTError("PrinterJob not found: " + nm);
-                } catch (InstantiationException e) {
+                } catch (ReflectiveOperationException e) {
                  throw new AWTError("Could not instantiate PrinterJob: " + nm);
-                } catch (IllegalAccessException e) {
-                    throw new AWTError("Could not access PrinterJob: " + nm);
                 }
             }
         });
--- a/jdk/src/java.desktop/share/classes/java/beans/AppletInitializer.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/java/beans/AppletInitializer.java	Wed Jul 05 22:30:12 2017 +0200
@@ -44,6 +44,7 @@
  */
 
 
+@SuppressWarnings("deprecation")
 public interface AppletInitializer {
 
     /**
--- a/jdk/src/java.desktop/share/classes/java/beans/Beans.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/java/beans/Beans.java	Wed Jul 05 22:30:12 2017 +0200
@@ -154,7 +154,7 @@
      * @exception IOException if an I/O error occurs.
      * @since 1.2
      */
-
+    @SuppressWarnings("deprecation")
     public static Object instantiate(ClassLoader cls, String beanName, BeanContext beanContext, AppletInitializer initializer)
                         throws IOException, ClassNotFoundException {
 
@@ -501,7 +501,7 @@
  * Package private support class.  This provides a default AppletContext
  * for beans which are applets.
  */
-
+@SuppressWarnings("deprecation")
 class BeansAppletContext implements AppletContext {
     Applet target;
     Hashtable<URL,Object> imageCache = new Hashtable<>();
@@ -586,6 +586,7 @@
  * Package private support class.  This provides an AppletStub
  * for beans which are applets.
  */
+@SuppressWarnings("deprecation")
 class BeansAppletStub implements AppletStub {
     transient boolean active;
     transient Applet target;
--- a/jdk/src/java.desktop/share/classes/java/beans/Introspector.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/java/beans/Introspector.java	Wed Jul 05 22:30:12 2017 +0200
@@ -36,6 +36,7 @@
 import java.lang.ref.Reference;
 import java.lang.ref.SoftReference;
 import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
 
@@ -1278,8 +1279,10 @@
      * First try the classloader of "sibling", then try the system
      * classloader then the class loader of the current Thread.
      */
+    @SuppressWarnings("deprecation")
     static Object instantiate(Class<?> sibling, String className)
                  throws InstantiationException, IllegalAccessException,
+                        NoSuchMethodException, InvocationTargetException,
                                                 ClassNotFoundException {
         // First check with sibling's classloader (if any).
         ClassLoader cl = sibling.getClassLoader();
--- a/jdk/src/java.desktop/share/classes/java/beans/MetaData.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/java/beans/MetaData.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1219,7 +1219,7 @@
         internalPersistenceDelegates.put("java.sql.Time", new java_util_Date_PersistenceDelegate());
     }
 
-    @SuppressWarnings("rawtypes")
+    @SuppressWarnings({"rawtypes", "deprecation"})
     public static synchronized PersistenceDelegate getPersistenceDelegate(Class type) {
         if (type == null) {
             return nullPersistenceDelegate;
@@ -1261,7 +1261,7 @@
             internalPersistenceDelegates.put(typeName, defaultPersistenceDelegate);
             try {
                 String name =  type.getName();
-                Class c = Class.forName("java.beans.MetaData$" + name.replace('.', '_')
+                Class<?> c = Class.forName("java.beans.MetaData$" + name.replace('.', '_')
                                         + "_PersistenceDelegate");
                 pd = (PersistenceDelegate)c.newInstance();
                 internalPersistenceDelegates.put(typeName, pd);
--- a/jdk/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java	Wed Jul 05 22:30:12 2017 +0200
@@ -461,6 +461,7 @@
      *         not been defined or cannot be created
      * @since 1.5
      */
+    @SuppressWarnings("deprecation")
     public PropertyEditor createPropertyEditor(Object bean) {
         Object editor = null;
 
--- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioFileFormat.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioFileFormat.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Objects;
 
 /**
  * An instance of the {@code AudioFileFormat} class describes an audio file,
@@ -344,7 +345,7 @@
          * @param  extension the string that commonly marks the file type
          *         without leading dot
          */
-        public Type(String name, String extension) {
+        public Type(final String name, final String extension) {
             this.name = name;
             this.extension = extension;
         }
@@ -353,14 +354,14 @@
          * Finalizes the equals method.
          */
         @Override
-        public final boolean equals(Object obj) {
-            if (toString() == null) {
-                return (obj != null) && (obj.toString() == null);
+        public final boolean equals(final Object obj) {
+            if (this == obj) {
+                return true;
             }
-            if (obj instanceof Type) {
-                return toString().equals(obj.toString());
+            if (!(obj instanceof Type)) {
+                return false;
             }
-            return false;
+            return Objects.equals(name, ((Type) obj).name);
         }
 
         /**
@@ -368,10 +369,7 @@
          */
         @Override
         public final int hashCode() {
-            if (toString() == null) {
-                return 0;
-            }
-            return toString().hashCode();
+            return name != null ? name.hashCode() : 0;
         }
 
         /**
--- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioFormat.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioFormat.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Objects;
 
 /**
  * {@code AudioFormat} is the class that specifies a particular arrangement of
@@ -599,7 +600,7 @@
          *
          * @param  name the name of the new type of encoding
          */
-        public Encoding(String name) {
+        public Encoding(final String name) {
             this.name = name;
         }
 
@@ -607,14 +608,14 @@
          * Finalizes the equals method.
          */
         @Override
-        public final boolean equals(Object obj) {
-            if (toString() == null) {
-                return (obj != null) && (obj.toString() == null);
+        public final boolean equals(final Object obj) {
+            if (this == obj) {
+                return true;
             }
-            if (obj instanceof Encoding) {
-                return toString().equals(obj.toString());
+            if (!(obj instanceof Encoding)) {
+                return false;
             }
-            return false;
+            return Objects.equals(name, ((Encoding) obj).name);
         }
 
         /**
@@ -622,10 +623,7 @@
          */
         @Override
         public final int hashCode() {
-            if (toString() == null) {
-                return 0;
-            }
-            return toString().hashCode();
+            return name != null ? name.hashCode() : 0;
         }
 
         /**
--- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/spi/AudioFileWriter.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/spi/AudioFileWriter.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -129,7 +129,7 @@
      *         system
      * @throws NullPointerException if {@code stream} or {@code fileType} or
      *         {@code out} are {@code null}
-     * @see #isFileTypeSupported(AudioFileFormat.Type, AudioInputStream)
+     * @see #isFileTypeSupported(Type, AudioInputStream)
      * @see #getAudioFileTypes
      */
     public abstract int write(AudioInputStream stream, Type fileType,
@@ -149,7 +149,7 @@
      *         the system
      * @throws NullPointerException if {@code stream} or {@code fileType} or
      *         {@code out} are {@code null}
-     * @see #isFileTypeSupported
+     * @see #isFileTypeSupported(Type, AudioInputStream)
      * @see #getAudioFileTypes
      */
     public abstract int write(AudioInputStream stream, Type fileType, File out)
--- a/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java	Wed Jul 05 22:30:12 2017 +0200
@@ -555,6 +555,7 @@
      * @see #setComponentPopupMenu
      * @since 1.5
      */
+    @SuppressWarnings("deprecation")
     public JPopupMenu getComponentPopupMenu() {
 
         if(!getInheritsPopupMenu()) {
@@ -2913,6 +2914,7 @@
      * @param pressed true if the key is pressed
      * @return true if there is a key binding for <code>e</code>
      */
+    @SuppressWarnings("deprecation")
     boolean processKeyBindings(KeyEvent e, boolean pressed) {
       if (!SwingUtilities.isValidKeyEventForKeyBindings(e)) {
           return false;
@@ -4457,6 +4459,7 @@
      *          return value for this method
      * @see #getVisibleRect
      */
+    @SuppressWarnings("deprecation")
     static final void computeVisibleRect(Component c, Rectangle visibleRect) {
         Container p = c.getParent();
         Rectangle bounds = c.getBounds();
@@ -4625,6 +4628,7 @@
      *          or <code>null</code> if not in any container
      */
     @BeanProperty(bound = false)
+    @SuppressWarnings("deprecation")
     public Container getTopLevelAncestor() {
         for(Container p = this; p != null; p = p.getParent()) {
             if(p instanceof Window || p instanceof Applet) {
@@ -5032,6 +5036,7 @@
         this.paintingChild = paintingChild;
     }
 
+    @SuppressWarnings("deprecation")
     void _paintImmediately(int x, int y, int w, int h) {
         Graphics g;
         Container c;
--- a/jdk/src/java.desktop/share/classes/javax/swing/JEditorPane.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JEditorPane.java	Wed Jul 05 22:30:12 2017 +0200
@@ -825,6 +825,7 @@
      *
      * @param reference the named location to scroll to
      */
+    @SuppressWarnings("deprecation")
     public void scrollToReference(String reference) {
         Document d = getDocument();
         if (d instanceof HTMLDocument) {
@@ -1179,6 +1180,7 @@
      * @return the editor kit, or <code>null</code> if there is nothing
      *   registered for the given type
      */
+    @SuppressWarnings("deprecation")
     public static EditorKit createEditorKitForContentType(String type) {
         Hashtable<String, EditorKit> kitRegistry = getKitRegisty();
         EditorKit k = kitRegistry.get(type);
--- a/jdk/src/java.desktop/share/classes/javax/swing/JTable.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JTable.java	Wed Jul 05 22:30:12 2017 +0200
@@ -6043,6 +6043,7 @@
             this.focusManager = fm;
         }
 
+        @SuppressWarnings("deprecation")
         public void propertyChange(PropertyChangeEvent ev) {
             if (!isEditing() || getClientProperty("terminateEditOnFocusLost") != Boolean.TRUE) {
                 return;
--- a/jdk/src/java.desktop/share/classes/javax/swing/JViewport.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JViewport.java	Wed Jul 05 22:30:12 2017 +0200
@@ -27,6 +27,12 @@
 
 import java.awt.*;
 import java.awt.event.*;
+import java.awt.geom.AffineTransform;
+import static java.awt.geom.AffineTransform.TYPE_FLIP;
+import static java.awt.geom.AffineTransform.TYPE_MASK_SCALE;
+import static java.awt.geom.AffineTransform.TYPE_TRANSLATION;
+import java.awt.image.AbstractMultiResolutionImage;
+import java.awt.image.ImageObserver;
 import java.awt.peer.ComponentPeer;
 import java.beans.BeanProperty;
 import java.beans.Transient;
@@ -37,6 +43,8 @@
 import javax.accessibility.*;
 
 import java.io.Serializable;
+import java.util.Arrays;
+import java.util.Collections;
 
 import sun.awt.AWTAccessor;
 
@@ -739,7 +747,43 @@
             g.clipRect(0, 0, viewBounds.width, viewBounds.height);
         }
 
-        if (backingStoreImage == null) {
+        boolean recreateBackingStoreImage = (backingStoreImage == null);
+        int scaledWidth = width;
+        int scaledHeight = height;
+
+        if (g instanceof Graphics2D) {
+            double sw = width;
+            double sh = height;
+            Graphics2D g2d = (Graphics2D) g;
+            AffineTransform tx = g2d.getTransform();
+            int type = tx.getType();
+            if ((type & ~(TYPE_TRANSLATION | TYPE_FLIP)) == 0) {
+                // skip
+            } else if ((type & ~(TYPE_TRANSLATION | TYPE_FLIP | TYPE_MASK_SCALE)) == 0) {
+                sw = Math.abs(width * tx.getScaleX());
+                sh = Math.abs(height * tx.getScaleY());
+            } else {
+                sw = Math.abs(width * Math.hypot(tx.getScaleX(), tx.getShearY()));
+                sh = Math.abs(height * Math.hypot(tx.getShearX(), tx.getScaleY()));
+            }
+
+            scaledWidth = (int) Math.ceil(sw);
+            scaledHeight = (int) Math.ceil(sh);
+
+            if (!recreateBackingStoreImage) {
+                if (backingStoreImage instanceof BackingStoreMultiResolutionImage) {
+                    BackingStoreMultiResolutionImage mrImage
+                            = (BackingStoreMultiResolutionImage) backingStoreImage;
+                    recreateBackingStoreImage = (mrImage.scaledWidth != scaledWidth
+                            || mrImage.scaledHeight != scaledHeight);
+                } else {
+                    recreateBackingStoreImage = (width != scaledWidth
+                            || height != scaledHeight);
+                }
+            }
+        }
+
+        if (recreateBackingStoreImage) {
             // Backing store is enabled but this is the first call to paint.
             // Create the backing store, paint it and then copy to g.
             // The backing store image will be created with the size of
@@ -747,7 +791,8 @@
             // same size, otherwise when scrolling the backing image
             // the region outside of the clipped region will not be painted,
             // and result in empty areas.
-            backingStoreImage = createImage(width, height);
+            backingStoreImage = createScaledImage(width, height,
+                                                  scaledWidth, scaledHeight);
             Rectangle clip = g.getClipBounds();
             if (clip.width != width || clip.height != height) {
                 if (!isOpaque()) {
@@ -815,6 +860,74 @@
         scrollUnderway = false;
     }
 
+    private Image createScaledImage(final int width, final int height,
+                                    int scaledWidth, int scaledHeight)
+    {
+        if (scaledWidth == width && scaledHeight == height) {
+            return createImage(width, height);
+        }
+
+        Image rvImage = createImage(scaledWidth, scaledHeight);
+
+        return new BackingStoreMultiResolutionImage(width, height,
+                scaledWidth, scaledHeight, rvImage);
+    }
+
+    static class BackingStoreMultiResolutionImage
+            extends AbstractMultiResolutionImage {
+
+        private final int width;
+        private final int height;
+        private final int scaledWidth;
+        private final int scaledHeight;
+        private final Image rvImage;
+
+        public BackingStoreMultiResolutionImage(int width, int height,
+                int scaledWidth, int scaledHeight, Image rvImage) {
+            this.width = width;
+            this.height = height;
+            this.scaledWidth = scaledWidth;
+            this.scaledHeight = scaledHeight;
+            this.rvImage = rvImage;
+        }
+
+        @Override
+        public int getWidth(ImageObserver observer) {
+            return width;
+        }
+
+        @Override
+        public int getHeight(ImageObserver observer) {
+            return height;
+        }
+
+        @Override
+        protected Image getBaseImage() {
+            return rvImage;
+        }
+
+        @Override
+        public Graphics getGraphics() {
+            Graphics graphics = rvImage.getGraphics();
+            if (graphics instanceof Graphics2D) {
+                double sx = (double) scaledWidth / width;
+                double sy = (double) scaledHeight / height;
+                ((Graphics2D) graphics).scale(sx, sy);
+            }
+            return graphics;
+        }
+
+        @Override
+        public Image getResolutionVariant(double w, double h) {
+            return rvImage;
+        }
+
+        @Override
+        public java.util.List<Image> getResolutionVariants() {
+            return Collections.unmodifiableList(Arrays.asList(rvImage));
+        }
+    }
+
 
     /**
      * Sets the bounds of this viewport.  If the viewport's width
--- a/jdk/src/java.desktop/share/classes/javax/swing/KeyboardManager.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/KeyboardManager.java	Wed Jul 05 22:30:12 2017 +0200
@@ -137,6 +137,7 @@
      /**
        * Find the top focusable Window, Applet, or InternalFrame
        */
+     @SuppressWarnings("deprecation")
      private static Container getTopAncestor(JComponent c) {
         for(Container p = c.getParent(); p != null; p = p.getParent()) {
             if (p instanceof Window && ((Window)p).isFocusableWindow() ||
--- a/jdk/src/java.desktop/share/classes/javax/swing/PopupFactory.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/PopupFactory.java	Wed Jul 05 22:30:12 2017 +0200
@@ -614,6 +614,7 @@
          * Returns true if popup can fit the screen and the owner's top parent.
          * It determines can popup be lightweight or mediumweight.
          */
+        @SuppressWarnings("deprecation")
         boolean fitsOnScreen() {
             boolean result = false;
             Component component = getComponent();
@@ -783,6 +784,8 @@
             component.removeAll();
             recycleLightWeightPopup(this);
         }
+
+        @SuppressWarnings("deprecation")
         public void show() {
             Container parent = null;
 
@@ -938,6 +941,8 @@
             rootPane.getContentPane().removeAll();
             recycleMediumWeightPopup(this);
         }
+
+        @SuppressWarnings("deprecation")
         public void show() {
             Component component = getComponent();
             Container parent = null;
--- a/jdk/src/java.desktop/share/classes/javax/swing/RepaintManager.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/RepaintManager.java	Wed Jul 05 22:30:12 2017 +0200
@@ -408,6 +408,7 @@
      *
      * @see JComponent#repaint
      */
+    @SuppressWarnings("deprecation")
     private void addDirtyRegion0(Container c, int x, int y, int w, int h) {
         /* Special cases we don't have to bother with.
          */
@@ -521,10 +522,12 @@
      * @see JApplet#repaint
      * @since 1.6
      */
+    @SuppressWarnings("deprecation")
     public void addDirtyRegion(Applet applet, int x, int y, int w, int h) {
         addDirtyRegion0(applet, x, y, w, h);
     }
 
+    @SuppressWarnings("deprecation")
     void scheduleHeavyWeightPaints() {
         Map<Container,Rectangle> hws;
 
--- a/jdk/src/java.desktop/share/classes/javax/swing/SwingUtilities.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/SwingUtilities.java	Wed Jul 05 22:30:12 2017 +0200
@@ -416,6 +416,7 @@
      * @param p  a Point object (converted to the new coordinate system)
      * @param c  a Component object
      */
+    @SuppressWarnings("deprecation")
     public static void convertPointToScreen(Point p,Component c) {
             Rectangle b;
             int x,y;
@@ -455,6 +456,7 @@
      * @param p  a Point object (converted to the new coordinate system)
      * @param c  a Component object
      */
+    @SuppressWarnings("deprecation")
     public static void convertPointFromScreen(Point p,Component c) {
         Rectangle b;
         int x,y;
@@ -1655,6 +1657,7 @@
      * @param c the component
      * @return the first ancestor of c that's a Window or the last Applet ancestor
      */
+    @SuppressWarnings("deprecation")
     public static Component getRoot(Component c) {
         Component applet = null;
         for(Component p = c; p != null; p = p.getParent()) {
@@ -1695,6 +1698,7 @@
      * @return true if a binding has found and processed
      * @since 1.4
      */
+    @SuppressWarnings("deprecation")
     public static boolean processKeyBindings(KeyEvent event) {
         if (event != null) {
             if (event.isConsumed()) {
@@ -2209,6 +2213,7 @@
      * @see java.awt.Component#isVisible()
      * @since 1.7
      */
+    @SuppressWarnings("deprecation")
     static Container getValidateRoot(Container c, boolean visibleOnly) {
         Container root = null;
 
--- a/jdk/src/java.desktop/share/classes/javax/swing/ToolTipManager.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/ToolTipManager.java	Wed Jul 05 22:30:12 2017 +0200
@@ -753,6 +753,7 @@
   // Returns: 0 no adjust
   //         -1 can't fit
   //         >0 adjust value by amount returned
+ @SuppressWarnings("deprecation")
   private int getPopupFitWidth(Rectangle popupRectInScreen, Component invoker){
     if (invoker != null){
       Container parent;
@@ -778,6 +779,7 @@
 
   // Returns:  0 no adjust
   //          >0 adjust by value return
+  @SuppressWarnings("deprecation")
   private int getPopupFitHeight(Rectangle popupRectInScreen, Component invoker){
     if (invoker != null){
       Container parent;
--- a/jdk/src/java.desktop/share/classes/javax/swing/UIManager.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/UIManager.java	Wed Jul 05 22:30:12 2017 +0200
@@ -513,6 +513,7 @@
      *
      * @since 9
      */
+    @SuppressWarnings("deprecation")
     public static LookAndFeel createLookAndFeel(String name)
             throws UnsupportedLookAndFeelException {
         Objects.requireNonNull(name);
@@ -526,14 +527,16 @@
                 if (info.getName().equals(name)) {
                     Class<?> cls = Class.forName(UIManager.class.getModule(),
                                                  info.getClassName());
-                    LookAndFeel laf = (LookAndFeel) cls.newInstance();
+                    LookAndFeel laf =
+                        (LookAndFeel) cls.newInstance();
                     if (!laf.isSupportedLookAndFeel()) {
                         break;
                     }
                     return laf;
                 }
             }
-        } catch (InstantiationException | IllegalAccessException ignore) {
+        } catch (ReflectiveOperationException |
+                 IllegalArgumentException ignore) {
         }
 
         throw new UnsupportedLookAndFeelException(name);
@@ -613,6 +616,7 @@
      * @throws ClassCastException if {@code className} does not identify
      *         a class that extends {@code LookAndFeel}
      */
+    @SuppressWarnings("deprecation")
     public static void setLookAndFeel(String className)
         throws ClassNotFoundException,
                InstantiationException,
@@ -625,7 +629,16 @@
         }
         else {
             Class<?> lnfClass = SwingUtilities.loadSystemClass(className);
-            setLookAndFeel((LookAndFeel)(lnfClass.newInstance()));
+            try {
+                LookAndFeel laf =
+                    (LookAndFeel)lnfClass.newInstance();
+                setLookAndFeel(laf);
+            } catch (ReflectiveOperationException | IllegalArgumentException e) {
+                InstantiationException ex =
+                    new InstantiationException("Wrapped Exception");
+                ex.initCause(e);
+                throw ex;
+            }
         }
     }
 
@@ -1086,6 +1099,7 @@
     /**
      * Finds the Multiplexing <code>LookAndFeel</code>.
      */
+    @SuppressWarnings("deprecation")
     private static LookAndFeel getMultiLookAndFeel() {
         LookAndFeel multiLookAndFeel = getLAFState().multiLookAndFeel;
         if (multiLookAndFeel == null) {
@@ -1093,7 +1107,8 @@
             String className = getLAFState().swingProps.getProperty(multiplexingLAFKey, defaultName);
             try {
                 Class<?> lnfClass = SwingUtilities.loadSystemClass(className);
-                multiLookAndFeel = (LookAndFeel)lnfClass.newInstance();
+                multiLookAndFeel =
+                        (LookAndFeel)lnfClass.newInstance();
             } catch (Exception exc) {
                 System.err.println("UIManager: failed loading " + className);
             }
@@ -1408,6 +1423,7 @@
     }
 
 
+    @SuppressWarnings("deprecation")
     private static void initializeAuxiliaryLAFs(Properties swingProps)
     {
         String auxLookAndFeelNames = swingProps.getProperty(auxiliaryLAFsKey);
@@ -1427,7 +1443,8 @@
             String className = p.nextToken();
             try {
                 Class<?> lnfClass = SwingUtilities.loadSystemClass(className);
-                LookAndFeel newLAF = (LookAndFeel)lnfClass.newInstance();
+                LookAndFeel newLAF =
+                        (LookAndFeel)lnfClass.newInstance();
                 newLAF.initialize();
                 auxLookAndFeels.addElement(newLAF);
             }
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java	Wed Jul 05 22:30:12 2017 +0200
@@ -403,7 +403,7 @@
      */
     public static void drawString(JComponent c, Graphics2D g, String string,
                                   float x, float y) {
-        SwingUtilities2.drawString(c, g, string, (int) x, (int) y);
+        SwingUtilities2.drawString(c, g, string, x, y, true);
     }
 
     /**
@@ -439,7 +439,7 @@
     public static void drawStringUnderlineCharAt(JComponent c, Graphics2D g,
             String string, int underlinedIndex, float x, float y) {
         SwingUtilities2.drawStringUnderlineCharAt(c, g, string, underlinedIndex,
-                                                  (int) x, (int) y);
+                                                  x, y, true);
     }
 
     /**
@@ -482,6 +482,6 @@
      * @since 9
      */
     public static float getStringWidth(JComponent c, FontMetrics fm, String string) {
-        return SwingUtilities2.stringWidth(c, fm, string);
+        return SwingUtilities2.stringWidth(c, fm, string, true);
     }
 }
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java	Wed Jul 05 22:30:12 2017 +0200
@@ -926,6 +926,7 @@
             }
         }
 
+        @SuppressWarnings("deprecation")
         boolean isInPopup(Component src) {
             for (Component c=src; c!=null; c=c.getParent()) {
                 if (c instanceof Applet || c instanceof Window) {
@@ -1143,6 +1144,7 @@
             }
         }
 
+        @SuppressWarnings("deprecation")
         public void stateChanged(ChangeEvent ev) {
             if (!(UIManager.getLookAndFeel() instanceof BasicLookAndFeel)) {
                 uninstall();
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1309,6 +1309,7 @@
      * @see javax.swing.text.View#getToolTipText
      * @since 1.4
      */
+    @SuppressWarnings("deprecation")
     public String getToolTipText(JTextComponent t, Point pt) {
         if (!painted) {
             return null;
@@ -2264,6 +2265,7 @@
          * <li>the press event is located over a selection
          * </ul>
          */
+        @SuppressWarnings("deprecation")
         protected boolean isDragPossible(MouseEvent e) {
             JTextComponent c = (JTextComponent)e.getSource();
             if (c.isEnabled()) {
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/multi/MultiTextUI.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/multi/MultiTextUI.java	Wed Jul 05 22:30:12 2017 +0200
@@ -85,6 +85,7 @@
      * the UI obtained from the default <code>LookAndFeel</code>
      * @since 1.4
      */
+    @SuppressWarnings("deprecation")
     public String getToolTipText(JTextComponent a, Point b) {
         String returnValue =
             ((TextUI) (uis.elementAt(0))).getToolTipText(a,b);
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultCaret.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultCaret.java	Wed Jul 05 22:30:12 2017 +0200
@@ -304,6 +304,7 @@
      *
      * @param e the mouse event
      */
+    @SuppressWarnings("deprecation")
     protected void positionCaret(MouseEvent e) {
         Point pt = new Point(e.getX(), e.getY());
         Position.Bias[] biasRet = new Position.Bias[1];
@@ -323,6 +324,7 @@
      *
      * @param e the mouse event
      */
+    @SuppressWarnings("deprecation")
     protected void moveCaret(MouseEvent e) {
         Point pt = new Point(e.getX(), e.getY());
         Position.Bias[] biasRet = new Position.Bias[1];
@@ -615,6 +617,7 @@
      * @param g the graphics context
      * @see #damage
      */
+    @SuppressWarnings("deprecation")
     public void paint(Graphics g) {
         if(isVisible()) {
             try {
@@ -959,6 +962,7 @@
      * @see #isActive
      * @see Caret#setVisible
      */
+    @SuppressWarnings("deprecation")
     public void setVisible(boolean e) {
         // focus lost notification can come in later after the
         // caret has been deinstalled, in which case the component
@@ -1301,6 +1305,7 @@
      * event thread so that calling <code>modelToView</code>
      * is safe.
      */
+    @SuppressWarnings("deprecation")
     void repaintNewCaret() {
         if (component != null) {
             TextUI mapper = component.getUI();
@@ -1664,6 +1669,7 @@
          *
          * @param e the action event
          */
+        @SuppressWarnings("deprecation")
         public void actionPerformed(ActionEvent e) {
             if (width == 0 || height == 0) {
                 // setVisible(true) will cause a scroll, only do this if the
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultEditorKit.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultEditorKit.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1429,6 +1429,7 @@
         }
 
         /** The operation to perform when this action is triggered. */
+        @SuppressWarnings("deprecation")
         public void actionPerformed(ActionEvent e) {
             JTextComponent target = getTextComponent(e);
             if (target != null) {
@@ -1542,6 +1543,7 @@
          * Returns adjustsed {@code y} position that indicates the location to scroll to
          * after selecting <code>index</code>.
          */
+        @SuppressWarnings("deprecation")
         private int getAdjustedY(JTextComponent text, Rectangle visible, int index) {
             int result = visible.y;
 
@@ -1589,6 +1591,7 @@
         }
 
         /** The operation to perform when this action is triggered. */
+        @SuppressWarnings("deprecation")
         public void actionPerformed(ActionEvent e) {
             JTextComponent target = getTextComponent(e);
             if (target != null) {
@@ -1672,6 +1675,7 @@
         }
 
         /** The operation to perform when this action is triggered. */
+        @SuppressWarnings("deprecation")
         public void actionPerformed(ActionEvent e) {
             JTextComponent target = getTextComponent(e);
             if (target != null) {
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultHighlighter.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultHighlighter.java	Wed Jul 05 22:30:12 2017 +0200
@@ -405,6 +405,7 @@
          * @param bounds the bounding box for the highlight
          * @param c the editor
          */
+        @SuppressWarnings("deprecation")
         public void paint(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c) {
             Rectangle alloc = bounds.getBounds();
             try {
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/FieldView.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/FieldView.java	Wed Jul 05 22:30:12 2017 +0200
@@ -205,6 +205,7 @@
      *           that is returned, although there is no guarantee.
      *           The parent may choose to resize or break the view.
      */
+    @SuppressWarnings("deprecation")
     public float getPreferredSpan(int axis) {
         switch (axis) {
         case View.X_AXIS:
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java	Wed Jul 05 22:30:12 2017 +0200
@@ -785,6 +785,7 @@
      * @param p the point to calculate a drop location for
      * @return the drop location, or <code>null</code>
      */
+    @SuppressWarnings("deprecation")
     DropLocation dropLocationForPoint(Point p) {
         Position.Bias[] bias = new Position.Bias[1];
         int index = getUI().viewToModel(this, p, bias);
@@ -1959,6 +1960,7 @@
      * @see javax.swing.plaf.TextUI#getToolTipText
      * @see javax.swing.ToolTipManager#registerComponent
      */
+    @SuppressWarnings("deprecation")
     public String getToolTipText(MouseEvent event) {
         String retValue = super.getToolTipText(event);
 
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/ParagraphView.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/ParagraphView.java	Wed Jul 05 22:30:12 2017 +0200
@@ -178,6 +178,7 @@
      * @return the location in the model that represents the
      *  next location visual position
      */
+    @SuppressWarnings("deprecation")
     protected int getNextNorthSouthVisualPositionFrom(int pos, Position.Bias b,
                                                       Shape a, int direction,
                                                       Position.Bias[] biasRet)
@@ -252,6 +253,7 @@
     // NOTE: This will not properly work if ParagraphView contains
     // other ParagraphViews. It won't raise, but this does not message
     // the children views with getNextVisualPositionFrom.
+    @SuppressWarnings("deprecation")
     protected int getClosestPositionTo(int pos, Position.Bias b, Shape a,
                                        int direction, Position.Bias[] biasRet,
                                        int rowIndex, int x)
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/PasswordView.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/PasswordView.java	Wed Jul 05 22:30:12 2017 +0200
@@ -84,6 +84,7 @@
         return drawUnselectedTextImpl(g, x, y, p0, p1, true);
     }
 
+    @SuppressWarnings("deprecation")
     private float drawUnselectedTextImpl(Graphics g, float x, float y,
                                          int p0, int p1,
                                          boolean useFPAPI)
@@ -152,6 +153,7 @@
         return drawSelectedTextImpl(g, x, y, p0, p1, true);
     }
 
+    @SuppressWarnings("deprecation")
     private float drawSelectedTextImpl(Graphics g, float x, float y,
                                        int p0, int p1,
                                        boolean useFPAPI)
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/PlainView.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/PlainView.java	Wed Jul 05 22:30:12 2017 +0200
@@ -471,6 +471,7 @@
      *   represent a valid location in the associated document
      * @see View#modelToView
      */
+    @SuppressWarnings("deprecation")
     public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException {
         // line coordinates
         Document doc = getDocument();
@@ -798,6 +799,7 @@
      * the given element.  It is assumed that the font
      * and font metrics are up-to-date.
      */
+    @SuppressWarnings("deprecation")
     private int getLineWidth(Element line) {
         if (line == null) {
             return 0;
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/Utilities.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/Utilities.java	Wed Jul 05 22:30:12 2017 +0200
@@ -107,7 +107,7 @@
                                              TabExpander e,
                                              int startOffset)
     {
-        return drawTabbedText(s, (int) x, (int) y, (Graphics) g, e, startOffset);
+        return drawTabbedText(null, s, x, y, g, e, startOffset, null, true);
     }
 
     /**
@@ -672,6 +672,7 @@
      *  a value of -1 will be returned.
      * @exception BadLocationException if the offset is out of range
      */
+    @SuppressWarnings("deprecation")
     public static final int getRowStart(JTextComponent c, int offs) throws BadLocationException {
         Rectangle r = c.modelToView(offs);
         if (r == null) {
@@ -702,6 +703,7 @@
      *  a value of -1 will be returned.
      * @exception BadLocationException if the offset is out of range
      */
+    @SuppressWarnings("deprecation")
     public static final int getRowEnd(JTextComponent c, int offs) throws BadLocationException {
         Rectangle2D r = c.modelToView2D(offs);
         if (r == null) {
@@ -744,6 +746,7 @@
         return getPositionAbove(c, offs, x, false);
     }
 
+    @SuppressWarnings("deprecation")
     static final int getPositionAbove(JTextComponent c, int offs, float x,
                                       boolean useFPAPI) throws BadLocationException
     {
@@ -818,6 +821,7 @@
         return getPositionBelow(c, offs, x, false);
     }
 
+    @SuppressWarnings("deprecation")
     static final int getPositionBelow(JTextComponent c, int offs, float x,
                                       boolean useFPAPI) throws BadLocationException
     {
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/View.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/View.java	Wed Jul 05 22:30:12 2017 +0200
@@ -501,6 +501,7 @@
      * @exception IllegalArgumentException if <code>direction</code>
      *          doesn't have one of the legal values above
      */
+    @SuppressWarnings("deprecation")
     public int getNextVisualPositionFrom(int pos, Position.Bias b, Shape a,
                                          int direction, Position.Bias[] biasRet)
       throws BadLocationException {
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/WrappedPlainView.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/WrappedPlainView.java	Wed Jul 05 22:30:12 2017 +0200
@@ -352,6 +352,7 @@
      * @param p1 the ending document location to use
      * @return the break position
      */
+    @SuppressWarnings("deprecation")
     protected int calculateBreakPosition(int p0, int p1) {
         int p;
         Segment segment = SegmentCache.getSharedSegment();
@@ -749,6 +750,7 @@
          *   valid location in the associated document
          * @see View#modelToView
          */
+        @SuppressWarnings("deprecation")
         public Shape modelToView(int pos, Shape a, Position.Bias b)
                 throws BadLocationException {
             Rectangle alloc = a.getBounds();
@@ -793,6 +795,7 @@
          *  given point in the view
          * @see View#viewToModel
          */
+        @SuppressWarnings("deprecation")
         public int viewToModel(float fx, float fy, Shape a, Position.Bias[] bias) {
             // PENDING(prinz) implement bias properly
             bias[0] = Position.Bias.Forward;
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/AccessibleHTML.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/AccessibleHTML.java	Wed Jul 05 22:30:12 2017 +0200
@@ -936,6 +936,7 @@
              * @return the screen coordinates of the character's the bounding box,
              * if index is invalid returns an empty rectangle.
              */
+            @SuppressWarnings("deprecation")
             public Rectangle getCharacterBounds(int i) {
                 try {
                     return editor.getUI().modelToView(editor, i);
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java	Wed Jul 05 22:30:12 2017 +0200
@@ -683,6 +683,7 @@
          * @param e the mouse event
          * @see MouseListener#mouseClicked
          */
+        @SuppressWarnings("deprecation")
         public void mouseClicked(MouseEvent e) {
             JEditorPane editor = (JEditorPane) e.getSource();
 
@@ -701,6 +702,7 @@
         }
 
         // track the moving of the mouse.
+        @SuppressWarnings("deprecation")
         public void mouseMoved(MouseEvent e) {
             JEditorPane editor = (JEditorPane) e.getSource();
             if (!editor.isEnabled()) {
@@ -773,6 +775,7 @@
          * Returns a string anchor if the passed in element has a
          * USEMAP that contains the passed in location.
          */
+        @SuppressWarnings("deprecation")
         private String getMapHREF(JEditorPane html, HTMLDocument hdoc,
                                   Element elem, AttributeSet attr, int offset,
                                   int x, int y) {
@@ -813,6 +816,7 @@
          * the location <code>x</code>, <code>y</code>. <code>offset</code>
          * gives the offset into the Document to check for.
          */
+        @SuppressWarnings("deprecation")
         private boolean doesElementContainLocation(JEditorPane editor,
                                                    Element e, int offset,
                                                    int x, int y) {
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/ObjectView.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/ObjectView.java	Wed Jul 05 22:30:12 2017 +0200
@@ -85,6 +85,7 @@
      * as a specification of the classname, which
      * we try to load.
      */
+    @SuppressWarnings("deprecation")
     protected Component createComponent() {
         AttributeSet attr = getElement().getAttributes();
         String classname = (String) attr.getAttribute(HTML.Attribute.CLASSID);
--- a/jdk/src/java.desktop/share/classes/sun/applet/AppletAudioClip.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletAudioClip.java	Wed Jul 05 22:30:12 2017 +0200
@@ -41,6 +41,7 @@
  * @author Arthur van Hoff, Kara Kytle
  */
 
+@SuppressWarnings("deprecation")
 public class AppletAudioClip implements AudioClip {
 
     // url that this AudioClip is based on
--- a/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java	Wed Jul 05 22:30:12 2017 +0200
@@ -54,7 +54,7 @@
  *
  * @author      Arthur van Hoff
  */
-@SuppressWarnings("serial") // JDK implementation class
+@SuppressWarnings({"serial", "deprecation"}) // JDK implementation class
 public
 abstract class AppletPanel extends Panel implements AppletStub, Runnable {
 
--- a/jdk/src/java.desktop/share/classes/sun/applet/AppletViewer.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletViewer.java	Wed Jul 05 22:30:12 2017 +0200
@@ -117,7 +117,7 @@
  * (The document named appletviewertags.html in the JDK's docs/tooldocs directory,
  *  once the JDK docs have been installed.)
  */
-@SuppressWarnings("serial") // JDK implementation class
+@SuppressWarnings({"serial", "deprecation"}) // JDK-implementation class
 public class AppletViewer extends Frame implements AppletContext, Printable {
 
     /**
@@ -157,7 +157,6 @@
     /**
      * Create the applet viewer.
      */
-    @SuppressWarnings("deprecation")
     public AppletViewer(int x, int y, URL doc, Hashtable<String, String> atts,
                         PrintStream statusMsgStream, AppletViewerFactory factory) {
         this.factory = factory;
--- a/jdk/src/java.desktop/share/classes/sun/applet/AppletViewerPanel.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletViewerPanel.java	Wed Jul 05 22:30:12 2017 +0200
@@ -197,6 +197,7 @@
      * Get the applet context. For now this is
      * also implemented by the AppletPanel class.
      */
+    @SuppressWarnings("deprecation")
     public AppletContext getAppletContext() {
         return (AppletContext)getParent();
     }
--- a/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java	Wed Jul 05 22:30:12 2017 +0200
@@ -499,6 +499,7 @@
      * @return the parent applet or {@ null}
      * @since 1.6
      */
+    @SuppressWarnings("deprecation")
     public static Applet getAppletIfAncestorOf(Component comp) {
         Container parent = comp.getParent();
         Applet applet = null;
--- a/jdk/src/java.desktop/share/classes/sun/awt/FontConfiguration.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/awt/FontConfiguration.java	Wed Jul 05 22:30:12 2017 +0200
@@ -971,7 +971,7 @@
 
             if (fcc != null) {
                 try {
-                    fc = (Charset) fcc.newInstance();
+                    fc = (Charset) fcc.getDeclaredConstructor().newInstance();
                 } catch (Exception e) {
                 }
             }
--- a/jdk/src/java.desktop/share/classes/sun/awt/LightweightFrame.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/awt/LightweightFrame.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -141,17 +141,52 @@
      *
      * @return the scale factor
      * @see #notifyDisplayChanged(int)
+     * @Depricated replaced by {@link #getScaleFactorX()} and
+     * {@link #getScaleFactorY}
      */
+    @Deprecated(since = "9")
     public abstract int getScaleFactor();
 
     /**
+     * Returns the scale factor of this frame along x coordinate. The default
+     * value is 1.
+     *
+     * @return the x coordinate scale factor
+     * @see #notifyDisplayChanged(double, double)
+     * @since 9
+     */
+    public abstract double getScaleFactorX();
+
+    /**
+     * Returns the scale factor of this frame along y coordinate. The default
+     * value is 1.
+     *
+     * @return the y coordinate scale factor
+     * @see #notifyDisplayChanged(double, double)
+     * @since 9
+     */
+    public abstract double getScaleFactorY();
+
+    /**
      * Called when display of the hosted frame is changed.
      *
      * @param scaleFactor the scale factor
+     * @Depricated replaced by {@link #notifyDisplayChanged(double, double)}
      */
+    @Deprecated(since = "9")
     public abstract void notifyDisplayChanged(int scaleFactor);
 
     /**
+     * Called when display of the hosted frame is changed.
+     *
+     * @param scaleFactorX the scale factor
+     * @param scaleFactorY the scale factor
+     * @since 9
+     */
+    public abstract void notifyDisplayChanged(double scaleFactorX,
+                                              double scaleFactorY);
+
+    /**
      * Host window absolute bounds.
      */
     private int hostX, hostY, hostW, hostH;
@@ -202,4 +237,5 @@
      * Removes a drop target from the lightweight frame.
      */
     public abstract void removeDropTarget(DropTarget dt);
+
 }
--- a/jdk/src/java.desktop/share/classes/sun/awt/image/GifImageDecoder.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/awt/image/GifImageDecoder.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -31,7 +31,6 @@
  */
 package sun.awt.image;
 
-import java.util.Vector;
 import java.util.Hashtable;
 import java.io.InputStream;
 import java.io.IOException;
@@ -620,7 +619,6 @@
 
 class GifFrame {
     private static final boolean verbose = false;
-    private static IndexColorModel trans_model;
 
     static final int DISPOSAL_NONE      = 0x00;
     static final int DISPOSAL_SAVE      = 0x01;
@@ -718,12 +716,6 @@
             case DISPOSAL_BGCOLOR:
                 byte tpix;
                 if (model.getTransparentPixel() < 0) {
-                    model = trans_model;
-                    if (model == null) {
-                        model = new IndexColorModel(8, 1,
-                                                    new byte[4], 0, true);
-                        trans_model = model;
-                    }
                     tpix = 0;
                 } else {
                     tpix = (byte) model.getTransparentPixel();
--- a/jdk/src/java.desktop/share/classes/sun/awt/image/VolatileSurfaceManager.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/awt/image/VolatileSurfaceManager.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -55,6 +55,15 @@
     protected SunVolatileImage vImg;
 
     /**
+     * A reference to the AffineTransform corresponding to the graphics
+     * configuration of the volatile image. Affine Transformation is usually
+     * derived from the screen device. During the displayChanged() callback,
+     * the existing transform is compared with the updated screen transform to
+     * determine whether the software backed surface needs to be re-created
+     */
+    protected AffineTransform atCurrent;
+
+    /**
      * The accelerated SurfaceData object.
      */
     protected SurfaceData sdAccel;
@@ -93,6 +102,7 @@
     protected VolatileSurfaceManager(SunVolatileImage vImg, Object context) {
         this.vImg = vImg;
         this.context = context;
+        this.atCurrent = vImg.getGraphicsConfig().getDefaultTransform();
 
         GraphicsEnvironment ge =
             GraphicsEnvironment.getLocalGraphicsEnvironment();
@@ -210,6 +220,10 @@
             sdCurrent = getBackupSurface();
             sdAccel = null;
             returnCode = VolatileImage.IMAGE_RESTORED;
+        } else if (lostSurfaceTmp) {
+            // A software surface has been restored. This could be due to
+            // display mode change on a non-accelerated volatile image.
+            returnCode = VolatileImage.IMAGE_RESTORED;
         }
 
         if ((returnCode != VolatileImage.IMAGE_INCOMPATIBLE) &&
@@ -326,9 +340,6 @@
      * method in the rendering process to recreate the surface.
      */
     public void displayChanged() {
-        if (!isAccelerationEnabled()) {
-            return;
-        }
         lostSurface = true;
         if (sdAccel != null) {
             // First, nullify the software surface.  This guards against
@@ -345,6 +356,28 @@
         // Update graphicsConfig for the vImg in case it changed due to
         // this display change event
         vImg.updateGraphicsConfig();
+
+        // Compare the Graphics configuration transforms to determine
+        // whether the software backed surface needs to be invalidated.
+        AffineTransform atUpdated = vImg.getGraphicsConfig()
+                                        .getDefaultTransform();
+        if (!isAccelerationEnabled()) {
+            if (!atUpdated.equals(atCurrent)) {
+                // Ideally there is no need to re-create a software surface.
+                // But some OSs allow changes to display state at runtime. Such
+                // a provision would cause mismatch in graphics configuration of
+                // the display and the surface. Hence we re-create the software
+                // surface as well.
+                sdBackup = null;
+                sdCurrent = getBackupSurface();
+            } else {
+                // Software backed surface was not invalidated.
+                lostSurface = false;
+            }
+        }
+
+        // Update the AffineTransformation backing the volatile image
+        atCurrent = atUpdated;
     }
 
     /**
--- a/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java	Wed Jul 05 22:30:12 2017 +0200
@@ -226,13 +226,10 @@
         }
         try {
             shellFolderManager =
-                (ShellFolderManager)managerClass.newInstance();
-        } catch (InstantiationException e) {
+                (ShellFolderManager)managerClass.getDeclaredConstructor().newInstance();
+        } catch (ReflectiveOperationException e) {
             throw new Error("Could not instantiate Shell Folder Manager: "
             + managerClass.getName());
-        } catch (IllegalAccessException e) {
-            throw new Error ("Could not access Shell Folder Manager: "
-            + managerClass.getName());
         }
 
         invoker = shellFolderManager.createInvoker();
--- a/jdk/src/java.desktop/share/classes/sun/font/FontManagerFactory.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/font/FontManagerFactory.java	Wed Jul 05 22:30:12 2017 +0200
@@ -80,10 +80,9 @@
                                                DEFAULT_CLASS);
                     ClassLoader cl = ClassLoader.getSystemClassLoader();
                     Class<?> fmClass = Class.forName(fmClassName, true, cl);
-                    instance = (FontManager) fmClass.newInstance();
-                } catch (ClassNotFoundException |
-                         InstantiationException |
-                         IllegalAccessException ex) {
+                    instance =
+                       (FontManager) fmClass.getDeclaredConstructor().newInstance();
+                } catch (ReflectiveOperationException ex) {
                     throw new InternalError(ex);
 
                 }
--- a/jdk/src/java.desktop/share/classes/sun/font/SunFontManager.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/font/SunFontManager.java	Wed Jul 05 22:30:12 2017 +0200
@@ -362,6 +362,14 @@
         });
     }
 
+    /**
+     * If the module image layout changes the location of JDK fonts,
+     * this will be updated to reflect that.
+     */
+    public static final String getJDKFontDir() {
+        return jreFontDirName;
+    }
+
     public TrueTypeFont getEUDCFont() {
         // Overridden in Windows.
         return null;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/font/lookup/JDKFontLookup.java	Wed Jul 05 22:30:12 2017 +0200
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.font.lookup;
+
+import sun.font.SunFontManager;
+
+/**
+ * Implementation-class accessed by other JDK modules to
+ * locate the JDK-provided fonts.
+ */
+public final class JDKFontLookup {
+
+    public final static String getJDKFontDir() {
+        return SunFontManager.getJDKFontDir();
+    }
+}
--- a/jdk/src/java.desktop/share/classes/sun/java2d/cmm/CMSManager.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/java2d/cmm/CMSManager.java	Wed Jul 05 22:30:12 2017 +0200
@@ -57,7 +57,7 @@
         if (cmmProviderClass != null) {
             try {
                 Class<?> cls = Class.forName(cmmProviderClass);
-                provider = (CMMServiceProvider)cls.newInstance();
+                provider = (CMMServiceProvider)cls.getConstructor().newInstance();
             } catch (ReflectiveOperationException e) {
             }
         }
--- a/jdk/src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitiveProxy.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitiveProxy.java	Wed Jul 05 22:30:12 2017 +0200
@@ -81,18 +81,15 @@
                         + relativeClassName;
         try {
             Class<?> clazz = Class.forName(name);
-            GraphicsPrimitive p = (GraphicsPrimitive) clazz.newInstance();
+            GraphicsPrimitive p =
+                (GraphicsPrimitive) clazz.getDeclaredConstructor().newInstance();
             if (!satisfiesSameAs(p)) {
                 throw new RuntimeException("Primitive " + p
                                            + " incompatible with proxy for "
                                            + name);
             }
             return p;
-        } catch (ClassNotFoundException ex) {
-            throw new RuntimeException(ex.toString());
-        } catch (InstantiationException ex) {
-            throw new RuntimeException(ex.toString());
-        } catch (IllegalAccessException ex) {
+        } catch (ReflectiveOperationException ex) {
             throw new RuntimeException(ex.toString());
         }
         // A RuntimeException should never happen in a deployed JDK, because
--- a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/RenderingEngine.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/RenderingEngine.java	Wed Jul 05 22:30:12 2017 +0200
@@ -127,7 +127,7 @@
         if (reClass != null) {
             try {
                 Class<?> cls = Class.forName(reClass);
-                reImpl = (RenderingEngine) cls.newInstance();
+                reImpl = (RenderingEngine) cls.getConstructor().newInstance();
             } catch (ReflectiveOperationException ignored0) {
             }
         }
@@ -135,7 +135,7 @@
             final String marlinREClass = "sun.java2d.marlin.MarlinRenderingEngine";
             try {
                 Class<?> cls = Class.forName(marlinREClass);
-                reImpl = (RenderingEngine) cls.newInstance();
+                reImpl = (RenderingEngine) cls.getConstructor().newInstance();
             } catch (ReflectiveOperationException ignored1) {
             }
         }
--- a/jdk/src/java.desktop/share/classes/sun/swing/JLightweightFrame.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/swing/JLightweightFrame.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,7 @@
 
 package sun.swing;
 
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.EventQueue;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.MouseInfo;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.Window;
+import java.awt.*;
 import java.awt.dnd.DragGestureEvent;
 import java.awt.dnd.DragGestureListener;
 import java.awt.dnd.DragGestureRecognizer;
@@ -46,6 +35,7 @@
 import java.awt.dnd.peer.DragSourceContextPeer;
 import java.awt.event.ContainerEvent;
 import java.awt.event.ContainerListener;
+import java.awt.geom.AffineTransform;
 import java.awt.image.BufferedImage;
 import java.awt.image.DataBufferInt;
 import java.beans.PropertyChangeEvent;
@@ -89,7 +79,8 @@
 
     private BufferedImage bbImage;
 
-    private volatile int scaleFactor = 1;
+    private volatile double scaleFactorX;
+    private volatile double scaleFactorY;
 
     /**
      * {@code copyBufferEnabled}, true by default, defines the following strategy.
@@ -124,6 +115,10 @@
      */
     public JLightweightFrame() {
         super();
+        AffineTransform defaultTransform =
+                           getGraphicsConfiguration().getDefaultTransform();
+        scaleFactorX = defaultTransform.getScaleX();
+        scaleFactorY = defaultTransform.getScaleY();
         copyBufferEnabled = "true".equals(AccessController.
             doPrivileged(new GetPropertyAction("swing.jlf.copyBufferEnabled", "true")));
 
@@ -157,8 +152,9 @@
             }
             Point p = SwingUtilities.convertPoint(c, x, y, jlf);
             Rectangle r = new Rectangle(p.x, p.y, w, h).intersection(
-                    new Rectangle(0, 0, bbImage.getWidth() / scaleFactor,
-                                  bbImage.getHeight() / scaleFactor));
+                    new Rectangle(0, 0,
+                          (int)Math.round(bbImage.getWidth() / scaleFactorX),
+                          (int)Math.round(bbImage.getHeight() / scaleFactorY)));
 
             if (!r.isEmpty()) {
                 notifyImageUpdated(r.x, r.y, r.width, r.height);
@@ -212,7 +208,7 @@
         g.setBackground(getBackground());
         g.setColor(getForeground());
         g.setFont(getFont());
-        g.scale(scaleFactor, scaleFactor);
+        g.scale(scaleFactorX, scaleFactorY);
         return g;
     }
 
@@ -237,28 +233,53 @@
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public int getScaleFactor() {
-        return scaleFactor;
+        return (int)scaleFactorX;
     }
 
     @Override
+    public double getScaleFactorX() {
+        return scaleFactorX;
+    }
+
+    @Override
+    public double getScaleFactorY() {
+        return scaleFactorY;
+    }
+
+    @Override
+    @SuppressWarnings("deprecation")
     public void notifyDisplayChanged(final int scaleFactor) {
-        if (scaleFactor != this.scaleFactor) {
+        notifyDisplayChanged(scaleFactor, scaleFactor);
+    }
+
+    @Override
+    public void notifyDisplayChanged(final double scaleFactorX,
+                                                    final double scaleFactorY) {
+        if (Double.compare(scaleFactorX, this.scaleFactorX) != 0 ||
+                         Double.compare(scaleFactorY, this.scaleFactorY) != 0) {
             if (!copyBufferEnabled) content.paintLock();
             try {
                 if (bbImage != null) {
-                    resizeBuffer(getWidth(), getHeight(), scaleFactor);
+                    resizeBuffer(getWidth(), getHeight(), scaleFactorX,
+                                                                  scaleFactorY);
                 }
             } finally {
                 if (!copyBufferEnabled) content.paintUnlock();
             }
-            this.scaleFactor = scaleFactor;
+            this.scaleFactorX = scaleFactorX;
+            this.scaleFactorY = scaleFactorY;
+
+            if(isVisible()) {
+                final Object peer =
+                        AWTAccessor.getComponentAccessor().getPeer(this);
+                if (peer instanceof DisplayChangedListener) {
+                    ((DisplayChangedListener) peer).displayChanged();
+                }
+                repaint();
+            }
         }
-        final Object peer = AWTAccessor.getComponentAccessor().getPeer(this);
-        if (peer instanceof DisplayChangedListener) {
-            ((DisplayChangedListener) peer).displayChanged();
-        }
-        repaint();
     }
 
     @Override
@@ -270,7 +291,8 @@
         }
     }
 
-    private void syncCopyBuffer(boolean reset, int x, int y, int w, int h, int scale) {
+    private void syncCopyBuffer(boolean reset, int x, int y, int w, int h,
+                                                 double scaleX, double scaleY) {
         content.paintLock();
         try {
             int[] srcBuffer = ((DataBufferInt)bbImage.getRaster().getDataBuffer()).getData();
@@ -279,14 +301,14 @@
             }
             int linestride = bbImage.getWidth();
 
-            x *= scale;
-            y *= scale;
-            w *= scale;
-            h *= scale;
+            int startX = (int)Math.floor(x * scaleX);
+            int startY = (int)Math.floor(y * scaleY);
+            int width  = (int)Math.ceil((x + w) * scaleX) - startX;
+            int height = (int)Math.ceil((y + h) * scaleY) - startY;
 
-            for (int i=0; i<h; i++) {
-                int from = (y + i) * linestride + x;
-                System.arraycopy(srcBuffer, from, copyBuffer, from, w);
+            for (int i = 0; i < height; i++) {
+                int from = (startY + i) * linestride + startX;
+                System.arraycopy(srcBuffer, from, copyBuffer, from, width);
             }
         } finally {
             content.paintUnlock();
@@ -295,7 +317,8 @@
 
     private void notifyImageUpdated(int x, int y, int width, int height) {
         if (copyBufferEnabled) {
-            syncCopyBuffer(false, x, y, width, height, scaleFactor);
+            syncCopyBuffer(false, x, y, width, height, scaleFactorX,
+                                                                  scaleFactorY);
         }
         content.imageUpdated(x, y, width, height);
     }
@@ -382,8 +405,10 @@
             int newW = width;
             int newH = height;
             if (bbImage != null) {
-                int imgWidth = bbImage.getWidth() / scaleFactor;
-                int imgHeight = bbImage.getHeight() / scaleFactor;
+                int imgWidth = (int)Math.round(bbImage.getWidth() /
+                                                                  scaleFactorX);
+                int imgHeight = (int)Math.round(bbImage.getHeight() /
+                                                                  scaleFactorY);
                 if (width != imgWidth || height != imgHeight) {
                     createBB = true;
                     if (bbImage != null) {
@@ -407,7 +432,7 @@
                 }
             }
             if (createBB) {
-                resizeBuffer(newW, newH, scaleFactor);
+                resizeBuffer(newW, newH, scaleFactorX, scaleFactorY);
                 return;
             }
             content.imageReshaped(0, 0, width, height);
@@ -419,16 +444,19 @@
         }
     }
 
-    private void resizeBuffer(int width, int height, int newScaleFactor) {
-            bbImage = new BufferedImage(width*newScaleFactor,height*newScaleFactor,
+    private void resizeBuffer(int width, int height, double newScaleFactorX,
+                                                     double newScaleFactorY) {
+        bbImage = new BufferedImage((int)Math.round(width * newScaleFactorX),
+                                    (int)Math.round(height * newScaleFactorY),
                                         BufferedImage.TYPE_INT_ARGB_PRE);
         int[] pixels= ((DataBufferInt)bbImage.getRaster().getDataBuffer()).getData();
         if (copyBufferEnabled) {
-            syncCopyBuffer(true, 0, 0, width, height, newScaleFactor);
+            syncCopyBuffer(true, 0, 0, width, height, newScaleFactorX,
+                                                               newScaleFactorY);
             pixels = copyBuffer;
         }
         content.imageBufferReset(pixels, 0, 0, width, height,
-                                 width * newScaleFactor, newScaleFactor);
+                          bbImage.getWidth(), newScaleFactorX, newScaleFactorY);
     }
 
     @Override
--- a/jdk/src/java.desktop/share/classes/sun/swing/LightweightContent.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/swing/LightweightContent.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -117,7 +117,10 @@
      * @param height the logical height of the image
      * @param linestride the line stride of the pixel buffer
      * @param scale the scale factor of the pixel buffer
+     * @Depricated replaced by
+     * {@link #imageBufferReset(int[],int,int,int,int,int,double,double)}
      */
+    @Deprecated(since = "9")
     default public void imageBufferReset(int[] data,
                                  int x, int y,
                                  int width, int height,
@@ -128,11 +131,54 @@
     }
 
     /**
+     * {@code JLightweightFrame} calls this method to notify the client
+     * application that a new data buffer has been set as a content pixel
+     * buffer. Typically this occurs when a buffer of a larger size is
+     * created in response to a content resize event.
+     * <p>
+     * The method reports a reference to the pixel data buffer, the content
+     * image bounds within the buffer and the line stride of the buffer.
+     * These values have the following correlation.
+     * The {@code width} and {@code height} matches the layout size of the
+     * content (the component returned from the {@link #getComponent} method).
+     * The {@code x} and {@code y} is the origin of the content, {@code (0, 0)}
+     * in the layout coordinate space of the content, appearing at
+     * {@code data[y * scaleY * linestride + x * scaleX]} in the buffer.
+     * A pixel with indices {@code (i, j)}, where {@code (0 <= i < width)} and
+     * {@code (0 <= j < height)}, in the layout coordinate space of the content
+     * is represented by a {@code scaleX * scaleY} square of pixels in the
+     * physical coordinate space of the buffer. The top-left corner of the
+     * square has the following physical coordinate in the buffer:
+     * {@code data[(y + j) * scaleY * linestride + (x + i) * scaleX]}.
+     *
+     * @param data the content pixel data buffer of INT_ARGB_PRE type
+     * @param x the logical x coordinate of the image
+     * @param y the logical y coordinate of the image
+     * @param width the logical width of the image
+     * @param height the logical height of the image
+     * @param linestride the line stride of the pixel buffer
+     * @param scaleX the x coordinate scale factor of the pixel buffer
+     * @param scaleY the y coordinate scale factor of the pixel buffer
+     * @since 9
+     */
+    @SuppressWarnings("deprecation")
+    default public void imageBufferReset(int[] data,
+                                         int x, int y,
+                                         int width, int height,
+                                         int linestride,
+                                         double scaleX, double scaleY)
+    {
+        imageBufferReset(data, x, y, width, height, linestride,
+                                                       (int)Math.round(scaleX));
+    }
+
+    /**
      * The default implementation for #imageBufferReset uses a hard-coded value
      * of 1 for the scale factor. Both the old and the new methods provide
      * default implementations in order to allow a client application to run
      * with any JDK version without breaking backward compatibility.
      */
+    @SuppressWarnings("deprecation")
     default public void imageBufferReset(int[] data,
                                  int x, int y,
                                  int width, int height,
--- a/jdk/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java	Wed Jul 05 22:30:12 2017 +0200
@@ -318,7 +318,21 @@
      * @param fm FontMetrics used to measure the String width
      * @param string String to get the width of
      */
-    public static int stringWidth(JComponent c, FontMetrics fm, String string){
+    public static int stringWidth(JComponent c, FontMetrics fm, String string) {
+        return (int) stringWidth(c, fm, string, false);
+    }
+
+    /**
+     * Returns the width of the passed in String.
+     * If the passed String is {@code null}, returns zero.
+     *
+     * @param c JComponent that will display the string, may be null
+     * @param fm FontMetrics used to measure the String width
+     * @param string String to get the width of
+     * @param useFPAPI use floating point API
+     */
+    public static float stringWidth(JComponent c, FontMetrics fm, String string,
+            boolean useFPAPI){
         if (string == null || string.equals("")) {
             return 0;
         }
@@ -333,9 +347,9 @@
         if (needsTextLayout) {
             TextLayout layout = createTextLayout(c, string,
                                     fm.getFont(), fm.getFontRenderContext());
-            return (int) layout.getAdvance();
+            return layout.getAdvance();
         } else {
-            return fm.stringWidth(string);
+            return getFontStringWidth(string, fm, useFPAPI);
         }
     }
 
@@ -426,6 +440,21 @@
      */
     public static void drawString(JComponent c, Graphics g, String text,
                                   int x, int y) {
+        drawString(c, g, text, x, y, false);
+    }
+
+    /**
+     * Draws the string at the specified location.
+     *
+     * @param c JComponent that will display the string, may be null
+     * @param g Graphics to draw the text to
+     * @param text String to display
+     * @param x X coordinate to draw the text at
+     * @param y Y coordinate to draw the text at
+     * @param useFPAPI use floating point API
+     */
+    public static void drawString(JComponent c, Graphics g, String text,
+                                  float x, float y, boolean useFPAPI) {
         // c may be null
 
         // All non-editable widgets that draw strings call into this
@@ -509,7 +538,7 @@
                                                     g2.getFontRenderContext());
                     layout.draw(g2, x, y);
                 } else {
-                    g.drawString(text, x, y);
+                    g2.drawString(text, x, y);
                 }
 
                 if (oldAAValue != null) {
@@ -530,7 +559,7 @@
             }
         }
 
-        g.drawString(text, x, y);
+        g.drawString(text, (int) x, (int) y);
     }
 
     /**
@@ -544,17 +573,36 @@
      * @param x X coordinate to draw the text at
      * @param y Y coordinate to draw the text at
      */
+
     public static void drawStringUnderlineCharAt(JComponent c,Graphics g,
-                           String text, int underlinedIndex, int x,int y) {
+                           String text, int underlinedIndex, int x, int y) {
+        drawStringUnderlineCharAt(c, g, text, underlinedIndex, x, y, false);
+    }
+    /**
+     * Draws the string at the specified location underlining the specified
+     * character.
+     *
+     * @param c JComponent that will display the string, may be null
+     * @param g Graphics to draw the text to
+     * @param text String to display
+     * @param underlinedIndex Index of a character in the string to underline
+     * @param x X coordinate to draw the text at
+     * @param y Y coordinate to draw the text at
+     * @param useFPAPI use floating point API
+     */
+    public static void drawStringUnderlineCharAt(JComponent c, Graphics g,
+                                                 String text, int underlinedIndex,
+                                                 float x, float y,
+                                                 boolean useFPAPI) {
         if (text == null || text.length() <= 0) {
             return;
         }
-        SwingUtilities2.drawString(c, g, text, x, y);
+        SwingUtilities2.drawString(c, g, text, x, y, useFPAPI);
         int textLength = text.length();
         if (underlinedIndex >= 0 && underlinedIndex < textLength ) {
-            int underlineRectY = y;
+            float underlineRectY = y;
             int underlineRectHeight = 1;
-            int underlineRectX = 0;
+            float underlineRectX = 0;
             int underlineRectWidth = 0;
             boolean isPrinting = isPrinting(g);
             boolean needsTextLayout = isPrinting;
@@ -594,7 +642,7 @@
                     underlineRectWidth = rect.width;
                 }
             }
-            g.fillRect(underlineRectX, underlineRectY + 1,
+            g.fillRect((int) underlineRectX, (int) underlineRectY + 1,
                        underlineRectWidth, underlineRectHeight);
         }
     }
--- a/jdk/src/java.desktop/share/classes/sun/swing/text/TextComponentPrintable.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/sun/swing/text/TextComponentPrintable.java	Wed Jul 05 22:30:12 2017 +0200
@@ -753,6 +753,7 @@
      * First step is to find yStart and yEnd for the every document position.
      * Second step is to merge all intersected segments ( [yStart, yEnd] ).
      */
+    @SuppressWarnings("deprecation")
     private void calculateRowsMetrics() {
         final int documentLength = printShell.getDocument().getLength();
         List<IntegerSegment> documentMetrics = new ArrayList<IntegerSegment>(LIST_SIZE);
--- a/jdk/src/java.desktop/unix/classes/sun/font/XMap.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/unix/classes/sun/font/XMap.java	Wed Jul 05 22:30:12 2017 +0200
@@ -172,7 +172,8 @@
         if (className != null) {
             try {
                 if (className.startsWith("sun.awt")) {
-                    enc = ((Charset)Class.forName(className).newInstance()).newEncoder();
+                    enc = ((Charset)Class.forName(className).getDeclaredConstructor().
+                                                  newInstance()).newEncoder();
                 } else {
                     enc = Charset.forName(className).newEncoder();
                 }
--- a/jdk/src/java.desktop/windows/native/libawt/java2d/windows/GDIWindowSurfaceData.cpp	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/windows/native/libawt/java2d/windows/GDIWindowSurfaceData.cpp	Wed Jul 05 22:30:12 2017 +0200
@@ -128,7 +128,7 @@
                 return;
             }
             hDC = comp->GetDCFromComponent();
-            if (hDC != NULL) {
+            if (hDC != NULL && wsdo->device != NULL) {
                 ::SelectObject(hDC, nullbrush);
                 ::SelectObject(hDC, nullpen);
                 ::SelectClipRgn(hDC, (HRGN) NULL);
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp	Wed Jul 05 22:30:12 2017 +0200
@@ -3523,7 +3523,7 @@
 
     WORD wChar[2];
     int converted = 1;
-    UINT ch = ::MapVirtualKey(wkey, 2);
+    UINT ch = ::MapVirtualKeyEx(wkey, 2, GetKeyboardLayout());
     if (ch & 0x80000000) {
         // Dead key which is handled as a normal key
         isDeadKey = deadKeyActive = TRUE;
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Taskbar.cpp	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Taskbar.cpp	Wed Jul 05 22:30:12 2017 +0200
@@ -58,7 +58,11 @@
 JNIEXPORT void JNICALL Java_sun_awt_windows_WTaskbarPeer_setProgressValue
   (JNIEnv *, jobject, jlong window, jint value)
 {
-    m_Taskbar->SetProgressValue((HWND)window, value, 100);
+    if (value < 0 || value > 100) {
+        m_Taskbar->SetProgressState((HWND)window, TBPF_NOPROGRESS);
+    } else {
+        m_Taskbar->SetProgressValue((HWND)window, value, 100);
+    }
 }
 
 
@@ -88,6 +92,9 @@
             flag = TBPF_NOPROGRESS;
         } else if (strcmp(valueNative, "NORMAL") == 0) {
             flag = TBPF_NORMAL;
+
+            // Switching from TBPF_INDETERMINATE to TBPF_NORMAL has no effect
+            m_Taskbar->SetProgressState((HWND)window, TBPF_PAUSED);
         } else if (strcmp(valueNative, "PAUSED") == 0) {
             flag = TBPF_PAUSED;
         } else if (strcmp(valueNative, "INDETERMINATE") == 0) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.accessibility/windows/native/bridge/AccessBridgeCalls.c	Wed Jul 05 22:30:12 2017 +0200
@@ -0,0 +1,1130 @@
+/*
+ *
+ * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Wrapper functions around calls to the AccessBridge DLL
+ */
+
+
+#include <windows.h>
+#include <jni.h>
+
+
+//#define ACCESSBRIDGE_32
+//#define ACCESSBRIDGE_64
+
+#include "AccessBridgeCalls.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    HINSTANCE theAccessBridgeInstance;
+    AccessBridgeFPs theAccessBridge;
+
+    BOOL theAccessBridgeInitializedFlag = FALSE;
+
+#define LOAD_FP(result, type, name) \
+    if ((theAccessBridge.result = \
+        (type) GetProcAddress(theAccessBridgeInstance, name)) == (type) 0) { \
+        return FALSE; \
+    }
+
+    BOOL initializeAccessBridge() {
+
+#ifdef ACCESSBRIDGE_ARCH_32 // For 32 bit AT interfacing with Java on 64 bit OS
+        theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE-32");
+#else
+#ifdef ACCESSBRIDGE_ARCH_64 // For 64 bit AT interfacing with Java on 64 bit OS
+                theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE-64");
+#else // For 32 bit AT interfacing with Java on 32 bit OS
+        theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE");
+#endif
+#endif
+        if (theAccessBridgeInstance != 0) {
+            LOAD_FP(Windows_run, Windows_runFP, "Windows_run");
+
+            LOAD_FP(SetJavaShutdown, SetJavaShutdownFP, "setJavaShutdownFP");
+            LOAD_FP(SetFocusGained, SetFocusGainedFP, "setFocusGainedFP");
+            LOAD_FP(SetFocusLost, SetFocusLostFP, "setFocusLostFP");
+
+            LOAD_FP(SetCaretUpdate, SetCaretUpdateFP, "setCaretUpdateFP");
+
+            LOAD_FP(SetMouseClicked, SetMouseClickedFP, "setMouseClickedFP");
+            LOAD_FP(SetMouseEntered, SetMouseEnteredFP, "setMouseEnteredFP");
+            LOAD_FP(SetMouseExited, SetMouseExitedFP, "setMouseExitedFP");
+            LOAD_FP(SetMousePressed, SetMousePressedFP, "setMousePressedFP");
+            LOAD_FP(SetMouseReleased, SetMouseReleasedFP, "setMouseReleasedFP");
+
+            LOAD_FP(SetMenuCanceled, SetMenuCanceledFP, "setMenuCanceledFP");
+            LOAD_FP(SetMenuDeselected, SetMenuDeselectedFP, "setMenuDeselectedFP");
+            LOAD_FP(SetMenuSelected, SetMenuSelectedFP, "setMenuSelectedFP");
+            LOAD_FP(SetPopupMenuCanceled, SetPopupMenuCanceledFP, "setPopupMenuCanceledFP");
+            LOAD_FP(SetPopupMenuWillBecomeInvisible, SetPopupMenuWillBecomeInvisibleFP, "setPopupMenuWillBecomeInvisibleFP");
+            LOAD_FP(SetPopupMenuWillBecomeVisible, SetPopupMenuWillBecomeVisibleFP, "setPopupMenuWillBecomeVisibleFP");
+
+            LOAD_FP(SetPropertyNameChange, SetPropertyNameChangeFP, "setPropertyNameChangeFP");
+            LOAD_FP(SetPropertyDescriptionChange, SetPropertyDescriptionChangeFP, "setPropertyDescriptionChangeFP");
+            LOAD_FP(SetPropertyStateChange, SetPropertyStateChangeFP, "setPropertyStateChangeFP");
+            LOAD_FP(SetPropertyValueChange, SetPropertyValueChangeFP, "setPropertyValueChangeFP");
+            LOAD_FP(SetPropertySelectionChange, SetPropertySelectionChangeFP, "setPropertySelectionChangeFP");
+            LOAD_FP(SetPropertyTextChange, SetPropertyTextChangeFP, "setPropertyTextChangeFP");
+            LOAD_FP(SetPropertyCaretChange, SetPropertyCaretChangeFP, "setPropertyCaretChangeFP");
+            LOAD_FP(SetPropertyVisibleDataChange, SetPropertyVisibleDataChangeFP, "setPropertyVisibleDataChangeFP");
+            LOAD_FP(SetPropertyChildChange, SetPropertyChildChangeFP, "setPropertyChildChangeFP");
+            LOAD_FP(SetPropertyActiveDescendentChange, SetPropertyActiveDescendentChangeFP, "setPropertyActiveDescendentChangeFP");
+
+            LOAD_FP(SetPropertyTableModelChange, SetPropertyTableModelChangeFP, "setPropertyTableModelChangeFP");
+
+            LOAD_FP(ReleaseJavaObject, ReleaseJavaObjectFP, "releaseJavaObject");
+            LOAD_FP(GetVersionInfo, GetVersionInfoFP, "getVersionInfo");
+
+            LOAD_FP(IsJavaWindow, IsJavaWindowFP, "isJavaWindow");
+            LOAD_FP(IsSameObject, IsSameObjectFP, "isSameObject");
+            LOAD_FP(GetAccessibleContextFromHWND, GetAccessibleContextFromHWNDFP, "getAccessibleContextFromHWND");
+            LOAD_FP(getHWNDFromAccessibleContext, getHWNDFromAccessibleContextFP, "getHWNDFromAccessibleContext");
+
+            LOAD_FP(GetAccessibleContextAt, GetAccessibleContextAtFP, "getAccessibleContextAt");
+            LOAD_FP(GetAccessibleContextWithFocus, GetAccessibleContextWithFocusFP, "getAccessibleContextWithFocus");
+            LOAD_FP(GetAccessibleContextInfo, GetAccessibleContextInfoFP, "getAccessibleContextInfo");
+            LOAD_FP(GetAccessibleChildFromContext, GetAccessibleChildFromContextFP, "getAccessibleChildFromContext");
+            LOAD_FP(GetAccessibleParentFromContext, GetAccessibleParentFromContextFP, "getAccessibleParentFromContext");
+
+            /* begin AccessibleTable */
+            LOAD_FP(getAccessibleTableInfo, getAccessibleTableInfoFP, "getAccessibleTableInfo");
+            LOAD_FP(getAccessibleTableCellInfo, getAccessibleTableCellInfoFP, "getAccessibleTableCellInfo");
+
+            LOAD_FP(getAccessibleTableRowHeader, getAccessibleTableRowHeaderFP, "getAccessibleTableRowHeader");
+            LOAD_FP(getAccessibleTableColumnHeader, getAccessibleTableColumnHeaderFP, "getAccessibleTableColumnHeader");
+
+            LOAD_FP(getAccessibleTableRowDescription, getAccessibleTableRowDescriptionFP, "getAccessibleTableRowDescription");
+            LOAD_FP(getAccessibleTableColumnDescription, getAccessibleTableColumnDescriptionFP, "getAccessibleTableColumnDescription");
+
+            LOAD_FP(getAccessibleTableRowSelectionCount, getAccessibleTableRowSelectionCountFP,
+                    "getAccessibleTableRowSelectionCount");
+            LOAD_FP(isAccessibleTableRowSelected, isAccessibleTableRowSelectedFP,
+                    "isAccessibleTableRowSelected");
+            LOAD_FP(getAccessibleTableRowSelections, getAccessibleTableRowSelectionsFP,
+                    "getAccessibleTableRowSelections");
+
+            LOAD_FP(getAccessibleTableColumnSelectionCount, getAccessibleTableColumnSelectionCountFP,
+                    "getAccessibleTableColumnSelectionCount");
+            LOAD_FP(isAccessibleTableColumnSelected, isAccessibleTableColumnSelectedFP,
+                    "isAccessibleTableColumnSelected");
+            LOAD_FP(getAccessibleTableColumnSelections, getAccessibleTableColumnSelectionsFP,
+                    "getAccessibleTableColumnSelections");
+
+            LOAD_FP(getAccessibleTableRow, getAccessibleTableRowFP,
+                    "getAccessibleTableRow");
+            LOAD_FP(getAccessibleTableColumn, getAccessibleTableColumnFP,
+                    "getAccessibleTableColumn");
+            LOAD_FP(getAccessibleTableIndex, getAccessibleTableIndexFP,
+                    "getAccessibleTableIndex");
+
+            /* end AccessibleTable */
+
+            /* AccessibleRelationSet */
+            LOAD_FP(getAccessibleRelationSet, getAccessibleRelationSetFP, "getAccessibleRelationSet");
+
+            /* AccessibleHypertext */
+            LOAD_FP(getAccessibleHypertext, getAccessibleHypertextFP, "getAccessibleHypertext");
+            LOAD_FP(activateAccessibleHyperlink, activateAccessibleHyperlinkFP, "activateAccessibleHyperlink");
+            LOAD_FP(getAccessibleHyperlinkCount, getAccessibleHyperlinkCountFP, "getAccessibleHyperlinkCount");
+            LOAD_FP(getAccessibleHypertextExt, getAccessibleHypertextExtFP, "getAccessibleHypertextExt");
+            LOAD_FP(getAccessibleHypertextLinkIndex, getAccessibleHypertextLinkIndexFP, "getAccessibleHypertextLinkIndex");
+            LOAD_FP(getAccessibleHyperlink, getAccessibleHyperlinkFP, "getAccessibleHyperlink");
+
+            /* Accessible KeyBinding, Icon and Action */
+            LOAD_FP(getAccessibleKeyBindings, getAccessibleKeyBindingsFP, "getAccessibleKeyBindings");
+            LOAD_FP(getAccessibleIcons, getAccessibleIconsFP, "getAccessibleIcons");
+            LOAD_FP(getAccessibleActions, getAccessibleActionsFP, "getAccessibleActions");
+            LOAD_FP(doAccessibleActions, doAccessibleActionsFP, "doAccessibleActions");
+
+            /* AccessibleText */
+            LOAD_FP(GetAccessibleTextInfo, GetAccessibleTextInfoFP, "getAccessibleTextInfo");
+            LOAD_FP(GetAccessibleTextItems, GetAccessibleTextItemsFP, "getAccessibleTextItems");
+            LOAD_FP(GetAccessibleTextSelectionInfo, GetAccessibleTextSelectionInfoFP, "getAccessibleTextSelectionInfo");
+            LOAD_FP(GetAccessibleTextAttributes, GetAccessibleTextAttributesFP, "getAccessibleTextAttributes");
+            LOAD_FP(GetAccessibleTextRect, GetAccessibleTextRectFP, "getAccessibleTextRect");
+            LOAD_FP(GetAccessibleTextLineBounds, GetAccessibleTextLineBoundsFP, "getAccessibleTextLineBounds");
+            LOAD_FP(GetAccessibleTextRange, GetAccessibleTextRangeFP, "getAccessibleTextRange");
+
+            LOAD_FP(GetCurrentAccessibleValueFromContext, GetCurrentAccessibleValueFromContextFP, "getCurrentAccessibleValueFromContext");
+            LOAD_FP(GetMaximumAccessibleValueFromContext, GetMaximumAccessibleValueFromContextFP, "getMaximumAccessibleValueFromContext");
+            LOAD_FP(GetMinimumAccessibleValueFromContext, GetMinimumAccessibleValueFromContextFP, "getMinimumAccessibleValueFromContext");
+
+            LOAD_FP(AddAccessibleSelectionFromContext, AddAccessibleSelectionFromContextFP, "addAccessibleSelectionFromContext");
+            LOAD_FP(ClearAccessibleSelectionFromContext, ClearAccessibleSelectionFromContextFP, "clearAccessibleSelectionFromContext");
+            LOAD_FP(GetAccessibleSelectionFromContext, GetAccessibleSelectionFromContextFP, "getAccessibleSelectionFromContext");
+            LOAD_FP(GetAccessibleSelectionCountFromContext, GetAccessibleSelectionCountFromContextFP, "getAccessibleSelectionCountFromContext");
+            LOAD_FP(IsAccessibleChildSelectedFromContext, IsAccessibleChildSelectedFromContextFP, "isAccessibleChildSelectedFromContext");
+            LOAD_FP(RemoveAccessibleSelectionFromContext, RemoveAccessibleSelectionFromContextFP, "removeAccessibleSelectionFromContext");
+            LOAD_FP(SelectAllAccessibleSelectionFromContext, SelectAllAccessibleSelectionFromContextFP, "selectAllAccessibleSelectionFromContext");
+
+            LOAD_FP(setTextContents, setTextContentsFP, "setTextContents");
+            LOAD_FP(getParentWithRole, getParentWithRoleFP, "getParentWithRole");
+            LOAD_FP(getTopLevelObject, getTopLevelObjectFP, "getTopLevelObject");
+            LOAD_FP(getParentWithRoleElseRoot, getParentWithRoleElseRootFP, "getParentWithRoleElseRoot");
+            LOAD_FP(getObjectDepth, getObjectDepthFP, "getObjectDepth");
+            LOAD_FP(getActiveDescendent, getActiveDescendentFP, "getActiveDescendent");
+
+            // additional methods for Teton
+            LOAD_FP(getVirtualAccessibleName, getVirtualAccessibleNameFP, "getVirtualAccessibleName");
+            LOAD_FP(requestFocus, requestFocusFP, "requestFocus");
+            LOAD_FP(selectTextRange, selectTextRangeFP, "selectTextRange");
+            LOAD_FP(getTextAttributesInRange, getTextAttributesInRangeFP, "getTextAttributesInRange");
+            LOAD_FP(getVisibleChildrenCount, getVisibleChildrenCountFP, "getVisibleChildrenCount");
+            LOAD_FP(getVisibleChildren, getVisibleChildrenFP, "getVisibleChildren");
+            LOAD_FP(setCaretPosition, setCaretPositionFP, "setCaretPosition");
+            LOAD_FP(getCaretLocation, getCaretLocationFP, "getCaretLocation");
+
+            LOAD_FP(getEventsWaiting, getEventsWaitingFP, "getEventsWaiting");
+
+            theAccessBridge.Windows_run();
+
+            theAccessBridgeInitializedFlag = TRUE;
+            return TRUE;
+        } else {
+            return FALSE;
+        }
+    }
+
+
+    BOOL shutdownAccessBridge() {
+        BOOL result;
+        DWORD error;
+        theAccessBridgeInitializedFlag = FALSE;
+        if (theAccessBridgeInstance != (HANDLE) 0) {
+            result = FreeLibrary(theAccessBridgeInstance);
+            if (result != TRUE) {
+                error = GetLastError();
+            }
+            return TRUE;
+        }
+        return FALSE;
+    }
+
+
+    void SetJavaShutdown(AccessBridge_JavaShutdownFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetJavaShutdown(fp);
+        }
+    }
+
+    void SetFocusGained(AccessBridge_FocusGainedFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetFocusGained(fp);
+        }
+    }
+
+    void SetFocusLost(AccessBridge_FocusLostFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetFocusLost(fp);
+        }
+    }
+
+
+    void SetCaretUpdate(AccessBridge_CaretUpdateFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetCaretUpdate(fp);
+        }
+    }
+
+
+    void SetMouseClicked(AccessBridge_MouseClickedFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetMouseClicked(fp);
+        }
+    }
+
+    void SetMouseEntered(AccessBridge_MouseEnteredFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetMouseEntered(fp);
+        }
+    }
+
+    void SetMouseExited(AccessBridge_MouseExitedFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetMouseExited(fp);
+        }
+    }
+
+    void SetMousePressed(AccessBridge_MousePressedFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetMousePressed(fp);
+        }
+    }
+
+    void SetMouseReleased(AccessBridge_MouseReleasedFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetMouseReleased(fp);
+        }
+    }
+
+
+    void SetMenuCanceled(AccessBridge_MenuCanceledFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetMenuCanceled(fp);
+        }
+    }
+
+    void SetMenuDeselected(AccessBridge_MenuDeselectedFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetMenuDeselected(fp);
+        }
+    }
+
+    void SetMenuSelected(AccessBridge_MenuSelectedFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetMenuSelected(fp);
+        }
+    }
+
+    void SetPopupMenuCanceled(AccessBridge_PopupMenuCanceledFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetPopupMenuCanceled(fp);
+        }
+    }
+
+    void SetPopupMenuWillBecomeInvisible(AccessBridge_PopupMenuWillBecomeInvisibleFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetPopupMenuWillBecomeInvisible(fp);
+        }
+    }
+
+    void SetPopupMenuWillBecomeVisible(AccessBridge_PopupMenuWillBecomeVisibleFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetPopupMenuWillBecomeVisible(fp);
+        }
+    }
+
+
+    void SetPropertyNameChange(AccessBridge_PropertyNameChangeFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetPropertyNameChange(fp);
+        }
+    }
+
+    void SetPropertyDescriptionChange(AccessBridge_PropertyDescriptionChangeFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetPropertyDescriptionChange(fp);
+        }
+    }
+
+    void SetPropertyStateChange(AccessBridge_PropertyStateChangeFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetPropertyStateChange(fp);
+        }
+    }
+
+    void SetPropertyValueChange(AccessBridge_PropertyValueChangeFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetPropertyValueChange(fp);
+        }
+    }
+
+    void SetPropertySelectionChange(AccessBridge_PropertySelectionChangeFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetPropertySelectionChange(fp);
+        }
+    }
+
+    void SetPropertyTextChange(AccessBridge_PropertyTextChangeFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetPropertyTextChange(fp);
+        }
+    }
+
+    void SetPropertyCaretChange(AccessBridge_PropertyCaretChangeFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetPropertyCaretChange(fp);
+        }
+    }
+
+    void SetPropertyVisibleDataChange(AccessBridge_PropertyVisibleDataChangeFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetPropertyVisibleDataChange(fp);
+        }
+    }
+
+    void SetPropertyChildChange(AccessBridge_PropertyChildChangeFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetPropertyChildChange(fp);
+        }
+    }
+
+    void SetPropertyActiveDescendentChange(AccessBridge_PropertyActiveDescendentChangeFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetPropertyActiveDescendentChange(fp);
+        }
+    }
+
+    void SetPropertyTableModelChange(AccessBridge_PropertyTableModelChangeFP fp) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SetPropertyTableModelChange(fp);
+        }
+    }
+
+    /**
+     * General routines
+     */
+    void ReleaseJavaObject(long vmID, Java_Object object) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.ReleaseJavaObject(vmID, object);
+        }
+    }
+
+    BOOL GetVersionInfo(long vmID, AccessBridgeVersionInfo *info) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetVersionInfo(vmID, info);
+        }
+        return FALSE;
+    }
+
+
+    /**
+     * Window routines
+     */
+    BOOL IsJavaWindow(HWND window) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+                        BOOL ret ;
+                        ret = theAccessBridge.IsJavaWindow(window);
+            return ret ;
+
+        }
+        return FALSE;
+    }
+
+
+    /**
+     * Returns the virtual machine ID and AccessibleContext for a top-level window
+     */
+    BOOL GetAccessibleContextFromHWND(HWND target, long *vmID, AccessibleContext *ac) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetAccessibleContextFromHWND(target, vmID, ac);
+        }
+        return FALSE;
+    }
+
+    /**
+     * Returns the HWND from the AccessibleContext of a top-level window.  Returns 0
+     *   on error or if the AccessibleContext does not refer to a top-level window.
+     */
+    HWND getHWNDFromAccessibleContext(long vmID, JOBJECT64 accesibleContext) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getHWNDFromAccessibleContext(vmID, accesibleContext);
+        }
+        return (HWND)0;
+    }
+
+    /**
+     * returns whether two objects are the same
+     */
+    BOOL IsSameObject(long vmID, JOBJECT64 obj1, JOBJECT64 obj2) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.IsSameObject(vmID, obj1, obj2);
+        }
+        return FALSE;
+    }
+
+    /**
+     * Sets editable text contents.  The AccessibleContext must implement AccessibleEditableText and
+     *   be editable.  The maximum text length is MAX_STRING_SIZE - 1.
+     * Returns whether successful
+     */
+    BOOL setTextContents (const long vmID, const AccessibleContext accessibleContext, const wchar_t *text) {
+
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.setTextContents(vmID, accessibleContext, text);
+        }
+        return FALSE;
+    }
+
+    /**
+     * Returns the Accessible Context with the specified role that is the
+     * ancestor of a given object. The role is one of the role strings
+     * defined in AccessBridgePackages.h
+     * If there is no ancestor object that has the specified role,
+     * returns (AccessibleContext)0.
+     */
+    AccessibleContext getParentWithRole (const long vmID, const AccessibleContext accessibleContext,
+                                         const wchar_t *role) {
+
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getParentWithRole(vmID, accessibleContext, role);
+        }
+        return (AccessibleContext)0;
+    }
+
+    /**
+     * Returns the Accessible Context with the specified role that is the
+     * ancestor of a given object. The role is one of the role strings
+     * defined in AccessBridgePackages.h.  If an object with the specified
+     * role does not exist, returns the top level object for the Java Window.
+     * Returns (AccessibleContext)0 on error.
+     */
+    AccessibleContext getParentWithRoleElseRoot (const long vmID, const AccessibleContext accessibleContext,
+                                                 const wchar_t *role) {
+
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getParentWithRoleElseRoot(vmID, accessibleContext, role);
+        }
+        return (AccessibleContext)0;
+    }
+
+    /**
+     * Returns the Accessible Context for the top level object in
+     * a Java Window.  This is same Accessible Context that is obtained
+     * from GetAccessibleContextFromHWND for that window.  Returns
+     * (AccessibleContext)0 on error.
+     */
+    AccessibleContext getTopLevelObject (const long vmID, const AccessibleContext accessibleContext) {
+
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getTopLevelObject(vmID, accessibleContext);
+        }
+        return (AccessibleContext)0;
+    }
+
+    /**
+     * Returns how deep in the object hierarchy a given object is.
+     * The top most object in the object hierarchy has an object depth of 0.
+     * Returns -1 on error.
+     */
+    int getObjectDepth (const long vmID, const AccessibleContext accessibleContext) {
+
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getObjectDepth(vmID, accessibleContext);
+        }
+        return -1;
+    }
+
+    /**
+     * Returns the Accessible Context of the current ActiveDescendent of an object.
+     * This method assumes the ActiveDescendent is the component that is currently
+     * selected in a container object.
+     * Returns (AccessibleContext)0 on error or if there is no selection.
+     */
+    AccessibleContext getActiveDescendent (const long vmID, const AccessibleContext accessibleContext) {
+
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getActiveDescendent(vmID, accessibleContext);
+        }
+        return (AccessibleContext)0;
+    }
+
+
+    /**
+     * Accessible Context routines
+     */
+    BOOL GetAccessibleContextAt(long vmID, AccessibleContext acParent,
+                                jint x, jint y, AccessibleContext *ac) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetAccessibleContextAt(vmID, acParent, x, y, ac);
+        }
+        return FALSE;
+    }
+
+    BOOL GetAccessibleContextWithFocus(HWND window, long *vmID, AccessibleContext *ac) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetAccessibleContextWithFocus(window, vmID, ac);
+        }
+        return FALSE;
+    }
+
+    BOOL GetAccessibleContextInfo(long vmID, AccessibleContext ac, AccessibleContextInfo *info) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetAccessibleContextInfo(vmID, ac, info);
+        }
+        return FALSE;
+    }
+
+    AccessibleContext GetAccessibleChildFromContext(long vmID, AccessibleContext ac, jint index) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetAccessibleChildFromContext(vmID, ac, index);
+        }
+        return (AccessibleContext) 0;
+    }
+
+    AccessibleContext GetAccessibleParentFromContext(long vmID, AccessibleContext ac) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetAccessibleParentFromContext(vmID, ac);
+        }
+        return (AccessibleContext) 0;
+    }
+
+    /* begin AccessibleTable routines */
+
+    /*
+     * get information about an AccessibleTable
+     */
+    BOOL getAccessibleTableInfo(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleTableInfo(vmID, acParent, tableInfo);
+        }
+        return FALSE;
+    }
+
+    /*
+     * get information about an AccessibleTable cell
+     */
+    BOOL getAccessibleTableCellInfo(long vmID, AccessibleTable accessibleTable,
+                                    jint row, jint column, AccessibleTableCellInfo *tableCellInfo) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleTableCellInfo(vmID, accessibleTable, row, column, tableCellInfo);
+        }
+        return FALSE;
+    }
+
+    /*
+     * get information about an AccessibleTable row header
+     */
+    BOOL getAccessibleTableRowHeader(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleTableRowHeader(vmID, acParent, tableInfo);
+        }
+        return FALSE;
+    }
+
+    /*
+     * get information about an AccessibleTable column header
+     */
+    BOOL getAccessibleTableColumnHeader(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo) {
+
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleTableColumnHeader(vmID, acParent, tableInfo);
+        }
+        return FALSE;
+    }
+
+    /*
+     * return a description of an AccessibleTable row header
+     */
+    AccessibleContext getAccessibleTableRowDescription(long vmID, AccessibleContext acParent, jint row) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleTableRowDescription(vmID, acParent, row);
+        }
+        return (AccessibleContext)0;
+    }
+
+    /*
+     * return a description of an AccessibleTable column header
+     */
+    AccessibleContext getAccessibleTableColumnDescription(long vmID, AccessibleContext acParent, jint column) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleTableColumnDescription(vmID, acParent, column);
+        }
+        return (AccessibleContext)0;
+    }
+
+    /*
+     * return the number of rows selected in an AccessibleTable
+     */
+    jint getAccessibleTableRowSelectionCount(long vmID, AccessibleTable table) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleTableRowSelectionCount(vmID, table);
+        }
+        return -1;
+    }
+
+    /*
+     * return whether a row is selected in an AccessibleTable
+     */
+    BOOL isAccessibleTableRowSelected(long vmID, AccessibleTable table, jint row) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.isAccessibleTableRowSelected(vmID, table, row);
+        }
+        return FALSE;
+    }
+
+    /*
+     * get an array of selected rows in an AccessibleTable
+     */
+    BOOL getAccessibleTableRowSelections(long vmID, AccessibleTable table, jint count, jint *selections) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleTableRowSelections(vmID, table, count, selections);
+        }
+        return FALSE;
+    }
+
+    /*
+     * return the number of columns selected in an AccessibleTable
+     */
+    jint getAccessibleTableColumnSelectionCount(long vmID, AccessibleTable table) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleTableColumnSelectionCount(vmID, table);
+        }
+        return -1;
+    }
+
+    /*
+     * return whether a column is selected in an AccessibleTable
+     */
+    BOOL isAccessibleTableColumnSelected(long vmID, AccessibleTable table, jint column) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.isAccessibleTableColumnSelected(vmID, table, column);
+        }
+        return FALSE;
+    }
+
+    /*
+     * get an array of columns selected in an AccessibleTable
+     */
+    BOOL getAccessibleTableColumnSelections(long vmID, AccessibleTable table, jint count, jint *selections) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleTableColumnSelections(vmID, table, count, selections);
+        }
+        return FALSE;
+    }
+
+    /*
+     * return the row number for a cell at a given index
+     */
+    jint
+    getAccessibleTableRow(long vmID, AccessibleTable table, jint index) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleTableRow(vmID, table, index);
+        }
+        return -1;
+    }
+
+    /*
+     * return the column number for a cell at a given index
+     */
+    jint
+    getAccessibleTableColumn(long vmID, AccessibleTable table, jint index) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleTableColumn(vmID, table, index);
+        }
+        return -1;
+    }
+
+    /*
+     * return the index of a cell at a given row and column
+     */
+    jint
+    getAccessibleTableIndex(long vmID, AccessibleTable table, jint row, jint column) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleTableIndex(vmID, table, row, column);
+        }
+        return -1;
+    }
+
+    /* end AccessibleTable routines */
+
+
+    /**
+     * Accessible Text routines
+     */
+    BOOL GetAccessibleTextInfo(long vmID, AccessibleText at, AccessibleTextInfo *textInfo, jint x, jint y) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetAccessibleTextInfo(vmID, at, textInfo, x, y);
+        }
+        return FALSE;
+    }
+
+    BOOL GetAccessibleTextItems(long vmID, AccessibleText at, AccessibleTextItemsInfo *textItems, jint index) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetAccessibleTextItems(vmID, at, textItems, index);
+        }
+        return FALSE;
+    }
+
+    BOOL GetAccessibleTextSelectionInfo(long vmID, AccessibleText at, AccessibleTextSelectionInfo *textSelection) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetAccessibleTextSelectionInfo(vmID, at, textSelection);
+        }
+        return FALSE;
+    }
+
+    BOOL GetAccessibleTextAttributes(long vmID, AccessibleText at, jint index, AccessibleTextAttributesInfo *attributes) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetAccessibleTextAttributes(vmID, at, index, attributes);
+        }
+        return FALSE;
+    }
+
+    BOOL GetAccessibleTextRect(long vmID, AccessibleText at, AccessibleTextRectInfo *rectInfo, jint index) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetAccessibleTextRect(vmID, at, rectInfo, index);
+        }
+        return FALSE;
+    }
+
+    BOOL GetAccessibleTextLineBounds(long vmID, AccessibleText at, jint index, jint *startIndex, jint *endIndex) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetAccessibleTextLineBounds(vmID, at, index, startIndex, endIndex);
+        }
+        return FALSE;
+    }
+
+    BOOL GetAccessibleTextRange(long vmID, AccessibleText at, jint start, jint end, wchar_t *text, short len) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetAccessibleTextRange(vmID, at, start, end, text, len);
+        }
+        return FALSE;
+    }
+
+    /**
+     * AccessibleRelationSet routines
+     */
+    BOOL getAccessibleRelationSet(long vmID, AccessibleContext accessibleContext,
+                                  AccessibleRelationSetInfo *relationSetInfo) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleRelationSet(vmID, accessibleContext, relationSetInfo);
+        }
+        return FALSE;
+    }
+
+    /**
+     * AccessibleHypertext routines
+     */
+
+    // Gets AccessibleHypertext for an AccessibleContext
+    BOOL getAccessibleHypertext(long vmID, AccessibleContext accessibleContext,
+                                AccessibleHypertextInfo *hypertextInfo) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleHypertext(vmID, accessibleContext, hypertextInfo);
+        }
+        return FALSE;
+    }
+
+    // Activates an AccessibleHyperlink for an AccessibleContext
+    BOOL activateAccessibleHyperlink(long vmID, AccessibleContext accessibleContext,
+                                     AccessibleHyperlink accessibleHyperlink) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.activateAccessibleHyperlink(vmID, accessibleContext, accessibleHyperlink);
+        }
+        return FALSE;
+    }
+
+    /*
+     * Returns the number of hyperlinks in a component
+     * Maps to AccessibleHypertext.getLinkCount.
+     * Returns -1 on error.
+     */
+    jint getAccessibleHyperlinkCount(const long vmID,
+                                     const AccessibleContext accessibleContext) {
+
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleHyperlinkCount(vmID, accessibleContext);
+        }
+        return -1;
+    }
+
+    /*
+     * This method is used to iterate through the hyperlinks in a component.  It
+     * returns hypertext information for a component starting at hyperlink index
+     * nStartIndex.  No more than MAX_HYPERLINKS AccessibleHypertextInfo objects will
+     * be returned for each call to this method.
+     * returns FALSE on error.
+     */
+    BOOL getAccessibleHypertextExt(const long vmID,
+                                   const AccessibleContext accessibleContext,
+                                   const jint nStartIndex,
+                                   /* OUT */ AccessibleHypertextInfo *hypertextInfo) {
+
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleHypertextExt(vmID,
+                                                             accessibleContext,
+                                                             nStartIndex,
+                                                             hypertextInfo);
+        }
+        return FALSE;
+    }
+
+    /*
+     * Returns the index into an array of hyperlinks that is associated with
+     * a character index in document;
+     * Maps to AccessibleHypertext.getLinkIndex.
+     * Returns -1 on error.
+     */
+    jint getAccessibleHypertextLinkIndex(const long vmID,
+                                         const AccessibleHypertext hypertext,
+                                         const jint nIndex) {
+
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleHypertextLinkIndex(vmID,
+                                                                   hypertext,
+                                                                   nIndex);
+        }
+        return -1;
+    }
+
+    /*
+     * Returns the nth hyperlink in a document.
+     * Maps to AccessibleHypertext.getLink.
+     * Returns -1 on error
+     */
+    BOOL getAccessibleHyperlink(const long vmID,
+                                const AccessibleHypertext hypertext,
+                                const jint nIndex,
+                                /* OUT */ AccessibleHyperlinkInfo *hyperlinkInfo) {
+
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleHyperlink(vmID,
+                                                          hypertext,
+                                                          nIndex,
+                                                          hyperlinkInfo);
+        }
+        return FALSE;
+    }
+
+
+    /* Accessible KeyBindings, Icons and Actions */
+    BOOL getAccessibleKeyBindings(long vmID, AccessibleContext accessibleContext,
+                                  AccessibleKeyBindings *keyBindings) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleKeyBindings(vmID, accessibleContext, keyBindings);
+        }
+        return FALSE;
+    }
+
+    BOOL getAccessibleIcons(long vmID, AccessibleContext accessibleContext,
+                            AccessibleIcons *icons) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleIcons(vmID, accessibleContext, icons);
+        }
+        return FALSE;
+    }
+
+    BOOL getAccessibleActions(long vmID, AccessibleContext accessibleContext,
+                              AccessibleActions *actions) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getAccessibleActions(vmID, accessibleContext, actions);
+        }
+        return FALSE;
+    }
+
+    BOOL doAccessibleActions(long vmID, AccessibleContext accessibleContext,
+                             AccessibleActionsToDo *actionsToDo, jint *failure) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.doAccessibleActions(vmID, accessibleContext, actionsToDo, failure);
+        }
+        return FALSE;
+    }
+
+    /**
+     * Accessible Value routines
+     */
+    BOOL GetCurrentAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetCurrentAccessibleValueFromContext(vmID, av, value, len);
+        }
+        return FALSE;
+    }
+
+    BOOL GetMaximumAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetMaximumAccessibleValueFromContext(vmID, av, value, len);
+        }
+        return FALSE;
+    }
+
+    BOOL GetMinimumAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetMinimumAccessibleValueFromContext(vmID, av, value, len);
+        }
+        return FALSE;
+    }
+
+
+    /**
+     * Accessible Selection routines
+     */
+    void addAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.AddAccessibleSelectionFromContext(vmID, as, i);
+        }
+    }
+
+    void clearAccessibleSelectionFromContext(long vmID, AccessibleSelection as) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.ClearAccessibleSelectionFromContext(vmID, as);
+        }
+    }
+
+    JOBJECT64 GetAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetAccessibleSelectionFromContext(vmID, as, i);
+        }
+        return (JOBJECT64) 0;
+    }
+
+    int GetAccessibleSelectionCountFromContext(long vmID, AccessibleSelection as) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.GetAccessibleSelectionCountFromContext(vmID, as);
+        }
+        return -1;
+    }
+
+    BOOL IsAccessibleChildSelectedFromContext(long vmID, AccessibleSelection as, int i) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.IsAccessibleChildSelectedFromContext(vmID, as, i);
+        }
+        return FALSE;
+    }
+
+    void RemoveAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.RemoveAccessibleSelectionFromContext(vmID, as, i);
+        }
+    }
+
+    void SelectAllAccessibleSelectionFromContext(long vmID, AccessibleSelection as) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            theAccessBridge.SelectAllAccessibleSelectionFromContext(vmID, as);
+        }
+    }
+
+    /**
+     * Additional methods for Teton
+     */
+
+    /**
+     * Gets the AccessibleName for a component based upon the JAWS algorithm. Returns
+     * whether successful.
+     *
+     * Bug ID 4916682 - Implement JAWS AccessibleName policy
+     */
+    BOOL getVirtualAccessibleName(const long vmID, const AccessibleContext accessibleContext,
+                                  wchar_t *name, int len) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getVirtualAccessibleName(vmID, accessibleContext, name, len);
+        }
+        return FALSE;
+    }
+
+    /**
+     * Request focus for a component. Returns whether successful;
+     *
+     * Bug ID 4944757 - requestFocus method needed
+     */
+    BOOL requestFocus(const long vmID, const AccessibleContext accessibleContext) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.requestFocus(vmID, accessibleContext);
+        }
+        return FALSE;
+    }
+
+    /**
+     * Selects text between two indices.  Selection includes the text at the start index
+     * and the text at the end index. Returns whether successful;
+     *
+     * Bug ID 4944758 - selectTextRange method needed
+     */
+    BOOL selectTextRange(const long vmID, const AccessibleContext accessibleContext,
+                         const int startIndex, const int endIndex) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.selectTextRange(vmID, accessibleContext, startIndex, endIndex);
+        }
+        return FALSE;
+    }
+
+    /**
+     * Get text attributes between two indices.  The attribute list includes the text at the
+     * start index and the text at the end index. Returns whether successful;
+     *
+     * Bug ID 4944761 - getTextAttributes between two indices method needed
+     */
+    BOOL getTextAttributesInRange(const long vmID, const AccessibleContext accessibleContext,
+                                  const int startIndex, const int endIndex,
+                                  AccessibleTextAttributesInfo *attributes, short *len) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getTextAttributesInRange(vmID, accessibleContext, startIndex,
+                                                            endIndex, attributes, len);
+        }
+        return FALSE;
+    }
+
+    /**
+     * Returns the number of visible children of a component. Returns -1 on error.
+     *
+     * Bug ID 4944762- getVisibleChildren for list-like components needed
+     */
+    int getVisibleChildrenCount(const long vmID, const AccessibleContext accessibleContext) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getVisibleChildrenCount(vmID, accessibleContext);
+        }
+        return FALSE;
+    }
+
+    /**
+     * Gets the visible children of an AccessibleContext. Returns whether successful;
+     *
+     * Bug ID 4944762- getVisibleChildren for list-like components needed
+     */
+    BOOL getVisibleChildren(const long vmID, const AccessibleContext accessibleContext,
+                            const int startIndex, VisibleChildrenInfo *visibleChildrenInfo) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getVisibleChildren(vmID, accessibleContext, startIndex,
+                                                      visibleChildrenInfo);
+        }
+        return FALSE;
+    }
+
+    /**
+     * Set the caret to a text position. Returns whether successful;
+     *
+     * Bug ID 4944770 - setCaretPosition method needed
+     */
+    BOOL setCaretPosition(const long vmID, const AccessibleContext accessibleContext,
+                          const int position) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.setCaretPosition(vmID, accessibleContext, position);
+        }
+        return FALSE;
+    }
+
+    /**
+     * Gets the text caret location
+     */
+    BOOL getCaretLocation(long vmID, AccessibleContext ac, AccessibleTextRectInfo *rectInfo, jint index) {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getCaretLocation(vmID, ac, rectInfo, index);
+        }
+        return FALSE;
+    }
+
+    /**
+     * Gets the number of events waiting to fire
+     */
+    int getEventsWaiting() {
+        if (theAccessBridgeInitializedFlag == TRUE) {
+            return theAccessBridge.getEventsWaiting();
+        }
+        return FALSE;
+    }
+
+#ifdef __cplusplus
+}
+#endif
--- a/jdk/src/jdk.accessibility/windows/native/include/bridge/AccessBridgeCallbacks.h	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/jdk.accessibility/windows/native/include/bridge/AccessBridgeCallbacks.h	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -24,10 +24,6 @@
  */
 
 /*
- * AccessBridgeCallbacks.h      1.17 05/03/21
- */
-
-/*
  * Header file defining callback typedefs for Windows routines
  * which are called from Java (responding to events, etc.).
  */
--- a/jdk/src/jdk.accessibility/windows/native/include/bridge/AccessBridgeCalls.c	Wed Nov 23 19:14:47 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1131 +0,0 @@
-/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @(#)AccessBridgeCalls.c      1.25 05/08/22
- */
-
-/*
- * Wrapper functions around calls to the AccessBridge DLL
- */
-
-
-#include <windows.h>
-#include <jni.h>
-
-
-//#define ACCESSBRIDGE_32
-//#define ACCESSBRIDGE_64
-
-#include "AccessBridgeCalls.h"
-#include "AccessBridgeDebug.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    HINSTANCE theAccessBridgeInstance;
-    AccessBridgeFPs theAccessBridge;
-
-    BOOL theAccessBridgeInitializedFlag = FALSE;
-
-#define LOAD_FP(result, type, name) \
-    PrintDebugString("LOAD_FP loading: %s ...", name); \
-    if ((theAccessBridge.result = \
-        (type) GetProcAddress(theAccessBridgeInstance, name)) == (type) 0) { \
-        PrintDebugString("LOAD_FP failed: %s", name); \
-        return FALSE; \
-    }
-
-    BOOL initializeAccessBridge() {
-
-#ifdef ACCESSBRIDGE_ARCH_32 // For 32bit AT new bridge
-        theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE-32");
-#else
-#ifdef ACCESSBRIDGE_ARCH_64 // For 64bit AT new bridge
-                theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE-64");
-#else // legacy
-        theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE");
-#endif
-#endif
-        if (theAccessBridgeInstance != 0) {
-            LOAD_FP(Windows_run, Windows_runFP, "Windows_run");
-
-            LOAD_FP(SetJavaShutdown, SetJavaShutdownFP, "setJavaShutdownFP");
-            LOAD_FP(SetFocusGained, SetFocusGainedFP, "setFocusGainedFP");
-            LOAD_FP(SetFocusLost, SetFocusLostFP, "setFocusLostFP");
-
-            LOAD_FP(SetCaretUpdate, SetCaretUpdateFP, "setCaretUpdateFP");
-
-            LOAD_FP(SetMouseClicked, SetMouseClickedFP, "setMouseClickedFP");
-            LOAD_FP(SetMouseEntered, SetMouseEnteredFP, "setMouseEnteredFP");
-            LOAD_FP(SetMouseExited, SetMouseExitedFP, "setMouseExitedFP");
-            LOAD_FP(SetMousePressed, SetMousePressedFP, "setMousePressedFP");
-            LOAD_FP(SetMouseReleased, SetMouseReleasedFP, "setMouseReleasedFP");
-
-            LOAD_FP(SetMenuCanceled, SetMenuCanceledFP, "setMenuCanceledFP");
-            LOAD_FP(SetMenuDeselected, SetMenuDeselectedFP, "setMenuDeselectedFP");
-            LOAD_FP(SetMenuSelected, SetMenuSelectedFP, "setMenuSelectedFP");
-            LOAD_FP(SetPopupMenuCanceled, SetPopupMenuCanceledFP, "setPopupMenuCanceledFP");
-            LOAD_FP(SetPopupMenuWillBecomeInvisible, SetPopupMenuWillBecomeInvisibleFP, "setPopupMenuWillBecomeInvisibleFP");
-            LOAD_FP(SetPopupMenuWillBecomeVisible, SetPopupMenuWillBecomeVisibleFP, "setPopupMenuWillBecomeVisibleFP");
-
-            LOAD_FP(SetPropertyNameChange, SetPropertyNameChangeFP, "setPropertyNameChangeFP");
-            LOAD_FP(SetPropertyDescriptionChange, SetPropertyDescriptionChangeFP, "setPropertyDescriptionChangeFP");
-            LOAD_FP(SetPropertyStateChange, SetPropertyStateChangeFP, "setPropertyStateChangeFP");
-            LOAD_FP(SetPropertyValueChange, SetPropertyValueChangeFP, "setPropertyValueChangeFP");
-            LOAD_FP(SetPropertySelectionChange, SetPropertySelectionChangeFP, "setPropertySelectionChangeFP");
-            LOAD_FP(SetPropertyTextChange, SetPropertyTextChangeFP, "setPropertyTextChangeFP");
-            LOAD_FP(SetPropertyCaretChange, SetPropertyCaretChangeFP, "setPropertyCaretChangeFP");
-            LOAD_FP(SetPropertyVisibleDataChange, SetPropertyVisibleDataChangeFP, "setPropertyVisibleDataChangeFP");
-            LOAD_FP(SetPropertyChildChange, SetPropertyChildChangeFP, "setPropertyChildChangeFP");
-            LOAD_FP(SetPropertyActiveDescendentChange, SetPropertyActiveDescendentChangeFP, "setPropertyActiveDescendentChangeFP");
-
-            LOAD_FP(SetPropertyTableModelChange, SetPropertyTableModelChangeFP, "setPropertyTableModelChangeFP");
-
-            LOAD_FP(ReleaseJavaObject, ReleaseJavaObjectFP, "releaseJavaObject");
-            LOAD_FP(GetVersionInfo, GetVersionInfoFP, "getVersionInfo");
-
-            LOAD_FP(IsJavaWindow, IsJavaWindowFP, "isJavaWindow");
-            LOAD_FP(IsSameObject, IsSameObjectFP, "isSameObject");
-            LOAD_FP(GetAccessibleContextFromHWND, GetAccessibleContextFromHWNDFP, "getAccessibleContextFromHWND");
-            LOAD_FP(getHWNDFromAccessibleContext, getHWNDFromAccessibleContextFP, "getHWNDFromAccessibleContext");
-
-            LOAD_FP(GetAccessibleContextAt, GetAccessibleContextAtFP, "getAccessibleContextAt");
-            LOAD_FP(GetAccessibleContextWithFocus, GetAccessibleContextWithFocusFP, "getAccessibleContextWithFocus");
-            LOAD_FP(GetAccessibleContextInfo, GetAccessibleContextInfoFP, "getAccessibleContextInfo");
-            LOAD_FP(GetAccessibleChildFromContext, GetAccessibleChildFromContextFP, "getAccessibleChildFromContext");
-            LOAD_FP(GetAccessibleParentFromContext, GetAccessibleParentFromContextFP, "getAccessibleParentFromContext");
-
-            /* begin AccessibleTable */
-            LOAD_FP(getAccessibleTableInfo, getAccessibleTableInfoFP, "getAccessibleTableInfo");
-            LOAD_FP(getAccessibleTableCellInfo, getAccessibleTableCellInfoFP, "getAccessibleTableCellInfo");
-
-            LOAD_FP(getAccessibleTableRowHeader, getAccessibleTableRowHeaderFP, "getAccessibleTableRowHeader");
-            LOAD_FP(getAccessibleTableColumnHeader, getAccessibleTableColumnHeaderFP, "getAccessibleTableColumnHeader");
-
-            LOAD_FP(getAccessibleTableRowDescription, getAccessibleTableRowDescriptionFP, "getAccessibleTableRowDescription");
-            LOAD_FP(getAccessibleTableColumnDescription, getAccessibleTableColumnDescriptionFP, "getAccessibleTableColumnDescription");
-
-            LOAD_FP(getAccessibleTableRowSelectionCount, getAccessibleTableRowSelectionCountFP,
-                    "getAccessibleTableRowSelectionCount");
-            LOAD_FP(isAccessibleTableRowSelected, isAccessibleTableRowSelectedFP,
-                    "isAccessibleTableRowSelected");
-            LOAD_FP(getAccessibleTableRowSelections, getAccessibleTableRowSelectionsFP,
-                    "getAccessibleTableRowSelections");
-
-            LOAD_FP(getAccessibleTableColumnSelectionCount, getAccessibleTableColumnSelectionCountFP,
-                    "getAccessibleTableColumnSelectionCount");
-            LOAD_FP(isAccessibleTableColumnSelected, isAccessibleTableColumnSelectedFP,
-                    "isAccessibleTableColumnSelected");
-            LOAD_FP(getAccessibleTableColumnSelections, getAccessibleTableColumnSelectionsFP,
-                    "getAccessibleTableColumnSelections");
-
-            LOAD_FP(getAccessibleTableRow, getAccessibleTableRowFP,
-                    "getAccessibleTableRow");
-            LOAD_FP(getAccessibleTableColumn, getAccessibleTableColumnFP,
-                    "getAccessibleTableColumn");
-            LOAD_FP(getAccessibleTableIndex, getAccessibleTableIndexFP,
-                    "getAccessibleTableIndex");
-
-            /* end AccessibleTable */
-
-            /* AccessibleRelationSet */
-            LOAD_FP(getAccessibleRelationSet, getAccessibleRelationSetFP, "getAccessibleRelationSet");
-
-            /* AccessibleHypertext */
-            LOAD_FP(getAccessibleHypertext, getAccessibleHypertextFP, "getAccessibleHypertext");
-            LOAD_FP(activateAccessibleHyperlink, activateAccessibleHyperlinkFP, "activateAccessibleHyperlink");
-            LOAD_FP(getAccessibleHyperlinkCount, getAccessibleHyperlinkCountFP, "getAccessibleHyperlinkCount");
-            LOAD_FP(getAccessibleHypertextExt, getAccessibleHypertextExtFP, "getAccessibleHypertextExt");
-            LOAD_FP(getAccessibleHypertextLinkIndex, getAccessibleHypertextLinkIndexFP, "getAccessibleHypertextLinkIndex");
-            LOAD_FP(getAccessibleHyperlink, getAccessibleHyperlinkFP, "getAccessibleHyperlink");
-
-            /* Accessible KeyBinding, Icon and Action */
-            LOAD_FP(getAccessibleKeyBindings, getAccessibleKeyBindingsFP, "getAccessibleKeyBindings");
-            LOAD_FP(getAccessibleIcons, getAccessibleIconsFP, "getAccessibleIcons");
-            LOAD_FP(getAccessibleActions, getAccessibleActionsFP, "getAccessibleActions");
-            LOAD_FP(doAccessibleActions, doAccessibleActionsFP, "doAccessibleActions");
-
-            /* AccessibleText */
-            LOAD_FP(GetAccessibleTextInfo, GetAccessibleTextInfoFP, "getAccessibleTextInfo");
-            LOAD_FP(GetAccessibleTextItems, GetAccessibleTextItemsFP, "getAccessibleTextItems");
-            LOAD_FP(GetAccessibleTextSelectionInfo, GetAccessibleTextSelectionInfoFP, "getAccessibleTextSelectionInfo");
-            LOAD_FP(GetAccessibleTextAttributes, GetAccessibleTextAttributesFP, "getAccessibleTextAttributes");
-            LOAD_FP(GetAccessibleTextRect, GetAccessibleTextRectFP, "getAccessibleTextRect");
-            LOAD_FP(GetAccessibleTextLineBounds, GetAccessibleTextLineBoundsFP, "getAccessibleTextLineBounds");
-            LOAD_FP(GetAccessibleTextRange, GetAccessibleTextRangeFP, "getAccessibleTextRange");
-
-            LOAD_FP(GetCurrentAccessibleValueFromContext, GetCurrentAccessibleValueFromContextFP, "getCurrentAccessibleValueFromContext");
-            LOAD_FP(GetMaximumAccessibleValueFromContext, GetMaximumAccessibleValueFromContextFP, "getMaximumAccessibleValueFromContext");
-            LOAD_FP(GetMinimumAccessibleValueFromContext, GetMinimumAccessibleValueFromContextFP, "getMinimumAccessibleValueFromContext");
-
-            LOAD_FP(AddAccessibleSelectionFromContext, AddAccessibleSelectionFromContextFP, "addAccessibleSelectionFromContext");
-            LOAD_FP(ClearAccessibleSelectionFromContext, ClearAccessibleSelectionFromContextFP, "clearAccessibleSelectionFromContext");
-            LOAD_FP(GetAccessibleSelectionFromContext, GetAccessibleSelectionFromContextFP, "getAccessibleSelectionFromContext");
-            LOAD_FP(GetAccessibleSelectionCountFromContext, GetAccessibleSelectionCountFromContextFP, "getAccessibleSelectionCountFromContext");
-            LOAD_FP(IsAccessibleChildSelectedFromContext, IsAccessibleChildSelectedFromContextFP, "isAccessibleChildSelectedFromContext");
-            LOAD_FP(RemoveAccessibleSelectionFromContext, RemoveAccessibleSelectionFromContextFP, "removeAccessibleSelectionFromContext");
-            LOAD_FP(SelectAllAccessibleSelectionFromContext, SelectAllAccessibleSelectionFromContextFP, "selectAllAccessibleSelectionFromContext");
-
-            LOAD_FP(setTextContents, setTextContentsFP, "setTextContents");
-            LOAD_FP(getParentWithRole, getParentWithRoleFP, "getParentWithRole");
-            LOAD_FP(getTopLevelObject, getTopLevelObjectFP, "getTopLevelObject");
-            LOAD_FP(getParentWithRoleElseRoot, getParentWithRoleElseRootFP, "getParentWithRoleElseRoot");
-            LOAD_FP(getObjectDepth, getObjectDepthFP, "getObjectDepth");
-            LOAD_FP(getActiveDescendent, getActiveDescendentFP, "getActiveDescendent");
-
-            // additional methods for Teton
-            LOAD_FP(getVirtualAccessibleName, getVirtualAccessibleNameFP, "getVirtualAccessibleName");
-            LOAD_FP(requestFocus, requestFocusFP, "requestFocus");
-            LOAD_FP(selectTextRange, selectTextRangeFP, "selectTextRange");
-            LOAD_FP(getTextAttributesInRange, getTextAttributesInRangeFP, "getTextAttributesInRange");
-            LOAD_FP(getVisibleChildrenCount, getVisibleChildrenCountFP, "getVisibleChildrenCount");
-            LOAD_FP(getVisibleChildren, getVisibleChildrenFP, "getVisibleChildren");
-            LOAD_FP(setCaretPosition, setCaretPositionFP, "setCaretPosition");
-            LOAD_FP(getCaretLocation, getCaretLocationFP, "getCaretLocation");
-
-            LOAD_FP(getEventsWaiting, getEventsWaitingFP, "getEventsWaiting");
-
-            theAccessBridge.Windows_run();
-
-            theAccessBridgeInitializedFlag = TRUE;
-            PrintDebugString("theAccessBridgeInitializedFlag = TRUE");
-            return TRUE;
-        } else {
-            return FALSE;
-        }
-    }
-
-
-    BOOL shutdownAccessBridge() {
-        BOOL result;
-        DWORD error;
-        theAccessBridgeInitializedFlag = FALSE;
-        if (theAccessBridgeInstance != (HANDLE) 0) {
-            result = FreeLibrary(theAccessBridgeInstance);
-            if (result != TRUE) {
-                error = GetLastError();
-            }
-            return TRUE;
-        }
-        return FALSE;
-    }
-
-
-    void SetJavaShutdown(AccessBridge_JavaShutdownFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetJavaShutdown(fp);
-        }
-    }
-
-    void SetFocusGained(AccessBridge_FocusGainedFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetFocusGained(fp);
-        }
-    }
-
-    void SetFocusLost(AccessBridge_FocusLostFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetFocusLost(fp);
-        }
-    }
-
-
-    void SetCaretUpdate(AccessBridge_CaretUpdateFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetCaretUpdate(fp);
-        }
-    }
-
-
-    void SetMouseClicked(AccessBridge_MouseClickedFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetMouseClicked(fp);
-        }
-    }
-
-    void SetMouseEntered(AccessBridge_MouseEnteredFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetMouseEntered(fp);
-        }
-    }
-
-    void SetMouseExited(AccessBridge_MouseExitedFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetMouseExited(fp);
-        }
-    }
-
-    void SetMousePressed(AccessBridge_MousePressedFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetMousePressed(fp);
-        }
-    }
-
-    void SetMouseReleased(AccessBridge_MouseReleasedFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetMouseReleased(fp);
-        }
-    }
-
-
-    void SetMenuCanceled(AccessBridge_MenuCanceledFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetMenuCanceled(fp);
-        }
-    }
-
-    void SetMenuDeselected(AccessBridge_MenuDeselectedFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetMenuDeselected(fp);
-        }
-    }
-
-    void SetMenuSelected(AccessBridge_MenuSelectedFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetMenuSelected(fp);
-        }
-    }
-
-    void SetPopupMenuCanceled(AccessBridge_PopupMenuCanceledFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetPopupMenuCanceled(fp);
-        }
-    }
-
-    void SetPopupMenuWillBecomeInvisible(AccessBridge_PopupMenuWillBecomeInvisibleFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetPopupMenuWillBecomeInvisible(fp);
-        }
-    }
-
-    void SetPopupMenuWillBecomeVisible(AccessBridge_PopupMenuWillBecomeVisibleFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetPopupMenuWillBecomeVisible(fp);
-        }
-    }
-
-
-    void SetPropertyNameChange(AccessBridge_PropertyNameChangeFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetPropertyNameChange(fp);
-        }
-    }
-
-    void SetPropertyDescriptionChange(AccessBridge_PropertyDescriptionChangeFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetPropertyDescriptionChange(fp);
-        }
-    }
-
-    void SetPropertyStateChange(AccessBridge_PropertyStateChangeFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetPropertyStateChange(fp);
-        }
-    }
-
-    void SetPropertyValueChange(AccessBridge_PropertyValueChangeFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetPropertyValueChange(fp);
-        }
-    }
-
-    void SetPropertySelectionChange(AccessBridge_PropertySelectionChangeFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetPropertySelectionChange(fp);
-        }
-    }
-
-    void SetPropertyTextChange(AccessBridge_PropertyTextChangeFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetPropertyTextChange(fp);
-        }
-    }
-
-    void SetPropertyCaretChange(AccessBridge_PropertyCaretChangeFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetPropertyCaretChange(fp);
-        }
-    }
-
-    void SetPropertyVisibleDataChange(AccessBridge_PropertyVisibleDataChangeFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetPropertyVisibleDataChange(fp);
-        }
-    }
-
-    void SetPropertyChildChange(AccessBridge_PropertyChildChangeFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetPropertyChildChange(fp);
-        }
-    }
-
-    void SetPropertyActiveDescendentChange(AccessBridge_PropertyActiveDescendentChangeFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetPropertyActiveDescendentChange(fp);
-        }
-    }
-
-    void SetPropertyTableModelChange(AccessBridge_PropertyTableModelChangeFP fp) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SetPropertyTableModelChange(fp);
-        }
-    }
-
-    /**
-     * General routines
-     */
-    void ReleaseJavaObject(long vmID, Java_Object object) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.ReleaseJavaObject(vmID, object);
-        }
-    }
-
-    BOOL GetVersionInfo(long vmID, AccessBridgeVersionInfo *info) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetVersionInfo(vmID, info);
-        }
-        return FALSE;
-    }
-
-
-    /**
-     * Window routines
-     */
-    BOOL IsJavaWindow(HWND window) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-                        BOOL ret ;
-                        ret = theAccessBridge.IsJavaWindow(window);
-            return ret ;
-
-        }
-        return FALSE;
-    }
-
-
-    /**
-     * Returns the virtual machine ID and AccessibleContext for a top-level window
-     */
-    BOOL GetAccessibleContextFromHWND(HWND target, long *vmID, AccessibleContext *ac) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetAccessibleContextFromHWND(target, vmID, ac);
-        }
-        return FALSE;
-    }
-
-    /**
-     * Returns the HWND from the AccessibleContext of a top-level window.  Returns 0
-     *   on error or if the AccessibleContext does not refer to a top-level window.
-     */
-    HWND getHWNDFromAccessibleContext(long vmID, JOBJECT64 accesibleContext) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getHWNDFromAccessibleContext(vmID, accesibleContext);
-        }
-        return (HWND)0;
-    }
-
-    /**
-     * returns whether two objects are the same
-     */
-    BOOL IsSameObject(long vmID, JOBJECT64 obj1, JOBJECT64 obj2) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.IsSameObject(vmID, obj1, obj2);
-        }
-        return FALSE;
-    }
-
-    /**
-     * Sets editable text contents.  The AccessibleContext must implement AccessibleEditableText and
-     *   be editable.  The maximum text length is MAX_STRING_SIZE - 1.
-     * Returns whether successful
-     */
-    BOOL setTextContents (const long vmID, const AccessibleContext accessibleContext, const wchar_t *text) {
-
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.setTextContents(vmID, accessibleContext, text);
-        }
-        return FALSE;
-    }
-
-    /**
-     * Returns the Accessible Context with the specified role that is the
-     * ancestor of a given object. The role is one of the role strings
-     * defined in AccessBridgePackages.h
-     * If there is no ancestor object that has the specified role,
-     * returns (AccessibleContext)0.
-     */
-    AccessibleContext getParentWithRole (const long vmID, const AccessibleContext accessibleContext,
-                                         const wchar_t *role) {
-
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getParentWithRole(vmID, accessibleContext, role);
-        }
-        return (AccessibleContext)0;
-    }
-
-    /**
-     * Returns the Accessible Context with the specified role that is the
-     * ancestor of a given object. The role is one of the role strings
-     * defined in AccessBridgePackages.h.  If an object with the specified
-     * role does not exist, returns the top level object for the Java Window.
-     * Returns (AccessibleContext)0 on error.
-     */
-    AccessibleContext getParentWithRoleElseRoot (const long vmID, const AccessibleContext accessibleContext,
-                                                 const wchar_t *role) {
-
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getParentWithRoleElseRoot(vmID, accessibleContext, role);
-        }
-        return (AccessibleContext)0;
-    }
-
-    /**
-     * Returns the Accessible Context for the top level object in
-     * a Java Window.  This is same Accessible Context that is obtained
-     * from GetAccessibleContextFromHWND for that window.  Returns
-     * (AccessibleContext)0 on error.
-     */
-    AccessibleContext getTopLevelObject (const long vmID, const AccessibleContext accessibleContext) {
-
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getTopLevelObject(vmID, accessibleContext);
-        }
-        return (AccessibleContext)0;
-    }
-
-    /**
-     * Returns how deep in the object hierarchy a given object is.
-     * The top most object in the object hierarchy has an object depth of 0.
-     * Returns -1 on error.
-     */
-    int getObjectDepth (const long vmID, const AccessibleContext accessibleContext) {
-
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getObjectDepth(vmID, accessibleContext);
-        }
-        return -1;
-    }
-
-    /**
-     * Returns the Accessible Context of the current ActiveDescendent of an object.
-     * This method assumes the ActiveDescendent is the component that is currently
-     * selected in a container object.
-     * Returns (AccessibleContext)0 on error or if there is no selection.
-     */
-    AccessibleContext getActiveDescendent (const long vmID, const AccessibleContext accessibleContext) {
-
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getActiveDescendent(vmID, accessibleContext);
-        }
-        return (AccessibleContext)0;
-    }
-
-
-    /**
-     * Accessible Context routines
-     */
-    BOOL GetAccessibleContextAt(long vmID, AccessibleContext acParent,
-                                jint x, jint y, AccessibleContext *ac) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetAccessibleContextAt(vmID, acParent, x, y, ac);
-        }
-        return FALSE;
-    }
-
-    BOOL GetAccessibleContextWithFocus(HWND window, long *vmID, AccessibleContext *ac) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetAccessibleContextWithFocus(window, vmID, ac);
-        }
-        return FALSE;
-    }
-
-    BOOL GetAccessibleContextInfo(long vmID, AccessibleContext ac, AccessibleContextInfo *info) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetAccessibleContextInfo(vmID, ac, info);
-        }
-        return FALSE;
-    }
-
-    AccessibleContext GetAccessibleChildFromContext(long vmID, AccessibleContext ac, jint index) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetAccessibleChildFromContext(vmID, ac, index);
-        }
-        return (AccessibleContext) 0;
-    }
-
-    AccessibleContext GetAccessibleParentFromContext(long vmID, AccessibleContext ac) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetAccessibleParentFromContext(vmID, ac);
-        }
-        return (AccessibleContext) 0;
-    }
-
-    /* begin AccessibleTable routines */
-
-    /*
-     * get information about an AccessibleTable
-     */
-    BOOL getAccessibleTableInfo(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleTableInfo(vmID, acParent, tableInfo);
-        }
-        return FALSE;
-    }
-
-    /*
-     * get information about an AccessibleTable cell
-     */
-    BOOL getAccessibleTableCellInfo(long vmID, AccessibleTable accessibleTable,
-                                    jint row, jint column, AccessibleTableCellInfo *tableCellInfo) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleTableCellInfo(vmID, accessibleTable, row, column, tableCellInfo);
-        }
-        return FALSE;
-    }
-
-    /*
-     * get information about an AccessibleTable row header
-     */
-    BOOL getAccessibleTableRowHeader(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleTableRowHeader(vmID, acParent, tableInfo);
-        }
-        return FALSE;
-    }
-
-    /*
-     * get information about an AccessibleTable column header
-     */
-    BOOL getAccessibleTableColumnHeader(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo) {
-
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleTableColumnHeader(vmID, acParent, tableInfo);
-        }
-        return FALSE;
-    }
-
-    /*
-     * return a description of an AccessibleTable row header
-     */
-    AccessibleContext getAccessibleTableRowDescription(long vmID, AccessibleContext acParent, jint row) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleTableRowDescription(vmID, acParent, row);
-        }
-        return (AccessibleContext)0;
-    }
-
-    /*
-     * return a description of an AccessibleTable column header
-     */
-    AccessibleContext getAccessibleTableColumnDescription(long vmID, AccessibleContext acParent, jint column) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleTableColumnDescription(vmID, acParent, column);
-        }
-        return (AccessibleContext)0;
-    }
-
-    /*
-     * return the number of rows selected in an AccessibleTable
-     */
-    jint getAccessibleTableRowSelectionCount(long vmID, AccessibleTable table) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleTableRowSelectionCount(vmID, table);
-        }
-        return -1;
-    }
-
-    /*
-     * return whether a row is selected in an AccessibleTable
-     */
-    BOOL isAccessibleTableRowSelected(long vmID, AccessibleTable table, jint row) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.isAccessibleTableRowSelected(vmID, table, row);
-        }
-        return FALSE;
-    }
-
-    /*
-     * get an array of selected rows in an AccessibleTable
-     */
-    BOOL getAccessibleTableRowSelections(long vmID, AccessibleTable table, jint count, jint *selections) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleTableRowSelections(vmID, table, count, selections);
-        }
-        return FALSE;
-    }
-
-    /*
-     * return the number of columns selected in an AccessibleTable
-     */
-    jint getAccessibleTableColumnSelectionCount(long vmID, AccessibleTable table) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleTableColumnSelectionCount(vmID, table);
-        }
-        return -1;
-    }
-
-    /*
-     * return whether a column is selected in an AccessibleTable
-     */
-    BOOL isAccessibleTableColumnSelected(long vmID, AccessibleTable table, jint column) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.isAccessibleTableColumnSelected(vmID, table, column);
-        }
-        return FALSE;
-    }
-
-    /*
-     * get an array of columns selected in an AccessibleTable
-     */
-    BOOL getAccessibleTableColumnSelections(long vmID, AccessibleTable table, jint count, jint *selections) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleTableColumnSelections(vmID, table, count, selections);
-        }
-        return FALSE;
-    }
-
-    /*
-     * return the row number for a cell at a given index
-     */
-    jint
-    getAccessibleTableRow(long vmID, AccessibleTable table, jint index) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleTableRow(vmID, table, index);
-        }
-        return -1;
-    }
-
-    /*
-     * return the column number for a cell at a given index
-     */
-    jint
-    getAccessibleTableColumn(long vmID, AccessibleTable table, jint index) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleTableColumn(vmID, table, index);
-        }
-        return -1;
-    }
-
-    /*
-     * return the index of a cell at a given row and column
-     */
-    jint
-    getAccessibleTableIndex(long vmID, AccessibleTable table, jint row, jint column) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleTableIndex(vmID, table, row, column);
-        }
-        return -1;
-    }
-
-    /* end AccessibleTable routines */
-
-
-    /**
-     * Accessible Text routines
-     */
-    BOOL GetAccessibleTextInfo(long vmID, AccessibleText at, AccessibleTextInfo *textInfo, jint x, jint y) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetAccessibleTextInfo(vmID, at, textInfo, x, y);
-        }
-        return FALSE;
-    }
-
-    BOOL GetAccessibleTextItems(long vmID, AccessibleText at, AccessibleTextItemsInfo *textItems, jint index) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetAccessibleTextItems(vmID, at, textItems, index);
-        }
-        return FALSE;
-    }
-
-    BOOL GetAccessibleTextSelectionInfo(long vmID, AccessibleText at, AccessibleTextSelectionInfo *textSelection) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetAccessibleTextSelectionInfo(vmID, at, textSelection);
-        }
-        return FALSE;
-    }
-
-    BOOL GetAccessibleTextAttributes(long vmID, AccessibleText at, jint index, AccessibleTextAttributesInfo *attributes) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetAccessibleTextAttributes(vmID, at, index, attributes);
-        }
-        return FALSE;
-    }
-
-    BOOL GetAccessibleTextRect(long vmID, AccessibleText at, AccessibleTextRectInfo *rectInfo, jint index) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetAccessibleTextRect(vmID, at, rectInfo, index);
-        }
-        return FALSE;
-    }
-
-    BOOL GetAccessibleTextLineBounds(long vmID, AccessibleText at, jint index, jint *startIndex, jint *endIndex) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetAccessibleTextLineBounds(vmID, at, index, startIndex, endIndex);
-        }
-        return FALSE;
-    }
-
-    BOOL GetAccessibleTextRange(long vmID, AccessibleText at, jint start, jint end, wchar_t *text, short len) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetAccessibleTextRange(vmID, at, start, end, text, len);
-        }
-        return FALSE;
-    }
-
-    /**
-     * AccessibleRelationSet routines
-     */
-    BOOL getAccessibleRelationSet(long vmID, AccessibleContext accessibleContext,
-                                  AccessibleRelationSetInfo *relationSetInfo) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleRelationSet(vmID, accessibleContext, relationSetInfo);
-        }
-        return FALSE;
-    }
-
-    /**
-     * AccessibleHypertext routines
-     */
-
-    // Gets AccessibleHypertext for an AccessibleContext
-    BOOL getAccessibleHypertext(long vmID, AccessibleContext accessibleContext,
-                                AccessibleHypertextInfo *hypertextInfo) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleHypertext(vmID, accessibleContext, hypertextInfo);
-        }
-        return FALSE;
-    }
-
-    // Activates an AccessibleHyperlink for an AccessibleContext
-    BOOL activateAccessibleHyperlink(long vmID, AccessibleContext accessibleContext,
-                                     AccessibleHyperlink accessibleHyperlink) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.activateAccessibleHyperlink(vmID, accessibleContext, accessibleHyperlink);
-        }
-        return FALSE;
-    }
-
-    /*
-     * Returns the number of hyperlinks in a component
-     * Maps to AccessibleHypertext.getLinkCount.
-     * Returns -1 on error.
-     */
-    jint getAccessibleHyperlinkCount(const long vmID,
-                                     const AccessibleContext accessibleContext) {
-
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleHyperlinkCount(vmID, accessibleContext);
-        }
-        return -1;
-    }
-
-    /*
-     * This method is used to iterate through the hyperlinks in a component.  It
-     * returns hypertext information for a component starting at hyperlink index
-     * nStartIndex.  No more than MAX_HYPERLINKS AccessibleHypertextInfo objects will
-     * be returned for each call to this method.
-     * returns FALSE on error.
-     */
-    BOOL getAccessibleHypertextExt(const long vmID,
-                                   const AccessibleContext accessibleContext,
-                                   const jint nStartIndex,
-                                   /* OUT */ AccessibleHypertextInfo *hypertextInfo) {
-
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleHypertextExt(vmID,
-                                                             accessibleContext,
-                                                             nStartIndex,
-                                                             hypertextInfo);
-        }
-        return FALSE;
-    }
-
-    /*
-     * Returns the index into an array of hyperlinks that is associated with
-     * a character index in document;
-     * Maps to AccessibleHypertext.getLinkIndex.
-     * Returns -1 on error.
-     */
-    jint getAccessibleHypertextLinkIndex(const long vmID,
-                                         const AccessibleHypertext hypertext,
-                                         const jint nIndex) {
-
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleHypertextLinkIndex(vmID,
-                                                                   hypertext,
-                                                                   nIndex);
-        }
-        return -1;
-    }
-
-    /*
-     * Returns the nth hyperlink in a document.
-     * Maps to AccessibleHypertext.getLink.
-     * Returns -1 on error
-     */
-    BOOL getAccessibleHyperlink(const long vmID,
-                                const AccessibleHypertext hypertext,
-                                const jint nIndex,
-                                /* OUT */ AccessibleHyperlinkInfo *hyperlinkInfo) {
-
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleHyperlink(vmID,
-                                                          hypertext,
-                                                          nIndex,
-                                                          hyperlinkInfo);
-        }
-        return FALSE;
-    }
-
-
-    /* Accessible KeyBindings, Icons and Actions */
-    BOOL getAccessibleKeyBindings(long vmID, AccessibleContext accessibleContext,
-                                  AccessibleKeyBindings *keyBindings) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleKeyBindings(vmID, accessibleContext, keyBindings);
-        }
-        return FALSE;
-    }
-
-    BOOL getAccessibleIcons(long vmID, AccessibleContext accessibleContext,
-                            AccessibleIcons *icons) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleIcons(vmID, accessibleContext, icons);
-        }
-        return FALSE;
-    }
-
-    BOOL getAccessibleActions(long vmID, AccessibleContext accessibleContext,
-                              AccessibleActions *actions) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getAccessibleActions(vmID, accessibleContext, actions);
-        }
-        return FALSE;
-    }
-
-    BOOL doAccessibleActions(long vmID, AccessibleContext accessibleContext,
-                             AccessibleActionsToDo *actionsToDo, jint *failure) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.doAccessibleActions(vmID, accessibleContext, actionsToDo, failure);
-        }
-        return FALSE;
-    }
-
-    /**
-     * Accessible Value routines
-     */
-    BOOL GetCurrentAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetCurrentAccessibleValueFromContext(vmID, av, value, len);
-        }
-        return FALSE;
-    }
-
-    BOOL GetMaximumAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetMaximumAccessibleValueFromContext(vmID, av, value, len);
-        }
-        return FALSE;
-    }
-
-    BOOL GetMinimumAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetMinimumAccessibleValueFromContext(vmID, av, value, len);
-        }
-        return FALSE;
-    }
-
-
-    /**
-     * Accessible Selection routines
-     */
-    void addAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.AddAccessibleSelectionFromContext(vmID, as, i);
-        }
-    }
-
-    void clearAccessibleSelectionFromContext(long vmID, AccessibleSelection as) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.ClearAccessibleSelectionFromContext(vmID, as);
-        }
-    }
-
-    JOBJECT64 GetAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetAccessibleSelectionFromContext(vmID, as, i);
-        }
-        return (JOBJECT64) 0;
-    }
-
-    int GetAccessibleSelectionCountFromContext(long vmID, AccessibleSelection as) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.GetAccessibleSelectionCountFromContext(vmID, as);
-        }
-        return -1;
-    }
-
-    BOOL IsAccessibleChildSelectedFromContext(long vmID, AccessibleSelection as, int i) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.IsAccessibleChildSelectedFromContext(vmID, as, i);
-        }
-        return FALSE;
-    }
-
-    void RemoveAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.RemoveAccessibleSelectionFromContext(vmID, as, i);
-        }
-    }
-
-    void SelectAllAccessibleSelectionFromContext(long vmID, AccessibleSelection as) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            theAccessBridge.SelectAllAccessibleSelectionFromContext(vmID, as);
-        }
-    }
-
-    /**
-     * Additional methods for Teton
-     */
-
-    /**
-     * Gets the AccessibleName for a component based upon the JAWS algorithm. Returns
-     * whether successful.
-     *
-     * Bug ID 4916682 - Implement JAWS AccessibleName policy
-     */
-    BOOL getVirtualAccessibleName(const long vmID, const AccessibleContext accessibleContext,
-                                  wchar_t *name, int len) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getVirtualAccessibleName(vmID, accessibleContext, name, len);
-        }
-        return FALSE;
-    }
-
-    /**
-     * Request focus for a component. Returns whether successful;
-     *
-     * Bug ID 4944757 - requestFocus method needed
-     */
-    BOOL requestFocus(const long vmID, const AccessibleContext accessibleContext) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.requestFocus(vmID, accessibleContext);
-        }
-        return FALSE;
-    }
-
-    /**
-     * Selects text between two indices.  Selection includes the text at the start index
-     * and the text at the end index. Returns whether successful;
-     *
-     * Bug ID 4944758 - selectTextRange method needed
-     */
-    BOOL selectTextRange(const long vmID, const AccessibleContext accessibleContext,
-                         const int startIndex, const int endIndex) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.selectTextRange(vmID, accessibleContext, startIndex, endIndex);
-        }
-        return FALSE;
-    }
-
-    /**
-     * Get text attributes between two indices.  The attribute list includes the text at the
-     * start index and the text at the end index. Returns whether successful;
-     *
-     * Bug ID 4944761 - getTextAttributes between two indices method needed
-     */
-    BOOL getTextAttributesInRange(const long vmID, const AccessibleContext accessibleContext,
-                                  const int startIndex, const int endIndex,
-                                  AccessibleTextAttributesInfo *attributes, short *len) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getTextAttributesInRange(vmID, accessibleContext, startIndex,
-                                                            endIndex, attributes, len);
-        }
-        return FALSE;
-    }
-
-    /**
-     * Returns the number of visible children of a component. Returns -1 on error.
-     *
-     * Bug ID 4944762- getVisibleChildren for list-like components needed
-     */
-    int getVisibleChildrenCount(const long vmID, const AccessibleContext accessibleContext) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getVisibleChildrenCount(vmID, accessibleContext);
-        }
-        return FALSE;
-    }
-
-    /**
-     * Gets the visible children of an AccessibleContext. Returns whether successful;
-     *
-     * Bug ID 4944762- getVisibleChildren for list-like components needed
-     */
-    BOOL getVisibleChildren(const long vmID, const AccessibleContext accessibleContext,
-                            const int startIndex, VisibleChildrenInfo *visibleChildrenInfo) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getVisibleChildren(vmID, accessibleContext, startIndex,
-                                                      visibleChildrenInfo);
-        }
-        return FALSE;
-    }
-
-    /**
-     * Set the caret to a text position. Returns whether successful;
-     *
-     * Bug ID 4944770 - setCaretPosition method needed
-     */
-    BOOL setCaretPosition(const long vmID, const AccessibleContext accessibleContext,
-                          const int position) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.setCaretPosition(vmID, accessibleContext, position);
-        }
-        return FALSE;
-    }
-
-    /**
-     * Gets the text caret location
-     */
-    BOOL getCaretLocation(long vmID, AccessibleContext ac, AccessibleTextRectInfo *rectInfo, jint index) {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getCaretLocation(vmID, ac, rectInfo, index);
-        }
-        return FALSE;
-    }
-
-    /**
-     * Gets the number of events waiting to fire
-     */
-    int getEventsWaiting() {
-        if (theAccessBridgeInitializedFlag == TRUE) {
-            return theAccessBridge.getEventsWaiting();
-        }
-        return FALSE;
-    }
-
-#ifdef __cplusplus
-}
-#endif
--- a/jdk/src/jdk.accessibility/windows/native/include/bridge/AccessBridgeCalls.h	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/jdk.accessibility/windows/native/include/bridge/AccessBridgeCalls.h	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -23,6 +23,25 @@
  * questions.
  */
 
+/* Note: In addition to this header file AccessBridgeCalls.c must be compiled and
+ * linked to your application.  AccessBridgeCalls.c implements the Java Access
+ * Bridge API and also hides the complexities associated with interfacing to the
+ * associated Java Access Bridge DLL which is installed when Java is installed.
+ *
+ * AccessBridgeCalls.c is available for download from the OpenJDK repository using
+ * the following link:
+ *
+ * http://hg.openjdk.java.net/jdk9/jdk9/jdk/raw-file/tip/src/jdk.accessibility/windows/native/bridge/AccessBridgeCalls.c
+ *
+ * Also note that the API is used in the jaccessinspector and jaccesswalker tools.
+ * The source for those tools is available in the OpenJDK repository at these links:
+ *
+ * http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/tip/src/jdk.accessibility/windows/native/jaccessinspector/jaccessinspector.cpp
+ * http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/tip/src/jdk.accessibility/windows/native/jaccesswalker/jaccesswalker.cpp
+ *
+ *
+ */
+
 /*
  * Wrapper functions around calls to the AccessBridge DLL
  */
--- a/jdk/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/SunMSCAPI.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/SunMSCAPI.java	Wed Jul 05 22:30:12 2017 +0200
@@ -33,6 +33,8 @@
 import java.security.ProviderException;
 import java.util.HashMap;
 import java.util.Arrays;
+import java.util.Map;
+
 import static sun.security.util.SecurityConstants.PROVIDER_VER;
 
 /**
@@ -133,8 +135,11 @@
                 /*
                  * Secure random
                  */
+                HashMap<String, String> srattrs = new HashMap<>(1);
+                srattrs.put("ThreadSafe", "true");
                 putService(new ProviderService(p, "SecureRandom",
-                           "Windows-PRNG", "sun.security.mscapi.PRNG"));
+                           "Windows-PRNG", "sun.security.mscapi.PRNG",
+                           null, srattrs));
 
                 /*
                  * Key store
--- a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/SunPKCS11.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/SunPKCS11.java	Wed Jul 05 22:30:12 2017 +0200
@@ -987,7 +987,8 @@
 
         P11Service(Token token, String type, String algorithm,
                 String className, String[] al, long mechanism) {
-            super(token.provider, type, algorithm, className, toList(al), null);
+            super(token.provider, type, algorithm, className, toList(al),
+                    type.equals(SR) ? Map.of("ThreadSafe", "true") : null);
             this.token = token;
             this.mechanism = mechanism & 0xFFFFFFFFL;
         }
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java	Wed Jul 05 22:30:12 2017 +0200
@@ -32,6 +32,7 @@
 import java.nio.file.Files;
 import java.nio.file.PathMatcher;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.MissingResourceException;
@@ -190,19 +191,12 @@
             if (options.help) {
                 if (unhandled.isEmpty()) {
                     log.println(TASK_HELPER.getMessage("main.usage", PROGNAME));
-
-                    for (Option<?> o : RECOGNIZED_OPTIONS) {
-                        String name = o.aliases()[0];
-
-                        if (name.startsWith("--")) {
-                            name = name.substring(2);
-                        } else if (name.startsWith("-")) {
-                            name = name.substring(1);
-                        }
-
-                        log.println(TASK_HELPER.getMessage("main.opt." + name));
-                    }
-
+                    Arrays.asList(RECOGNIZED_OPTIONS).stream()
+                        .filter(option -> !option.isHidden())
+                        .sorted()
+                        .forEach(option -> {
+                             log.println(TASK_HELPER.getMessage(option.resourceName()));
+                        });
                     log.println(TASK_HELPER.getMessage("main.opt.footer"));
                 } else {
                     try {
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/resources/jimage.properties	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/resources/jimage.properties	Wed Jul 05 22:30:12 2017 +0200
@@ -60,34 +60,36 @@
 warn.prefix=Warning:
 
 main.opt.dir=\
-\  --dir                             Target directory for extract directive
+\       --dir                        Target directory for extract directive
 
 main.opt.include=\
-\  --include <pattern-list>          Pattern list for filtering entries.
-
-main.opt.footer=\
-\n\
-\For options requiring a <pattern-list>, the value will be a comma\
-\ separated list of elements each using one the following forms:\n\
-\  <glob-pattern>\n\
-\  glob:<glob-pattern>\n\
-\  regex:<regex-pattern>
-
+\       --include <pattern-list>     Pattern list for filtering entries.
 
 main.opt.full-version=\
-\  --full-version                    Print full version information
+\       --full-version               Print full version information
 
 main.opt.help=\
 \  -h,  --help                       Print usage message
 
 main.opt.verbose=\
-\  --verbose                         Listing prints entry size and offset attributes
+\       --verbose                    Listing prints entry size and offset\n\
+\                                    attributes
 
 main.opt.version=\
-\  --version                         Print version information
+\       --version                    Print version information
 
 main.command.files=\
-\  @<filename>                       Read options from file
+\       @<filename>                  Read options from file
+
+main.opt.footer=\
+\n\
+\For options requiring a <pattern-list>, the value will be a comma separated\n\
+\list of elements each using one the following forms:\n\
+\  <glob-pattern>\n\
+\  glob:<glob-pattern>\n\
+\  regex:<regex-pattern>
+
+
 
 err.not.a.task=task must be one of <extract | info | list | verify>: {0}
 err.missing.arg=no value given for {0}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java	Wed Jul 05 22:30:12 2017 +0200
@@ -27,6 +27,7 @@
 import java.lang.reflect.Layer;
 import java.nio.ByteOrder;
 import java.nio.file.Path;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -278,6 +279,13 @@
      */
     public void build(JlinkConfiguration config, PluginsConfiguration pluginsConfig) {
         Objects.requireNonNull(config);
+        if (pluginsConfig == null) {
+            pluginsConfig = new PluginsConfiguration();
+        }
+
+        // add all auto-enabled plugins from boot layer
+        pluginsConfig = addAutoEnabledPlugins(pluginsConfig);
+
         try {
             JlinkTask.createImage(config, pluginsConfig);
         } catch (Exception ex) {
@@ -285,6 +293,19 @@
         }
     }
 
+    private PluginsConfiguration addAutoEnabledPlugins(PluginsConfiguration pluginsConfig) {
+        List<Plugin> plugins = new ArrayList<>(pluginsConfig.getPlugins());
+        List<Plugin> bootPlugins = PluginRepository.getPlugins(Layer.boot());
+        for (Plugin bp : bootPlugins) {
+            if (Utils.isAutoEnabled(bp)) {
+                bp.configure(Collections.emptyMap());
+                plugins.add(bp);
+            }
+        }
+        return new PluginsConfiguration(plugins, pluginsConfig.getImageBuilder(),
+            pluginsConfig.getLastSorterPluginName());
+    }
+
     /**
      * Post process the image with a plugin configuration.
      *
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java	Wed Jul 05 22:30:12 2017 +0200
@@ -134,7 +134,7 @@
         }, true, "--full-version"),
         new Option<JlinkTask>(false, (task, opt, arg) -> {
             task.options.ignoreSigning = true;
-        }, true, "--ignore-signing-information"),};
+        }, "--ignore-signing-information"),};
 
     private static final String PROGNAME = "jlink";
     private final OptionsValues options = new OptionsValues();
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java	Wed Jul 05 22:30:12 2017 +0200
@@ -46,8 +46,8 @@
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 import java.util.Set;
+import java.util.stream.Stream;
 
-import jdk.tools.jlink.internal.plugins.ExcludeFilesPlugin;
 import jdk.tools.jlink.internal.plugins.ExcludeJmodSectionPlugin;
 import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.plugin.Plugin.Category;
@@ -90,8 +90,7 @@
         public boolean showUsage;
     }
 
-    public static class Option<T> {
-
+    public static class Option<T> implements Comparable<T> {
         public interface Processing<T> {
 
             void process(T task, String opt, String arg) throws BadArgs;
@@ -100,17 +99,34 @@
         final boolean hasArg;
         final Processing<T> processing;
         final boolean hidden;
-        final String[] aliases;
+        final String name;
+        final String shortname;
 
-        public Option(boolean hasArg, Processing<T> processing, boolean hidden, String... aliases) {
+        public Option(boolean hasArg, Processing<T> processing, boolean hidden, String name, String shortname) {
+            if (!name.startsWith("--")) {
+                throw new RuntimeException("option name missing --, " + name);
+            }
+            if (!shortname.isEmpty() && !shortname.startsWith("-")) {
+                throw new RuntimeException("short name missing -, " + shortname);
+            }
+
             this.hasArg = hasArg;
             this.processing = processing;
-            this.aliases = aliases;
             this.hidden = hidden;
+            this.name = name;
+            this.shortname = shortname;
         }
 
-        public Option(boolean hasArg, Processing<T> processing, String... aliases) {
-            this(hasArg, processing, false, aliases);
+        public Option(boolean hasArg, Processing<T> processing, String name, String shortname) {
+            this(hasArg, processing, false, name, shortname);
+        }
+
+        public Option(boolean hasArg, Processing<T> processing, boolean hidden, String name) {
+            this(hasArg, processing, hidden, name, "");
+        }
+
+        public Option(boolean hasArg, Processing<T> processing, String name) {
+            this(hasArg, processing, false, name, "");
         }
 
         public boolean isHidden() {
@@ -118,16 +134,10 @@
         }
 
         public boolean matches(String opt) {
-            for (String a : aliases) {
-                if (a.equals(opt)) {
-                    return true;
-                } else if (opt.startsWith("--")
-                        && (hasArg && opt.startsWith(a + "="))) {
-                    return true;
-                }
-            }
-            return false;
-        }
+            return opt.equals(name) ||
+                   opt.equals(shortname) ||
+                   hasArg && opt.startsWith("--") && opt.startsWith(name + "=");
+         }
 
         public boolean ignoreRest() {
             return false;
@@ -137,28 +147,54 @@
             processing.process(task, opt, arg);
         }
 
-        public String[] aliases() {
-            return aliases;
+        public String getName() {
+            return name;
+        }
+
+        public String resourceName() {
+            return resourcePrefix() + name.substring(2);
+        }
+
+        public String getShortname() {
+            return shortname;
+        }
+
+        public String resourcePrefix() {
+            return "main.opt.";
+        }
+
+        @Override
+        public int compareTo(Object object) {
+            if (!(object instanceof Option<?>)) {
+                throw new RuntimeException("comparing non-Option");
+            }
+
+            Option<?> option = (Option<?>)object;
+
+            return name.compareTo(option.name);
+        }
+
+    }
+
+    private static class PluginOption extends Option<PluginsHelper> {
+        public PluginOption(boolean hasArg,
+                Processing<PluginsHelper> processing, boolean hidden, String name, String shortname) {
+            super(hasArg, processing, hidden, name, shortname);
+        }
+
+        public PluginOption(boolean hasArg,
+                Processing<PluginsHelper> processing, boolean hidden, String name) {
+            super(hasArg, processing, hidden, name, "");
+        }
+
+        public String resourcePrefix() {
+            return "plugin.opt.";
         }
     }
 
-    private static class PlugOption extends Option<PluginsOptions> {
-
-        public PlugOption(boolean hasArg,
-                Processing<PluginsOptions> processing, boolean hidden, String... aliases) {
-            super(hasArg, processing, hidden, aliases);
-        }
-
-        public PlugOption(boolean hasArg,
-                Processing<PluginsOptions> processing, String... aliases) {
-            super(hasArg, processing, aliases);
-        }
-    }
-
-    private final class PluginsOptions {
+    private final class PluginsHelper {
 
         private static final String PLUGINS_PATH = "--plugin-module-path";
-        private static final String POST_PROCESS = "--post-process-path";
 
         private Layer pluginsLayer = Layer.boot();
         private final List<Plugin> plugins;
@@ -170,10 +206,10 @@
         // Each such occurrence results in a Map of arguments. So, there could be multiple
         // args maps per plugin instance.
         private final Map<Plugin, List<Map<String, String>>> pluginToMaps = new HashMap<>();
-        private final List<PlugOption> pluginsOptions = new ArrayList<>();
-        private final List<PlugOption> mainOptions = new ArrayList<>();
+        private final List<PluginOption> pluginsOptions = new ArrayList<>();
+        private final List<PluginOption> mainOptions = new ArrayList<>();
 
-        private PluginsOptions(String pp) throws BadArgs {
+        private PluginsHelper(String pp) throws BadArgs {
 
             if (pp != null) {
                 String[] dirs = pp.split(File.pathSeparator);
@@ -193,13 +229,13 @@
                     addOrderedPluginOptions(plugin, optionsSeen);
                 }
             }
-            mainOptions.add(new PlugOption(false,
+            mainOptions.add(new PluginOption(false,
                     (task, opt, arg) -> {
                         // This option is handled prior
                         // to have the options parsed.
                     },
-                    "--plugin-module-path"));
-            mainOptions.add(new PlugOption(true, (task, opt, arg) -> {
+                    false, "--plugin-module-path"));
+            mainOptions.add(new PluginOption(true, (task, opt, arg) -> {
                     for (Plugin plugin : plugins) {
                         if (plugin.getName().equals(arg)) {
                             pluginToMaps.remove(plugin);
@@ -208,24 +244,24 @@
                     }
                     throw newBadArgs("err.no.such.plugin", arg);
                 },
-                "--disable-plugin"));
-            mainOptions.add(new PlugOption(true, (task, opt, arg) -> {
+                false, "--disable-plugin"));
+            mainOptions.add(new PluginOption(true, (task, opt, arg) -> {
                 Path path = Paths.get(arg);
                 if (!Files.exists(path) || !Files.isDirectory(path)) {
                     throw newBadArgs("err.image.must.exist", path);
                 }
                 existingImage = path.toAbsolutePath();
-            }, true, POST_PROCESS));
-            mainOptions.add(new PlugOption(true,
+            }, true, "--post-process-path"));
+            mainOptions.add(new PluginOption(true,
                     (task, opt, arg) -> {
                         lastSorter = arg;
                     },
                     true, "--resources-last-sorter"));
-            mainOptions.add(new PlugOption(false,
+            mainOptions.add(new PluginOption(false,
                     (task, opt, arg) -> {
                         listPlugins = true;
                     },
-                    "--list-plugins"));
+                    false, "--list-plugins"));
         }
 
         private List<Map<String, String>> argListFor(Plugin plugin) {
@@ -261,8 +297,8 @@
             }
             optionsSeen.add(option);
 
-            PlugOption plugOption
-                    = new PlugOption(plugin.hasArguments(),
+            PluginOption plugOption
+                    = new PluginOption(plugin.hasArguments(),
                             (task, opt, arg) -> {
                                 if (!Utils.isFunctional(plugin)) {
                                     throw newBadArgs("err.provider.not.functional",
@@ -312,7 +348,7 @@
                                     }
                                 }
                             },
-                            "--" + option);
+                            false, "--" + option);
             pluginsOptions.add(plugOption);
 
             if (Utils.isFunctional(plugin)) {
@@ -322,44 +358,44 @@
 
                 if (plugin instanceof DefaultCompressPlugin) {
                     plugOption
-                        = new PlugOption(false,
+                        = new PluginOption(false,
                             (task, opt, arg) -> {
                                 Map<String, String> m = addArgumentMap(plugin);
                                 m.put(DefaultCompressPlugin.NAME, DefaultCompressPlugin.LEVEL_2);
-                            }, "-c");
+                            }, false, "--compress", "-c");
                     mainOptions.add(plugOption);
                 } else if (plugin instanceof StripDebugPlugin) {
                     plugOption
-                        = new PlugOption(false,
+                        = new PluginOption(false,
                             (task, opt, arg) -> {
                                 addArgumentMap(plugin);
-                            }, "-G");
+                            }, false, "--strip-debug", "-G");
                     mainOptions.add(plugOption);
                 } else if (plugin instanceof ExcludeJmodSectionPlugin) {
-                    plugOption = new PlugOption(false, (task, opt, arg) -> {
+                    plugOption = new PluginOption(false, (task, opt, arg) -> {
                             Map<String, String> m = addArgumentMap(plugin);
                             m.put(ExcludeJmodSectionPlugin.NAME,
                                   ExcludeJmodSectionPlugin.MAN_PAGES);
-                        }, "--no-man-pages");
+                        }, false, "--no-man-pages");
                     mainOptions.add(plugOption);
 
-                    plugOption = new PlugOption(false, (task, opt, arg) -> {
+                    plugOption = new PluginOption(false, (task, opt, arg) -> {
                         Map<String, String> m = addArgumentMap(plugin);
                         m.put(ExcludeJmodSectionPlugin.NAME,
                               ExcludeJmodSectionPlugin.INCLUDE_HEADER_FILES);
-                    }, "--no-header-files");
+                    }, false, "--no-header-files");
                     mainOptions.add(plugOption);
                 }
             }
         }
 
-        private PlugOption getOption(String name) throws BadArgs {
-            for (PlugOption o : pluginsOptions) {
+        private PluginOption getOption(String name) throws BadArgs {
+            for (PluginOption o : pluginsOptions) {
                 if (o.matches(name)) {
                     return o;
                 }
             }
-            for (PlugOption o : mainOptions) {
+            for (PluginOption o : mainOptions) {
                 if (o.matches(name)) {
                     return o;
                 }
@@ -461,7 +497,7 @@
         private String getPluginsPath(String[] args) throws BadArgs {
             String pp = null;
             for (int i = 0; i < args.length; i++) {
-                if (args[i].equals(PluginsOptions.PLUGINS_PATH)) {
+                if (args[i].equals(PluginsHelper.PLUGINS_PATH)) {
                     if (i == args.length - 1) {
                         throw new BadArgs("err.no.plugins.path").showUsage(true);
                     } else {
@@ -498,13 +534,13 @@
             // Must extract it prior to do any option analysis.
             // Required to interpret custom plugin options.
             // Unit tests can call Task multiple time in same JVM.
-            pluginOptions = new PluginsOptions(getPluginsPath(args));
+            pluginOptions = new PluginsHelper(getPluginsPath(args));
 
             // First extract plugins path if any
             String pp = null;
             List<String> filteredArgs = new ArrayList<>();
             for (int i = 0; i < args.length; i++) {
-                if (args[i].equals(PluginsOptions.PLUGINS_PATH)) {
+                if (args[i].equals(PluginsHelper.PLUGINS_PATH)) {
                     if (i == args.length - 1) {
                         throw new BadArgs("err.no.plugins.path").showUsage(true);
                     } else {
@@ -529,7 +565,7 @@
             for (int i = 0; i < args.length; i++) {
                 if (args[i].charAt(0) == '-') {
                     String name = args[i];
-                    PlugOption pluginOption = null;
+                    PluginOption pluginOption = null;
                     Option<T> option = getOption(name);
                     if (option == null) {
                         pluginOption = pluginOptions.getOption(name);
@@ -585,32 +621,13 @@
         }
 
         public void showHelp(String progName) {
-            showHelp(progName, true);
-        }
-
-        private void showHelp(String progName, boolean showsImageBuilder) {
             log.println(bundleHelper.getMessage("main.usage", progName));
-            for (Option<?> o : options) {
-                String name = o.aliases[0].substring(1); // there must always be at least one name
-                name = name.charAt(0) == '-' ? name.substring(1) : name;
-                if (o.isHidden() || name.equals("h")) {
-                    continue;
-                }
-                log.println(bundleHelper.getMessage("main.opt." + name));
-            }
-
-            for (Option<?> o : pluginOptions.mainOptions) {
-                if (o.aliases[0].equals(PluginsOptions.POST_PROCESS)
-                        && !showsImageBuilder) {
-                    continue;
-                }
-                String name = o.aliases[0].substring(1); // there must always be at least one name
-                name = name.charAt(0) == '-' ? name.substring(1) : name;
-                if (o.isHidden()) {
-                    continue;
-                }
-                log.println(bundleHelper.getMessage("plugin.opt." + name));
-            }
+            Stream.concat(options.stream(), pluginOptions.mainOptions.stream())
+                .filter(option -> !option.isHidden())
+                .sorted()
+                .forEach(option -> {
+                     log.println(bundleHelper.getMessage(option.resourceName()));
+                });
 
             log.println(bundleHelper.getMessage("main.command.files"));
         }
@@ -619,6 +636,7 @@
             log.println("\n" + bundleHelper.getMessage("main.extended.help"));
             List<Plugin> pluginList = PluginRepository.
                     getPlugins(pluginOptions.pluginsLayer);
+
             for (Plugin plugin : Utils.getSortedPlugins(pluginList)) {
                 showPlugin(plugin, log);
             }
@@ -671,7 +689,7 @@
         }
     }
 
-    private PluginsOptions pluginOptions;
+    private PluginsHelper pluginOptions;
     private PrintWriter log;
     private final ResourceBundleHelper bundleHelper;
 
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/packager/AppRuntimeImageBuilder.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/packager/AppRuntimeImageBuilder.java	Wed Jul 05 22:30:12 2017 +0200
@@ -118,8 +118,6 @@
                                         null));
         }
 
-        plugins.add(Jlink.newPlugin("installed-modules", Collections.emptyMap(), null));
-
         // build the image
         Jlink.PluginsConfiguration pluginConfig = new Jlink.PluginsConfiguration(
             plugins, new DefaultImageBuilder(outputDir), null);
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties	Wed Jul 05 22:30:12 2017 +0200
@@ -24,46 +24,51 @@
 #
 
 main.usage.summary=\
-Usage: {0} <options> --module-path <modulepath> --add-modules <mods> --output <path>\n\
-use --help for a list of possible options
+Usage: {0} <options> --module-path <modulepath> --add-modules <mods> --output\n\
+\<path> use --help for a list of possible options
 
 main.usage=\
-Usage: {0} <options> --module-path <modulepath> --add-modules <mods> --output <path>\n\
-\Possible options include:
+Usage: {0} <options> --module-path <modulepath> --add-modules <mods> --output
+\<path> Possible options include:
 
 error.prefix=Error:
 warn.prefix=Warning:
 
 main.opt.help=\
-\  -h, --help                        Print this help message
+\  -h, --help                            Print this help message
 
 main.opt.version=\
-\  --version                         Version information
+\      --version                         Version information
 
 main.opt.module-path=\
-\  -p <modulepath>\n\
-\  --module-path <modulepath>        Module path
+\  -p, --module-path <path>              Module path
 
 main.opt.add-modules=\
-\  --add-modules <mod>[,<mod>...]    Root modules to resolve
+\      --add-modules <mod>[,<mod>...]    Root modules to resolve
 
 main.opt.limit-modules=\
-\  --limit-modules <mod>[,<mod>...]  Limit the universe of observable modules
+\      --limit-modules <mod>[,<mod>...]  Limit the universe of observable\n\
+\                                        modules
 
 main.opt.output=\
-\  --output <path>                   Location of output path
+\      --output <path>                   Location of output path
 
 main.command.files=\
-\  @<filename>                       Read options from file
+\      @<filename>                       Read options from file
 
 main.opt.endian=\
-\  --endian <little|big>             Byte order of generated jimage (default:native)
+\      --endian <little|big>             Byte order of generated jimage\n\
+\                                        (default:native)
 
 main.opt.save-opts=\
-\  --save-opts <filename>            Save jlink options in the given file
+\      --save-opts <filename>            Save jlink options in the given file
 
 main.opt.ignore-signing-information=\
-\  --ignore-signing-information      Ignore signing information in modular JARs
+\      --ignore-signing-information      Suppress a fatal error when signed\n\
+\                                        modular JARs are linked in the image.\n\
+\                                        The signature related files of the\n\
+\                                        signed modular JARs are not copied to\n\
+\                                        the runtime image.
 
 main.msg.bug=\
 An exception has occurred in jlink. \
@@ -75,13 +80,13 @@
 \List of available plugins:
 
 main.extended.help.footer=\
-\For options requiring a <pattern-list>, the value will be a comma\
-\ separated list of elements each using one the following forms:\n\
+\For options requiring a <pattern-list>, the value will be a comma separated\n\
+\list of elements each using one the following forms:\n\
 \  <glob-pattern>\n\
 \  glob:<glob-pattern>\n\
 \  regex:<regex-pattern>\n\
-\  @<filename> where filename is the name of a file containing patterns to be\
-\ used, one pattern per line\n\
+\  @<filename> where filename is the name of a file containing patterns to be\n\
+\              used, one pattern per line\n\
 \n\
 
 
@@ -110,6 +115,6 @@
 err.not.modular.format=selected module {0} ({1}) not in jmod or modular JAR format
 err.signing=signed modular JAR {0} is currently not supported,\
 \ use --ignore-signing-information to suppress error
-warn.signing=signed modular JAR {0} is currently not supported
+warn.signing=WARNING: signed modular JAR {0} is currently not supported
 warn.invalid.arg=invalid classname or pathname not exist: {0}
 warn.split.package=package {0} defined in {1} {2}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties	Wed Jul 05 22:30:12 2017 +0200
@@ -132,32 +132,33 @@
 List of available plugin options:
 
 plugin.opt.list-plugins=\
-\  --list-plugins                    List available plugins
+\      --list-plugins                    List available plugins
 
 plugin.opt.post-process-path=\
-\  --post-process-path <imagefile>   Post process an existing image
+\      --post-process-path <imagefile>   Post process an existing image
 
 plugin.opt.resources-last-sorter=\
-\  --resources-last-sorter <name>    The last plugin allowed to sort resources
+\      --resources-last-sorter <name>    The last plugin allowed to sort\n\
+\                                        resources
 
 plugin.opt.plugin-module-path=\
-\  --plugin-module-path <modulepath> Custom plugin module path
+\      --plugin-module-path <modulepath> Custom plugin module path
 
 plugin.opt.disable-plugin=\
-\  --disable-plugin <pluginname>     Disable the plugin mentioned
+\      --disable-plugin <pluginname>     Disable the plugin mentioned
 
-plugin.opt.c=\
-\  -c, --compress=<0|1|2>            Enable compression of resources\
-\n                                    More details in --list-plugins option
+plugin.opt.compress=\
+\  -c, --compress=<0|1|2>                Enable compression of resources\n\
+\                                        More details in --list-plugins option
 
-plugin.opt.G=\
-\  -G, --strip-debug                 Strip debug information
+plugin.opt.strip-debug=\
+\  -G, --strip-debug                     Strip debug information
 
 plugin.opt.no-man-pages=\
-\  --no-man-pages                    Exclude man pages
+\      --no-man-pages                    Exclude man pages
 
 plugin.opt.no-header-files=\
-\  --no-header-files                 Exclude include header files
+\      --no-header-files                 Exclude include header files
 
 main.plugin.name=\
 \Plugin Name
--- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/ext/CurrencyNames_de_GR.properties	Wed Nov 23 19:14:47 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-# 
-# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-# 
-
-# (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved
-# (C) Copyright IBM Corp. 1996 - 1999 - All Rights Reserved
-#
-# The original version of this source code and documentation
-# is copyrighted and owned by Taligent, Inc., a wholly-owned
-# subsidiary of IBM. These materials are provided under terms
-# of a License Agreement between Taligent and Sun. This technology
-# is protected by multiple US and International patents.
-#
-# This notice and attribution to Taligent may not be removed.
-# Taligent is a registered trademark of Taligent, Inc.
-
-EUR=\u20AC
-GRD=\u03B4\u03C1\u03C7
--- a/jdk/test/Makefile	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/test/Makefile	Wed Jul 05 22:30:12 2017 +0200
@@ -55,7 +55,7 @@
 UNAME     = uname
 UNIQ      = uniq
 WC        = wc
-ZIP       = zip
+ZIPEXE    = zip
 
 # Get OS name from uname (Cygwin inexplicably adds _NT-5.1)
 UNAME_S := $(shell $(UNAME) -s | $(CUT) -f1 -d_)
@@ -162,7 +162,7 @@
 ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)`     \
 	           && $(CD) $(ABS_TEST_OUTPUT_DIR)             \
 	           && $(CHMOD) -R a+r . \
-	           && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
+	           && $(ZIPEXE) -q -r $(ARCHIVE_BUNDLE) . )
 
 # important results files
 SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport/text/summary.txt")
--- a/jdk/test/ProblemList.txt	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/test/ProblemList.txt	Wed Jul 05 22:30:12 2017 +0200
@@ -135,7 +135,7 @@
 java/lang/instrument/BootClassPath/BootClassPathTest.sh         8072130 macosx-all
 
 java/lang/management/MemoryMXBean/Pending.java                  8158837 generic-all
-java/lang/management/MemoryMXBean/PendingAllGC.sh               8158760 generic-all
+java/lang/management/MemoryMXBean/PendingAllGC.sh               8158837 generic-all
 
 ############################################################################
 
@@ -252,10 +252,14 @@
 
 # core_tools
 
-tools/pack200/CommandLineTests.java                             7143279,8059906 generic-all
+tools/pack200/CommandLineTests.java                             8059906 generic-all
 
 tools/launcher/FXLauncherTest.java                              8068049 linux-all,macosx-all
 
+tools/jimage/JImageExtractTest.java                             8169713 generic-all
+tools/jimage/JImageListTest.java                                8169713 generic-all
+tools/jimage/JImageVerifyTest.java                              8169713 generic-all
+
 ############################################################################
 
 # jdk_jdi
@@ -300,6 +304,6 @@
 
 # jdk_other
 
-com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java                   8141370 linux-i586,macosx-all
+com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java                   8169942 linux-i586,macosx-all,windows-x64
 
 ############################################################################
--- a/jdk/test/com/sun/jndi/dns/CheckAccess.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/test/com/sun/jndi/dns/CheckAccess.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -24,11 +24,13 @@
 /*
  * @test
  * @bug 6657619
+ * @modules jdk.naming.dns
  * @summary DnsContext.debug is public static mutable (findbugs)
  * @author Vincent Ryan
  */
 
-import java.lang.reflect.*;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
 
 /*
  * Check that the 'debug' class member is no longer publicly accessible.
--- a/jdk/test/com/sun/jndi/dns/Test6991580.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/test/com/sun/jndi/dns/Test6991580.java	Wed Jul 05 22:30:12 2017 +0200
@@ -30,13 +30,14 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 
-/**
+/*
  * @test
  * @bug 6991580 8080108 8133035
  * @requires os.family != "windows"
  * @summary IPv6 Nameservers in resolv.conf throws NumberFormatException
- * @modules jdk.naming.dns/com.sun.jndi.dns
- * @build IPv6NameserverPlatformParsingTest
+ * @modules java.desktop
+ *          jdk.naming.dns/com.sun.jndi.dns
+ * @compile --add-modules jdk.naming.dns IPv6NameserverPlatformParsingTest.java
  * @run main/manual Test6991580
  */
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/jndi/ldap/TEST.properties	Wed Jul 05 22:30:12 2017 +0200
@@ -0,0 +1,1 @@
+modules = java.naming
--- a/jdk/test/com/sun/jndi/rmi/registry/RegistryContext/UnbindIdempotent.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/test/com/sun/jndi/rmi/registry/RegistryContext/UnbindIdempotent.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -28,6 +28,7 @@
  *     successfully.
  * @modules java.rmi/sun.rmi.registry java.rmi/sun.rmi.server
  *     java.rmi/sun.rmi.transport java.rmi/sun.rmi.transport.tcp
+ *     jdk.naming.rmi
  * @library ../../../../../../java/rmi/testlibrary
  * @build TestLibrary
  * @run main UnbindIdempotent
@@ -49,8 +50,10 @@
 
         try {
             rctx = (Context)ictx.lookup("rmi://localhost:" + Integer.toString(registryPort));
+            System.out.println("Got context: " + rctx.getClass());
         } catch (NamingException e) {
             // Unable to set up for test.
+            System.err.println("WARNING: The test skipped due to NamingException: " + e);
             return;
         }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/nio/sctp/TEST.properties	Wed Jul 05 22:30:12 2017 +0200
@@ -0,0 +1,2 @@
+modules = jdk.sctp
+
--- a/jdk/test/java/awt/FileDialog/FileDialogIconTest/FileDialogIconTest.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/test/java/awt/FileDialog/FileDialogIconTest/FileDialogIconTest.java	Wed Jul 05 22:30:12 2017 +0200
@@ -22,21 +22,28 @@
  */
 
 /* @test
- * @bug 8157163
+ * @bug 8157163 8159132
  * @summary AWT FileDialog does not inherit icon image from parent Frame
  * @requires os.family=="windows"
  * @run main FileDialogIconTest
  */
-import javax.swing.*;
-import java.awt.*;
+
+import java.awt.Color;
+import java.awt.Dialog;
+import java.awt.FileDialog;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.Image;
 import java.awt.image.BufferedImage;
-import java.lang.reflect.InvocationTargetException;
+import javax.swing.SwingUtilities;
 
 public class FileDialogIconTest {
     private static Frame frame;
     private static Dialog dialog;
 
-    public static void main(final String[] args) throws InterruptedException, InvocationTargetException, AWTException {
+    public static void main(final String[] args) throws Exception {
         Robot robot;
         Point p;
         try {
@@ -51,9 +58,9 @@
             dialog.setModal(false);
             dialog.setVisible(true);
             robot.waitForIdle();
-            robot.delay(200);
+            robot.delay(1000);
 
-            p = new Point(10, 10);
+            p = new Point(20, 20);
             SwingUtilities.convertPointToScreen(p, dialog);
             Color color = robot.getPixelColor(p.x, p.y);
             if (!Color.RED.equals(color)) {
--- a/jdk/test/java/awt/Focus/DisposedWindow/DisposeDialogNotActivateOwnerTest/DisposeDialogNotActivateOwnerTest.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/test/java/awt/Focus/DisposedWindow/DisposeDialogNotActivateOwnerTest/DisposeDialogNotActivateOwnerTest.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -22,237 +22,103 @@
  */
 
 /*
-  test
-  @bug       6386592
-  @summary   Tests that disposing a dialog doesn't activate its invisible owner.
-  @author    anton.tarasov@sun.com: area=awt.focus
-  @run       applet DisposeDialogNotActivateOwnerTest.html
+  @test
+  @key headful
+  @bug 6386592 8160766
+  @summary Tests that disposing a dialog doesn't activate its invisible owner.
 */
 
-import java.awt.*;
-import java.awt.event.*;
-import java.applet.Applet;
+import java.awt.AWTException;
+import java.awt.Button;
+import java.awt.Component;
+import java.awt.Dialog;
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.awt.event.InputEvent;
 
-public class DisposeDialogNotActivateOwnerTest extends Applet {
+public class DisposeDialogNotActivateOwnerTest {
     Robot robot;
-
-    Frame frame = new Frame("Owner Frame");
-    Dialog dialog = new Dialog(new Frame(), "Owned Dialog");
-    Button frameButton = new Button("button");
-
-    static boolean passed = false;
+    Frame frame;
+    Frame dialogInvisibleOwner;
+    Dialog dialog;
+    Button frameButton;
+    static volatile boolean buttonReceivedFocus = false;
 
     public static void main(String[] args) {
-        DisposeDialogNotActivateOwnerTest app = new DisposeDialogNotActivateOwnerTest();
-        app.init();
-        app.start();
+        DisposeDialogNotActivateOwnerTest test =
+                new DisposeDialogNotActivateOwnerTest();
+        test.performTest();
+        test.dispose();
     }
 
-    public void init() {
+    public DisposeDialogNotActivateOwnerTest() {
         try {
             robot = new Robot();
         } catch (AWTException e) {
-            throw new RuntimeException("Error: unable to create robot", e);
+            throw new RuntimeException("Error: unable to create robot");
         }
-        // Create instructions for the user here, as well as set up
-        // the environment -- set the layout manager, add buttons,
-        // etc.
-        this.setLayout (new BorderLayout ());
-        Sysout.createDialogWithInstructions(new String[]
-            {"This is automatic test. Simply wait until it is done."
-            });
 
-        frame.setBounds(800, 50, 200, 100);
+        dialogInvisibleOwner = new Frame("Dialog Invisible Owner Frame");
+        dialog = new Dialog(dialogInvisibleOwner, "Owned Dialog");
+
+        frame = new Frame("A Frame");
+        frameButton = new Button("button");
+        frameButton.addFocusListener(new FocusAdapter() {
+            public void focusGained(FocusEvent e) {
+                buttonReceivedFocus = true;
+            }
+        });
+        frame.setBounds(0, 0, 400, 200);
         frame.add(frameButton);
-        dialog.setBounds(800, 300, 200, 100);
+        dialog.setBounds(100, 50, 200, 100);
     }
 
-    public void start() {
-
-        frameButton.addFocusListener(new FocusAdapter() {
-                public void focusGained(FocusEvent e) {
-                    passed = true;
-                }
-            });
-
+    public void performTest() {
         frame.setVisible(true);
         robot.waitForIdle();
-
-        // make sure the frame is focused
-        clickOn(frame);
+        clickOnTitle(frame);
+        robot.waitForIdle();
+        robot.delay(200);
         if (!frame.isFocused()) {
-            throw new RuntimeException("Error: a frame didn't get initial focus.");
+            dispose();
+            throw new RuntimeException("Error: frame didn't get initial focus");
         }
 
         dialog.setVisible(true);
         robot.waitForIdle();
-
-        // make sure the dialog is focused
+        robot.delay(200);
         if (!dialog.isFocused()) {
-            throw new RuntimeException("Error: a dialog didn't get initial focus.");
+            dispose();
+            throw new RuntimeException("Error: dialog didn't get initial focus");
         }
 
         dialog.dispose();
         robot.waitForIdle();
-
-        if (passed) {
-            Sysout.println("Test passed.");
-        } else {
-            throw new RuntimeException("Test failed: a dialog activates invisible owner when disposed!");
+        robot.delay(200);
+        if (!buttonReceivedFocus) {
+            dispose();
+            throw new RuntimeException(
+                "Test failed: Dialog activates invisible owner when disposed!");
         }
     }
 
-    void clickOn(Component c) {
+    public void dispose() {
+        frame.dispose();
+        dialog.dispose();
+        dialogInvisibleOwner.dispose();
+    }
+
+    void clickOnTitle(Component c) {
         Point p = c.getLocationOnScreen();
         Dimension d = c.getSize();
-
-        if (c instanceof Frame) {
-            robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + ((Frame)c).getInsets().top/2);
-        } else {
-            robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + (int)(d.getHeight()/2));
-        }
-
+        robot.mouseMove(p.x + (int)(d.getWidth() / 2),
+                        p.y + ((Frame)c).getInsets().top / 2);
         robot.mousePress(InputEvent.BUTTON1_MASK);
         robot.delay(20);
         robot.mouseRelease(InputEvent.BUTTON1_MASK);
-
-        robot.waitForIdle();
     }
 }
-
-/****************************************************
- Standard Test Machinery
- DO NOT modify anything below -- it's a standard
-  chunk of code whose purpose is to make user
-  interaction uniform, and thereby make it simpler
-  to read and understand someone else's test.
- ****************************************************/
-
-/**
- This is part of the standard test machinery.
- It creates a dialog (with the instructions), and is the interface
-  for sending text messages to the user.
- To print the instructions, send an array of strings to Sysout.createDialog
-  WithInstructions method.  Put one line of instructions per array entry.
- To display a message for the tester to see, simply call Sysout.println
-  with the string to be displayed.
- This mimics System.out.println but works within the test harness as well
-  as standalone.
- */
-
-class Sysout
-{
-    static TestDialog dialog;
-
-    public static void createDialogWithInstructions( String[] instructions )
-    {
-        dialog = new TestDialog( new Frame(), "Instructions" );
-        dialog.printInstructions( instructions );
-        dialog.setVisible(true);
-        println( "Any messages for the tester will display here." );
-    }
-
-    public static void createDialog( )
-    {
-        dialog = new TestDialog( new Frame(), "Instructions" );
-        String[] defInstr = { "Instructions will appear here. ", "" } ;
-        dialog.printInstructions( defInstr );
-        dialog.setVisible(true);
-        println( "Any messages for the tester will display here." );
-    }
-
-
-    public static void printInstructions( String[] instructions )
-    {
-        dialog.printInstructions( instructions );
-    }
-
-
-    public static void println( String messageIn )
-    {
-        dialog.displayMessage( messageIn );
-    }
-
-}// Sysout  class
-
-/**
-  This is part of the standard test machinery.  It provides a place for the
-   test instructions to be displayed, and a place for interactive messages
-   to the user to be displayed.
-  To have the test instructions displayed, see Sysout.
-  To have a message to the user be displayed, see Sysout.
-  Do not call anything in this dialog directly.
-  */
-class TestDialog extends Dialog
-{
-
-    TextArea instructionsText;
-    TextArea messageText;
-    int maxStringLength = 80;
-
-    //DO NOT call this directly, go through Sysout
-    public TestDialog( Frame frame, String name )
-    {
-        super( frame, name );
-        int scrollBoth = TextArea.SCROLLBARS_BOTH;
-        instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
-        add( "North", instructionsText );
-
-        messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
-        add("Center", messageText);
-
-        pack();
-
-        setVisible(true);
-    }// TestDialog()
-
-    //DO NOT call this directly, go through Sysout
-    public void printInstructions( String[] instructions )
-    {
-        //Clear out any current instructions
-        instructionsText.setText( "" );
-
-        //Go down array of instruction strings
-
-        String printStr, remainingStr;
-        for( int i=0; i < instructions.length; i++ )
-        {
-            //chop up each into pieces maxSringLength long
-            remainingStr = instructions[ i ];
-            while( remainingStr.length() > 0 )
-            {
-                //if longer than max then chop off first max chars to print
-                if( remainingStr.length() >= maxStringLength )
-                {
-                    //Try to chop on a word boundary
-                    int posOfSpace = remainingStr.
-                        lastIndexOf( ' ', maxStringLength - 1 );
-
-                    if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
-
-                    printStr = remainingStr.substring( 0, posOfSpace + 1 );
-                    remainingStr = remainingStr.substring( posOfSpace + 1 );
-                }
-                //else just print
-                else
-                {
-                    printStr = remainingStr;
-                    remainingStr = "";
-                }
-
-                instructionsText.append( printStr + "\n" );
-
-            }// while
-
-        }// for
-
-    }//printInstructions()
-
-    //DO NOT call this directly, go through Sysout
-    public void displayMessage( String messageIn )
-    {
-        messageText.append( messageIn + "\n" );
-        System.out.println(messageIn);
-    }
-
-}// TestDialog  class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/InputMethods/SpanishDiacriticsTest/SpanishDiacriticsTest.html	Wed Jul 05 22:30:12 2017 +0200
@@ -0,0 +1,40 @@
+<!--
+Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+This code is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 only, as
+published by the Free Software Foundation.
+
+This code is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+version 2 for more details (a copy is included in the LICENSE file that
+accompanied this code).
+
+You should have received a copy of the GNU General Public License version
+2 along with this work; if not, write to the Free Software Foundation,
+Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+or visit www.oracle.com if you need additional information or have any
+questions.
+-->
+
+<html>
+<head>
+<title> SpanishDiacriticsTest </title>
+</head>
+<body>
+<applet code="SpanishDiacriticsTest.class" width=350 height=200></applet>
+
+Test run requires the following keyboard layout to be installed:
+Windows OS: Spanish (United States) with 'Latin American' keyboard layout
+
+1. A frame with a text field should be displayed at upper left corner
+2. Set focus to the text field and switch to Spanish with 'Latin American' keyboard layout
+3. Type the following: ' ' o - i.e. single quote two times (using [ key on US keyboard) then o character.
+
+If you the text field displays ''o, (i.e. o should be without acute) then the test is passed; otherwise failed.
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/InputMethods/SpanishDiacriticsTest/SpanishDiacriticsTest.java	Wed Jul 05 22:30:12 2017 +0200
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8169355
+ * @summary Check if Spanish diacritical signs could be typed for TextField
+ * @author Dmitry Markov
+ * @run applet/manual=yesno SpanishDiacriticsTest.html
+*/
+
+import javax.swing.*;
+import java.applet.Applet;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.util.concurrent.locks.LockSupport;
+
+public class SpanishDiacriticsTest extends Applet {
+    @Override
+    public void init() {
+        SwingUtilities.invokeLater(() -> {
+            JFrame frame = new JFrame();
+            JTextField textField = new JTextField(20);
+            textField.addKeyListener(new KeyAdapter() {
+                @Override
+                public void keyTyped(KeyEvent e) {
+                    LockSupport.parkNanos(1_000_000_000L);
+                }
+            });
+            frame.add(textField);
+            frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+            frame.pack();
+            frame.setVisible(true);
+        });
+    }
+}
+
--- a/jdk/test/java/awt/KeyboardFocusmanager/DefaultPolicyChange/DefaultPolicyChange_Swing.java	Wed Nov 23 19:14:47 2016 +0000
+++ b/jdk/test/java/awt/KeyboardFocusmanager/DefaultPolicyChange/DefaultPolicyChange_Swing.java	Wed Jul 05 22:30:12 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -23,32 +23,25 @@
 
 /*
   @test
-  @bug 6741526
+  @bug 6741526 8004693
   @summary KeyboardFocusManager.setDefaultFocusTraversalPolicy(FocusTraversalPolicy) affects created components
-  @library ../../regtesthelpers
-  @build Sysout
   @author Andrei Dmitriev : area=awt-focus
   @run main DefaultPolicyChange_Swing
 */
 
 import java.awt.*;
+
 import javax.swing.*;
 import javax.swing.table.DefaultTableModel;
-import test.java.awt.regtesthelpers.Sysout;
 
 public class DefaultPolicyChange_Swing {
-    public static void main(String []s) {
-        EventQueue.invokeLater(new Runnable(){
-            public void run (){
-                DefaultPolicyChange_Swing.runTestSwing();
-            }
-        });
+
+    public static void main(final String[] s) throws Exception {
+        EventQueue.invokeAndWait(DefaultPolicyChange_Swing::runTestSwing);
     }
+
     private static void runTestSwing(){
         KeyboardFocusManager currentKFM = KeyboardFocusManager.getCurrentKeyboardFocusManager();
-        FocusTraversalPolicy defaultFTP = currentKFM.getDefaultFocusTraversalPolicy();
-        ContainerOrderFocusTraversalPolicy newFTP = new ContainerOrderFocusTraversalPolicy();
-
 
         JFrame jf = new JFrame("Test1");
         JWindow jw = new JWindow(jf);
@@ -71,22 +64,35 @@
             throw new RuntimeException("Failure! Swing toplevel must have LayoutFocusTraversalPolicy installed");
         }
 
+        FocusTraversalPolicy[] defaultFTP = {
+                jf.getFocusTraversalPolicy(), jw.getFocusTraversalPolicy(),
+                jd.getFocusTraversalPolicy()
+        };
+
         jf.setVisible(true);
 
         System.out.println("Now will set another policy.");
+        ContainerOrderFocusTraversalPolicy newFTP = new ContainerOrderFocusTraversalPolicy();
         currentKFM.setDefaultFocusTraversalPolicy(newFTP);
 
-        FocusTraversalPolicy resultFTP = jw.getFocusTraversalPolicy();
+        FocusTraversalPolicy[] resultFTP = {
+                jf.getFocusTraversalPolicy(), jw.getFocusTraversalPolicy(),
+                jd.getFocusTraversalPolicy()
+        };
 
         System.out.println("FTP current on jf= " + jf.getFocusTraversalPolicy());
         System.out.println("FTP current on jw= " + jw.getFocusTraversalPolicy());
         System.out.println("FTP current on jd= " + jd.getFocusTraversalPolicy());
 
-        if (!resultFTP.equals(defaultFTP)) {
-            Sysout.println("Failure! FocusTraversalPolicy should not change");
-            Sysout.println("Was: " + defaultFTP);
-            Sysout.println("Become: " + resultFTP);
-            throw new RuntimeException("Failure! FocusTraversalPolicy should not change");
+        jf.dispose();
+
+        for (int i=0; i < 3; i++) {
+            if (!resultFTP[i].equals(defaultFTP[i])) {
+                System.out.println("Failure! FocusTraversalPolicy should not change");
+                System.out.println("Was: " + defaultFTP[i]);
+                System.out.println("Become: " + resultFTP[i]);
+                throw new RuntimeException("Failure! FocusTraversalPolicy should not change");
+            }
         }
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/image/OpaquePNGToGIFTest.java	Wed Jul 05 22:30:12 2017 +0200
@@ -0,0 +1,422 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+ /*
+ * @test
+ * @bug     6334602
+ * @summary Test verifies that when we create GIF image from Opaque PNG images
+ *          it should not be transparent.
+ * @modules java.desktop/com.sun.imageio.plugins.gif
+ * @run     main/manual OpaquePNGToGIFTest
+ */
+
+import java.awt.image.BufferedImage;
+import com.sun.imageio.plugins.gif.GIFImageMetadata;
+import java.awt.Canvas;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Image;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.imageio.IIOImage;
+import javax.imageio.ImageIO;
+import javax.imageio.ImageReader;
+import javax.imageio.ImageTypeSpecifier;
+import javax.imageio.ImageWriteParam;
+import javax.imageio.ImageWriter;
+import javax.imageio.metadata.IIOMetadata;
+import javax.imageio.stream.ImageInputStream;
+import javax.imageio.stream.ImageOutputStream;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+
+public final class OpaquePNGToGIFTest extends Frame {
+
+    Image img = null;
+    private Dimension prefImgSize = new Dimension(100, 100);
+    private Color canvasColor = new Color(0, 255, 0);
+    File outputFile = null;
+    ImageCanvas imageCanvas = new ImageCanvas();
+    FileOutputStream fos;
+    private static GridBagLayout layout;
+    private static JPanel mainControlPanel;
+    private static JPanel resultButtonPanel;
+    private static JPanel canvasPanel;
+    private static JLabel instructionText;
+    private static JButton startTestButton;
+    private static JButton passButton;
+    private static JButton failButton;
+    private static JDialog dialog;
+    private static Frame instructionFrame;
+    private static Frame imageFrame;
+    Toolkit tk;
+    ImageWriter writer = null;
+    boolean testPassed, testGeneratedInterrupt, startButtonClicked;
+    private static Thread mainThread;
+
+    public OpaquePNGToGIFTest() throws Exception {
+        SwingUtilities.invokeAndWait(() -> {
+            try {
+                startTest();
+            } catch (Exception ex) {
+                Logger.getLogger(OpaquePNGToGIFTest.class.getName()).
+                        log(Level.SEVERE, null, ex);
+            }
+        });
+        mainThread = Thread.currentThread();
+        try {
+            Thread.sleep(60000);
+        } catch (InterruptedException e) {
+            if (!testPassed && testGeneratedInterrupt) {
+                throw new RuntimeException("Test failed or didnt run"
+                        + " properly");
+            }
+        }
+        if (!testGeneratedInterrupt) {
+            if (img != null) {
+                img.flush();
+            }
+            instructionFrame.dispose();
+            if (startButtonClicked) {
+                imageFrame.dispose();
+            }
+            fos.close();
+            Files.delete(outputFile.toPath());
+            throw new RuntimeException("user has not executed the test");
+        }
+    }
+
+    public void startTest() throws Exception {
+        instructionFrame = new Frame();
+        dialog = new JDialog(instructionFrame);
+        dialog.setTitle("Instruction Dialog");
+        layout = new GridBagLayout();
+        mainControlPanel = new JPanel(layout);
+        resultButtonPanel = new JPanel(layout);
+        canvasPanel = new JPanel();
+        GridBagConstraints gbc = new GridBagConstraints();
+        String instructions
+                = "<html>    INSTRUCTIONS:<br><br>"
+                + "After clicking on Start Test button you will see Red<br> "
+                + " circle drawn with light blue background, if the circle<br>"
+                + " color changes from Red to Green then press button Fail,<br>"
+                + " if it stays Red then press button Pass.<br><br></html>";
+        instructionText = new JLabel();
+        instructionText.setText(instructions);
+
+        gbc.gridx = 0;
+        gbc.gridy = 0;
+        gbc.fill = GridBagConstraints.HORIZONTAL;
+        mainControlPanel.add(instructionText, gbc);
+        startTestButton = new JButton("Start Test");
+        startTestButton.setActionCommand("Start Test");
+        startTestButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                try {
+                    startButtonClicked = true;
+                    imageFrame = new Frame();
+
+                    Iterator it = ImageIO.getImageWritersByFormatName("GIF");
+                    while (it.hasNext()) {
+                        writer = (ImageWriter) it.next();
+                        break;
+                    }
+                    // read input opaque PNG image.
+                    String fileName = "opaque_input.png";
+                    String sep = System.getProperty("file.separator");
+                    String dir = System.getProperty("test.src", ".");
+                    System.out.println(dir + "     " + sep);
+                    String filePath = dir + sep + fileName;
+                    File inputFile = new File(filePath);
+                    ImageInputStream iis = ImageIO.
+                            createImageInputStream(inputFile);
+                    ImageReader reader = null;
+                    Iterator readerIter = ImageIO.getImageReaders(iis);
+                    while (readerIter.hasNext()) {
+                        reader = (ImageReader) readerIter.next();
+                        break;
+                    }
+
+                    reader.setInput(iis);
+                    IIOMetadata imgData = reader.getImageMetadata(0);
+                    BufferedImage bi = reader.read(0);
+
+                    //create temporary GIF imageas output
+                    File directory = new File(dir + sep);
+                    outputFile = File.createTempFile("output",
+                            ".gif", directory);
+                    createAnimatedImage(bi, imgData,
+                            writer, outputFile);
+                    writer.dispose();
+                    iis.close();
+                    if (outputFile == null) {
+                        throw new RuntimeException("Unable to create output GIF"
+                                + " file");
+                    }
+                    // extract GIF image using Toolkit and show it on a Panel.
+                    tk = Toolkit.getDefaultToolkit();
+                    img = tk.getImage(dir + sep + outputFile.getName());
+                    directory.delete();
+                    imageCanvas.setBackground(canvasColor);
+                    imageCanvas.setImage(img);
+                    imageCanvas.setPreferredSize(prefImgSize);
+                    canvasPanel.doLayout();
+
+                    canvasPanel.add(imageCanvas);
+                    imageFrame.add("Center", canvasPanel);
+                    imageFrame.setSize(200, 200);
+                    imageFrame.setVisible(true);
+                    imageFrame.addWindowListener(new WindowAdapter() {
+                        @Override
+                        public void windowClosing(WindowEvent e) {
+                            try {
+                                img.flush();
+                                instructionFrame.dispose();
+                                imageFrame.dispose();
+                                fail();
+                            } finally {
+                                try {
+                                    fos.close();
+                                    Files.delete(outputFile.toPath());
+                                } catch (IOException ex) {
+                                    Logger.getLogger(OpaquePNGToGIFTest.class.
+                                            getName()).log(Level.SEVERE, null,
+                                                    ex);
+                                }
+                            }
+                        }
+                    });
+                } catch (IOException ex) {
+                    Logger.getLogger(OpaquePNGToGIFTest.class.getName()).
+                            log(Level.SEVERE, null, ex);
+                }
+            }
+        });
+        passButton = new JButton("Pass");
+        passButton.setActionCommand("Pass");
+        passButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                try {
+                    if (img != null) {
+                        img.flush();
+                    }
+                    instructionFrame.dispose();
+                    if (!startButtonClicked) {
+                        fail();
+                    } else {
+                        imageFrame.dispose();
+                        pass();
+                    }