changeset 30530:aba5d5e892b2

Merge
author duke
date Wed, 05 Jul 2017 20:33:50 +0200
parents f0f03398adb4 57e874482f98
children 4915246064b2
files jdk/src/java.base/share/classes/sun/security/provider/certpath/CertStoreHelper.java jdk/src/java.base/share/classes/sun/security/provider/certpath/ssl/SSLServerCertStoreHelper.java jdk/src/java.desktop/unix/classes/sun/awt/motif/MFontConfiguration.java jdk/src/java.desktop/unix/classes/sun/awt/motif/X11CNS11643.java jdk/src/java.desktop/unix/classes/sun/awt/motif/X11CNS11643P1.java jdk/src/java.desktop/unix/classes/sun/awt/motif/X11CNS11643P2.java jdk/src/java.desktop/unix/classes/sun/awt/motif/X11CNS11643P3.java jdk/src/java.desktop/unix/classes/sun/awt/motif/X11Dingbats.java jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GB18030_0.java jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GB18030_1.java jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GB2312.java jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GBK.java jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0201.java jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0208.java jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0212.java jdk/src/java.desktop/unix/classes/sun/awt/motif/X11Johab.java jdk/src/java.desktop/unix/classes/sun/awt/motif/X11KSC5601.java jdk/src/java.desktop/unix/classes/sun/awt/motif/X11SunUnicode_0.java jdk/src/java.naming/share/classes/sun/security/provider/certpath/ldap/LDAPCertStoreHelper.java jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/DoubleByteEncoder.java jdk/src/jdk.charsets/unix/classes/sun/nio/cs/ext/COMPOUND_TEXT.java jdk/src/jdk.charsets/unix/classes/sun/nio/cs/ext/COMPOUND_TEXT_Decoder.java jdk/src/jdk.charsets/unix/classes/sun/nio/cs/ext/COMPOUND_TEXT_Encoder.java jdk/src/jdk.charsets/unix/classes/sun/nio/cs/ext/CompoundTextSupport.java jdk/test/java/awt/Component/isLightweightCrash/StubPeerCrash.java jdk/test/sun/nio/cs/OLD/X11GB2312_OLD.java jdk/test/sun/nio/cs/OLD/X11GBK_OLD.java jdk/test/sun/nio/cs/OLD/X11KSC5601_OLD.java jdk/test/sun/nio/cs/TestCompoundTest.java jdk/test/sun/nio/cs/TestX11CNS.java jdk/test/sun/nio/cs/TestX11JIS0201.java jdk/test/sun/nio/cs/X11CNS11643.java jdk/test/sun/nio/cs/X11CNS11643P1.java jdk/test/sun/nio/cs/X11CNS11643P2.java jdk/test/sun/nio/cs/X11CNS11643P3.java
diffstat 518 files changed, 28058 insertions(+), 24021 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags-top-repo	Thu May 14 20:17:02 2015 -0700
+++ b/.hgtags-top-repo	Wed Jul 05 20:33:50 2017 +0200
@@ -306,3 +306,4 @@
 ea38728b4f4bdd8fd0d7a89b18069f521cf05013 jdk9-b61
 105d045a69174d870b69bfe471b3f2d05a9f8ecc jdk9-b62
 0b32ed628fa60e4ab99fb0b5866d648e16231f17 jdk9-b63
+82cf9aab9a83e41c8194ba01af9666afdb856cbe jdk9-b64
--- a/common/autoconf/basics.m4	Thu May 14 20:17:02 2015 -0700
+++ b/common/autoconf/basics.m4	Wed Jul 05 20:33:50 2017 +0200
@@ -705,9 +705,9 @@
       # is performed.
       filtered_files=`$ECHO "$files_present" \
           | $SED -e 's/config.log//g' \
-	      -e 's/confdefs.h//g' \
-	      -e 's/fixpath.exe//g' \
-	      -e 's/ //g' \
+              -e 's/configure.log//g' \
+              -e 's/confdefs.h//g' \
+              -e 's/ //g' \
           | $TR -d '\n'`
       if test "x$filtered_files" != x; then
         AC_MSG_NOTICE([Current directory is $CURDIR.])
@@ -1054,3 +1054,29 @@
 
   AC_SUBST(BASH_ARGS)
 ])
+
+# Code to run after AC_OUTPUT
+AC_DEFUN_ONCE([BASIC_POST_CONFIG_OUTPUT],
+[
+  # Try to move config.log (generated by autoconf) to the configure-support directory.
+  if test -e ./config.log; then
+    $MV -f ./config.log "$CONFIGURESUPPORT_OUTPUTDIR/config.log" 2> /dev/null
+  fi
+
+  # Rotate our log file (configure.log)
+  if test -e "$OUTPUT_ROOT/configure.log.old"; then
+    $RM -f "$OUTPUT_ROOT/configure.log.old"
+  fi
+  if test -e "$OUTPUT_ROOT/configure.log"; then
+    $MV -f "$OUTPUT_ROOT/configure.log" "$OUTPUT_ROOT/configure.log.old" 2> /dev/null
+  fi
+
+  # Move configure.log from current directory to the build output root
+  if test -e ./configure.log; then
+    echo found it
+    $MV -f ./configure.log "$OUTPUT_ROOT/configure.log" 2> /dev/null
+  fi
+
+  # Make the compare script executable
+  $CHMOD +x $OUTPUT_ROOT/compare.sh
+])
--- a/common/autoconf/configure	Thu May 14 20:17:02 2015 -0700
+++ b/common/autoconf/configure	Wed Jul 05 20:33:50 2017 +0200
@@ -255,13 +255,10 @@
   set -x
 fi
 
-if test "x$conf_debug_configure" = xtrue; then
-  # Turn on logging, but don't turn on twice when called recursive
-  conf_debug_logfile=./debug-configure.log
-  (exec 3>&1 ; (. $conf_script_to_run "${conf_processed_arguments[@]}" 2>&1 1>&3 ) | tee -a $conf_debug_logfile 1>&2 ; exec 3>&-) | tee -a $conf_debug_logfile
-else
-  ( . $conf_script_to_run "${conf_processed_arguments[@]}" )
-fi
+# Now transfer control to the script generated by autoconf. This is where the
+# main work is done.
+conf_logfile=./configure.log
+(exec 3>&1 ; (. $conf_script_to_run "${conf_processed_arguments[@]}" 2>&1 1>&3 ) | tee -a $conf_logfile 1>&2 ; exec 3>&-) | tee -a $conf_logfile
 
 conf_result_code=$?
 ###
--- a/common/autoconf/configure.ac	Thu May 14 20:17:02 2015 -0700
+++ b/common/autoconf/configure.ac	Wed Jul 05 20:33:50 2017 +0200
@@ -265,15 +265,10 @@
 
 # Create the actual output files. Now the main work of configure is done.
 AC_OUTPUT
+
+# After AC_OUTPUT, we need to do final work
 CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK
-
-# Try to move the config.log file to the output directory.
-if test -e ./config.log; then
-  $MV -f ./config.log "$CONFIGURESUPPORT_OUTPUTDIR/config.log" 2> /dev/null
-fi
-
-# Make the compare script executable
-$CHMOD +x $OUTPUT_ROOT/compare.sh
+BASIC_POST_CONFIG_OUTPUT
 
 # Finally output some useful information to the user
 HELP_PRINT_SUMMARY_AND_WARNINGS
--- a/common/autoconf/flags.m4	Thu May 14 20:17:02 2015 -0700
+++ b/common/autoconf/flags.m4	Wed Jul 05 20:33:50 2017 +0200
@@ -231,7 +231,6 @@
 
   AC_SUBST(C_FLAG_REORDER)
   AC_SUBST(CXX_FLAG_REORDER)
-  AC_SUBST(SHARED_LIBRARY_FLAGS)
   AC_SUBST(SET_EXECUTABLE_ORIGIN)
   AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
   AC_SUBST(SET_SHARED_LIBRARY_NAME)
@@ -524,6 +523,10 @@
   #    CXXFLAGS_JDK  - C++ Compiler flags
   #    COMMON_CCXXFLAGS_JDK - common to C and C++
   if test "x$TOOLCHAIN_TYPE" = xgcc; then
+    if test "x$OPENJDK_TARGET_CPU" = xx86; then
+      # Force compatibility with i586 on 32 bit intel platforms.
+      COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586"
+    fi
     COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
         -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
     case $OPENJDK_TARGET_CPU_ARCH in
@@ -900,6 +903,24 @@
       [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false])
   AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG)
 
+  AC_ARG_ENABLE([warnings-as-errors], [AS_HELP_STRING([--disable-warnings-as-errors],
+      [do not consider native warnings to be an error @<:@enabled@:>@])])
+
+  AC_MSG_CHECKING([if native warnings are errors])
+  if test "x$enable_warnings_as_errors" = "xyes"; then
+    AC_MSG_RESULT([yes (explicitely set)])
+    WARNINGS_AS_ERRORS=true
+  elif test "x$enable_warnings_as_errors" = "xno"; then
+    AC_MSG_RESULT([no])
+    WARNINGS_AS_ERRORS=false
+  elif test "x$enable_warnings_as_errors" = "x"; then
+    AC_MSG_RESULT([yes (default)])
+    WARNINGS_AS_ERRORS=true
+  else
+    AC_MSG_ERROR([--enable-warnings-as-errors accepts no argument])
+  fi
+  AC_SUBST(WARNINGS_AS_ERRORS)
+
   case "${TOOLCHAIN_TYPE}" in
     microsoft)
       DISABLE_WARNING_PREFIX="-wd"
--- a/common/autoconf/generated-configure.sh	Thu May 14 20:17:02 2015 -0700
+++ b/common/autoconf/generated-configure.sh	Wed Jul 05 20:33:50 2017 +0200
@@ -684,6 +684,7 @@
 ENABLE_DEBUG_SYMBOLS
 CFLAGS_WARNINGS_ARE_ERRORS
 DISABLE_WARNING_PREFIX
+WARNINGS_AS_ERRORS
 COMPILER_SUPPORTS_TARGET_BITS_FLAG
 ZERO_ARCHFLAG
 LDFLAGS_TESTEXE_SUFFIX
@@ -727,7 +728,6 @@
 SET_SHARED_LIBRARY_NAME
 SET_SHARED_LIBRARY_ORIGIN
 SET_EXECUTABLE_ORIGIN
-SHARED_LIBRARY_FLAGS
 CXX_FLAG_REORDER
 C_FLAG_REORDER
 SYSROOT_LDFLAGS
@@ -1086,6 +1086,7 @@
 with_extra_cflags
 with_extra_cxxflags
 with_extra_ldflags
+enable_warnings_as_errors
 enable_debug_symbols
 enable_zip_debug_info
 enable_native_coverage
@@ -1852,6 +1853,9 @@
   --enable-rmiconnector-iiop
                           enable the JMX RMIConnector iiop transport
                           [disabled]
+  --disable-warnings-as-errors
+                          do not consider native warnings to be an error
+                          [enabled]
   --disable-debug-symbols disable generation of debug symbols [enabled]
   --disable-zip-debug-info
                           disable zipping of debug-info files [enabled]
@@ -3496,6 +3500,9 @@
 # Check for support for specific options in bash
 
 
+# Code to run after AC_OUTPUT
+
+
 #
 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -4359,7 +4366,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1430918902
+DATE_WHEN_GENERATED=1431429776
 
 ###############################################################################
 #
@@ -15335,9 +15342,9 @@
       # is performed.
       filtered_files=`$ECHO "$files_present" \
           | $SED -e 's/config.log//g' \
-	      -e 's/confdefs.h//g' \
-	      -e 's/fixpath.exe//g' \
-	      -e 's/ //g' \
+              -e 's/configure.log//g' \
+              -e 's/confdefs.h//g' \
+              -e 's/ //g' \
           | $TR -d '\n'`
       if test "x$filtered_files" != x; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: Current directory is $CURDIR." >&5
@@ -41761,7 +41768,6 @@
 
 
 
-
   if test "x$OPENJDK_TARGET_OS" = xsolaris; then
     CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__"
     CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__"
@@ -42029,6 +42035,10 @@
   #    CXXFLAGS_JDK  - C++ Compiler flags
   #    COMMON_CCXXFLAGS_JDK - common to C and C++
   if test "x$TOOLCHAIN_TYPE" = xgcc; then
+    if test "x$OPENJDK_TARGET_CPU" = xx86; then
+      # Force compatibility with i586 on 32 bit intel platforms.
+      COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586"
+    fi
     COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
         -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
     case $OPENJDK_TARGET_CPU_ARCH in
@@ -42471,6 +42481,31 @@
 
 
 
+  # Check whether --enable-warnings-as-errors was given.
+if test "${enable_warnings_as_errors+set}" = set; then :
+  enableval=$enable_warnings_as_errors;
+fi
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if native warnings are errors" >&5
+$as_echo_n "checking if native warnings are errors... " >&6; }
+  if test "x$enable_warnings_as_errors" = "xyes"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (explicitely set)" >&5
+$as_echo "yes (explicitely set)" >&6; }
+    WARNINGS_AS_ERRORS=true
+  elif test "x$enable_warnings_as_errors" = "xno"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    WARNINGS_AS_ERRORS=false
+  elif test "x$enable_warnings_as_errors" = "x"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5
+$as_echo "yes (default)" >&6; }
+    WARNINGS_AS_ERRORS=true
+  else
+    as_fn_error $? "--enable-warnings-as-errors accepts no argument" "$LINENO" 5
+  fi
+
+
   case "${TOOLCHAIN_TYPE}" in
     microsoft)
       DISABLE_WARNING_PREFIX="-wd"
@@ -54179,14 +54214,31 @@
 fi
 
 
-
-# Try to move the config.log file to the output directory.
-if test -e ./config.log; then
-  $MV -f ./config.log "$CONFIGURESUPPORT_OUTPUTDIR/config.log" 2> /dev/null
-fi
-
-# Make the compare script executable
-$CHMOD +x $OUTPUT_ROOT/compare.sh
+# After AC_OUTPUT, we need to do final work
+
+
+  # Try to move config.log (generated by autoconf) to the configure-support directory.
+  if test -e ./config.log; then
+    $MV -f ./config.log "$CONFIGURESUPPORT_OUTPUTDIR/config.log" 2> /dev/null
+  fi
+
+  # Rotate our log file (configure.log)
+  if test -e "$OUTPUT_ROOT/configure.log.old"; then
+    $RM -f "$OUTPUT_ROOT/configure.log.old"
+  fi
+  if test -e "$OUTPUT_ROOT/configure.log"; then
+    $MV -f "$OUTPUT_ROOT/configure.log" "$OUTPUT_ROOT/configure.log.old" 2> /dev/null
+  fi
+
+  # Move configure.log from current directory to the build output root
+  if test -e ./configure.log; then
+    echo found it
+    $MV -f ./configure.log "$OUTPUT_ROOT/configure.log" 2> /dev/null
+  fi
+
+  # Make the compare script executable
+  $CHMOD +x $OUTPUT_ROOT/compare.sh
+
 
 # Finally output some useful information to the user
 
@@ -54280,14 +54332,20 @@
 
 
 
-if test -e "$OUTPUT_ROOT/config.log"; then
-  $GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" > /dev/null 2>&1
-  if test $? -eq 0; then
-    printf "The following warnings were produced. Repeated here for convenience:\n"
-    # We must quote sed expression (using []) to stop m4 from eating the [].
-    $GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" | $SED -e  's/^configure:[0-9]*: //'
-    printf "\n"
-  fi
-fi
-
-
+  # Locate config.log.
+  if test -e "$CONFIGURESUPPORT_OUTPUTDIR/config.log"; then
+    CONFIG_LOG_PATH="$CONFIGURESUPPORT_OUTPUTDIR"
+  elif test -e "./config.log"; then
+    CONFIG_LOG_PATH="."
+  fi
+
+  if test -e "$CONFIG_LOG_PATH/config.log"; then
+    $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" > /dev/null 2>&1
+    if test $? -eq 0; then
+      printf "The following warnings were produced. Repeated here for convenience:\n"
+      # We must quote sed expression (using []) to stop m4 from eating the [].
+      $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" | $SED -e  's/^configure:[0-9]*: //'
+      printf "\n"
+    fi
+  fi
+
--- a/common/autoconf/help.m4	Thu May 14 20:17:02 2015 -0700
+++ b/common/autoconf/help.m4	Wed Jul 05 20:33:50 2017 +0200
@@ -212,7 +212,7 @@
   if test "x$TOOLCHAIN_VERSION" != "x"; then
     print_version=" $TOOLCHAIN_VERSION"
   fi
-  printf "* Toolchain:      $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION$print_version)\n" 
+  printf "* Toolchain:      $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION$print_version)\n"
   printf "* C Compiler:     Version $CC_VERSION_NUMBER (at $CC)\n"
   printf "* C++ Compiler:   Version $CXX_VERSION_NUMBER (at $CXX)\n"
 
@@ -263,14 +263,20 @@
 
 AC_DEFUN_ONCE([HELP_REPEAT_WARNINGS],
 [
-if test -e "$OUTPUT_ROOT/config.log"; then
-  $GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" > /dev/null 2>&1
-  if test $? -eq 0; then
-    printf "The following warnings were produced. Repeated here for convenience:\n"
-    # We must quote sed expression (using []) to stop m4 from eating the [].
-    $GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ]
-    printf "\n"
+  # Locate config.log.
+  if test -e "$CONFIGURESUPPORT_OUTPUTDIR/config.log"; then
+    CONFIG_LOG_PATH="$CONFIGURESUPPORT_OUTPUTDIR"
+  elif test -e "./config.log"; then
+    CONFIG_LOG_PATH="."
   fi
-fi
 
+  if test -e "$CONFIG_LOG_PATH/config.log"; then
+    $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" > /dev/null 2>&1
+    if test $? -eq 0; then
+      printf "The following warnings were produced. Repeated here for convenience:\n"
+      # We must quote sed expression (using []) to stop m4 from eating the [].
+      $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ]
+      printf "\n"
+    fi
+  fi
 ])
--- a/common/autoconf/spec.gmk.in	Thu May 14 20:17:02 2015 -0700
+++ b/common/autoconf/spec.gmk.in	Wed Jul 05 20:33:50 2017 +0200
@@ -321,6 +321,9 @@
 DISABLE_WARNING_PREFIX := @DISABLE_WARNING_PREFIX@
 CFLAGS_WARNINGS_ARE_ERRORS:=@CFLAGS_WARNINGS_ARE_ERRORS@
 
+# A global flag (true or false) determining if native warnings are considered errors.
+WARNINGS_AS_ERRORS := @WARNINGS_AS_ERRORS@
+
 CFLAGS_CCACHE:=@CFLAGS_CCACHE@
 
 # Tools that potentially need to be cross compilation aware.
@@ -394,9 +397,6 @@
 
 LIPO:=@LIPO@
 
-# Command to create a shared library
-SHARED_LIBRARY_FLAGS:=@SHARED_LIBRARY_FLAGS@
-
 # Options to linker to specify a mapfile.
 # (Note absence of := assignment, because we do not want to evaluate the macro body here)
 SET_SHARED_LIBRARY_MAPFILE=@SET_SHARED_LIBRARY_MAPFILE@
--- a/corba/.hgtags	Thu May 14 20:17:02 2015 -0700
+++ b/corba/.hgtags	Wed Jul 05 20:33:50 2017 +0200
@@ -306,3 +306,4 @@
 d690f489ca0bb95a6157d996da2fa72bcbcf02ea jdk9-b61
 d27f7e0a7aca129969de23e9934408a31b4abf4c jdk9-b62
 0acac6937de7a0868f8c6f88b7d036d780abeee6 jdk9-b63
+0a5e5a7c3539e8bde73d9fe55750e49a49cb8dac jdk9-b64
--- a/hotspot/.hgtags	Thu May 14 20:17:02 2015 -0700
+++ b/hotspot/.hgtags	Wed Jul 05 20:33:50 2017 +0200
@@ -466,3 +466,4 @@
 715d2da5801c410746e92f08066d53bde1496286 jdk9-b61
 1eab877142cce6ca06e556e2ad0af688f993f00b jdk9-b62
 2ac9b6b36689b50d1562627067c92d51781b5684 jdk9-b63
+bf92b8db249cdfa5651ef954b6c0743a7e0ea4cd jdk9-b64
--- a/hotspot/src/cpu/aarch64/vm/aarch64.ad	Thu May 14 20:17:02 2015 -0700
+++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad	Wed Jul 05 20:33:50 2017 +0200
@@ -810,9 +810,6 @@
   bool unnecessary_volatile(const Node *barrier);
   bool needs_releasing_store(const Node *store);
 
-  // Use barrier instructions rather than load acquire / store
-  // release.
-  const bool UseBarriersForVolatile = false;
   // Use barrier instructions for unsafe volatile gets rather than
   // trying to identify an exact signature for them
   const bool UseBarriersForUnsafeVolatileGet = false;
--- a/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp	Thu May 14 20:17:02 2015 -0700
+++ b/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp	Wed Jul 05 20:33:50 2017 +0200
@@ -98,8 +98,8 @@
   product(bool, NearCpool, true,                                        \
          "constant pool is close to instructions")                      \
                                                                         \
-  notproduct(bool, UseAcqRelForVolatileFields, false,                   \
-             "Use acquire and release insns for volatile fields")       \
+  product(bool, UseBarriersForVolatile, false,                          \
+          "Use memory barriers to implement volatile accesses")         \
                                                                         \
   product(bool, UseCRC32, false,                                        \
           "Use CRC32 instructions for CRC32 computation")               \
@@ -117,8 +117,8 @@
   product(bool, NearCpool, true,                                        \
          "constant pool is close to instructions")                      \
                                                                         \
-  notproduct(bool, UseAcqRelForVolatileFields, false,                   \
-             "Use acquire and release insns for volatile fields")       \
+  product(bool, UseBarriersForVolatile, false,                          \
+          "Use memory barriers to implement volatile accesses")         \
   product(bool, UseNeon, false,                                         \
           "Use Neon for CRC32 computation")                             \
   product(bool, UseCRC32, false,                                        \
--- a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp	Thu May 14 20:17:02 2015 -0700
+++ b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp	Wed Jul 05 20:33:50 2017 +0200
@@ -1314,7 +1314,7 @@
     // case_array_offset_in_bytes()
     movw(reg2, in_bytes(MultiBranchData::per_case_size()));
     movw(rscratch1, in_bytes(MultiBranchData::case_array_offset()));
-    maddw(index, index, reg2, rscratch1);
+    Assembler::maddw(index, index, reg2, rscratch1);
 
     // Update the case count
     increment_mdp_data_at(mdp,
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp	Thu May 14 20:17:02 2015 -0700
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp	Wed Jul 05 20:33:50 2017 +0200
@@ -1625,7 +1625,7 @@
     sdivw(result, ra, rb);
   } else {
     sdivw(scratch, ra, rb);
-    msubw(result, scratch, rb, ra);
+    Assembler::msubw(result, scratch, rb, ra);
   }
 
   return idivl_offset;
@@ -1655,7 +1655,7 @@
     sdiv(result, ra, rb);
   } else {
     sdiv(scratch, ra, rb);
-    msub(result, scratch, rb, ra);
+    Assembler::msub(result, scratch, rb, ra);
   }
 
   return idivq_offset;
@@ -3787,14 +3787,6 @@
   }
 }
 
-  bool MacroAssembler::use_acq_rel_for_volatile_fields() {
-#ifdef PRODUCT
-    return false;
-#else
-    return UseAcqRelForVolatileFields;
-#endif
-  }
-
 void MacroAssembler::build_frame(int framesize) {
   if (framesize == 0) {
     // Is this even possible?
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp	Thu May 14 20:17:02 2015 -0700
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp	Wed Jul 05 20:33:50 2017 +0200
@@ -405,6 +405,18 @@
     umaddl(Rd, Rn, Rm, zr);
   }
 
+#define WRAP(INSN)                                                            \
+  void INSN(Register Rd, Register Rn, Register Rm, Register Ra) {             \
+    if ((VM_Version::cpu_cpuFeatures() & VM_Version::CPU_A53MAC) && Ra != zr) \
+      nop();                                                                  \
+    Assembler::INSN(Rd, Rn, Rm, Ra);                                          \
+  }
+
+  WRAP(madd) WRAP(msub) WRAP(maddw) WRAP(msubw)
+  WRAP(smaddl) WRAP(smsubl) WRAP(umaddl) WRAP(umsubl)
+#undef WRAP
+
+
   // macro assembly operations needed for aarch64
 
   // first two private routines for loading 32 bit or 64 bit constants
@@ -1094,9 +1106,6 @@
   address read_polling_page(Register r, address page, relocInfo::relocType rtype);
   address read_polling_page(Register r, relocInfo::relocType rtype);
 
-  // Used by aarch64.ad to control code generation
-  static bool use_acq_rel_for_volatile_fields();
-
   // CRC32 code for java.util.zip.CRC32::updateBytes() instrinsic.
   void update_byte_crc32(Register crc, Register val, Register table);
   void update_word_crc32(Register crc, Register v, Register tmp,
@@ -1150,10 +1159,6 @@
                             int offset, int size);
 };
 
-// Used by aarch64.ad to control code generation
-#define treat_as_volatile(MEM_NODE)                                     \
-  (MacroAssembler::use_acq_rel_for_volatile_fields() ? (MEM_NODE)->is_volatile() : false)
-
 #ifdef ASSERT
 inline bool AbstractAssembler::pd_check_instruction_mark() { return false; }
 #endif
--- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp	Thu May 14 20:17:02 2015 -0700
+++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp	Wed Jul 05 20:33:50 2017 +0200
@@ -59,6 +59,9 @@
 
 int VM_Version::_cpu;
 int VM_Version::_model;
+int VM_Version::_model2;
+int VM_Version::_variant;
+int VM_Version::_revision;
 int VM_Version::_stepping;
 int VM_Version::_cpuFeatures;
 const char*           VM_Version::_features_str = "";
@@ -122,13 +125,47 @@
 
   char buf[512];
 
-  strcpy(buf, "simd");
+  _cpuFeatures = auxv;
+
+  int cpu_lines = 0;
+  if (FILE *f = fopen("/proc/cpuinfo", "r")) {
+    char buf[128], *p;
+    while (fgets(buf, sizeof (buf), f) != NULL) {
+      if (p = strchr(buf, ':')) {
+        long v = strtol(p+1, NULL, 0);
+        if (strncmp(buf, "CPU implementer", sizeof "CPU implementer" - 1) == 0) {
+          _cpu = v;
+          cpu_lines++;
+        } else if (strncmp(buf, "CPU variant", sizeof "CPU variant" - 1) == 0) {
+          _variant = v;
+        } else if (strncmp(buf, "CPU part", sizeof "CPU part" - 1) == 0) {
+          if (_model != v)  _model2 = _model;
+          _model = v;
+        } else if (strncmp(buf, "CPU revision", sizeof "CPU revision" - 1) == 0) {
+          _revision = v;
+        }
+      }
+    }
+    fclose(f);
+  }
+
+  // Enable vendor specific features
+  if (_cpu == CPU_CAVIUM && _variant == 0) _cpuFeatures |= CPU_DMB_ATOMICS;
+  if (_cpu == CPU_ARM && (_model == 0xd03 || _model2 == 0xd03)) _cpuFeatures |= CPU_A53MAC;
+  // If an olde style /proc/cpuinfo (cpu_lines == 1) then if _model is an A57 (0xd07)
+  // we assume the worst and assume we could be on a big little system and have
+  // undisclosed A53 cores which we could be swapped to at any stage
+  if (_cpu == CPU_ARM && cpu_lines == 1 && _model == 0xd07) _cpuFeatures |= CPU_A53MAC;
+
+  sprintf(buf, "0x%02x:0x%x:0x%03x:%d", _cpu, _variant, _model, _revision);
+  if (_model2) sprintf(buf+strlen(buf), "(0x%03x)", _model2);
+  if (auxv & HWCAP_ASIMD) strcat(buf, ", simd");
   if (auxv & HWCAP_CRC32) strcat(buf, ", crc");
   if (auxv & HWCAP_AES)   strcat(buf, ", aes");
   if (auxv & HWCAP_SHA1)  strcat(buf, ", sha1");
   if (auxv & HWCAP_SHA2)  strcat(buf, ", sha256");
 
-  _features_str = strdup(buf);
+  _features_str = os::strdup(buf);
 
   if (FLAG_IS_DEFAULT(UseCRC32)) {
     UseCRC32 = (auxv & HWCAP_CRC32) != 0;
@@ -202,6 +239,10 @@
     UseMultiplyToLenIntrinsic = true;
   }
 
+  if (FLAG_IS_DEFAULT(UseBarriersForVolatile)) {
+    UseBarriersForVolatile = (_cpuFeatures & CPU_DMB_ATOMICS) != 0;
+  }
+
 #ifdef COMPILER2
   if (FLAG_IS_DEFAULT(OptoScheduling)) {
     OptoScheduling = true;
--- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp	Thu May 14 20:17:02 2015 -0700
+++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp	Wed Jul 05 20:33:50 2017 +0200
@@ -34,6 +34,9 @@
 protected:
   static int _cpu;
   static int _model;
+  static int _model2;
+  static int _variant;
+  static int _revision;
   static int _stepping;
   static int _cpuFeatures;     // features returned by the "cpuid" instruction
                                // 0 if this instruction is not available
@@ -49,7 +52,40 @@
   static void assert_is_initialized() {
   }
 
+  enum {
+    CPU_ARM       = 'A',
+    CPU_BROADCOM  = 'B',
+    CPU_CAVIUM    = 'C',
+    CPU_DEC       = 'D',
+    CPU_INFINEON  = 'I',
+    CPU_MOTOROLA  = 'M',
+    CPU_NVIDIA    = 'N',
+    CPU_AMCC      = 'P',
+    CPU_QUALCOM   = 'Q',
+    CPU_MARVELL   = 'V',
+    CPU_INTEL     = 'i',
+  } cpuFamily;
+
+  enum {
+    CPU_FP           = (1<<0),
+    CPU_ASIMD        = (1<<1),
+    CPU_EVTSTRM      = (1<<2),
+    CPU_AES          = (1<<3),
+    CPU_PMULL        = (1<<4),
+    CPU_SHA1         = (1<<5),
+    CPU_SHA2         = (1<<6),
+    CPU_CRC32        = (1<<7),
+    CPU_A53MAC       = (1 << 30),
+    CPU_DMB_ATOMICS  = (1 << 31),
+  } cpuFeatureFlags;
+
   static const char* cpu_features()           { return _features_str; }
+  static int cpu_family()                     { return _cpu; }
+  static int cpu_model()                      { return _model; }
+  static int cpu_model2()                     { return _model2; }
+  static int cpu_variant()                    { return _variant; }
+  static int cpu_revision()                   { return _revision; }
+  static int cpu_cpuFeatures()                { return _cpuFeatures; }
 
 };
 
--- a/jaxp/.hgtags	Thu May 14 20:17:02 2015 -0700
+++ b/jaxp/.hgtags	Wed Jul 05 20:33:50 2017 +0200
@@ -306,3 +306,4 @@
 f4a4a54620370f077c2e830a5561c8cfa811712b jdk9-b61
 3bcf83c1bbc1b7663e930d72c133a9bd86c7618d jdk9-b62
 4a8f895f0317dcc90479cb7cc97014312e69edf7 jdk9-b63
+6f91749b5aaef1a171ec2254163233438d1071d1 jdk9-b64
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.java	Thu May 14 20:17:02 2015 -0700
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.java	Wed Jul 05 20:33:50 2017 +0200
@@ -567,8 +567,12 @@
     }
 
     public NodeList makeNodeList(DTMAxisIterator iter) {
-        // TODO: gather nodes from all DOMs ?
-        return _main.makeNodeList(iter);
+        int index = iter.next();
+        if (index == DTM.NULL) {
+            return null;
+        }
+        iter.reset();
+        return _adapters[getDTMId(index)].makeNodeList(iter);
     }
 
     public String getLanguage(int node) {
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java	Thu May 14 20:17:02 2015 -0700
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java	Thu May 14 20:17:02 2015 -0700
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java	Thu May 14 20:17:02 2015 -0700
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathEvaluationResult.java	Thu May 14 20:17:02 2015 -0700
+++ b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathEvaluationResult.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathNodes.java	Thu May 14 20:17:02 2015 -0700
+++ b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathNodes.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/DocumentExtFunc.java	Wed Jul 05 20:33:50 2017 +0200
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class DocumentExtFunc {
+
+    public static String test(NodeList list) {
+        Node node = list.item(0);
+        return "["+node.getNodeName() + ":" + node.getNodeValue()+"]";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/XSLTFunctionsTest.java	Wed Jul 05 20:33:50 2017 +0200
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import static org.testng.Assert.assertEquals;
+
+/*
+ * @summary This class contains tests for XSLT functions.
+ */
+
+public class XSLTFunctionsTest {
+
+    /**
+     * @bug 8062518
+     * Verifies that a reference to the DTM created by XSLT document function is
+     * actually read from the DTM by an extension function.
+     * @param xml Content of xml file to process
+     * @param xsl stylesheet content that loads external document {@code externalDoc}
+     *        with XSLT 'document' function and then reads it with
+     *        DocumentExtFunc.test() function
+     * @param externalDoc Content of the external xml document
+     * @param expectedResult Expected transformation result
+     **/
+    @Test(dataProvider = "document")
+    public void testDocument(final String xml, final String xsl,
+                             final String externalDoc, final String expectedResult) throws Exception {
+        // Prepare sources for transormation
+        Source src = new StreamSource(new StringReader(xml));
+        Source xslsrc = new StreamSource(new StringReader(xsl));
+
+        // Create factory and transformer
+        TransformerFactory tf = TransformerFactory.newInstance();
+        Transformer t = tf.newTransformer( xslsrc );
+        t.setErrorListener(tf.getErrorListener());
+
+        // Set URI Resolver to return the newly constructed xml
+        // stream source object from xml test string
+        t.setURIResolver(new URIResolver() {
+            @Override
+            public Source resolve(String href, String base)
+                    throws TransformerException {
+                if (href.contains("externalDoc")) {
+                    return new StreamSource(new StringReader(externalDoc));
+                } else {
+                    return new StreamSource(new StringReader(xml));
+                }
+            }
+        });
+
+        // Prepare output stream
+        StringWriter xmlResultString = new StringWriter();
+        StreamResult xmlResultStream = new StreamResult(xmlResultString);
+
+        //Transform the xml
+        t.transform(src, xmlResultStream);
+
+        // If the document can't be accessed and the bug is in place then
+        // reported exception will be thrown during transformation
+        System.out.println("Transformation result:"+xmlResultString.toString().trim());
+
+        // Check the result - it should contain two (node name, node values) entries -
+        // one for original document, another for a document created with
+        // call to 'document' function
+        assertEquals(xmlResultString.toString().trim(), expectedResult);
+    }
+
+    @DataProvider(name = "document")
+    public static Object[][] documentTestData() {
+        return new Object[][] {
+            {documentTestXml, documentTestXsl, documentTestExternalDoc, documentTesteExpectedResult},
+        };
+    }
+
+    static final String documentTestXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Test>Doc</Test>";
+
+    static final String documentTestExternalDoc = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Test>External Doc</Test>";
+
+    static final String documentTestXsl = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+            + "<xsl:transform version=\"1.0\""
+            + " xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" "
+            + " xmlns:cfunc=\"http://xml.apache.org/xalan/java/\">"
+            + "<xsl:template match=\"/\">"
+            + "<xsl:element name=\"root\">"
+            + "<xsl:variable name=\"other_doc\" select=\"document(&#39;externalDoc&#39;)\"/>"
+            + "<!-- Source -->"
+            + "<xsl:value-of select=\"cfunc:javax.xml.transform.DocumentExtFunc.test(/Test)\"/>"
+            + "<!-- document() -->"
+            + "<xsl:value-of select=\"cfunc:javax.xml.transform.DocumentExtFunc.test($other_doc/Test)\"/>"
+            + "</xsl:element></xsl:template></xsl:transform>";
+
+    static final String documentTesteExpectedResult = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+                                                    + "<root>[Test:Doc][Test:External Doc]</root>";
+}
--- a/jaxws/.hgtags	Thu May 14 20:17:02 2015 -0700
+++ b/jaxws/.hgtags	Wed Jul 05 20:33:50 2017 +0200
@@ -309,3 +309,4 @@
 77f44848c44c003205490bf5ab88035233b65418 jdk9-b61
 cd0cf72b2cbf4adb778a02505fb065bb2292688c jdk9-b62
 b5c22d09b1c91dd49b006f38d8ba9c4397517ccc jdk9-b63
+df100399ed27d0eaa57c137ca99819a0fee66178 jdk9-b64
--- a/jdk/.hgtags	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/.hgtags	Wed Jul 05 20:33:50 2017 +0200
@@ -306,3 +306,4 @@
 da84dcac1b0b12c5b836b05ac75ecbfadee0cd32 jdk9-b61
 49118e68fbd4cc0044e718c47db681946d5efd69 jdk9-b62
 fd3281c400347088b36aeb16273aa679d53a81a4 jdk9-b63
+7de8d036ad0980d988d1b9b4b4e6be555d9fbf98 jdk9-b64
--- a/jdk/make/CompileDemos.gmk	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/make/CompileDemos.gmk	Wed Jul 05 20:33:50 2017 +0200
@@ -396,7 +396,7 @@
   $(eval $(call SetupNativeCompilation,BUILD_LIBPOLLER, \
       SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \
       OPTIMIZATION := LOW, \
-      CFLAGS := $(CFLAGS_JDKLIB) $(SHARED_LIBRARY_FLAGS) \
+      CFLAGS := $(CFLAGS_JDKLIB) \
           -I$(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
       LDFLAGS := $(LDFLAGS_JDKLIB), \
       LDFLAGS_SUFFIX_solaris := -lc, \
--- a/jdk/make/data/charsetmapping/charsets	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/make/data/charsetmapping/charsets	Wed Jul 05 20:33:50 2017 +0200
@@ -1833,10 +1833,3 @@
 ##
 ########################################################
  
-charset x-COMPOUND_TEXT COMPOUND_TEXT
-    package sun.nio.cs.ext
-    type    source
-    os      unix
-    alias   COMPOUND_TEXT       # JDK historical
-    alias   x11-compound_text
-    alias   x-compound-text
--- a/jdk/make/launcher/Launcher-jdk.accessibility.gmk	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/make/launcher/Launcher-jdk.accessibility.gmk	Wed Jul 05 20:33:50 2017 +0200
@@ -39,7 +39,7 @@
       CFLAGS := $(filter-out -Zc:wchar_t-, $(CFLAGS_JDKEXE)) -Zc:wchar_t \
           -analyze- -Od -Gd -D_WINDOWS \
           -D_UNICODE -DUNICODE -RTC1 -EHsc, \
-      DISABLED_WARNINGS_microsoft := 4267, \
+      DISABLED_WARNINGS_microsoft := 4267 4996, \
       LDFLAGS := $(LDFLAGS_JDKEXE) \
           Advapi32.lib Version.lib User32.lib, \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jabswitch, \
--- a/jdk/make/launcher/Launcher-jdk.pack200.gmk	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/make/launcher/Launcher-jdk.pack200.gmk	Wed Jul 05 20:33:50 2017 +0200
@@ -84,6 +84,7 @@
     CFLAGS_linux := -fPIC, \
     CFLAGS_solaris := -KPIC, \
     CFLAGS_macosx := -fPIC, \
+    DISABLED_WARNINGS_gcc := unused-result, \
     MAPFILE := $(UNPACK_MAPFILE),\
     LDFLAGS := $(UNPACKEXE_ZIPOBJS) \
         $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
--- a/jdk/make/lib/Awt2dLibraries.gmk	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/make/lib/Awt2dLibraries.gmk	Wed Jul 05 20:33:50 2017 +0200
@@ -246,9 +246,10 @@
     CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
     DISABLED_WARNINGS_gcc := sign-compare unused-result maybe-uninitialized \
         format-nonliteral parentheses, \
-    DISABLED_WARNINGS_clang := logical-op-parentheses, \
+    DISABLED_WARNINGS_clang := logical-op-parentheses extern-initializer, \
     DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \
-    DISABLED_WARNINGS_microsoft := 4297 4244 4267, \
+    DISABLED_WARNINGS_microsoft := 4297 4244 4267 4996, \
+    WARNINGS_AS_ERRORS_gcc := false, \
     ASFLAGS := $(LIBAWT_ASFLAGS), \
     MAPFILE := $(LIBAWT_MAPFILE), \
     LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \
@@ -357,6 +358,7 @@
             format-security int-to-pointer-cast parentheses, \
         DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \
             E_ASSIGNMENT_TYPE_MISMATCH E_NON_CONST_INIT, \
+        WARNINGS_AS_ERRORS_gcc := false, \
         MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_xawt/mapfile-vers, \
         LDFLAGS := $(LDFLAGS_JDKLIB) \
             $(X_LIBS) $(LIBAWT_XAWT_LDFLAGS) \
@@ -408,11 +410,11 @@
     INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \
     OPTIMIZATION := HIGHEST, \
     CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \
-        $(SHARED_LIBRARY_FLAGS) $(LIBLCMS_CPPFLAGS) \
+        $(LIBLCMS_CPPFLAGS) \
         $(LCMS_CFLAGS), \
     CFLAGS_solaris := -xc99=no_lib, \
     CFLAGS_windows := -DCMS_IS_WINDOWS_, \
-    DISABLED_WARNINGS_gcc := format-nonliteral, \
+    DISABLED_WARNINGS_gcc := format-nonliteral type-limits, \
     DISABLED_WARNINGS_clang := tautological-compare, \
     DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/liblcms/mapfile-vers, \
@@ -647,10 +649,13 @@
     OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
     CFLAGS_windows = -DCC_NOEX, \
     DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast reorder \
-        delete-non-virtual-dtor, \
-    DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types, \
+        delete-non-virtual-dtor type-limits, \
+    DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \
+        tautological-constant-out-of-range-compare int-to-pointer-cast, \
     DISABLED_WARNINGS_solstudio := truncwarn, \
-    DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090, \
+    DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146, \
+    WARNINGS_AS_ERRORS_gcc := false, \
+    WARNINGS_AS_ERRORS_solstudio := false, \
     MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
     LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
@@ -880,10 +885,10 @@
       OPTIMIZATION := LOW, \
       CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
                 $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS), \
-      DISABLED_WARNINGS_gcc := type-limits unused-result maybe-uninitialized, \
+      DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result maybe-uninitialized, \
       DISABLED_WARNINGS_clang := incompatible-pointer-types, \
-      DISABLED_WARNINGS_solstudio := E_NEWLINE_NOT_LAST, \
-      DISABLED_WARNINGS_microsoft := 4244 4267, \
+      DISABLED_WARNINGS_solstudio := E_NEWLINE_NOT_LAST E_DECLARATION_IN_CODE, \
+      DISABLED_WARNINGS_microsoft := 4018 4244 4267, \
       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
@@ -956,6 +961,7 @@
       DISABLED_WARNINGS_clang := incomplete-implementation \
           deprecated-declarations objc-method-access bitwise-op-parentheses \
           incompatible-pointer-types parentheses-equality extra-tokens, \
+      WARNINGS_AS_ERRORS_clang := false, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN) \
           -L$(INSTALL_LIBRARIES_HERE), \
--- a/jdk/make/lib/CoreLibraries.gmk	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/make/lib/CoreLibraries.gmk	Wed Jul 05 20:33:50 2017 +0200
@@ -149,7 +149,8 @@
     DISABLED_WARNINGS_gcc := type-limits format-nonliteral, \
     DISABLED_WARNINGS_clang := int-conversion, \
     DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \
-    DISABLED_WARNINGS_microsoft := 4022 4267, \
+    DISABLED_WARNINGS_microsoft := 4022 4267 4996, \
+    WARNINGS_AS_ERRORS_solstudio := false, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/jdk/make/lib/Lib-jdk.crypto.ucrypto.gmk	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/make/lib/Lib-jdk.crypto.ucrypto.gmk	Wed Jul 05 20:33:50 2017 +0200
@@ -38,6 +38,7 @@
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           $(addprefix -I, $(LIBJ2UCRYPTO_SRC)), \
+      DISABLED_WARNINGS_solstudio := E_MACRO_REDEFINED, \
       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2ucrypto/mapfile-vers, \
       LDFLAGS := $(LDFLAGS_JDKLIB), \
       LDFLAGS_SUFFIX := $(LIBDL), \
--- a/jdk/make/lib/NetworkingLibraries.gmk	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/make/lib/NetworkingLibraries.gmk	Wed Jul 05 20:33:50 2017 +0200
@@ -34,7 +34,7 @@
         $(LIBJAVA_HEADER_FLAGS) $(addprefix -I, $(LIBNET_SRC_DIRS)), \
     DISABLED_WARNINGS_gcc := format-nonliteral, \
     DISABLED_WARNINGS_clang := parentheses-equality constant-logical-operand, \
-    DISABLED_WARNINGS_microsoft := 4244 4047 4133, \
+    DISABLED_WARNINGS_microsoft := 4244 4047 4133 4996, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libnet/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/jdk/make/lib/NioLibraries.gmk	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/make/lib/NioLibraries.gmk	Wed Jul 05 20:33:50 2017 +0200
@@ -70,7 +70,7 @@
         $(BUILD_LIBNIO_CFLAGS), \
     DISABLED_WARNINGS_gcc := type-limits, \
     DISABLED_WARNINGS_clang := tautological-compare, \
-    DISABLED_WARNINGS_microsoft := 4244, \
+    DISABLED_WARNINGS_microsoft := 4244 4996, \
     MAPFILE := $(BUILD_LIBNIO_MAPFILE), \
     LDFLAGS := $(LDFLAGS_JDKLIB) $(BUILD_LIBNIO_LDFLAGS) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/jdk/make/lib/SoundLibraries.gmk	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/make/lib/SoundLibraries.gmk	Wed Jul 05 20:33:50 2017 +0200
@@ -111,10 +111,6 @@
   LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES)
 endif # OPENJDK_TARGET_OS solaris
 
-
-  ifeq ($(OPENJDK_TARGET_CPU), aarch64)
-       LIBJSOUND_CFLAGS += -DX_ARCH=X_AARCH64
-  endif
 LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \
@@ -129,6 +125,7 @@
     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \
     DISABLED_WARNINGS_clang := implicit-function-declaration \
         deprecated-writable-strings, \
+    WARNINGS_AS_ERRORS_clang := false, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsound/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/jdk/src/java.base/macosx/native/libjli/java_md_macosx.c	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/macosx/native/libjli/java_md_macosx.c	Wed Jul 05 20:33:50 2017 +0200
@@ -948,8 +948,15 @@
     jmethodID getCanonicalNameMID = NULL;
     NULL_CHECK(getCanonicalNameMID = (*env)->GetMethodID(env, classClass, "getCanonicalName", "()Ljava/lang/String;"));
 
-    jstring mainClassString = NULL;
-    NULL_CHECK(mainClassString = (*env)->CallObjectMethod(env, mainClass, getCanonicalNameMID));
+    jstring mainClassString = (*env)->CallObjectMethod(env, mainClass, getCanonicalNameMID);
+    if ((*env)->ExceptionCheck(env)) {
+        /*
+         * Clears all errors caused by getCanonicalName() on the mainclass and
+         * leaves the JAVA_MAIN_CLASS__<pid> empty.
+         */
+        (*env)->ExceptionClear(env);
+        return;
+    }
 
     const char *mainClassName = NULL;
     NULL_CHECK(mainClassName = (*env)->GetStringUTFChars(env, mainClassString, NULL));
@@ -1056,7 +1063,7 @@
  * Note the jvmInstance must be initialized first before entering into
  * ShowSplashScreen, as there is a callback into the JLI_GetJavaVMInstance.
  */
-void PostJVMInit(JNIEnv *env, jstring mainClass, JavaVM *vm) {
+void PostJVMInit(JNIEnv *env, jclass mainClass, JavaVM *vm) {
     jvmInstance = vm;
     SetMainClassForAWT(env, mainClass);
     CHECK_EXCEPTION_RETURN();
--- a/jdk/src/java.base/share/classes/java/io/BufferedReader.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/io/BufferedReader.java	Wed Jul 05 20:33:50 2017 +0200
@@ -272,6 +272,7 @@
      *             stream has been reached
      *
      * @exception  IOException  If an I/O error occurs
+     * @exception  IndexOutOfBoundsException {@inheritDoc}
      */
     public int read(char cbuf[], int off, int len) throws IOException {
         synchronized (lock) {
--- a/jdk/src/java.base/share/classes/java/io/CharArrayReader.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/io/CharArrayReader.java	Wed Jul 05 20:33:50 2017 +0200
@@ -116,6 +116,7 @@
      *          the end of the stream has been reached
      *
      * @exception   IOException  If an I/O error occurs
+     * @exception   IndexOutOfBoundsException {@inheritDoc}
      */
     public int read(char b[], int off, int len) throws IOException {
         synchronized (lock) {
--- a/jdk/src/java.base/share/classes/java/io/FilterReader.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/io/FilterReader.java	Wed Jul 05 20:33:50 2017 +0200
@@ -69,6 +69,7 @@
      * Reads characters into a portion of an array.
      *
      * @exception  IOException  If an I/O error occurs
+     * @exception  IndexOutOfBoundsException {@inheritDoc}
      */
     public int read(char cbuf[], int off, int len) throws IOException {
         return in.read(cbuf, off, len);
--- a/jdk/src/java.base/share/classes/java/io/InputStreamReader.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/io/InputStreamReader.java	Wed Jul 05 20:33:50 2017 +0200
@@ -179,6 +179,7 @@
      *             stream has been reached
      *
      * @exception  IOException  If an I/O error occurs
+     * @exception  IndexOutOfBoundsException {@inheritDoc}
      */
     public int read(char cbuf[], int offset, int length) throws IOException {
         return sd.read(cbuf, offset, length);
--- a/jdk/src/java.base/share/classes/java/io/LineNumberReader.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/io/LineNumberReader.java	Wed Jul 05 20:33:50 2017 +0200
@@ -159,6 +159,8 @@
      *
      * @throws  IOException
      *          If an I/O error occurs
+     *
+     * @throws  IndexOutOfBoundsException {@inheritDoc}
      */
     @SuppressWarnings("fallthrough")
     public int read(char cbuf[], int off, int len) throws IOException {
--- a/jdk/src/java.base/share/classes/java/io/PipedReader.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/io/PipedReader.java	Wed Jul 05 20:33:50 2017 +0200
@@ -286,6 +286,7 @@
      *                  <a href=PipedInputStream.html#BROKEN> <code>broken</code></a>,
      *                  {@link #connect(java.io.PipedWriter) unconnected}, closed,
      *                  or an I/O error occurs.
+     * @exception  IndexOutOfBoundsException {@inheritDoc}
      */
     public synchronized int read(char cbuf[], int off, int len)  throws IOException {
         if (!connected) {
--- a/jdk/src/java.base/share/classes/java/io/PushbackReader.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/io/PushbackReader.java	Wed Jul 05 20:33:50 2017 +0200
@@ -102,6 +102,7 @@
      *             stream has been reached
      *
      * @exception  IOException  If an I/O error occurs
+     * @exception  IndexOutOfBoundsException {@inheritDoc}
      */
     public int read(char cbuf[], int off, int len) throws IOException {
         synchronized (lock) {
--- a/jdk/src/java.base/share/classes/java/io/Reader.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/io/Reader.java	Wed Jul 05 20:33:50 2017 +0200
@@ -153,6 +153,9 @@
      *             stream has been reached
      *
      * @exception  IOException  If an I/O error occurs
+     * @exception  IndexOutOfBoundsException
+     *             If {@code off} is negative, or {@code len} is negative,
+     *             or {@code len} is greater than {@code cbuf.length - off}
      */
     abstract public int read(char cbuf[], int off, int len) throws IOException;
 
--- a/jdk/src/java.base/share/classes/java/io/StringReader.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/io/StringReader.java	Wed Jul 05 20:33:50 2017 +0200
@@ -84,6 +84,7 @@
      *             stream has been reached
      *
      * @exception  IOException  If an I/O error occurs
+     * @exception  IndexOutOfBoundsException {@inheritDoc}
      */
     public int read(char cbuf[], int off, int len) throws IOException {
         synchronized (lock) {
--- a/jdk/src/java.base/share/classes/java/lang/annotation/Documented.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/annotation/Documented.java	Wed Jul 05 20:33:50 2017 +0200
@@ -26,12 +26,24 @@
 package java.lang.annotation;
 
 /**
- * Indicates that annotations with a type are to be documented by javadoc
- * and similar tools by default.  This type should be used to annotate the
- * declarations of types whose annotations affect the use of annotated
- * elements by their clients.  If a type declaration is annotated with
- * Documented, its annotations become part of the public API
- * of the annotated elements.
+ * If the annotation {@code @Documented} is present on the declaration
+ * of an annotation type <i>A</i>, then any {@code @A} annotation on
+ * an element is considered part of the element's public contract.
+ *
+ * In more detail, when an annotation type <i>A</i> is annotated with
+ * {@code Documented}, the presence and value of annotations of type
+ * <i>A</i> are a part of the public contract of the elements <i>A</i>
+ * annotates.
+ *
+ * Conversely, if an annotation type <i>B</i> is <em>not</em>
+ * annotated with {@code Documented}, the presence and value of
+ * <i>B</i> annotations are <em>not</em> part of the public contract
+ * of the elements <i>B</i> annotates.
+ *
+ * Concretely, if an annotation type is annotated with {@code
+ * Documented}, by default a tool like javadoc will display
+ * annotations of that type in its output while annotations of
+ * annotation types without {@code Documented} will not be displayed.
  *
  * @author  Joshua Bloch
  * @since 1.5
--- a/jdk/src/java.base/share/classes/java/security/Policy.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/security/Policy.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -49,7 +49,8 @@
  * implementation (a default subclass implementation of this abstract class).
  * The default Policy implementation can be changed by setting the value
  * of the {@code policy.provider} security property to the fully qualified
- * name of the desired Policy subclass implementation.
+ * name of the desired Policy subclass implementation. The system class loader
+ * is used to load this class.
  *
  * <p> Application code can directly subclass Policy to provide a custom
  * implementation.  In addition, an instance of a Policy object can be
@@ -111,6 +112,10 @@
 
     private static final Debug debug = Debug.getInstance("policy");
 
+    // Default policy provider
+    private static final String DEFAULT_POLICY =
+        "sun.security.provider.PolicyFile";
+
     // Cache mapping ProtectionDomain.Key to PermissionCollection
     private WeakHashMap<ProtectionDomain.Key, PermissionCollection> pdMapping;
 
@@ -169,74 +174,7 @@
             synchronized (Policy.class) {
                 PolicyInfo pinfo = policy.get();
                 if (pinfo.policy == null) {
-                    String policy_class = AccessController.doPrivileged(
-                        new PrivilegedAction<>() {
-                        public String run() {
-                            return Security.getProperty("policy.provider");
-                        }
-                    });
-                    if (policy_class == null) {
-                        policy_class = "sun.security.provider.PolicyFile";
-                    }
-
-                    try {
-                        pinfo = new PolicyInfo(
-                            (Policy) Class.forName(policy_class).newInstance(),
-                            true);
-                    } catch (Exception e) {
-                        /*
-                         * The policy_class seems to be an extension
-                         * so we have to bootstrap loading it via a policy
-                         * provider that is on the bootclasspath.
-                         * If it loads then shift gears to using the configured
-                         * provider.
-                         */
-
-                        // install the bootstrap provider to avoid recursion
-                        Policy polFile = new sun.security.provider.PolicyFile();
-                        pinfo = new PolicyInfo(polFile, false);
-                        policy.set(pinfo);
-
-                        final String pc = policy_class;
-                        Policy pol = AccessController.doPrivileged(
-                            new PrivilegedAction<>() {
-                            public Policy run() {
-                                try {
-                                    ClassLoader cl =
-                                            ClassLoader.getSystemClassLoader();
-                                    // we want the extension loader
-                                    ClassLoader extcl = null;
-                                    while (cl != null) {
-                                        extcl = cl;
-                                        cl = cl.getParent();
-                                    }
-                                    return (extcl != null ? (Policy)Class.forName(
-                                            pc, true, extcl).newInstance() : null);
-                                } catch (Exception e) {
-                                    if (debug != null) {
-                                        debug.println("policy provider " +
-                                                    pc +
-                                                    " not available");
-                                        e.printStackTrace();
-                                    }
-                                    return null;
-                                }
-                            }
-                        });
-                        /*
-                         * if it loaded install it as the policy provider. Otherwise
-                         * continue to use the system default implementation
-                         */
-                        if (pol != null) {
-                            pinfo = new PolicyInfo(pol, true);
-                        } else {
-                            if (debug != null) {
-                                debug.println("using sun.security.provider.PolicyFile");
-                            }
-                            pinfo = new PolicyInfo(polFile, true);
-                        }
-                    }
-                    policy.set(pinfo);
+                    return loadPolicyProvider();
                 }
                 return pinfo.policy;
             }
@@ -245,6 +183,70 @@
     }
 
     /**
+     * Loads and instantiates a Policy implementation specified by the
+     * policy.provider security property. Note that this method should only
+     * be called by getPolicyNoCheck and from within a synchronized block with
+     * an intrinsic lock on the Policy.class.
+     */
+    private static Policy loadPolicyProvider() {
+        String policyProvider =
+            AccessController.doPrivileged(new PrivilegedAction<>() {
+                @Override
+                public String run() {
+                    return Security.getProperty("policy.provider");
+                }
+            });
+
+        /*
+         * If policy.provider is not set or is set to the default provider,
+         * simply instantiate it and return.
+         */
+        if (policyProvider == null || policyProvider.isEmpty() ||
+            policyProvider.equals(DEFAULT_POLICY))
+        {
+            Policy polFile = new sun.security.provider.PolicyFile();
+            policy.set(new PolicyInfo(polFile, true));
+            return polFile;
+        }
+
+        /*
+         * Locate, load, and instantiate the policy.provider impl using
+         * the system class loader. While doing so, install the bootstrap
+         * provider to avoid potential recursion.
+         */
+        Policy polFile = new sun.security.provider.PolicyFile();
+        policy.set(new PolicyInfo(polFile, false));
+
+        Policy pol = AccessController.doPrivileged(new PrivilegedAction<>() {
+            @Override
+            public Policy run() {
+                try {
+                    ClassLoader scl = ClassLoader.getSystemClassLoader();
+                    Class<?> c = Class.forName(policyProvider, true, scl);
+                    return (Policy)c.newInstance();
+                } catch (Exception e) {
+                    if (debug != null) {
+                        debug.println("policy provider " + policyProvider +
+                                      " not available");
+                        e.printStackTrace();
+                    }
+                    return null;
+                }
+            }
+        });
+
+        if (pol == null) {
+            // Fallback and use the system default implementation
+            if (debug != null) {
+                debug.println("using " + DEFAULT_POLICY);
+            }
+            pol = polFile;
+        }
+        policy.set(new PolicyInfo(pol, true));
+        return pol;
+    }
+
+    /**
      * Sets the system-wide Policy object. This method first calls
      * {@code SecurityManager.checkPermission} with a
      * {@code SecurityPermission("setPolicy")}
--- a/jdk/src/java.base/share/classes/java/security/cert/LDAPCertStoreParameters.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/security/cert/LDAPCertStoreParameters.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -30,7 +30,12 @@
  * <p>
  * This class is used to provide necessary configuration parameters (server
  * name and port number) to implementations of the LDAP {@code CertStore}
- * algorithm.
+ * algorithm. However, if you are retrieving certificates or CRLs from
+ * an ldap URI as specified by RFC 5280, use the
+ * {@link java.security.cert.URICertStoreParameters URICertStoreParameters}
+ * instead as the URI may contain additional information such as the
+ * distinguished name that will help the LDAP CertStore find the specific
+ * certificates and CRLs.
  * <p>
  * <b>Concurrent Access</b>
  * <p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/java/security/cert/URICertStoreParameters.java	Wed Jul 05 20:33:50 2017 +0200
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.security.cert;
+
+import java.net.URI;
+
+/**
+ * Parameters used as input for {@code CertStore} algorithms which use
+ * information contained in a URI to retrieve certificates and CRLs.
+ * <p>
+ * This class is used to provide necessary configuration parameters
+ * through a URI as defined in RFC 5280 to implementations of
+ * {@code CertStore} algorithms.
+ * <p>
+ * <b>Concurrent Access</b>
+ * <p>
+ * Unless otherwise specified, the methods defined in this class are not
+ * thread-safe. Multiple threads that need to access a single
+ * object concurrently should synchronize amongst themselves and
+ * provide the necessary locking. Multiple threads each manipulating
+ * separate objects need not synchronize.
+ *
+ * @since       1.9
+ * @see         CertStore
+ * @see         java.net.URI
+ */
+public final class URICertStoreParameters implements CertStoreParameters {
+
+    /**
+     * The uri, cannot be null
+     */
+    private final URI uri;
+
+    /*
+     * Hash code for this parameters.
+     */
+    private int myhash = -1;
+
+    /**
+     * Creates an instance of {@code URICertStoreParameters} with the
+     * specified URI.
+     *
+     * @param uri the URI which contains configuration information.
+     * @throws NullPointerException if {@code uri} is null
+     */
+    public URICertStoreParameters(URI uri) {
+        if (uri == null) {
+            throw new NullPointerException();
+        }
+        this.uri = uri;
+    }
+
+    /**
+     * Returns the URI used to construct this
+     * {@code URICertStoreParameters} object.
+     *
+     * @return the URI.
+     */
+    public URI getURI() {
+        return uri;
+    }
+
+    /**
+     * Returns a copy of this object. Changes to the copy will not affect
+     * the original and vice versa.
+     *
+     * @return the copy
+     */
+    @Override
+    public URICertStoreParameters clone() {
+        try {
+            return new URICertStoreParameters(uri);
+        } catch (NullPointerException e) {
+            /* Cannot happen */
+            throw new InternalError(e.toString(), e);
+        }
+    }
+
+    /**
+     * Returns a hash code value for this parameters object.
+     * The hash code is generated using the URI supplied at construction.
+     *
+     * @return a hash code value for this parameters.
+     */
+    @Override
+    public int hashCode() {
+        if (myhash == -1) {
+            myhash = uri.hashCode()*7;
+        }
+        return myhash;
+    }
+
+    /**
+     * Compares the specified object with this parameters object for equality.
+     * Two URICertStoreParameters are considered equal if the URIs used
+     * to construct them are equal.
+     *
+     * @param p the object to test for equality with this parameters.
+     *
+     * @return true if the specified object is equal to this parameters object.
+     */
+    @Override
+    public boolean equals(Object p) {
+        if (p == null || (!(p instanceof URICertStoreParameters))) {
+            return false;
+        }
+
+        if (p == this) {
+            return true;
+        }
+
+        URICertStoreParameters other = (URICertStoreParameters)p;
+        return uri.equals(other.getURI());
+    }
+
+    /**
+     * Returns a formatted string describing the parameters
+     * including the URI used to construct this object.
+     *
+     * @return a formatted string describing the parameters
+     */
+    @Override
+    public String toString() {
+        return "URICertStoreParameters: " + uri.toString();
+    }
+}
--- a/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java	Wed Jul 05 20:33:50 2017 +0200
@@ -64,6 +64,7 @@
 import java.util.function.Function;
 import java.util.function.IntBinaryOperator;
 import java.util.function.LongBinaryOperator;
+import java.util.function.Predicate;
 import java.util.function.ToDoubleBiFunction;
 import java.util.function.ToDoubleFunction;
 import java.util.function.ToIntBiFunction;
@@ -1619,6 +1620,45 @@
     }
 
     /**
+     * Helper method for EntrySet.removeIf
+     */
+    boolean removeEntryIf(Predicate<? super Entry<K, V>> function) {
+        if (function == null) throw new NullPointerException();
+        Node<K,V>[] t;
+        boolean removed = false;
+        if ((t = table) != null) {
+            Traverser<K,V> it = new Traverser<K,V>(t, t.length, 0, t.length);
+            for (Node<K,V> p; (p = it.advance()) != null; ) {
+                K k = p.key;
+                V v = p.val;
+                Map.Entry<K,V> e = new AbstractMap.SimpleImmutableEntry<>(k, v);
+                if (function.test(e) && replaceNode(k, null, v) != null)
+                    removed = true;
+            }
+        }
+        return removed;
+    }
+
+    /**
+     * Helper method for Values.removeIf
+     */
+    boolean removeValueIf(Predicate<? super  V> function) {
+        if (function == null) throw new NullPointerException();
+        Node<K,V>[] t;
+        boolean removed = false;
+        if ((t = table) != null) {
+            Traverser<K,V> it = new Traverser<K,V>(t, t.length, 0, t.length);
+            for (Node<K,V> p; (p = it.advance()) != null; ) {
+                K k = p.key;
+                V v = p.val;
+                if (function.test(v) && replaceNode(k, null, v) != null)
+                    removed = true;
+            }
+        }
+        return removed;
+    }
+
+    /**
      * If the specified key is not already associated with a value,
      * attempts to compute its value using the given mapping function
      * and enters it into this map unless {@code null}.  The entire
@@ -4690,6 +4730,10 @@
             throw new UnsupportedOperationException();
         }
 
+        public boolean removeIf(Predicate<? super V> filter) {
+            return map.removeValueIf(filter);
+        }
+
         public Spliterator<V> spliterator() {
             Node<K,V>[] t;
             ConcurrentHashMap<K,V> m = map;
@@ -4759,6 +4803,10 @@
             return added;
         }
 
+        public boolean removeIf(Predicate<? super Entry<K, V>> filter) {
+            return map.removeEntryIf(filter);
+        }
+
         public final int hashCode() {
             int h = 0;
             Node<K,V>[] t;
--- a/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentMap.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentMap.java	Wed Jul 05 20:33:50 2017 +0200
@@ -34,6 +34,7 @@
  */
 
 package java.util.concurrent;
+
 import java.util.Map;
 import java.util.Objects;
 import java.util.function.BiConsumer;
@@ -44,6 +45,14 @@
  * A {@link java.util.Map} providing thread safety and atomicity
  * guarantees.
  *
+ * <p>To maintain the specified guarantees, default implementations of
+ * methods including {@link #putIfAbsent} inherited from {@link Map}
+ * must be overridden by implementations of this interface. Similarly,
+ * implementations of the collections returned by methods {@link
+ * #keySet}, {@link #values}, and {@link #entrySet} must override
+ * methods such as {@code removeIf} when necessary to
+ * preserve atomicity guarantees.
+ *
  * <p>Memory consistency effects: As with other concurrent
  * collections, actions in a thread prior to placing an object into a
  * {@code ConcurrentMap} as a key or value
@@ -60,7 +69,7 @@
  * @param <K> the type of keys maintained by this map
  * @param <V> the type of mapped values
  */
-public interface ConcurrentMap<K, V> extends Map<K, V> {
+public interface ConcurrentMap<K,V> extends Map<K,V> {
 
     /**
      * {@inheritDoc}
@@ -86,9 +95,9 @@
      * @implSpec The default implementation is equivalent to, for this
      * {@code map}:
      * <pre> {@code
-     * for ((Map.Entry<K, V> entry : map.entrySet())
-     *     action.accept(entry.getKey(), entry.getValue());
-     * }</pre>
+     * for (Map.Entry<K,V> entry : map.entrySet()) {
+     *   action.accept(entry.getKey(), entry.getValue());
+     * }}</pre>
      *
      * @implNote The default implementation assumes that
      * {@code IllegalStateException} thrown by {@code getKey()} or
@@ -101,13 +110,13 @@
     @Override
     default void forEach(BiConsumer<? super K, ? super V> action) {
         Objects.requireNonNull(action);
-        for (Map.Entry<K, V> entry : entrySet()) {
+        for (Map.Entry<K,V> entry : entrySet()) {
             K k;
             V v;
             try {
                 k = entry.getKey();
                 v = entry.getValue();
-            } catch(IllegalStateException ise) {
+            } catch (IllegalStateException ise) {
                 // this usually means the entry is no longer in the map.
                 continue;
             }
@@ -117,14 +126,13 @@
 
     /**
      * If the specified key is not already associated
-     * with a value, associate it with the given value.
-     * This is equivalent to
-     *  <pre> {@code
+     * with a value, associates it with the given value.
+     * This is equivalent to, for this {@code map}:
+     * <pre> {@code
      * if (!map.containsKey(key))
      *   return map.put(key, value);
      * else
-     *   return map.get(key);
-     * }</pre>
+     *   return map.get(key);}</pre>
      *
      * except that the action is performed atomically.
      *
@@ -147,18 +155,19 @@
      * @throws IllegalArgumentException if some property of the specified key
      *         or value prevents it from being stored in this map
      */
-     V putIfAbsent(K key, V value);
+    V putIfAbsent(K key, V value);
 
     /**
      * Removes the entry for a key only if currently mapped to a given value.
-     * This is equivalent to
-     *  <pre> {@code
-     * if (map.containsKey(key) && Objects.equals(map.get(key), value)) {
+     * This is equivalent to, for this {@code map}:
+     * <pre> {@code
+     * if (map.containsKey(key)
+     *     && Objects.equals(map.get(key), value)) {
      *   map.remove(key);
      *   return true;
-     * } else
+     * } else {
      *   return false;
-     * }</pre>
+     * }}</pre>
      *
      * except that the action is performed atomically.
      *
@@ -181,14 +190,15 @@
 
     /**
      * Replaces the entry for a key only if currently mapped to a given value.
-     * This is equivalent to
-     *  <pre> {@code
-     * if (map.containsKey(key) && Objects.equals(map.get(key), oldValue)) {
+     * This is equivalent to, for this {@code map}:
+     * <pre> {@code
+     * if (map.containsKey(key)
+     *     && Objects.equals(map.get(key), oldValue)) {
      *   map.put(key, newValue);
      *   return true;
-     * } else
+     * } else {
      *   return false;
-     * }</pre>
+     * }}</pre>
      *
      * except that the action is performed atomically.
      *
@@ -212,13 +222,12 @@
 
     /**
      * Replaces the entry for a key only if currently mapped to some value.
-     * This is equivalent to
-     *  <pre> {@code
-     * if (map.containsKey(key)) {
+     * This is equivalent to, for this {@code map}:
+     * <pre> {@code
+     * if (map.containsKey(key))
      *   return map.put(key, value);
-     * } else
-     *   return null;
-     * }</pre>
+     * else
+     *   return null;}</pre>
      *
      * except that the action is performed atomically.
      *
@@ -249,12 +258,14 @@
      * @implSpec
      * <p>The default implementation is equivalent to, for this {@code map}:
      * <pre> {@code
-     * for ((Map.Entry<K, V> entry : map.entrySet())
-     *     do {
-     *        K k = entry.getKey();
-     *        V v = entry.getValue();
-     *     } while(!replace(k, v, function.apply(k, v)));
-     * }</pre>
+     * for (Map.Entry<K,V> entry : map.entrySet()) {
+     *   K k;
+     *   V v;
+     *   do {
+     *     k = entry.getKey();
+     *     v = entry.getValue();
+     *   } while (!map.replace(k, v, function.apply(k, v)));
+     * }}</pre>
      *
      * The default implementation may retry these steps when multiple
      * threads attempt updates including potentially calling the function
@@ -275,7 +286,7 @@
     default void replaceAll(BiFunction<? super K, ? super V, ? extends V> function) {
         Objects.requireNonNull(function);
         forEach((k,v) -> {
-            while(!replace(k, v, function.apply(k, v))) {
+            while (!replace(k, v, function.apply(k, v))) {
                 // v changed or k is gone
                 if ( (v = get(k)) == null) {
                     // k is no longer in the map.
@@ -295,11 +306,10 @@
      *
      * <pre> {@code
      * if (map.get(key) == null) {
-     *     V newValue = mappingFunction.apply(key);
-     *     if (newValue != null)
-     *         return map.putIfAbsent(key, newValue);
-     * }
-     * }</pre>
+     *   V newValue = mappingFunction.apply(key);
+     *   if (newValue != null)
+     *     return map.putIfAbsent(key, newValue);
+     * }}</pre>
      *
      * The default implementation may retry these steps when multiple
      * threads attempt updates including potentially calling the mapping
@@ -331,18 +341,17 @@
      * @implSpec
      * The default implementation is equivalent to performing the following
      * steps for this {@code map}, then returning the current value or
-     * {@code null} if now absent. :
+     * {@code null} if now absent:
      *
      * <pre> {@code
      * if (map.get(key) != null) {
-     *     V oldValue = map.get(key);
-     *     V newValue = remappingFunction.apply(key, oldValue);
-     *     if (newValue != null)
-     *         map.replace(key, oldValue, newValue);
-     *     else
-     *         map.remove(key, oldValue);
-     * }
-     * }</pre>
+     *   V oldValue = map.get(key);
+     *   V newValue = remappingFunction.apply(key, oldValue);
+     *   if (newValue != null)
+     *     map.replace(key, oldValue, newValue);
+     *   else
+     *     map.remove(key, oldValue);
+     * }}</pre>
      *
      * The default implementation may retry these steps when multiple threads
      * attempt updates including potentially calling the remapping function
@@ -363,13 +372,13 @@
             BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
         Objects.requireNonNull(remappingFunction);
         V oldValue;
-        while((oldValue = get(key)) != null) {
+        while ((oldValue = get(key)) != null) {
             V newValue = remappingFunction.apply(key, oldValue);
             if (newValue != null) {
                 if (replace(key, oldValue, newValue))
                     return newValue;
             } else if (remove(key, oldValue))
-               return null;
+                return null;
         }
         return oldValue;
     }
@@ -386,17 +395,16 @@
      * V oldValue = map.get(key);
      * V newValue = remappingFunction.apply(key, oldValue);
      * if (oldValue != null ) {
-     *    if (newValue != null)
-     *       map.replace(key, oldValue, newValue);
-     *    else
-     *       map.remove(key, oldValue);
+     *   if (newValue != null)
+     *     map.replace(key, oldValue, newValue);
+     *   else
+     *     map.remove(key, oldValue);
      * } else {
-     *    if (newValue != null)
-     *       map.putIfAbsent(key, newValue);
-     *    else
-     *       return null;
-     * }
-     * }</pre>
+     *   if (newValue != null)
+     *     map.putIfAbsent(key, newValue);
+     *   else
+     *     return null;
+     * }}</pre>
      *
      * The default implementation may retry these steps when multiple
      * threads attempt updates including potentially calling the remapping
@@ -417,7 +425,7 @@
             BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
         Objects.requireNonNull(remappingFunction);
         V oldValue = get(key);
-        for(;;) {
+        for (;;) {
             V newValue = remappingFunction.apply(key, oldValue);
             if (newValue == null) {
                 // delete mapping
@@ -458,7 +466,6 @@
         }
     }
 
-
     /**
      * {@inheritDoc}
      *
@@ -470,12 +477,11 @@
      * <pre> {@code
      * V oldValue = map.get(key);
      * V newValue = (oldValue == null) ? value :
-     *              remappingFunction.apply(oldValue, value);
+     *     remappingFunction.apply(oldValue, value);
      * if (newValue == null)
-     *     map.remove(key);
+     *   map.remove(key);
      * else
-     *     map.put(key, newValue);
-     * }</pre>
+     *   map.put(key, newValue);}</pre>
      *
      * <p>The default implementation may retry these steps when multiple
      * threads attempt updates including potentially calling the remapping
--- a/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java	Wed Jul 05 20:33:50 2017 +0200
@@ -58,6 +58,7 @@
 import java.util.function.Consumer;
 import java.util.function.BiConsumer;
 import java.util.function.Function;
+import java.util.function.Predicate;
 
 /**
  * A scalable concurrent {@link ConcurrentNavigableMap} implementation.
@@ -2492,6 +2493,22 @@
             else
                 return (Spliterator<E>)((SubMap<?,E>)m).valueIterator();
         }
+        public boolean removeIf(Predicate<? super E> filter) {
+            if (filter == null) throw new NullPointerException();
+            if (m instanceof ConcurrentSkipListMap)
+                return ((ConcurrentSkipListMap<?,E>)m).removeValueIf(filter);
+            // else use iterator
+            @SuppressWarnings("unchecked") Iterator<Map.Entry<Object,E>> it =
+                    ((SubMap<Object,E>)m).entryIterator();
+            boolean removed = false;
+            while (it.hasNext()) {
+                Map.Entry<Object,E> e = it.next();
+                E v = e.getValue();
+                if (filter.test(v) && m.remove(e.getKey(), v))
+                    removed = true;
+            }
+            return removed;
+        }
     }
 
     static final class EntrySet<K1,V1> extends AbstractSet<Map.Entry<K1,V1>> {
@@ -2554,6 +2571,20 @@
                 return (Spliterator<Map.Entry<K1,V1>>)
                     ((SubMap<K1,V1>)m).entryIterator();
         }
+        public boolean removeIf(Predicate<? super Entry<K1, V1>> filter) {
+            if (filter == null) throw new NullPointerException();
+            if (m instanceof ConcurrentSkipListMap)
+                return ((ConcurrentSkipListMap<K1,V1>)m).removeEntryIf(filter);
+            // else use iterator
+            Iterator<Map.Entry<K1,V1>> it = ((SubMap<K1,V1>)m).entryIterator();
+            boolean removed = false;
+            while (it.hasNext()) {
+                Map.Entry<K1,V1> e = it.next();
+                if (filter.test(e) && m.remove(e.getKey(), e.getValue()))
+                    removed = true;
+            }
+            return removed;
+        }
     }
 
     /**
@@ -3267,6 +3298,41 @@
     }
 
     /**
+     * Helper method for EntrySet.removeIf
+     */
+    boolean removeEntryIf(Predicate<? super Entry<K, V>> function) {
+        if (function == null) throw new NullPointerException();
+        boolean removed = false;
+        for (Node<K,V> n = findFirst(); n != null; n = n.next) {
+            V v;
+            if ((v = n.getValidValue()) != null) {
+                K k = n.key;
+                Map.Entry<K,V> e = new AbstractMap.SimpleImmutableEntry<>(k, v);
+                if (function.test(e) && remove(k, v))
+                    removed = true;
+            }
+        }
+        return removed;
+    }
+
+    /**
+     * Helper method for Values.removeIf
+     */
+    boolean removeValueIf(Predicate<? super V> function) {
+        if (function == null) throw new NullPointerException();
+        boolean removed = false;
+        for (Node<K,V> n = findFirst(); n != null; n = n.next) {
+            V v;
+            if ((v = n.getValidValue()) != null) {
+                K k = n.key;
+                if (function.test(v) && remove(k, v))
+                    removed = true;
+            }
+        }
+        return removed;
+    }
+
+    /**
      * Base class providing common structure for Spliterators.
      * (Although not all that much common functionality; as usual for
      * view classes, details annoyingly vary in key, value, and entry
--- a/jdk/src/java.base/share/classes/javax/security/auth/Subject.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/javax/security/auth/Subject.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1522,17 +1522,20 @@
             }
         }
 
+        @Override
         public int size() {
             return set.size();
         }
 
+        @Override
         public Iterator<T> iterator() {
             return set.iterator();
         }
 
+        @Override
         public boolean add(T o) {
 
-            if (!o.getClass().isAssignableFrom(c)) {
+            if (!c.isAssignableFrom(o.getClass())) {
                 MessageFormat form = new MessageFormat(ResourcesMgr.getString
                         ("attempting.to.add.an.object.which.is.not.an.instance.of.class"));
                 Object[] source = {c.toString()};
--- a/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java	Wed Jul 05 20:33:50 2017 +0200
@@ -67,10 +67,6 @@
  *   in RFC 5280. The ValidationAlgorithm attribute notes the
  *   specification that this provider implements.
  *
- * - LDAP is the CertStore type for LDAP repositories. The
- *   LDAPSchema attribute notes the specification defining the
- *   schema that this provider uses to find certificates and CRLs.
- *
  * - JavaPolicy is the default file-based Policy type.
  *
  * - JavaLoginConfig is the default file-based LoginModule Configuration type.
@@ -275,9 +271,6 @@
         /*
          * CertStores
          */
-        map.put("CertStore.LDAP",
-            "sun.security.provider.certpath.ldap.LDAPCertStore");
-        map.put("CertStore.LDAP LDAPSchema", "RFC2587");
         map.put("CertStore.Collection",
             "sun.security.provider.certpath.CollectionCertStore");
         map.put("CertStore.com.sun.security.IndexedCollection",
@@ -310,7 +303,6 @@
         map.put("KeyStore.JKS ImplementedIn", "Software");
         map.put("CertPathValidator.PKIX ImplementedIn", "Software");
         map.put("CertPathBuilder.PKIX ImplementedIn", "Software");
-        map.put("CertStore.LDAP ImplementedIn", "Software");
         map.put("CertStore.Collection ImplementedIn", "Software");
         map.put("CertStore.com.sun.security.IndexedCollection ImplementedIn",
             "Software");
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/CertStoreHelper.java	Thu May 14 20:17:02 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 2009, 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.
- */
-
-package sun.security.provider.certpath;
-
-import java.net.URI;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.security.AccessController;
-import java.security.NoSuchAlgorithmException;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.security.cert.CertStore;
-import java.security.cert.CertStoreException;
-import java.security.cert.X509CertSelector;
-import java.security.cert.X509CRLSelector;
-import javax.security.auth.x500.X500Principal;
-import java.io.IOException;
-
-import sun.security.util.Cache;
-
-/**
- * Helper used by URICertStore and others when delegating to another CertStore
- * to fetch certs and CRLs.
- */
-
-public abstract class CertStoreHelper {
-
-    private static final int NUM_TYPES = 2;
-    private final static Map<String,String> classMap = new HashMap<>(NUM_TYPES);
-    static {
-        classMap.put(
-            "LDAP",
-            "sun.security.provider.certpath.ldap.LDAPCertStoreHelper");
-        classMap.put(
-            "SSLServer",
-            "sun.security.provider.certpath.ssl.SSLServerCertStoreHelper");
-    };
-    private static Cache<String, CertStoreHelper> cache
-        = Cache.newSoftMemoryCache(NUM_TYPES);
-
-    public static CertStoreHelper getInstance(final String type)
-        throws NoSuchAlgorithmException
-    {
-        CertStoreHelper helper = cache.get(type);
-        if (helper != null) {
-            return helper;
-        }
-        final String cl = classMap.get(type);
-        if (cl == null) {
-            throw new NoSuchAlgorithmException(type + " not available");
-        }
-        try {
-            helper = AccessController.doPrivileged(
-                new PrivilegedExceptionAction<CertStoreHelper>() {
-                    public CertStoreHelper run() throws ClassNotFoundException {
-                        try {
-                            Class<?> c = Class.forName(cl, true, null);
-                            CertStoreHelper csh
-                                = (CertStoreHelper)c.newInstance();
-                            cache.put(type, csh);
-                            return csh;
-                        } catch (InstantiationException |
-                                 IllegalAccessException e) {
-                            throw new AssertionError(e);
-                        }
-                    }
-            });
-            return helper;
-        } catch (PrivilegedActionException e) {
-            throw new NoSuchAlgorithmException(type + " not available",
-                                               e.getException());
-        }
-    }
-
-    static boolean isCausedByNetworkIssue(String type, CertStoreException cse) {
-        switch (type) {
-            case "LDAP":
-            case "SSLServer":
-                try {
-                    CertStoreHelper csh = CertStoreHelper.getInstance(type);
-                    return csh.isCausedByNetworkIssue(cse);
-                } catch (NoSuchAlgorithmException nsae) {
-                    return false;
-                }
-            case "URI":
-                Throwable t = cse.getCause();
-                return (t != null && t instanceof IOException);
-            default:
-                // we don't know about any other remote CertStore types
-                return false;
-        }
-    }
-
-    /**
-     * Returns a CertStore using the given URI as parameters.
-     */
-    public abstract CertStore getCertStore(URI uri)
-        throws NoSuchAlgorithmException, InvalidAlgorithmParameterException;
-
-    /**
-     * Wraps an existing X509CertSelector when needing to avoid DN matching
-     * issues.
-     */
-    public abstract X509CertSelector wrap(X509CertSelector selector,
-                          X500Principal certSubject,
-                          String dn)
-        throws IOException;
-
-    /**
-     * Wraps an existing X509CRLSelector when needing to avoid DN matching
-     * issues.
-     */
-    public abstract X509CRLSelector wrap(X509CRLSelector selector,
-                         Collection<X500Principal> certIssuers,
-                         String dn)
-        throws IOException;
-
-    /**
-     * Returns true if the cause of the CertStoreException is a network
-     * related issue.
-     */
-    public abstract boolean isCausedByNetworkIssue(CertStoreException e);
-}
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java	Wed Jul 05 20:33:50 2017 +0200
@@ -466,6 +466,34 @@
                   stackedCerts, params.trustAnchors());
     }
 
+    static boolean isCausedByNetworkIssue(String type, CertStoreException cse) {
+        boolean result;
+        Throwable t = cse.getCause();
+
+        switch (type) {
+            case "LDAP":
+                if (t != null) {
+                    // These two exception classes are inside java.naming module
+                    String cn = t.getClass().getName();
+                    result = (cn.equals("javax.naming.ServiceUnavailableException") ||
+                        cn.equals("javax.naming.CommunicationException"));
+                } else {
+                    result = false;
+                }
+                break;
+            case "SSLServer":
+                result = (t != null && t instanceof IOException);
+                break;
+            case "URI":
+                result = (t != null && t instanceof IOException);
+                break;
+            default:
+                // we don't know about any other remote CertStore types
+                return false;
+        }
+        return result;
+    }
+
     private void checkCRLs(X509Certificate cert, PublicKey prevKey,
                            X509Certificate prevCert, boolean signFlag,
                            boolean allowSeparateKey,
@@ -510,7 +538,7 @@
                                   "CertStoreException: " + e.getMessage());
                 }
                 if (networkFailureException == null &&
-                    CertStoreHelper.isCausedByNetworkIssue(store.getType(),e)) {
+                    isCausedByNetworkIssue(store.getType(),e)) {
                     // save this exception, we may need to throw it later
                     networkFailureException = new CertPathValidatorException(
                         "Unable to determine revocation status due to " +
@@ -557,8 +585,7 @@
             } catch (CertStoreException e) {
                 if (e instanceof CertStoreTypeException) {
                     CertStoreTypeException cste = (CertStoreTypeException)e;
-                    if (CertStoreHelper.isCausedByNetworkIssue(cste.getType(),
-                                                               e)) {
+                    if (isCausedByNetworkIssue(cste.getType(), e)) {
                         throw new CertPathValidatorException(
                             "Unable to determine revocation status due to " +
                             "network error", e, null, -1,
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/URICertStore.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/URICertStore.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -42,6 +42,7 @@
 import java.security.cert.CertStoreSpi;
 import java.security.cert.CRLException;
 import java.security.cert.CRLSelector;
+import java.security.cert.URICertStoreParameters;
 import java.security.cert.X509Certificate;
 import java.security.cert.X509CertSelector;
 import java.security.cert.X509CRL;
@@ -118,9 +119,7 @@
 
     // true if URI is ldap
     private boolean ldap = false;
-    private CertStoreHelper ldapHelper;
     private CertStore ldapCertStore;
-    private String ldapPath;
 
     // Default maximum connect timeout in milliseconds (15 seconds)
     // allowed when downloading CRLs
@@ -165,13 +164,8 @@
         // if ldap URI, use an LDAPCertStore to fetch certs and CRLs
         if (uri.getScheme().toLowerCase(Locale.ENGLISH).equals("ldap")) {
             ldap = true;
-            ldapHelper = CertStoreHelper.getInstance("LDAP");
-            ldapCertStore = ldapHelper.getCertStore(uri);
-            ldapPath = uri.getPath();
-            // strip off leading '/'
-            if (ldapPath.charAt(0) == '/') {
-                ldapPath = ldapPath.substring(1);
-            }
+            URICertStoreParameters lparams = new URICertStoreParameters(uri);
+            ldapCertStore = CertStore.getInstance("LDAP", lparams);
         }
         try {
             factory = CertificateFactory.getInstance("X.509");
@@ -246,20 +240,10 @@
     public synchronized Collection<X509Certificate> engineGetCertificates
         (CertSelector selector) throws CertStoreException {
 
-        // if ldap URI we wrap the CertSelector in an LDAPCertSelector to
-        // avoid LDAP DN matching issues (see LDAPCertSelector for more info)
         if (ldap) {
-            X509CertSelector xsel = (X509CertSelector) selector;
-            try {
-                xsel = ldapHelper.wrap(xsel, xsel.getSubject(), ldapPath);
-            } catch (IOException ioe) {
-                throw new CertStoreException(ioe);
-            }
-            // Fetch the certificates via LDAP. LDAPCertStore has its own
             // caching mechanism, see the class description for more info.
-            // Safe cast since xsel is an X509 certificate selector.
             return (Collection<X509Certificate>)
-                ldapCertStore.getCertificates(xsel);
+                ldapCertStore.getCertificates(selector);
         }
 
         // Return the Certificates for this entry. It returns the cached value
@@ -356,20 +340,11 @@
     public synchronized Collection<X509CRL> engineGetCRLs(CRLSelector selector)
         throws CertStoreException {
 
-        // if ldap URI we wrap the CRLSelector in an LDAPCRLSelector to
-        // avoid LDAP DN matching issues (see LDAPCRLSelector for more info)
         if (ldap) {
-            X509CRLSelector xsel = (X509CRLSelector) selector;
-            try {
-                xsel = ldapHelper.wrap(xsel, null, ldapPath);
-            } catch (IOException ioe) {
-                throw new CertStoreException(ioe);
-            }
             // Fetch the CRLs via LDAP. LDAPCertStore has its own
             // caching mechanism, see the class description for more info.
-            // Safe cast since xsel is an X509 certificate selector.
             try {
-                return (Collection<X509CRL>) ldapCertStore.getCRLs(xsel);
+                return (Collection<X509CRL>) ldapCertStore.getCRLs(selector);
             } catch (CertStoreException cse) {
                 throw new PKIX.CertStoreTypeException("LDAP", cse);
             }
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/ssl/SSLServerCertStore.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/ssl/SSLServerCertStore.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -153,7 +153,7 @@
         throw new UnsupportedOperationException();
     }
 
-    static CertStore getInstance(URI uri)
+    public static CertStore getInstance(URI uri)
         throws InvalidAlgorithmParameterException
     {
         return new CS(new SSLServerCertStore(uri), null, "SSLServer", null);
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/ssl/SSLServerCertStoreHelper.java	Thu May 14 20:17:02 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2011, 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.
- */
-
-package sun.security.provider.certpath.ssl;
-
-import java.io.IOException;
-import java.net.URI;
-import java.security.NoSuchAlgorithmException;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.cert.CertStore;
-import java.security.cert.CertStoreException;
-import java.security.cert.X509CertSelector;
-import java.security.cert.X509CRLSelector;
-import java.util.Collection;
-import javax.security.auth.x500.X500Principal;
-
-import sun.security.provider.certpath.CertStoreHelper;
-
-/**
- * SSL implementation of CertStoreHelper.
- */
-public final class SSLServerCertStoreHelper extends CertStoreHelper {
-
-    @Override
-    public CertStore getCertStore(URI uri)
-        throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
-    {
-        return SSLServerCertStore.getInstance(uri);
-    }
-
-    @Override
-    public X509CertSelector wrap(X509CertSelector selector,
-                                 X500Principal certSubject,
-                                 String ldapDN)
-        throws IOException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public X509CRLSelector wrap(X509CRLSelector selector,
-                                Collection<X500Principal> certIssuers,
-                                String ldapDN)
-        throws IOException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public boolean isCausedByNetworkIssue(CertStoreException e) {
-        Throwable t = e.getCause();
-        return (t != null && t instanceof IOException);
-    }
-}
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -46,6 +46,9 @@
 import java.security.cert.CRL;
 import java.security.cert.X509Certificate;
 import java.security.cert.CertificateException;
+import java.security.cert.URICertStoreParameters;
+
+
 import java.text.Collator;
 import java.text.MessageFormat;
 import java.util.*;
@@ -69,7 +72,7 @@
 import sun.security.pkcs10.PKCS10;
 import sun.security.pkcs10.PKCS10Attribute;
 import sun.security.provider.X509Factory;
-import sun.security.provider.certpath.CertStoreHelper;
+import sun.security.provider.certpath.ssl.SSLServerCertStore;
 import sun.security.util.Password;
 import javax.crypto.KeyGenerator;
 import javax.crypto.SecretKey;
@@ -2208,14 +2211,10 @@
                 }
             }
         } else {    // must be LDAP, and uri is not null
-            // Lazily load LDAPCertStoreHelper if present
-            CertStoreHelper helper = CertStoreHelper.getInstance("LDAP");
-            String path = uri.getPath();
-            if (path.charAt(0) == '/') path = path.substring(1);
-            CertStore s = helper.getCertStore(uri);
-            X509CRLSelector sel =
-                    helper.wrap(new X509CRLSelector(), null, path);
-            return s.getCRLs(sel);
+            URICertStoreParameters params =
+                new URICertStoreParameters(uri);
+            CertStore s = CertStore.getInstance("LDAP", params);
+            return s.getCRLs(new X509CRLSelector());
         }
     }
 
@@ -2463,9 +2462,7 @@
                 out.println(rb.getString("Not.a.signed.jar.file"));
             }
         } else if (sslserver != null) {
-            // Lazily load SSLCertStoreHelper if present
-            CertStoreHelper helper = CertStoreHelper.getInstance("SSLServer");
-            CertStore cs = helper.getCertStore(new URI("https://" + sslserver));
+            CertStore cs = SSLServerCertStore.getInstance(new URI("https://" + sslserver));
             Collection<? extends Certificate> chain;
             try {
                 chain = cs.getCertificates(null);
--- a/jdk/src/java.base/share/conf/security/java.security	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/conf/security/java.security	Wed Jul 05 20:33:50 2017 +0200
@@ -78,6 +78,7 @@
 security.provider.tbd=com.sun.security.sasl.Provider
 security.provider.tbd=org.jcp.xml.dsig.internal.dom.XMLDSigRI
 security.provider.tbd=sun.security.smartcardio.SunPCSC
+security.provider.tbd=sun.security.provider.certpath.ldap.JdkLDAP
 #ifdef windows
 security.provider.tbd=sun.security.mscapi.SunMSCAPI
 #endif
@@ -156,7 +157,8 @@
 
 #
 # Class to instantiate as the system Policy. This is the name of the class
-# that will be used as the Policy object.
+# that will be used as the Policy object. The system class loader is used to
+# locate this class.
 #
 policy.provider=sun.security.provider.PolicyFile
 
--- a/jdk/src/java.base/share/native/libjli/java.h	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/native/libjli/java.h	Wed Jul 05 20:33:50 2017 +0200
@@ -194,7 +194,7 @@
  * For MacOSX and Windows/Unix compatibility we require these
  * entry points, some of them may be stubbed out on Windows/Unixes.
  */
-void     PostJVMInit(JNIEnv *env, jstring mainClass, JavaVM *vm);
+void     PostJVMInit(JNIEnv *env, jclass mainClass, JavaVM *vm);
 void     ShowSplashScreen();
 void     RegisterThread();
 /*
--- a/jdk/src/java.base/share/native/libzip/zip_util.c	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/share/native/libzip/zip_util.c	Wed Jul 05 20:33:50 2017 +0200
@@ -1206,7 +1206,7 @@
         }
 
         /* Slash is already there? */
-        if (name[ulen-1] == '/') {
+        if (ulen > 0 && name[ulen - 1] == '/') {
             break;
         }
 
--- a/jdk/src/java.base/unix/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/unix/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/jdk/src/java.base/unix/native/libjli/java_md_solinux.c	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/unix/native/libjli/java_md_solinux.c	Wed Jul 05 20:33:50 2017 +0200
@@ -938,7 +938,7 @@
 }
 
 void
-PostJVMInit(JNIEnv *env, jstring mainClass, JavaVM *vm)
+PostJVMInit(JNIEnv *env, jclass mainClass, JavaVM *vm)
 {
     // stubbed out for windows and *nixes.
 }
--- a/jdk/src/java.base/windows/native/libjli/java_md.c	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.base/windows/native/libjli/java_md.c	Wed Jul 05 20:33:50 2017 +0200
@@ -970,7 +970,7 @@
 }
 
 void
-PostJVMInit(JNIEnv *env, jstring mainClass, JavaVM *vm)
+PostJVMInit(JNIEnv *env, jclass mainClass, JavaVM *vm)
 {
     // stubbed out for windows and *nixes.
 }
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/Application.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/Application.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -25,14 +25,18 @@
 
 package com.apple.eawt;
 
-import java.awt.*;
-import java.awt.peer.*;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.PopupMenu;
+import java.awt.Toolkit;
+import java.awt.Window;
 import java.beans.Beans;
 
 import javax.swing.JMenuBar;
 
-import sun.lwawt.*;
-import sun.lwawt.macosx.*;
+import sun.awt.AWTAccessor;
+import sun.lwawt.LWWindowPeer;
+import sun.lwawt.macosx.CPlatformWindow;
 
 /**
  * The <code>Application</code> class allows you to integrate your Java application with the native Mac OS X environment.
@@ -385,10 +389,8 @@
      *
      * @since Java for Mac OS X 10.7 Update 1
      */
-    @SuppressWarnings("deprecation")
     public void requestToggleFullScreen(final Window window) {
-        final ComponentPeer peer = window.getPeer();
-
+        final Object peer = AWTAccessor.getComponentAccessor().getPeer(window);
         if (!(peer instanceof LWWindowPeer)) return;
         Object platformWindow = ((LWWindowPeer) peer).getPlatformWindow();
         if (!(platformWindow instanceof CPlatformWindow)) return;
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppDockIconHandler.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppDockIconHandler.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -28,6 +28,7 @@
 import java.awt.*;
 import java.lang.reflect.*;
 
+import sun.awt.AWTAccessor;
 import sun.lwawt.macosx.*;
 import sun.lwawt.macosx.CImage.Creator;
 
@@ -41,7 +42,6 @@
 
     _AppDockIconHandler() { }
 
-    @SuppressWarnings("deprecation")
     public void setDockMenu(final PopupMenu menu) {
         fDockMenu = menu;
 
@@ -61,8 +61,8 @@
 
         // instantiate the menu peer and set the native fDockMenu ivar
         menu.addNotify();
-        final long nsMenuPtr = ((CMenu)fDockMenu.getPeer()).getNativeMenu();
-        nativeSetDockMenu(nsMenuPtr);
+        CMenu peer = AWTAccessor.getMenuComponentAccessor().getPeer(fDockMenu);
+        nativeSetDockMenu(peer.getNativeMenu());
     }
 
     public PopupMenu getDockMenu() {
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppMenuBarHandler.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppMenuBarHandler.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -32,6 +32,7 @@
 import javax.swing.plaf.MenuBarUI;
 
 import com.apple.laf.ScreenMenuBar;
+import sun.awt.AWTAccessor;
 import sun.lwawt.macosx.CMenuBar;
 
 import com.apple.laf.AquaMenuBarUI;
@@ -49,7 +50,10 @@
     }
 
     // callback from the native delegate -init function
-    private static void initMenuStates(final boolean aboutMenuItemVisible, final boolean aboutMenuItemEnabled, final boolean prefsMenuItemVisible, final boolean prefsMenuItemEnabled) {
+    private static void initMenuStates(final boolean aboutMenuItemVisible,
+                                       final boolean aboutMenuItemEnabled,
+                                       final boolean prefsMenuItemVisible,
+                                       final boolean prefsMenuItemEnabled) {
         synchronized (instance) {
             instance.aboutMenuItemVisible = aboutMenuItemVisible;
             instance.aboutMenuItemEnabled = aboutMenuItemEnabled;
@@ -92,7 +96,6 @@
         return (frame.getExtendedState() & Frame.ICONIFIED) != 0;
     }
 
-    @SuppressWarnings("deprecation")
     static void installDefaultMenuBar(final JMenuBar menuBar) {
         if (menuBar == null) {
             // intentionally clearing the default menu
@@ -114,7 +117,7 @@
         }
 
         screenMenuBar.addNotify();
-        final MenuComponentPeer peer = screenMenuBar.getPeer();
+        final Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(screenMenuBar);
         if (!(peer instanceof CMenuBar)) {
             // such a thing should not be possible
             throw new IllegalStateException("Unable to determine native menu bar from provided JMenuBar");
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Wed Jul 05 20:33:50 2017 +0200
@@ -152,20 +152,6 @@
         }
 
         @Override
-        public void focusGained(final FocusEvent e) {
-            if (arrowButton != null) {
-                arrowButton.repaint();
-            }
-        }
-
-        @Override
-        public void focusLost(final FocusEvent e) {
-            if (arrowButton != null) {
-                arrowButton.repaint();
-            }
-        }
-
-        @Override
         public void changedUpdate(final DocumentEvent e) {
             editorTextChanged();
         }
@@ -252,6 +238,16 @@
      */
     protected FocusListener createFocusListener() {
         return new BasicComboBoxUI.FocusHandler() {
+            @Override
+            public void focusGained(FocusEvent e) {
+                super.focusGained(e);
+
+                if (arrowButton != null) {
+                    arrowButton.repaint();
+                }
+            }
+
+            @Override
             public void focusLost(final FocusEvent e) {
                 hasFocus = false;
                 if (!e.isTemporary()) {
@@ -264,6 +260,10 @@
                 if (ac != null) {
                     ac.firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, AccessibleState.FOCUSED, null);
                 }
+
+                if (arrowButton != null) {
+                    arrowButton.repaint();
+                }
             }
         };
     }
@@ -438,6 +438,7 @@
             if (editor != null) {
                 final Rectangle editorRect = rectangleForCurrentValue();
                 editorRect.width += 4;
+                editorRect.height += 1;
                 editor.setBounds(editorRect);
             }
         }
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldBorder.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldBorder.java	Wed Jul 05 20:33:50 2017 +0200
@@ -124,7 +124,7 @@
 
     public Insets getBorderInsets(final Component c) {
         if (!(c instanceof JTextComponent) || c.isOpaque()) return new InsetsUIResource(3, 7, 3, 7);
-        return new InsetsUIResource(6, 7, 6, 7);
+        return new InsetsUIResource(5, 5, 5, 5);
     }
 
     protected static State getStateFor(final JTextComponent jc) {
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenu.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenu.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -27,11 +27,11 @@
 
 import java.awt.*;
 import java.awt.event.*;
-import java.awt.peer.MenuComponentPeer;
 import java.util.Hashtable;
 
 import javax.swing.*;
 
+import sun.awt.AWTAccessor;
 import sun.awt.SunToolkit;
 import sun.lwawt.LWToolkit;
 import sun.lwawt.macosx.*;
@@ -212,24 +212,36 @@
                 // Send a mouseExited to the previously hilited item, if it wasn't 0.
                 if (target != fLastMouseEventTarget) {
                     if (fLastMouseEventTarget != null) {
-                        LWToolkit.postEvent(new MouseEvent(fLastMouseEventTarget, MouseEvent.MOUSE_EXITED, when, modifiers, x - fLastTargetRect.x, y - fLastTargetRect.y, 0, false));
+                        LWToolkit.postEvent(
+                                new MouseEvent(fLastMouseEventTarget,
+                                               MouseEvent.MOUSE_EXITED, when,
+                                               modifiers, x - fLastTargetRect.x,
+                                               y - fLastTargetRect.y, 0,
+                                               false));
                     }
-                    // Send a mouseEntered to the current hilited item, if it wasn't 0.
+                    // Send a mouseEntered to the current hilited item, if it
+                    // wasn't 0.
                     if (target != null) {
-                        LWToolkit.postEvent(new MouseEvent(target, MouseEvent.MOUSE_ENTERED, when, modifiers, x - targetRect.x, y - targetRect.y, 0, false));
+                        LWToolkit.postEvent(
+                                new MouseEvent(target, MouseEvent.MOUSE_ENTERED,
+                                               when, modifiers,
+                                               x - targetRect.x,
+                                               y - targetRect.y, 0, false));
                     }
                     fLastMouseEventTarget = target;
                     fLastTargetRect = targetRect;
                 }
                 // Post a mouse event to the current item.
                 if (target == null) return;
-                LWToolkit.postEvent(new MouseEvent(target, kind, when, modifiers, x - targetRect.x, y - targetRect.y, 0, false));
+                LWToolkit.postEvent(
+                        new MouseEvent(target, kind, when, modifiers,
+                                       x - targetRect.x, y - targetRect.y, 0,
+                                       false));
             }
         });
     }
 
     @Override
-    @SuppressWarnings("deprecation")
     public void addNotify() {
         synchronized (getTreeLock()) {
             super.addNotify();
@@ -248,7 +260,8 @@
                 if (tooltipText != null) {
                     setToolTipText(tooltipText);
                 }
-                final MenuComponentPeer peer = getPeer();
+                final Object peer = AWTAccessor.getMenuComponentAccessor()
+                                               .getPeer(this);
                 if (peer instanceof CMenu) {
                     final CMenu menu = (CMenu) peer;
                     final long nativeMenu = menu.getNativeMenu();
@@ -355,9 +368,8 @@
     public void setIndeterminate(boolean indeterminate) { }
 
     @Override
-    @SuppressWarnings("deprecation")
     public void setToolTipText(final String text) {
-        final MenuComponentPeer peer = getPeer();
+        Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(this);
         if (!(peer instanceof CMenuItem)) return;
 
         final CMenuItem cmi = (CMenuItem)peer;
@@ -365,9 +377,8 @@
     }
 
     @Override
-    @SuppressWarnings("deprecation")
     public void setIcon(final Icon i) {
-        final MenuComponentPeer peer = getPeer();
+        Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(this);
         if (!(peer instanceof CMenuItem)) return;
 
         final CMenuItem cmi = (CMenuItem)peer;
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenuBar.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenuBar.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -25,19 +25,21 @@
 
 package com.apple.laf;
 
-import sun.awt.AWTAccessor;
 import sun.lwawt.macosx.CMenuBar;
 
 import java.awt.*;
 import java.awt.event.*;
-import java.lang.reflect.*;
-import java.security.*;
 import java.util.*;
 
 import javax.swing.*;
 
+import static sun.awt.AWTAccessor.*;
+
 @SuppressWarnings("serial") // JDK implementation class
-public class ScreenMenuBar extends MenuBar implements ContainerListener, ScreenMenuPropertyHandler, ComponentListener {
+public class ScreenMenuBar extends MenuBar
+        implements ContainerListener, ScreenMenuPropertyHandler,
+                   ComponentListener {
+
     static boolean sJMenuBarHasHelpMenus = false; //$ could check by calling getHelpMenu in a try block
 
     JMenuBar fSwingBar;
@@ -246,22 +248,23 @@
             fSubmenus.remove(menu);
     }
 
-    @SuppressWarnings("deprecation")
     public Menu add(final Menu m, final int index) {
         synchronized (getTreeLock()) {
             if (m.getParent() != null) {
                 m.getParent().remove(m);
             }
 
-            final Vector<Menu> menus = AWTAccessor.getMenuBarAccessor().getMenus(this);
+            final Vector<Menu> menus = getMenuBarAccessor().getMenus(this);
             menus.insertElementAt(m, index);
-            AWTAccessor.getMenuComponentAccessor().setParent(m, this);
+            final MenuComponentAccessor acc = getMenuComponentAccessor();
+            acc.setParent(m, this);
 
-            final CMenuBar peer = (CMenuBar)getPeer();
+            final CMenuBar peer = acc.getPeer(this);
             if (peer == null) return m;
 
             peer.setNextInsertionIndex(index);
-            if (m.getPeer() == null) {
+            final CMenuBar mPeer = acc.getPeer(m);
+            if (mPeer == null) {
                 m.addNotify();
             }
 
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenuItem.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenuItem.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -27,15 +27,18 @@
 
 import java.awt.*;
 import java.awt.event.*;
-import java.awt.peer.MenuComponentPeer;
 
 import javax.swing.*;
 import javax.swing.plaf.ComponentUI;
 
+import sun.awt.AWTAccessor;
 import sun.lwawt.macosx.CMenuItem;
 
 @SuppressWarnings("serial") // JDK implementation class
-final class ScreenMenuItem extends MenuItem implements ActionListener, ComponentListener, ScreenMenuPropertyHandler {
+final class ScreenMenuItem extends MenuItem
+        implements ActionListener, ComponentListener,
+                   ScreenMenuPropertyHandler {
+
     ScreenMenuPropertyListener fListener;
     JMenuItem fMenuItem;
 
@@ -97,9 +100,8 @@
         fMenuItem.removeComponentListener(this);
     }
 
-    @SuppressWarnings("deprecation")
     static void syncLabelAndKS(MenuItem menuItem, String label, KeyStroke ks) {
-        final MenuComponentPeer peer = menuItem.getPeer();
+        Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(menuItem);
         if (!(peer instanceof CMenuItem)) {
             //Is it possible?
             return;
@@ -166,18 +168,16 @@
         }
     }
 
-    @SuppressWarnings("deprecation")
     public void setToolTipText(final String text) {
-        final MenuComponentPeer peer = getPeer();
+        Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(this);
         if (!(peer instanceof CMenuItem)) return;
 
         final CMenuItem cmi = (CMenuItem)peer;
         cmi.setToolTipText(text);
     }
 
-    @SuppressWarnings("deprecation")
     public void setIcon(final Icon i) {
-        final MenuComponentPeer peer = getPeer();
+        Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(this);
         if (!(peer instanceof CMenuItem)) return;
 
         final CMenuItem cmi = (CMenuItem)peer;
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenuItemCheckbox.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenuItemCheckbox.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -27,17 +27,20 @@
 
 import java.awt.*;
 import java.awt.event.*;
-import java.awt.peer.MenuComponentPeer;
 
 import javax.swing.*;
 import javax.swing.plaf.ButtonUI;
 
 import com.apple.laf.AquaMenuItemUI.IndeterminateListener;
 
+import sun.awt.AWTAccessor;
 import sun.lwawt.macosx.*;
 
 @SuppressWarnings("serial") // JDK implementation class
-final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionListener, ComponentListener, ScreenMenuPropertyHandler, ItemListener {
+final class ScreenMenuItemCheckbox extends CheckboxMenuItem
+        implements ActionListener, ComponentListener, ScreenMenuPropertyHandler,
+                   ItemListener {
+
     JMenuItem fMenuItem;
     MenuContainer fParent;
 
@@ -57,12 +60,12 @@
     }
 
     ScreenMenuPropertyListener fPropertyListener;
-    @SuppressWarnings("deprecation")
+
     public void addNotify() {
         super.addNotify();
 
         // Avoid the Auto toggle behavior of AWT CheckBoxMenuItem
-        CCheckboxMenuItem ccb = (CCheckboxMenuItem) getPeer();
+        CCheckboxMenuItem ccb = AWTAccessor.getMenuComponentAccessor().getPeer(this);
         ccb.setAutoToggle(false);
 
         fMenuItem.addComponentListener(this);
@@ -155,17 +158,15 @@
         setVisible(false);
     }
 
-    @SuppressWarnings("deprecation")
     public void setToolTipText(final String text) {
-        final MenuComponentPeer peer = getPeer();
+        Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(this);
         if (!(peer instanceof CMenuItem)) return;
 
         ((CMenuItem)peer).setToolTipText(text);
     }
 
-    @SuppressWarnings("deprecation")
     public void setIcon(final Icon i) {
-        final MenuComponentPeer peer = getPeer();
+        Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(this);
         if (!(peer instanceof CMenuItem)) return;
 
         final CMenuItem cmi = (CMenuItem)peer;
@@ -208,9 +209,8 @@
             }
         }
 
-    @SuppressWarnings("deprecation")
     public void setIndeterminate(final boolean indeterminate) {
-        final MenuComponentPeer peer = getPeer();
+        Object peer = AWTAccessor.getMenuComponentAccessor().getPeer(this);
         if (peer instanceof CCheckboxMenuItem) {
             ((CCheckboxMenuItem)peer).setIsIndeterminate(indeterminate);
         }
--- a/jdk/src/java.desktop/macosx/classes/sun/awt/CGraphicsConfig.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/sun/awt/CGraphicsConfig.java	Wed Jul 05 20:33:50 2017 +0200
@@ -72,7 +72,8 @@
 
     @Override
     public AffineTransform getDefaultTransform() {
-        return new AffineTransform();
+        double scaleFactor = device.getScaleFactor();
+        return AffineTransform.getScaleInstance(scaleFactor, scaleFactor);
     }
 
     @Override
--- a/jdk/src/java.desktop/macosx/classes/sun/awt/CGraphicsDevice.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/sun/awt/CGraphicsDevice.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -206,17 +206,15 @@
         return true;
     }
 
-    @SuppressWarnings("deprecation")
     private static void enterFullScreenExclusive(Window w) {
-        FullScreenCapable peer = (FullScreenCapable)w.getPeer();
+        FullScreenCapable peer = AWTAccessor.getComponentAccessor().getPeer(w);
         if (peer != null) {
             peer.enterFullScreenMode();
         }
     }
 
-    @SuppressWarnings("deprecation")
     private static void exitFullScreenExclusive(Window w) {
-        FullScreenCapable peer = (FullScreenCapable)w.getPeer();
+        FullScreenCapable peer = AWTAccessor.getComponentAccessor().getPeer(w);
         if (peer != null) {
             peer.exitFullScreenMode();
         }
--- a/jdk/src/java.desktop/macosx/classes/sun/java2d/opengl/CGLVolatileSurfaceManager.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/sun/java2d/opengl/CGLVolatileSurfaceManager.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -33,13 +33,14 @@
 import java.awt.image.ColorModel;
 import java.awt.peer.ComponentPeer;
 
+import sun.awt.AWTAccessor;
+import sun.awt.AWTAccessor.ComponentAccessor;
 import sun.awt.image.SunVolatileImage;
 import sun.awt.image.VolatileSurfaceManager;
 import sun.java2d.BackBufferCapsProvider;
 import sun.java2d.SurfaceData;
 import static sun.java2d.opengl.OGLContext.OGLContextCaps.*;
 import sun.java2d.pipe.hw.ExtendedBufferCapabilities;
-import static sun.java2d.pipe.hw.AccelSurface.*;
 import static sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.*;
 
 public class CGLVolatileSurfaceManager extends VolatileSurfaceManager {
@@ -74,11 +75,11 @@
      * Create a pbuffer-based SurfaceData object (or init the backbuffer
      * of an existing window if this is a double buffered GraphicsConfig)
      */
-    @SuppressWarnings("deprecation")
     protected SurfaceData initAcceleratedSurface() {
         SurfaceData sData = null;
         Component comp = vImg.getComponent();
-        final ComponentPeer peer = (comp != null) ? comp.getPeer() : null;
+        final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
+        final ComponentPeer peer = (comp != null) ? acc.getPeer(comp) : null;
 
         try {
             boolean createVSynced = false;
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWComponentPeer.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWComponentPeer.java	Wed Jul 05 20:33:50 2017 +0200
@@ -930,8 +930,8 @@
                     return false;
                 }
                 final LWWindowPeer parentPeer =
-                        (LWWindowPeer) AWTAccessor.getComponentAccessor()
-                                                  .getPeer(parentWindow);
+                        AWTAccessor.getComponentAccessor()
+                                   .getPeer(parentWindow);
                 if (parentPeer == null) {
                     focusLog.fine("request rejected, parentPeer is null");
                     LWKeyboardFocusManagerPeer.removeLastFocusRequest(getTarget());
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java	Wed Jul 05 20:33:50 2017 +0200
@@ -33,6 +33,7 @@
 import javax.swing.*;
 
 import sun.awt.*;
+import sun.awt.AWTAccessor.ComponentAccessor;
 import sun.java2d.*;
 import sun.java2d.loops.Blit;
 import sun.java2d.loops.CompositeType;
@@ -505,7 +506,7 @@
     @Override
     public void repositionSecurityWarning() {
         if (warningWindow != null) {
-            AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor();
+            ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor();
             Window target = getTarget();
             int x = compAccessor.getX(target);
             int y = compAccessor.getY(target);
@@ -563,8 +564,7 @@
     public void blockWindows(List<Window> windows) {
         //TODO: LWX will probably need some collectJavaToplevels to speed this up
         for (Window w : windows) {
-            WindowPeer wp =
-                    (WindowPeer) AWTAccessor.getComponentAccessor().getPeer(w);
+            WindowPeer wp = AWTAccessor.getComponentAccessor().getPeer(w);
             if (wp != null) {
                 wp.setModalBlocked((Dialog)getTarget(), true);
             }
@@ -1247,7 +1247,8 @@
     private boolean isOneOfOwnersOf(LWWindowPeer peer) {
         Window owner = (peer != null ? peer.getTarget().getOwner() : null);
         while (owner != null) {
-            if ((LWWindowPeer)owner.getPeer() == this) {
+            final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
+            if (acc.getPeer(owner) == this) {
                 return true;
             }
             owner = owner.getOwner();
@@ -1321,8 +1322,8 @@
         while (owner != null && !(owner instanceof Frame || owner instanceof Dialog)) {
             owner = owner.getOwner();
         }
-        return owner == null ? null :
-               (LWWindowPeer) AWTAccessor.getComponentAccessor().getPeer(owner);
+        return owner == null ? null : AWTAccessor.getComponentAccessor()
+                                                 .getPeer(owner);
     }
 
     /**
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -39,6 +39,7 @@
 import java.util.Map;
 import java.util.concurrent.Callable;
 
+import sun.awt.AWTAccessor;
 import sun.awt.dnd.*;
 import sun.lwawt.LWComponentPeer;
 import sun.lwawt.LWWindowPeer;
@@ -88,7 +89,6 @@
         super.startDrag(dsc, cursor, dragImage, dragImageOffset);
     }
 
-    @SuppressWarnings("deprecation")
     protected void startDrag(Transferable transferable, long[] formats, Map<Long, DataFlavor> formatMap) {
         DragGestureEvent trigger = getTrigger();
         InputEvent         triggerEvent = trigger.getTriggerEvent();
@@ -135,7 +135,9 @@
 
         try {
             //It sure will be LWComponentPeer instance as rootComponent is a Window
-            PlatformWindow platformWindow = ((LWComponentPeer)rootComponent.getPeer()).getPlatformWindow();
+            LWComponentPeer<?, ?> peer = AWTAccessor.getComponentAccessor()
+                                                    .getPeer(rootComponent);
+            PlatformWindow platformWindow = peer.getPlatformWindow();
             long nativeViewPtr = CPlatformWindow.getNativeViewPtr(platformWindow);
             if (nativeViewPtr == 0L) throw new InvalidDnDOperationException("Unsupported platform window implementation");
 
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -30,6 +30,7 @@
 import java.awt.Point;
 import java.awt.Toolkit;
 
+import sun.awt.AWTAccessor;
 import sun.awt.EmbeddedFrame;
 import sun.lwawt.LWWindowPeer;
 
@@ -46,9 +47,8 @@
         show();
     }
 
-    @SuppressWarnings("deprecation")
     public void addNotify() {
-        if (getPeer() == null) {
+        if (!isDisplayable()) {
             LWCToolkit toolkit = (LWCToolkit)Toolkit.getDefaultToolkit();
             LWWindowPeer peer = toolkit.createEmbeddedFrame(this);
             setPeer(peer);
@@ -61,10 +61,9 @@
 
     public void unregisterAccelerator(AWTKeyStroke stroke) {}
 
-    @SuppressWarnings("deprecation")
     protected long getLayerPtr() {
-        LWWindowPeer peer = (LWWindowPeer)getPeer();
-        return peer.getLayerPtr();
+        return AWTAccessor.getComponentAccessor().<LWWindowPeer>getPeer(this)
+                          .getLayerPtr();
     }
 
     // -----------------------------------------------------------------------
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CImage.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CImage.java	Wed Jul 05 20:33:50 2017 +0200
@@ -138,17 +138,6 @@
             return ((DataBufferInt)bimg.getRaster().getDataBuffer()).getData();
         }
 
-        public CImage createFromImageImmediately(final Image image) {
-            int[]  buffer = imageToArray(image, false);
-
-            if (buffer == null) {
-                return null;
-            }
-
-            return new CImage(nativeCreateNSImageFromArray(buffer, image.getWidth(null),
-                                                           image.getHeight(null)));
-        }
-
         public byte[] getPlatformImageBytes(final Image image) {
             int[] buffer = imageToArray(image, false);
 
@@ -168,20 +157,33 @@
 
         // This is used to create a CImage from a Image
         public CImage createFromImage(final Image image) {
+            return createFromImage(image, true);
+        }
+
+        public CImage createFromImageImmediately(final Image image) {
+            return createFromImage(image, false);
+        }
+
+        // This is used to create a CImage from a Image
+        private CImage createFromImage(final Image image, final boolean prepareImage) {
             if (image instanceof MultiResolutionImage) {
                 List<Image> resolutionVariants
                         = ((MultiResolutionImage) image).getResolutionVariants();
-                return createFromImages(resolutionVariants);
+                return createFromImages(resolutionVariants, prepareImage);
             }
 
-            int[] buffer = imageToArray(image, true);
+            int[] buffer = imageToArray(image, prepareImage);
             if (buffer == null) {
                 return null;
             }
             return new CImage(nativeCreateNSImageFromArray(buffer, image.getWidth(null), image.getHeight(null)));
         }
 
-        public CImage createFromImages(List<Image> images) {
+        public CImage createFromImages(final List<Image> images) {
+            return createFromImages(images, true);
+        }
+
+        private CImage createFromImages(final List<Image> images, final boolean prepareImage) {
             if (images == null || images.isEmpty()) {
                 return null;
             }
@@ -194,8 +196,8 @@
 
             num = 0;
 
-            for (Image img : images) {
-                buffers[num] = imageToArray(img, true);
+            for (final Image img : images) {
+                buffers[num] = imageToArray(img, prepareImage);
                 if (buffers[num] == null) {
                     // Unable to process the image
                     continue;
@@ -210,9 +212,9 @@
             }
 
             return new CImage(nativeCreateNSImageFromArrays(
-                        Arrays.copyOf(buffers, num),
-                        Arrays.copyOf(w, num),
-                        Arrays.copyOf(h, num)));
+                    Arrays.copyOf(buffers, num),
+                    Arrays.copyOf(w, num),
+                    Arrays.copyOf(h, num)));
         }
 
         static int getSelectorAsInt(final String fromString) {
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -38,9 +38,12 @@
 import java.text.*;
 import javax.swing.text.JTextComponent;
 
+import sun.awt.AWTAccessor;
 import sun.awt.im.InputMethodAdapter;
 import sun.lwawt.*;
 
+import static sun.awt.AWTAccessor.ComponentAccessor;
+
 public class CInputMethod extends InputMethodAdapter {
     private InputMethodContext fIMContext;
     private Component fAwtFocussedComponent;
@@ -385,12 +388,11 @@
 
     // java.awt.Toolkit#getNativeContainer() is not available
     //    from this package
-    @SuppressWarnings("deprecation")
     private LWComponentPeer<?, ?> getNearestNativePeer(Component comp) {
         if (comp==null)
             return null;
-
-        ComponentPeer peer = comp.getPeer();
+        final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
+        ComponentPeer peer = acc.getPeer(comp);
         if (peer==null)
             return null;
 
@@ -398,7 +400,7 @@
             comp = comp.getParent();
             if (comp==null)
                 return null;
-            peer = comp.getPeer();
+            peer = acc.getPeer(comp);
             if (peer==null)
                 return null;
         }
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuBar.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuBar.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -29,6 +29,8 @@
 import java.awt.MenuBar;
 import java.awt.peer.MenuBarPeer;
 
+import sun.awt.AWTAccessor;
+
 public class CMenuBar extends CMenuComponent implements MenuBarPeer {
 
     private int nextInsertionIndex = -1;
@@ -43,9 +45,8 @@
     }
 
     @Override
-    @SuppressWarnings("deprecation")
     public void addHelpMenu(Menu m) {
-        CMenu cMenu = (CMenu)m.getPeer();
+        CMenu cMenu = AWTAccessor.getMenuComponentAccessor().getPeer(m);
         nativeSetHelpMenu(getModel(), cMenu.getModel());
     }
 
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -31,12 +31,11 @@
 import java.awt.peer.WindowPeer;
 import java.beans.*;
 import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-import java.util.Objects;
 
 import javax.swing.*;
 
 import sun.awt.*;
+import sun.awt.AWTAccessor.ComponentAccessor;
 import sun.java2d.SurfaceData;
 import sun.java2d.opengl.CGLSurfaceData;
 import sun.lwawt.*;
@@ -193,8 +192,9 @@
         @SuppressWarnings("deprecation")
         public CPlatformWindow convertJComponentToTarget(final JRootPane p) {
             Component root = SwingUtilities.getRoot(p);
-            if (root == null || (LWWindowPeer)root.getPeer() == null) return null;
-            return (CPlatformWindow)((LWWindowPeer)root.getPeer()).getPlatformWindow();
+            final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
+            if (root == null || acc.getPeer(root) == null) return null;
+            return (CPlatformWindow)((LWWindowPeer)acc.getPeer(root)).getPlatformWindow();
         }
     };
 
@@ -523,15 +523,15 @@
     }
 
     @Override // PlatformWindow
-    @SuppressWarnings("deprecation")
     public void setVisible(boolean visible) {
         final long nsWindowPtr = getNSWindowPtr();
 
         // Process parent-child relationship when hiding
+        final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
         if (!visible) {
             // Unparent my children
             for (Window w : target.getOwnedWindows()) {
-                WindowPeer p = (WindowPeer)w.getPeer();
+                WindowPeer p = acc.getPeer(w);
                 if (p instanceof LWWindowPeer) {
                     CPlatformWindow pw = (CPlatformWindow)((LWWindowPeer)p).getPlatformWindow();
                     if (pw != null && pw.isVisible()) {
@@ -627,7 +627,7 @@
 
             // Add my own children to myself
             for (Window w : target.getOwnedWindows()) {
-                WindowPeer p = (WindowPeer)w.getPeer();
+                final Object p = acc.getPeer(w);
                 if (p instanceof LWWindowPeer) {
                     CPlatformWindow pw = (CPlatformWindow)((LWWindowPeer)p).getPlatformWindow();
                     if (pw != null && pw.isVisible()) {
@@ -679,13 +679,13 @@
     }
 
     @Override  // PlatformWindow
-    @SuppressWarnings("deprecation")
     public void toFront() {
         final long nsWindowPtr = getNSWindowPtr();
         LWCToolkit lwcToolkit = (LWCToolkit) Toolkit.getDefaultToolkit();
         Window w = DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();
-        if( w != null && w.getPeer() != null
-                && ((LWWindowPeer)w.getPeer()).getPeerType() == LWWindowPeer.PeerType.EMBEDDED_FRAME
+        final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
+        if( w != null && acc.getPeer(w) != null
+                && ((LWWindowPeer)acc.getPeer(w)).getPeerType() == LWWindowPeer.PeerType.EMBEDDED_FRAME
                 && !lwcToolkit.isApplicationActive()) {
             lwcToolkit.activateApplicationIgnoringOtherApps();
         }
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java	Wed Jul 05 20:33:50 2017 +0200
@@ -36,6 +36,10 @@
 import javax.print.*;
 import javax.print.attribute.PrintRequestAttributeSet;
 import javax.print.attribute.HashPrintRequestAttributeSet;
+import javax.print.attribute.standard.Media;
+import javax.print.attribute.standard.MediaPrintableArea;
+import javax.print.attribute.standard.MediaSize;
+import javax.print.attribute.standard.MediaSizeName;
 import javax.print.attribute.standard.PageRanges;
 
 import sun.java2d.*;
@@ -745,4 +749,34 @@
     protected void startPage(PageFormat arg0, Printable arg1, int arg2, boolean arg3) throws PrinterException {
         // TODO Auto-generated method stub
     }
-}
+
+    @Override
+    protected MediaSize getMediaSize(Media media, PrintService service,
+            PageFormat page) {
+        if (media == null || !(media instanceof MediaSizeName)) {
+            return getDefaultMediaSize(page);
+        }
+        MediaSize size = MediaSize.getMediaSizeForName((MediaSizeName) media);
+        return size != null ? size : getDefaultMediaSize(page);
+    }
+
+    private MediaSize getDefaultMediaSize(PageFormat page){
+            final int inch = 72;
+            Paper paper = page.getPaper();
+            float width = (float) (paper.getWidth() / inch);
+            float height = (float) (paper.getHeight() / inch);
+            return new MediaSize(width, height, MediaSize.INCH);
+    }
+
+    @Override
+    protected MediaPrintableArea getDefaultPrintableArea(PageFormat page, double w, double h) {
+        final float dpi = 72.0f;
+        Paper paper = page.getPaper();
+        return new MediaPrintableArea(
+                (float) (paper.getImageableX() / dpi),
+                (float) (paper.getImageableY() / dpi),
+                (float) (paper.getImageableWidth() / dpi),
+                (float) (paper.getImageableHeight() / dpi),
+                MediaPrintableArea.INCH);
+    }
+}
\ No newline at end of file
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -37,6 +37,8 @@
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 
+import static sun.awt.AWTAccessor.*;
+
 public class CTrayIcon extends CFRetainedResource implements TrayIconPeer {
     private TrayIcon target;
     private PopupMenu popup;
@@ -68,15 +70,15 @@
         updateImage();
     }
 
-    @SuppressWarnings("deprecation")
     private CPopupMenu checkAndCreatePopupPeer() {
         CPopupMenu menuPeer = null;
         if (popup != null) {
             try {
-                menuPeer = (CPopupMenu)popup.getPeer();
+                final MenuComponentAccessor acc = getMenuComponentAccessor();
+                menuPeer = acc.getPeer(popup);
                 if (menuPeer == null) {
                     popup.addNotify();
-                    menuPeer = (CPopupMenu)popup.getPeer();
+                    menuPeer = acc.getPeer(popup);
                 }
             } catch (Exception e) {
                 e.printStackTrace();
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -30,6 +30,7 @@
 import java.awt.Toolkit;
 import java.lang.reflect.InvocationTargetException;
 
+import sun.awt.AWTAccessor;
 import sun.awt.EmbeddedFrame;
 import sun.lwawt.LWWindowPeer;
 
@@ -48,10 +49,9 @@
         this.nsViewPtr = nsViewPtr;
     }
 
-    @SuppressWarnings("deprecation")
     @Override
     public void addNotify() {
-        if (getPeer() == null) {
+        if (!isDisplayable()) {
             LWCToolkit toolkit = (LWCToolkit) Toolkit.getDefaultToolkit();
             setPeer(toolkit.createEmbeddedFrame(this));
         }
@@ -78,11 +78,12 @@
      * Synthetic event delivery for focus management
      */
     @Override
-    @SuppressWarnings("deprecation")
     public void synthesizeWindowActivation(boolean activated) {
         if (isActive != activated) {
             isActive = activated;
-            ((LWWindowPeer)getPeer()).notifyActivation(activated, null);
+            final LWWindowPeer peer = AWTAccessor.getComponentAccessor()
+                                                 .getPeer(this);
+            peer.notifyActivation(activated, null);
         }
     }
 
@@ -91,13 +92,14 @@
      * Designed to be called from the main thread
      * This method should be called once from the initialization of the SWT_AWT Bridge
      */
-    @SuppressWarnings("deprecation")
     public void validateWithBounds(final int x, final int y, final int width, final int height) {
         try {
+            final LWWindowPeer peer = AWTAccessor.getComponentAccessor()
+                                                 .getPeer(this);
             LWCToolkit.invokeAndWait(new Runnable() {
                 @Override
                 public void run() {
-                    ((LWWindowPeer) getPeer()).setBoundsPrivate(0, 0, width, height);
+                    peer.setBoundsPrivate(0, 0, width, height);
                     validate();
                     setVisible(true);
                 }
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -293,7 +293,7 @@
     }
 
     @Override
-    protected DesktopPeer createDesktopPeer(Desktop target) {
+    public DesktopPeer createDesktopPeer(Desktop target) {
         return new CDesktopPeer();
     }
 
@@ -575,7 +575,8 @@
 
         final boolean[] ret = new boolean[1];
 
-        try {  invokeAndWait(new Runnable() { public void run() { synchronized(ret) {
+        try {  invokeAndWait(new Runnable() { @Override
+                                              public void run() { synchronized(ret) {
             ret[0] = a.equals(b);
         }}}, c); } catch (Exception e) { e.printStackTrace(); }
 
--- a/jdk/src/java.desktop/share/classes/java/awt/Button.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Button.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -168,13 +168,12 @@
      * application to change the look of the button without changing
      * its functionality.
      *
-     * @see     java.awt.Toolkit#createButton(java.awt.Button)
      * @see     java.awt.Component#getToolkit()
      */
     public void addNotify() {
         synchronized(getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createButton(this);
+                peer = getComponentFactory().createButton(this);
             super.addNotify();
         }
     }
--- a/jdk/src/java.desktop/share/classes/java/awt/Canvas.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Canvas.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,11 +58,13 @@
     }
 
     /**
-     * Constructs a new Canvas given a GraphicsConfiguration object.
+     * Constructs a new Canvas given a GraphicsConfiguration object. If null is
+     * passed, then the default GraphicsConfiguration will be used.
      *
-     * @param config a reference to a GraphicsConfiguration object.
+     * @param config a reference to a GraphicsConfiguration object or null
      *
      * @see GraphicsConfiguration
+     * @see Component#getGraphicsConfiguration()
      */
     public Canvas(GraphicsConfiguration config) {
         this();
@@ -70,10 +72,9 @@
     }
 
     @Override
-    @SuppressWarnings("deprecation")
     void setGraphicsConfiguration(GraphicsConfiguration gc) {
         synchronized(getTreeLock()) {
-            CanvasPeer peer = (CanvasPeer)getPeer();
+            CanvasPeer peer = (CanvasPeer) this.peer;
             if (peer != null) {
                 gc = peer.getAppropriateGraphicsConfiguration(gc);
             }
@@ -94,13 +95,12 @@
     /**
      * Creates the peer of the canvas.  This peer allows you to change the
      * user interface of the canvas without changing its functionality.
-     * @see     java.awt.Toolkit#createCanvas(java.awt.Canvas)
      * @see     java.awt.Component#getToolkit()
      */
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createCanvas(this);
+                peer = getComponentFactory().createCanvas(this);
             super.addNotify();
         }
     }
--- a/jdk/src/java.desktop/share/classes/java/awt/Checkbox.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Checkbox.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -239,13 +239,12 @@
      * Creates the peer of the Checkbox. The peer allows you to change the
      * look of the Checkbox without changing its functionality.
      *
-     * @see     java.awt.Toolkit#createCheckbox(java.awt.Checkbox)
      * @see     java.awt.Component#getToolkit()
      */
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createCheckbox(this);
+                peer = getComponentFactory().createCheckbox(this);
             super.addNotify();
         }
     }
--- a/jdk/src/java.desktop/share/classes/java/awt/CheckboxMenuItem.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/CheckboxMenuItem.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -155,13 +155,12 @@
      * change the look of the checkbox item without changing its
      * functionality.
      * Most applications do not call this method directly.
-     * @see     java.awt.Toolkit#createCheckboxMenuItem(java.awt.CheckboxMenuItem)
      * @see     java.awt.Component#getToolkit()
      */
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = Toolkit.getDefaultToolkit().createCheckboxMenuItem(this);
+                peer = getComponentFactory().createCheckboxMenuItem(this);
             super.addNotify();
         }
     }
--- a/jdk/src/java.desktop/share/classes/java/awt/Choice.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Choice.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -143,13 +143,12 @@
      * Creates the <code>Choice</code>'s peer.  This peer allows us
      * to change the look
      * of the <code>Choice</code> without changing its functionality.
-     * @see     java.awt.Toolkit#createChoice(java.awt.Choice)
      * @see     java.awt.Component#getToolkit()
      */
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createChoice(this);
+                peer = getComponentFactory().createChoice(this);
             super.addNotify();
         }
     }
--- a/jdk/src/java.desktop/share/classes/java/awt/Component.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Component.java	Wed Jul 05 20:33:50 2017 +0200
@@ -61,6 +61,7 @@
 import javax.accessibility.*;
 import java.applet.Applet;
 
+import sun.awt.ComponentFactory;
 import sun.security.action.GetPropertyAction;
 import sun.awt.AppContext;
 import sun.awt.AWTAccessor;
@@ -198,7 +199,7 @@
      * @see #addNotify
      * @see #removeNotify
      */
-    transient ComponentPeer peer;
+    transient volatile ComponentPeer peer;
 
     /**
      * The parent of the object. It may be <code>null</code>
@@ -924,8 +925,9 @@
             public Cursor getCursor(Component comp) {
                 return comp.getCursor_NoClientCode();
             }
-            public ComponentPeer getPeer(Component comp) {
-                return comp.peer;
+            @SuppressWarnings("unchecked")
+            public <T extends ComponentPeer> T getPeer(Component comp) {
+                return (T) comp.peer;
             }
             public void setPeer(Component comp, ComponentPeer peer) {
                 comp.peer = peer;
@@ -1069,17 +1071,6 @@
     }
 
     /**
-     * @deprecated As of JDK version 1.1,
-     * programs should not directly manipulate peers;
-     * replaced by <code>boolean isDisplayable()</code>.
-     * @return the peer for this component
-     */
-    @Deprecated
-    public ComponentPeer getPeer() {
-        return peer;
-    }
-
-    /**
      * Associate a <code>DropTarget</code> with this component.
      * The <code>Component</code> will receive drops only if it
      * is enabled.
@@ -1095,7 +1086,7 @@
         DropTarget old;
 
         if ((old = dropTarget) != null) {
-            if (peer != null) dropTarget.removeNotify(peer);
+            dropTarget.removeNotify();
 
             DropTarget t = dropTarget;
 
@@ -1113,12 +1104,12 @@
         if ((dropTarget = dt) != null) {
             try {
                 dropTarget.setComponent(this);
-                if (peer != null) dropTarget.addNotify(peer);
+                dropTarget.addNotify();
             } catch (IllegalArgumentException iae) {
                 if (old != null) {
                     try {
                         old.setComponent(this);
-                        if (peer != null) dropTarget.addNotify(peer);
+                        dropTarget.addNotify();
                     } catch (IllegalArgumentException iae1) {
                         // ignore it!
                     }
@@ -1179,7 +1170,7 @@
 
         graphicsConfig = gc;
 
-        ComponentPeer peer = getPeer();
+        ComponentPeer peer = this.peer;
         if (peer != null) {
             return peer.updateGraphicsData(gc);
         }
@@ -1239,6 +1230,14 @@
         return Toolkit.getDefaultToolkit();
     }
 
+    final ComponentFactory getComponentFactory() {
+        final Toolkit toolkit = getToolkit();
+        if (toolkit instanceof ComponentFactory) {
+            return (ComponentFactory) toolkit;
+        }
+        throw new AWTError("UI components are unsupported by: " + toolkit);
+    }
+
     /**
      * Determines whether this component is valid. A component is valid
      * when it is correctly sized and positioned within its parent
@@ -1281,7 +1280,7 @@
      * @since 1.2
      */
     public boolean isDisplayable() {
-        return getPeer() != null;
+        return peer != null;
     }
 
     /**
@@ -1336,7 +1335,11 @@
             return null;
         }
         Window win = getContainingWindow();
-        if (!Toolkit.getDefaultToolkit().getMouseInfoPeer().isWindowUnderMouse(win)) {
+        Toolkit toolkit = Toolkit.getDefaultToolkit();
+        if (!(toolkit instanceof ComponentFactory)) {
+            return null;
+        }
+        if (!((ComponentFactory) toolkit).getMouseInfoPeer().isWindowUnderMouse(win)) {
             return null;
         }
         final boolean INCLUDE_DISABLED = true;
@@ -2582,7 +2585,7 @@
      * @since 1.2
      */
     public boolean isOpaque() {
-        if (getPeer() == null) {
+        if (peer == null) {
             return false;
         }
         else {
@@ -2608,7 +2611,7 @@
      * @since 1.2
      */
     public boolean isLightweight() {
-        return getPeer() instanceof LightweightPeer;
+        return peer instanceof LightweightPeer;
     }
 
 
@@ -3126,7 +3129,6 @@
      *          obtained
      * @return the font metrics for <code>font</code>
      * @see       #getFont
-     * @see       #getPeer
      * @see       java.awt.peer.ComponentPeer#getFontMetrics(Font)
      * @see       Toolkit#getFontMetrics(Font)
      * @since     1.0
@@ -3186,7 +3188,7 @@
 
             if (nativeContainer == null) return;
 
-            ComponentPeer cPeer = nativeContainer.getPeer();
+            ComponentPeer cPeer = nativeContainer.peer;
 
             if (cPeer != null) {
                 cPeer.updateCursorImmediately();
@@ -5019,7 +5021,7 @@
                 if (source != null) {
                     Container target = source.getNativeContainer();
                     if (target != null) {
-                        tpeer = target.getPeer();
+                        tpeer = target.peer;
                     }
                 }
             }
@@ -6972,7 +6974,7 @@
                 if (peer == null) {
                     // Update both the Component's peer variable and the local
                     // variable we use for thread safety.
-                    this.peer = peer = getToolkit().createComponent(this);
+                    this.peer = peer = getComponentFactory().createComponent(this);
                 }
 
                 // This is a lightweight component which means it won't be
@@ -7022,7 +7024,7 @@
                 popup.addNotify();
             }
 
-            if (dropTarget != null) dropTarget.addNotify(peer);
+            if (dropTarget != null) dropTarget.addNotify();
 
             peerFont = getFont();
 
@@ -7109,7 +7111,7 @@
                     ((FlipBufferStrategy)bufferStrategy).destroyBuffers();
                 }
 
-                if (dropTarget != null) dropTarget.removeNotify(peer);
+                if (dropTarget != null) dropTarget.removeNotify();
 
                 // Hide peer first to stop system events such as cursor moves.
                 if (visible) {
@@ -9851,7 +9853,7 @@
         }
 
         if (!isLightweight()) {
-            ComponentPeer peer = getPeer();
+            ComponentPeer peer = this.peer;
             if (peer != null) {
                 // The Region class has some optimizations. That's why
                 // we should manually check whether it's empty and
@@ -9975,7 +9977,7 @@
             for (int i = indexAbove; i > -1; i--) {
                 Component comp = cont.getComponent(i);
                 if (comp != null && comp.isDisplayable() && !comp.isLightweight()) {
-                    return comp.getPeer();
+                    return comp.peer;
                 }
             }
             // traversing the hierarchy up to the closest HW container;
--- a/jdk/src/java.desktop/share/classes/java/awt/Container.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Container.java	Wed Jul 05 20:33:50 2017 +0200
@@ -820,7 +820,7 @@
                 }
             } else {
                 // Q: Need to update NativeInLightFixer?
-                comp.getPeer().reparent(parentPeer);
+                comp.peer.reparent(parentPeer);
             }
         }
     }
@@ -840,10 +840,10 @@
             // If component is lightweight container we need to reparent all its explicit  heavyweight children
             if (comp instanceof Container) {
                 // Traverse component's tree till depth-first until encountering heavyweight component
-                reparentTraverse((ContainerPeer)getPeer(), (Container)comp);
+                reparentTraverse((ContainerPeer)peer, (Container)comp);
             }
         } else {
-            comp.getPeer().reparent((ContainerPeer)getPeer());
+            comp.peer.reparent((ContainerPeer) peer);
         }
     }
 
@@ -4195,7 +4195,7 @@
                 }
             } else {
                 if (comp.isVisible()) {
-                    ComponentPeer peer = comp.getPeer();
+                    ComponentPeer peer = comp.peer;
                     if (peer != null) {
                         peer.setVisible(true);
                     }
@@ -4217,7 +4217,7 @@
                 }
             } else {
                 if (comp.isVisible()) {
-                    ComponentPeer peer = comp.getPeer();
+                    ComponentPeer peer = comp.peer;
                     if (peer != null) {
                         peer.setVisible(false);
                     }
@@ -4239,7 +4239,7 @@
                     ((Container)comp).recursiveRelocateHeavyweightChildren(newOrigin);
                 }
             } else {
-                ComponentPeer peer = comp.getPeer();
+                ComponentPeer peer = comp.peer;
                 if (peer != null) {
                     peer.setBounds(origin.x + comp.getX(), origin.y + comp.getY(),
                             comp.getWidth(), comp.getHeight(),
--- a/jdk/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java	Wed Jul 05 20:33:50 2017 +0200
@@ -504,7 +504,10 @@
                 } else if (comp instanceof Container && comp != aContainer) {
                     Container cont = (Container)comp;
                     if (cont.isFocusTraversalPolicyProvider()) {
-                        return cont.getFocusTraversalPolicy().getLastComponent(cont);
+                        Component retComp = cont.getFocusTraversalPolicy().getLastComponent(cont);
+                        if (retComp != null) {
+                            return retComp;
+                        }
                     }
                 }
             }
--- a/jdk/src/java.desktop/share/classes/java/awt/DefaultFocusTraversalPolicy.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/DefaultFocusTraversalPolicy.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -93,7 +93,6 @@
      * @return <code>true</code> if aComponent meets the above requirements;
      *         <code>false</code> otherwise
      */
-    @SuppressWarnings("deprecation")
     protected boolean accept(Component aComponent) {
         if (!(aComponent.isVisible() && aComponent.isDisplayable() &&
               aComponent.isEnabled()))
@@ -123,7 +122,7 @@
             return focusable;
         }
 
-        ComponentPeer peer = aComponent.getPeer();
+        ComponentPeer peer = aComponent.peer;
         return (peer != null && peer.isFocusable());
     }
 }
--- a/jdk/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -796,7 +796,6 @@
      * @return <code>true</code>
      * @see Component#dispatchEvent
      */
-    @SuppressWarnings("deprecation")
     public boolean dispatchKeyEvent(KeyEvent e) {
         Component focusOwner = (((AWTEvent)e).isPosted) ? getFocusOwner() : e.getComponent();
 
@@ -824,14 +823,14 @@
 
         // Allow the peer to process KeyEvent
         Component source = e.getComponent();
-        ComponentPeer peer = source.getPeer();
+        ComponentPeer peer = source.peer;
 
         if (peer == null || peer instanceof LightweightPeer) {
             // if focus owner is lightweight then its native container
             // processes event
             Container target = source.getNativeContainer();
             if (target != null) {
-                peer = target.getPeer();
+                peer = target.peer;
             }
         }
         if (peer != null) {
@@ -1049,7 +1048,7 @@
             Component source = (Component)ke.getSource();
             Container target = source.getNativeContainer();
             if (target != null) {
-                ComponentPeer peer = target.getPeer();
+                ComponentPeer peer = target.peer;
                 if (peer != null) {
                     peer.handleEvent(ke);
                     /**
--- a/jdk/src/java.desktop/share/classes/java/awt/Desktop.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Desktop.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -25,19 +25,16 @@
 
 package java.awt;
 
+import java.awt.peer.DesktopPeer;
 import java.io.File;
+import java.io.FilePermission;
 import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URI;
 import java.net.URL;
-import java.net.MalformedURLException;
-import java.awt.AWTPermission;
-import java.awt.GraphicsEnvironment;
-import java.awt.HeadlessException;
-import java.awt.peer.DesktopPeer;
+
 import sun.awt.SunToolkit;
-import sun.awt.HeadlessToolkit;
-import java.io.FilePermission;
 import sun.security.util.SecurityConstants;
 
 /**
@@ -122,7 +119,11 @@
      * Suppresses default constructor for noninstantiability.
      */
     private Desktop() {
-        peer = Toolkit.getDefaultToolkit().createDesktopPeer(this);
+        Toolkit defaultToolkit = Toolkit.getDefaultToolkit();
+        // same cast as in isDesktopSupported()
+        if (defaultToolkit instanceof SunToolkit) {
+            peer = ((SunToolkit) defaultToolkit).createDesktopPeer(this);
+        }
     }
 
     /**
--- a/jdk/src/java.desktop/share/classes/java/awt/Dialog.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Dialog.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,11 +36,9 @@
 import sun.awt.AppContext;
 import sun.awt.AWTPermissions;
 import sun.awt.SunToolkit;
-import sun.awt.PeerEvent;
 import sun.awt.util.IdentityArrayList;
 import sun.awt.util.IdentityLinkedList;
 import java.security.AccessControlException;
-import java.util.function.BooleanSupplier;
 
 /**
  * A Dialog is a top-level window with a title and a border
@@ -749,15 +747,14 @@
      * @see Component#isDisplayable
      * @see #removeNotify
      */
-    @SuppressWarnings("deprecation")
     public void addNotify() {
         synchronized (getTreeLock()) {
-            if (parent != null && parent.getPeer() == null) {
+            if (parent != null && parent.peer == null) {
                 parent.addNotify();
             }
 
             if (peer == null) {
-                peer = getToolkit().createDialog(this);
+                peer = getComponentFactory().createDialog(this);
             }
             super.addNotify();
         }
--- a/jdk/src/java.desktop/share/classes/java/awt/FileDialog.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/FileDialog.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -314,14 +314,13 @@
      * Creates the file dialog's peer.  The peer allows us to change the look
      * of the file dialog without changing its functionality.
      */
-    @SuppressWarnings("deprecation")
     public void addNotify() {
         synchronized(getTreeLock()) {
-            if (parent != null && parent.getPeer() == null) {
+            if (parent != null && parent.peer == null) {
                 parent.addNotify();
             }
             if (peer == null)
-                peer = getToolkit().createFileDialog(this);
+                peer = getComponentFactory().createFileDialog(this);
             super.addNotify();
         }
     }
--- a/jdk/src/java.desktop/share/classes/java/awt/Font.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Font.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,10 +41,11 @@
 import java.security.PrivilegedExceptionAction;
 import java.text.AttributedCharacterIterator.Attribute;
 import java.text.CharacterIterator;
-import java.text.StringCharacterIterator;
 import java.util.Hashtable;
 import java.util.Locale;
 import java.util.Map;
+
+import sun.awt.ComponentFactory;
 import sun.font.StandardGlyphVector;
 
 import sun.font.AttributeMap;
@@ -239,6 +240,11 @@
         public boolean isCreatedFont(Font font) {
             return font.createdFont;
         }
+
+        @Override
+        public FontPeer getFontPeer(final Font font) {
+            return font.getFontPeer();
+        }
     }
 
     static {
@@ -434,24 +440,16 @@
     private static final long serialVersionUID = -4206021311591459213L;
 
     /**
-     * Gets the peer of this <code>Font</code>.
-     * @return  the peer of the <code>Font</code>.
-     * @since 1.1
-     * @deprecated Font rendering is now platform independent.
+     * Gets the peer of this {@code Font}.
+     *
+     * @return the peer of the {@code Font}.
      */
-    @Deprecated
-    public FontPeer getPeer(){
-        return getPeer_NoClientCode();
-    }
-    // NOTE: This method is called by privileged threads.
-    //       We implement this functionality in a package-private method
-    //       to insure that it cannot be overridden by client subclasses.
-    //       DO NOT INVOKE CLIENT CODE ON THIS THREAD!
-    @SuppressWarnings("deprecation")
-    final FontPeer getPeer_NoClientCode() {
+    private FontPeer getFontPeer() {
         if(peer == null) {
             Toolkit tk = Toolkit.getDefaultToolkit();
-            this.peer = tk.getFontPeer(name, style);
+            if (tk instanceof ComponentFactory) {
+                peer = ((ComponentFactory) tk).getFontPeer(name, style);
+            }
         }
         return peer;
     }
--- a/jdk/src/java.desktop/share/classes/java/awt/Frame.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Frame.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,21 +24,23 @@
  */
 package java.awt;
 
+import java.awt.event.KeyEvent;
+import java.awt.event.WindowEvent;
 import java.awt.peer.FramePeer;
-import java.awt.event.*;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
 import java.util.Vector;
-import java.io.Serializable;
-import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
-import java.io.IOException;
-import sun.awt.AppContext;
+
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleRole;
+import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
+
+import sun.awt.AWTAccessor;
 import sun.awt.SunToolkit;
-import sun.awt.AWTAccessor;
-import java.lang.ref.WeakReference;
-import javax.accessibility.*;
 
 /**
  * A <code>Frame</code> is a top-level window with a title and a border.
@@ -474,7 +476,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null) {
-                peer = getToolkit().createFrame(this);
+                peer = getComponentFactory().createFrame(this);
             }
             FramePeer p = (FramePeer)peer;
             MenuBar menuBar = this.menuBar;
--- a/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -3054,11 +3054,10 @@
         return (wto != wfrom);
     }
 
-    @SuppressWarnings("deprecation")
     static Component getHeavyweight(Component comp) {
-        if (comp == null || comp.getPeer() == null) {
+        if (comp == null || comp.peer == null) {
             return null;
-        } else if (comp.getPeer() instanceof LightweightPeer) {
+        } else if (comp.peer instanceof LightweightPeer) {
             return comp.getNativeContainer();
         } else {
             return comp;
--- a/jdk/src/java.desktop/share/classes/java/awt/Label.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Label.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -184,7 +184,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createLabel(this);
+                peer = getComponentFactory().createLabel(this);
             super.addNotify();
         }
     }
--- a/jdk/src/java.desktop/share/classes/java/awt/List.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/List.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -252,7 +252,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createList(this);
+                peer = getComponentFactory().createList(this);
             super.addNotify();
         }
     }
--- a/jdk/src/java.desktop/share/classes/java/awt/Menu.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Menu.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -174,7 +174,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = Toolkit.getDefaultToolkit().createMenu(this);
+                peer = getComponentFactory().createMenu(this);
             int nitems = getItemCount();
             for (int i = 0 ; i < nitems ; i++) {
                 MenuItem mi = getItem(i);
--- a/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java	Wed Jul 05 20:33:50 2017 +0200
@@ -143,7 +143,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = Toolkit.getDefaultToolkit().createMenuBar(this);
+                peer = getComponentFactory().createMenuBar(this);
 
             int nmenus = getMenuCount();
             for (int i = 0 ; i < nmenus ; i++) {
--- a/jdk/src/java.desktop/share/classes/java/awt/MenuComponent.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/MenuComponent.java	Wed Jul 05 20:33:50 2017 +0200
@@ -30,6 +30,8 @@
 import java.io.ObjectInputStream;
 import sun.awt.AppContext;
 import sun.awt.AWTAccessor;
+import sun.awt.ComponentFactory;
+
 import javax.accessibility.*;
 
 import java.security.AccessControlContext;
@@ -57,7 +59,7 @@
         }
     }
 
-    transient MenuComponentPeer peer;
+    transient volatile MenuComponentPeer peer;
     transient MenuContainer parent;
 
     /**
@@ -142,6 +144,11 @@
                     menuComp.appContext = appContext;
                 }
                 @Override
+                @SuppressWarnings("unchecked")
+                public <T extends MenuComponentPeer> T getPeer(MenuComponent menuComp) {
+                    return (T) menuComp.peer;
+                }
+                @Override
                 public MenuContainer getParent(MenuComponent menuComp) {
                     return menuComp.parent;
                 }
@@ -179,6 +186,14 @@
                      // getName()
     }
 
+    final ComponentFactory getComponentFactory() {
+        final Toolkit toolkit = Toolkit.getDefaultToolkit();
+        if (toolkit instanceof ComponentFactory) {
+            return (ComponentFactory) toolkit;
+        }
+        throw new AWTError("UI components are unsupported by: " + toolkit);
+    }
+
     /**
      * Gets the name of the menu component.
      * @return        the name of the menu component
@@ -226,16 +241,6 @@
     }
 
     /**
-     * @deprecated As of JDK version 1.1,
-     * programs should not directly manipulate peers.
-     * @return the peer for this component
-     */
-    @Deprecated
-    public MenuComponentPeer getPeer() {
-        return peer;
-    }
-
-    /**
      * Gets the font used for this menu component.
      * @return   the font used in this menu component, if there is one;
      *                  <code>null</code> otherwise
--- a/jdk/src/java.desktop/share/classes/java/awt/MenuItem.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/MenuItem.java	Wed Jul 05 20:33:50 2017 +0200
@@ -233,7 +233,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = Toolkit.getDefaultToolkit().createMenuItem(this);
+                peer = getComponentFactory().createMenuItem(this);
         }
     }
 
--- a/jdk/src/java.desktop/share/classes/java/awt/MouseInfo.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/MouseInfo.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -26,6 +26,7 @@
 package java.awt;
 
 import sun.awt.AWTPermissions;
+import sun.awt.ComponentFactory;
 
 /**
  * <code>MouseInfo</code>  provides methods for getting information about the mouse,
@@ -80,8 +81,13 @@
             security.checkPermission(AWTPermissions.WATCH_MOUSE_PERMISSION);
         }
 
+        Toolkit toolkit = Toolkit.getDefaultToolkit();
         Point point = new Point(0, 0);
-        int deviceNum = Toolkit.getDefaultToolkit().getMouseInfoPeer().fillPointWithCoords(point);
+        int deviceNum = 0;
+        if (toolkit instanceof ComponentFactory) {
+            deviceNum = ((ComponentFactory) toolkit).getMouseInfoPeer().fillPointWithCoords(point);
+        }
+
         GraphicsDevice[] gds = GraphicsEnvironment.getLocalGraphicsEnvironment().
                                    getScreenDevices();
         PointerInfo retval = null;
@@ -113,9 +119,13 @@
     /**
      * Returns the number of buttons on the mouse.
      * On systems without a mouse, returns <code>-1</code>.
+     * The number of buttons is obtained from the AWT Toolkit
+     * by requesting the {@code "awt.mouse.numButtons"} desktop property
+     * which is set by the underlying native platform.
      *
      * @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true
      * @return number of buttons on the mouse
+     * @see Toolkit#getDesktopProperty
      * @since 1.5
      */
     public static int getNumberOfButtons() throws HeadlessException {
--- a/jdk/src/java.desktop/share/classes/java/awt/Panel.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Panel.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -83,7 +83,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createPanel(this);
+                peer = getComponentFactory().createPanel(this);
             super.addNotify();
         }
     }
--- a/jdk/src/java.desktop/share/classes/java/awt/PopupMenu.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/PopupMenu.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -121,7 +121,7 @@
             }
             else {
                 if (peer == null)
-                    peer = Toolkit.getDefaultToolkit().createPopupMenu(this);
+                    peer = getComponentFactory().createPopupMenu(this);
                 int nitems = getItemCount();
                 for (int i = 0 ; i < nitems ; i++) {
                     MenuItem mi = getItem(i);
@@ -153,7 +153,6 @@
      *                parent's hierarchy
      * @exception RuntimeException if the parent is not showing on screen
      */
-    @SuppressWarnings("deprecation")
     public void show(Component origin, int x, int y) {
         // Use localParent for thread safety.
         MenuContainer localParent = parent;
@@ -177,7 +176,7 @@
                 throw new IllegalArgumentException("origin not in parent's hierarchy");
             }
         }
-        if (compParent.getPeer() == null || !compParent.isShowing()) {
+        if (compParent.peer == null || !compParent.isShowing()) {
             throw new RuntimeException("parent not showing on screen");
         }
         if (peer == null) {
--- a/jdk/src/java.desktop/share/classes/java/awt/ScrollPane.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/ScrollPane.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,6 @@
  */
 package java.awt;
 
-import java.awt.peer.LightweightPeer;
 import java.awt.peer.ScrollPanePeer;
 import java.awt.event.*;
 import javax.accessibility.*;
@@ -562,7 +561,7 @@
             }
 
             if (peer == null)
-                peer = getToolkit().createScrollPane(this);
+                peer = getComponentFactory().createScrollPane(this);
             super.addNotify();
 
             // Bug 4124460. Restore the adjustable values.
--- a/jdk/src/java.desktop/share/classes/java/awt/Scrollbar.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Scrollbar.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -433,7 +433,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createScrollbar(this);
+                peer = getComponentFactory().createScrollbar(this);
             super.addNotify();
         }
     }
--- a/jdk/src/java.desktop/share/classes/java/awt/TextArea.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/TextArea.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,15 +24,15 @@
  */
 package java.awt;
 
-import java.awt.event.InputEvent;
-import java.awt.event.KeyEvent;
 import java.awt.peer.TextAreaPeer;
-import java.io.ObjectOutputStream;
+import java.io.IOException;
 import java.io.ObjectInputStream;
-import java.io.IOException;
 import java.util.HashSet;
 import java.util.Set;
-import javax.accessibility.*;
+
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
 
 /**
  * A <code>TextArea</code> object is a multi-line region
@@ -290,7 +290,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createTextArea(this);
+                peer = getComponentFactory().createTextArea(this);
             super.addNotify();
         }
     }
--- a/jdk/src/java.desktop/share/classes/java/awt/TextField.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/TextField.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -219,7 +219,7 @@
     public void addNotify() {
         synchronized (getTreeLock()) {
             if (peer == null)
-                peer = getToolkit().createTextField(this);
+                peer = getComponentFactory().createTextField(this);
             super.addNotify();
         }
     }
--- a/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java	Wed Jul 05 20:33:50 2017 +0200
@@ -25,36 +25,37 @@
 
 package java.awt;
 
-import java.beans.PropertyChangeEvent;
+import java.awt.datatransfer.Clipboard;
+import java.awt.dnd.DragGestureListener;
+import java.awt.dnd.DragGestureRecognizer;
+import java.awt.dnd.DragSource;
 import java.awt.event.*;
-import java.awt.peer.*;
 import java.awt.im.InputMethodHighlight;
+import java.awt.image.ColorModel;
 import java.awt.image.ImageObserver;
 import java.awt.image.ImageProducer;
-import java.awt.image.ColorModel;
-import java.awt.datatransfer.Clipboard;
-import java.awt.dnd.DragSource;
-import java.awt.dnd.DragGestureRecognizer;
-import java.awt.dnd.DragGestureEvent;
-import java.awt.dnd.DragGestureListener;
-import java.awt.dnd.InvalidDnDOperationException;
-import java.awt.dnd.peer.DragSourceContextPeer;
-import java.net.URL;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
 import java.io.File;
 import java.io.FileInputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.EventListener;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.Properties;
+import java.util.ResourceBundle;
+import java.util.StringTokenizer;
+import java.util.WeakHashMap;
 
-import java.util.*;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
+import sun.awt.AWTAccessor;
+import sun.awt.AWTPermissions;
 import sun.awt.AppContext;
-
 import sun.awt.HeadlessToolkit;
-import sun.awt.NullComponentPeer;
 import sun.awt.PeerEvent;
 import sun.awt.SunToolkit;
-import sun.awt.AWTAccessor;
-import sun.awt.AWTPermissions;
-
 import sun.util.CoreResourceBundleControl;
 
 /**
@@ -112,341 +113,6 @@
  */
 public abstract class Toolkit {
 
-    /**
-     * Creates this toolkit's implementation of the <code>Desktop</code>
-     * using the specified peer interface.
-     * @param     target the desktop to be implemented
-     * @return    this toolkit's implementation of the <code>Desktop</code>
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Desktop
-     * @see       java.awt.peer.DesktopPeer
-     * @since 1.6
-     */
-    protected abstract DesktopPeer createDesktopPeer(Desktop target)
-      throws HeadlessException;
-
-
-    /**
-     * Creates this toolkit's implementation of <code>Button</code> using
-     * the specified peer interface.
-     * @param     target the button to be implemented.
-     * @return    this toolkit's implementation of <code>Button</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Button
-     * @see       java.awt.peer.ButtonPeer
-     */
-    protected abstract ButtonPeer createButton(Button target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>TextField</code> using
-     * the specified peer interface.
-     * @param     target the text field to be implemented.
-     * @return    this toolkit's implementation of <code>TextField</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.TextField
-     * @see       java.awt.peer.TextFieldPeer
-     */
-    protected abstract TextFieldPeer createTextField(TextField target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>Label</code> using
-     * the specified peer interface.
-     * @param     target the label to be implemented.
-     * @return    this toolkit's implementation of <code>Label</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Label
-     * @see       java.awt.peer.LabelPeer
-     */
-    protected abstract LabelPeer createLabel(Label target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>List</code> using
-     * the specified peer interface.
-     * @param     target the list to be implemented.
-     * @return    this toolkit's implementation of <code>List</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.List
-     * @see       java.awt.peer.ListPeer
-     */
-    protected abstract ListPeer createList(java.awt.List target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>Checkbox</code> using
-     * the specified peer interface.
-     * @param     target the check box to be implemented.
-     * @return    this toolkit's implementation of <code>Checkbox</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Checkbox
-     * @see       java.awt.peer.CheckboxPeer
-     */
-    protected abstract CheckboxPeer createCheckbox(Checkbox target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>Scrollbar</code> using
-     * the specified peer interface.
-     * @param     target the scroll bar to be implemented.
-     * @return    this toolkit's implementation of <code>Scrollbar</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Scrollbar
-     * @see       java.awt.peer.ScrollbarPeer
-     */
-    protected abstract ScrollbarPeer createScrollbar(Scrollbar target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>ScrollPane</code> using
-     * the specified peer interface.
-     * @param     target the scroll pane to be implemented.
-     * @return    this toolkit's implementation of <code>ScrollPane</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.ScrollPane
-     * @see       java.awt.peer.ScrollPanePeer
-     * @since     1.1
-     */
-    protected abstract ScrollPanePeer createScrollPane(ScrollPane target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>TextArea</code> using
-     * the specified peer interface.
-     * @param     target the text area to be implemented.
-     * @return    this toolkit's implementation of <code>TextArea</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.TextArea
-     * @see       java.awt.peer.TextAreaPeer
-     */
-    protected abstract TextAreaPeer createTextArea(TextArea target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>Choice</code> using
-     * the specified peer interface.
-     * @param     target the choice to be implemented.
-     * @return    this toolkit's implementation of <code>Choice</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Choice
-     * @see       java.awt.peer.ChoicePeer
-     */
-    protected abstract ChoicePeer createChoice(Choice target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>Frame</code> using
-     * the specified peer interface.
-     * @param     target the frame to be implemented.
-     * @return    this toolkit's implementation of <code>Frame</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Frame
-     * @see       java.awt.peer.FramePeer
-     */
-    protected abstract FramePeer createFrame(Frame target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>Canvas</code> using
-     * the specified peer interface.
-     * @param     target the canvas to be implemented.
-     * @return    this toolkit's implementation of <code>Canvas</code>.
-     * @see       java.awt.Canvas
-     * @see       java.awt.peer.CanvasPeer
-     */
-    protected abstract CanvasPeer       createCanvas(Canvas target);
-
-    /**
-     * Creates this toolkit's implementation of <code>Panel</code> using
-     * the specified peer interface.
-     * @param     target the panel to be implemented.
-     * @return    this toolkit's implementation of <code>Panel</code>.
-     * @see       java.awt.Panel
-     * @see       java.awt.peer.PanelPeer
-     */
-    protected abstract PanelPeer        createPanel(Panel target);
-
-    /**
-     * Creates this toolkit's implementation of <code>Window</code> using
-     * the specified peer interface.
-     * @param     target the window to be implemented.
-     * @return    this toolkit's implementation of <code>Window</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Window
-     * @see       java.awt.peer.WindowPeer
-     */
-    protected abstract WindowPeer createWindow(Window target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>Dialog</code> using
-     * the specified peer interface.
-     * @param     target the dialog to be implemented.
-     * @return    this toolkit's implementation of <code>Dialog</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Dialog
-     * @see       java.awt.peer.DialogPeer
-     */
-    protected abstract DialogPeer createDialog(Dialog target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>MenuBar</code> using
-     * the specified peer interface.
-     * @param     target the menu bar to be implemented.
-     * @return    this toolkit's implementation of <code>MenuBar</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.MenuBar
-     * @see       java.awt.peer.MenuBarPeer
-     */
-    protected abstract MenuBarPeer createMenuBar(MenuBar target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>Menu</code> using
-     * the specified peer interface.
-     * @param     target the menu to be implemented.
-     * @return    this toolkit's implementation of <code>Menu</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.Menu
-     * @see       java.awt.peer.MenuPeer
-     */
-    protected abstract MenuPeer createMenu(Menu target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>PopupMenu</code> using
-     * the specified peer interface.
-     * @param     target the popup menu to be implemented.
-     * @return    this toolkit's implementation of <code>PopupMenu</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.PopupMenu
-     * @see       java.awt.peer.PopupMenuPeer
-     * @since     1.1
-     */
-    protected abstract PopupMenuPeer createPopupMenu(PopupMenu target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>MenuItem</code> using
-     * the specified peer interface.
-     * @param     target the menu item to be implemented.
-     * @return    this toolkit's implementation of <code>MenuItem</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.MenuItem
-     * @see       java.awt.peer.MenuItemPeer
-     */
-    protected abstract MenuItemPeer createMenuItem(MenuItem target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>FileDialog</code> using
-     * the specified peer interface.
-     * @param     target the file dialog to be implemented.
-     * @return    this toolkit's implementation of <code>FileDialog</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.FileDialog
-     * @see       java.awt.peer.FileDialogPeer
-     */
-    protected abstract FileDialogPeer createFileDialog(FileDialog target)
-        throws HeadlessException;
-
-    /**
-     * Creates this toolkit's implementation of <code>CheckboxMenuItem</code> using
-     * the specified peer interface.
-     * @param     target the checkbox menu item to be implemented.
-     * @return    this toolkit's implementation of <code>CheckboxMenuItem</code>.
-     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
-     * returns true
-     * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @see       java.awt.CheckboxMenuItem
-     * @see       java.awt.peer.CheckboxMenuItemPeer
-     */
-    protected abstract CheckboxMenuItemPeer createCheckboxMenuItem(
-        CheckboxMenuItem target) throws HeadlessException;
-
-    /**
-     * Obtains this toolkit's implementation of helper class for
-     * <code>MouseInfo</code> operations.
-     * @return    this toolkit's implementation of  helper for <code>MouseInfo</code>
-     * @throws    UnsupportedOperationException if this operation is not implemented
-     * @see       java.awt.peer.MouseInfoPeer
-     * @see       java.awt.MouseInfo
-     * @since 1.5
-     */
-    protected MouseInfoPeer getMouseInfoPeer() {
-        throw new UnsupportedOperationException("Not implemented");
-    }
-
-    private static LightweightPeer lightweightMarker;
-
-    /**
-     * Creates a peer for a component or container.  This peer is windowless
-     * and allows the Component and Container classes to be extended directly
-     * to create windowless components that are defined entirely in java.
-     *
-     * @param  target The Component to be created.
-     * @return the peer for the specified component
-     */
-    protected LightweightPeer createComponent(Component target) {
-        if (lightweightMarker == null) {
-            lightweightMarker = new NullComponentPeer();
-        }
-        return lightweightMarker;
-    }
-
-    /**
-     * Creates this toolkit's implementation of <code>Font</code> using
-     * the specified peer interface.
-     * @param     name the font to be implemented
-     * @param     style the style of the font, such as <code>PLAIN</code>,
-     *            <code>BOLD</code>, <code>ITALIC</code>, or a combination
-     * @return    this toolkit's implementation of <code>Font</code>
-     * @see       java.awt.Font
-     * @see       java.awt.peer.FontPeer
-     * @see       java.awt.GraphicsEnvironment#getAllFonts
-     * @deprecated  see java.awt.GraphicsEnvironment#getAllFonts
-     */
-    @Deprecated
-    protected abstract FontPeer getFontPeer(String name, int style);
-
     // The following method is called by the private method
     // <code>updateSystemColors</code> in <code>SystemColor</code>.
 
@@ -1749,17 +1415,6 @@
     }
 
     /**
-     * Creates the peer for a DragSourceContext.
-     * Always throws InvalidDndOperationException if
-     * GraphicsEnvironment.isHeadless() returns true.
-     *
-     * @param  dge the {@code DragGestureEvent}
-     * @return the peer created
-     * @see java.awt.GraphicsEnvironment#isHeadless
-     */
-    public abstract DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException;
-
-    /**
      * Creates a concrete, platform dependent, subclass of the abstract
      * DragGestureRecognizer class requested, and associates it with the
      * DragSource, Component and DragGestureListener specified.
--- a/jdk/src/java.desktop/share/classes/java/awt/Window.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Window.java	Wed Jul 05 20:33:50 2017 +0200
@@ -29,7 +29,6 @@
 import java.awt.geom.Point2D;
 import java.awt.im.InputContext;
 import java.awt.image.BufferStrategy;
-import java.awt.image.BufferedImage;
 import java.awt.peer.ComponentPeer;
 import java.awt.peer.WindowPeer;
 import java.beans.PropertyChangeListener;
@@ -56,7 +55,6 @@
 import sun.awt.CausedFocusEvent;
 import sun.awt.SunToolkit;
 import sun.awt.util.IdentityArrayList;
-import sun.java2d.Disposer;
 import sun.java2d.pipe.Region;
 import sun.security.action.GetPropertyAction;
 import sun.util.logging.PlatformLogger;
@@ -755,15 +753,14 @@
      * @see Container#removeNotify
      * @since 1.0
      */
-    @SuppressWarnings("deprecation")
     public void addNotify() {
         synchronized (getTreeLock()) {
             Container parent = this.parent;
-            if (parent != null && parent.getPeer() == null) {
+            if (parent != null && parent.peer == null) {
                 parent.addNotify();
             }
             if (peer == null) {
-                peer = getToolkit().createWindow(this);
+                peer = getComponentFactory().createWindow(this);
             }
             synchronized (allWindows) {
                 allWindows.add(this);
@@ -802,7 +799,7 @@
     @SuppressWarnings("deprecation")
     public void pack() {
         Container parent = this.parent;
-        if (parent != null && parent.getPeer() == null) {
+        if (parent != null && parent.peer == null) {
             parent.addNotify();
         }
         if (peer == null) {
@@ -1072,10 +1069,9 @@
         }
     }
 
-    @SuppressWarnings("deprecation")
     static void updateChildFocusableWindowState(Window w) {
-        if (w.getPeer() != null && w.isShowing()) {
-            ((WindowPeer)w.getPeer()).updateFocusableWindowState();
+        if (w.peer != null && w.isShowing()) {
+            ((WindowPeer)w.peer).updateFocusableWindowState();
         }
         for (int i = 0; i < w.ownedWindowList.size(); i++) {
             Window child = w.ownedWindowList.elementAt(i).get();
@@ -1160,10 +1156,9 @@
      * as reported in javadoc. So we need to implement this functionality even if a
      * child overrides dispose() in a wrong way without calling super.dispose().
      */
-    @SuppressWarnings("deprecation")
     void disposeImpl() {
         dispose();
-        if (getPeer() != null) {
+        if (peer != null) {
             doDispose();
         }
     }
@@ -3651,7 +3646,7 @@
                 }
             }
             this.opacity = opacity;
-            WindowPeer peer = (WindowPeer)getPeer();
+            WindowPeer peer = (WindowPeer) this.peer;
             if (peer != null) {
                 peer.setOpacity(opacity);
             }
@@ -3728,7 +3723,6 @@
      *
      * @since 1.7
      */
-    @SuppressWarnings("deprecation")
     public void setShape(Shape shape) {
         synchronized (getTreeLock()) {
             if (shape != null) {
@@ -3746,7 +3740,7 @@
                 }
             }
             this.shape = (shape == null) ? null : new Path2D.Float(shape);
-            WindowPeer peer = (WindowPeer)getPeer();
+            WindowPeer peer = (WindowPeer) this.peer;
             if (peer != null) {
                 peer.applyShape(shape == null ? null : Region.getInstance(shape, null));
             }
@@ -3846,7 +3840,6 @@
      * @see GraphicsConfiguration#isTranslucencyCapable()
      */
     @Override
-    @SuppressWarnings("deprecation")
     public void setBackground(Color bgColor) {
         Color oldBg = getBackground();
         super.setBackground(bgColor);
@@ -3874,7 +3867,7 @@
         } else if ((oldAlpha < 255) && (alpha == 255)) {
             setLayersOpaque(this, true);
         }
-        WindowPeer peer = (WindowPeer)getPeer();
+        WindowPeer peer = (WindowPeer) this.peer;
         if (peer != null) {
             peer.setOpaque(alpha == 255);
         }
@@ -3899,10 +3892,9 @@
         return bg != null ? bg.getAlpha() == 255 : true;
     }
 
-    @SuppressWarnings("deprecation")
     private void updateWindow() {
         synchronized (getTreeLock()) {
-            WindowPeer peer = (WindowPeer)getPeer();
+            WindowPeer peer = (WindowPeer) this.peer;
             if (peer != null) {
                 peer.updateWindow();
             }
@@ -4090,7 +4082,6 @@
                 window.securityWarningHeight = height;
             }
 
-            @SuppressWarnings("deprecation")
             public void setSecurityWarningPosition(Window window,
                     Point2D point, float alignmentX, float alignmentY)
             {
@@ -4100,7 +4091,7 @@
                 window.securityWarningAlignmentY = alignmentY;
 
                 synchronized (window.getTreeLock()) {
-                    WindowPeer peer = (WindowPeer)window.getPeer();
+                    WindowPeer peer = (WindowPeer) window.peer;
                     if (peer != null) {
                         peer.repositionSecurityWarning();
                     }
--- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSource.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSource.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -35,13 +35,15 @@
 import java.awt.datatransfer.FlavorMap;
 import java.awt.datatransfer.SystemFlavorMap;
 import java.awt.datatransfer.Transferable;
-import java.awt.dnd.peer.DragSourceContextPeer;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
 import java.security.AccessController;
 import java.util.EventListener;
+
+import sun.awt.AWTAccessor;
+import sun.awt.AWTAccessor.DragSourceContextAccessor;
 import sun.awt.dnd.SunDragSourceContextPeer;
 import sun.security.action.GetIntegerAction;
 
@@ -303,22 +305,16 @@
         try {
             if (flavorMap != null) this.flavorMap = flavorMap;
 
-            DragSourceContextPeer dscp = Toolkit.getDefaultToolkit().createDragSourceContextPeer(trigger);
-
-            DragSourceContext     dsc = createDragSourceContext(dscp,
-                                                                trigger,
-                                                                dragCursor,
-                                                                dragImage,
-                                                                imageOffset,
-                                                                transferable,
-                                                                dsl
-                                                                );
+            DragSourceContext dsc = createDragSourceContext(trigger, dragCursor,
+                                                            dragImage,
+                                                            imageOffset,
+                                                            transferable, dsl);
 
             if (dsc == null) {
                 throw new InvalidDnDOperationException();
             }
-
-            dscp.startDrag(dsc, dsc.getCursor(), dragImage, imageOffset); // may throw
+            DragSourceContextAccessor acc = AWTAccessor.getDragSourceContextAccessor();
+            acc.getPeer(dsc).startDrag(dsc, dsc.getCursor(), dragImage, imageOffset); // may throw
         } catch (RuntimeException e) {
             SunDragSourceContextPeer.setDragDropInProgress(false);
             throw e;
@@ -442,7 +438,6 @@
      * is registered with the created <code>DragSourceContext</code>,
      * but <code>NullPointerException</code> is not thrown.
      *
-     * @param dscp          The <code>DragSourceContextPeer</code> for this drag
      * @param dgl           The <code>DragGestureEvent</code> that triggered the
      *                      drag
      * @param dragCursor     The initial {@code Cursor} for this drag operation
@@ -473,8 +468,13 @@
      *         event are equal to <code>DnDConstants.ACTION_NONE</code>.
      */
 
-    protected DragSourceContext createDragSourceContext(DragSourceContextPeer dscp, DragGestureEvent dgl, Cursor dragCursor, Image dragImage, Point imageOffset, Transferable t, DragSourceListener dsl) {
-        return new DragSourceContext(dscp, dgl, dragCursor, dragImage, imageOffset, t, dsl);
+    protected DragSourceContext createDragSourceContext(DragGestureEvent dgl,
+                                                        Cursor dragCursor,
+                                                        Image dragImage,
+                                                        Point imageOffset,
+                                                        Transferable t,
+                                                        DragSourceListener dsl) {
+        return new DragSourceContext(dgl, dragCursor, dragImage, imageOffset, t, dsl);
     }
 
     /**
--- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceContext.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceContext.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -25,24 +25,25 @@
 
 package java.awt.dnd;
 
+import java.awt.AWTError;
 import java.awt.Component;
 import java.awt.Cursor;
 import java.awt.Image;
 import java.awt.Point;
-
+import java.awt.Toolkit;
 import java.awt.datatransfer.DataFlavor;
 import java.awt.datatransfer.Transferable;
 import java.awt.datatransfer.UnsupportedFlavorException;
-
 import java.awt.dnd.peer.DragSourceContextPeer;
-
 import java.io.IOException;
 import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
 import java.io.Serializable;
+import java.util.TooManyListenersException;
 
-import java.util.TooManyListenersException;
+import sun.awt.AWTAccessor;
+import sun.awt.ComponentFactory;
 
 /**
  * The <code>DragSourceContext</code> class is responsible for managing the
@@ -123,6 +124,10 @@
 
     protected static final int CHANGED = 3;
 
+    static {
+        AWTAccessor.setDragSourceContextAccessor(dsc -> dsc.peer);
+    }
+
     /**
      * Called from <code>DragSource</code>, this constructor creates a new
      * <code>DragSourceContext</code> given the
@@ -155,7 +160,6 @@
      * If <code>DragSourceListener</code> is <code>null</code> no exception
      * is thrown.
      *
-     * @param dscp       the <code>DragSourceContextPeer</code> for this drag
      * @param trigger    the triggering event
      * @param dragCursor     the initial {@code Cursor} for this drag operation
      *                       or {@code null} for the default cursor handling;
@@ -179,10 +183,16 @@
      * @throws NullPointerException if dscp, trigger, or t are null, or
      *         if dragImage is non-null and offset is null
      */
-    public DragSourceContext(DragSourceContextPeer dscp,
-                             DragGestureEvent trigger, Cursor dragCursor,
+    public DragSourceContext(DragGestureEvent trigger, Cursor dragCursor,
                              Image dragImage, Point offset, Transferable t,
                              DragSourceListener dsl) {
+        Toolkit toolkit = Toolkit.getDefaultToolkit();
+        if (!(toolkit instanceof ComponentFactory)) {
+            throw new AWTError("Unsupported toolkit: " + toolkit);
+        }
+        DragSourceContextPeer dscp = ((ComponentFactory) toolkit).
+                createDragSourceContextPeer(trigger);
+
         if (dscp == null) {
             throw new NullPointerException("DragSourceContextPeer");
         }
@@ -623,8 +633,7 @@
     /*
      * fields
      */
-
-    private transient DragSourceContextPeer peer;
+    private final transient DragSourceContextPeer peer;
 
     /**
      * The event which triggered the start of the drag.
--- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTarget.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTarget.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -49,6 +49,9 @@
 import java.awt.peer.LightweightPeer;
 import java.awt.dnd.peer.DropTargetPeer;
 
+import sun.awt.AWTAccessor;
+import sun.awt.AWTAccessor.ComponentAccessor;
+
 
 /**
  * The <code>DropTarget</code> is associated
@@ -204,19 +207,13 @@
         if (component == c || component != null && component.equals(c))
             return;
 
-        Component     old;
-        ComponentPeer oldPeer = null;
+        final Component old = component;
 
-        if ((old = component) != null) {
+        if (old  != null) {
             clearAutoscroll();
 
             component = null;
-
-            if (componentPeer != null) {
-                oldPeer = componentPeer;
-                removeNotify(componentPeer);
-            }
-
+            removeNotify();
             old.setDropTarget(null);
 
         }
@@ -226,7 +223,7 @@
         } catch (Exception e) { // undo the change
             if (old != null) {
                 old.setDropTarget(this);
-                addNotify(oldPeer);
+                addNotify();
             }
         }
     }
@@ -494,24 +491,24 @@
      * association of the ComponentPeer with the Component may result in
      * a malfunction of the DnD system.
      **********************************************************************
-     *
-     * @param peer The Peer of the Component we are associated with!
-     *
      */
-
-    @SuppressWarnings("deprecation")
-    public void addNotify(ComponentPeer peer) {
-        if (peer == componentPeer) return;
+    public void addNotify() {
+        final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
+        ComponentPeer peer = acc.getPeer(component);
+        if (peer == null || peer == componentPeer) {
+            return;
+        }
 
         componentPeer = peer;
 
+
         for (Component c = component;
              c != null && peer instanceof LightweightPeer; c = c.getParent()) {
-            peer = c.getPeer();
+            peer = acc.getPeer(c);
         }
 
         if (peer instanceof DropTargetPeer) {
-            nativePeer = peer;
+            nativePeer = (DropTargetPeer) peer;
             ((DropTargetPeer)peer).addDropTarget(this);
         } else {
             nativePeer = null;
@@ -530,15 +527,14 @@
      * disassociation of the ComponentPeer from the Component may result in
      * a malfunction of the DnD system.
      **********************************************************************
-     *
-     * @param peer The Peer of the Component we are being disassociated from!
      */
 
-    public void removeNotify(ComponentPeer peer) {
-        if (nativePeer != null)
-            ((DropTargetPeer)nativePeer).removeDropTarget(this);
-
-        componentPeer = nativePeer = null;
+    public void removeNotify() {
+        if (nativePeer != null) {
+            nativePeer.removeDropTarget(this);
+        }
+        componentPeer = null;
+        nativePeer = null;
 
         synchronized (this) {
             if (isDraggingInside) {
@@ -834,7 +830,7 @@
     /*
      * That Component's "native" Peer
      */
-    private transient ComponentPeer nativePeer;
+    private transient DropTargetPeer nativePeer;
 
 
     /**
--- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetContext.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetContext.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -39,6 +39,8 @@
 import java.util.Arrays;
 import java.util.List;
 
+import sun.awt.AWTAccessor;
+import sun.awt.AWTAccessor.DropTargetContextAccessor;
 
 /**
  * A <code>DropTargetContext</code> is created
@@ -58,6 +60,19 @@
 
     private static final long serialVersionUID = -634158968993743371L;
 
+    static {
+        AWTAccessor.setDropTargetContextAccessor(new DropTargetContextAccessor() {
+            @Override
+            public void reset(DropTargetContext dtc) {
+                dtc.reset();
+            }
+            @Override
+            public void setDropTargetContextPeer(DropTargetContext dtc,
+                                                 DropTargetContextPeer dtcp) {
+                dtc.setDropTargetContextPeer(dtcp);
+            }
+        });
+    }
     /**
      * Construct a <code>DropTargetContext</code>
      * given a specified <code>DropTarget</code>.
@@ -90,20 +105,9 @@
     public Component getComponent() { return dropTarget.getComponent(); }
 
     /**
-     * Called when associated with the <code>DropTargetContextPeer</code>.
-     *
-     * @param dtcp the <code>DropTargetContextPeer</code>
-     */
-
-    public void addNotify(DropTargetContextPeer dtcp) {
-        dropTargetContextPeer = dtcp;
-    }
-
-    /**
      * Called when disassociated with the <code>DropTargetContextPeer</code>.
      */
-
-    public void removeNotify() {
+    void reset() {
         dropTargetContextPeer = null;
         transferable          = null;
     }
@@ -282,12 +286,18 @@
      *
      * @return the platform peer
      */
-
     DropTargetContextPeer getDropTargetContextPeer() {
         return dropTargetContextPeer;
     }
 
     /**
+     * Sets the {@code DropTargetContextPeer}
+     */
+    void setDropTargetContextPeer(final DropTargetContextPeer dtcp) {
+        dropTargetContextPeer = dtcp;
+    }
+
+    /**
      * Creates a TransferableProxy to proxy for the specified
      * Transferable.
      *
@@ -412,7 +422,7 @@
      *
      * @serial
      */
-    private DropTarget dropTarget;
+    private final DropTarget dropTarget;
 
     private transient DropTargetContextPeer dropTargetContextPeer;
 
--- a/jdk/src/java.desktop/share/classes/java/awt/geom/Path2D.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/geom/Path2D.java	Wed Jul 05 20:33:50 2017 +0200
@@ -101,6 +101,8 @@
 
     static final int INIT_SIZE = 20;
     static final int EXPAND_MAX = 500;
+    static final int EXPAND_MAX_COORDS = EXPAND_MAX * 2;
+    static final int EXPAND_MIN = 10; // ensure > 6 (cubics)
 
     /**
      * Constructs a new empty {@code Path2D} object.
@@ -141,6 +143,42 @@
     abstract int rectCrossings(double rxmin, double rymin,
                                double rxmax, double rymax);
 
+    static byte[] expandPointTypes(byte[] oldPointTypes, int needed) {
+        final int oldSize = oldPointTypes.length;
+        final int newSizeMin = oldSize + needed;
+        if (newSizeMin < oldSize) {
+            // hard overflow failure - we can't even accommodate
+            // new items without overflowing
+            throw new ArrayIndexOutOfBoundsException(
+                          "pointTypes exceeds maximum capacity !");
+        }
+        // growth algorithm computation
+        int grow = oldSize;
+        if (grow > EXPAND_MAX) {
+            grow = Math.max(EXPAND_MAX, oldSize >> 3); // 1/8th min
+        } else if (grow < EXPAND_MIN) {
+            grow = EXPAND_MIN;
+        }
+        assert grow > 0;
+
+        int newSize = oldSize + grow;
+        if (newSize < newSizeMin) {
+            // overflow in growth algorithm computation
+            newSize = Integer.MAX_VALUE;
+        }
+        while (true) {
+            try {
+                // try allocating the larger array
+                return Arrays.copyOf(oldPointTypes, newSize);
+            } catch (OutOfMemoryError oome) {
+                if (newSize == newSizeMin) {
+                    throw oome;
+                }
+            }
+            newSize = newSizeMin + (newSize - newSizeMin) / 2;
+        }
+    }
+
     /**
      * The {@code Float} class defines a geometric path with
      * coordinates stored in single precision floating point.
@@ -279,31 +317,53 @@
                                      floatCoords[coordindex+1]);
         }
 
+        @Override
         void needRoom(boolean needMove, int newCoords) {
-            if (needMove && numTypes == 0) {
+            if ((numTypes == 0) && needMove) {
                 throw new IllegalPathStateException("missing initial moveto "+
                                                     "in path definition");
             }
-            int size = pointTypes.length;
-            if (numTypes >= size) {
-                int grow = size;
-                if (grow > EXPAND_MAX) {
-                    grow = EXPAND_MAX;
-                } else if (grow == 0) {
-                    grow = 1;
+            if (numTypes >= pointTypes.length) {
+                pointTypes = expandPointTypes(pointTypes, 1);
+            }
+            if (numCoords > (floatCoords.length - newCoords)) {
+                floatCoords = expandCoords(floatCoords, newCoords);
+            }
+        }
+
+        static float[] expandCoords(float[] oldCoords, int needed) {
+            final int oldSize = oldCoords.length;
+            final int newSizeMin = oldSize + needed;
+            if (newSizeMin < oldSize) {
+                // hard overflow failure - we can't even accommodate
+                // new items without overflowing
+                throw new ArrayIndexOutOfBoundsException(
+                              "coords exceeds maximum capacity !");
+            }
+            // growth algorithm computation
+            int grow = oldSize;
+            if (grow > EXPAND_MAX_COORDS) {
+                grow = Math.max(EXPAND_MAX_COORDS, oldSize >> 3); // 1/8th min
+            } else if (grow < EXPAND_MIN) {
+                grow = EXPAND_MIN;
+            }
+            assert grow > needed;
+
+            int newSize = oldSize + grow;
+            if (newSize < newSizeMin) {
+                // overflow in growth algorithm computation
+                newSize = Integer.MAX_VALUE;
+            }
+            while (true) {
+                try {
+                    // try allocating the larger array
+                    return Arrays.copyOf(oldCoords, newSize);
+                } catch (OutOfMemoryError oome) {
+                    if (newSize == newSizeMin) {
+                        throw oome;
+                    }
                 }
-                pointTypes = Arrays.copyOf(pointTypes, size+grow);
-            }
-            size = floatCoords.length;
-            if (numCoords + newCoords > size) {
-                int grow = size;
-                if (grow > EXPAND_MAX * 2) {
-                    grow = EXPAND_MAX * 2;
-                }
-                if (grow < newCoords) {
-                    grow = newCoords;
-                }
-                floatCoords = Arrays.copyOf(floatCoords, size+grow);
+                newSize = newSizeMin + (newSize - newSizeMin) / 2;
             }
         }
 
@@ -1126,31 +1186,53 @@
                                       doubleCoords[coordindex+1]);
         }
 
+        @Override
         void needRoom(boolean needMove, int newCoords) {
-            if (needMove && numTypes == 0) {
+            if ((numTypes == 0) && needMove) {
                 throw new IllegalPathStateException("missing initial moveto "+
                                                     "in path definition");
             }
-            int size = pointTypes.length;
-            if (numTypes >= size) {
-                int grow = size;
-                if (grow > EXPAND_MAX) {
-                    grow = EXPAND_MAX;
-                } else if (grow == 0) {
-                    grow = 1;
+            if (numTypes >= pointTypes.length) {
+                pointTypes = expandPointTypes(pointTypes, 1);
+            }
+            if (numCoords > (doubleCoords.length - newCoords)) {
+                doubleCoords = expandCoords(doubleCoords, newCoords);
+            }
+        }
+
+        static double[] expandCoords(double[] oldCoords, int needed) {
+            final int oldSize = oldCoords.length;
+            final int newSizeMin = oldSize + needed;
+            if (newSizeMin < oldSize) {
+                // hard overflow failure - we can't even accommodate
+                // new items without overflowing
+                throw new ArrayIndexOutOfBoundsException(
+                              "coords exceeds maximum capacity !");
+            }
+            // growth algorithm computation
+            int grow = oldSize;
+            if (grow > EXPAND_MAX_COORDS) {
+                grow = Math.max(EXPAND_MAX_COORDS, oldSize >> 3); // 1/8th min
+            } else if (grow < EXPAND_MIN) {
+                grow = EXPAND_MIN;
+            }
+            assert grow > needed;
+
+            int newSize = oldSize + grow;
+            if (newSize < newSizeMin) {
+                // overflow in growth algorithm computation
+                newSize = Integer.MAX_VALUE;
+            }
+            while (true) {
+                try {
+                    // try allocating the larger array
+                    return Arrays.copyOf(oldCoords, newSize);
+                } catch (OutOfMemoryError oome) {
+                    if (newSize == newSizeMin) {
+                        throw oome;
+                    }
                 }
-                pointTypes = Arrays.copyOf(pointTypes, size+grow);
-            }
-            size = doubleCoords.length;
-            if (numCoords + newCoords > size) {
-                int grow = size;
-                if (grow > EXPAND_MAX * 2) {
-                    grow = EXPAND_MAX * 2;
-                }
-                if (grow < newCoords) {
-                    grow = newCoords;
-                }
-                doubleCoords = Arrays.copyOf(doubleCoords, size+grow);
+                newSize = newSizeMin + (newSize - newSizeMin) / 2;
             }
         }
 
--- a/jdk/src/java.desktop/share/classes/java/beans/IndexedPropertyDescriptor.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/beans/IndexedPropertyDescriptor.java	Wed Jul 05 20:33:50 2017 +0200
@@ -431,7 +431,7 @@
     /**
      * Package-private constructor.
      * Merge two property descriptors.  Where they conflict, give the
-     * second argument (y) priority over the first argumnnt (x).
+     * second argument (y) priority over the first argument (x).
      *
      * @param x  The first (lower priority) PropertyDescriptor
      * @param y  The second (higher priority) PropertyDescriptor
@@ -439,39 +439,37 @@
 
     IndexedPropertyDescriptor(PropertyDescriptor x, PropertyDescriptor y) {
         super(x,y);
+        Method tr = null;
+        Method tw = null;
+
         if (x instanceof IndexedPropertyDescriptor) {
-            IndexedPropertyDescriptor ix = (IndexedPropertyDescriptor)x;
-            try {
-                Method xr = ix.getIndexedReadMethod();
-                if (xr != null) {
-                    setIndexedReadMethod(xr);
-                }
+            IndexedPropertyDescriptor ix = (IndexedPropertyDescriptor) x;
+            tr = ix.getIndexedReadMethod();
+            tw = ix.getIndexedWriteMethod();
+        }
+        if (y instanceof IndexedPropertyDescriptor) {
+            IndexedPropertyDescriptor iy = (IndexedPropertyDescriptor) y;
+            Method yr = iy.getIndexedReadMethod();
+            if (isAssignable(tr, yr)) {
+                tr = yr;
+            }
 
-                Method xw = ix.getIndexedWriteMethod();
-                if (xw != null) {
-                    setIndexedWriteMethod(xw);
-                }
-            } catch (IntrospectionException ex) {
-                // Should not happen
-                throw new AssertionError(ex);
+            Method yw = iy.getIndexedWriteMethod();
+            if (isAssignable(tw, yw)) {
+                tw = yw;
             }
         }
-        if (y instanceof IndexedPropertyDescriptor) {
-            IndexedPropertyDescriptor iy = (IndexedPropertyDescriptor)y;
-            try {
-                Method yr = iy.getIndexedReadMethod();
-                if (yr != null && yr.getDeclaringClass() == getClass0()) {
-                    setIndexedReadMethod(yr);
-                }
 
-                Method yw = iy.getIndexedWriteMethod();
-                if (yw != null && yw.getDeclaringClass() == getClass0()) {
-                    setIndexedWriteMethod(yw);
-                }
-            } catch (IntrospectionException ex) {
-                // Should not happen
-                throw new AssertionError(ex);
+        try {
+            if(tr != null) {
+                setIndexedReadMethod(tr);
             }
+            if(tw != null) {
+                setIndexedWriteMethod(tw);
+            }
+        } catch(IntrospectionException ex) {
+            // Should not happen
+            throw new AssertionError(ex);
         }
     }
 
--- a/jdk/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java	Wed Jul 05 20:33:50 2017 +0200
@@ -748,7 +748,7 @@
         appendTo(sb, "writeMethod", this.writeMethodRef.get());
     }
 
-    private boolean isAssignable(Method m1, Method m2) {
+    boolean isAssignable(Method m1, Method m2) {
         if (m1 == null) {
             return true; // choose second method
         }
--- a/jdk/src/java.desktop/share/classes/javax/swing/AbstractCellEditor.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/AbstractCellEditor.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -53,7 +53,13 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public abstract class AbstractCellEditor implements CellEditor, Serializable {
 
+    /**
+     * The list of listeners.
+     */
     protected EventListenerList listenerList = new EventListenerList();
+    /**
+     * The change event.
+     */
     transient protected ChangeEvent changeEvent = null;
 
     // Force this to be implemented.
--- a/jdk/src/java.desktop/share/classes/javax/swing/AbstractListModel.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/AbstractListModel.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -50,6 +50,9 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public abstract class AbstractListModel<E> implements ListModel<E>, Serializable
 {
+    /**
+     * The listener list.
+     */
     protected EventListenerList listenerList = new EventListenerList();
 
 
--- a/jdk/src/java.desktop/share/classes/javax/swing/ButtonGroup.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/ButtonGroup.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -69,7 +69,9 @@
 @SuppressWarnings("serial")
 public class ButtonGroup implements Serializable {
 
-    // the list of buttons participating in this group
+    /**
+     * The list of buttons participating in this group.
+     */
     protected Vector<AbstractButton> buttons = new Vector<AbstractButton>();
 
     /**
--- a/jdk/src/java.desktop/share/classes/javax/swing/DefaultFocusManager.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/DefaultFocusManager.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -57,10 +57,19 @@
     private final LayoutComparator comparator =
         new LayoutComparator();
 
+    /**
+     * Constructs a {@code DefaultFocusManager}.
+     */
     public DefaultFocusManager() {
         setDefaultFocusTraversalPolicy(gluePolicy);
     }
 
+    /**
+     * Returns the component after.
+     * @return the component after
+     * @param aContainer a container
+     * @param aComponent a component
+     */
     public Component getComponentAfter(Container aContainer,
                                        Component aComponent)
     {
@@ -83,6 +92,12 @@
         return null;
     }
 
+    /**
+     * Returns the component before.
+     * @return the component before
+     * @param aContainer a container
+     * @param aComponent a component
+     */
     public Component getComponentBefore(Container aContainer,
                                         Component aComponent)
     {
@@ -105,6 +120,11 @@
         return null;
     }
 
+    /**
+     * Returns the first component.
+     * @return the first component
+     * @param aContainer a container
+     */
     public Component getFirstComponent(Container aContainer) {
         Container root = (aContainer.isFocusCycleRoot())
             ? aContainer
@@ -125,6 +145,11 @@
         return null;
     }
 
+    /**
+     * Returns the last component.
+     * @return the last component
+     * @param aContainer a container
+     */
     public Component getLastComponent(Container aContainer) {
         Container root = (aContainer.isFocusCycleRoot())
             ? aContainer
@@ -145,6 +170,12 @@
         return null;
     }
 
+    /**
+     * Compares the components by their focus traversal cycle order.
+     * @param a the first component
+     * @param b the second component
+     * @return a comparison of the components by their focus traversal cycle order
+     */
     public boolean compareTabOrder(Component a, Component b) {
         return (comparator.compare(a, b) < 0);
     }
--- a/jdk/src/java.desktop/share/classes/javax/swing/DefaultListCellRenderer.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/DefaultListCellRenderer.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -84,6 +84,9 @@
     */
     private static final Border SAFE_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
     private static final Border DEFAULT_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
+    /**
+     * No focus border
+     */
     protected static Border noFocusBorder = DEFAULT_NO_FOCUS_BORDER;
 
     /**
--- a/jdk/src/java.desktop/share/classes/javax/swing/DefaultListSelectionModel.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/DefaultListSelectionModel.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -68,8 +68,14 @@
     private int lastChangedIndex = MIN;
 
     private BitSet value = new BitSet(32);
+    /**
+     * The list of listeners.
+     */
     protected EventListenerList listenerList = new EventListenerList();
 
+    /**
+     * Whether or not the lead anchor notification is enabled.
+     */
     protected boolean leadAnchorNotificationEnabled = true;
 
     /** {@inheritDoc} */
@@ -139,6 +145,8 @@
 
     /**
      * Notifies listeners that we have ended a series of adjustments.
+     * @param isAdjusting true if this is the final change in a series of
+     *          adjustments
      */
     protected void fireValueChanged(boolean isAdjusting) {
         if (lastChangedIndex == MIN) {
--- a/jdk/src/java.desktop/share/classes/javax/swing/DefaultSingleSelectionModel.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/DefaultSingleSelectionModel.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -47,7 +47,8 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class DefaultSingleSelectionModel implements SingleSelectionModel,
 Serializable {
-    /* Only one ModelChangeEvent is needed per model instance since the
+    /**
+     * Only one ModelChangeEvent is needed per model instance since the
      * event's only (read-only) state is the source property.  The source
      * of events generated here is always "this".
      */
@@ -57,12 +58,16 @@
 
     private int index = -1;
 
-    // implements javax.swing.SingleSelectionModel
+    /**
+     * {@inheritDoc}
+     */
     public int getSelectedIndex() {
         return index;
     }
 
-    // implements javax.swing.SingleSelectionModel
+    /**
+     * {@inheritDoc}
+     */
     public void setSelectedIndex(int index) {
         if (this.index != index) {
             this.index = index;
@@ -70,12 +75,16 @@
         }
     }
 
-    // implements javax.swing.SingleSelectionModel
+    /**
+     * {@inheritDoc}
+     */
     public void clearSelection() {
         setSelectedIndex(-1);
     }
 
-    // implements javax.swing.SingleSelectionModel
+    /**
+     * {@inheritDoc}
+     */
     public boolean isSelected() {
         boolean ret = false;
         if (getSelectedIndex() != -1) {
--- a/jdk/src/java.desktop/share/classes/javax/swing/DesktopManager.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/DesktopManager.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -145,6 +145,7 @@
      * necessary state.  Normally <b>f</b> will be a JInternalFrame.
      *
      * @param f  the {@code JComponent} being resized
+     * @param direction the direction
      */
     void beginResizingFrame(JComponent f, int direction);
 
--- a/jdk/src/java.desktop/share/classes/javax/swing/JColorChooser.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JColorChooser.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -561,6 +561,9 @@
 // Accessibility support
 ////////////////
 
+    /**
+     * The accessible context.
+     */
     protected AccessibleContext accessibleContext = null;
 
     /**
--- a/jdk/src/java.desktop/share/classes/javax/swing/JComboBox.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JComboBox.java	Wed Jul 05 20:33:50 2017 +0200
@@ -577,6 +577,8 @@
                 if (!found) {
                     return;
                 }
+
+                getEditor().setItem(anObject);
             }
 
             // Must toggle the state of this flag since this method
@@ -1319,16 +1321,12 @@
      * do not call or override.
      */
     public void actionPerformed(ActionEvent e) {
-        ComboBoxEditor editor = getEditor();
-        if ((editor != null) && (e != null) && (editor == e.getSource()
-                || editor.getEditorComponent() == e.getSource())) {
-            setPopupVisible(false);
-            getModel().setSelectedItem(editor.getItem());
-            String oldCommand = getActionCommand();
-            setActionCommand("comboBoxEdited");
-            fireActionEvent();
-            setActionCommand(oldCommand);
-        }
+        setPopupVisible(false);
+        getModel().setSelectedItem(getEditor().getItem());
+        String oldCommand = getActionCommand();
+        setActionCommand("comboBoxEdited");
+        fireActionEvent();
+        setActionCommand(oldCommand);
     }
 
     /**
--- a/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java	Wed Jul 05 20:33:50 2017 +0200
@@ -57,6 +57,7 @@
 import static javax.swing.ClientPropertyKey.*;
 import javax.accessibility.*;
 
+import sun.awt.AWTAccessor;
 import sun.awt.SunToolkit;
 import sun.swing.SwingUtilities2;
 import sun.swing.UIClientPropertyKey;
@@ -4218,9 +4219,10 @@
      * @param c  the {@code Component} to be checked
      * @return true if this component is lightweight
      */
-    @SuppressWarnings("deprecation")
     public static boolean isLightweightComponent(Component c) {
-        return c.getPeer() instanceof LightweightPeer;
+        // TODO we cannot call c.isLightweight() because it is incorrectly
+        // overriden in DelegateContainer on osx.
+        return AWTAccessor.getComponentAccessor().isLightweight(c);
     }
 
 
@@ -5033,7 +5035,6 @@
         this.paintingChild = paintingChild;
     }
 
-    @SuppressWarnings("deprecation")
     void _paintImmediately(int x, int y, int w, int h) {
         Graphics g;
         Container c;
@@ -5159,7 +5160,7 @@
         }
 
         // If the clip width or height is negative, don't bother painting
-        if(c == null || c.getPeer() == null ||
+        if(c == null || !c.isDisplayable() ||
                         paintImmediatelyClip.width <= 0 ||
                         paintImmediatelyClip.height <= 0) {
             recycleRectangle(paintImmediatelyClip);
--- a/jdk/src/java.desktop/share/classes/javax/swing/JEditorPane.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JEditorPane.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -726,6 +726,8 @@
      * URL's can be properly resolved.
      *
      * @param page  the URL of the page
+     * @return a stream for the URL which is about to be loaded
+     * @throws IOException if an I/O problem occurs
      */
     protected InputStream getStream(URL page) throws IOException {
         final URLConnection conn = page.openConnection();
@@ -1712,10 +1714,17 @@
 
         private AccessibleContext accessibleContext;
 
+        /**
+         * Returns the accessible text.
+         * @return the accessible text
+         */
         public AccessibleText getAccessibleText() {
             return new JEditorPaneAccessibleHypertextSupport();
         }
 
+        /**
+         * Constructs an {@code AccessibleJEditorPaneHTML}.
+         */
         protected AccessibleJEditorPaneHTML () {
             HTMLEditorKit kit = (HTMLEditorKit)JEditorPane.this.getEditorKit();
             accessibleContext = kit.getAccessibleContext();
@@ -1791,9 +1800,16 @@
     protected class JEditorPaneAccessibleHypertextSupport
     extends AccessibleJEditorPane implements AccessibleHypertext {
 
+        /**
+         * An HTML link.
+         */
         public class HTMLLink extends AccessibleHyperlink {
             Element element;
 
+            /**
+             * Constructs a {@code HTMLLink}.
+             * @param e the element
+             */
             public HTMLLink(Element e) {
                 element = e;
             }
--- a/jdk/src/java.desktop/share/classes/javax/swing/JInternalFrame.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JInternalFrame.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -38,7 +38,6 @@
 
 import java.io.ObjectOutputStream;
 import java.io.IOException;
-import java.lang.StringBuilder;
 import java.beans.PropertyChangeListener;
 import sun.awt.AppContext;
 import sun.swing.SwingUtilities2;
@@ -1654,7 +1653,7 @@
      * <dt><code>DO_NOTHING_ON_CLOSE</code>
      * <dd> Do nothing.
      *      This requires the program to handle the operation
-     *      in the <code>windowClosing</code> method
+     *      in the <code>internalFrameClosing</code> method
      *      of a registered <code>InternalFrameListener</code> object.
      * <dt><code>HIDE_ON_CLOSE</code>
      * <dd> Automatically make the internal frame invisible.
--- a/jdk/src/java.desktop/share/classes/javax/swing/JList.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JList.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -2890,6 +2890,9 @@
 
         int leadSelectionIndex;
 
+        /**
+         * Constructs an {@code AccessibleJList}.
+         */
         public AccessibleJList() {
             super();
             JList.this.addPropertyChangeListener(this);
@@ -3193,6 +3196,11 @@
             private ListModel<E> listModel;
             private ListCellRenderer<? super E> cellRenderer = null;
 
+            /**
+             * Constructs an {@code AccessibleJListChild}.
+             * @param parent the parent
+             * @param indexInParent the index in the parent
+             */
             public AccessibleJListChild(JList<E> parent, int indexInParent) {
                 this.parent = parent;
                 this.setAccessibleParent(parent);
--- a/jdk/src/java.desktop/share/classes/javax/swing/JTable.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JTable.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -6803,12 +6803,25 @@
         protected class AccessibleJTableModelChange
             implements AccessibleTableModelChange {
 
+            /** The type */
             protected int type;
+            /** The first row */
             protected int firstRow;
+            /** The last row */
             protected int lastRow;
+            /** The first column */
             protected int firstColumn;
+            /** The last column */
             protected int lastColumn;
 
+            /**
+             * Constructs an {@code AccessibleJTableModelChange}.
+             * @param type the type
+             * @param firstRow the first row
+             * @param lastRow the last row
+             * @param firstColumn the first column
+             * @param lastColumn the last column
+             */
             protected AccessibleJTableModelChange(int type, int firstRow,
                                                   int lastRow, int firstColumn,
                                                   int lastColumn) {
@@ -6819,22 +6832,42 @@
                 this.lastColumn = lastColumn;
             }
 
+            /**
+             * Returns the type.
+             * @return the type
+             */
             public int getType() {
                 return type;
             }
 
+            /**
+             * Returns the first row.
+             * @return the first row
+             */
             public int getFirstRow() {
                 return firstRow;
             }
 
+            /**
+             * Returns the last row.
+             * @return the last row
+             */
             public int getLastRow() {
                 return lastRow;
             }
 
+            /**
+             * Returns the first column.
+             * @return the first column
+             */
             public int getFirstColumn() {
                 return firstColumn;
             }
 
+            /**
+             * Returns the last column.
+             * @return the last column
+             */
             public int getLastColumn() {
                 return lastColumn;
             }
--- a/jdk/src/java.desktop/share/classes/javax/swing/JViewport.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JViewport.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -37,6 +37,8 @@
 
 import java.io.Serializable;
 
+import sun.awt.AWTAccessor;
+
 /**
  * The "viewport" or "porthole" through which you see the underlying
  * information. When you scroll, what moves is the viewport. It is like
@@ -380,7 +382,6 @@
      * @param contentRect the <code>Rectangle</code> to display
      * @see JComponent#isValidateRoot
      * @see java.awt.Component#isValid
-     * @see java.awt.Component#getPeer
      */
     public void scrollRectToVisible(Rectangle contentRect) {
         Component view = getView();
@@ -1448,7 +1449,6 @@
      * Returns true if the component needs to be completely repainted after
      * a blit and a paint is received.
      */
-    @SuppressWarnings("deprecation")
     private boolean needsRepaintAfterBlit() {
         // Find the first heavy weight ancestor. isObscured and
         // canDetermineObscurity are only appropriate for heavy weights.
@@ -1459,7 +1459,8 @@
         }
 
         if (heavyParent != null) {
-            ComponentPeer peer = heavyParent.getPeer();
+            ComponentPeer peer = AWTAccessor.getComponentAccessor()
+                                            .getPeer(heavyParent);
 
             if (peer != null && peer.canDetermineObscurity() &&
                                 !peer.isObscured()) {
--- a/jdk/src/java.desktop/share/classes/javax/swing/RepaintManager.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/RepaintManager.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -401,7 +401,6 @@
      *
      * @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.
          */
@@ -432,7 +431,7 @@
         // it could lead to the possibility of getting locks out
         // of order and deadlocking.
         for (Container p = c; p != null; p = p.getParent()) {
-            if (!p.isVisible() || (p.getPeer() == null)) {
+            if (!p.isVisible() || !p.isDisplayable()) {
                 return;
             }
             if ((p instanceof Window) || (p instanceof Applet)) {
--- a/jdk/src/java.desktop/share/classes/javax/swing/SortingFocusTraversalPolicy.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/SortingFocusTraversalPolicy.java	Wed Jul 05 20:33:50 2017 +0200
@@ -570,7 +570,10 @@
             } else if (comp instanceof Container && comp != aContainer) {
                 Container cont = (Container)comp;
                 if (cont.isFocusTraversalPolicyProvider()) {
-                    return cont.getFocusTraversalPolicy().getLastComponent(cont);
+                    Component retComp = cont.getFocusTraversalPolicy().getLastComponent(cont);
+                    if (retComp != null) {
+                        return retComp;
+                    }
                 }
             }
         }
--- a/jdk/src/java.desktop/share/classes/javax/swing/ToolTipManager.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/ToolTipManager.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -80,8 +80,13 @@
     private KeyStroke postTip;
     private KeyStroke hideTip;
 
-    // PENDING(ges)
+    /**
+     * Lightweight popup enabled.
+     */
     protected boolean lightWeightPopupEnabled = true;
+    /**
+     * Heavyweight popup enabled.
+     */
     protected boolean heavyWeightPopupEnabled = false;
 
     ToolTipManager() {
@@ -657,7 +662,13 @@
         }
     }
 
+    /**
+     * Inside timer action.
+     */
     protected class insideTimerAction implements ActionListener {
+        /**
+         * {@inheritDoc}
+         */
         public void actionPerformed(ActionEvent e) {
             if(insideComponent != null && insideComponent.isShowing()) {
                 // Lazy lookup
@@ -681,13 +692,25 @@
         }
     }
 
+    /**
+     * Outside timer action.
+     */
     protected class outsideTimerAction implements ActionListener {
+        /**
+         * {@inheritDoc}
+         */
         public void actionPerformed(ActionEvent e) {
             showImmediately = false;
         }
     }
 
+    /**
+     * Still inside timer action.
+     */
     protected class stillInsideTimerAction implements ActionListener {
+        /**
+         * {@inheritDoc}
+         */
         public void actionPerformed(ActionEvent e) {
             hideTipWindow();
             enterTimer.stop();
--- a/jdk/src/java.desktop/share/classes/javax/swing/UIDefaults.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/UIDefaults.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -1191,6 +1191,10 @@
         /** Key bindings are registered under. */
         private Object[] bindings;
 
+        /**
+         * Constructs a {@code LazyInputMap}.
+         * @param bindings the bindings
+         */
         public LazyInputMap(Object[] bindings) {
             this.bindings = bindings;
         }
--- a/jdk/src/java.desktop/share/classes/javax/swing/border/BevelBorder.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/border/BevelBorder.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -52,10 +52,25 @@
     /** Lowered bevel type. */
     public static final int LOWERED = 1;
 
+    /**
+     * The bevel type.
+     */
     protected int bevelType;
+    /**
+     * The color to use for the bevel outer highlight.
+     */
     protected Color highlightOuter;
+    /**
+     * The color to use for the bevel inner highlight.
+     */
     protected Color highlightInner;
+    /**
+     * The color to use for the bevel inner shadow.
+     */
     protected Color shadowInner;
+    /**
+     * the color to use for the bevel outer shadow
+     */
     protected Color shadowOuter;
 
     /**
@@ -262,6 +277,17 @@
      */
     public boolean isBorderOpaque() { return true; }
 
+    /**
+     * Paints a raised bevel for the specified component with the specified
+     * position and size.
+     *
+     * @param c the component for which the raised bevel is being painted
+     * @param g the paint graphics
+     * @param x the x position of the raised bevel
+     * @param y the y position of the raised bevel
+     * @param width the width of the raised bevel
+     * @param height the height of the raised bevel
+     */
     protected void paintRaisedBevel(Component c, Graphics g, int x, int y,
                                     int width, int height)  {
         Color oldColor = g.getColor();
@@ -291,6 +317,17 @@
 
     }
 
+    /**
+     * Paints a lowered bevel for the specified component with the specified
+     * position and size.
+     *
+     * @param c the component for which the lowered bevel is being painted
+     * @param g the paint graphics
+     * @param x the x position of the lowered bevel
+     * @param y the y position of the lowered bevel
+     * @param width the width of the lowered bevel
+     * @param height the height of the lowered bevel
+     */
     protected void paintLoweredBevel(Component c, Graphics g, int x, int y,
                                         int width, int height)  {
         Color oldColor = g.getColor();
--- a/jdk/src/java.desktop/share/classes/javax/swing/border/CompoundBorder.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/border/CompoundBorder.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -56,7 +56,13 @@
  */
 @SuppressWarnings("serial")
 public class CompoundBorder extends AbstractBorder {
+    /**
+     * The outside border.
+     */
     protected Border outsideBorder;
+    /**
+     * The inside border.
+     */
     protected Border insideBorder;
 
     /**
--- a/jdk/src/java.desktop/share/classes/javax/swing/border/EmptyBorder.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/border/EmptyBorder.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -49,7 +49,22 @@
 @SuppressWarnings("serial")
 public class EmptyBorder extends AbstractBorder implements Serializable
 {
-    protected int left, right, top, bottom;
+    /**
+     * The left inset of the border.
+     */
+    protected int left;
+    /**
+     * The right inset of the border.
+     */
+    protected int right;
+    /**
+     * The top inset of the border.
+     */
+    protected int top;
+    /**
+     * The bottom inset of the border.
+     */
+    protected int bottom;
 
     /**
      * Creates an empty border with the specified insets.
--- a/jdk/src/java.desktop/share/classes/javax/swing/border/EtchedBorder.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/border/EtchedBorder.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -59,8 +59,17 @@
     /** Lowered etched type. */
     public static final int LOWERED = 1;
 
+    /**
+     * The type of etch to be drawn by the border.
+     */
     protected int etchType;
+    /**
+     * The color to use for the etched highlight.
+     */
     protected Color highlight;
+    /**
+     * The color to use for the etched shadow.
+     */
     protected Color shadow;
 
     /**
--- a/jdk/src/java.desktop/share/classes/javax/swing/border/LineBorder.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/border/LineBorder.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -56,8 +56,17 @@
     private static Border blackLine;
     private static Border grayLine;
 
+    /**
+     * Thickness of the border.
+     */
     protected int thickness;
+    /**
+     * Color of the border.
+     */
     protected Color lineColor;
+    /**
+     * Whether or not the border has rounded corners.
+     */
     protected boolean roundedCorners;
 
     /**
--- a/jdk/src/java.desktop/share/classes/javax/swing/border/MatteBorder.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/border/MatteBorder.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -49,7 +49,13 @@
 @SuppressWarnings("serial")
 public class MatteBorder extends EmptyBorder
 {
+    /**
+     * The color rendered for the border.
+     */
     protected Color color;
+    /**
+     * The icon to be used for tiling the border.
+     */
     protected Icon tileIcon;
 
     /**
--- a/jdk/src/java.desktop/share/classes/javax/swing/border/TitledBorder.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/border/TitledBorder.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -70,11 +70,29 @@
 @SuppressWarnings("serial")
 public class TitledBorder extends AbstractBorder
 {
+    /**
+     * The title the border should display.
+     */
     protected String title;
+    /**
+     * The border.
+     */
     protected Border border;
+    /**
+     * The position for the title.
+     */
     protected int titlePosition;
+    /**
+     * The justification for the title.
+     */
     protected int titleJustification;
+    /**
+     * The font for rendering the title.
+     */
     protected Font titleFont;
+    /**
+     * The color of the title.
+     */
     protected Color titleColor;
 
     private final JLabel label;
@@ -117,13 +135,19 @@
      */
     static public final int     TRAILING = 5;
 
-    // Space between the border and the component's edge
+    /**
+     * Space between the border and the component's edge
+     */
     static protected final int EDGE_SPACING = 2;
 
-    // Space between the border and text
+    /**
+     * Space between the border and text
+     */
     static protected final int TEXT_SPACING = 2;
 
-    // Horizontal inset of text that is left or right justified
+    /**
+     * Horizontal inset of text that is left or right justified
+     */
     static protected final int TEXT_INSET_H = 5;
 
     /**
@@ -676,6 +700,11 @@
         return justification;
     }
 
+    /**
+     * Returns default font of the titled border.
+     * @return default font of the titled border
+     * @param c the component
+     */
     protected Font getFont(Component c) {
         Font font = getTitleFont();
         if (font != null) {
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/ActionMapUIResource.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/ActionMapUIResource.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -37,6 +37,9 @@
  */
 @SuppressWarnings("serial") // Superclass is not serializable across versions
 public class ActionMapUIResource extends ActionMap implements UIResource {
+    /**
+     * Constructs an {@code ActionMapUIResource}.
+     */
     public ActionMapUIResource() {
     }
 }
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/BorderUIResource.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/BorderUIResource.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -38,7 +38,7 @@
 import javax.swing.plaf.UIResource;
 
 
-/*
+/**
  * A Border wrapper class which implements UIResource.  UI
  * classes which set border properties should use this class
  * to wrap any borders specified as defaults.
@@ -67,6 +67,10 @@
     static Border raisedBevel;
     static Border blackLine;
 
+    /**
+     * Returns a etched border UI resource.
+     * @return a etched border UI resource
+     */
     public static Border getEtchedBorderUIResource() {
         if (etched == null) {
             etched = new EtchedBorderUIResource();
@@ -74,6 +78,10 @@
         return etched;
     }
 
+    /**
+     * Returns a lowered bevel border UI resource.
+     * @return a lowered bevel border UI resource
+     */
     public static Border getLoweredBevelBorderUIResource() {
         if (loweredBevel == null) {
             loweredBevel = new BevelBorderUIResource(BevelBorder.LOWERED);
@@ -81,6 +89,10 @@
         return loweredBevel;
     }
 
+    /**
+     * Returns a raised bevel border UI resource.
+     * @return a raised bevel border UI resource
+     */
     public static Border getRaisedBevelBorderUIResource() {
         if (raisedBevel == null) {
             raisedBevel = new BevelBorderUIResource(BevelBorder.RAISED);
@@ -88,6 +100,10 @@
         return raisedBevel;
     }
 
+    /**
+     * Returns a black line border UI resource.
+     * @return a black line border UI resource
+     */
     public static Border getBlackLineBorderUIResource() {
         if (blackLine == null) {
             blackLine = new LineBorderUIResource(Color.black);
@@ -122,7 +138,15 @@
         return delegate.isBorderOpaque();
     }
 
+    /**
+     * A compound border UI resource.
+     */
     public static class CompoundBorderUIResource extends CompoundBorder implements UIResource {
+        /**
+         * Constructs a {@code CompoundBorderUIResource}.
+         * @param outsideBorder the outside border
+         * @param insideBorder the inside border
+         */
         @ConstructorProperties({"outsideBorder", "insideBorder"})
         public CompoundBorderUIResource(Border outsideBorder, Border insideBorder) {
             super(outsideBorder, insideBorder);
@@ -130,23 +154,49 @@
 
     }
 
+    /**
+     * An empty border UI resource.
+     */
     public static class EmptyBorderUIResource extends EmptyBorder implements UIResource {
 
+        /**
+         * Constructs a {@code EmptyBorderUIResource}.
+         * @param top the top inset of the border
+         * @param left the left inset of the border
+         * @param bottom the bottom inset of the border
+         * @param right the right inset of the border
+         */
         public EmptyBorderUIResource(int top, int left, int bottom, int right)   {
             super(top, left, bottom, right);
         }
+        /**
+         * Constructs a {@code EmptyBorderUIResource}.
+         * @param insets the insets of the border
+         */
         @ConstructorProperties({"borderInsets"})
         public EmptyBorderUIResource(Insets insets) {
             super(insets);
         }
     }
 
+    /**
+     * A line border UI resource.
+     */
     public static class LineBorderUIResource extends LineBorder implements UIResource {
 
+        /**
+         * Constructs a {@code LineBorderUIResource}.
+         * @param color the color for the border
+         */
         public LineBorderUIResource(Color color) {
             super(color);
         }
 
+        /**
+         * Constructs a {@code LineBorderUIResource}.
+         * @param color the color for the border
+         * @param thickness the thickness of the border
+         */
         @ConstructorProperties({"lineColor", "thickness"})
         public LineBorderUIResource(Color color, int thickness)  {
             super(color, thickness);
@@ -154,16 +204,37 @@
     }
 
 
+    /**
+     * A bevel border UI resource.
+     */
     public static class BevelBorderUIResource extends BevelBorder implements UIResource {
 
+        /**
+         * Constructs a {@code BevelBorderUIResource}.
+         * @param bevelType the type of bevel for the border
+         */
         public BevelBorderUIResource(int bevelType) {
             super(bevelType);
         }
 
+        /**
+         * Constructs a {@code BevelBorderUIResource}.
+         * @param bevelType the type of bevel for the border
+         * @param highlight the color to use for the bevel highlight
+         * @param shadow the color to use for the bevel shadow
+         */
         public BevelBorderUIResource(int bevelType, Color highlight, Color shadow) {
             super(bevelType, highlight, shadow);
         }
 
+        /**
+         * Constructs a {@code BevelBorderUIResource}.
+         * @param bevelType the type of bevel for the border
+         * @param highlightOuter the color to use for the bevel outer highlight
+         * @param highlightInner the color to use for the bevel inner highlight
+         * @param shadowOuter the color to use for the bevel outer shadow
+         * @param shadowInner the color to use for the bevel inner shadow
+         */
         @ConstructorProperties({"bevelType", "highlightOuterColor", "highlightInnerColor", "shadowOuterColor", "shadowInnerColor"})
         public BevelBorderUIResource(int bevelType,
                                      Color highlightOuter, Color highlightInner,
@@ -172,57 +243,124 @@
         }
     }
 
+    /**
+     * An etched border UI resource.
+     */
     public static class EtchedBorderUIResource extends EtchedBorder implements UIResource {
 
+        /**
+         * Constructs an {@code EtchedBorderUIResource}.
+         */
         public EtchedBorderUIResource()    {
             super();
         }
 
+        /**
+         * Constructs an {@code EtchedBorderUIResource}.
+         * @param etchType the type of etch to be drawn by the border
+         */
         public EtchedBorderUIResource(int etchType)    {
             super(etchType);
         }
 
+        /**
+         * Constructs an {@code EtchedBorderUIResource}.
+         * @param highlight the color to use for the etched highlight
+         * @param shadow the color to use for the etched shadow
+         */
         public EtchedBorderUIResource(Color highlight, Color shadow)    {
             super(highlight, shadow);
         }
 
+        /**
+         * Constructs an {@code EtchedBorderUIResource}.
+         * @param etchType the type of etch to be drawn by the border
+         * @param highlight the color to use for the etched highlight
+         * @param shadow the color to use for the etched shadow
+         */
         @ConstructorProperties({"etchType", "highlightColor", "shadowColor"})
         public EtchedBorderUIResource(int etchType, Color highlight, Color shadow)    {
             super(etchType, highlight, shadow);
         }
     }
 
+    /**
+     * A matte border UI resource.
+     */
     public static class MatteBorderUIResource extends MatteBorder implements UIResource {
 
+        /**
+         * Constructs a {@code MatteBorderUIResource}.
+         * @param top the top inset of the border
+         * @param left the left inset of the border
+         * @param bottom the bottom inset of the border
+         * @param right the right inset of the border
+         * @param color the color rendered for the border
+         */
         public MatteBorderUIResource(int top, int left, int bottom, int right,
                                      Color color)   {
             super(top, left, bottom, right, color);
         }
 
+        /**
+         * Constructs a {@code MatteBorderUIResource}.
+         * @param top the top inset of the border
+         * @param left the left inset of the border
+         * @param bottom the bottom inset of the border
+         * @param right the right inset of the border
+         * @param tileIcon the icon to be used for tiling the border
+         */
         public MatteBorderUIResource(int top, int left, int bottom, int right,
                                      Icon tileIcon)   {
             super(top, left, bottom, right, tileIcon);
         }
 
+        /**
+         * Constructs a {@code MatteBorderUIResource}.
+         * @param tileIcon the icon to be used for tiling the border
+         */
         public MatteBorderUIResource(Icon tileIcon)   {
             super(tileIcon);
         }
     }
 
+    /**
+     * A titled border UI resource.
+     */
     public static class TitledBorderUIResource extends TitledBorder implements UIResource {
 
+        /**
+         * Constructs a {@code TitledBorderUIResource}.
+         * @param title the title the border should display
+         */
         public TitledBorderUIResource(String title)     {
             super(title);
         }
 
+        /**
+         * Constructs a {@code TitledBorderUIResource}.
+         * @param border the border
+         */
         public TitledBorderUIResource(Border border)       {
             super(border);
         }
 
+        /**
+         * Constructs a {@code TitledBorderUIResource}.
+         * @param border the border
+         * @param title the title the border should display
+         */
         public TitledBorderUIResource(Border border, String title) {
             super(border, title);
         }
 
+        /**
+         * Constructs a {@code TitledBorderUIResource}.
+         * @param border the border
+         * @param title the title the border should display
+         * @param titleJustification the justification fro the title
+         * @param titlePosition the position for the title
+         */
         public TitledBorderUIResource(Border border,
                         String title,
                         int titleJustification,
@@ -230,6 +368,14 @@
             super(border, title, titleJustification, titlePosition);
         }
 
+        /**
+         * Constructs a {@code TitledBorderUIResource}.
+         * @param border the border
+         * @param title the title the border should display
+         * @param titleJustification the justification fro the title
+         * @param titlePosition the position for the title
+         * @param titleFont the font for rendering the title
+         */
         public TitledBorderUIResource(Border border,
                         String title,
                         int titleJustification,
@@ -238,6 +384,15 @@
             super(border, title, titleJustification, titlePosition, titleFont);
         }
 
+        /**
+         * Constructs a {@code TitledBorderUIResource}.
+         * @param border the border
+         * @param title the title the border should display
+         * @param titleJustification the justification fro the title
+         * @param titlePosition the position for the title
+         * @param titleFont the font for rendering the title
+         * @param titleColor the color of the title
+         */
         @ConstructorProperties({"border", "title", "titleJustification", "titlePosition", "titleFont", "titleColor"})
         public TitledBorderUIResource(Border border,
                         String title,
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/ColorUIResource.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/ColorUIResource.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -28,7 +28,7 @@
 import java.awt.Color;
 import java.beans.ConstructorProperties;
 
-/*
+/**
  * A subclass of Color that implements UIResource.  UI
  * classes that create colors should use this class.
  * <p>
@@ -48,19 +48,39 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class ColorUIResource extends Color implements UIResource
 {
+    /**
+     * Constructs a {@code ColorUIResource}.
+     * @param r the red component
+     * @param g the green component
+     * @param b the blue component
+     */
     @ConstructorProperties({"red", "green", "blue"})
     public ColorUIResource(int r, int g, int b) {
         super(r, g, b);
     }
 
+    /**
+     * Constructs a {@code ColorUIResource}.
+     * @param rgb the combined RGB components
+     */
     public ColorUIResource(int rgb) {
         super(rgb);
     }
 
+    /**
+     * Constructs a {@code ColorUIResource}.
+     * @param r the red component
+     * @param g the green component
+     * @param b the blue component
+     */
     public ColorUIResource(float r, float g, float b) {
         super(r, g, b);
     }
 
+    /**
+     * Constructs a {@code ColorUIResource}.
+     * @param c the color
+     */
     public ColorUIResource(Color c) {
         super(c.getRGB(), (c.getRGB() & 0xFF000000) != 0xFF000000);
     }
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/ComponentInputMapUIResource.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/ComponentInputMapUIResource.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -38,6 +38,10 @@
  */
 @SuppressWarnings("serial") // Superclass is not serializable across versions
 public class ComponentInputMapUIResource extends ComponentInputMap implements UIResource {
+    /**
+     * Constructs a {@code ComponentInputMapUIResource}.
+     * @param component a non-null JComponent
+     */
     public ComponentInputMapUIResource(JComponent component) {
         super(component);
     }
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/DimensionUIResource.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/DimensionUIResource.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -29,7 +29,7 @@
 import javax.swing.plaf.UIResource;
 
 
-/*
+/**
  * A subclass of <code>Dimension</code> that implements
  * <code>UIResource</code>.  UI classes that use
  * <code>Dimension</code> values for default properties
@@ -51,6 +51,11 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class DimensionUIResource extends Dimension implements UIResource
 {
+    /**
+     * Constructs a {@code DimensionUIResource}.
+     * @param width the width
+     * @param height the height
+     */
     public DimensionUIResource(int width, int height) {
         super(width, height);
     }
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/FileChooserUI.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/FileChooserUI.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -38,13 +38,42 @@
 
 public abstract class FileChooserUI extends ComponentUI
 {
+    /**
+     * Returns an accept-all file filter.
+     * @param fc the file chooser
+     * @return an accept-all file filter
+     */
     public abstract FileFilter getAcceptAllFileFilter(JFileChooser fc);
+    /**
+     * Returns a file view.
+     * @param fc the file chooser
+     * @return a file view
+     */
     public abstract FileView getFileView(JFileChooser fc);
 
+    /**
+     * Returns approve button text.
+     * @param fc the file chooser
+     * @return approve button text.
+     */
     public abstract String getApproveButtonText(JFileChooser fc);
+    /**
+     * Returns the dialog title.
+     * @param fc the file chooser
+     * @return the dialog title.
+     */
     public abstract String getDialogTitle(JFileChooser fc);
 
+    /**
+     * Rescan the current directory.
+     * @param fc the file chooser
+     */
     public abstract void rescanCurrentDirectory(JFileChooser fc);
+    /**
+     * Ensure the file in question is visible.
+     * @param fc the file chooser
+     * @param f the file
+     */
     public abstract void ensureFileIsVisible(JFileChooser fc, File f);
 
     /**
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/FontUIResource.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/FontUIResource.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -50,10 +50,20 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class FontUIResource extends Font implements UIResource
 {
+    /**
+     * Constructs a {@code FontUIResource}.
+     * @param name the font name
+     * @param style the style constant for the font
+     * @param size the point size of the font
+     */
     public FontUIResource(String name, int style, int size) {
         super(name, style, size);
     }
 
+    /**
+     * Constructs a {@code FontUIResource}.
+     * @param font the font
+     */
     public FontUIResource(Font font) {
         super(font);
     }
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/InputMapUIResource.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/InputMapUIResource.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -37,6 +37,9 @@
  */
 @SuppressWarnings("serial") // Same-version serialization only
 public class InputMapUIResource extends InputMap implements UIResource {
+    /**
+     * Constructs an {@code InputMapUIResource}.
+     */
     public InputMapUIResource() {
     }
 }
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/InsetsUIResource.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/InsetsUIResource.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -29,7 +29,7 @@
 import javax.swing.plaf.UIResource;
 
 
-/*
+/**
  * A subclass of Insets that implements UIResource.  UI
  * classes that use Insets values for default properties
  * should use this class.
@@ -50,6 +50,13 @@
 @SuppressWarnings("serial") // Same-version serialization only
 public class InsetsUIResource extends Insets implements UIResource
 {
+    /**
+     * Constructs an {@code InsetsUIResource}.
+     * @param top the inset from the top
+     * @param left the inset from the left
+     * @param bottom the inset from the bottom
+     * @param right the inset from the right
+     */
     public InsetsUIResource(int top, int left, int bottom, int right) {
         super(top, left, bottom, right);
     }
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/LayerUI.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/LayerUI.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -730,6 +730,15 @@
      * This method is to be overridden instead of {@code JLayer.imageUpdate}.
      * <p>
      * <b>Note:</b> This method is usually called <b>not</b> on the Event Dispatching Thread.
+     *
+     * @param img the image being observed
+     * @param infoflags see imageUpdate for information
+     * @param x the x coordinate
+     * @param y the y coordinate
+     * @param w the width
+     * @param h the height
+     * @param l a {@code JLayer} component
+     * @return false if the infoflags indicate that the image is completely loaded; true otherwise
      */
     public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h, JLayer<? extends V> l) {
         return l.imageUpdate(img, infoflags, x, y, w, h);
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/TabbedPaneUI.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/TabbedPaneUI.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -35,7 +35,25 @@
  * @author Amy Fowler
  */
 public abstract class TabbedPaneUI extends ComponentUI {
+    /**
+     * Returns the tab for the coordinate.
+     * @param pane the pane
+     * @param x the x coordinate
+     * @param y the y coordinate
+     * @return the tab for the coordinate
+     */
     public abstract int tabForCoordinate(JTabbedPane pane, int x, int y);
+    /**
+     * Returns the rectangle for the tab bounds.
+     * @param pane the pane
+     * @param index the index
+     * @return the rectangle for the tab bounds
+     */
     public abstract Rectangle getTabBounds(JTabbedPane pane, int index);
+    /**
+     * Returns the tab run count.
+     * @param pane the pane
+     * @return the tab run count
+     */
     public abstract int getTabRunCount(JTabbedPane pane);
 }
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java	Wed Jul 05 20:33:50 2017 +0200
@@ -992,7 +992,7 @@
         getDisplaySize();
         if (sameBaseline) {
             Insets insets = c.getInsets();
-            height = height - insets.top - insets.bottom;
+            height = Math.max(height - insets.top - insets.bottom, 0);
             if (!comboBox.isEditable()) {
                 ListCellRenderer<Object> renderer = comboBox.getRenderer();
                 if (renderer == null)  {
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -222,12 +222,14 @@
 
     /**
      * Obsolete - not used.
+     * @param e list data event
      */
     public void intervalAdded(ListDataEvent e) {
     }
 
     /**
      * Obsolete - not used.
+     * @param e list data event
      */
     public void intervalRemoved(ListDataEvent e) {
     }
@@ -241,7 +243,12 @@
         ShellFolder.sort(v);
     }
 
-    // Obsolete - not used
+    /**
+     * Obsolete - not used
+     * @return a comparison of the file names
+     * @param a a file
+     * @param b another file
+     */
     protected boolean lt(File a, File b) {
         // First ignore case when comparing
         int diff = a.getName().toLowerCase().compareTo(b.getName().toLowerCase());
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -50,23 +50,39 @@
 public class BasicFileChooserUI extends FileChooserUI {
 
     /* FileView icons */
+    /** Directory icon */
     protected Icon directoryIcon = null;
+    /** File icon */
     protected Icon fileIcon = null;
+    /** Computer icon */
     protected Icon computerIcon = null;
+    /** Hard drive icon */
     protected Icon hardDriveIcon = null;
+    /** Floppy drive icon */
     protected Icon floppyDriveIcon = null;
 
+    /** New folder icon */
     protected Icon newFolderIcon = null;
+    /** Up folder icon */
     protected Icon upFolderIcon = null;
+    /** Home folder icon */
     protected Icon homeFolderIcon = null;
+    /** List view icon */
     protected Icon listViewIcon = null;
+    /** Details view icon */
     protected Icon detailsViewIcon = null;
+    /** View menu icon */
     protected Icon viewMenuIcon = null;
 
+    /** Save button mnemonic */
     protected int saveButtonMnemonic = 0;
+    /** Open button mnemonic */
     protected int openButtonMnemonic = 0;
+    /** Cancel button mnemonic */
     protected int cancelButtonMnemonic = 0;
+    /** Update button mnemonic */
     protected int updateButtonMnemonic = 0;
+    /** Help button mnemonic */
     protected int helpButtonMnemonic = 0;
 
     /**
@@ -77,10 +93,15 @@
      */
     protected int directoryOpenButtonMnemonic = 0;
 
+    /** Save button text */
     protected String saveButtonText = null;
+    /** Open button text */
     protected String openButtonText = null;
+    /** Cancel button text */
     protected String cancelButtonText = null;
+    /** Update button text */
     protected String updateButtonText = null;
+    /** Help button text */
     protected String helpButtonText = null;
 
     /**
@@ -91,13 +112,20 @@
      */
     protected String directoryOpenButtonText = null;
 
+    /** Open dialog title text */
     private String openDialogTitleText = null;
+    /** Save dialog title text */
     private String saveDialogTitleText = null;
 
+    /** Save button tool tip text */
     protected String saveButtonToolTipText = null;
+    /** Open button tool tip text */
     protected String openButtonToolTipText = null;
+    /** Cancel button tool tip text */
     protected String cancelButtonToolTipText = null;
+    /** Update button tool tip text */
     protected String updateButtonToolTipText = null;
+    /** Help button tool tip text */
     protected String helpButtonToolTipText = null;
 
     /**
@@ -158,9 +186,17 @@
         return new BasicFileChooserUI((JFileChooser) c);
     }
 
+    /**
+     * Constructs a {@code BasicFileChooserUI}.
+     * @param b file chooser
+     */
     public BasicFileChooserUI(JFileChooser b) {
     }
 
+    /**
+     * Installs the UI.
+     * @param c the component
+     */
     public void installUI(JComponent c) {
         accessoryPanel = new JPanel(new BorderLayout());
         filechooser = (JFileChooser) c;
@@ -175,6 +211,10 @@
         filechooser.applyComponentOrientation(filechooser.getComponentOrientation());
     }
 
+    /**
+     * Uninstalls the UI.
+     * @param c the component
+     */
     public void uninstallUI(JComponent c) {
         uninstallListeners(filechooser);
         uninstallComponents(filechooser);
@@ -190,12 +230,24 @@
         handler = null;
     }
 
+    /**
+     * Installs the components.
+     * @param fc the file chooser
+     */
     public void installComponents(JFileChooser fc) {
     }
 
+    /**
+     * Uninstalls the components.
+     * @param fc the file chooser
+     */
     public void uninstallComponents(JFileChooser fc) {
     }
 
+    /**
+     * Installs the listeners.
+     * @param fc the file chooser
+     */
     protected void installListeners(JFileChooser fc) {
         propertyChangeListener = createPropertyChangeListener(fc);
         if(propertyChangeListener != null) {
@@ -241,6 +293,10 @@
     }
 
 
+    /**
+     * Uninstalls the listeners.
+     * @param fc the file chooser
+     */
     protected void uninstallListeners(JFileChooser fc) {
         if(propertyChangeListener != null) {
             fc.removePropertyChangeListener(propertyChangeListener);
@@ -252,6 +308,10 @@
     }
 
 
+    /**
+     * Installs the defaults.
+     * @param fc the file chooser
+     */
     protected void installDefaults(JFileChooser fc) {
         installIcons(fc);
         installStrings(fc);
@@ -264,6 +324,10 @@
         LookAndFeel.installProperty(fc, "opaque", Boolean.FALSE);
     }
 
+    /**
+     * Installs the icons.
+     * @param fc the file chooser
+     */
     protected void installIcons(JFileChooser fc) {
         directoryIcon    = UIManager.getIcon("FileView.directoryIcon");
         fileIcon         = UIManager.getIcon("FileView.fileIcon");
@@ -279,6 +343,10 @@
         viewMenuIcon     = UIManager.getIcon("FileChooser.viewMenuIcon");
     }
 
+    /**
+     * Installs the strings.
+     * @param fc the file chooser
+     */
     protected void installStrings(JFileChooser fc) {
 
         Locale l = fc.getLocale();
@@ -315,6 +383,10 @@
         directoryOpenButtonToolTipText = UIManager.getString("FileChooser.directoryOpenButtonToolTipText",l);
     }
 
+    /**
+     * Uninstalls the defaults.
+     * @param fc the file chooser
+     */
     protected void uninstallDefaults(JFileChooser fc) {
         uninstallIcons(fc);
         uninstallStrings(fc);
@@ -323,6 +395,10 @@
         }
     }
 
+    /**
+     * Uninstalls the icons.
+     * @param fc the file chooser
+     */
     protected void uninstallIcons(JFileChooser fc) {
         directoryIcon    = null;
         fileIcon         = null;
@@ -338,6 +414,10 @@
         viewMenuIcon     = null;
     }
 
+    /**
+     * Uninstalls the strings.
+     * @param fc the file chooser
+     */
     protected void uninstallStrings(JFileChooser fc) {
         saveButtonText   = null;
         openButtonText   = null;
@@ -354,6 +434,9 @@
         directoryOpenButtonToolTipText = null;
     }
 
+    /**
+     * Creates the model.
+     */
     protected void createModel() {
         if (model != null) {
             model.invalidateFileCache();
@@ -361,50 +444,102 @@
         model = new BasicDirectoryModel(getFileChooser());
     }
 
+    /**
+     * Returns the model.
+     * @return the model
+     */
     public BasicDirectoryModel getModel() {
         return model;
     }
 
+    /**
+     * Creates the property change listener.
+     * @param fc the file chooser
+     * @return the property change listener
+     */
     public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) {
         return null;
     }
 
+    /**
+     * Returns the file name.
+     * @return the file name
+     */
     public String getFileName() {
         return null;
     }
 
+    /**
+     * Returns the directory name.
+     * @return the directory name
+     */
     public String getDirectoryName() {
         return null;
     }
 
+    /**
+     * Sets the file name.
+     * @param filename the file name
+     */
     public void setFileName(String filename) {
     }
 
+    /**
+     * Sets the directory name.
+     * @param dirname the file name
+     */
     public void setDirectoryName(String dirname) {
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void rescanCurrentDirectory(JFileChooser fc) {
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void ensureFileIsVisible(JFileChooser fc, File f) {
     }
 
+    /**
+     * Returns the file chooser.
+     * @return the file chooser
+     */
     public JFileChooser getFileChooser() {
         return filechooser;
     }
 
+    /**
+     * Returns the accessory panel.
+     * @return the accessory panel
+     */
     public JPanel getAccessoryPanel() {
         return accessoryPanel;
     }
 
+    /**
+     * Returns the approve button.
+     * @param fc the file chooser
+     * @return the approve button
+     */
     protected JButton getApproveButton(JFileChooser fc) {
         return null;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public JButton getDefaultButton(JFileChooser fc) {
         return getApproveButton(fc);
     }
 
+    /**
+     * Returns the approve button tool tip.
+     * @param fc the file chooser
+     * @return the approve button tool tip
+     */
     public String getApproveButtonToolTipText(JFileChooser fc) {
         String tooltipText = fc.getApproveButtonToolTipText();
         if(tooltipText != null) {
@@ -419,6 +554,9 @@
         return null;
     }
 
+    /**
+     * Clears the icon cache.
+     */
     public void clearIconCache() {
         fileView.clearIconCache();
     }
@@ -435,11 +573,22 @@
         return handler;
     }
 
+    /**
+     * Creates a double click listener.
+     * @param fc the file chooser
+     * @param list the list
+     * @return a double click listener
+     */
     protected MouseListener createDoubleClickListener(JFileChooser fc,
                                                       JList<?> list) {
         return new Handler(list);
     }
 
+    /**
+     * Creates a list selection listener.
+     * @param fc the file chooser
+     * @return a list selection listener
+     */
     public ListSelectionListener createListSelectionListener(JFileChooser fc) {
         return getHandler();
     }
@@ -566,12 +715,19 @@
         }
     }
 
+    /**
+     * A double click listener.
+     */
     protected class DoubleClickListener extends MouseAdapter {
         // NOTE: This class exists only for backward compatibility. All
         // its functionality has been moved into Handler. If you need to add
         // new functionality add it to the Handler, but make sure this
         // class calls into the Handler.
         Handler handler;
+        /**
+         * Constucts a {@code DoubleClickListener}.
+         * @param list the lsit
+         */
         public  DoubleClickListener(JList<?> list) {
             handler = new Handler(list);
         }
@@ -587,16 +743,21 @@
             handler.mouseEntered(e);
         }
 
+        /** {@inheritDoc} */
         public void mouseClicked(MouseEvent e) {
             handler.mouseClicked(e);
         }
     }
 
+    /**
+     * A selection listener.
+     */
     protected class SelectionListener implements ListSelectionListener {
         // NOTE: This class exists only for backward compatibility. All
         // its functionality has been moved into Handler. If you need to add
         // new functionality add it to the Handler, but make sure this
         // class calls into the Handler.
+        /** {@inheritDoc} */
         public void valueChanged(ListSelectionEvent e) {
             getHandler().valueChanged(e);
         }
@@ -672,6 +833,8 @@
 
     /**
      * Returns the title of this dialog
+     * @param fc the file chooser
+     * @return the title of this dialog
      */
     public String getDialogTitle(JFileChooser fc) {
         String dialogTitle = fc.getDialogTitle();
@@ -686,7 +849,11 @@
         }
     }
 
-
+    /**
+     * Returns the approve button mnemonic.
+     * @param fc the file chooser
+     * @return the approve button mnemonic
+     */
     public int getApproveButtonMnemonic(JFileChooser fc) {
         int mnemonic = fc.getApproveButtonMnemonic();
         if (mnemonic > 0) {
@@ -700,6 +867,7 @@
         }
     }
 
+    /** {@inheritDoc} */
     public String getApproveButtonText(JFileChooser fc) {
         String buttonText = fc.getApproveButtonText();
         if (buttonText != null) {
@@ -718,6 +886,10 @@
     // ***** Directory Actions *****
     // *****************************
 
+    /**
+     * Returns a new folder action.
+     * @return a new folder action
+     */
     public Action getNewFolderAction() {
         if (newFolderAction == null) {
             newFolderAction = new NewFolderAction();
@@ -730,22 +902,42 @@
         return newFolderAction;
     }
 
+    /**
+     * Returns a go home action.
+     * @return a go home action
+     */
     public Action getGoHomeAction() {
         return goHomeAction;
     }
 
+    /**
+     * Returns a change to parent directory action.
+     * @return a change to parent directory action
+     */
     public Action getChangeToParentDirectoryAction() {
         return changeToParentDirectoryAction;
     }
 
+    /**
+     * Returns an approve selection action.
+     * @return an approve selection  action
+     */
     public Action getApproveSelectionAction() {
         return approveSelectionAction;
     }
 
+    /**
+     * Returns a cancel selection action.
+     * @return a cancel selection action
+     */
     public Action getCancelSelectionAction() {
         return cancelSelectionAction;
     }
 
+    /**
+     * Returns an update action.
+     * @return an update action
+     */
     public Action getUpdateAction() {
         return updateAction;
     }
@@ -756,9 +948,11 @@
      */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     protected class NewFolderAction extends AbstractAction {
+        /** Constructs a {@code NewFolderAction}. */
         protected NewFolderAction() {
             super(FilePane.ACTION_NEW_FOLDER);
         }
+        /** {@inheritDoc} */
         public void actionPerformed(ActionEvent e) {
             if (readOnly) {
                 return;
@@ -799,6 +993,7 @@
      */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     protected class GoHomeAction extends AbstractAction {
+        /** Constructs a {@code GoHomeAction}. */
         protected GoHomeAction() {
             super("Go Home");
         }
@@ -808,12 +1003,17 @@
         }
     }
 
+    /**
+     * Change to parent directory action.
+     */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     protected class ChangeToParentDirectoryAction extends AbstractAction {
+        /** Constructs a {@code ChangeToParentDirectoryAction}. */
         protected ChangeToParentDirectoryAction() {
             super("Go Up");
             putValue(Action.ACTION_COMMAND_KEY, FilePane.ACTION_CHANGE_TO_PARENT_DIRECTORY);
         }
+        /** {@inheritDoc} */
         public void actionPerformed(ActionEvent e) {
             getFileChooser().changeToParentDirectory();
         }
@@ -824,9 +1024,11 @@
      */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     protected class ApproveSelectionAction extends AbstractAction {
+        /** Constructs an {@code ApproveSelectionAction}. */
         protected ApproveSelectionAction() {
             super(FilePane.ACTION_APPROVE_SELECTION);
         }
+        /** {@inheritDoc} */
         public void actionPerformed(ActionEvent e) {
             if (isDirectorySelected()) {
                 File dir = getDirectory();
@@ -1133,6 +1335,7 @@
      */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     protected class CancelSelectionAction extends AbstractAction {
+        /** {@inheritDoc} */
         public void actionPerformed(ActionEvent e) {
             getFileChooser().cancelSelection();
         }
@@ -1143,6 +1346,7 @@
      */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     protected class UpdateAction extends AbstractAction {
+        /** {@inheritDoc} */
         public void actionPerformed(ActionEvent e) {
             JFileChooser fc = getFileChooser();
             fc.setCurrentDirectory(fc.getFileSystemView().createFileObject(getDirectoryName()));
@@ -1188,15 +1392,27 @@
     // *****************************************
     // ***** default AcceptAll file filter *****
     // *****************************************
+    /**
+     * Accept all file filter.
+     */
     protected class AcceptAllFileFilter extends FileFilter {
 
+        /** Constructs an {@code AcceptAllFileFilter}. */
         public AcceptAllFileFilter() {
         }
 
+        /**
+         * Returns true.
+         * @param f the file
+         * @return true
+         */
         public boolean accept(File f) {
             return true;
         }
 
+        /**
+         * {@inheritDoc}
+         */
         public String getDescription() {
             return UIManager.getString("FileChooser.acceptAllFileFilterText");
         }
@@ -1206,18 +1422,26 @@
     // ***********************
     // * FileView operations *
     // ***********************
+    /**
+     * A basic file view.
+     */
     protected class BasicFileView extends FileView {
         /* FileView type descriptions */
-        // PENDING(jeff) - pass in the icon cache size
+        /** The icon cache */
         protected Hashtable<File,Icon> iconCache = new Hashtable<File,Icon>();
 
+        /** Constructs a {@code BasicFileView}. */
         public BasicFileView() {
         }
 
+        /**
+         * Clears the icon cache.
+         */
         public void clearIconCache() {
             iconCache = new Hashtable<File,Icon>();
         }
 
+        /** {@inheritDoc} */
         public String getName(File f) {
             // Note: Returns display name rather than file name
             String fileName = null;
@@ -1227,11 +1451,12 @@
             return fileName;
         }
 
-
+        /** {@inheritDoc} */
         public String getDescription(File f) {
             return f.getName();
         }
 
+        /** {@inheritDoc} */
         public String getTypeDescription(File f) {
             String type = getFileChooser().getFileSystemView().getSystemTypeDescription(f);
             if (type == null) {
@@ -1244,10 +1469,20 @@
             return type;
         }
 
+        /**
+         * Returns the cached icon for the file.
+         * @param f the file
+         * @return the cached icon for the file
+         */
         public Icon getCachedIcon(File f) {
             return iconCache.get(f);
         }
 
+        /**
+         * Caches an icon for a file.
+         * @param f the file
+         * @param i the icon
+         */
         public void cacheIcon(File f, Icon i) {
             if(f == null || i == null) {
                 return;
@@ -1255,6 +1490,7 @@
             iconCache.put(f, i);
         }
 
+        /** {@inheritDoc} */
         public Icon getIcon(File f) {
             Icon icon = getCachedIcon(f);
             if(icon != null) {
@@ -1278,6 +1514,11 @@
             return icon;
         }
 
+        /**
+         * Returns whether or not a file is hidden.
+         * @param f the file
+         * @return whether or not a file is hidden
+         */
         public Boolean isHidden(File f) {
             String name = f.getName();
             if(name != null && name.charAt(0) == '.') {
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java	Thu May 14 20:17:02 2015 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java	Wed Jul 05 20:33:50 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -42,22 +42,31 @@
  */
 public class BasicInternalFrameUI extends InternalFrameUI
 {
-
+    /** frame */
     protected JInternalFrame frame;
 
     private Handler handler;
+    /** Border listener */
     protected MouseInputAdapter          borderListener;
+    /** Property change listener */
     protected PropertyChangeListener     propertyChangeListener;
+    /** Internal frame layout */
     protected LayoutManager              internalFrameLayout;
+    /** Component listener */
     protected ComponentListener          componentListener;
+    /** Glass pane dispatcher */
     protected MouseInputListener         glassPaneDispatcher;
     private InternalFrameListener        internalFrameListener;
 
+    /** North pane */
     protected JComponent northPane;
+    /** South pane */
     protected JComponent southPane;
+    /** West pane */
     protected JComponent westPane;
+    /** East pane */
     protected JComponent eastPane;
-
+    /** Title pane */
     protected BasicInternalFrameTitlePane titlePane; // access needs this
 
     private static DesktopManager sharedDesktopManager;
@@ -85,10 +94,19 @@
 /////////////////////////////////////////////////////////////////////////////
 // ComponentUI Interface Implementation methods
 /////////////////////////////////////////////////////////////////////////////
+    /**
+     * Returns a component UI.
+     * @param b a component
+     * @return a component UI
+     */
     public static ComponentUI createUI(JComponent b)    {
         return new BasicInternalFrameUI((JInternalFrame)b);
     }
 
+    /**
+     * Constructs a {@code BasicInternalFrameUI}.
+     * @param b the internal frame
+     */
     public BasicInternalFrameUI(JInternalFrame b)   {
         LookAndFeel laf = UIManager.getLookAndFeel();
         if (laf instanceof BasicLookAndFeel) {
@@ -96,6 +114,10 @@
         }
     }
 
+    /**
+     * Installs the UI.
+     * @param c the component
+     */
     public void installUI(JComponent c)   {
 
         frame = (JInternalFrame)c;
@@ -108,6 +130,10 @@
         LookAndFeel.installProperty(frame, "opaque", Boolean.TRUE);
     }
 
+    /**
+     * Uninstalls the UI.
+     * @param c the component
+     */
     public void uninstallUI(JComponent c) {
         if(c != frame)
             throw new IllegalComponentStateException(
@@ -124,6 +150,9 @@
         frame = null;
     }
 
+    /**
+     * Installs the defaults.
+