Merge
authorprr
Wed, 01 Nov 2017 10:00:38 -0700
changeset 47514 31c2e88afd3e
parent 47513 d5a1cde89944 (diff)
parent 47482 4a35a00eb001 (current diff)
child 47515 4c2e14b481f9
Merge
make/autoconf/generated-configure.sh
--- a/make/autoconf/generated-configure.sh	Wed Nov 01 16:45:28 2017 +0100
+++ b/make/autoconf/generated-configure.sh	Wed Nov 01 10:00:38 2017 -0700
@@ -690,6 +690,7 @@
 FREETYPE_BUNDLE_LIB_PATH
 FREETYPE_LIBS
 FREETYPE_CFLAGS
+FONTCONFIG_CFLAGS
 CUPS_CFLAGS
 X_EXTRA_LIBS
 X_LIBS
@@ -1184,6 +1185,8 @@
 with_x
 with_cups
 with_cups_include
+with_fontconfig
+with_fontconfig_include
 with_freetype
 with_freetype_include
 with_freetype_lib
@@ -2113,6 +2116,10 @@
   --with-cups             specify prefix directory for the cups package
                           (expecting the headers under PATH/include)
   --with-cups-include     specify directory for the cups include files
+  --with-fontconfig       specify prefix directory for the fontconfig package
+                          (expecting the headers under PATH/include)
+  --with-fontconfig-include
+                          specify directory for the fontconfig include files
   --with-freetype         specify prefix directory for the freetype package
                           (expecting the libraries under PATH/lib and the
                           headers under PATH/include)
@@ -4170,6 +4177,8 @@
       PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;;
     cups)
       PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;;
+    fontconfig)
+      PKGHANDLER_COMMAND="sudo apt-get install libfontconfig1-dev" ;;
     freetype)
       PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;;
     ffi)
@@ -4193,6 +4202,8 @@
       PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;;
     cups)
       PKGHANDLER_COMMAND="sudo yum install cups-devel" ;;
+    fontconfig)
+      PKGHANDLER_COMMAND="sudo yum install fontconfig-devel" ;;
     freetype)
       PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;;
     x11)
@@ -4756,6 +4767,36 @@
 ################################################################################
 
 
+#
+# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+################################################################################
+# Setup fontconfig
+################################################################################
+
+
 
 ################################################################################
 # Determine which libraries are needed for this configuration
@@ -54541,6 +54582,16 @@
     NEEDS_LIB_X11=true
   fi
 
+  # Check if fontconfig is needed
+  if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then
+    # No fontconfig support on windows or macosx
+    NEEDS_LIB_FONTCONFIG=false
+  else
+    # All other instances need fontconfig, even if building headless only,
+    # libawt still needs fontconfig headers.
+    NEEDS_LIB_FONTCONFIG=true
+  fi
+
   # Check if cups is needed
   if test "x$OPENJDK_TARGET_OS" = xwindows; then
     # Windows have a separate print system
@@ -58358,6 +58409,116 @@
 
 
 
+# Check whether --with-fontconfig was given.
+if test "${with_fontconfig+set}" = set; then :
+  withval=$with_fontconfig;
+fi
+
+
+# Check whether --with-fontconfig-include was given.
+if test "${with_fontconfig_include+set}" = set; then :
+  withval=$with_fontconfig_include;
+fi
+
+
+  if test "x$NEEDS_LIB_FONTCONFIG" = xfalse; then
+    if (test "x${with_fontconfig}" != x && test "x${with_fontconfig}" != xno) || \
+        (test "x${with_fontconfig_include}" != x && test "x${with_fontconfig_include}" != xno); then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: fontconfig not used, so --with-fontconfig[-*] is ignored" >&5
+$as_echo "$as_me: WARNING: fontconfig not used, so --with-fontconfig[-*] is ignored" >&2;}
+    fi
+    FONTCONFIG_CFLAGS=
+  else
+    FONTCONFIG_FOUND=no
+
+    if test "x${with_fontconfig}" = xno || test "x${with_fontconfig_include}" = xno; then
+      as_fn_error $? "It is not possible to disable the use of fontconfig. Remove the --without-fontconfig option." "$LINENO" 5
+    fi
+
+    if test "x${with_fontconfig}" != x; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fontconfig headers" >&5
+$as_echo_n "checking for fontconfig headers... " >&6; }
+      if test -s "${with_fontconfig}/include/fontconfig/fontconfig.h"; then
+        FONTCONFIG_CFLAGS="-I${with_fontconfig}/include"
+        FONTCONFIG_FOUND=yes
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FONTCONFIG_FOUND" >&5
+$as_echo "$FONTCONFIG_FOUND" >&6; }
+      else
+        as_fn_error $? "Can't find 'include/fontconfig/fontconfig.h' under ${with_fontconfig} given with the --with-fontconfig option." "$LINENO" 5
+      fi
+    fi
+    if test "x${with_fontconfig_include}" != x; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fontconfig headers" >&5
+$as_echo_n "checking for fontconfig headers... " >&6; }
+      if test -s "${with_fontconfig_include}/fontconfig/fontconfig.h"; then
+        FONTCONFIG_CFLAGS="-I${with_fontconfig_include}"
+        FONTCONFIG_FOUND=yes
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FONTCONFIG_FOUND" >&5
+$as_echo "$FONTCONFIG_FOUND" >&6; }
+      else
+        as_fn_error $? "Can't find 'fontconfig/fontconfig.h' under ${with_fontconfig_include} given with the --with-fontconfig-include option." "$LINENO" 5
+      fi
+    fi
+    if test "x$FONTCONFIG_FOUND" = xno; then
+      # Are the fontconfig headers installed in the default /usr/include location?
+      for ac_header in fontconfig/fontconfig.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "fontconfig/fontconfig.h" "ac_cv_header_fontconfig_fontconfig_h" "$ac_includes_default"
+if test "x$ac_cv_header_fontconfig_fontconfig_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_FONTCONFIG_FONTCONFIG_H 1
+_ACEOF
+
+          FONTCONFIG_FOUND=yes
+          FONTCONFIG_CFLAGS=
+          DEFAULT_FONTCONFIG=yes
+
+fi
+
+done
+
+    fi
+    if test "x$FONTCONFIG_FOUND" = xno; then
+
+  # Print a helpful message on how to acquire the necessary build dependency.
+  # fontconfig is the help tag: freetype, cups, alsa etc
+  MISSING_DEPENDENCY=fontconfig
+
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    cygwin_help $MISSING_DEPENDENCY
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    msys_help $MISSING_DEPENDENCY
+  else
+    PKGHANDLER_COMMAND=
+
+    case $PKGHANDLER in
+      apt-get)
+        apt_help     $MISSING_DEPENDENCY ;;
+      yum)
+        yum_help     $MISSING_DEPENDENCY ;;
+      brew)
+        brew_help    $MISSING_DEPENDENCY ;;
+      port)
+        port_help    $MISSING_DEPENDENCY ;;
+      pkgutil)
+        pkgutil_help $MISSING_DEPENDENCY ;;
+      pkgadd)
+        pkgadd_help  $MISSING_DEPENDENCY ;;
+    esac
+
+    if test "x$PKGHANDLER_COMMAND" != x; then
+      HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
+    fi
+  fi
+
+      as_fn_error $? "Could not find fontconfig! $HELP_MSG " "$LINENO" 5
+    fi
+  fi
+
+
+
+
+
 # Check whether --with-freetype was given.
 if test "${with_freetype+set}" = set; then :
   withval=$with_freetype;
@@ -65892,6 +66053,7 @@
 
 
 
+
 # Hotspot setup depends on lib checks.
 
 
--- a/make/autoconf/help.m4	Wed Nov 01 16:45:28 2017 +0100
+++ b/make/autoconf/help.m4	Wed Nov 01 10:00:38 2017 -0700
@@ -113,6 +113,8 @@
       PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;;
     cups)
       PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;;
+    fontconfig)
+      PKGHANDLER_COMMAND="sudo apt-get install libfontconfig1-dev" ;;
     freetype)
       PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;;
     ffi)
@@ -136,6 +138,8 @@
       PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;;
     cups)
       PKGHANDLER_COMMAND="sudo yum install cups-devel" ;;
+    fontconfig)
+      PKGHANDLER_COMMAND="sudo yum install fontconfig-devel" ;;
     freetype)
       PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;;
     x11)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/autoconf/lib-fontconfig.m4	Wed Nov 01 10:00:38 2017 -0700
@@ -0,0 +1,85 @@
+#
+# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+################################################################################
+# Setup fontconfig
+################################################################################
+AC_DEFUN_ONCE([LIB_SETUP_FONTCONFIG],
+[
+  AC_ARG_WITH(fontconfig, [AS_HELP_STRING([--with-fontconfig],
+      [specify prefix directory for the fontconfig package
+      (expecting the headers under PATH/include)])])
+  AC_ARG_WITH(fontconfig-include, [AS_HELP_STRING([--with-fontconfig-include],
+      [specify directory for the fontconfig include files])])
+
+  if test "x$NEEDS_LIB_FONTCONFIG" = xfalse; then
+    if (test "x${with_fontconfig}" != x && test "x${with_fontconfig}" != xno) || \
+        (test "x${with_fontconfig_include}" != x && test "x${with_fontconfig_include}" != xno); then
+      AC_MSG_WARN([[fontconfig not used, so --with-fontconfig[-*] is ignored]])
+    fi
+    FONTCONFIG_CFLAGS=
+  else
+    FONTCONFIG_FOUND=no
+
+    if test "x${with_fontconfig}" = xno || test "x${with_fontconfig_include}" = xno; then
+      AC_MSG_ERROR([It is not possible to disable the use of fontconfig. Remove the --without-fontconfig option.])
+    fi
+
+    if test "x${with_fontconfig}" != x; then
+      AC_MSG_CHECKING([for fontconfig headers])
+      if test -s "${with_fontconfig}/include/fontconfig/fontconfig.h"; then
+        FONTCONFIG_CFLAGS="-I${with_fontconfig}/include"
+        FONTCONFIG_FOUND=yes
+        AC_MSG_RESULT([$FONTCONFIG_FOUND])
+      else
+        AC_MSG_ERROR([Can't find 'include/fontconfig/fontconfig.h' under ${with_fontconfig} given with the --with-fontconfig option.])
+      fi
+    fi
+    if test "x${with_fontconfig_include}" != x; then
+      AC_MSG_CHECKING([for fontconfig headers])
+      if test -s "${with_fontconfig_include}/fontconfig/fontconfig.h"; then
+        FONTCONFIG_CFLAGS="-I${with_fontconfig_include}"
+        FONTCONFIG_FOUND=yes
+        AC_MSG_RESULT([$FONTCONFIG_FOUND])
+      else
+        AC_MSG_ERROR([Can't find 'fontconfig/fontconfig.h' under ${with_fontconfig_include} given with the --with-fontconfig-include option.])
+      fi
+    fi
+    if test "x$FONTCONFIG_FOUND" = xno; then
+      # Are the fontconfig headers installed in the default /usr/include location?
+      AC_CHECK_HEADERS([fontconfig/fontconfig.h], [
+          FONTCONFIG_FOUND=yes
+          FONTCONFIG_CFLAGS=
+          DEFAULT_FONTCONFIG=yes
+      ])
+    fi
+    if test "x$FONTCONFIG_FOUND" = xno; then
+      HELP_MSG_MISSING_DEPENDENCY([fontconfig])
+      AC_MSG_ERROR([Could not find fontconfig! $HELP_MSG ])
+    fi
+  fi
+
+  AC_SUBST(FONTCONFIG_CFLAGS)
+])
--- a/make/autoconf/libraries.m4	Wed Nov 01 16:45:28 2017 +0100
+++ b/make/autoconf/libraries.m4	Wed Nov 01 10:00:38 2017 -0700
@@ -31,6 +31,7 @@
 m4_include([lib-freetype.m4])
 m4_include([lib-std.m4])
 m4_include([lib-x11.m4])
+m4_include([lib-fontconfig.m4])
 
 ################################################################################
 # Determine which libraries are needed for this configuration
@@ -47,6 +48,16 @@
     NEEDS_LIB_X11=true
   fi
 
+  # Check if fontconfig is needed
+  if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then
+    # No fontconfig support on windows or macosx
+    NEEDS_LIB_FONTCONFIG=false
+  else
+    # All other instances need fontconfig, even if building headless only,
+    # libawt still needs fontconfig headers.
+    NEEDS_LIB_FONTCONFIG=true
+  fi
+
   # Check if cups is needed
   if test "x$OPENJDK_TARGET_OS" = xwindows; then
     # Windows have a separate print system
@@ -83,6 +94,7 @@
   LIB_SETUP_STD_LIBS
   LIB_SETUP_X11
   LIB_SETUP_CUPS
+  LIB_SETUP_FONTCONFIG
   LIB_SETUP_FREETYPE
   LIB_SETUP_ALSA
   LIB_SETUP_LIBFFI
--- a/make/lib/Awt2dLibraries.gmk	Wed Nov 01 16:45:28 2017 +0100
+++ b/make/lib/Awt2dLibraries.gmk	Wed Nov 01 10:00:38 2017 -0700
@@ -317,6 +317,7 @@
 
     LIBAWT_XAWT_CFLAGS += -DXAWT -DXAWT_HACK \
         -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
+        $(FONTCONFIG_CFLAGS) \
         $(CUPS_CFLAGS)
 
     ifeq ($(OPENJDK_TARGET_OS), solaris)
@@ -555,6 +556,7 @@
           -DHEADLESS=true \
           -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
           $(CUPS_CFLAGS) \
+          $(FONTCONFIG_CFLAGS) \
           $(X_CFLAGS) \
           $(LIBAWT_HEADLESS_CFLAGS), \
       DISABLED_WARNINGS_xlc := 1506-356, \
--- a/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenUtilities.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenUtilities.java	Wed Nov 01 10:00:38 2017 -0700
@@ -25,19 +25,19 @@
 
 package com.apple.eawt;
 
-import java.awt.*;
+import java.awt.Component;
+import java.awt.Window;
 
 import javax.swing.RootPaneContainer;
 
-import sun.lwawt.macosx.*;
-
 import com.apple.eawt.event.GestureUtilities;
+import sun.lwawt.macosx.CPlatformWindow;
 
 /**
  * Utility class perform animated full screen actions to top-level {@link Window}s.
  *
  * This class manages the relationship between {@link Window}s and the {@link FullScreenListener}s
- * attached to them. It's design is similar to the Java SE 6u10 {@link com.sun.awt.AWTUtilities}
+ * attached to them. It's design is similar to the Java SE 6u10 {@code com.sun.awt.AWTUtilities}
  * class which adds additional functionality to AWT Windows, without adding new API to the
  * {@link java.awt.Window} class.
  *
@@ -45,7 +45,6 @@
  *
  * @see FullScreenAdapter
  * @see GestureUtilities
- * @see com.sun.awt.AWTUtilities
  *
  * @since Java for Mac OS X 10.7 Update 1
  */
--- a/src/java.desktop/macosx/classes/com/apple/eawt/event/GestureUtilities.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/macosx/classes/com/apple/eawt/event/GestureUtilities.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,13 +25,15 @@
 
 package com.apple.eawt.event;
 
-import javax.swing.*;
+import javax.swing.JComponent;
+import javax.swing.JFrame;
+import javax.swing.JRootPane;
 
 /**
  * Registration utility class to add {@link GestureListener}s to Swing components.
  *
  * This class manages the relationship between {@link JComponent}s and the {@link GestureListener}s
- * attached to them. It's design is similar to the Java SE 6u10 {@link com.sun.awt.AWTUtilities}
+ * attached to them. It's design is similar to the Java SE 6u10 {@code com.sun.awt.AWTUtilities}
  * class which adds additional functionality to AWT Windows, without adding new API to the
  * {@link java.awt.Window} class.
  *
@@ -40,7 +42,6 @@
  *
  * @see GestureAdapter
  * @see JFrame#getRootPane()
- * @see com.sun.awt.AWTUtilities
  *
  * @since Java for Mac OS X 10.5 Update 7, Java for Mac OS X 10.6 Update 2
  */
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Wed Nov 01 10:00:38 2017 -0700
@@ -25,13 +25,25 @@
 
 package sun.lwawt.macosx;
 
-import com.apple.eawt.FullScreenAdapter;
-import com.apple.eawt.FullScreenUtilities;
-import com.apple.eawt.event.FullScreenEvent;
-import java.awt.*;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.DefaultKeyboardFocusManager;
+import java.awt.Dialog;
 import java.awt.Dialog.ModalityType;
-import java.awt.event.*;
-import java.beans.*;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Frame;
+import java.awt.GraphicsDevice;
+import java.awt.Insets;
+import java.awt.MenuBar;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Toolkit;
+import java.awt.Window;
+import java.awt.event.FocusEvent;
+import java.awt.event.WindowEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
 import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -39,21 +51,23 @@
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicReference;
 
-import javax.swing.*;
+import javax.swing.JRootPane;
+import javax.swing.RootPaneContainer;
+import javax.swing.SwingUtilities;
 
-import sun.awt.*;
+import com.apple.laf.ClientPropertyApplicator;
+import com.apple.laf.ClientPropertyApplicator.Property;
+import sun.awt.AWTAccessor;
 import sun.awt.AWTAccessor.ComponentAccessor;
 import sun.awt.AWTAccessor.WindowAccessor;
 import sun.java2d.SurfaceData;
 import sun.java2d.opengl.CGLSurfaceData;
-import sun.lwawt.*;
+import sun.lwawt.LWToolkit;
+import sun.lwawt.LWWindowPeer;
+import sun.lwawt.LWWindowPeer.PeerType;
+import sun.lwawt.PlatformWindow;
 import sun.util.logging.PlatformLogger;
 
-import com.apple.laf.*;
-import com.apple.laf.ClientPropertyApplicator.Property;
-import com.sun.awt.AWTUtilities;
-import sun.lwawt.LWWindowPeer.PeerType;
-
 public class CPlatformWindow extends CFRetainedResource implements PlatformWindow {
     private native long nativeCreateNSWindow(long nsViewPtr,long ownerPtr, long styleBits, double x, double y, double w, double h);
     private static native void nativeSetNSWindowStyleBits(long nsWindowPtr, int mask, int data);
@@ -172,7 +186,7 @@
             c.setStyleBits(TEXTURED, Boolean.parseBoolean(value.toString()));
         }},
         new Property<CPlatformWindow>(WINDOW_ALPHA) { public void applyProperty(final CPlatformWindow c, final Object value) {
-            AWTUtilities.setWindowOpacity(c.target, value == null ? 1.0f : Float.parseFloat(value.toString()));
+            c.target.setOpacity(value == null ? 1.0f : Float.parseFloat(value.toString()));
         }},
         new Property<CPlatformWindow>(WINDOW_SHADOW) { public void applyProperty(final CPlatformWindow c, final Object value) {
             c.setStyleBits(HAS_SHADOW, value == null ? true : Boolean.parseBoolean(value.toString()));
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,26 +25,37 @@
 
 package sun.lwawt.macosx;
 
-import sun.awt.AWTAccessor;
-import sun.awt.SunToolkit;
-
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.*;
+import java.awt.AWTEvent;
+import java.awt.Button;
+import java.awt.Frame;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.Image;
+import java.awt.MediaTracker;
+import java.awt.PopupMenu;
+import java.awt.RenderingHints;
+import java.awt.Toolkit;
+import java.awt.Transparency;
+import java.awt.TrayIcon;
+import java.awt.event.ActionEvent;
+import java.awt.event.MouseEvent;
 import java.awt.geom.Point2D;
 import java.awt.image.BufferedImage;
 import java.awt.peer.TrayIconPeer;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.concurrent.atomic.AtomicReference;
+
+import javax.swing.Icon;
+import javax.swing.UIManager;
 
-import static sun.awt.AWTAccessor.*;
+import sun.awt.SunToolkit;
+
+import static sun.awt.AWTAccessor.MenuComponentAccessor;
+import static sun.awt.AWTAccessor.getMenuComponentAccessor;
 
 public class CTrayIcon extends CFRetainedResource implements TrayIconPeer {
     private TrayIcon target;
     private PopupMenu popup;
-    private JDialog messageDialog;
-    private DialogEventHandler handler;
 
     // In order to construct MouseEvent object, we need to specify a
     // Component target. Because TrayIcon isn't Component's subclass,
@@ -59,8 +70,6 @@
     CTrayIcon(TrayIcon target) {
         super(0, true);
 
-        this.messageDialog = null;
-        this.handler = null;
         this.target = target;
         this.popup = target.getPopupMenu();
         this.dummyFrame = new Frame();
@@ -129,28 +138,25 @@
      */
     public void displayMessage(final String caption, final String text,
                                final String messageType) {
-
-        if (SwingUtilities.isEventDispatchThread()) {
-            displayMessageOnEDT(caption, text, messageType);
+        // obtain icon to show along the message
+        Icon icon = getIconForMessageType(messageType);
+        CImage cimage = null;
+        if (icon != null) {
+            BufferedImage image = scaleIcon(icon, 0.75);
+            cimage = CImage.getCreator().createFromImage(image);
+        }
+        if (cimage != null) {
+            cimage.execute(imagePtr -> {
+                execute(ptr -> nativeShowNotification(ptr, caption, text,
+                                                      imagePtr));
+            });
         } else {
-            try {
-                SwingUtilities.invokeAndWait(new Runnable() {
-                    public void run() {
-                        displayMessageOnEDT(caption, text, messageType);
-                    }
-                });
-            } catch (Exception e) {
-                throw new AssertionError(e);
-            }
+            execute(ptr -> nativeShowNotification(ptr, caption, text, 0));
         }
     }
 
     @Override
     public void dispose() {
-        if (messageDialog != null) {
-            disposeMessageDialog();
-        }
-
         dummyFrame.dispose();
 
         if (popup != null) {
@@ -276,154 +282,14 @@
         }
     }
 
-    private native Point2D nativeGetIconLocation(long trayIconModel);
-
-    public void displayMessageOnEDT(String caption, String text,
-                                    String messageType) {
-        if (messageDialog != null) {
-            disposeMessageDialog();
-        }
-
-        // obtain icon to show along the message
-        Icon icon = getIconForMessageType(messageType);
-        if (icon != null) {
-            icon = new ImageIcon(scaleIcon(icon, 0.75));
-        }
-
-        // We want the message dialog text area to be about 1/8 of the screen
-        // size. There is nothing special about this value, it's just makes the
-        // message dialog to look nice
-        Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
-        int textWidth = screenSize.width / 8;
-
-        // create dialog to show
-        messageDialog = createMessageDialog(caption, text, textWidth, icon);
-
-        // finally, show the dialog to user
-        showMessageDialog();
-    }
+    private native void nativeShowNotification(long trayIconModel,
+                                               String caption, String text,
+                                               long nsimage);
 
     /**
-     * Creates dialog window used to display the message
+     * Used by the automated tests.
      */
-    private JDialog createMessageDialog(String caption, String text,
-                                     int textWidth, Icon icon) {
-        JDialog dialog;
-        handler = new DialogEventHandler();
-
-        JTextArea captionArea = null;
-        if (caption != null) {
-            captionArea = createTextArea(caption, textWidth, false, true);
-        }
-
-        JTextArea textArea = null;
-        if (text != null){
-            textArea = createTextArea(text, textWidth, true, false);
-        }
-
-        Object[] panels = null;
-        if (captionArea != null) {
-            if (textArea != null) {
-                panels = new Object[] {captionArea, new JLabel(), textArea};
-            } else {
-                panels = new Object[] {captionArea};
-            }
-        } else {
-           if (textArea != null) {
-                panels = new Object[] {textArea};
-            }
-        }
-
-        // We want message dialog with small title bar. There is a client
-        // property property that does it, however, it must be set before
-        // dialog's native window is created. This is why we create option
-        // pane and dialog separately
-        final JOptionPane op = new JOptionPane(panels);
-        op.setIcon(icon);
-        op.addPropertyChangeListener(handler);
-
-        // Make Ok button small. Most likely won't work for L&F other then Aqua
-        try {
-            JPanel buttonPanel = (JPanel)op.getComponent(1);
-            JButton ok = (JButton)buttonPanel.getComponent(0);
-            ok.putClientProperty("JComponent.sizeVariant", "small");
-        } catch (Throwable t) {
-            // do nothing, we tried and failed, no big deal
-        }
-
-        dialog = new JDialog((Dialog) null);
-        JRootPane rp = dialog.getRootPane();
-
-        // gives us dialog window with small title bar and not zoomable
-        rp.putClientProperty(CPlatformWindow.WINDOW_STYLE, "small");
-        rp.putClientProperty(CPlatformWindow.WINDOW_ZOOMABLE, "false");
-
-        dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
-        dialog.setModal(false);
-        dialog.setModalExclusionType(Dialog.ModalExclusionType.TOOLKIT_EXCLUDE);
-        dialog.setAlwaysOnTop(true);
-        dialog.setAutoRequestFocus(false);
-        dialog.setResizable(false);
-        dialog.setContentPane(op);
-
-        dialog.addWindowListener(handler);
-
-        // suppress security warning for untrusted windows
-        AWTAccessor.getWindowAccessor().setTrayIconWindow(dialog, true);
-
-        dialog.pack();
-
-        return dialog;
-    }
-
-    private void showMessageDialog() {
-
-        Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
-        AtomicReference<Point2D> ref = new AtomicReference<>();
-        execute(ptr -> {
-            ref.set(nativeGetIconLocation(ptr));
-        });
-        Point2D iconLoc = ref.get();
-        if (iconLoc == null) {
-            return;
-        }
-
-        int dialogY = (int)iconLoc.getY();
-        int dialogX = (int)iconLoc.getX();
-        if (dialogX + messageDialog.getWidth() > screenSize.width) {
-            dialogX = screenSize.width - messageDialog.getWidth();
-        }
-
-        messageDialog.setLocation(dialogX, dialogY);
-        messageDialog.setVisible(true);
-    }
-
-   private void disposeMessageDialog() {
-        if (SwingUtilities.isEventDispatchThread()) {
-            disposeMessageDialogOnEDT();
-        } else {
-            try {
-                SwingUtilities.invokeAndWait(new Runnable() {
-                    public void run() {
-                        disposeMessageDialogOnEDT();
-                    }
-                });
-            } catch (Exception e) {
-                throw new AssertionError(e);
-            }
-        }
-   }
-
-    private void disposeMessageDialogOnEDT() {
-        if (messageDialog != null) {
-            messageDialog.removeWindowListener(handler);
-            messageDialog.removePropertyChangeListener(handler);
-            messageDialog.dispose();
-
-            messageDialog = null;
-            handler = null;
-        }
-    }
+    private native Point2D nativeGetIconLocation(long trayIconModel);
 
     /**
      * Scales an icon using specified scale factor
@@ -480,56 +346,5 @@
             return UIManager.getIcon("OptionPane.informationIcon");
         }
     }
-
-    private static JTextArea createTextArea(String text, int width,
-                                            boolean isSmall, boolean isBold) {
-        JTextArea textArea = new JTextArea(text);
-
-        textArea.setLineWrap(true);
-        textArea.setWrapStyleWord(true);
-        textArea.setEditable(false);
-        textArea.setFocusable(false);
-        textArea.setBorder(null);
-        textArea.setBackground(new JLabel().getBackground());
-
-        if (isSmall) {
-            textArea.putClientProperty("JComponent.sizeVariant", "small");
-        }
-
-        if (isBold) {
-            Font font = textArea.getFont();
-            Font boldFont = new Font(font.getName(), Font.BOLD, font.getSize());
-            textArea.setFont(boldFont);
-        }
-
-        textArea.setSize(width, 1);
-
-        return textArea;
-    }
-
-    /**
-     * Implements all the Listeners needed by message dialog
-     */
-    private final class DialogEventHandler extends WindowAdapter
-            implements PropertyChangeListener {
-
-        public void windowClosing(WindowEvent we) {
-                disposeMessageDialog();
-        }
-
-        public void propertyChange(PropertyChangeEvent e) {
-            if (messageDialog == null) {
-                return;
-            }
-
-            String prop = e.getPropertyName();
-            Container cp = messageDialog.getContentPane();
-
-            if (messageDialog.isVisible() && e.getSource() == cp &&
-                    (prop.equals(JOptionPane.VALUE_PROPERTY))) {
-                disposeMessageDialog();
-            }
-        }
-    }
 }
 
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m	Wed Nov 01 10:00:38 2017 -0700
@@ -74,20 +74,20 @@
     // Initialize ourselves
     self = [super initWithFrame: rect];
     if (self == nil) return self;
-    
+
     m_cPlatformView = cPlatformView;
     fInputMethodLOCKABLE = NULL;
     fKeyEventsNeeded = NO;
     fProcessingKeystroke = NO;
-    
+
     fEnablePressAndHold = shouldUsePressAndHold();
     fInPressAndHold = NO;
     fPAHNeedsToSelect = NO;
-    
+
     mouseIsOver = NO;
     [self resetTrackingArea];
     [self setAutoresizesSubviews:NO];
-    
+
     if (windowLayer != nil) {
         self.cglLayer = windowLayer;
         //Layer hosting view
@@ -98,7 +98,7 @@
         //[self setLayerContentsRedrawPolicy: NSViewLayerContentsRedrawDuringViewResize];
         //[self setLayerContentsPlacement: NSViewLayerContentsPlacementTopLeft];
         //[self setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable];
-        
+
 #ifdef REMOTELAYER
         CGLLayer *parentLayer = (CGLLayer*)self.cglLayer;
         parentLayer.parentLayer = NULL;
@@ -120,36 +120,36 @@
         }
 #endif /* REMOTELAYER */
     }
-    
+
     return self;
 }
 
 - (void) dealloc {
     AWT_ASSERT_APPKIT_THREAD;
-    
+
     self.cglLayer = nil;
-    
+
     JNIEnv *env = [ThreadUtilities getJNIEnvUncached];
     (*env)->DeleteWeakGlobalRef(env, m_cPlatformView);
     m_cPlatformView = NULL;
-    
+
     if (fInputMethodLOCKABLE != NULL)
     {
         JNIEnv *env = [ThreadUtilities getJNIEnvUncached];
-        
+
         JNFDeleteGlobalRef(env, fInputMethodLOCKABLE);
         fInputMethodLOCKABLE = NULL;
     }
-    
-    
+
+
     [super dealloc];
 }
 
 - (void) viewDidMoveToWindow {
     AWT_ASSERT_APPKIT_THREAD;
-    
+
     [AWTToolkit eventCountPlusPlus];
-    
+
     [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() {
         [[self window] makeFirstResponder: self];
     }];
@@ -230,10 +230,10 @@
 
 - (void) mouseMoved: (NSEvent *)event {
     // TODO: better way to redirect move events to the "under" view
-    
+
     NSPoint eventLocation = [event locationInWindow];
     NSPoint localPoint = [self convertPoint: eventLocation fromView: nil];
-    
+
     if  ([self mouse: localPoint inRect: [self bounds]]) {
         [self deliverJavaMouseEvent: event];
     } else {
@@ -277,10 +277,10 @@
 - (void) keyDown: (NSEvent *)event {
     fProcessingKeystroke = YES;
     fKeyEventsNeeded = YES;
-    
+
     // Allow TSM to look at the event and potentially send back NSTextInputClient messages.
     [self interpretKeyEvents:[NSArray arrayWithObject:event]];
-    
+
     if (fEnablePressAndHold && [event willBeHandledByComplexInputMethod] && fInputMethodLOCKABLE) {
         fProcessingKeystroke = NO;
         if (!fInPressAndHold) {
@@ -289,14 +289,14 @@
         }
         return;
     }
-    
+
     NSString *eventCharacters = [event characters];
     BOOL isDeadKey = (eventCharacters != nil && [eventCharacters length] == 0);
-    
+
     if ((![self hasMarkedText] && fKeyEventsNeeded) || isDeadKey) {
         [self deliverJavaKeyEventHelper: event];
     }
-    
+
     fProcessingKeystroke = NO;
 }
 
@@ -313,7 +313,7 @@
     if (![self hasMarkedText] && !fInPressAndHold) {
         [self deliverJavaKeyEventHelper: event];
     }
-    
+
     // Workaround for 8020209: special case for "Cmd =" and "Cmd ."
     // because Cocoa calls performKeyEquivalent twice for these keystrokes
     NSUInteger modFlags = [event modifierFlags] &
@@ -327,9 +327,9 @@
                 return YES;
             }
         }
-        
+
     }
-    
+
     return NO;
 }
 
@@ -343,36 +343,36 @@
     if ([window isKindOfClass: [AWTWindow_Panel class]] || [window isKindOfClass: [AWTWindow_Normal class]]) {
         isEnabled = [(AWTWindow*)[window delegate] isEnabled];
     }
-    
+
     if (!isEnabled) {
         return;
     }
-    
+
     NSEventType type = [event type];
-    
+
     // check synthesized mouse entered/exited events
     if ((type == NSMouseEntered && mouseIsOver) || (type == NSMouseExited && !mouseIsOver)) {
         return;
     }else if ((type == NSMouseEntered && !mouseIsOver) || (type == NSMouseExited && mouseIsOver)) {
         mouseIsOver = !mouseIsOver;
     }
-    
+
     [AWTToolkit eventCountPlusPlus];
-    
+
     JNIEnv *env = [ThreadUtilities getJNIEnv];
-    
+
     NSPoint eventLocation = [event locationInWindow];
     NSPoint localPoint = [self convertPoint: eventLocation fromView: nil];
     NSPoint absP = [NSEvent mouseLocation];
-    
+
     // Convert global numbers between Cocoa's coordinate system and Java.
     // TODO: need consitent way for doing that both with global as well as with local coordinates.
     // The reason to do it here is one more native method for getting screen dimension otherwise.
-    
+
     NSRect screenRect = [[[NSScreen screens] objectAtIndex:0] frame];
     absP.y = screenRect.size.height - absP.y;
     jint clickCount;
-    
+
     if (type == NSMouseEntered ||
         type == NSMouseExited ||
         type == NSScrollWheel ||
@@ -388,7 +388,7 @@
         deltaX = [event scrollingDeltaX] * 0.1;
         deltaY = [event scrollingDeltaY] * 0.1;
     }
-    
+
     static JNF_CLASS_CACHE(jc_NSEvent, "sun/lwawt/macosx/NSEvent");
     static JNF_CTOR_CACHE(jctor_NSEvent, jc_NSEvent, "(IIIIIIIIDDI)V");
     jobject jEvent = JNFNewObject(env, jctor_NSEvent,
@@ -402,7 +402,7 @@
                                   deltaX,
                                   [AWTToolkit scrollStateWithEvent: event]);
     CHECK_NULL(jEvent);
-    
+
     static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView");
     static JNF_MEMBER_CACHE(jm_deliverMouseEvent, jc_PlatformView, "deliverMouseEvent", "(Lsun/lwawt/macosx/NSEvent;)V");
     jobject jlocal = (*env)->NewLocalRef(env, m_cPlatformView);
@@ -418,10 +418,10 @@
         [self removeTrackingArea:rolloverTrackingArea];
         [rolloverTrackingArea release];
     }
-    
+
     int options = (NSTrackingActiveAlways | NSTrackingMouseEnteredAndExited |
                    NSTrackingMouseMoved | NSTrackingEnabledDuringMouseDrag);
-    
+
     rolloverTrackingArea = [[NSTrackingArea alloc] initWithRect:[self visibleRect]
                                                         options: options
                                                           owner:self
@@ -448,17 +448,17 @@
     }
     [sLastKeyEvent release];
     sLastKeyEvent = [event retain];
-    
+
     [AWTToolkit eventCountPlusPlus];
     JNIEnv *env = [ThreadUtilities getJNIEnv];
-    
+
     jstring characters = NULL;
     jstring charactersIgnoringModifiers = NULL;
     if ([event type] != NSFlagsChanged) {
         characters = JNFNSToJavaString(env, [event characters]);
         charactersIgnoringModifiers = JNFNSToJavaString(env, [event charactersIgnoringModifiers]);
     }
-    
+
     static JNF_CLASS_CACHE(jc_NSEvent, "sun/lwawt/macosx/NSEvent");
     static JNF_CTOR_CACHE(jctor_NSEvent, jc_NSEvent, "(IISLjava/lang/String;Ljava/lang/String;)V");
     jobject jEvent = JNFNewObject(env, jctor_NSEvent,
@@ -468,7 +468,7 @@
                                   characters,
                                   charactersIgnoringModifiers);
     CHECK_NULL(jEvent);
-    
+
     static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView");
     static JNF_MEMBER_CACHE(jm_deliverKeyEvent, jc_PlatformView,
                             "deliverKeyEvent", "(Lsun/lwawt/macosx/NSEvent;)V");
@@ -502,7 +502,7 @@
 
 - (void) drawRect:(NSRect)dirtyRect {
     AWT_ASSERT_APPKIT_THREAD;
-    
+
     [super drawRect:dirtyRect];
     JNIEnv *env = [ThreadUtilities getJNIEnv];
     if (env != NULL) {
@@ -615,17 +615,17 @@
 - (id)accessibilityAttributeValue:(NSString *)attribute
 {
     AWT_ASSERT_APPKIT_THREAD;
-    
+
     if ([attribute isEqualToString:NSAccessibilityChildrenAttribute])
     {
         JNIEnv *env = [ThreadUtilities getJNIEnv];
-        
+
         (*env)->PushLocalFrame(env, 4);
-        
+
         id result = NSAccessibilityUnignoredChildrenForOnlyChild([self getAxData:env]);
-        
+
         (*env)->PopLocalFrame(env, NULL);
-        
+
         return result;
     }
     else
@@ -642,28 +642,28 @@
 {
     AWT_ASSERT_APPKIT_THREAD;
     JNIEnv *env = [ThreadUtilities getJNIEnv];
-    
+
     (*env)->PushLocalFrame(env, 4);
-    
+
     id result = [[self getAxData:env] accessibilityHitTest:point withEnv:env];
-    
+
     (*env)->PopLocalFrame(env, NULL);
-    
+
     return result;
 }
 
 - (id)accessibilityFocusedUIElement
 {
     AWT_ASSERT_APPKIT_THREAD;
-    
+
     JNIEnv *env = [ThreadUtilities getJNIEnv];
-    
+
     (*env)->PushLocalFrame(env, 4);
-    
+
     id result = [[self getAxData:env] accessibilityFocusedUIElement];
-    
+
     (*env)->PopLocalFrame(env, NULL);
-    
+
     return result;
 }
 
@@ -702,12 +702,12 @@
 - (id)validRequestorForSendType:(NSString *)sendType returnType:(NSString *)returnType
 {
     if ([[self window] firstResponder] != self) return nil; // let AWT components handle themselves
-    
+
     if ([sendType isEqual:NSStringPboardType] || [returnType isEqual:NSStringPboardType]) {
         NSString *selectedText = [self accessibleSelectedText];
         if (selectedText) return self;
     }
-    
+
     return nil;
 }
 
@@ -719,13 +719,13 @@
         [pboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil];
         return [pboard setString:[self accessibleSelectedText] forType:NSStringPboardType];
     }
-    
+
     if ([types containsObject:NSRTFDPboardType])
     {
         [pboard declareTypes:[NSArray arrayWithObject:NSRTFDPboardType] owner:nil];
         return [pboard setData:[self accessibleSelectedTextAsRTFD] forType:NSRTFDPboardType];
     }
-    
+
     return NO;
 }
 
@@ -737,17 +737,17 @@
         NSString *text = [pboard stringForType:NSStringPboardType];
         return [self replaceAccessibleTextSelection:text];
     }
-    
+
     if ([[pboard types] containsObject:NSRTFDPboardType])
     {
         NSData *rtfdData = [pboard dataForType:NSRTFDPboardType];
         NSAttributedString *styledText = [[NSAttributedString alloc] initWithRTFD:rtfdData documentAttributes:NULL];
         NSString *text = [styledText string];
         [styledText release];
-        
+
         return [self replaceAccessibleTextSelection:text];
     }
-    
+
     return NO;
 }
 
@@ -769,7 +769,7 @@
     // If draggingSource is nil route the message to the superclass (if responding to the selector):
     CDragSource *dragSource = self._dragSource;
     NSDragOperation dragOp = NSDragOperationNone;
-    
+
     if (dragSource != nil) {
         dragOp = [dragSource draggingSourceOperationMaskForLocal:flag];
     }
@@ -781,7 +781,7 @@
     // If draggingSource is nil route the message to the superclass (if responding to the selector):
     CDragSource *dragSource = self._dragSource;
     NSArray* array = nil;
-    
+
     if (dragSource != nil) {
         array = [dragSource namesOfPromisedFilesDroppedAtDestination:dropDestination];
     }
@@ -792,7 +792,7 @@
 {
     // If draggingSource is nil route the message to the superclass (if responding to the selector):
     CDragSource *dragSource = self._dragSource;
-    
+
     if (dragSource != nil) {
         [dragSource draggedImage:image beganAt:screenPoint];
     }
@@ -802,7 +802,7 @@
 {
     // If draggingSource is nil route the message to the superclass (if responding to the selector):
     CDragSource *dragSource = self._dragSource;
-    
+
     if (dragSource != nil) {
         [dragSource draggedImage:image endedAt:screenPoint operation:operation];
     }
@@ -812,7 +812,7 @@
 {
     // If draggingSource is nil route the message to the superclass (if responding to the selector):
     CDragSource *dragSource = self._dragSource;
-    
+
     if (dragSource != nil) {
         [dragSource draggedImage:image movedTo:screenPoint];
     }
@@ -823,7 +823,7 @@
     // If draggingSource is nil route the message to the superclass (if responding to the selector):
     CDragSource *dragSource = self._dragSource;
     BOOL result = FALSE;
-    
+
     if (dragSource != nil) {
         result = [dragSource ignoreModifierKeysWhileDragging];
     }
@@ -839,7 +839,7 @@
     // If draggingDestination is nil route the message to the superclass:
     CDropTarget *dropTarget = self._dropTarget;
     NSDragOperation dragOp = NSDragOperationNone;
-    
+
     if (dropTarget != nil) {
         dragOp = [dropTarget draggingEntered:sender];
     }
@@ -851,7 +851,7 @@
     // If draggingDestination is nil route the message to the superclass:
     CDropTarget *dropTarget = self._dropTarget;
     NSDragOperation dragOp = NSDragOperationNone;
-    
+
     if (dropTarget != nil) {
         dragOp = [dropTarget draggingUpdated:sender];
     }
@@ -862,7 +862,7 @@
 {
     // If draggingDestination is nil route the message to the superclass:
     CDropTarget *dropTarget = self._dropTarget;
-    
+
     if (dropTarget != nil) {
         [dropTarget draggingExited:sender];
     }
@@ -873,7 +873,7 @@
     // If draggingDestination is nil route the message to the superclass:
     CDropTarget *dropTarget = self._dropTarget;
     BOOL result = FALSE;
-    
+
     if (dropTarget != nil) {
         result = [dropTarget prepareForDragOperation:sender];
     }
@@ -885,7 +885,7 @@
     // If draggingDestination is nil route the message to the superclass:
     CDropTarget *dropTarget = self._dropTarget;
     BOOL result = FALSE;
-    
+
     if (dropTarget != nil) {
         result = [dropTarget performDragOperation:sender];
     }
@@ -896,7 +896,7 @@
 {
     // If draggingDestination is nil route the message to the superclass:
     CDropTarget *dropTarget = self._dropTarget;
-    
+
     if (dropTarget != nil) {
         [dropTarget concludeDragOperation:sender];
     }
@@ -906,7 +906,7 @@
 {
     // If draggingDestination is nil route the message to the superclass:
     CDropTarget *dropTarget = self._dropTarget;
-    
+
     if (dropTarget != nil) {
         [dropTarget draggingEnded:sender];
     }
@@ -924,20 +924,20 @@
 #ifdef IM_DEBUG
     fprintf(stderr, "AWTView InputMethod Selector Called : [insertText]: %s\n", [aString UTF8String]);
 #endif // IM_DEBUG
-    
+
     if (fInputMethodLOCKABLE == NULL) {
         return;
     }
-    
+
     // Insert happens at the end of PAH
     fInPressAndHold = NO;
-    
+
     // insertText gets called when the user commits text generated from an input method.  It also gets
     // called during ordinary input as well.  We only need to send an input method event when we have marked
     // text, or 'text in progress'.  We also need to send the event if we get an insert text out of the blue!
     // (i.e., when the user uses the Character palette or Inkwell), or when the string to insert is a complex
     // Unicode value.
-    
+
     NSMutableString * useString = [self parseString:aString];
     NSUInteger utf16Length = [useString lengthOfBytesUsingEncoding:NSUTF16StringEncoding];
     NSUInteger utf8Length = [useString lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
@@ -946,22 +946,22 @@
         ((utf8Length > 1) && [self isCodePointInUnicodeBlockNeedingIMEvent:[useString characterAtIndex:0]])) {
         aStringIsComplex = YES;
     }
-    
+
     if ([self hasMarkedText] || !fProcessingKeystroke || aStringIsComplex) {
         JNIEnv *env = [ThreadUtilities getJNIEnv];
-        
+
         static JNF_MEMBER_CACHE(jm_selectPreviousGlyph, jc_CInputMethod, "selectPreviousGlyph", "()V");
         // We need to select the previous glyph so that it is overwritten.
         if (fPAHNeedsToSelect) {
             JNFCallVoidMethod(env, fInputMethodLOCKABLE, jm_selectPreviousGlyph);
             fPAHNeedsToSelect = NO;
         }
-        
+
         static JNF_MEMBER_CACHE(jm_insertText, jc_CInputMethod, "insertText", "(Ljava/lang/String;)V");
         jstring insertedText =  JNFNSToJavaString(env, useString);
         JNFCallVoidMethod(env, fInputMethodLOCKABLE, jm_insertText, insertedText); // AWT_THREADING Safe (AWTRunLoopMode)
         (*env)->DeleteLocalRef(env, insertedText);
-        
+
         // The input method event will create psuedo-key events for each character in the committed string.
         // We also don't want to send the character that triggered the insertText, usually a return. [3337563]
         fKeyEventsNeeded = NO;
@@ -993,7 +993,7 @@
 {
     if (!fInputMethodLOCKABLE)
         return;
-    
+
     BOOL isAttributedString = [aString isKindOfClass:[NSAttributedString class]];
     NSAttributedString *attrString = (isAttributedString ? (NSAttributedString *)aString : nil);
     NSString *incomingString = (isAttributedString ? [aString string] : aString);
@@ -1004,14 +1004,14 @@
     static JNF_MEMBER_CACHE(jm_addAttribute, jc_CInputMethod, "addAttribute", "(ZZII)V");
     static JNF_MEMBER_CACHE(jm_dispatchText, jc_CInputMethod, "dispatchText", "(IIZ)V");
     JNIEnv *env = [ThreadUtilities getJNIEnv];
-    
+
     // NSInputContext already did the analysis of the TSM event and created attributes indicating
     // the underlining and color that should be done to the string.  We need to look at the underline
     // style and color to determine what kind of Java hilighting needs to be done.
     jstring inProcessText = JNFNSToJavaString(env, incomingString);
     JNFCallVoidMethod(env, fInputMethodLOCKABLE, jm_startIMUpdate, inProcessText); // AWT_THREADING Safe (AWTRunLoopMode)
     (*env)->DeleteLocalRef(env, inProcessText);
-    
+
     if (isAttributedString) {
         NSUInteger length;
         NSRange effectiveRange;
@@ -1027,25 +1027,25 @@
                 (NSNumber *)[attributes objectForKey:NSUnderlineStyleAttributeName];
                 NSInteger underlineSize = [underlineSizeObj integerValue];
                 isThickUnderline = (underlineSize > 1);
-                
+
                 NSColor *underlineColorObj =
                 (NSColor *)[attributes objectForKey:NSUnderlineColorAttributeName];
                 isGray = !([underlineColorObj isEqual:[NSColor blackColor]]);
-                
+
                 JNFCallVoidMethod(env, fInputMethodLOCKABLE, jm_addAttribute, isThickUnderline, isGray, effectiveRange.location, effectiveRange.length); // AWT_THREADING Safe (AWTRunLoopMode)
             }
         }
     }
-    
+
     static JNF_MEMBER_CACHE(jm_selectPreviousGlyph, jc_CInputMethod, "selectPreviousGlyph", "()V");
     // We need to select the previous glyph so that it is overwritten.
     if (fPAHNeedsToSelect) {
         JNFCallVoidMethod(env, fInputMethodLOCKABLE, jm_selectPreviousGlyph);
         fPAHNeedsToSelect = NO;
     }
-    
+
     JNFCallVoidMethod(env, fInputMethodLOCKABLE, jm_dispatchText, selectionRange.location, selectionRange.length, JNI_FALSE); // AWT_THREADING Safe (AWTRunLoopMode)
-    
+
     // If the marked text is being cleared (zero-length string) don't handle the key event.
     if ([incomingString length] == 0) {
         fKeyEventsNeeded = NO;
@@ -1057,16 +1057,16 @@
 #ifdef IM_DEBUG
     fprintf(stderr, "AWTView InputMethod Selector Called : [unmarkText]\n");
 #endif // IM_DEBUG
-    
+
     if (!fInputMethodLOCKABLE) {
         return;
     }
-    
+
     // unmarkText cancels any input in progress and commits it to the text field.
     static JNF_MEMBER_CACHE(jm_unmarkText, jc_CInputMethod, "unmarkText", "()V");
     JNIEnv *env = [ThreadUtilities getJNIEnv];
     JNFCallVoidMethod(env, fInputMethodLOCKABLE, jm_unmarkText); // AWT_THREADING Safe (AWTRunLoopMode)
-    
+
 }
 
 - (BOOL) hasMarkedText
@@ -1074,24 +1074,24 @@
 #ifdef IM_DEBUG
     fprintf(stderr, "AWTView InputMethod Selector Called : [hasMarkedText]\n");
 #endif // IM_DEBUG
-    
+
     if (!fInputMethodLOCKABLE) {
         return NO;
     }
-    
+
     static JNF_MEMBER_CACHE(jf_fCurrentText, jc_CInputMethod, "fCurrentText", "Ljava/text/AttributedString;");
     static JNF_MEMBER_CACHE(jf_fCurrentTextLength, jc_CInputMethod, "fCurrentTextLength", "I");
     JNIEnv *env = [ThreadUtilities getJNIEnv];
     jobject currentText = JNFGetObjectField(env, fInputMethodLOCKABLE, jf_fCurrentText);
-    
+
     jint currentTextLength = JNFGetIntField(env, fInputMethodLOCKABLE, jf_fCurrentTextLength);
-    
+
     BOOL hasMarkedText = (currentText != NULL && currentTextLength > 0);
-    
+
     if (currentText != NULL) {
         (*env)->DeleteLocalRef(env, currentText);
     }
-    
+
     return hasMarkedText;
 }
 
@@ -1100,7 +1100,7 @@
 #ifdef IM_DEBUG
     fprintf(stderr, "AWTView InputMethod Selector Called : [conversationIdentifier]\n");
 #endif // IM_DEBUG
-    
+
     return (NSInteger) self;
 }
 
@@ -1112,16 +1112,16 @@
 #ifdef IM_DEBUG
     fprintf(stderr, "AWTView InputMethod Selector Called : [attributedSubstringFromRange] location=%lu, length=%lu\n", (unsigned long)theRange.location, (unsigned long)theRange.length);
 #endif // IM_DEBUG
-    
+
     static JNF_MEMBER_CACHE(jm_substringFromRange, jc_CInputMethod, "attributedSubstringFromRange", "(II)Ljava/lang/String;");
     JNIEnv *env = [ThreadUtilities getJNIEnv];
     jobject theString = JNFCallObjectMethod(env, fInputMethodLOCKABLE, jm_substringFromRange, theRange.location, theRange.length); // AWT_THREADING Safe (AWTRunLoopMode)
-    
+
     id result = [[[NSAttributedString alloc] initWithString:JNFJavaToNSString(env, theString)] autorelease];
 #ifdef IM_DEBUG
     NSLog(@"attributedSubstringFromRange returning \"%@\"", result);
 #endif // IM_DEBUG
-    
+
     (*env)->DeleteLocalRef(env, theString);
     return result;
 }
@@ -1131,24 +1131,24 @@
  */
 - (NSRange) markedRange
 {
-    
+
 #ifdef IM_DEBUG
     fprintf(stderr, "AWTView InputMethod Selector Called : [markedRange]\n");
 #endif // IM_DEBUG
-    
+
     if (!fInputMethodLOCKABLE) {
         return NSMakeRange(NSNotFound, 0);
     }
-    
+
     static JNF_MEMBER_CACHE(jm_markedRange, jc_CInputMethod, "markedRange", "()[I");
     JNIEnv *env = [ThreadUtilities getJNIEnv];
     jarray array;
     jboolean isCopy;
     jint *_array;
     NSRange range = NSMakeRange(NSNotFound, 0);
-    
+
     array = JNFCallObjectMethod(env, fInputMethodLOCKABLE, jm_markedRange); // AWT_THREADING Safe (AWTRunLoopMode)
-    
+
     if (array) {
         _array = (*env)->GetIntArrayElements(env, array, &isCopy);
         if (_array != NULL) {
@@ -1162,7 +1162,7 @@
         }
         (*env)->DeleteLocalRef(env, array);
     }
-    
+
     return range;
 }
 
@@ -1174,18 +1174,18 @@
     if (!fInputMethodLOCKABLE) {
         return NSMakeRange(NSNotFound, 0);
     }
-    
+
     static JNF_MEMBER_CACHE(jm_selectedRange, jc_CInputMethod, "selectedRange", "()[I");
     JNIEnv *env = [ThreadUtilities getJNIEnv];
     jarray array;
     jboolean isCopy;
     jint *_array;
     NSRange range = NSMakeRange(NSNotFound, 0);
-    
+
 #ifdef IM_DEBUG
     fprintf(stderr, "AWTView InputMethod Selector Called : [selectedRange]\n");
 #endif // IM_DEBUG
-    
+
     array = JNFCallObjectMethod(env, fInputMethodLOCKABLE, jm_selectedRange); // AWT_THREADING Safe (AWTRunLoopMode)
     if (array) {
         _array = (*env)->GetIntArrayElements(env, array, &isCopy);
@@ -1196,7 +1196,7 @@
         }
         (*env)->DeleteLocalRef(env, array);
     }
-    
+
     return range;
 }
 
@@ -1207,7 +1207,7 @@
     if (!fInputMethodLOCKABLE) {
         return NSZeroRect;
     }
-    
+
     static JNF_MEMBER_CACHE(jm_firstRectForCharacterRange, jc_CInputMethod,
                             "firstRectForCharacterRange", "(I)[I");
     JNIEnv *env = [ThreadUtilities getJNIEnv];
@@ -1215,16 +1215,16 @@
     jboolean isCopy;
     jint *_array;
     NSRect rect;
-    
+
 #ifdef IM_DEBUG
     fprintf(stderr,
             "AWTView InputMethod Selector Called : [firstRectForCharacterRange:] location=%lu, length=%lu\n",
             (unsigned long)theRange.location, (unsigned long)theRange.length);
 #endif // IM_DEBUG
-    
+
     array = JNFCallObjectMethod(env, fInputMethodLOCKABLE, jm_firstRectForCharacterRange,
                                 theRange.location); // AWT_THREADING Safe (AWTRunLoopMode)
-    
+
     _array = (*env)->GetIntArrayElements(env, array, &isCopy);
     if (_array) {
         rect = ConvertNSScreenRect(env, NSMakeRect(_array[0], _array[1], _array[2], _array[3]));
@@ -1233,7 +1233,7 @@
         rect = NSZeroRect;
     }
     (*env)->DeleteLocalRef(env, array);
-    
+
 #ifdef IM_DEBUG
     fprintf(stderr,
             "firstRectForCharacterRange returning x=%f, y=%f, width=%f, height=%f\n",
@@ -1250,23 +1250,23 @@
     if (!fInputMethodLOCKABLE) {
         return NSNotFound;
     }
-    
+
     static JNF_MEMBER_CACHE(jm_characterIndexForPoint, jc_CInputMethod,
                             "characterIndexForPoint", "(II)I");
     JNIEnv *env = [ThreadUtilities getJNIEnv];
-    
+
     NSPoint flippedLocation = ConvertNSScreenPoint(env, thePoint);
-    
+
 #ifdef IM_DEBUG
     fprintf(stderr, "AWTView InputMethod Selector Called : [characterIndexForPoint:(NSPoint)thePoint] x=%f, y=%f\n", flippedLocation.x, flippedLocation.y);
 #endif // IM_DEBUG
-    
+
     jint index = JNFCallIntMethod(env, fInputMethodLOCKABLE, jm_characterIndexForPoint, (jint)flippedLocation.x, (jint)flippedLocation.y); // AWT_THREADING Safe (AWTRunLoopMode)
-    
+
 #ifdef IM_DEBUG
     fprintf(stderr, "characterIndexForPoint returning %ld\n", index);
 #endif // IM_DEBUG
-    
+
     if (index == -1) {
         return NSNotFound;
     } else {
@@ -1279,7 +1279,7 @@
 #ifdef IM_DEBUG
     fprintf(stderr, "AWTView InputMethod Selector Called : [validAttributesForMarkedText]\n");
 #endif // IM_DEBUG
-    
+
     return [NSArray array];
 }
 
@@ -1288,14 +1288,14 @@
 #ifdef IM_DEBUG
     fprintf(stderr, "AWTView InputMethod Selector Called : [setInputMethod]\n");
 #endif // IM_DEBUG
-    
+
     JNIEnv *env = [ThreadUtilities getJNIEnv];
-    
+
     // Get rid of the old one
     if (fInputMethodLOCKABLE) {
         JNFDeleteGlobalRef(env, fInputMethodLOCKABLE);
     }
-    
+
     // Save a global ref to the new input method.
     if (inputMethod != NULL)
         fInputMethodLOCKABLE = JNFNewGlobalRef(env, inputMethod);
@@ -1308,7 +1308,7 @@
 #ifdef IM_DEBUG
     fprintf(stderr, "AWTView InputMethod Selector Called : [abandonInput]\n");
 #endif // IM_DEBUG
-    
+
     [ThreadUtilities performOnMainThread:@selector(markedTextAbandoned:) on:[NSInputManager currentInputManager] withObject:self waitUntilDone:YES];
     [self unmarkText];
 }
@@ -1330,22 +1330,22 @@
 (JNIEnv *env, jobject obj, jint originX, jint originY, jint width, jint height, jlong windowLayerPtr)
 {
     __block AWTView *newView = nil;
-    
+
     JNF_COCOA_ENTER(env);
-    
+
     NSRect rect = NSMakeRect(originX, originY, width, height);
     jobject cPlatformView = (*env)->NewWeakGlobalRef(env, obj);
-    
+
     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-        
+
         CALayer *windowLayer = jlong_to_ptr(windowLayerPtr);
         newView = [[AWTView alloc] initWithRect:rect
                                    platformView:cPlatformView
                                     windowLayer:windowLayer];
     }];
-    
+
     JNF_COCOA_EXIT(env);
-    
+
     return ptr_to_jlong(newView);
 }
 
@@ -1360,21 +1360,21 @@
 (JNIEnv *env, jclass cls, jlong viewPtr, jboolean toResize)
 {
     JNF_COCOA_ENTER(env);
-    
+
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
-    
+
     [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
-        
+
         if (toResize) {
             [view setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable];
         } else {
             [view setAutoresizingMask: NSViewMinYMargin | NSViewMaxXMargin];
         }
-        
+
         if ([view superview] != nil) {
             [[view superview] setAutoresizesSubviews:(BOOL)toResize];
         }
-        
+
     }];
     JNF_COCOA_EXIT(env);
 }
@@ -1390,19 +1390,19 @@
 (JNIEnv *env, jclass cls, jlong viewPtr)
 {
     __block jint ret; //CGDirectDisplayID
-    
+
     JNF_COCOA_ENTER(env);
-    
+
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
     NSWindow *window = [view window];
-    
+
     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-        
+
         ret = (jint)[[AWTWindow getNSWindowDisplayID_AppKitThread: window] intValue];
     }];
-    
+
     JNF_COCOA_EXIT(env);
-    
+
     return ret;
 }
 
@@ -1417,25 +1417,25 @@
 (JNIEnv *env, jclass cls, jlong viewPtr)
 {
     jobject jRect = NULL;
-    
+
     JNF_COCOA_ENTER(env);
-    
+
     __block NSRect rect = NSZeroRect;
-    
+
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-        
+
         NSRect viewBounds = [view bounds];
         NSRect frameInWindow = [view convertRect:viewBounds toView:nil];
         rect = [[view window] convertRectToScreen:frameInWindow];
-        NSRect screenRect = [[NSScreen mainScreen] frame];
         //Convert coordinates to top-left corner origin
-        rect.origin.y = screenRect.size.height - rect.origin.y - viewBounds.size.height;
+        rect = ConvertNSScreenRect(NULL, rect);
+
     }];
     jRect = NSToJavaRect(env, rect);
-    
+
     JNF_COCOA_EXIT(env);
-    
+
     return jRect;
 }
 
@@ -1449,17 +1449,17 @@
 (JNIEnv *env, jclass clazz, jlong viewPtr)
 {
     __block jboolean underMouse = JNI_FALSE;
-    
+
     JNF_COCOA_ENTER(env);
-    
+
     NSView *nsView = OBJC(viewPtr);
-    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){       
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         NSPoint ptWindowCoords = [[nsView window] mouseLocationOutsideOfEventStream];
         NSPoint ptViewCoords = [nsView convertPoint:ptWindowCoords fromView:nil];
         underMouse = [nsView hitTest:ptViewCoords] != nil;
     }];
-    
+
     JNF_COCOA_EXIT(env);
-    
+
     return underMouse;
 }
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.m	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.m	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -134,8 +134,7 @@
     NSPoint absP = [NSEvent mouseLocation];
     NSEventType type = [event type];
 
-    NSRect screenRect = [[NSScreen mainScreen] frame];
-    absP.y = screenRect.size.height - absP.y;
+    absP = ConvertNSScreenPoint(NULL, absP);
     jint clickCount;
 
     clickCount = [event clickCount];
@@ -179,15 +178,15 @@
     isHighlighted = NO;
     image = nil;
     trackingArea = nil;
-	
+
     [self addTrackingArea];
-	
+
     return self;
 }
 
 - (void)addTrackingArea {
-    NSTrackingAreaOptions options = NSTrackingMouseMoved | 
-                                    NSTrackingInVisibleRect | 
+    NSTrackingAreaOptions options = NSTrackingMouseMoved |
+                                    NSTrackingInVisibleRect |
                                     NSTrackingActiveAlways;
     trackingArea = [[NSTrackingArea alloc] initWithRect: CGRectZero
                                                 options: options
@@ -410,3 +409,28 @@
 
     return jpt;
 }
+
+JNIEXPORT void JNICALL
+Java_sun_lwawt_macosx_CTrayIcon_nativeShowNotification
+(JNIEnv *env, jobject self, jlong model, jobject jcaption, jobject jtext,
+              long nsimage) {
+JNF_COCOA_ENTER(env);
+
+    AWTTrayIcon *icon = jlong_to_ptr(model);
+    NSString *caption = JNFJavaToNSString(env, jcaption);
+    NSString *text = JNFJavaToNSString(env, jtext);
+    NSImage * contentImage = jlong_to_ptr(nsimage);
+
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
+        NSUserNotification *notification = [[NSUserNotification alloc] init];
+        notification.title = caption;
+        notification.informativeText = text;
+        notification.contentImage = contentImage;
+        notification.soundName = NSUserNotificationDefaultSoundName;
+
+        [[NSUserNotificationCenter defaultUserNotificationCenter]
+            deliverNotification:notification];
+    }];
+
+JNF_COCOA_EXIT(env);
+}
--- a/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.h	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.h	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@
 #import <Cocoa/Cocoa.h>
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
 
-@interface NSApplicationAWT : NSApplication {
+@interface NSApplicationAWT : NSApplication <NSUserNotificationCenterDelegate> {
     NSString *fApplicationName;
     NSWindow *eventTransparentWindow;
     NSTimeInterval dummyEventTimestamp;
--- a/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m	Wed Nov 01 10:00:38 2017 -0700
@@ -77,6 +77,8 @@
 
 - (void)dealloc
 {
+    [[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:nil];
+
     [fApplicationName release];
     fApplicationName = nil;
 
@@ -138,10 +140,18 @@
 
     [super finishLaunching];
 
+    [[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:self];
+
     // inform any interested parties that the AWT has arrived and is pumping
     [[NSNotificationCenter defaultCenter] postNotificationName:JNFRunLoopDidStartNotification object:self];
 }
 
+- (BOOL)userNotificationCenter:(NSUserNotificationCenter *)center
+     shouldPresentNotification:(NSUserNotification *)notification
+{
+    return YES; // We always show notifications to the user
+}
+
 - (void) registerWithProcessManager
 {
     // Headless: NO
--- a/src/java.desktop/share/classes/com/sun/awt/AWTUtilities.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/com/sun/awt/AWTUtilities.java	Wed Nov 01 10:00:38 2017 -0700
@@ -25,7 +25,16 @@
 
 package com.sun.awt;
 
-import java.awt.*;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dialog;
+import java.awt.Frame;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.Shape;
+import java.awt.Toolkit;
+import java.awt.Window;
 
 import javax.swing.JRootPane;
 
@@ -64,6 +73,7 @@
  * drastically between update release, and it may even be
  * removed or be moved in some other package(s)/class(es).
  */
+@Deprecated(forRemoval = true, since = "10")
 public final class AWTUtilities {
 
     /**
@@ -114,7 +124,10 @@
      *                         (either PERPIXEL_TRANSPARENT,
      *                         TRANSLUCENT, or PERPIXEL_TRANSLUCENT)
      * @return whether the given translucency kind is supported
+     * @deprecated use {@link GraphicsDevice#isWindowTranslucencySupported}
+     *             instead
      */
+    @Deprecated(forRemoval = true, since = "10")
     public static boolean isTranslucencySupported(Translucency translucencyKind) {
         switch (translucencyKind) {
             case PERPIXEL_TRANSPARENT:
@@ -166,14 +179,15 @@
      *                                  and the opacity is less than 1.0f
      * @throws UnsupportedOperationException if the TRANSLUCENT translucency
      *                                       kind is not supported
+     * @deprecated use {@link Window#setOpacity} instead
      */
+    @Deprecated(forRemoval = true, since = "10")
     public static void setWindowOpacity(Window window, float opacity) {
         if (window == null) {
             throw new NullPointerException(
                     "The window argument should not be null.");
         }
-
-        AWTAccessor.getWindowAccessor().setOpacity(window, opacity);
+        window.setOpacity(opacity);
     }
 
     /**
@@ -182,14 +196,16 @@
      *
      * @param window the window to get the opacity level from
      * @throws NullPointerException if the window argument is null
+     * @deprecated use {@link Window#getOpacity} instead
      */
+    @Deprecated(forRemoval = true, since = "10")
     public static float getWindowOpacity(Window window) {
         if (window == null) {
             throw new NullPointerException(
                     "The window argument should not be null.");
         }
 
-        return AWTAccessor.getWindowAccessor().getOpacity(window);
+        return window.getOpacity();
     }
 
     /**
@@ -198,7 +214,10 @@
      * Note that this method may sometimes return true, but the native
      * windowing system may still not support the concept of
      * shaping (due to the bugs in the windowing system).
+     * @deprecated use {@link GraphicsDevice#isWindowTranslucencySupported}
+     *             instead
      */
+    @Deprecated(forRemoval = true, since = "10")
     public static boolean isWindowShapingSupported() {
         Toolkit curToolkit = Toolkit.getDefaultToolkit();
         if (!(curToolkit instanceof SunToolkit)) {
@@ -216,13 +235,15 @@
      * @param window the window to get the shape from
      * @return the current shape of the window
      * @throws NullPointerException if the window argument is null
+     * @deprecated use {@link Window#getShape} instead
      */
+    @Deprecated(forRemoval = true, since = "10")
     public static Shape getWindowShape(Window window) {
         if (window == null) {
             throw new NullPointerException(
                     "The window argument should not be null.");
         }
-        return AWTAccessor.getWindowAccessor().getShape(window);
+        return window.getShape();
     }
 
     /**
@@ -247,13 +268,15 @@
      *                                  and the shape is not null
      * @throws UnsupportedOperationException if the PERPIXEL_TRANSPARENT
      *                                       translucency kind is not supported
+     * @deprecated use {@link Window#setShape} instead
      */
+    @Deprecated(forRemoval = true, since = "10")
     public static void setWindowShape(Window window, Shape shape) {
         if (window == null) {
             throw new NullPointerException(
                     "The window argument should not be null.");
         }
-        AWTAccessor.getWindowAccessor().setShape(window, shape);
+        window.setShape(shape);
     }
 
     private static boolean isWindowTranslucencySupported() {
@@ -349,7 +372,9 @@
      * isOpaque argument is {@code false}.
      * @throws UnsupportedOperationException if the PERPIXEL_TRANSLUCENT
      *                                       translucency kind is not supported
+     * @deprecated use {@link Window#setBackground} instead
      */
+    @Deprecated(forRemoval = true, since = "10")
     public static void setWindowOpaque(Window window, boolean isOpaque) {
         if (window == null) {
             throw new NullPointerException(
@@ -359,7 +384,12 @@
             throw new UnsupportedOperationException(
                     "The PERPIXEL_TRANSLUCENT translucency kind is not supported");
         }
-        AWTAccessor.getWindowAccessor().setOpaque(window, isOpaque);
+        Color bg = window.getBackground();
+        if (bg == null) {
+            bg = new Color(0, 0, 0, 0);
+        }
+        window.setBackground(new Color(bg.getRed(), bg.getGreen(), bg.getBlue(),
+                                       isOpaque ? 255 : 0));
     }
 
     /**
@@ -369,7 +399,9 @@
      * @return whether the window is currently opaque (true)
      *         or translucent (false)
      * @throws NullPointerException if the window argument is null
+     * @deprecated use {@link Window#isOpaque} instead
      */
+    @Deprecated(forRemoval = true, since = "10")
     public static boolean isWindowOpaque(Window window) {
         if (window == null) {
             throw new NullPointerException(
@@ -395,7 +427,10 @@
      * @throws NullPointerException if the gc argument is null
      * @return whether the given GraphicsConfiguration supports
      *         the translucency effects.
+     * @deprecated use {@link GraphicsConfiguration#isTranslucencyCapable}
+     *             instead
      */
+    @Deprecated(forRemoval = true, since = "10")
     public static boolean isTranslucencyCapable(GraphicsConfiguration gc) {
         if (gc == null) {
             throw new NullPointerException("The gc argument should not be null");
@@ -448,8 +483,9 @@
      * 'mixing-cutout' shape
      * @param shape the new 'mixing-cutout' shape
      * @throws NullPointerException if the component argument is {@code null}
+     * @deprecated use {@link Component#setMixingCutoutShape} instead
      */
-    @Deprecated(since = "9")
+    @Deprecated(forRemoval = true, since = "9")
     public static void setComponentMixingCutoutShape(Component component,
             Shape shape)
     {
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFCompressor.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFCompressor.java	Wed Nov 01 10:00:38 2017 -0700
@@ -68,12 +68,7 @@
     protected ImageOutputStream stream;
 
     /**
-     * Creates a compressor object for use in compressing TIFF data. This
-     * object may be passed to the
-     * {@link TIFFImageWriteParam#setTIFFCompressor(TIFFCompressor)}
-     * method to override the compressor of a supported compression type or
-     * to provide the implementation of the compression algorithm of an
-     * unsupported compression type.
+     * Creates a compressor object for use in compressing TIFF data.
      *
      * <p>The parameters {@code compressionTagValue} and
      * {@code isCompressionLossless} are provided to accomodate
--- a/src/java.desktop/share/classes/java/applet/AppletContext.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/java/applet/AppletContext.java	Wed Nov 01 10:00:38 2017 -0700
@@ -117,24 +117,30 @@
      * <table class="striped">
      * <caption>Target arguments and their descriptions</caption>
      * <thead>
-     * <tr><th>Target Argument</th>
-     * <th>Description</th></tr>
+     *   <tr>
+     *     <th scope="col">Target Argument
+     *     <th scope="col">Description
      * </thead>
      * <tbody>
-     * <tr><td>{@code "_self"}  <td>Show in the window and frame that
-     *                                   contain the applet.</tr>
-     * <tr><td>{@code "_parent"}<td>Show in the applet's parent frame. If
-     *                                   the applet's frame has no parent frame,
-     *                                   acts the same as "_self".</tr>
-     * <tr><td>{@code "_top"}   <td>Show in the top-level frame of the applet's
-     *                                   window. If the applet's frame is the
-     *                                   top-level frame, acts the same as "_self".</tr>
-     * <tr><td>{@code "_blank"} <td>Show in a new, unnamed
-     *                                   top-level window.</tr>
-     * <tr><td><i>name</i><td>Show in the frame or window named <i>name</i>. If
-     *                        a target named <i>name</i> does not already exist, a
-     *                        new top-level window with the specified name is created,
-     *                        and the document is shown there.</tr>
+     *   <tr>
+     *     <th scope="row">{@code "_self"}
+     *     <td>Show in the window and frame that contain the applet.
+     *   <tr>
+     *     <th scope="row">{@code "_parent"}
+     *     <td>Show in the applet's parent frame. If the applet's frame has no
+     *     parent frame, acts the same as "_self".
+     *   <tr>
+     *     <th scope="row">{@code "_top"}
+     *     <td>Show in the top-level frame of the applet's window. If the
+     *     applet's frame is the top-level frame, acts the same as "_self".
+     *   <tr>
+     *     <th scope="row">{@code "_blank"}
+     *     <td>Show in a new, unnamed top-level window.
+     *   <tr>
+     *     <th scope="row"><i>name</i>
+     *     <td>Show in the frame or window named <i>name</i>. If a target named
+     *     <i>name</i> does not already exist, a new top-level window with the
+     *     specified name is created, and the document is shown there.
      * </tbody>
      * </table>
      * <p>
--- a/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java	Wed Nov 01 10:00:38 2017 -0700
@@ -94,25 +94,23 @@
      * <table class="striped">
      * <caption>AWTKeyStroke default values</caption>
      * <thead>
-     * <tr><th>Property</th><th>Default Value</th></tr>
+     *   <tr>
+     *     <th scope="col">Property
+     *     <th scope="col">Default Value
      * </thead>
      * <tbody>
-     * <tr>
-     *    <td>Key Char</td>
-     *    <td>{@code KeyEvent.CHAR_UNDEFINED}</td>
-     * </tr>
-     * <tr>
-     *    <td>Key Code</td>
-     *    <td>{@code KeyEvent.VK_UNDEFINED}</td>
-     * </tr>
-     * <tr>
-     *    <td>Modifiers</td>
-     *    <td>none</td>
-     * </tr>
-     * <tr>
-     *    <td>On key release?</td>
-     *    <td>{@code false}</td>
-     * </tr>
+     *   <tr>
+     *     <th scope="row">Key Char
+     *     <td>{@code KeyEvent.CHAR_UNDEFINED}
+     *   <tr>
+     *     <th scope="row">Key Code
+     *     <td>{@code KeyEvent.VK_UNDEFINED}
+     *   <tr>
+     *     <th scope="row">Modifiers
+     *     <td>none
+     *   <tr>
+     *     <th scope="row">On key release?
+     *     <td>{@code false}
      * </tbody>
      * </table>
      *
--- a/src/java.desktop/share/classes/java/awt/AWTPermission.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/java/awt/AWTPermission.java	Wed Nov 01 10:00:38 2017 -0700
@@ -48,144 +48,116 @@
  * <caption>AWTPermission target names, descriptions, and associated risks
  * </caption>
  * <thead>
- * <tr>
- * <th>Permission Target Name</th>
- * <th>What the Permission Allows</th>
- * <th>Risks of Allowing this Permission</th>
- * </tr>
+ *   <tr>
+ *     <th scope="col">Permission Target Name
+ *     <th scope="col">What the Permission Allows
+ *     <th scope="col">Risks of Allowing this Permission
  * </thead>
  * <tbody>
- * <tr>
- *   <td>accessClipboard</td>
- *   <td>Posting and retrieval of information to and from the AWT clipboard</td>
- *   <td>This would allow malfeasant code to share
- * potentially sensitive or confidential information.</td>
- * </tr>
- *
- * <tr>
- *   <td>accessEventQueue</td>
- *   <td>Access to the AWT event queue</td>
- *   <td>After retrieving the AWT event queue,
- * malicious code may peek at and even remove existing events
- * from its event queue, as well as post bogus events which may purposefully
- * cause the application or applet to misbehave in an insecure manner.</td>
- * </tr>
- *
- * <tr>
- *   <td>accessSystemTray</td>
- *   <td>Access to the AWT SystemTray instance</td>
- *   <td>This would allow malicious code to add tray icons to the system tray.
- * First, such an icon may look like the icon of some known application
- * (such as a firewall or anti-virus) and order a user to do something unsafe
- * (with help of balloon messages). Second, the system tray may be glutted with
- * tray icons so that no one could add a tray icon anymore.</td>
- * </tr>
- *
- * <tr>
- *   <td>createRobot</td>
- *   <td>Create java.awt.Robot objects</td>
- *   <td>The java.awt.Robot object allows code to generate native-level
- * mouse and keyboard events as well as read the screen. It could allow
- * malicious code to control the system, run other programs, read the
- * display, and deny mouse and keyboard access to the user.</td>
- * </tr>
- *
- * <tr>
- *   <td>fullScreenExclusive</td>
- *   <td>Enter full-screen exclusive mode</td>
- *   <td>Entering full-screen exclusive mode allows direct access to
- * low-level graphics card memory.  This could be used to spoof the
- * system, since the program is in direct control of rendering. Depending on
- * the implementation, the security warning may not be shown for the windows
- * used to enter the full-screen exclusive mode (assuming that the {@code
- * fullScreenExclusive} permission has been granted to this application). Note
- * that this behavior does not mean that the {@code
- * showWindowWithoutWarningBanner} permission will be automatically granted to
- * the application which has the {@code fullScreenExclusive} permission:
- * non-full-screen windows will continue to be shown with the security
- * warning.</td>
- * </tr>
- *
- * <tr>
- *   <td>listenToAllAWTEvents</td>
- *   <td>Listen to all AWT events, system-wide</td>
- *   <td>After adding an AWT event listener,
- * malicious code may scan all AWT events dispatched in the system,
- * allowing it to read all user input (such as passwords).  Each
- * AWT event listener is called from within the context of that
- * event queue's EventDispatchThread, so if the accessEventQueue
- * permission is also enabled, malicious code could modify the
- * contents of AWT event queues system-wide, causing the application
- * or applet to misbehave in an insecure manner.</td>
- * </tr>
- *
- * <tr>
- *   <td>readDisplayPixels</td>
- *   <td>Readback of pixels from the display screen</td>
- *   <td>Interfaces such as the java.awt.Composite interface or the
- * java.awt.Robot class allow arbitrary code to examine pixels on the
- * display enable malicious code to snoop on the activities of the user.</td>
- * </tr>
- *
- * <tr>
- *   <td>replaceKeyboardFocusManager</td>
- *   <td>Sets the {@code KeyboardFocusManager} for
- *       a particular thread.
- *   <td>When {@code SecurityManager} is installed, the invoking
- *       thread must be granted this permission in order to replace
- *       the current {@code KeyboardFocusManager}.  If permission
- *       is not granted, a {@code SecurityException} will be thrown.
- * </tr>
- *
- * <tr>
- *   <td>setAppletStub</td>
- *   <td>Setting the stub which implements Applet container services</td>
- *   <td>Malicious code could set an applet's stub and result in unexpected
- * behavior or denial of service to an applet.</td>
- * </tr>
- *
- * <tr>
- *   <td>setWindowAlwaysOnTop</td>
- *   <td>Setting always-on-top property of the window: {@link Window#setAlwaysOnTop}</td>
- *   <td>The malicious window might make itself look and behave like a real full desktop, so that
- * information entered by the unsuspecting user is captured and subsequently misused </td>
- * </tr>
- *
- * <tr>
- *   <td>showWindowWithoutWarningBanner</td>
- *   <td>Display of a window without also displaying a banner warning
- * that the window was created by an applet</td>
- *   <td>Without this warning,
- * an applet may pop up windows without the user knowing that they
- * belong to an applet.  Since users may make security-sensitive
- * decisions based on whether or not the window belongs to an applet
- * (entering a username and password into a dialog box, for example),
- * disabling this warning banner may allow applets to trick the user
- * into entering such information.</td>
- * </tr>
- *
- * <tr>
- *   <td>toolkitModality</td>
- *   <td>Creating {@link Dialog.ModalityType#TOOLKIT_MODAL TOOLKIT_MODAL} dialogs
- *       and setting the {@link Dialog.ModalExclusionType#TOOLKIT_EXCLUDE
- *       TOOLKIT_EXCLUDE} window property.</td>
- *   <td>When a toolkit-modal dialog is shown from an applet, it blocks all other
- * applets in the browser. When launching applications from Java Web Start,
- * its windows (such as the security dialog) may also be blocked by toolkit-modal
- * dialogs, shown from these applications.</td>
- * </tr>
- *
- * <tr>
- *   <td>watchMousePointer</td>
- *   <td>Getting the information about the mouse pointer position at any
- * time</td>
- *   <td>Constantly watching the mouse pointer,
- * an applet can make guesses about what the user is doing, i.e. moving
- * the mouse to the lower left corner of the screen most likely means that
- * the user is about to launch an application. If a virtual keypad is used
- * so that keyboard is emulated using the mouse, an applet may guess what
- * is being typed.</td>
- * </tr>
+ *   <tr>
+ *     <th scope="row">accessClipboard
+ *     <td>Posting and retrieval of information to and from the AWT clipboard
+ *     <td>This would allow malfeasant code to share potentially sensitive or
+ *     confidential information.
+ *   <tr>
+ *     <th scope="row">accessEventQueue
+ *     <td>Access to the AWT event queue
+ *     <td>After retrieving the AWT event queue, malicious code may peek at and
+ *     even remove existing events from its event queue, as well as post bogus
+ *     events which may purposefully cause the application or applet to
+ *     misbehave in an insecure manner.
+ *   <tr>
+ *     <th scope="row">accessSystemTray
+ *     <td>Access to the AWT SystemTray instance
+ *     <td>This would allow malicious code to add tray icons to the system tray.
+ *     First, such an icon may look like the icon of some known application
+ *     (such as a firewall or anti-virus) and order a user to do something
+ *     unsafe (with help of balloon messages). Second, the system tray may be
+ *     glutted with tray icons so that no one could add a tray icon anymore.
+ *   <tr>
+ *     <th scope="row">createRobot
+ *     <td>Create java.awt.Robot objects
+ *     <td>The java.awt.Robot object allows code to generate native-level mouse
+ *     and keyboard events as well as read the screen. It could allow malicious
+ *     code to control the system, run other programs, read the display, and
+ *     deny mouse and keyboard access to the user.
+ *   <tr>
+ *     <th scope="row">fullScreenExclusive
+ *     <td>Enter full-screen exclusive mode
+ *     <td>Entering full-screen exclusive mode allows direct access to low-level
+ *     graphics card memory. This could be used to spoof the system, since the
+ *     program is in direct control of rendering. Depending on the
+ *     implementation, the security warning may not be shown for the windows
+ *     used to enter the full-screen exclusive mode (assuming that the
+ *     {@code fullScreenExclusive} permission has been granted to this
+ *     application). Note that this behavior does not mean that the
+ *     {@code showWindowWithoutWarningBanner} permission will be automatically
+ *     granted to the application which has the {@code fullScreenExclusive}
+ *     permission: non-full-screen windows will continue to be shown with the
+ *     security warning.
+ *   <tr>
+ *     <th scope="row">listenToAllAWTEvents
+ *     <td>Listen to all AWT events, system-wide
+ *     <td>After adding an AWT event listener, malicious code may scan all AWT
+ *     events dispatched in the system, allowing it to read all user input (such
+ *     as passwords). Each AWT event listener is called from within the context
+ *     of that event queue's EventDispatchThread, so if the accessEventQueue
+ *     permission is also enabled, malicious code could modify the contents of
+ *     AWT event queues system-wide, causing the application or applet to
+ *     misbehave in an insecure manner.
+ *   <tr>
+ *     <th scope="row">readDisplayPixels
+ *     <td>Readback of pixels from the display screen
+ *     <td>Interfaces such as the java.awt.Composite interface or the
+ *     java.awt.Robot class allow arbitrary code to examine pixels on the
+ *     display enable malicious code to snoop on the activities of the user.
+ *   <tr>
+ *     <th scope="row">replaceKeyboardFocusManager
+ *     <td>Sets the {@code KeyboardFocusManager} for a particular thread.
+ *     <td>When {@code SecurityManager} is installed, the invoking thread must
+ *     be granted this permission in order to replace the current
+ *     {@code KeyboardFocusManager}. If permission is not granted, a
+ *     {@code SecurityException} will be thrown.
+ *   <tr>
+ *     <th scope="row">setAppletStub
+ *     <td>Setting the stub which implements Applet container services
+ *     <td>Malicious code could set an applet's stub and result in unexpected
+ *     behavior or denial of service to an applet.
+ *   <tr>
+ *     <th scope="row">setWindowAlwaysOnTop
+ *     <td>Setting always-on-top property of the window:
+ *     {@link Window#setAlwaysOnTop}
+ *     <td>The malicious window might make itself look and behave like a real
+ *     full desktop, so that information entered by the unsuspecting user is
+ *     captured and subsequently misused
+ *   <tr>
+ *     <th scope="row">showWindowWithoutWarningBanner
+ *     <td>Display of a window without also displaying a banner warning that the
+ *     window was created by an applet
+ *     <td>Without this warning, an applet may pop up windows without the user
+ *     knowing that they belong to an applet. Since users may make
+ *     security-sensitive decisions based on whether or not the window belongs
+ *     to an applet (entering a username and password into a dialog box, for
+ *     example), disabling this warning banner may allow applets to trick the
+ *     user into entering such information.
+ *   <tr>
+ *     <th scope="row">toolkitModality
+ *     <td>Creating {@link Dialog.ModalityType#TOOLKIT_MODAL TOOLKIT_MODAL}
+ *     dialogs and setting the
+ *     {@link Dialog.ModalExclusionType#TOOLKIT_EXCLUDE TOOLKIT_EXCLUDE} window
+ *     property.
+ *     <td>When a toolkit-modal dialog is shown from an applet, it blocks all
+ *     other applets in the browser. When launching applications from Java Web
+ *     Start, its windows (such as the security dialog) may also be blocked by
+ *     toolkit-modal dialogs, shown from these applications.
+ *   <tr>
+ *     <th scope="row">watchMousePointer
+ *     <td>Getting the information about the mouse pointer position at any time
+ *     <td>Constantly watching the mouse pointer, an applet can make guesses
+ *     about what the user is doing, i.e. moving the mouse to the lower left
+ *     corner of the screen most likely means that the user is about to launch
+ *     an application. If a virtual keypad is used so that keyboard is emulated
+ *     using the mouse, an applet may guess what is being typed.
  * </tbody>
  * </table>
  *
@@ -195,11 +167,9 @@
  * @see java.security.PermissionCollection
  * @see java.lang.SecurityManager
  *
- *
  * @author Marianne Mueller
  * @author Roland Schemers
  */
-
 public final class AWTPermission extends BasicPermission {
 
     /** use serialVersionUID from the Java 2 platform for interoperability */
--- a/src/java.desktop/share/classes/java/awt/AlphaComposite.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/java/awt/AlphaComposite.java	Wed Nov 01 10:00:38 2017 -0700
@@ -72,22 +72,40 @@
  * The following factors are used in the description of the blending
  * equation in the Porter and Duff paper:
  *
- * <blockquote>
- * <table class="borderless">
+ * <table class="striped">
  * <caption style="display:none">Factors</caption>
- * <tr><th style="text-align:left">Factor&nbsp;&nbsp;<th style="text-align:left">Definition
- * <tr><td><em>A<sub>s</sub></em><td>the alpha component of the source pixel
- * <tr><td><em>C<sub>s</sub></em><td>a color component of the source pixel in premultiplied form
- * <tr><td><em>A<sub>d</sub></em><td>the alpha component of the destination pixel
- * <tr><td><em>C<sub>d</sub></em><td>a color component of the destination pixel in premultiplied form
- * <tr><td><em>F<sub>s</sub></em><td>the fraction of the source pixel that contributes to the output
- * <tr><td><em>F<sub>d</sub></em><td>the fraction of the destination pixel that contributes
- * to the output
- * <tr><td><em>A<sub>r</sub></em><td>the alpha component of the result
- * <tr><td><em>C<sub>r</sub></em><td>a color component of the result in premultiplied form
+ * <thead>
+ *   <tr>
+ *     <th scope="col">Factor
+ *     <th scope="col">Definition
+ * </thead>
+ * <tbody>
+ *   <tr>
+ *     <th scope="row"><em>A<sub>s</sub></em>
+ *     <td>the alpha component of the source pixel
+ *   <tr>
+ *     <th scope="row"><em>C<sub>s</sub></em>
+ *     <td>a color component of the source pixel in premultiplied form
+ *   <tr>
+ *     <th scope="row"><em>A<sub>d</sub></em>
+ *     <td>the alpha component of the destination pixel
+ *   <tr>
+ *     <th scope="row"><em>C<sub>d</sub></em>
+ *     <td>a color component of the destination pixel in premultiplied form
+ *   <tr>
+ *     <th scope="row"><em>F<sub>s</sub></em>
+ *     <td>the fraction of the source pixel that contributes to the output
+ *   <tr>
+ *     <th scope="row"><em>F<sub>d</sub></em>
+ *     <td>the fraction of the destination pixel that contributes to the output
+ *   <tr>
+ *     <th scope="row"><em>A<sub>r</sub></em>
+ *     <td>the alpha component of the result
+ *   <tr>
+ *     <th scope="row"><em>C<sub>r</sub></em>
+ *     <td>a color component of the result in premultiplied form
+ * </tbody>
  * </table>
- * </blockquote>
- *
  * <p>
  * Using these factors, Porter and Duff define 12 ways of choosing
  * the blending factors <em>F<sub>s</sub></em> and <em>F<sub>d</sub></em> to
@@ -113,19 +131,37 @@
  * The following factors will be used to discuss our extensions to
  * the blending equation in the Porter and Duff paper:
  *
- * <blockquote>
- * <table class="borderless">
+ * <table class="striped">
  * <caption style="display:none">Factors</caption>
- * <tr><th style="text-align:left">Factor&nbsp;&nbsp;<th style="text-align:left">Definition
- * <tr><td><em>C<sub>sr</sub></em> <td>one of the raw color components of the source pixel
- * <tr><td><em>C<sub>dr</sub></em> <td>one of the raw color components of the destination pixel
- * <tr><td><em>A<sub>ac</sub></em>  <td>the "extra" alpha component from the AlphaComposite instance
- * <tr><td><em>A<sub>sr</sub></em> <td>the raw alpha component of the source pixel
- * <tr><td><em>A<sub>dr</sub></em><td>the raw alpha component of the destination pixel
- * <tr><td><em>A<sub>df</sub></em> <td>the final alpha component stored in the destination
- * <tr><td><em>C<sub>df</sub></em> <td>the final raw color component stored in the destination
+ * <thead>
+ *   <tr>
+ *     <th scope="col">Factor
+ *     <th scope="col">Definition
+ * </thead>
+ * <tbody>
+ *   <tr>
+ *     <th scope="row"><em>C<sub>sr</sub></em>
+ *     <td>one of the raw color components of the source pixel
+ *   <tr>
+ *     <th scope="row"><em>C<sub>dr</sub></em>
+ *     <td>one of the raw color components of the destination pixel
+ *   <tr>
+ *     <th scope="row"><em>A<sub>ac</sub></em>
+ *     <td>the "extra" alpha component from the AlphaComposite instance
+ *   <tr>
+ *     <th scope="row"><em>A<sub>sr</sub></em>
+ *     <td>the raw alpha component of the source pixel
+ *   <tr>
+ *     <th scope="row"><em>A<sub>dr</sub></em>
+ *     <td>the raw alpha component of the destination pixel
+ *   <tr>
+ *     <th scope="row"><em>A<sub>df</sub></em>
+ *     <td>the final alpha component stored in the destination
+ *   <tr>
+ *     <th scope="row"><em>C<sub>df</sub></em>
+ *     <td>the final raw color component stored in the destination
+ * </tbody>
  * </table>
- *</blockquote>
  *
  * <h3>Preparing Inputs</h3>
  *
--- a/src/java.desktop/share/classes/java/awt/Component.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/java/awt/Component.java	Wed Nov 01 10:00:38 2017 -0700
@@ -843,10 +843,6 @@
             public Rectangle getBounds(Component comp) {
                 return new Rectangle(comp.x, comp.y, comp.width, comp.height);
             }
-            public void setMixingCutoutShape(Component comp, Shape shape) {
-                comp.setMixingCutoutShape(shape);
-            }
-
             public void setGraphicsConfiguration(Component comp,
                     GraphicsConfiguration gc)
             {
@@ -7247,28 +7243,24 @@
      * <caption>Recommended default values for a Component's focus traversal
      * keys</caption>
      * <thead>
-     * <tr>
-     *    <th>Identifier</th>
-     *    <th>Meaning</th>
-     *    <th>Default</th>
-     * </tr>
+     *   <tr>
+     *     <th scope="col">Identifier
+     *     <th scope="col">Meaning
+     *     <th scope="col">Default
      * </thead>
      * <tbody>
-     * <tr>
-     *    <td>KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS</td>
-     *    <td>Normal forward keyboard traversal</td>
-     *    <td>TAB on KEY_PRESSED, CTRL-TAB on KEY_PRESSED</td>
-     * </tr>
-     * <tr>
-     *    <td>KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS</td>
-     *    <td>Normal reverse keyboard traversal</td>
-     *    <td>SHIFT-TAB on KEY_PRESSED, CTRL-SHIFT-TAB on KEY_PRESSED</td>
-     * </tr>
-     * <tr>
-     *    <td>KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS</td>
-     *    <td>Go up one focus traversal cycle</td>
-     *    <td>none</td>
-     * </tr>
+     *   <tr>
+     *     <th scope="row">KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS
+     *     <td>Normal forward keyboard traversal
+     *     <td>TAB on KEY_PRESSED, CTRL-TAB on KEY_PRESSED
+     *   <tr>
+     *     <th scope="row">KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS
+     *     <td>Normal reverse keyboard traversal
+     *     <td>SHIFT-TAB on KEY_PRESSED, CTRL-SHIFT-TAB on KEY_PRESSED
+     *   <tr>
+     *     <th scope="row">KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS
+     *     <td>Go up one focus traversal cycle
+     *     <td>none
      * </tbody>
      * </table>
      *
--- a/src/java.desktop/share/classes/java/awt/Container.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/java/awt/Container.java	Wed Nov 01 10:00:38 2017 -0700
@@ -3069,33 +3069,28 @@
      * <caption>Recommended default values for a Container's focus traversal
      * keys</caption>
      * <thead>
-     * <tr>
-     *    <th>Identifier</th>
-     *    <th>Meaning</th>
-     *    <th>Default</th>
-     * </tr>
+     *   <tr>
+     *     <th scope="col">Identifier
+     *     <th scope="col">Meaning
+     *     <th scope="col">Default
      * </thead>
      * <tbody>
-     * <tr>
-     *    <td>KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS</td>
-     *    <td>Normal forward keyboard traversal</td>
-     *    <td>TAB on KEY_PRESSED, CTRL-TAB on KEY_PRESSED</td>
-     * </tr>
-     * <tr>
-     *    <td>KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS</td>
-     *    <td>Normal reverse keyboard traversal</td>
-     *    <td>SHIFT-TAB on KEY_PRESSED, CTRL-SHIFT-TAB on KEY_PRESSED</td>
-     * </tr>
-     * <tr>
-     *    <td>KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS</td>
-     *    <td>Go up one focus traversal cycle</td>
-     *    <td>none</td>
-     * </tr>
-     * <tr>
-     *    <td>KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS</td>
-     *    <td>Go down one focus traversal cycle</td>
-     *    <td>none</td>
-     * </tr>
+     *   <tr>
+     *     <th scope="row">KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS
+     *     <td>Normal forward keyboard traversal
+     *     <td>TAB on KEY_PRESSED, CTRL-TAB on KEY_PRESSED
+     *   <tr>
+     *     <th scope="row">KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS
+     *     <td>Normal reverse keyboard traversal
+     *     <td>SHIFT-TAB on KEY_PRESSED, CTRL-SHIFT-TAB on KEY_PRESSED
+     *   <tr>
+     *     <th scope="row">KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS
+     *     <td>Go up one focus traversal cycle
+     *     <td>none
+     *   <tr>
+     *     <th scope="row">KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
+     *     <td>Go down one focus traversal cycle
+     *     <td>none
      * </tbody>
      * </table>
      *
--- a/src/java.desktop/share/classes/java/awt/Desktop.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/java/awt/Desktop.java	Wed Nov 01 10:00:38 2017 -0700
@@ -768,13 +768,13 @@
      * Installs the handler which is notified when the application is asked to
      * open a list of files.
      *
-     * @implNote Please note that for Mac OS, notifications
+     * @implNote Please note that for macOS, notifications
      * are only sent if the Java app is a bundled application,
      * with a {@code CFBundleDocumentTypes} array present in its
-     * Info.plist. See the
-     * <a href="http://developer.apple.com/mac/library/documentation/General/Reference/InfoPlistKeyReference">
-     * Info.plist Key Reference</a> for more information about adding a
-     * {@code CFBundleDocumentTypes} key to your app's Info.plist.
+     * {@code Info.plist}. Check the
+     * <a href="https://developer.apple.com/documentation">
+     * Apple Developer Documentation</a> for more information about
+     * {@code Info.plist}.
      *
      * @param openFileHandler handler
      *
@@ -800,13 +800,13 @@
      * Installs the handler which is notified when the application is asked to
      * print a list of files.
      *
-     * @implNote Please note that for Mac OS, notifications
+     * @implNote Please note that for macOS, notifications
      * are only sent if the Java app is a bundled application,
      * with a {@code CFBundleDocumentTypes} array present in its
-     * Info.plist. See the
-     * <a href="http://developer.apple.com/mac/library/documentation/General/Reference/InfoPlistKeyReference">
-     * Info.plist Key Reference</a> for more information about adding a
-     * {@code CFBundleDocumentTypes} key to your app's Info.plist.
+     * {@code Info.plist}. Check the
+     * <a href="https://developer.apple.com/documentation">
+     * Apple Developer Documentation</a> for more information about
+     * {@code Info.plist}.
      *
      * @param printFileHandler handler
      * @throws SecurityException if a security manager exists and its
@@ -835,13 +835,13 @@
      * {@link OpenURIHandler#openURI(OpenURIEvent)} requests to be
      * enqueued until another handler is set.
      *
-     * @implNote Please note that for Mac OS, notifications
+     * @implNote Please note that for macOS, notifications
      * are only sent if the Java app is a bundled application,
      * with a {@code CFBundleDocumentTypes} array present in its
-     * Info.plist. See the
-     * <a href="http://developer.apple.com/mac/library/documentation/General/Reference/InfoPlistKeyReference">
-     * Info.plist Key Reference</a> for more information about adding a
-     * {@code CFBundleDocumentTypes} key to your app's Info.plist.
+     * {@code Info.plist}. Check the
+     * <a href="https://developer.apple.com/documentation">
+     * Apple Developer Documentation</a> for more information about
+     * {@code Info.plist}.
      *
      * @param openURIHandler handler
      *
--- a/src/java.desktop/share/classes/java/awt/EventQueue.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/java/awt/EventQueue.java	Wed Nov 01 10:00:38 2017 -0700
@@ -680,33 +680,28 @@
      * <table class="striped">
      * <caption>Event types, source types, and dispatch methods</caption>
      * <thead>
-     * <tr>
-     *     <th>Event Type</th>
-     *     <th>Source Type</th>
-     *     <th>Dispatched To</th>
-     * </tr>
+     *   <tr>
+     *     <th scope="col">Event Type
+     *     <th scope="col">Source Type
+     *     <th scope="col">Dispatched To
      * </thead>
      * <tbody>
-     * <tr>
-     *     <td>ActiveEvent</td>
-     *     <td>Any</td>
-     *     <td>event.dispatch()</td>
-     * </tr>
-     * <tr>
-     *     <td>Other</td>
-     *     <td>Component</td>
-     *     <td>source.dispatchEvent(AWTEvent)</td>
-     * </tr>
-     * <tr>
-     *     <td>Other</td>
-     *     <td>MenuComponent</td>
-     *     <td>source.dispatchEvent(AWTEvent)</td>
-     * </tr>
-     * <tr>
-     *     <td>Other</td>
-     *     <td>Other</td>
-     *     <td>No action (ignored)</td>
-     * </tr>
+     *   <tr>
+     *     <th scope="row">ActiveEvent
+     *     <td>Any
+     *     <td>event.dispatch()
+     *   <tr>
+     *     <th scope="row">Other
+     *     <td>Component
+     *     <td>source.dispatchEvent(AWTEvent)
+     *   <tr>
+     *     <th scope="row">Other
+     *     <td>MenuComponent
+     *     <td>source.dispatchEvent(AWTEvent)
+     *   <tr>
+     *     <th scope="row">Other
+     *     <td>Other
+     *     <td>No action (ignored)
      * </tbody>
      * </table>
      *
--- a/src/java.desktop/share/classes/java/awt/GraphicsDevice.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/java/awt/GraphicsDevice.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,10 @@
  * questions.
  */
 
-
 package java.awt;
 
 import java.awt.image.ColorModel;
 
-import sun.awt.AWTAccessor;
 import sun.awt.AppContext;
 import sun.awt.SunToolkit;
 
--- a/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1042,35 +1042,30 @@
      * <table class="striped">
      * <caption>Recommended default values for focus traversal keys</caption>
      * <thead>
-     * <tr>
-     *    <th>Identifier</th>
-     *    <th>Meaning</th>
-     *    <th>Default</th>
-     * </tr>
+     *   <tr>
+     *     <th scope="col">Identifier
+     *     <th scope="col">Meaning
+     *     <th scope="col">Default
      * </thead>
      * <tbody>
-     * <tr>
-     *    <td>{@code KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS}</td>
-     *    <td>Normal forward keyboard traversal</td>
-     *    <td>{@code TAB} on {@code KEY_PRESSED},
-     *        {@code CTRL-TAB} on {@code KEY_PRESSED}</td>
-     * </tr>
-     * <tr>
-     *    <td>{@code KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS}</td>
-     *    <td>Normal reverse keyboard traversal</td>
-     *    <td>{@code SHIFT-TAB} on {@code KEY_PRESSED},
-     *        {@code CTRL-SHIFT-TAB} on {@code KEY_PRESSED}</td>
-     * </tr>
-     * <tr>
-     *    <td>{@code KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS}</td>
-     *    <td>Go up one focus traversal cycle</td>
-     *    <td>none</td>
-     * </tr>
-     * <tr>
-     *    <td>{@code KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS}</td>
-     *    <td>Go down one focus traversal cycle</td>
-     *    <td>none</td>
-     * </tr>
+     *   <tr>
+     *     <th scope="row">{@code KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS}
+     *     <td>Normal forward keyboard traversal
+     *     <td>{@code TAB} on {@code KEY_PRESSED}, {@code CTRL-TAB} on
+     *     {@code KEY_PRESSED}
+     *   <tr>
+     *     <th scope="row">{@code KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS}
+     *     <td>Normal reverse keyboard traversal
+     *     <td>{@code SHIFT-TAB} on {@code KEY_PRESSED}, {@code CTRL-SHIFT-TAB}
+     *     on {@code KEY_PRESSED}
+     *   <tr>
+     *     <th scope="row">{@code KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS}
+     *     <td>Go up one focus traversal cycle
+     *     <td>none
+     *   <tr>
+     *     <th scope="row">{@code KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS}
+     *     <td>Go down one focus traversal cycle
+     *     <td>none
      * </tbody>
      * </table>
      *
--- a/src/java.desktop/share/classes/java/awt/Scrollbar.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/java/awt/Scrollbar.java	Wed Nov 01 10:00:38 2017 -0700
@@ -299,58 +299,44 @@
      * <table class="striped">
      * <caption>Scrollbar default properties</caption>
      * <thead>
-     * <tr>
-     *   <th>Property</th>
-     *   <th>Description</th>
-     *   <th>Default Value</th>
-     * </tr>
+     *   <tr>
+     *     <th scope="col">Property
+     *     <th scope="col">Description
+     *     <th scope="col">Default Value
      * </thead>
      * <tbody>
-     * <tr>
-     *   <td>orientation</td>
-     *   <td>indicates whether the scroll bar is vertical
-     *   <br>or horizontal</td>
-     *   <td>{@code Scrollbar.VERTICAL}</td>
-     * </tr>
-     * <tr>
-     *   <td>value</td>
-     *   <td>value which controls the location
-     *   <br>of the scroll bar's bubble</td>
-     *   <td>0</td>
-     * </tr>
-     * <tr>
-     *   <td>visible amount</td>
-     *   <td>visible amount of the scroll bar's range,
-     *   <br>typically represented by the size of the
-     *   <br>scroll bar's bubble</td>
-     *   <td>10</td>
-     * </tr>
-     * <tr>
-     *   <td>minimum</td>
-     *   <td>minimum value of the scroll bar</td>
-     *   <td>0</td>
-     * </tr>
-     * <tr>
-     *   <td>maximum</td>
-     *   <td>maximum value of the scroll bar</td>
-     *   <td>100</td>
-     * </tr>
-     * <tr>
-     *   <td>unit increment</td>
-     *   <td>amount the value changes when the
-     *   <br>Line Up or Line Down key is pressed,
-     *   <br>or when the end arrows of the scrollbar
-     *   <br>are clicked </td>
-     *   <td>1</td>
-     * </tr>
-     * <tr>
-     *   <td>block increment</td>
-     *   <td>amount the value changes when the
-     *   <br>Page Up or Page Down key is pressed,
-     *   <br>or when the scrollbar track is clicked
-     *   <br>on either side of the bubble </td>
-     *   <td>10</td>
-     * </tr>
+     *   <tr>
+     *     <th scope="row">orientation
+     *     <td>indicates whether the scroll bar is vertical or horizontal
+     *     <td>{@code Scrollbar.VERTICAL}
+     *   <tr>
+     *     <th scope="row">value
+     *     <td>value which controls the location of the scroll bar's bubble
+     *     <td>0
+     *   <tr>
+     *     <th scope="row">visible amount
+     *     <td>visible amount of the scroll bar's range, typically represented
+     *     by the size of the scroll bar's bubble
+     *     <td>10
+     *   <tr>
+     *     <th scope="row">minimum
+     *     <td>minimum value of the scroll bar
+     *     <td>0
+     *   <tr>
+     *     <th scope="row">maximum
+     *     <td>maximum value of the scroll bar
+     *     <td>100
+     *   <tr>
+     *     <th scope="row">unit increment
+     *     <td>amount the value changes when the Line Up or Line Down key is
+     *     pressed, or when the end arrows of the scrollbar are clicked
+     *     <td>1
+     *   <tr>
+     *     <th scope="row">block increment
+     *     <td>amount the value changes when the Page Up or Page Down key is
+     *     pressed, or when the scrollbar track is clicked<br>on either side of
+     *     the bubble
+     *     <td>10
      * </tbody>
      * </table>
      *
--- a/src/java.desktop/share/classes/java/awt/SystemTray.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/java/awt/SystemTray.java	Wed Nov 01 10:00:38 2017 -0700
@@ -371,28 +371,26 @@
      * <table class="striped">
      * <caption>SystemTray properties</caption>
      * <thead>
-     * <tr>
-     *    <th>Property</th>
-     *    <th>Description</th>
-     * </tr>
+     *   <tr>
+     *     <th scope="col">Property
+     *     <th scope="col">Description
      * </thead>
      * <tbody>
-     * <tr>
-     *    <td>{@code trayIcons}</td>
-     *    <td>The {@code SystemTray}'s array of {@code TrayIcon} objects.
-     *        The array is accessed via the {@link #getTrayIcons} method.<br>
-     *        This property is changed when a tray icon is added to (or removed
-     *        from) the system tray.<br> For example, this property is changed
-     *        when the system tray becomes unavailable on the desktop<br>
-     *        and the tray icons are automatically removed.</td>
-     * </tr>
-     * <tr>
-     *    <td>{@code systemTray}</td>
-     *    <td>This property contains {@code SystemTray} instance when the system tray
-     *        is available or {@code null} otherwise.<br> This property is changed
-     *        when the system tray becomes available or unavailable on the desktop.<br>
-     *        The property is accessed by the {@link #getSystemTray} method.</td>
-     * </tr>
+     *   <tr>
+     *     <th scope="row">{@code trayIcons}
+     *     <td>The {@code SystemTray}'s array of {@code TrayIcon} objects. The
+     *     array is accessed via the {@link #getTrayIcons} method. This property
+     *     is changed when a tray icon is added to (or removed from) the system
+     *     tray. For example, this property is changed when the system tray
+     *     becomes unavailable on the desktop and the tray icons are
+     *     automatically removed.
+     *   <tr>
+     *     <th scope="row">{@code systemTray}
+     *     <td>This property contains {@code SystemTray} instance when the
+     *     system tray is available or {@code null} otherwise. This property is
+     *     changed when the system tray becomes available or unavailable on the
+     *     desktop. The property is accessed by the {@link #getSystemTray}
+     *     method.
      * </tbody>
      * </table>
      * <p>
--- a/src/java.desktop/share/classes/java/awt/Window.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/java/awt/Window.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,9 +22,17 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package java.awt;
 
-import java.awt.event.*;
+import java.awt.event.ComponentEvent;
+import java.awt.event.FocusEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseWheelEvent;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowFocusListener;
+import java.awt.event.WindowListener;
+import java.awt.event.WindowStateListener;
 import java.awt.geom.Path2D;
 import java.awt.geom.Point2D;
 import java.awt.im.InputContext;
@@ -48,7 +56,13 @@
 import java.util.Set;
 import java.util.Vector;
 import java.util.concurrent.atomic.AtomicBoolean;
-import javax.accessibility.*;
+
+import javax.accessibility.Accessible;
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleRole;
+import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
+
 import sun.awt.AWTAccessor;
 import sun.awt.AWTPermissions;
 import sun.awt.AppContext;
@@ -4050,26 +4064,6 @@
 
     static {
         AWTAccessor.setWindowAccessor(new AWTAccessor.WindowAccessor() {
-            public float getOpacity(Window window) {
-                return window.opacity;
-            }
-            public void setOpacity(Window window, float opacity) {
-                window.setOpacity(opacity);
-            }
-            public Shape getShape(Window window) {
-                return window.getShape();
-            }
-            public void setShape(Window window, Shape shape) {
-                window.setShape(shape);
-            }
-            public void setOpaque(Window window, boolean opaque) {
-                Color bg = window.getBackground();
-                if (bg == null) {
-                    bg = new Color(0, 0, 0, 0);
-                }
-                window.setBackground(new Color(bg.getRed(), bg.getGreen(), bg.getBlue(),
-                                               opaque ? 255 : 0));
-            }
             public void updateWindow(Window window) {
                 window.updateWindow();
             }
--- a/src/java.desktop/share/classes/java/awt/event/MouseEvent.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/java/awt/event/MouseEvent.java	Wed Nov 01 10:00:38 2017 -0700
@@ -745,7 +745,6 @@
      * @see #getClickCount()
      * @see #isPopupTrigger()
      * @see #getButton()
-     * @see #button
      * @see Toolkit#areExtraMouseButtonsEnabled()
      * @see java.awt.MouseInfo#getNumberOfButtons()
      * @see InputEvent#getMaskForButton(int)
--- a/src/java.desktop/share/classes/java/awt/font/NumericShaper.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/java/awt/font/NumericShaper.java	Wed Nov 01 10:00:38 2017 -0700
@@ -108,39 +108,36 @@
  *
  * <table class="plain">
  * <caption>NumericShaper constants precedence</caption>
- *    <thead>
- *    <tr>
- *       <th class="TableHeadingColor">Unicode Range</th>
- *       <th class="TableHeadingColor">{@code NumericShaper} Constants</th>
- *       <th class="TableHeadingColor">Precedence</th>
- *    </tr>
- *    </thead>
- *    <tbody>
- *    <tr>
- *       <td rowspan="2">Arabic</td>
- *       <td>{@link NumericShaper#ARABIC NumericShaper.ARABIC}<br>
- *           {@link NumericShaper#EASTERN_ARABIC NumericShaper.EASTERN_ARABIC}</td>
- *       <td>{@link NumericShaper#EASTERN_ARABIC NumericShaper.EASTERN_ARABIC}</td>
- *    </tr>
- *    <tr>
- *       <td>{@link NumericShaper.Range#ARABIC}<br>
- *           {@link NumericShaper.Range#EASTERN_ARABIC}</td>
- *       <td>{@link NumericShaper.Range#EASTERN_ARABIC}</td>
- *    </tr>
- *    </tbody>
- *    <tbody>
- *    <tr>
- *       <td>Tai Tham</td>
- *       <td>{@link NumericShaper.Range#TAI_THAM_HORA}<br>
- *           {@link NumericShaper.Range#TAI_THAM_THAM}</td>
- *       <td>{@link NumericShaper.Range#TAI_THAM_THAM}</td>
- *    </tr>
- *    </tbody>
+ * <thead>
+ *   <tr>
+ *     <th scope="col">Unicode Range
+ *     <th scope="col">{@code NumericShaper} Constants
+ *     <th scope="col">Precedence
+ * </thead>
+ * <tbody>
+ *   <tr>
+ *     <th scope="row" rowspan="2">Arabic
+ *     <td>{@link NumericShaper#ARABIC NumericShaper.ARABIC}
+ *     <br>
+ *     {@link NumericShaper#EASTERN_ARABIC NumericShaper.EASTERN_ARABIC}
+ *     <td>{@link NumericShaper#EASTERN_ARABIC NumericShaper.EASTERN_ARABIC}
+ *   </tr>
+ *   <tr>
+ *     <th scope="row">{@link NumericShaper.Range#ARABIC}
+ *     <br>
+ *     {@link NumericShaper.Range#EASTERN_ARABIC}
+ *     <td>{@link NumericShaper.Range#EASTERN_ARABIC}
+ *   <tr>
+ *     <th scope="row">Tai Tham
+ *     <td>{@link NumericShaper.Range#TAI_THAM_HORA}
+ *     <br>
+ *     {@link NumericShaper.Range#TAI_THAM_THAM}
+ *     <td>{@link NumericShaper.Range#TAI_THAM_THAM}
+ * </tbody>
  * </table>
  *
  * @since 1.4
  */
-
 public final class NumericShaper implements java.io.Serializable {
 
     // For access from java.text.Bidi
--- a/src/java.desktop/share/classes/java/awt/font/TextAttribute.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/java/awt/font/TextAttribute.java	Wed Nov 01 10:00:38 2017 -0700
@@ -96,159 +96,141 @@
  * </UL>
  *
  * <h4>Summary of attributes</h4>
- * <table style="float:center;width:95%" class="striped">
- * <caption>Key, value type, principal constants, and
- * default value behavior of all TextAttributes</caption>
+ *
+ * <table style="width:95%;margin: 0px auto" class="striped">
+ * <caption>Key, value type, principal constants, and default value behavior of
+ * all TextAttributes</caption>
  * <thead>
- * <tr>
- * <th valign="TOP" style="text-align:center">Key</th>
- * <th valign="TOP" style="text-align:center">Value Type</th>
- * <th valign="TOP" style="text-align:center">Principal Constants</th>
- * <th valign="TOP" style="text-align:center">Default Value</th>
- * </tr>
+ *   <tr>
+ *     <th scope="col">Key
+ *     <th scope="col">Value Type
+ *     <th scope="col">Principal Constants
+ *     <th scope="col">Default Value
  * </thead>
  * <tbody>
- * <tr>
- * <td valign="TOP">{@link #FAMILY}</td>
- * <td valign="TOP">String</td>
- * <td valign="TOP">See Font {@link java.awt.Font#DIALOG DIALOG},
- * {@link java.awt.Font#DIALOG_INPUT DIALOG_INPUT},<br> {@link java.awt.Font#SERIF SERIF},
- * {@link java.awt.Font#SANS_SERIF SANS_SERIF}, and {@link java.awt.Font#MONOSPACED MONOSPACED}.
- * </td>
- * <td valign="TOP">"Default" (use platform default)</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #WEIGHT}</td>
- * <td valign="TOP">Number</td>
- * <td valign="TOP">WEIGHT_REGULAR, WEIGHT_BOLD</td>
- * <td valign="TOP">WEIGHT_REGULAR</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #WIDTH}</td>
- * <td valign="TOP">Number</td>
- * <td valign="TOP">WIDTH_CONDENSED, WIDTH_REGULAR,<br>WIDTH_EXTENDED</td>
- * <td valign="TOP">WIDTH_REGULAR</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #POSTURE}</td>
- * <td valign="TOP">Number</td>
- * <td valign="TOP">POSTURE_REGULAR, POSTURE_OBLIQUE</td>
- * <td valign="TOP">POSTURE_REGULAR</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #SIZE}</td>
- * <td valign="TOP">Number</td>
- * <td valign="TOP">none</td>
- * <td valign="TOP">12.0</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #TRANSFORM}</td>
- * <td valign="TOP">{@link TransformAttribute}</td>
- * <td valign="TOP">See TransformAttribute {@link TransformAttribute#IDENTITY IDENTITY}</td>
- * <td valign="TOP">TransformAttribute.IDENTITY</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #SUPERSCRIPT}</td>
- * <td valign="TOP">Integer</td>
- * <td valign="TOP">SUPERSCRIPT_SUPER, SUPERSCRIPT_SUB</td>
- * <td valign="TOP">0 (use the standard glyphs and metrics)</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #FONT}</td>
- * <td valign="TOP">{@link java.awt.Font}</td>
- * <td valign="TOP">none</td>
- * <td valign="TOP">null (do not override font resolution)</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #CHAR_REPLACEMENT}</td>
- * <td valign="TOP">{@link GraphicAttribute}</td>
- * <td valign="TOP">none</td>
- * <td valign="TOP">null (draw text using font glyphs)</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #FOREGROUND}</td>
- * <td valign="TOP">{@link java.awt.Paint}</td>
- * <td valign="TOP">none</td>
- * <td valign="TOP">null (use current graphics paint)</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #BACKGROUND}</td>
- * <td valign="TOP">{@link java.awt.Paint}</td>
- * <td valign="TOP">none</td>
- * <td valign="TOP">null (do not render background)</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #UNDERLINE}</td>
- * <td valign="TOP">Integer</td>
- * <td valign="TOP">UNDERLINE_ON</td>
- * <td valign="TOP">-1 (do not render underline)</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #STRIKETHROUGH}</td>
- * <td valign="TOP">Boolean</td>
- * <td valign="TOP">STRIKETHROUGH_ON</td>
- * <td valign="TOP">false (do not render strikethrough)</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #RUN_DIRECTION}</td>
- * <td valign="TOP">Boolean</td>
- * <td valign="TOP">RUN_DIRECTION_LTR<br>RUN_DIRECTION_RTL</td>
- * <td valign="TOP">null (use {@link java.text.Bidi} standard default)</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #BIDI_EMBEDDING}</td>
- * <td valign="TOP">Integer</td>
- * <td valign="TOP">none</td>
- * <td valign="TOP">0 (use base line direction)</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #JUSTIFICATION}</td>
- * <td valign="TOP">Number</td>
- * <td valign="TOP">JUSTIFICATION_FULL</td>
- * <td valign="TOP">JUSTIFICATION_FULL</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #INPUT_METHOD_HIGHLIGHT}</td>
- * <td valign="TOP">{@link java.awt.im.InputMethodHighlight},<br>{@link java.text.Annotation}</td>
- * <td valign="TOP">(see class)</td>
- * <td valign="TOP">null (do not apply input highlighting)</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #INPUT_METHOD_UNDERLINE}</td>
- * <td valign="TOP">Integer</td>
- * <td valign="TOP">UNDERLINE_LOW_ONE_PIXEL,<br>UNDERLINE_LOW_TWO_PIXEL</td>
- * <td valign="TOP">-1 (do not render underline)</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #SWAP_COLORS}</td>
- * <td valign="TOP">Boolean</td>
- * <td valign="TOP">SWAP_COLORS_ON</td>
- * <td valign="TOP">false (do not swap colors)</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #NUMERIC_SHAPING}</td>
- * <td valign="TOP">{@link java.awt.font.NumericShaper}</td>
- * <td valign="TOP">none</td>
- * <td valign="TOP">null (do not shape digits)</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #KERNING}</td>
- * <td valign="TOP">Integer</td>
- * <td valign="TOP">KERNING_ON</td>
- * <td valign="TOP">0 (do not request kerning)</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #LIGATURES}</td>
- * <td valign="TOP">Integer</td>
- * <td valign="TOP">LIGATURES_ON</td>
- * <td valign="TOP">0 (do not form optional ligatures)</td>
- * </tr>
- * <tr>
- * <td valign="TOP">{@link #TRACKING}</td>
- * <td valign="TOP">Number</td>
- * <td valign="TOP">TRACKING_LOOSE, TRACKING_TIGHT</td>
- * <td valign="TOP">0 (do not add tracking)</td>
- * </tr>
+ *   <tr>
+ *     <th scope="row">{@link #FAMILY}
+ *     <td>String
+ *     <td>See Font {@link java.awt.Font#DIALOG DIALOG},
+ *     {@link java.awt.Font#DIALOG_INPUT DIALOG_INPUT},
+ *     <br>
+ *     {@link java.awt.Font#SERIF SERIF},
+ *     {@link java.awt.Font#SANS_SERIF SANS_SERIF}, and
+ *     {@link java.awt.Font#MONOSPACED MONOSPACED}.
+ *     <td>"Default" (use platform default)
+ *   <tr>
+ *     <th scope="row">{@link #WEIGHT}
+ *     <td>Number
+ *     <td>WEIGHT_REGULAR, WEIGHT_BOLD
+ *     <td>WEIGHT_REGULAR
+ *   <tr>
+ *     <th scope="row">{@link #WIDTH}
+ *     <td>Number
+ *     <td>WIDTH_CONDENSED, WIDTH_REGULAR,<br>WIDTH_EXTENDED
+ *     <td>WIDTH_REGULAR
+ *   <tr>
+ *     <th scope="row">{@link #POSTURE}
+ *     <td>Number
+ *     <td>POSTURE_REGULAR, POSTURE_OBLIQUE
+ *     <td>POSTURE_REGULAR
+ *   <tr>
+ *     <th scope="row">{@link #SIZE}
+ *     <td>Number
+ *     <td>none
+ *     <td>12.0
+ *   <tr>
+ *     <th scope="row">{@link #TRANSFORM}
+ *     <td>{@link TransformAttribute}
+ *     <td>See TransformAttribute {@link TransformAttribute#IDENTITY IDENTITY}
+ *     <td>TransformAttribute.IDENTITY
+ *   <tr>
+ *     <th scope="row">{@link #SUPERSCRIPT}
+ *     <td>Integer
+ *     <td>SUPERSCRIPT_SUPER, SUPERSCRIPT_SUB
+ *     <td>0 (use the standard glyphs and metrics)
+ *   <tr>
+ *     <th scope="row">{@link #FONT}
+ *     <td>{@link java.awt.Font}
+ *     <td>none
+ *     <td>null (do not override font resolution)
+ *   <tr>
+ *     <th scope="row">{@link #CHAR_REPLACEMENT}
+ *     <td>{@link GraphicAttribute}
+ *     <td>none
+ *     <td>null (draw text using font glyphs)
+ *   <tr>
+ *     <th scope="row">{@link #FOREGROUND}
+ *     <td>{@link java.awt.Paint}
+ *     <td>none
+ *     <td>null (use current graphics paint)
+ *   <tr>
+ *     <th scope="row">{@link #BACKGROUND}
+ *     <td>{@link java.awt.Paint}
+ *     <td>none
+ *     <td>null (do not render background)
+ *   <tr>
+ *     <th scope="row">{@link #UNDERLINE}
+ *     <td>Integer
+ *     <td>UNDERLINE_ON
+ *     <td>-1 (do not render underline)
+ *   <tr>
+ *     <th scope="row">{@link #STRIKETHROUGH}
+ *     <td>Boolean
+ *     <td>STRIKETHROUGH_ON
+ *     <td>false (do not render strikethrough)
+ *   <tr>
+ *     <th scope="row">{@link #RUN_DIRECTION}
+ *     <td>Boolean
+ *     <td>RUN_DIRECTION_LTR<br>RUN_DIRECTION_RTL
+ *     <td>null (use {@link java.text.Bidi} standard default)
+ *   <tr>
+ *     <th scope="row">{@link #BIDI_EMBEDDING}
+ *     <td>Integer
+ *     <td>none
+ *     <td>0 (use base line direction)
+ *   <tr>
+ *     <th scope="row">{@link #JUSTIFICATION}
+ *     <td>Number
+ *     <td>JUSTIFICATION_FULL
+ *     <td>JUSTIFICATION_FULL
+ *   <tr>
+ *     <th scope="row">{@link #INPUT_METHOD_HIGHLIGHT}
+ *     <td>{@link java.awt.im.InputMethodHighlight},
+ *     <br>
+ *     {@link java.text.Annotation}
+ *     <td>(see class)
+ *     <td>null (do not apply input highlighting)
+ *   <tr>
+ *     <th scope="row">{@link #INPUT_METHOD_UNDERLINE}
+ *     <td>Integer
+ *     <td>UNDERLINE_LOW_ONE_PIXEL,<br>UNDERLINE_LOW_TWO_PIXEL
+ *     <td>-1 (do not render underline)
+ *   <tr>
+ *     <th scope="row">{@link #SWAP_COLORS}
+ *     <td>Boolean
+ *     <td>SWAP_COLORS_ON
+ *     <td>false (do not swap colors)
+ *   <tr>
+ *     <th scope="row">{@link #NUMERIC_SHAPING}
+ *     <td>{@link java.awt.font.NumericShaper}
+ *     <td>none
+ *     <td>null (do not shape digits)
+ *   <tr>
+ *     <th scope="row">{@link #KERNING}
+ *     <td>Integer
+ *     <td>KERNING_ON
+ *     <td>0 (do not request kerning)
+ *   <tr>
+ *     <th scope="row">{@link #LIGATURES}
+ *     <td>Integer
+ *     <td>LIGATURES_ON
+ *     <td>0 (do not form optional ligatures)
+ *   <tr>
+ *     <th scope="row">{@link #TRACKING}
+ *     <td>Number
+ *     <td>TRACKING_LOOSE, TRACKING_TIGHT
+ *     <td>0 (do not add tracking)
+ *   </tr>
  * </tbody>
  * </table>
  *
--- a/src/java.desktop/share/classes/java/awt/image/RescaleOp.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/java/awt/image/RescaleOp.java	Wed Nov 01 10:00:38 2017 -0700
@@ -360,7 +360,8 @@
      *         of {@code src} is an {@code IndexColorModel},
      *         or if the number of scaling factors and offsets in this
      *         {@code RescaleOp} do not meet the requirements
-     *         stated in the class comments.
+     *         stated in the class comments, or if the source and
+     *         destination images differ in size.
      */
     public final BufferedImage filter (BufferedImage src, BufferedImage dst) {
         ColorModel srcCM = src.getColorModel();
@@ -473,7 +474,8 @@
      *         {@code dst} do not have the same number of bands,
      *         or if the number of scaling factors and offsets in this
      *         {@code RescaleOp} do not meet the requirements
-     *         stated in the class comments.
+     *         stated in the class comments, or if the source and
+     *         destination rasters differ in size.
      */
     public final WritableRaster filter (Raster src, WritableRaster dst)  {
         return filterRasterImpl(src, dst, length, true);
--- a/src/java.desktop/share/classes/javax/imageio/package-info.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/imageio/package-info.java	Wed Nov 01 10:00:38 2017 -0700
@@ -39,84 +39,77 @@
  * <p>
  * All implementations of javax.imageio provide the following standard image
  * format plug-ins:
- * <div>
- * <table border=1 cellpadding=5 style="margin: 0px auto;" summary="Standard
- * image format plug-ins">
- *     <tr>
- *         <th>&nbsp;</th><th>Reading</th><th>Writing</th><th>Notes</th>
- *         <th>Metadata</th>
- *     </tr>
  *
+ * <table class="striped">
+ * <caption>Standard image format plug-ins</caption>
+ * <thead>
+ *   <tr>
+ *     <th scope="col">Image format
+ *     <th scope="col">Reading
+ *     <th scope="col">Writing
+ *     <th scope="col">Notes
+ *     <th scope="col">Metadata
+ * </thead>
+ * <tbody>
  * <!-- BMP plugin -->
- *     <tr>
- *         <td><a href="https://msdn.microsoft.com/en-us/library/dd183391.aspx">
- *         BMP</a></td>
- *         <td align='center'>yes</td>
- *         <td align='center'>yes</td>
- *         <td align='center'>none</td>
- *         <td align='center'><a href='metadata/doc-files/bmp_metadata.html'>BMP
- *         metadata format</a></td>
- *     </tr>
- *
+ *   <tr>
+ *     <th scope="row">
+ *     <a href="https://msdn.microsoft.com/en-us/library/dd183391.aspx">BMP</a>
+ *     <td>yes
+ *     <td>yes
+ *     <td>none
+ *     <td><a href='metadata/doc-files/bmp_metadata.html'>BMP
+ *     metadata format</a>
  * <!-- GIF plugin -->
- *     <tr>
- *         <td><a href="http://www.w3.org/Graphics/GIF/spec-gif89a.txt">GIF</a>
- *         </td>
- *         <td align='center'>yes</td>
- *         <td align='center'>yes</td>
- *         <td align='center'><a href="#gif_plugin_notes">GIF plug-in notes</a>
- *         </td>
- *         <td align='center'><a href='metadata/doc-files/gif_metadata.html'>GIF
- *         metadata format</a></td>
- *     </tr>
- *
+ *   <tr>
+ *     <th scope="row">
+ *     <a href="http://www.w3.org/Graphics/GIF/spec-gif89a.txt">GIF</a>
+ *     <td>yes
+ *     <td>yes
+ *     <td><a href="#gif_plugin_notes">GIF plug-in notes</a>
+ *     <td><a href='metadata/doc-files/gif_metadata.html'>GIF
+ *     metadata format</a>
  * <!-- JPEG plugin -->
- *     <tr>
- *         <td><a href="http://www.jpeg.org">JPEG</a></td>
- *         <td align='center'>yes</td>
- *         <td align='center'>yes</td>
- *         <td align='center'>none</td>
- *         <td align='center'><a href='metadata/doc-files/jpeg_metadata.html'>
- *         JPEG metadata format</a></td>
- *     </tr>
- *
+ *   <tr>
+ *     <th scope="row"><a href="http://www.jpeg.org">JPEG</a>
+ *     <td>yes
+ *     <td>yes
+ *     <td>none
+ *     <td><a href='metadata/doc-files/jpeg_metadata.html'>
+ *     JPEG metadata format</a>
  * <!-- PNG plugin -->
- *     <tr>
- *         <td><a href="http://www.libpng.org/pub/png/spec/">PNG</a></td>
- *         <td align='center'>yes</td>
- *         <td align='center'>yes</td>
- *         <td align='center'>none</td>
- *         <td align='center'><a href='metadata/doc-files/png_metadata.html'>PNG
- *         metadata format</a></td>
- *     </tr>
- *
+ *   <tr>
+ *     <th scope="row"><a href="http://www.libpng.org/pub/png/spec/">PNG</a>
+ *     <td>yes
+ *     <td>yes
+ *     <td>none
+ *     <td><a href='metadata/doc-files/png_metadata.html'>PNG
+ *     metadata format</a>
  * <!-- TIFF plugin -->
- *     <tr>
- *         <td><a href="https://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf">
- *         TIFF</a></td>
- *         <td align='center'>yes</td>
- *         <td align='center'>yes</td>
- *         <td align='center'><a href='metadata/doc-files/tiff_metadata.html#Reading'>
- *         TIFF plug-in notes</a></td>
- *         <td align='center'><a href='metadata/doc-files/tiff_metadata.html#StreamMetadata'>
- *         TIFF metadata format</a></td>
- *     </tr>
- *
+ *   <tr>
+ *     <th scope="row">
+ *     <a href="https://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf">
+ *     TIFF</a>
+ *     <td>yes
+ *     <td>yes
+ *     <td>
+ *     <a href='metadata/doc-files/tiff_metadata.html#Reading'>TIFF plug-in
+ *     notes</a>
+ *     <td>
+ *     <a href='metadata/doc-files/tiff_metadata.html#StreamMetadata'>TIFF
+ *     metadata format</a>
  * <!-- WBMP plugin -->
- *     <tr>
- *         <td><a href="http://www.wapforum.org/what/technical/SPEC-WAESpec-19990524.pdf">
- *         WBMP</a></td>
- *         <td align='center'>yes</td>
- *         <td align='center'>yes</td>
- *         <td align='center'>none</td>
- *         <td align='center'><a href='metadata/doc-files/wbmp_metadata.html'>
- *         WBMP metadata format</a></td>
- *     </tr>
+ *   <tr>
+ *     <th scope="row">
+ *     <a href="http://www.wapforum.org/what/technical/SPEC-WAESpec-19990524.pdf">
+ *     WBMP</a>
+ *     <td>yes
+ *     <td>yes
+ *     <td>none
+ *     <td><a href='metadata/doc-files/wbmp_metadata.html'>
+ *     WBMP metadata format</a>
+ * </tbody>
  * </table>
- * </div>
- * <BR>
- * <BR>
- * <BR>
  *
  * <h2> Standard Plug-in Notes</h2>
  *
--- a/src/java.desktop/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,13 +54,32 @@
  * listed in the following
  * table:
  *
- * <table border=1>
- * <caption><b>Compression Types</b></caption>
- * <tr><th>Type String</th> <th>Description</th>  <th>Image Types</th></tr>
- * <tr><td>BI_RGB</td>  <td>Uncompressed RLE</td> <td>{@literal <= } 8-bits/sample</td></tr>
- * <tr><td>BI_RLE8</td> <td>8-bit Run Length Encoding</td> <td>{@literal <=} 8-bits/sample</td></tr>
- * <tr><td>BI_RLE4</td> <td>4-bit Run Length Encoding</td> <td>{@literal <=} 4-bits/sample</td></tr>
- * <tr><td>BI_BITFIELDS</td> <td>Packed data</td> <td> 16 or 32 bits/sample</td></tr>
+ * <table class="striped">
+ * <caption>Compression Types</caption>
+ * <thead>
+ *   <tr>
+ *     <th scope="col">Type String
+ *     <th scope="col">Description
+ *     <th scope="col">Image Types
+ * </thead>
+ * <tbody>
+ *   <tr>
+ *     <th scope="row">BI_RGB
+ *     <td>Uncompressed RLE
+ *     <td>{@literal <= } 8-bits/sample
+ *   <tr>
+ *     <th scope="row">BI_RLE8
+ *     <td>8-bit Run Length Encoding
+ *     <td>{@literal <=} 8-bits/sample
+ *   <tr>
+ *     <th scope="row">BI_RLE4
+ *     <td>4-bit Run Length Encoding
+ *     <td>{@literal <=} 4-bits/sample
+ *   <tr>
+ *     <th scope="row">BI_BITFIELDS
+ *     <td>Packed data
+ *     <td>16 or 32 bits/sample
+ * </tbody>
  * </table>
  */
 public class BMPImageWriteParam extends ImageWriteParam {
--- a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java	Wed Nov 01 10:00:38 2017 -0700
@@ -40,221 +40,83 @@
  * TIFF data types are referred to by Java constants and mapped internally
  * onto Java language data types and type names as follows:
  *
- * <br>
- * <br>
- * <table border="1">
+ * <table class="striped">
  * <caption>TIFF Data Type to Java Data Type Mapping</caption>
- *
- * <tr>
- * <th>
- * <b>TIFF Data Type</b>
- * </th>
- * <th>
- * <b>Java Constant</b>
- * </th>
- * <th>
- * <b>Java Data Type</b>
- * </th>
- * <th>
- * <b>Java Type Name</b>
- * </th>
- * </tr>
- *
- * <tr>
- * <td>
- * {@code BYTE}
- * </td>
- * <td>
- * {@link TIFFTag#TIFF_BYTE}
- * </td>
- * <td>
- * {@code byte}
- * </td>
- * <td>
- * {@code "Byte"}
- * </td>
- * </tr>
- *
- * <tr>
- * <td>
- * {@code ASCII}
- * </td>
- * <td>
- * {@link TIFFTag#TIFF_ASCII}
- * </td>
- * <td>
- * {@code String}
- * </td>
- * <td>
- * {@code "Ascii"}
- * </td>
- * </tr>
- *
- * <tr>
- * <td>
- * {@code SHORT}
- * </td>
- * <td>
- * {@link TIFFTag#TIFF_SHORT}
- * </td>
- * <td>
- * {@code char}
- * </td>
- * <td>
- * {@code "Short"}
- * </td>
- * </tr>
- *
- * <tr>
- * <td>
- * {@code LONG}
- * </td>
- * <td>
- * {@link TIFFTag#TIFF_LONG}
- * </td>
- * <td>
- * {@code long}
- * </td>
- * <td>
- * {@code "Long"}
- * </td>
- * </tr>
- *
- * <tr>
- * <td>
- * {@code RATIONAL}
- * </td>
- * <td>
- * {@link TIFFTag#TIFF_RATIONAL}
- * </td>
- * <td>
- * {@code long[2]} {numerator, denominator}
- * </td>
- * <td>
- * {@code "Rational"}
- * </td>
- * </tr>
- *
- * <tr>
- * <td>
- * {@code SBYTE}
- * </td>
- * <td>
- * {@link TIFFTag#TIFF_SBYTE}
- * </td>
- * <td>
- * {@code byte}
- * </td>
- * <td>
- * {@code "SByte"}
- * </td>
- * </tr>
- *
- * <tr>
- * <td>
- * {@code UNDEFINED}
- * </td>
- * <td>
- * {@link TIFFTag#TIFF_UNDEFINED}
- * </td>
- * <td>
- * {@code byte}
- * </td>
- * <td>
- * {@code "Undefined"}
- * </td>
- * </tr>
- *
- * <tr>
- * <td>
- * {@code SSHORT}
- * </td>
- * <td>
- * {@link TIFFTag#TIFF_SSHORT}
- * </td>
- * <td>
- * {@code short}
- * </td>
- * <td>
- * {@code "SShort"}
- * </td>
- * </tr>
- *
- * <tr>
- * <td>
- * {@code SLONG}
- * </td>
- * <td>
- * {@link TIFFTag#TIFF_SLONG}
- * </td>
- * <td>
- * {@code int}
- * </td>
- * <td>
- * {@code "SLong"}
- * </td>
- * </tr>
- *
- * <tr>
- * <td>
- * {@code SRATIONAL}
- * </td>
- * <td>
- * {@link TIFFTag#TIFF_SRATIONAL}
- * </td>
- * <td>
- * {@code int[2]} {numerator, denominator}
- * </td>
- * <td>
- * {@code "SRational"}
- * </td>
- * </tr>
- *
- * <tr>
- * <td>
- * {@code FLOAT}
- * </td>
- * <td>
- * {@link TIFFTag#TIFF_FLOAT}
- * </td>
- * <td>
- * {@code float}
- * </td>
- * <td>
- * {@code "Float"}
- * </td>
- * </tr>
- *
- * <tr>
- * <td>
- * {@code DOUBLE}
- * </td>
- * <td>
- * {@link TIFFTag#TIFF_DOUBLE}
- * </td>
- * <td>
- * {@code double}
- * </td>
- * <td>
- * {@code "Double"}
- * </td>
- * </tr>
- *
- * <tr>
- * <td>
- * {@code IFD}
- * </td>
- * <td>
- * {@link TIFFTag#TIFF_IFD_POINTER}
- * </td>
- * <td>
- * {@code long}
- * </td>
- * <td>
- * {@code "IFDPointer"}
- * </td>
- * </tr>
- *
+ * <thead>
+ *   <tr>
+ *     <th scope="col">TIFF Data Type
+ *     <th scope="col">Java Constant
+ *     <th scope="col">Java Data Type
+ *     <th scope="col">Java Type Name
+ * </thead>
+ * <tbody>
+ *   <tr>
+ *     <th scope="row">{@code BYTE}
+ *     <td>{@link TIFFTag#TIFF_BYTE}
+ *     <td>{@code byte}
+ *     <td>{@code "Byte"}
+ *   <tr>
+ *     <th scope="row">{@code ASCII}
+ *     <td>{@link TIFFTag#TIFF_ASCII}
+ *     <td>{@code String}
+ *     <td>{@code "Ascii"}
+ *   <tr>
+ *     <th scope="row">{@code SHORT}
+ *     <td>{@link TIFFTag#TIFF_SHORT}
+ *     <td>{@code char}
+ *     <td>{@code "Short"}
+ *   <tr>
+ *     <th scope="row">{@code LONG}
+ *     <td>{@link TIFFTag#TIFF_LONG}
+ *     <td>{@code long}
+ *     <td>{@code "Long"}
+ *   <tr>
+ *     <th scope="row">{@code RATIONAL}
+ *     <td>{@link TIFFTag#TIFF_RATIONAL}
+ *     <td>{@code long[2]} {numerator, denominator}
+ *     <td>{@code "Rational"}
+ *   <tr>
+ *     <th scope="row">{@code SBYTE}
+ *     <td>{@link TIFFTag#TIFF_SBYTE}
+ *     <td>{@code byte}
+ *     <td>{@code "SByte"}
+ *   <tr>
+ *     <th scope="row">{@code UNDEFINED}
+ *     <td>{@link TIFFTag#TIFF_UNDEFINED}
+ *     <td>{@code byte}
+ *     <td>{@code "Undefined"}
+ *   <tr>
+ *     <th scope="row">{@code SSHORT}
+ *     <td>{@link TIFFTag#TIFF_SSHORT}
+ *     <td>{@code short}
+ *     <td>{@code "SShort"}
+ *   <tr>
+ *     <th scope="row">{@code SLONG}
+ *     <td>{@link TIFFTag#TIFF_SLONG}
+ *     <td>{@code int}
+ *     <td>{@code "SLong"}
+ *   <tr>
+ *     <th scope="row">{@code SRATIONAL}
+ *     <td>{@link TIFFTag#TIFF_SRATIONAL}
+ *     <td>{@code int[2]} {numerator, denominator}
+ *     <td>{@code "SRational"}
+ *   <tr>
+ *     <th scope="row">{@code FLOAT}
+ *     <td>{@link TIFFTag#TIFF_FLOAT}
+ *     <td>{@code float}
+ *     <td>{@code "Float"}
+ *   <tr>
+ *     <th scope="row">{@code DOUBLE}
+ *     <td>{@link TIFFTag#TIFF_DOUBLE}
+ *     <td>{@code double}
+ *     <td>{@code "Double"}
+ *   <tr>
+ *     <th scope="row">{@code IFD}
+ *     <td>{@link TIFFTag#TIFF_IFD_POINTER}
+ *     <td>{@code long}
+ *     <td>{@code "IFDPointer"}
+ *   </tr>
+ * </tbody>
  * </table>
  *
  * @since 9
--- a/src/java.desktop/share/classes/javax/print/DocFlavor.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/print/DocFlavor.java	Wed Nov 01 10:00:38 2017 -0700
@@ -175,21 +175,21 @@
  *   <caption>MIME-Types and their descriptions</caption>
  *   <thead>
  *     <tr>
- *       <th>MIME-Type
- *       <th>Description
+ *       <th scope="col">MIME-Type
+ *       <th scope="col">Description
  *   </thead>
  *   <tbody>
  *     <tr>
- *       <td>{@code "text/plain"}
+ *       <th scope="row">{@code "text/plain"}
  *       <td>Plain text in the default character set (US-ASCII)
  *     <tr>
- *       <td><code> "text/plain; charset=<i>xxx</i>"</code>
+ *       <th scope="row"><code> "text/plain; charset=<i>xxx</i>"</code>
  *       <td>Plain text in character set <i>xxx</i>
  *     <tr>
- *       <td>{@code "text/html"}
+ *       <th scope="row">{@code "text/html"}
  *       <td>HyperText Markup Language in the default character set (US-ASCII)
  *     <tr>
- *       <td><code> "text/html; charset=<i>xxx</i>"</code>
+ *       <th scope="row"><code> "text/html; charset=<i>xxx</i>"</code>
  *       <td>HyperText Markup Language in character set <i>xxx</i>
  *   </tbody>
  *   </table>
@@ -201,18 +201,18 @@
  *   <caption>MIME-Types and their descriptions</caption>
  *   <thead>
  *     <tr>
- *       <th>MIME-Type
- *       <th>Description
+ *       <th scope="col">MIME-Type
+ *       <th scope="col">Description
  *   </thead>
  *   <tbody>
  *     <tr>
- *       <td>{@code "application/pdf"}
+ *       <th scope="row">{@code "application/pdf"}
  *       <td>Portable Document Format document
  *     <tr>
- *       <td>{@code "application/postscript"}
+ *       <th scope="row">{@code "application/postscript"}
  *       <td>PostScript document
  *     <tr>
- *       <td>{@code "application/vnd.hp-PCL"}
+ *       <th scope="row">{@code "application/vnd.hp-PCL"}
  *       <td>Printer Control Language document
  *   </tbody>
  *   </table>
@@ -223,18 +223,18 @@
  *   <caption>MIME-Types and their descriptions</caption>
  *   <thead>
  *     <tr>
- *       <th>MIME-Type
- *       <th>Description
+ *       <th scope="col">MIME-Type
+ *       <th scope="col">Description
  *   </thead>
  *   <tbody>
  *     <tr>
- *       <td>{@code "image/gif"}
+ *       <th scope="row">{@code "image/gif"}
  *       <td>Graphics Interchange Format image
  *     <tr>
- *       <td>{@code "image/jpeg"}
+ *       <th scope="row">{@code "image/jpeg"}
  *       <td>Joint Photographic Experts Group image
  *     <tr>
- *       <td>{@code "image/png"}
+ *       <th scope="row">{@code "image/png"}
  *       <td>Portable Network Graphics image
  *   </tbody>
  *   </table>
@@ -245,12 +245,12 @@
  *   <caption>MIME-Types and their descriptions</caption>
  *   <thead>
  *     <tr>
- *       <th>MIME-Type
- *       <th>Description
+ *       <th scope="col">MIME-Type
+ *       <th scope="col">Description
  *   </thead>
  *   <tbody>
  *     <tr>
- *       <td>{@code "application/octet-stream"}
+ *       <th scope="row">{@code "application/octet-stream"}
  *       <td>The print data format is unspecified (just an octet stream)
  *   </tbody>
  *   </table>
--- a/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java	Wed Nov 01 10:00:38 2017 -0700
@@ -42,22 +42,23 @@
  * The table below shows the effects of specifying a Chromaticity attribute of
  * {@link #MONOCHROME MONOCHROME} or {@link #COLOR COLOR} for a monochrome or
  * color document.
+ *
  * <table class="striped">
  * <caption>Shows effects of specifying {@code MONOCHROME} or {@code COLOR}
  * Chromaticity attributes</caption>
  * <thead>
  *   <tr>
- *     <th>Chromaticity<br>Attribute
- *     <th>Effect on<br>Monochrome Document
- *     <th>Effect on<br>Color Document
+ *     <th scope="col">Chromaticity<br>Attribute
+ *     <th scope="col">Effect on<br>Monochrome Document
+ *     <th scope="col">Effect on<br>Color Document
  * </thead>
  * <tbody>
  *   <tr>
- *     <td>{@link #MONOCHROME MONOCHROME}
+ *     <th scope="row">{@link #MONOCHROME MONOCHROME}
  *     <td>Printed as is, in monochrome
  *     <td>Printed in monochrome, with colors converted to shades of gray
  *   <tr>
- *     <td>{@link #COLOR COLOR}
+ *     <th scope="row">{@link #COLOR COLOR}
  *     <td>Printed as is, in monochrome
  *     <td>Printed as is, in color
  * </tbody>
--- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java	Wed Nov 01 10:00:38 2017 -0700
@@ -69,40 +69,41 @@
  * The size of a doc is computed based on the print data representation class as
  * specified by the doc's {@link javax.print.DocFlavor DocFlavor}, as shown in
  * the table below.
+ *
  * <table class="striped">
  * <caption>Table showing computation of doc sizes</caption>
  * <thead>
  *   <tr>
- *     <th>Representation Class
- *     <th>Document Size
+ *     <th scope="col">Representation Class
+ *     <th scope="col">Document Size
  * </thead>
  * <tbody>
  *   <tr>
- *     <td>{@code byte[]}
+ *     <th scope="row">{@code byte[]}
  *     <td>Length of the byte array
  *   <tr>
- *     <td>{@code java.io.InputStream}
+ *     <th scope="row">{@code java.io.InputStream}
  *     <td>Number of bytes read from the stream
  *   <tr>
- *     <td>{@code char[]}
+ *     <th scope="row">{@code char[]}
  *     <td>Length of the character array x 2
  *   <tr>
- *     <td>{@code java.lang.String}
+ *     <th scope="row">{@code java.lang.String}
  *     <td>Length of the string x 2
  *   <tr>
- *     <td>{@code java.io.Reader}
+ *     <th scope="row">{@code java.io.Reader}
  *     <td>Number of characters read from the stream x 2
  *   <tr>
- *     <td>{@code java.net.URL}
+ *     <th scope="row">{@code java.net.URL}
  *     <td>Number of bytes read from the file at the given {@code URL} address
  *   <tr>
- *     <td>{@code java.awt.image.renderable.RenderableImage}
+ *     <th scope="row">{@code java.awt.image.renderable.RenderableImage}
  *     <td>Implementation dependent&#42;
  *   <tr>
- *     <td>{@code java.awt.print.Printable}
+ *     <th scope="row">{@code java.awt.print.Printable}
  *     <td>Implementation dependent&#42;
  *   <tr>
- *     <td>{@code java.awt.print.Pageable}
+ *     <th scope="row">{@code java.awt.print.Pageable}
  *     <td>Implementation dependent&#42;
  * </tbody>
  * </table>
--- a/src/java.desktop/share/classes/javax/print/attribute/standard/PresentationDirection.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/print/attribute/standard/PresentationDirection.java	Wed Nov 01 10:00:38 2017 -0700
@@ -41,10 +41,10 @@
  * <p>
  * <b>IPP Compatibility:</b> This attribute is not an IPP 1.1 attribute; it is
  * an attribute in the Production Printing Extension
- * (<a href="ftp://ftp.pwg.org/pub/pwg/standards/pwg5100.3.pdf">PDF</a>) of IPP
- * 1.1. The category name returned by {@code getName()} is the IPP attribute
- * name. The enumeration's integer value is the IPP enum value. The
- * {@code toString()} method returns the IPP string representation of the
+ * (<a href="ftp://ftp.pwg.org/pub/pwg/standards/temp_archive/pwg5100.3.pdf">
+ * PDF</a>) of IPP 1.1. The category name returned by {@code getName()} is the
+ * IPP attribute name. The enumeration's integer value is the IPP enum value.
+ * The {@code toString()} method returns the IPP string representation of the
  * attribute value.
  *
  * @author Phil Race
--- a/src/java.desktop/share/classes/javax/print/attribute/standard/package-info.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/print/attribute/standard/package-info.java	Wed Nov 01 10:00:38 2017 -0700
@@ -150,412 +150,437 @@
  * attribute, the column marked "SupportedValuesAttribute" lists the
  * supported-values attribute class, if any, with which a print service
  * indicates the supported values for that attribute category.
- * <table border=1 cellpadding=2 cellspacing=1 summary="Lists all printing
- * attributes as described in above text">
- *   <tr style="background-color:#E5E5E5">
- *     <th valign="bottom">Attribute Class
- *     <th valign="bottom">Doc<br>Attribute
- *     <th valign="bottom">Print<br>Request<br>Attribute
- *     <th valign="bottom">Print<br>Job<br>Attribute
- *     <th valign="bottom">Print<br>Service<br>Attribute
- *     <th valign="bottom">SupportedValuesAttribute
+ *
+ * <table class="striped">
+ * <caption>Lists all printing attributes as described above</caption>
+ * <thead>
  *   <tr>
- *     <td><a href="Compression.html">Compression</a>
+ *     <th scope="col">Attribute Class
+ *     <th scope="col">Doc<br>Attribute
+ *     <th scope="col">Print<br>Request<br>Attribute
+ *     <th scope="col">Print<br>Job<br>Attribute
+ *     <th scope="col">Print<br>Service<br>Attribute
+ *     <th scope="col">SupportedValuesAttribute
+ * </thead>
+ * <tbody>
+ *   <tr>
+ *     <th scope="row"><a href="Compression.html">Compression</a>
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="DocumentName.html">DocumentName</a>
+ *     <th scope="row"><a href="DocumentName.html">DocumentName</a>
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="Chromaticity.html">Chromaticity</a>
+ *     <th scope="row"><a href="Chromaticity.html">Chromaticity</a>
  *     <td align="center">X
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="Copies.html">Copies</a>
+ *     <th scope="row"><a href="Copies.html">Copies</a>
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td><a href="CopiesSupported.html">CopiesSupported</a>
  *   <tr>
- *     <td><a href="Finishings.html">Finishings</a>
+ *     <th scope="row"><a href="Finishings.html">Finishings</a>
  *     <td align="center">X
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="JobHoldUntil.html">JobHoldUntil</a>
+ *     <th scope="row"><a href="JobHoldUntil.html">JobHoldUntil</a>
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="JobImpressions.html">JobImpressions</a>
+ *     <th scope="row"><a href="JobImpressions.html">JobImpressions</a>
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td><a href="JobImpressionsSupported.html">JobImpressionsSupported</a>
  *   <tr>
- *     <td><a href="JobKOctets.html">JobKOctets</a>
+ *     <th scope="row"><a href="JobKOctets.html">JobKOctets</a>
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td><a href="JobKOctetsSupported.html">JobKOctetsSupported</a>
  *   <tr>
- *     <td><a href="JobMediaSheets.html">JobMediaSheets</a>
+ *     <th scope="row"><a href="JobMediaSheets.html">JobMediaSheets</a>
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td><a href="JobMediaSheetsSupported.html">JobMediaSheetsSupported</a>
  *   <tr>
- *     <td><a href="JobName.html">JobName</a>
+ *     <th scope="row"><a href="JobName.html">JobName</a>
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="JobPriority.html">JobPriority</a>
+ *     <th scope="row"><a href="JobPriority.html">JobPriority</a>
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td><a href="JobPrioritySupported.html">JobPrioritySupported</a>
  *   <tr>
- *     <td><a href="JobSheets.html">JobSheets</a>
+ *     <th scope="row"><a href="JobSheets.html">JobSheets</a>
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="Media.html">Media</a>
+ *     <th scope="row"><a href="Media.html">Media</a>
  *     <td align="center">X
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="MediaSize.html">MediaSize</a>
+ *     <th scope="row"><a href="MediaSize.html">MediaSize</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="MultipleDocumentHandling.html">MultipleDocumentHandling</a>
+ *     <th scope="row"><a href="MultipleDocumentHandling.html">
+ *     MultipleDocumentHandling</a>
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="NumberUp.html">NumberUp</a>
+ *     <th scope="row"><a href="NumberUp.html">NumberUp</a>
  *     <td align="center">X
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td><a href="NumberUpSupported.html">NumberUpSupported</a>
  *   <tr>
- *     <td><a href="OrientationRequested.html">OrientationRequested</a>
+ *     <th scope="row"><a href="OrientationRequested.html">
+ *     OrientationRequested</a>
  *     <td align="center">X
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="PageRanges.html">PageRanges</a>
+ *     <th scope="row"><a href="PageRanges.html">PageRanges</a>
  *     <td align="center">X
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="PresentationDirection.html">PresentationDirection</a>
+ *     <th scope="row"><a href="PresentationDirection.html">
+ *     PresentationDirection</a>
  *     <td align="center">X
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="PrinterResolution.html">PrinterResolution</a>
+ *     <th scope="row"><a href="PrinterResolution.html">PrinterResolution</a>
  *     <td align="center">X
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="PrintQuality.html">PrintQuality</a>
+ *     <th scope="row"><a href="PrintQuality.html">PrintQuality</a>
  *     <td align="center">X
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="RequestingUserName.html">RequestingUserName</a>
+ *     <th scope="row"><a href="RequestingUserName.html">RequestingUserName</a>
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="SheetCollate.html">SheetCollate</a>
+ *     <th scope="row"><a href="SheetCollate.html">SheetCollate</a>
  *     <td align="center">X
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="Sides.html">Sides</a>
+ *     <th scope="row"><a href="Sides.html">Sides</a>
  *     <td align="center">X
  *     <td align="center">X
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="DateTimeAtCompleted.html">DateTimeAtCompleted</a>
+ *     <th scope="row"><a href="DateTimeAtCompleted.html">
+ *     DateTimeAtCompleted</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="DateTimeAtCreation.html">DateTimeAtCreation</a>
+ *     <th scope="row"><a href="DateTimeAtCreation.html">DateTimeAtCreation</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="DateTimeAtProcessing.html">DateTimeAtProcessing</a>
+ *     <th scope="row"><a href="DateTimeAtProcessing.html">
+ *     DateTimeAtProcessing</a>
+ *     <td>&nbsp;
+ *     <td>&nbsp;
+ *     <td align="center">X
+ *     <td>&nbsp;
+ *     <td>&nbsp;
+ *   <tr>
+ *     <th scope="row"><a href="JobImpressionsCompleted.html">
+ *     JobImpressionsCompleted</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="JobImpressionsCompleted.html">JobImpressionsCompleted</a>
+ *     <th scope="row"><a href="JobKOctetsProcessed.html">
+ *     JobKOctetsProcessed</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="JobKOctetsProcessed.html">JobKOctetsProcessed</a>
+ *     <th scope="row"><a href="JobMediaSheetsCompleted.html">
+ *     JobMediaSheetsCompleted</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="JobMediaSheetsCompleted.html">JobMediaSheetsCompleted</a>
+ *     <th scope="row"><a href="JobMessageFromOperator.html">
+ *     JobMessageFromOperator</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="JobMessageFromOperator.html">JobMessageFromOperator</a>
+ *     <th scope="row"><a href="JobOriginatingUserName.html">
+ *     JobOriginatingUserName</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="JobOriginatingUserName.html">JobOriginatingUserName</a>
+ *     <th scope="row"><a href="JobState.html">JobState</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="JobState.html">JobState</a>
+ *     <th scope="row"><a href="JobStateReasons.html">JobStateReasons</a>
+ *     <br>
+ *     Contains zero or more --
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="JobStateReasons.html">JobStateReasons</a><br>
- *             Contains zero or more --
+ *     <th scope="row">-- <a href="JobStateReason.html">JobStateReason</a>
+ *     <td>&nbsp;
+ *     <td>&nbsp;
+ *     <td>&nbsp;
+ *     <td>&nbsp;
+ *     <td>&nbsp;
+ *   <tr>
+ *     <th scope="row"><a href="NumberOfDocuments.html">NumberOfDocuments</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td>-- <a href="JobStateReason.html">JobStateReason</a>
- *     <td>&nbsp;
- *     <td>&nbsp;
- *     <td>&nbsp;
- *     <td>&nbsp;
- *     <td>&nbsp;
- *   <tr>
- *     <td><a href="NumberOfDocuments.html">NumberOfDocuments</a>
+ *     <th scope="row"><a href="NumberOfInterveningJobs.html">
+ *     NumberOfInterveningJobs</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="NumberOfInterveningJobs.html">NumberOfInterveningJobs</a>
- *     <td>&nbsp;
- *     <td>&nbsp;
- *     <td align="center">X
- *     <td>&nbsp;
- *     <td>&nbsp;
- *   <tr>
- *     <td><a href="OutputDeviceAssigned.html">OutputDeviceAssigned</a>
+ *     <th scope="row"><a href="OutputDeviceAssigned.html">
+ *     OutputDeviceAssigned</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="ColorSupported.html">ColorSupported</a>
+ *     <th scope="row"><a href="ColorSupported.html">ColorSupported</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="PagesPerMinute.html">PagesPerMinute</a>
+ *     <th scope="row"><a href="PagesPerMinute.html">PagesPerMinute</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="PagesPerMinuteColor.html">PagesPerMinuteColor</a>
+ *     <th scope="row"><a href="PagesPerMinuteColor.html">
+ *     PagesPerMinuteColor</a>
+ *     <td>&nbsp;
+ *     <td>&nbsp;
+ *     <td>&nbsp;
+ *     <td align="center">X
+ *     <td>&nbsp;
+ *   <tr>
+ *     <th scope="row"><a href="PDLOverrideSupported.html">
+ *     PDLOverrideSupported</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="PDLOverrideSupported.html">PDLOverrideSupported</a>
+ *     <th scope="row"><a href="PrinterIsAcceptingJobs.html">
+ *     PrinterIsAcceptingJobs</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="PrinterIsAcceptingJobs.html">PrinterIsAcceptingJobs</a>
+ *     <th scope="row"><a href="PrinterInfo.html">PrinterInfo</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="PrinterInfo.html">PrinterInfo</a>
+ *     <th scope="row"><a href="PrinterLocation.html">PrinterLocation</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="PrinterLocation.html">PrinterLocation</a>
+ *     <th scope="row"><a href="PrinterMessageFromOperator.html">
+ *     PrinterMessageFromOperator</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="PrinterMessageFromOperator.html">
- *             PrinterMessageFromOperator</a>
+ *     <th scope="row"><a href="PrinterMakeAndModel.html">
+ *     PrinterMakeAndModel</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="PrinterMakeAndModel.html">PrinterMakeAndModel</a>
+ *     <th scope="row"><a href="PrinterMoreInfo.html">PrinterMoreInfo</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="PrinterMoreInfo.html">PrinterMoreInfo</a>
+ *     <th scope="row"><a href="PrinterMoreInfoManufacturer.html">
+ *     PrinterMoreInfoManufacturer</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="PrinterMoreInfoManufacturer.html">
- *             PrinterMoreInfoManufacturer</a>
+ *     <th scope="row"><a href="PrinterName.html">PrinterName</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="PrinterName.html">PrinterName</a>
+ *     <th scope="row"><a href="PrinterState.html">PrinterState</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="PrinterState.html">PrinterState</a>
+ *     <th scope="row"><a href="PrinterStateReasons.html">
+ *     PrinterStateReasons</a>
+ *     <br>
+ *     Contains zero or more --
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="PrinterStateReasons.html">PrinterStateReasons</a><br>
- *             Contains zero or more --
+ *     <th scope="row">-- <a href="PrinterStateReason.html">
+ *     PrinterStateReason</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
- *     <td align="center">X
+ *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td>-- <a href="PrinterStateReason.html">PrinterStateReason</a>
+ *     <th scope="row">-- <a href="Severity.html">Severity</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *   <tr>
- *     <td>-- <a href="Severity.html">Severity</a>
- *     <td>&nbsp;
- *     <td>&nbsp;
- *     <td>&nbsp;
- *     <td>&nbsp;
- *     <td>&nbsp;
- *   <tr>
- *     <td><a href="QueuedJobCount.html">QueuedJobCount</a>
+ *     <th scope="row"><a href="QueuedJobCount.html">QueuedJobCount</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td align="center">X
  *     <td>&nbsp;
  *   <tr>
- *     <td><a href="ReferenceUriSchemesSupported.html">
- *             ReferenceUriSchemesSupported</a>
+ *     <th scope="row"><a href="ReferenceUriSchemesSupported.html">
+ *     ReferenceUriSchemesSupported</a>
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
  *     <td>&nbsp;
+ * </tbody>
  * </table>
  * <p>
  * Please note: In the {@code javax.print} APIs, a {@code null} reference
--- a/src/java.desktop/share/classes/javax/sound/midi/MidiFileFormat.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/sound/midi/MidiFileFormat.java	Wed Nov 01 10:00:38 2017 -0700
@@ -43,32 +43,36 @@
  * The following table lists some common properties that should be used in
  * implementations:
  *
- * <table border=1>
+ * <table class="striped">
  * <caption>MIDI File Format Properties</caption>
+ * <thead>
  *   <tr>
- *     <th>Property key
- *     <th>Value type
- *     <th>Description
+ *     <th scope="col">Property key
+ *     <th scope="col">Value type
+ *     <th scope="col">Description
+ * </thead>
+ * <tbody>
  *   <tr>
- *     <td>&quot;author&quot;
+ *     <th scope="row">"author"
  *     <td>{@link String String}
  *     <td>name of the author of this file
  *   <tr>
- *     <td>&quot;title&quot;
+ *     <th scope="row">"title"
  *     <td>{@link String String}
  *     <td>title of this file
  *   <tr>
- *     <td>&quot;copyright&quot;
+ *     <th scope="row">"copyright"
  *     <td>{@link String String}
  *     <td>copyright message
  *   <tr>
- *     <td>&quot;date&quot;
+ *     <th scope="row">"date"
  *     <td>{@link java.util.Date Date}
  *     <td>date of the recording or release
  *   <tr>
- *     <td>&quot;comment&quot;
+ *     <th scope="row">"comment"
  *     <td>{@link String String}
  *     <td>an arbitrary text
+ * </tbody>
  * </table>
  *
  * @author Kara Kytle
--- a/src/java.desktop/share/classes/javax/sound/midi/MidiSystem.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/sound/midi/MidiSystem.java	Wed Nov 01 10:00:38 2017 -0700
@@ -78,32 +78,32 @@
  * <caption>MIDI System Property Keys</caption>
  * <thead>
  *   <tr>
- *     <th>Property Key
- *     <th>Interface
- *     <th>Affected Method
+ *     <th scope="col">Property Key
+ *     <th scope="col">Interface
+ *     <th scope="col">Affected Method
  * </thead>
  * <tbody>
  *   <tr>
- *     <td>{@code javax.sound.midi.Receiver}
+ *     <th scope="row">{@code javax.sound.midi.Receiver}
  *     <td>{@link Receiver}
  *     <td>{@link #getReceiver}
  *   <tr>
- *     <td>{@code javax.sound.midi.Sequencer}
+ *     <th scope="row">{@code javax.sound.midi.Sequencer}
  *     <td>{@link Sequencer}
  *     <td>{@link #getSequencer}
  *   <tr>
- *     <td>{@code javax.sound.midi.Synthesizer}
+ *     <th scope="row">{@code javax.sound.midi.Synthesizer}
  *     <td>{@link Synthesizer}
  *     <td>{@link #getSynthesizer}
  *   <tr>
- *     <td>{@code javax.sound.midi.Transmitter}
+ *     <th scope="row">{@code javax.sound.midi.Transmitter}
  *     <td>{@link Transmitter}
  *     <td>{@link #getTransmitter}
  * </tbody>
  * </table>
  *
  * The property value consists of the provider class name and the device name,
- * separated by the hash mark (&quot;#&quot;). The provider class name is the
+ * separated by the hash mark ("#"). The provider class name is the
  * fully-qualified name of a concrete
  * {@link MidiDeviceProvider MIDI device provider} class. The device name is
  * matched against the {@code String} returned by the {@code getName} method of
--- a/src/java.desktop/share/classes/javax/sound/sampled/AudioFileFormat.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/sound/sampled/AudioFileFormat.java	Wed Nov 01 10:00:38 2017 -0700
@@ -50,36 +50,40 @@
  * The following table lists some common properties that should be used in
  * implementations:
  *
- * <table border=1>
+ * <table class="striped">
  * <caption>Audio File Format Properties</caption>
+ * <thead>
  *   <tr>
- *     <th>Property key
- *     <th>Value type
- *     <th>Description
+ *     <th scope="col">Property key
+ *     <th scope="col">Value type
+ *     <th scope="col">Description
+ * </thead>
+ * <tbody>
  *   <tr>
- *     <td>&quot;duration&quot;
+ *     <th scope="row">"duration"
  *     <td>{@link Long Long}
  *     <td>playback duration of the file in microseconds
  *   <tr>
- *     <td>&quot;author&quot;
+ *     <th scope="row">"author"
  *     <td>{@link String String}
  *     <td>name of the author of this file
  *   <tr>
- *     <td>&quot;title&quot;
+ *     <th scope="row">"title"
  *     <td>{@link String String}
  *     <td>title of this file
  *   <tr>
- *     <td>&quot;copyright&quot;
+ *     <th scope="row">"copyright"
  *     <td>{@link String String}
  *     <td>copyright message
  *   <tr>
- *     <td>&quot;date&quot;
+ *     <th scope="row">"date"
  *     <td>{@link java.util.Date Date}
  *     <td>date of the recording or release
  *   <tr>
- *     <td>&quot;comment&quot;
+ *     <th scope="row">"comment"
  *     <td>{@link String String}
  *     <td>an arbitrary text
+ * </tbody>
  * </table>
  *
  * @author David Rivas
--- a/src/java.desktop/share/classes/javax/sound/sampled/AudioFormat.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/sound/sampled/AudioFormat.java	Wed Nov 01 10:00:38 2017 -0700
@@ -94,21 +94,21 @@
  * <caption>Audio Format Properties</caption>
  * <thead>
  *   <tr>
- *     <th>Property key
- *     <th>Value type
- *     <th>Description
+ *     <th scope="col">Property key
+ *     <th scope="col">Value type
+ *     <th scope="col">Description
  * </thead>
  * <tbody>
  *   <tr>
- *     <td>&quot;bitrate&quot;
+ *     <th scope="row">"bitrate"
  *     <td>{@link java.lang.Integer Integer}
  *     <td>average bit rate in bits per second
  *   <tr>
- *     <td>&quot;vbr&quot;
+ *     <th scope="row">"vbr"
  *     <td>{@link java.lang.Boolean Boolean}
  *     <td>{@code true}, if the file is encoded in variable bit rate (VBR)
  *   <tr>
- *     <td>&quot;quality&quot;
+ *     <th scope="row">"quality"
  *     <td>{@link java.lang.Integer Integer}
  *     <td>encoding/conversion quality, 1..100
  * </tbody>
--- a/src/java.desktop/share/classes/javax/sound/sampled/AudioPermission.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/sound/sampled/AudioPermission.java	Wed Nov 01 10:00:38 2017 -0700
@@ -46,13 +46,13 @@
  * risks</caption>
  * <thead>
  *   <tr>
- *     <th>Permission Target Name
- *     <th>What the Permission Allows
- *     <th>Risks of Allowing this Permission
+ *     <th scope="col">Permission Target Name
+ *     <th scope="col">What the Permission Allows
+ *     <th scope="col">Risks of Allowing this Permission
  * </thead>
  * <tbody>
  *   <tr>
- *     <td>play
+ *     <th scope="row">play
  *     <td>Audio playback through the audio device or devices on the system.
  *     Allows the application to obtain and manipulate lines and mixers for
  *     audio playback (rendering).
@@ -61,7 +61,7 @@
  *     audio being played on the system, or because manipulation of a mixer
  *     affects the audio for all lines using that mixer.
  *   <tr>
- *     <td>record
+ *     <th scope="row">record
  *     <td>Audio recording through the audio device or devices on the system.
  *     Allows the application to obtain and manipulate lines and mixers for
  *     audio recording (capture).
--- a/src/java.desktop/share/classes/javax/sound/sampled/AudioSystem.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/sound/sampled/AudioSystem.java	Wed Nov 01 10:00:38 2017 -0700
@@ -75,32 +75,32 @@
  * <caption>Audio System Property Keys</caption>
  * <thead>
  *   <tr>
- *     <th>Property Key
- *     <th>Interface
- *     <th>Affected Method(s)
+ *     <th scope="col">Property Key
+ *     <th scope="col">Interface
+ *     <th scope="col">Affected Method(s)
  * </thead>
  * <tbody>
  *   <tr>
- *     <td>{@code javax.sound.sampled.Clip}
+ *     <th scope="row">{@code javax.sound.sampled.Clip}
  *     <td>{@link Clip}
  *     <td>{@link #getLine}, {@link #getClip}
  *   <tr>
- *     <td>{@code javax.sound.sampled.Port}
+ *     <th scope="row">{@code javax.sound.sampled.Port}
  *     <td>{@link Port}
  *     <td>{@link #getLine}
  *   <tr>
- *     <td>{@code javax.sound.sampled.SourceDataLine}
+ *     <th scope="row">{@code javax.sound.sampled.SourceDataLine}
  *     <td>{@link SourceDataLine}
  *     <td>{@link #getLine}, {@link #getSourceDataLine}
  *   <tr>
- *     <td>{@code javax.sound.sampled.TargetDataLine}
+ *     <th scope="row">{@code javax.sound.sampled.TargetDataLine}
  *     <td>{@link TargetDataLine}
  *     <td>{@link #getLine}, {@link #getTargetDataLine}
  * </tbody>
  * </table>
  *
  * The property value consists of the provider class name and the mixer name,
- * separated by the hash mark (&quot;#&quot;). The provider class name is the
+ * separated by the hash mark ("#"). The provider class name is the
  * fully-qualified name of a concrete {@link MixerProvider mixer provider}
  * class. The mixer name is matched against the {@code String} returned by the
  * {@code getName} method of {@code Mixer.Info}. Either the class name, or the
--- a/src/java.desktop/share/classes/javax/sound/sampled/ReverbType.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/sound/sampled/ReverbType.java	Wed Nov 01 10:00:38 2017 -0700
@@ -75,44 +75,44 @@
  * early intensity, and early delay</caption>
  * <thead>
  *   <tr>
- *     <th>Type
- *     <th>Decay Time (ms)
- *     <th>Late Intensity (dB)
- *     <th>Late Delay (ms)
- *     <th>Early Intensity (dB)
- *     <th>Early Delay(ms)
+ *     <th scope="col">Type
+ *     <th scope="col">Decay Time (ms)
+ *     <th scope="col">Late Intensity (dB)
+ *     <th scope="col">Late Delay (ms)
+ *     <th scope="col">Early Intensity (dB)
+ *     <th scope="col">Early Delay(ms)
  * </thead>
  * <tbody>
  *   <tr>
- *     <td>Cavern
+ *     <th scope="row">Cavern
  *     <td>2250
  *     <td>-2.0
  *     <td>41.3
  *     <td>-1.4
  *     <td>10.3
  *   <tr>
- *     <td>Dungeon
+ *     <th scope="row">Dungeon
  *     <td>1600
  *     <td>-1.0
  *     <td>10.3
  *     <td>-0.7
  *     <td>2.6
  *   <tr>
- *     <td>Garage
+ *     <th scope="row">Garage
  *     <td>900
  *     <td>-6.0
  *     <td>14.7
  *     <td>-4.0
  *     <td>3.9
  *   <tr>
- *     <td>Acoustic Lab
+ *     <th scope="row">Acoustic Lab
  *     <td>280
  *     <td>-3.0
  *     <td>8.0
  *     <td>-2.0
  *     <td>2.0
  *   <tr>
- *     <td>Closet
+ *     <th scope="row">Closet
  *     <td>150
  *     <td>-10.0
  *     <td>2.5
--- a/src/java.desktop/share/classes/javax/swing/Action.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/Action.java	Wed Nov 01 10:00:38 2017 -0700
@@ -98,102 +98,88 @@
  * <caption>Supported Action properties</caption>
  * <thead>
  *  <tr>
- *    <th>Component Property
- *    <th>Components
- *    <th>Action Key
- *    <th>Notes
+ *    <th scope="col">Component Property
+ *    <th scope="col">Components
+ *    <th scope="col">Action Key
+ *    <th scope="col">Notes
  * </thead>
  * <tbody>
- *  <tr valign="top" style="text-align:left">
- *      <td><b><code>enabled</code></b>
- *      <td>All
- *      <td>The <code>isEnabled</code> method
- *      <td>&nbsp;
- *  <tr valign="top" style="text-align:left">
- *      <td><b><code>toolTipText</code></b>
- *      <td>All
- *      <td><code>SHORT_DESCRIPTION</code>
- *      <td>&nbsp;
- *  <tr valign="top" style="text-align:left">
- *      <td><b><code>actionCommand</code></b>
- *      <td>All
- *      <td><code>ACTION_COMMAND_KEY</code>
- *      <td>&nbsp;
- *  <tr valign="top" style="text-align:left">
- *      <td><b><code>mnemonic</code></b>
- *      <td>All buttons
- *      <td><code>MNEMONIC_KEY</code>
- *      <td>A <code>null</code> value or <code>Action</code> results in the
- *          button's <code>mnemonic</code> property being set to
- *          <code>'\0'</code>.
- *  <tr valign="top" style="text-align:left">
- *      <td><b><code>text</code></b>
- *      <td>All buttons
- *      <td><code>NAME</code>
- *      <td>If you do not want the text of the button to mirror that
- *          of the <code>Action</code>, set the property
- *          <code>hideActionText</code> to <code>true</code>.  If
- *          <code>hideActionText</code> is <code>true</code>, setting the
- *          <code>Action</code> changes the text of the button to
- *          <code>null</code> and any changes to <code>NAME</code>
- *          are ignored.  <code>hideActionText</code> is useful for
- *          tool bar buttons that typically only show an <code>Icon</code>.
- *          <code>JToolBar.add(Action)</code> sets the property to
- *          <code>true</code> if the <code>Action</code> has a
- *          non-<code>null</code> value for <code>LARGE_ICON_KEY</code> or
- *          <code>SMALL_ICON</code>.
- *  <tr valign="top" style="text-align:left">
- *      <td><b><code>displayedMnemonicIndex</code></b>
- *      <td>All buttons
- *      <td><code>DISPLAYED_MNEMONIC_INDEX_KEY</code>
- *      <td>If the value of <code>DISPLAYED_MNEMONIC_INDEX_KEY</code> is
- *          beyond the bounds of the text, it is ignored.  When
- *          <code>setAction</code> is called, if the value from the
- *          <code>Action</code> is <code>null</code>, the displayed
- *          mnemonic index is not updated.  In any subsequent changes to
- *          <code>DISPLAYED_MNEMONIC_INDEX_KEY</code>, <code>null</code>
- *          is treated as -1.
- *  <tr valign="top" style="text-align:left">
- *      <td><b><code>icon</code></b>
- *      <td>All buttons except of <code>JCheckBox</code>,
- *      <code>JToggleButton</code> and <code>JRadioButton</code>.
- *      <td>either <code>LARGE_ICON_KEY</code> or
- *          <code>SMALL_ICON</code>
- *     <td>The <code>JMenuItem</code> subclasses only use
- *         <code>SMALL_ICON</code>.  All other buttons will use
- *         <code>LARGE_ICON_KEY</code>; if the value is <code>null</code> they
- *         use <code>SMALL_ICON</code>.
- *  <tr valign="top" style="text-align:left">
- *      <td><b><code>accelerator</code></b>
- *      <td>All <code>JMenuItem</code> subclasses, with the exception of
- *          <code>JMenu</code>.
- *      <td><code>ACCELERATOR_KEY</code>
- *      <td>&nbsp;
- *  <tr valign="top" style="text-align:left">
- *      <td><b><code>selected</code></b>
- *      <td><code>JToggleButton</code>, <code>JCheckBox</code>,
- *          <code>JRadioButton</code>, <code>JCheckBoxMenuItem</code> and
- *          <code>JRadioButtonMenuItem</code>
- *      <td><code>SELECTED_KEY</code>
- *      <td>Components that honor this property only use
- *          the value if it is {@code non-null}. For example, if
- *          you set an {@code Action} that has a {@code null}
- *          value for {@code SELECTED_KEY} on a {@code JToggleButton}, the
- *          {@code JToggleButton} will not update it's selected state in
- *          any way. Similarly, any time the {@code JToggleButton}'s
- *          selected state changes it will only set the value back on
- *          the {@code Action} if the {@code Action} has a {@code non-null}
- *          value for {@code SELECTED_KEY}.
- *          <br>
- *          Components that honor this property keep their selected state
- *          in sync with this property. When the same {@code Action} is used
- *          with multiple components, all the components keep their selected
- *          state in sync with this property. Mutually exclusive
- *          buttons, such as {@code JToggleButton}s in a {@code ButtonGroup},
- *          force only one of the buttons to be selected. As such, do not
- *          use the same {@code Action} that defines a value for the
- *          {@code SELECTED_KEY} property with multiple mutually
- *          exclusive buttons.
+ *  <tr>
+ *    <th scope="row">{@code enabled}
+ *    <td>All
+ *    <td>The {@code isEnabled} method
+ *    <td>&nbsp;
+ *  <tr>
+ *    <th scope="row">{@code toolTipText}
+ *    <td>All
+ *    <td>{@code SHORT_DESCRIPTION}
+ *    <td>&nbsp;
+ *  <tr>
+ *    <th scope="row">{@code actionCommand}
+ *    <td>All
+ *    <td>{@code ACTION_COMMAND_KEY}
+ *    <td>&nbsp;
+ *  <tr>
+ *    <th scope="row">{@code mnemonic}
+ *    <td>All buttons
+ *    <td>{@code MNEMONIC_KEY}
+ *    <td>A {@code null} value or {@code Action} results in the button's
+ *    {@code mnemonic} property being set to {@code '\0'}.
+ *  <tr>
+ *    <th scope="row">{@code text}
+ *    <td>All buttons
+ *    <td>{@code NAME}
+ *    <td>If you do not want the text of the button to mirror that of the
+ *    {@code Action}, set the property {@code hideActionText} to {@code true}.
+ *    If {@code hideActionText} is {@code true}, setting the {@code Action}
+ *    changes the text of the button to {@code null} and any changes to
+ *    {@code NAME} are ignored. {@code hideActionText} is useful for tool bar
+ *    buttons that typically only show an {@code Icon}.
+ *    {@code JToolBar.add(Action)} sets the property to {@code true} if the
+ *    {@code Action} has a non-{@code null} value for {@code LARGE_ICON_KEY} or
+ *    {@code SMALL_ICON}.
+ *  <tr>
+ *    <th scope="row">{@code displayedMnemonicIndex}
+ *    <td>All buttons
+ *    <td>{@code DISPLAYED_MNEMONIC_INDEX_KEY}
+ *    <td>If the value of {@code DISPLAYED_MNEMONIC_INDEX_KEY} is beyond the
+ *    bounds of the text, it is ignored. When {@code setAction} is called, if
+ *    the value from the {@code Action} is {@code null}, the displayed mnemonic
+ *    index is not updated. In any subsequent changes to
+ *    {@code DISPLAYED_MNEMONIC_INDEX_KEY}, {@code null} is treated as -1.
+ *  <tr>
+ *    <th scope="row">{@code icon}
+ *    <td>All buttons except of {@code JCheckBox}, {@code JToggleButton} and
+ *    {@code JRadioButton}.
+ *    <td>either {@code LARGE_ICON_KEY} or {@code SMALL_ICON}
+ *    <td>The {@code JMenuItem} subclasses only use {@code SMALL_ICON}. All
+ *    other buttons will use {@code LARGE_ICON_KEY}; if the value is
+ *    {@code null} they use {@code SMALL_ICON}.
+ *  <tr>
+ *    <th scope="row">{@code accelerator}
+ *    <td>All {@code JMenuItem} subclasses, with the exception of {@code JMenu}.
+ *    <td>{@code ACCELERATOR_KEY}
+ *    <td>&nbsp;
+ *  <tr>
+ *    <th scope="row">{@code selected}
+ *    <td>{@code JToggleButton}, {@code JCheckBox}, {@code JRadioButton},
+ *    {@code JCheckBoxMenuItem} and {@code JRadioButtonMenuItem}
+ *    <td>{@code SELECTED_KEY}
+ *    <td>Components that honor this property only use the value if it is
+ *    {@code non-null}. For example, if you set an {@code Action} that has a
+ *    {@code null} value for {@code SELECTED_KEY} on a {@code JToggleButton},
+ *    the {@code JToggleButton} will not update it's selected state in any way.
+ *    Similarly, any time the {@code JToggleButton}'s selected state changes it
+ *    will only set the value back on the {@code Action} if the {@code Action}
+ *    has a {@code non-null} value for {@code SELECTED_KEY}.
+ *    <br>
+ *    Components that honor this property keep their selected state in sync with
+ *    this property. When the same {@code Action} is used with multiple
+ *    components, all the components keep their selected state in sync with this
+ *    property. Mutually exclusive buttons, such as {@code JToggleButton}s in a
+ *    {@code ButtonGroup}, force only one of the buttons to be selected. As
+ *    such, do not use the same {@code Action} that defines a value for the
+ *    {@code SELECTED_KEY} property with multiple mutually exclusive buttons.
  * </tbody>
  * </table>
  * <p>
--- a/src/java.desktop/share/classes/javax/swing/DefaultDesktopManager.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/DefaultDesktopManager.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,16 +23,22 @@
  * questions.
  */
 
-
 package javax.swing;
 
-import com.sun.awt.AWTUtilities;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Toolkit;
+import java.awt.Window;
+import java.beans.PropertyVetoException;
+
 import sun.awt.AWTAccessor;
 import sun.awt.SunToolkit;
 
-import java.awt.*;
-import java.beans.PropertyVetoException;
-
 /** This is an implementation of the <code>DesktopManager</code>.
   * It currently implements the basic behaviors for managing
   * <code>JInternalFrame</code>s in an arbitrary parent.
@@ -315,7 +321,7 @@
         if (p != null) {
             String mode = (String)p.getClientProperty("JDesktopPane.dragMode");
             Window window = SwingUtilities.getWindowAncestor(f);
-            if (window != null && !AWTUtilities.isWindowOpaque(window)) {
+            if (window != null && !window.isOpaque()) {
                 dragMode = DEFAULT_DRAG_MODE;
             } else if (mode != null && mode.equals("outline")) {
                 dragMode = OUTLINE_DRAG_MODE;
--- a/src/java.desktop/share/classes/javax/swing/DefaultListSelectionModel.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/DefaultListSelectionModel.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -95,6 +95,7 @@
      * @throws IllegalArgumentException {@inheritDoc}
      */
     public void setSelectionMode(int selectionMode) {
+        int oldMode = this.selectionMode;
         switch (selectionMode) {
         case SINGLE_SELECTION:
         case SINGLE_INTERVAL_SELECTION:
@@ -104,6 +105,24 @@
         default:
             throw new IllegalArgumentException("invalid selectionMode");
         }
+
+        /*
+        This code will only be executed when selection needs to be updated on
+        changing selection mode. It will happen only if selection mode is changed
+        from MULTIPLE_INTERVAL to SINGLE_INTERVAL or SINGLE or from
+        SINGLE_INTERVAL to SINGLE
+         */
+        if (oldMode > this.selectionMode) {
+            if (this.selectionMode == SINGLE_SELECTION) {
+                setSelectionInterval(minIndex, minIndex);
+            } else if (this.selectionMode == SINGLE_INTERVAL_SELECTION) {
+                int selectionEndindex = minIndex;
+                while (value.get(selectionEndindex+1)) {
+                    selectionEndindex++;
+                }
+                setSelectionInterval(minIndex, selectionEndindex);
+            }
+        }
     }
 
     /** {@inheritDoc} */
--- a/src/java.desktop/share/classes/javax/swing/JComponent.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/JComponent.java	Wed Nov 01 10:00:38 2017 -0700
@@ -121,7 +121,7 @@
  *     both of which are sections in <em>The Java Tutorial</em>.
  * </ul>
  * For more information on these subjects, see the
- * <a href="package-summary.html#package_description">Swing package description</a>
+ * {@link javax.swing Swing package description}
  * and <em>The Java Tutorial</em> section
  * <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/jcomponent.html">The JComponent Class</a>.
  * <p>
--- a/src/java.desktop/share/classes/javax/swing/JEditorPane.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/JEditorPane.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1914,11 +1914,13 @@
 
             /**
              * Return an object that represents the link anchor,
-             * as appropriate for that link.  E.g. from HTML:
-             *   <a href="http://www.sun.com/access">Accessibility</a>
+             * as appropriate for that link.
+             * <p>
+             * E.g. from HTML:
+             *   &lt;a href="http://openjdk.java.net"&gt;OpenJDK&lt;/a&gt;
              * this method would return a String containing the text:
-             * 'Accessibility'.
-             *
+             * 'OpenJDK'.
+             * <p>
              * Similarly, from this HTML:
              *   &lt;a HREF="#top"&gt;&lt;img src="top-hat.gif" alt="top hat"&gt;&lt;/a&gt;
              * this might return the object ImageIcon("top-hat.gif", "top hat");
--- a/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java	Wed Nov 01 10:00:38 2017 -0700
@@ -59,27 +59,32 @@
  * <caption>Possible JFormattedTextField configurations and their descriptions
  * </caption>
  * <thead>
- * <tr><th>Value</th>
- * <th>Description</th></tr>
+ *   <tr>
+ *     <th scope="col">Value
+ *     <th scope="col">Description
  * </thead>
  * <tbody>
- * <tr><td>JFormattedTextField.REVERT
- *            <td>Revert the display to match that of <code>getValue</code>,
- *                possibly losing the current edit.
- *        <tr><td>JFormattedTextField.COMMIT
- *            <td>Commits the current value. If the value being edited
- *                isn't considered a legal value by the
- *                <code>AbstractFormatter</code> that is, a
- *                <code>ParseException</code> is thrown, then the value
- *                will not change, and then edited value will persist.
- *        <tr><td>JFormattedTextField.COMMIT_OR_REVERT
- *            <td>Similar to <code>COMMIT</code>, but if the value isn't
- *                legal, behave like <code>REVERT</code>.
- *        <tr><td>JFormattedTextField.PERSIST
- *            <td>Do nothing, don't obtain a new
- *                <code>AbstractFormatter</code>, and don't update the value.
+ *   <tr>
+ *     <th scope="row">JFormattedTextField.REVERT
+ *     <td>Revert the display to match that of {@code getValue}, possibly losing
+ *     the current edit.
+ *   <tr>
+ *     <th scope="row">JFormattedTextField.COMMIT
+ *     <td>Commits the current value. If the value being edited isn't considered
+ *     a legal value by the {@code AbstractFormatter} that is, a
+ *     {@code ParseException} is thrown, then the value will not change, and
+ *     then edited value will persist.
+ *   <tr>
+ *     <th scope="row">JFormattedTextField.COMMIT_OR_REVERT
+ *     <td>Similar to {@code COMMIT}, but if the value isn't legal, behave like
+ *     {@code REVERT}.
+ *   <tr>
+ *     <th scope="row">JFormattedTextField.PERSIST
+ *     <td>Do nothing, don't obtain a new {@code AbstractFormatter}, and don't
+ *     update the value.
  * </tbody>
  * </table>
+ *
  * The default is <code>JFormattedTextField.COMMIT_OR_REVERT</code>,
  * refer to {@link #setFocusLostBehavior} for more information on this.
  * <p>
--- a/src/java.desktop/share/classes/javax/swing/JList.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/JList.java	Wed Nov 01 10:00:38 2017 -0700
@@ -968,25 +968,30 @@
      * <caption>Describes layouts VERTICAL,HORIZONTAL_WRAP, and VERTICAL_WRAP
      * </caption>
      * <thead>
-     *   <tr><th>Value</th><th>Description</th></tr>
+     *   <tr>
+     *     <th scope="col">Value
+     *     <th scope="col">Description
      * </thead>
      * <tbody>
-     *   <tr><td><code>VERTICAL</code>
-     *       <td>Cells are layed out vertically in a single column.
-     *   <tr><td><code>HORIZONTAL_WRAP</code>
-     *       <td>Cells are layed out horizontally, wrapping to a new row as
-     *           necessary. If the {@code visibleRowCount} property is less than
-     *           or equal to zero, wrapping is determined by the width of the
-     *           list; otherwise wrapping is done in such a way as to ensure
-     *           {@code visibleRowCount} rows in the list.
-     *   <tr><td><code>VERTICAL_WRAP</code>
-     *       <td>Cells are layed out vertically, wrapping to a new column as
-     *           necessary. If the {@code visibleRowCount} property is less than
-     *           or equal to zero, wrapping is determined by the height of the
-     *           list; otherwise wrapping is done at {@code visibleRowCount} rows.
+     *   <tr>
+     *     <th scope="row">{@code VERTICAL}
+     *     <td>Cells are layed out vertically in a single column.
+     *   <tr>
+     *     <th scope="row">{@code HORIZONTAL_WRAP}
+     *     <td>Cells are layed out horizontally, wrapping to a new row as
+     *     necessary. If the {@code visibleRowCount} property is less than or
+     *     equal to zero, wrapping is determined by the width of the list;
+     *     otherwise wrapping is done in such a way as to ensure
+     *     {@code visibleRowCount} rows in the list.
+     *   <tr>
+     *     <th scope="row">{@code VERTICAL_WRAP}
+     *     <td>Cells are layed out vertically, wrapping to a new column as
+     *     necessary. If the {@code visibleRowCount} property is less than or
+     *     equal to zero, wrapping is determined by the height of the list;
+     *     otherwise wrapping is done at {@code visibleRowCount} rows.
      * </tbody>
      * </table>
-     * <p>
+     *
      * The default value of this property is <code>VERTICAL</code>.
      *
      * @param layoutOrientation the new layout orientation, one of:
--- a/src/java.desktop/share/classes/javax/swing/JOptionPane.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/JOptionPane.java	Wed Nov 01 10:00:38 2017 -0700
@@ -71,37 +71,30 @@
  * class may appear complex because of the large number of methods, almost
  * all uses of this class are one-line calls to one of the static
  * <code>showXxxDialog</code> methods shown below:
- * <blockquote>
  *
  * <table class="striped">
  * <caption>Common JOptionPane method names and their descriptions</caption>
  * <thead>
- * <tr>
- *    <th>Method Name</th>
- *    <th>Description</th>
- * </tr>
+ *   <tr>
+ *     <th scope="col">Method Name
+ *     <th scope="col">Description
  * </thead>
  * <tbody>
- * <tr>
- *    <td>showConfirmDialog</td>
- *    <td>Asks a confirming question, like yes/no/cancel.</td>
- * </tr>
- * <tr>
- *    <td>showInputDialog</td>
- *    <td>Prompt for some input.</td>
- * </tr>
- * <tr>
- *   <td>showMessageDialog</td>
- *   <td>Tell the user about something that has happened.</td>
- * </tr>
- * <tr>
- *   <td>showOptionDialog</td>
- *   <td>The Grand Unification of the above three.</td>
- * </tr>
+ *   <tr>
+ *     <th scope="row">showConfirmDialog
+ *     <td>Asks a confirming question, like yes/no/cancel.</td>
+ *   <tr>
+ *     <th scope="row">showInputDialog
+ *     <td>Prompt for some input.
+ *   <tr>
+ *     <th scope="row">showMessageDialog
+ *     <td>Tell the user about something that has happened.
+ *   <tr>
+ *     <th scope="row">showOptionDialog
+ *     <td>The Grand Unification of the above three.
  * </tbody>
  * </table>
  *
- * </blockquote>
  * Each of these methods also comes in a <code>showInternalXXX</code>
  * flavor, which uses an internal frame to hold the dialog box (see
  * {@link JInternalFrame}).
@@ -148,7 +141,7 @@
  * in which case a default <code>Frame</code> is used as the parent,
  * and the dialog will be
  * centered on the screen (depending on the {@literal L&F}).
- * <dt><a id=message>message</a><dd>
+ * <dt>message<dd>
  * A descriptive message to be placed in the dialog box.
  * In the most common usage, message is just a <code>String</code> or
  * <code>String</code> constant.
--- a/src/java.desktop/share/classes/javax/swing/SpinnerNumberModel.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/SpinnerNumberModel.java	Wed Nov 01 10:00:38 2017 -0700
@@ -260,8 +260,7 @@
      * as the <code>value</code> however it's possible to use any
      * <code>Comparable</code> with a <code>compareTo</code>
      * method for a <code>Number</code> with the same type as the value.
-     * See <a href="#setMinimum(java.lang.Comparable)">
-     * <code>setMinimum</code></a> for an example.
+     * See {@link #setMinimum(Comparable)} for an example.
      * <p>
      * This method fires a <code>ChangeEvent</code> if the
      * <code>maximum</code> has changed.
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java	Wed Nov 01 10:00:38 2017 -0700
@@ -588,52 +588,53 @@
      * <caption>Describes the preferred size for each layout orientation
      * </caption>
      * <thead>
-     * <tr><th>Layout Orientation</th><th>Preferred Size</th></tr>
+     *   <tr>
+     *     <th scope="col">Layout Orientation
+     *     <th scope="col">Preferred Size
      * </thead>
      * <tbody>
-     * <tr>
-     *   <td>JList.VERTICAL
-     *   <td>The preferredSize of the list is total height of the rows
-     *       and the maximum width of the cells.  If JList.fixedCellHeight
-     *       is specified then the total height of the rows is just
-     *       (cellVerticalMargins + fixedCellHeight) * model.getSize() where
-     *       rowVerticalMargins is the space we allocate for drawing
-     *       the yellow focus outline.  Similarly if fixedCellWidth is
-     *       specified then we just use that.
-     *   </td>
-     * <tr>
-     *   <td>JList.VERTICAL_WRAP
-     *   <td>If the visible row count is greater than zero, the preferredHeight
-     *       is the maximum cell height * visibleRowCount. If the visible row
-     *       count is &lt;= 0, the preferred height is either the current height
-     *       of the list, or the maximum cell height, whichever is
-     *       bigger. The preferred width is than the maximum cell width *
-     *       number of columns needed. Where the number of columns needs is
-     *       list.height / max cell height. Max cell height is either the fixed
-     *       cell height, or is determined by iterating through all the cells
-     *       to find the maximum height from the ListCellRenderer.
-     * <tr>
-     *   <td>JList.HORIZONTAL_WRAP
-     *   <td>If the visible row count is greater than zero, the preferredHeight
-     *       is the maximum cell height * adjustedRowCount.  Where
-     *       visibleRowCount is used to determine the number of columns.
-     *       Because this lays out horizontally the number of rows is
-     *       then determined from the column count.  For example, lets say
-     *       you have a model with 10 items and the visible row count is 8.
-     *       The number of columns needed to display this is 2, but you no
-     *       longer need 8 rows to display this, you only need 5, thus
-     *       the adjustedRowCount is 5.
-     *       <p>If the visible row
-     *       count is &lt;= 0, the preferred height is dictated by the
-     *       number of columns, which will be as many as can fit in the width
-     *       of the <code>JList</code> (width / max cell width), with at
-     *       least one column.  The preferred height then becomes the
-     *       model size / number of columns * maximum cell height.
-     *       Max cell height is either the fixed
-     *       cell height, or is determined by iterating through all the cells
-     *       to find the maximum height from the ListCellRenderer.
+     *   <tr>
+     *     <th scope="row">JList.VERTICAL
+     *     <td>The preferredSize of the list is total height of the rows
+     *     and the maximum width of the cells. If JList.fixedCellHeight
+     *     is specified then the total height of the rows is just
+     *     (cellVerticalMargins + fixedCellHeight) * model.getSize() where
+     *     rowVerticalMargins is the space we allocate for drawing
+     *     the yellow focus outline. Similarly if fixedCellWidth is
+     *     specified then we just use that.
+     *   <tr>
+     *     <th scope="row">JList.VERTICAL_WRAP
+     *     <td>If the visible row count is greater than zero, the preferredHeight
+     *     is the maximum cell height * visibleRowCount. If the visible row
+     *     count is &lt;= 0, the preferred height is either the current height
+     *     of the list, or the maximum cell height, whichever is
+     *     bigger. The preferred width is than the maximum cell width *
+     *     number of columns needed. Where the number of columns needs is
+     *     list.height / max cell height. Max cell height is either the fixed
+     *     cell height, or is determined by iterating through all the cells
+     *     to find the maximum height from the ListCellRenderer.
+     *   <tr>
+     *     <th scope="row">JList.HORIZONTAL_WRAP
+     *     <td>If the visible row count is greater than zero, the preferredHeight
+     *     is the maximum cell height * adjustedRowCount. Where
+     *     visibleRowCount is used to determine the number of columns.
+     *     Because this lays out horizontally the number of rows is
+     *     then determined from the column count. For example, lets say
+     *     you have a model with 10 items and the visible row count is 8.
+     *     The number of columns needed to display this is 2, but you no
+     *     longer need 8 rows to display this, you only need 5, thus
+     *     the adjustedRowCount is 5.
+     *     <p>
+     *     If the visible row count is &lt;= 0, the preferred height is dictated
+     *     by the number of columns, which will be as many as can fit in the
+     *     width of the {@code JList} (width / max cell width), with at least
+     *     one column. The preferred height then becomes the model size / number
+     *     of columns * maximum cell height. Max cell height is either the fixed
+     *     cell height, or is determined by iterating through all the cells to
+     *     find the maximum height from the ListCellRenderer.
      * </tbody>
      * </table>
+     *
      * The above specifies the raw preferred width and height. The resulting
      * preferred width is the above width + insets.left + insets.right and
      * the resulting preferred height is the above height + insets.top +
--- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java	Wed Nov 01 10:00:38 2017 -0700
@@ -295,87 +295,87 @@
      * <caption>Metal's system color mapping</caption>
      * <thead>
      *  <tr>
-     *    <th>Key
-     *    <th>Value
+     *    <th scope="col">Key
+     *    <th scope="col">Value
      * </thead>
      * <tbody>
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"desktop"
+     *  <tr>
+     *    <th scope="row">"desktop"
      *    <td>{@code theme.getDesktopColor()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"activeCaption"
+     *  <tr>
+     *    <th scope="row">"activeCaption"
      *    <td>{@code theme.getWindowTitleBackground()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"activeCaptionText"
+     *  <tr>
+     *    <th scope="row">"activeCaptionText"
      *    <td>{@code theme.getWindowTitleForeground()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"activeCaptionBorder"
+     *  <tr>
+     *    <th scope="row">"activeCaptionBorder"
      *    <td>{@code theme.getPrimaryControlShadow()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"inactiveCaption"
+     *  <tr>
+     *    <th scope="row">"inactiveCaption"
      *    <td>{@code theme.getWindowTitleInactiveBackground()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"inactiveCaptionText"
+     *  <tr>
+     *    <th scope="row">"inactiveCaptionText"
      *    <td>{@code theme.getWindowTitleInactiveForeground()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"inactiveCaptionBorder"
+     *  <tr>
+     *    <th scope="row">"inactiveCaptionBorder"
      *    <td>{@code theme.getControlShadow()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"window"
+     *  <tr>
+     *    <th scope="row">"window"
      *    <td>{@code theme.getWindowBackground()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"windowBorder"
+     *  <tr>
+     *    <th scope="row">"windowBorder"
      *    <td>{@code theme.getControl()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"windowText"
+     *  <tr>
+     *    <th scope="row">"windowText"
      *    <td>{@code theme.getUserTextColor()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"menu"
+     *  <tr>
+     *    <th scope="row">"menu"
      *    <td>{@code theme.getMenuBackground()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"menuText"
+     *  <tr>
+     *    <th scope="row">"menuText"
      *    <td>{@code theme.getMenuForeground()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"text"
+     *  <tr>
+     *    <th scope="row">"text"
      *    <td>{@code theme.getWindowBackground()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"textText"
+     *  <tr>
+     *    <th scope="row">"textText"
      *    <td>{@code theme.getUserTextColor()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"textHighlight"
+     *  <tr>
+     *    <th scope="row">"textHighlight"
      *    <td>{@code theme.getTextHighlightColor()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"textHighlightText"
+     *  <tr>
+     *    <th scope="row">"textHighlightText"
      *    <td>{@code theme.getHighlightedTextColor()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"textInactiveText"
+     *  <tr>
+     *    <th scope="row">"textInactiveText"
      *    <td>{@code theme.getInactiveSystemTextColor()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"control"
+     *  <tr>
+     *    <th scope="row">"control"
      *    <td>{@code theme.getControl()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"controlText"
+     *  <tr>
+     *    <th scope="row">"controlText"
      *    <td>{@code theme.getControlTextColor()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"controlHighlight"
+     *  <tr>
+     *    <th scope="row">"controlHighlight"
      *    <td>{@code theme.getControlHighlight()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"controlLtHighlight"
+     *  <tr>
+     *    <th scope="row">"controlLtHighlight"
      *    <td>{@code theme.getControlHighlight()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"controlShadow"
+     *  <tr>
+     *    <th scope="row">"controlShadow"
      *    <td>{@code theme.getControlShadow()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"controlDkShadow"
+     *  <tr>
+     *    <th scope="row">"controlDkShadow"
      *    <td>{@code theme.getControlDarkShadow()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"scrollbar"
+     *  <tr>
+     *    <th scope="row">"scrollbar"
      *    <td>{@code theme.getControl()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"info"
+     *  <tr>
+     *    <th scope="row">"info"
      *    <td>{@code theme.getPrimaryControl()}
-     *  <tr valign="top" style="text-align:left">
-     *    <td>"infoText"
+     *  <tr>
+     *    <th scope="row">"infoText"
      *    <td>{@code theme.getPrimaryControlInfo()}
      * </tbody>
      * </table>
--- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalTreeUI.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalTreeUI.java	Wed Nov 01 10:00:38 2017 -0700
@@ -47,24 +47,25 @@
  * <table class="striped">
  * <caption>Descriptions of supported hints: Angled, Horizontal, and None
  * </caption>
- *  <tr>
- *    <th>Angled</th>
- *    <td>A line is drawn connecting the child to the parent. For handling
- *          of the root node refer to
- *          {@link javax.swing.JTree#setRootVisible} and
- *          {@link javax.swing.JTree#setShowsRootHandles}.
- *    </td>
- *  </tr>
- *  <tr>
- *     <th>Horizontal</th>
- *     <td>A horizontal line is drawn dividing the children of the root node.</td>
- *  </tr>
- *  <tr>
- *      <th>None</th>
- *      <td>Do not draw any visual indication between nodes.</td>
- *  </tr>
+ * <thead>
+ *   <tr>
+ *     <th scope="col">Hint
+ *     <th scope="col">Description
+ * </thead>
+ * <tbody>
+ *   <tr>
+ *     <th scope="row">Angled
+ *     <td>A line is drawn connecting the child to the parent. For handling of
+ *     the root node refer to {@link JTree#setRootVisible} and
+ *     {@link JTree#setShowsRootHandles}.
+ *   <tr>
+ *     <th scope="row">Horizontal
+ *     <td>A horizontal line is drawn dividing the children of the root node.
+ *   <tr>
+ *     <th scope="row">None
+ *     <td>Do not draw any visual indication between nodes.
+ * </tbody>
  * </table>
- *
  * <p>
  * As it is typically impractical to obtain the <code>TreeUI</code> from
  * the <code>JTree</code> and cast to an instance of <code>MetalTreeUI</code>
--- a/src/java.desktop/share/classes/javax/swing/text/DefaultCaret.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/text/DefaultCaret.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -352,6 +352,7 @@
                 setVisible(true);
             }
             setSelectionVisible(true);
+            updateSystemSelection();
         }
     }
 
@@ -365,7 +366,9 @@
      */
     public void focusLost(FocusEvent e) {
         setVisible(false);
-        setSelectionVisible(ownsSelection || e.isTemporary());
+        setSelectionVisible((e.getCause() == FocusEvent.Cause.ACTIVATION ||
+                e.getOppositeComponent() instanceof JRootPane) &&
+                (ownsSelection || e.isTemporary()));
     }
 
 
@@ -866,7 +869,6 @@
                     Highlighter.HighlightPainter p = getSelectionPainter();
                     try {
                         selectionTag = h.addHighlight(p0, p1, p);
-                        updateOwnsSelection();
                     } catch (BadLocationException bl) {
                         selectionTag = null;
                     }
@@ -877,7 +879,6 @@
                     Highlighter h = component.getHighlighter();
                     h.removeHighlight(selectionTag);
                     selectionTag = null;
-                    updateOwnsSelection();
                 }
             }
         }
@@ -1119,7 +1120,6 @@
                     if (selectionTag != null) {
                         h.removeHighlight(selectionTag);
                         selectionTag = null;
-                        updateOwnsSelection();
                     }
                 // otherwise, change or add the highlight
                 } else {
@@ -1130,7 +1130,6 @@
                             Highlighter.HighlightPainter p = getSelectionPainter();
                             selectionTag = h.addHighlight(p0, p1, p);
                         }
-                        updateOwnsSelection();
                     } catch (BadLocationException e) {
                         throw new StateInvariantError("Bad caret position");
                     }
@@ -1181,7 +1180,6 @@
         if (this.dot != dot || this.dotBias != dotBias ||
             selectionTag != null || forceCaretPositionChange) {
             changeCaretPosition(dot, dotBias);
-            updateOwnsSelection();
         }
         this.markBias = this.dotBias;
         this.markLTR = dotLTR;
@@ -1189,7 +1187,6 @@
         if ((h != null) && (selectionTag != null)) {
             h.removeHighlight(selectionTag);
             selectionTag = null;
-            updateOwnsSelection();
         }
     }
 
@@ -1940,13 +1937,6 @@
         }
     }
 
-    /**
-     * Updates ownsSelection based on text selection in the caret.
-     */
-    private void updateOwnsSelection() {
-        ownsSelection = (selectionTag != null)
-                && SwingUtilities2.canAccessSystemClipboard();
-    }
 
     private class DefaultFilterBypass extends NavigationFilter.FilterBypass {
         public Caret getCaret() {
--- a/src/java.desktop/share/classes/javax/swing/text/Document.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/text/Document.java	Wed Nov 01 10:00:38 2017 -0700
@@ -146,10 +146,10 @@
  * <p>
  * The methods related to observing mutations to the document are:
  * <ul>
- * <li><a href="#addDocumentListener(javax.swing.event.DocumentListener)">addDocumentListener(DocumentListener)</a>
- * <li><a href="#removeDocumentListener(javax.swing.event.DocumentListener)">removeDocumentListener(DocumentListener)</a>
- * <li><a href="#addUndoableEditListener(javax.swing.event.UndoableEditListener)">addUndoableEditListener(UndoableEditListener)</a>
- * <li><a href="#removeUndoableEditListener(javax.swing.event.UndoableEditListener)">removeUndoableEditListener(UndoableEditListener)</a>
+ *   <li>{@link #addDocumentListener(DocumentListener)}
+ *   <li>{@link #removeDocumentListener(DocumentListener)}
+ *   <li>{@link #addUndoableEditListener(UndoableEditListener)}
+ *   <li>{@link #removeUndoableEditListener(UndoableEditListener)}
  * </ul>
  *
  * <p><b>Properties</b>
--- a/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java	Wed Nov 01 10:00:38 2017 -0700
@@ -160,34 +160,39 @@
  * <table class="striped">
  * <caption>Stages of keyboard and input method event handling</caption>
  * <thead>
- * <tr>
- * <th id="stage">Stage</th>
- * <th id="ke">KeyEvent</th>
- * <th id="ime">InputMethodEvent</th></tr>
+ *   <tr>
+ *     <th scope="col">Stage
+ *     <th scope="col">KeyEvent
+ *     <th scope="col">InputMethodEvent
  * </thead>
  * <tbody>
- * <tr><td headers="stage">1.   </td>
- *     <td headers="ke">input methods </td>
- *     <td headers="ime">(generated here)</td></tr>
- * <tr><td headers="stage">2.   </td>
- *     <td headers="ke">focus manager </td>
- *     <td headers="ime"></td>
- * </tr>
- * <tr>
- *     <td headers="stage">3.   </td>
- *     <td headers="ke">registered key listeners</td>
- *     <td headers="ime">registered input method listeners</tr>
- * <tr>
- *     <td headers="stage">4.   </td>
- *     <td headers="ke"></td>
- *     <td headers="ime">input method handling in JTextComponent</tr>
- * <tr>
- *     <td headers="stage">5.   </td><td headers="ke ime" colspan=2>keymap handling using the current keymap</td></tr>
- * <tr><td headers="stage">6.   </td><td headers="ke">keyboard handling in JComponent (e.g. accelerators, component navigation, etc.)</td>
- *     <td headers="ime"></td></tr>
+ *   <tr>
+ *     <th scope="row">1.
+ *     <td>input methods
+ *     <td>(generated here)
+ *   <tr>
+ *     <th scope="row" headers="stage">2.
+ *     <td>focus manager
+ *     <td>
+ *   </tr>
+ *   <tr>
+ *     <th scope="row">3.
+ *     <td>registered key listeners
+ *     <td>registered input method listeners
+ *   <tr>
+ *     <th scope="row">4.
+ *     <td>
+ *     <td>input method handling in JTextComponent
+ *   <tr>
+ *     <th scope="row">5.
+ *     <td colspan=2>keymap handling using the current keymap
+ *   <tr>
+ *     <th scope="row">6.
+ *     <td>keyboard handling in JComponent (e.g. accelerators, component
+ *     navigation, etc.)
+ *     <td>
  * </tbody>
  * </table>
- *
  * <p>
  * To maintain compatibility with applications that listen to key
  * events but are not aware of input method events, the input
--- a/src/java.desktop/share/classes/javax/swing/text/MaskFormatter.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/text/MaskFormatter.java	Wed Nov 01 10:00:38 2017 -0700
@@ -40,36 +40,39 @@
  * <table class="striped">
  * <caption>Valid characters and their descriptions</caption>
  * <thead>
- * <tr>
- *    <th>Character&nbsp;</th>
- *    <th>Description</th>
- * </tr>
+ *   <tr>
+ *     <th scope="col">Character
+ *     <th scope="col">Description
  * </thead>
  * <tbody>
- * <tr>
- *    <td>#</td>
- *    <td>Any valid number, uses <code>Character.isDigit</code>.</td>
- * </tr>
- * <tr>
- *    <td>'</td>
- *    <td>Escape character, used to escape any of the
- *       special formatting characters.</td>
- * </tr>
- * <tr>
- *    <td>U</td><td>Any character (<code>Character.isLetter</code>). All
- *        lowercase letters are mapped to upper case.</td>
- * </tr>
- * <tr><td>L</td><td>Any character (<code>Character.isLetter</code>). All
- *        upper case letters are mapped to lower case.</td>
- * </tr>
- * <tr><td>A</td><td>Any character or number (<code>Character.isLetter</code>
- *       or <code>Character.isDigit</code>)</td>
- * </tr>
- * <tr><td>?</td><td>Any character
- *        (<code>Character.isLetter</code>).</td>
- * </tr>
- * <tr><td>*</td><td>Anything.</td></tr>
- * <tr><td>H</td><td>Any hex character (0-9, a-f or A-F).</td></tr>
+ *   <tr>
+ *     <th scope="row">#
+ *     <td>Any valid number, uses {@code Character.isDigit}.
+ *   <tr>
+ *     <th scope="row">'
+ *     <td>Escape character, used to escape any of the special formatting
+ *     characters.
+ *   <tr>
+ *     <th scope="row">U
+ *     <td>Any character ({@code Character.isLetter}). All lowercase letters are
+ *     mapped to upper case.
+ *   <tr>
+ *     <th scope="row">L
+ *     <td>Any character ({@code Character.isLetter}). All upper case letters
+ *     are mapped to lower case.
+ *   <tr>
+ *     <th scope="row">A
+ *     <td>Any character or number ({@code Character.isLetter} or
+ *     {@code Character.isDigit}).
+ *   <tr>
+ *     <th scope="row">?
+ *     <td>Any character ({@code Character.isLetter}).
+ *   <tr>
+ *     <th scope="row">*
+ *     <td>Anything.
+ *   <tr>
+ *     <th scope="row">H
+ *     <td>Any hex character (0-9, a-f or A-F).
  * </tbody>
  * </table>
  *
--- a/src/java.desktop/share/classes/javax/swing/text/html/FormView.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/text/html/FormView.java	Wed Nov 01 10:00:38 2017 -0700
@@ -50,60 +50,47 @@
  * <table class="striped">
  * <caption>Shows what components get built by this view</caption>
  * <thead>
- * <tr>
- *   <th>Element Type</th>
- *   <th>Component built</th>
- * </tr>
+ *   <tr>
+ *     <th scope="col">Element Type
+ *     <th scope="col">Component built
  * </thead>
  * <tbody>
- * <tr>
- *   <td>input, type button</td>
- *   <td>JButton</td>
- * </tr>
- * <tr>
- *   <td>input, type checkbox</td>
- *   <td>JCheckBox</td>
- * </tr>
- * <tr>
- *   <td>input, type image</td>
- *   <td>JButton</td>
- * </tr>
- * <tr>
- *   <td>input, type password</td>
- *   <td>JPasswordField</td>
- * </tr>
- * <tr>
- *   <td>input, type radio</td>
- *   <td>JRadioButton</td>
- * </tr>
- * <tr>
- *   <td>input, type reset</td>
- *   <td>JButton</td>
- * </tr>
- * <tr>
- *   <td>input, type submit</td>
- *   <td>JButton</td>
- * </tr>
- * <tr>
- *   <td>input, type text</td>
- *   <td>JTextField</td>
- * </tr>
- * <tr>
- *   <td>select, size &gt; 1 or multiple attribute defined</td>
- *   <td>JList in a JScrollPane</td>
- * </tr>
- * <tr>
- *   <td>select, size unspecified or 1</td>
- *   <td>JComboBox</td>
- * </tr>
- * <tr>
- *   <td>textarea</td>
- *   <td>JTextArea in a JScrollPane</td>
- * </tr>
- * <tr>
- *   <td>input, type file</td>
- *   <td>JTextField</td>
- * </tr>
+ *   <tr>
+ *     <th scope="row">input, type button
+ *     <td>JButton
+ *   <tr>
+ *     <th scope="row">input, type checkbox
+ *     <td>JCheckBox
+ *   <tr>
+ *     <th scope="row">input, type image
+ *     <td>JButton
+ *   <tr>
+ *     <th scope="row">input, type password
+ *     <td>JPasswordField
+ *   <tr>
+ *     <th scope="row">input, type radio
+ *     <td>JRadioButton
+ *   <tr>
+ *     <th scope="row">input, type reset
+ *     <td>JButton
+ *   <tr>
+ *     <th scope="row">input, type submit
+ *     <td>JButton
+ *   <tr>
+ *     <th scope="row">input, type text
+ *     <td>JTextField
+ *   <tr>
+ *     <th scope="row">select, size &gt; 1 or multiple attribute defined
+ *     <td>JList in a JScrollPane
+ *   <tr>
+ *     <th scope="row">select, size unspecified or 1
+ *     <td>JComboBox
+ *   <tr>
+ *     <th scope="row">textarea
+ *     <td>JTextArea in a JScrollPane
+ *   <tr>
+ *     <th scope="row">input, type file
+ *     <td>JTextField
  * </tbody>
  * </table>
  *
--- a/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java	Wed Nov 01 10:00:38 2017 -0700
@@ -2134,81 +2134,227 @@
      * <table class="striped">
      * <caption>HTML tags and assigned actions</caption>
      * <thead>
-     * <tr><th>Tag</th><th>Action</th></tr>
+     *   <tr>
+     *     <th scope="col">Tag
+     *     <th scope="col">Action
      * </thead>
      * <tbody>
-     * <tr><td><code>HTML.Tag.A</code>         <td>CharacterAction
-     * <tr><td><code>HTML.Tag.ADDRESS</code>   <td>CharacterAction
-     * <tr><td><code>HTML.Tag.APPLET</code>    <td>HiddenAction
-     * <tr><td><code>HTML.Tag.AREA</code>      <td>AreaAction
-     * <tr><td><code>HTML.Tag.B</code>         <td>CharacterAction
-     * <tr><td><code>HTML.Tag.BASE</code>      <td>BaseAction
-     * <tr><td><code>HTML.Tag.BASEFONT</code>  <td>CharacterAction
-     * <tr><td><code>HTML.Tag.BIG</code>       <td>CharacterAction
-     * <tr><td><code>HTML.Tag.BLOCKQUOTE</code><td>BlockAction
-     * <tr><td><code>HTML.Tag.BODY</code>      <td>BlockAction
-     * <tr><td><code>HTML.Tag.BR</code>        <td>SpecialAction
-     * <tr><td><code>HTML.Tag.CAPTION</code>   <td>BlockAction
-     * <tr><td><code>HTML.Tag.CENTER</code>    <td>BlockAction
-     * <tr><td><code>HTML.Tag.CITE</code>      <td>CharacterAction
-     * <tr><td><code>HTML.Tag.CODE</code>      <td>CharacterAction
-     * <tr><td><code>HTML.Tag.DD</code>        <td>BlockAction
-     * <tr><td><code>HTML.Tag.DFN</code>       <td>CharacterAction
-     * <tr><td><code>HTML.Tag.DIR</code>       <td>BlockAction
-     * <tr><td><code>HTML.Tag.DIV</code>       <td>BlockAction
-     * <tr><td><code>HTML.Tag.DL</code>        <td>BlockAction
-     * <tr><td><code>HTML.Tag.DT</code>        <td>ParagraphAction
-     * <tr><td><code>HTML.Tag.EM</code>        <td>CharacterAction
-     * <tr><td><code>HTML.Tag.FONT</code>      <td>CharacterAction
-     * <tr><td><code>HTML.Tag.FORM</code>      <td>As of 1.4 a BlockAction
-     * <tr><td><code>HTML.Tag.FRAME</code>     <td>SpecialAction
-     * <tr><td><code>HTML.Tag.FRAMESET</code>  <td>BlockAction
-     * <tr><td><code>HTML.Tag.H1</code>        <td>ParagraphAction
-     * <tr><td><code>HTML.Tag.H2</code>        <td>ParagraphAction
-     * <tr><td><code>HTML.Tag.H3</code>        <td>ParagraphAction
-     * <tr><td><code>HTML.Tag.H4</code>        <td>ParagraphAction
-     * <tr><td><code>HTML.Tag.H5</code>        <td>ParagraphAction
-     * <tr><td><code>HTML.Tag.H6</code>        <td>ParagraphAction
-     * <tr><td><code>HTML.Tag.HEAD</code>      <td>HeadAction
-     * <tr><td><code>HTML.Tag.HR</code>        <td>SpecialAction
-     * <tr><td><code>HTML.Tag.HTML</code>      <td>BlockAction
-     * <tr><td><code>HTML.Tag.I</code>         <td>CharacterAction
-     * <tr><td><code>HTML.Tag.IMG</code>       <td>SpecialAction
-     * <tr><td><code>HTML.Tag.INPUT</code>     <td>FormAction
-     * <tr><td><code>HTML.Tag.ISINDEX</code>   <td>IsndexAction
-     * <tr><td><code>HTML.Tag.KBD</code>       <td>CharacterAction
-     * <tr><td><code>HTML.Tag.LI</code>        <td>BlockAction
-     * <tr><td><code>HTML.Tag.LINK</code>      <td>LinkAction
-     * <tr><td><code>HTML.Tag.MAP</code>       <td>MapAction
-     * <tr><td><code>HTML.Tag.MENU</code>      <td>BlockAction
-     * <tr><td><code>HTML.Tag.META</code>      <td>MetaAction
-     * <tr><td><code>HTML.Tag.NOFRAMES</code>  <td>BlockAction
-     * <tr><td><code>HTML.Tag.OBJECT</code>    <td>SpecialAction
-     * <tr><td><code>HTML.Tag.OL</code>        <td>BlockAction
-     * <tr><td><code>HTML.Tag.OPTION</code>    <td>FormAction
-     * <tr><td><code>HTML.Tag.P</code>         <td>ParagraphAction
-     * <tr><td><code>HTML.Tag.PARAM</code>     <td>HiddenAction
-     * <tr><td><code>HTML.Tag.PRE</code>       <td>PreAction
-     * <tr><td><code>HTML.Tag.SAMP</code>      <td>CharacterAction
-     * <tr><td><code>HTML.Tag.SCRIPT</code>    <td>HiddenAction
-     * <tr><td><code>HTML.Tag.SELECT</code>    <td>FormAction
-     * <tr><td><code>HTML.Tag.SMALL</code>     <td>CharacterAction
-     * <tr><td><code>HTML.Tag.STRIKE</code>    <td>CharacterAction
-     * <tr><td><code>HTML.Tag.S</code>         <td>CharacterAction
-     * <tr><td><code>HTML.Tag.STRONG</code>    <td>CharacterAction
-     * <tr><td><code>HTML.Tag.STYLE</code>     <td>StyleAction
-     * <tr><td><code>HTML.Tag.SUB</code>       <td>CharacterAction
-     * <tr><td><code>HTML.Tag.SUP</code>       <td>CharacterAction
-     * <tr><td><code>HTML.Tag.TABLE</code>     <td>BlockAction
-     * <tr><td><code>HTML.Tag.TD</code>        <td>BlockAction
-     * <tr><td><code>HTML.Tag.TEXTAREA</code>  <td>FormAction
-     * <tr><td><code>HTML.Tag.TH</code>        <td>BlockAction
-     * <tr><td><code>HTML.Tag.TITLE</code>     <td>TitleAction
-     * <tr><td><code>HTML.Tag.TR</code>        <td>BlockAction
-     * <tr><td><code>HTML.Tag.TT</code>        <td>CharacterAction
-     * <tr><td><code>HTML.Tag.U</code>         <td>CharacterAction
-     * <tr><td><code>HTML.Tag.UL</code>        <td>BlockAction
-     * <tr><td><code>HTML.Tag.VAR</code>       <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.A}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.ADDRESS}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.APPLET}
+     *     <td>HiddenAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.AREA}
+     *     <td>AreaAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.B}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.BASE}
+     *     <td>BaseAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.BASEFONT}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.BIG}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.BLOCKQUOTE}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.BODY}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.BR}
+     *     <td>SpecialAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.CAPTION}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.CENTER}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.CITE}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.CODE}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.DD}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.DFN}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.DIR}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.DIV}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.DL}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.DT}
+     *     <td>ParagraphAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.EM}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.FONT}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.FORM}
+     *     <td>As of 1.4 a BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.FRAME}
+     *     <td>SpecialAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.FRAMESET}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.H1}
+     *     <td>ParagraphAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.H2}
+     *     <td>ParagraphAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.H3}
+     *     <td>ParagraphAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.H4}
+     *     <td>ParagraphAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.H5}
+     *     <td>ParagraphAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.H6}
+     *     <td>ParagraphAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.HEAD}
+     *     <td>HeadAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.HR}
+     *     <td>SpecialAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.HTML}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.I}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.IMG}
+     *     <td>SpecialAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.INPUT}
+     *     <td>FormAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.ISINDEX}
+     *     <td>IsndexAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.KBD}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.LI}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.LINK}
+     *     <td>LinkAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.MAP}
+     *     <td>MapAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.MENU}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.META}
+     *     <td>MetaAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.NOFRAMES}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.OBJECT}
+     *     <td>SpecialAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.OL}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.OPTION}
+     *     <td>FormAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.P}
+     *     <td>ParagraphAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.PARAM}
+     *     <td>HiddenAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.PRE}
+     *     <td>PreAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.SAMP}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.SCRIPT}
+     *     <td>HiddenAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.SELECT}
+     *     <td>FormAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.SMALL}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.STRIKE}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.S}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.STRONG}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.STYLE}
+     *     <td>StyleAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.SUB}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.SUP}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.TABLE}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.TD}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.TEXTAREA}
+     *     <td>FormAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.TH}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.TITLE}
+     *     <td>TitleAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.TR}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.TT}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.U}
+     *     <td>CharacterAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.UL}
+     *     <td>BlockAction
+     *   <tr>
+     *     <th scope="row">{@code HTML.Tag.VAR}
+     *     <td>CharacterAction
      * </tbody>
      * </table>
      * <p>
@@ -3397,45 +3543,44 @@
          * <caption>Model assignments for the various types of form elements
          * </caption>
          * <thead>
-         * <tr>
-         *   <th>Element Type
-         *   <th>Model Type
-         * </tr>
+         *   <tr>
+         *     <th scope="col">Element Type
+         *     <th scope="col">Model Type
          * </thead>
          * <tbody>
-         * <tr>
-         *   <td>input, type button
-         *   <td>{@link DefaultButtonModel}
-         * <tr>
-         *   <td>input, type checkbox
-         *   <td>{@link javax.swing.JToggleButton.ToggleButtonModel}
-         * <tr>
-         *   <td>input, type image
-         *   <td>{@link DefaultButtonModel}
-         * <tr>
-         *   <td>input, type password
-         *   <td>{@link PlainDocument}
-         * <tr>
-         *   <td>input, type radio
-         *   <td>{@link javax.swing.JToggleButton.ToggleButtonModel}
-         * <tr>
-         *   <td>input, type reset
-         *   <td>{@link DefaultButtonModel}
-         * <tr>
-         *   <td>input, type submit
-         *   <td>{@link DefaultButtonModel}
-         * <tr>
-         *   <td>input, type text or type is null.
-         *   <td>{@link PlainDocument}
-         * <tr>
-         *   <td>select
-         *   <td>{@link DefaultComboBoxModel} or an {@link DefaultListModel}, with an item type of Option
-         * <tr>
-         *   <td>textarea
-         *   <td>{@link PlainDocument}
+         *   <tr>
+         *     <th scope="row">input, type button
+         *     <td>{@link DefaultButtonModel}
+         *   <tr>
+         *     <th scope="row">input, type checkbox
+         *     <td>{@link JToggleButton.ToggleButtonModel}
+         *   <tr>
+         *     <th scope="row">input, type image
+         *     <td>{@link DefaultButtonModel}
+         *   <tr>
+         *     <th scope="row">input, type password
+         *     <td>{@link PlainDocument}
+         *   <tr>
+         *     <th scope="row">input, type radio
+         *     <td>{@link JToggleButton.ToggleButtonModel}
+         *   <tr>
+         *     <th scope="row">input, type reset
+         *     <td>{@link DefaultButtonModel}
+         *   <tr>
+         *     <th scope="row">input, type submit
+         *     <td>{@link DefaultButtonModel}
+         *   <tr>
+         *     <th scope="row">input, type text or type is null.
+         *     <td>{@link PlainDocument}
+         *   <tr>
+         *     <th scope="row">select
+         *     <td>{@link DefaultComboBoxModel} or an {@link DefaultListModel},
+         *     with an item type of Option
+         *   <tr>
+         *     <td>textarea
+         *     <td>{@link PlainDocument}
          * </tbody>
          * </table>
-         *
          */
         public class FormAction extends SpecialAction {
 
--- a/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1122,83 +1122,116 @@
      * <caption>Describes the tag and view created by this factory by default
      * </caption>
      * <thead>
-     * <tr>
-     * <th>Tag
-     * <th>View created
-     * </tr>
+     *   <tr>
+     *     <th scope="col">Tag
+     *     <th scope="col">View created
      * </thead>
      * <tbody>
-     * <tr>
-     * <td>HTML.Tag.CONTENT<td>InlineView
-     * </tr><tr>
-     * <td>HTML.Tag.IMPLIED<td>javax.swing.text.html.ParagraphView
-     * </tr><tr>
-     * <td>HTML.Tag.P<td>javax.swing.text.html.ParagraphView
-     * </tr><tr>
-     * <td>HTML.Tag.H1<td>javax.swing.text.html.ParagraphView
-     * </tr><tr>
-     * <td>HTML.Tag.H2<td>javax.swing.text.html.ParagraphView
-     * </tr><tr>
-     * <td>HTML.Tag.H3<td>javax.swing.text.html.ParagraphView
-     * </tr><tr>
-     * <td>HTML.Tag.H4<td>javax.swing.text.html.ParagraphView
-     * </tr><tr>
-     * <td>HTML.Tag.H5<td>javax.swing.text.html.ParagraphView
-     * </tr><tr>
-     * <td>HTML.Tag.H6<td>javax.swing.text.html.ParagraphView
-     * </tr><tr>
-     * <td>HTML.Tag.DT<td>javax.swing.text.html.ParagraphView
-     * </tr><tr>
-     * <td>HTML.Tag.MENU<td>ListView
-     * </tr><tr>
-     * <td>HTML.Tag.DIR<td>ListView
-     * </tr><tr>
-     * <td>HTML.Tag.UL<td>ListView
-     * </tr><tr>
-     * <td>HTML.Tag.OL<td>ListView
-     * </tr><tr>
-     * <td>HTML.Tag.LI<td>BlockView
-     * </tr><tr>
-     * <td>HTML.Tag.DL<td>BlockView
-     * </tr><tr>
-     * <td>HTML.Tag.DD<td>BlockView
-     * </tr><tr>
-     * <td>HTML.Tag.BODY<td>BlockView
-     * </tr><tr>
-     * <td>HTML.Tag.HTML<td>BlockView
-     * </tr><tr>
-     * <td>HTML.Tag.CENTER<td>BlockView
-     * </tr><tr>
-     * <td>HTML.Tag.DIV<td>BlockView
-     * </tr><tr>
-     * <td>HTML.Tag.BLOCKQUOTE<td>BlockView
-     * </tr><tr>
-     * <td>HTML.Tag.PRE<td>BlockView
-     * </tr><tr>
-     * <td>HTML.Tag.BLOCKQUOTE<td>BlockView
-     * </tr><tr>
-     * <td>HTML.Tag.PRE<td>BlockView
-     * </tr><tr>
-     * <td>HTML.Tag.IMG<td>ImageView
-     * </tr><tr>
-     * <td>HTML.Tag.HR<td>HRuleView
-     * </tr><tr>
-     * <td>HTML.Tag.BR<td>BRView
-     * </tr><tr>
-     * <td>HTML.Tag.TABLE<td>javax.swing.text.html.TableView
-     * </tr><tr>
-     * <td>HTML.Tag.INPUT<td>FormView
-     * </tr><tr>
-     * <td>HTML.Tag.SELECT<td>FormView
-     * </tr><tr>
-     * <td>HTML.Tag.TEXTAREA<td>FormView
-     * </tr><tr>
-     * <td>HTML.Tag.OBJECT<td>ObjectView
-     * </tr><tr>
-     * <td>HTML.Tag.FRAMESET<td>FrameSetView
-     * </tr><tr>
-     * <td>HTML.Tag.FRAME<td>FrameView
-     * </tr>
+     *   <tr>
+     *     <th scope="row">HTML.Tag.CONTENT
+     *     <td>InlineView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.IMPLIED
+     *     <td>javax.swing.text.html.ParagraphView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.P
+     *     <td>javax.swing.text.html.ParagraphView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.H1
+     *     <td>javax.swing.text.html.ParagraphView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.H2
+     *     <td>javax.swing.text.html.ParagraphView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.H3
+     *     <td>javax.swing.text.html.ParagraphView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.H4
+     *     <td>javax.swing.text.html.ParagraphView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.H5
+     *     <td>javax.swing.text.html.ParagraphView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.H6
+     *     <td>javax.swing.text.html.ParagraphView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.DT
+     *     <td>javax.swing.text.html.ParagraphView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.MENU
+     *     <td>ListView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.DIR
+     *     <td>ListView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.UL
+     *     <td>ListView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.OL
+     *     <td>ListView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.LI
+     *     <td>BlockView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.DL
+     *     <td>BlockView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.DD
+     *     <td>BlockView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.BODY
+     *     <td>BlockView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.HTML
+     *     <td>BlockView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.CENTER
+     *     <td>BlockView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.DIV
+     *     <td>BlockView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.BLOCKQUOTE
+     *     <td>BlockView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.PRE
+     *     <td>BlockView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.BLOCKQUOTE
+     *     <td>BlockView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.PRE
+     *     <td>BlockView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.IMG
+     *     <td>ImageView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.HR
+     *     <td>HRuleView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.BR
+     *     <td>BRView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.TABLE
+     *     <td>javax.swing.text.html.TableView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.INPUT
+     *     <td>FormView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.SELECT
+     *     <td>FormView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.TEXTAREA
+     *     <td>FormView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.OBJECT
+     *     <td>ObjectView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.FRAMESET
+     *     <td>FrameSetView
+     *   <tr>
+     *     <th scope="row">HTML.Tag.FRAME
+     *     <td>FrameView
      * </tbody>
      * </table>
      */
--- a/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java	Wed Nov 01 10:00:38 2017 -0700
@@ -65,19 +65,35 @@
  * <caption>Properties</caption>
  * <thead>
  *   <tr>
- *     <th>Property:
- *     <th>Key:
+ *     <th scope="col">Property
+ *     <th scope="col">Key
  *   </tr>
  * </thead>
  * <tbody>
- *   <tr><td>"leafIcon"<td>"Tree.leafIcon"
- *   <tr><td>"closedIcon"<td>"Tree.closedIcon"
- *   <tr><td>"openIcon"<td>"Tree.openIcon"
- *   <tr><td>"textSelectionColor"<td>"Tree.selectionForeground"
- *   <tr><td>"textNonSelectionColor"<td>"Tree.textForeground"
- *   <tr><td>"backgroundSelectionColor"<td>"Tree.selectionBackground"
- *   <tr><td>"backgroundNonSelectionColor"<td>"Tree.textBackground"
- *   <tr><td>"borderSelectionColor"<td>"Tree.selectionBorderColor"
+ *   <tr>
+ *     <th scope="row">"leafIcon"
+ *     <td>"Tree.leafIcon"
+ *   <tr>
+ *     <th scope="row">"closedIcon"
+ *     <td>"Tree.closedIcon"
+ *   <tr>
+ *     <th scope="row">"openIcon"
+ *     <td>"Tree.openIcon"
+ *   <tr>
+ *     <th scope="row">"textSelectionColor"
+ *     <td>"Tree.selectionForeground"
+ *   <tr>
+ *     <th scope="row">"textNonSelectionColor"
+ *     <td>"Tree.textForeground"
+ *   <tr>
+ *     <th scope="row">"backgroundSelectionColor"
+ *     <td>"Tree.selectionBackground"
+ *   <tr>
+ *     <th scope="row">"backgroundNonSelectionColor"
+ *     <td>"Tree.textBackground"
+ *   <tr>
+ *     <th scope="row">"borderSelectionColor"
+ *     <td>"Tree.selectionBorderColor"
  * </tbody>
  * </table>
  * <p>
--- a/src/java.desktop/share/classes/sun/awt/AWTAccessor.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/share/classes/sun/awt/AWTAccessor.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -291,26 +291,6 @@
      */
     public interface WindowAccessor {
         /*
-         * Get opacity level of the given window.
-         */
-        float getOpacity(Window window);
-        /*
-         * Set opacity level to the given window.
-         */
-        void setOpacity(Window window, float opacity);
-        /*
-         * Get a shape assigned to the given window.
-         */
-        Shape getShape(Window window);
-        /*
-         * Set a shape to the given window.
-         */
-        void setShape(Window window, Shape shape);
-        /*
-         * Set the opaque preoperty to the given window.
-         */
-        void setOpaque(Window window, boolean isOpaque);
-        /*
          * Update the image of a non-opaque (translucent) window.
          */
         void updateWindow(Window window);
--- a/src/java.desktop/unix/classes/sun/awt/X11/XDragSourceContextPeer.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XDragSourceContextPeer.java	Wed Nov 01 10:00:38 2017 -0700
@@ -38,6 +38,7 @@
 
 import java.util.*;
 
+import sun.java2d.pipe.Region;
 import sun.util.logging.PlatformLogger;
 
 import sun.awt.dnd.SunDragSourceContextPeer;
@@ -811,10 +812,10 @@
     }
 
     public int scaleUp(int x) {
-        return x * windowScale;
+        return Region.clipRound(x * (double)windowScale);
     }
 
     public int scaleDown(int x) {
-        return x / windowScale;
+        return Region.clipRound(x / (double)windowScale);
     }
 }
--- a/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,41 +22,135 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package sun.awt.X11;
 
-import java.awt.peer.TaskbarPeer;
-import java.awt.*;
-import java.awt.event.InputEvent;
-import java.awt.event.MouseEvent;
-import java.awt.event.KeyEvent;
+import java.awt.AWTError;
+import java.awt.AWTException;
+import java.awt.Button;
+import java.awt.Canvas;
+import java.awt.Checkbox;
+import java.awt.CheckboxMenuItem;
+import java.awt.Choice;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.Desktop;
+import java.awt.Dialog;
+import java.awt.Dimension;
+import java.awt.EventQueue;
+import java.awt.FileDialog;
+import java.awt.Frame;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
+import java.awt.Image;
+import java.awt.Insets;
+import java.awt.JobAttributes;
+import java.awt.Label;
+import java.awt.Menu;
+import java.awt.MenuBar;
+import java.awt.MenuItem;
+import java.awt.PageAttributes;
+import java.awt.Panel;
+import java.awt.Point;
+import java.awt.PopupMenu;
+import java.awt.PrintJob;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.ScrollPane;
+import java.awt.Scrollbar;
+import java.awt.SystemColor;
+import java.awt.SystemTray;
+import java.awt.Taskbar;
+import java.awt.TextArea;
+import java.awt.TextField;
+import java.awt.Toolkit;
+import java.awt.TrayIcon;
+import java.awt.Window;
 import java.awt.datatransfer.Clipboard;
+import java.awt.dnd.DragGestureEvent;
+import java.awt.dnd.DragGestureListener;
+import java.awt.dnd.DragGestureRecognizer;
 import java.awt.dnd.DragSource;
-import java.awt.dnd.DragGestureListener;
-import java.awt.dnd.DragGestureEvent;
-import java.awt.dnd.DragGestureRecognizer;
+import java.awt.dnd.InvalidDnDOperationException;
 import java.awt.dnd.MouseDragGestureRecognizer;
-import java.awt.dnd.InvalidDnDOperationException;
 import java.awt.dnd.peer.DragSourceContextPeer;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
 import java.awt.font.TextAttribute;
 import java.awt.im.InputMethodHighlight;
 import java.awt.im.spi.InputMethodDescriptor;
-import java.awt.peer.*;
+import java.awt.peer.ButtonPeer;
+import java.awt.peer.CanvasPeer;
+import java.awt.peer.CheckboxMenuItemPeer;
+import java.awt.peer.CheckboxPeer;
+import java.awt.peer.ChoicePeer;
+import java.awt.peer.DesktopPeer;
+import java.awt.peer.DialogPeer;
+import java.awt.peer.FileDialogPeer;
+import java.awt.peer.FontPeer;
+import java.awt.peer.FramePeer;
+import java.awt.peer.KeyboardFocusManagerPeer;
+import java.awt.peer.LabelPeer;
+import java.awt.peer.ListPeer;
+import java.awt.peer.MenuBarPeer;
+import java.awt.peer.MenuItemPeer;
+import java.awt.peer.MenuPeer;
+import java.awt.peer.MouseInfoPeer;
+import java.awt.peer.PanelPeer;
+import java.awt.peer.PopupMenuPeer;
+import java.awt.peer.RobotPeer;
+import java.awt.peer.ScrollPanePeer;
+import java.awt.peer.ScrollbarPeer;
+import java.awt.peer.SystemTrayPeer;
+import java.awt.peer.TaskbarPeer;
+import java.awt.peer.TextAreaPeer;
+import java.awt.peer.TextFieldPeer;
+import java.awt.peer.TrayIconPeer;
+import java.awt.peer.WindowPeer;
 import java.beans.PropertyChangeListener;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Properties;
+import java.util.Set;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.Vector;
+
 import javax.swing.LookAndFeel;
 import javax.swing.UIDefaults;
-import sun.awt.*;
+
+import sun.awt.AWTAccessor;
+import sun.awt.AWTPermissions;
+import sun.awt.AppContext;
+import sun.awt.DisplayChangedListener;
+import sun.awt.LightweightFrame;
+import sun.awt.SunToolkit;
+import sun.awt.UNIXToolkit;
+import sun.awt.X11GraphicsConfig;
+import sun.awt.X11GraphicsDevice;
+import sun.awt.X11GraphicsEnvironment;
+import sun.awt.XSettings;
 import sun.awt.datatransfer.DataTransferer;
+import sun.awt.util.PerformanceLogger;
+import sun.awt.util.ThreadGroupUtils;
 import sun.font.FontConfigManager;
 import sun.java2d.SunGraphicsEnvironment;
-import sun.awt.util.PerformanceLogger;
-import sun.awt.util.ThreadGroupUtils;
 import sun.print.PrintJob2D;
+import sun.security.action.GetBooleanAction;
 import sun.security.action.GetPropertyAction;
-import sun.security.action.GetBooleanAction;
 import sun.util.logging.PlatformLogger;
+
 import static sun.awt.X11.XlibUtil.scaleDown;
 
 public final class XToolkit extends UNIXToolkit implements Runnable {
@@ -2587,7 +2681,7 @@
     @Override
     public boolean isWindowTranslucencySupported() {
         //NOTE: it may not be supported. The actual check is being performed
-        //      at com.sun.awt.AWTUtilities(). In X11 we need to check
+        //      at java.awt.GraphicsDevice. In X11 we need to check
         //      whether there's any translucency-capable GC available.
         return true;
     }
--- a/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,42 +22,50 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package sun.awt.X11;
 
-import java.awt.*;
-
+import java.awt.AWTEvent;
+import java.awt.Component;
+import java.awt.Dialog;
+import java.awt.Dimension;
+import java.awt.EventQueue;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.Image;
+import java.awt.Insets;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.SystemColor;
+import java.awt.Window;
 import java.awt.event.ComponentEvent;
 import java.awt.event.FocusEvent;
 import java.awt.event.WindowEvent;
-import java.awt.geom.AffineTransform;
-
 import java.awt.peer.ComponentPeer;
 import java.awt.peer.WindowPeer;
-
 import java.io.UnsupportedEncodingException;
-
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
 import java.util.Vector;
-
 import java.util.concurrent.atomic.AtomicBoolean;
 
+import sun.awt.AWTAccessor;
 import sun.awt.AWTAccessor.ComponentAccessor;
-import sun.util.logging.PlatformLogger;
-
-import sun.awt.AWTAccessor;
 import sun.awt.DisplayChangedListener;
+import sun.awt.IconInfo;
 import sun.awt.SunToolkit;
 import sun.awt.X11GraphicsDevice;
 import sun.awt.X11GraphicsEnvironment;
-import sun.awt.IconInfo;
-
 import sun.java2d.pipe.Region;
+import sun.util.logging.PlatformLogger;
 
 class XWindowPeer extends XPanelPeer implements WindowPeer,
                                                 DisplayChangedListener {
@@ -446,16 +454,14 @@
     }
 
     private void updateShape() {
-        // Shape shape = ((Window)target).getShape();
-        Shape shape = AWTAccessor.getWindowAccessor().getShape((Window)target);
+        Shape shape = ((Window)target).getShape();
         if (shape != null) {
             applyShape(Region.getInstance(shape, null));
         }
     }
 
     private void updateOpacity() {
-        // float opacity = ((Window)target).getOpacity();
-        float opacity = AWTAccessor.getWindowAccessor().getOpacity((Window)target);
+        float opacity = ((Window)target).getOpacity();
         if (opacity < 1.0f) {
             setOpacity(opacity);
         }
@@ -2375,7 +2381,7 @@
     public void print(Graphics g) {
         // We assume we print the whole frame,
         // so we expect no clip was set previously
-        Shape shape = AWTAccessor.getWindowAccessor().getShape((Window)target);
+        Shape shape = ((Window)target).getShape();
         if (shape != null) {
             g.setClip(shape);
         }
--- a/src/java.desktop/unix/classes/sun/awt/X11/XlibUtil.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XlibUtil.java	Wed Nov 01 10:00:38 2017 -0700
@@ -38,6 +38,8 @@
 import sun.awt.X11GraphicsDevice;
 import sun.awt.X11GraphicsEnvironment;
 
+import sun.java2d.pipe.Region;
+
 /*
  * This class is a collection of utility methods that operate
  * with native windows.
@@ -414,6 +416,6 @@
     }
 
     static int scaleDown(int x, int scale) {
-        return x / scale;
+        return Region.clipRound(x / (double)scale);
     }
 }
--- a/src/java.desktop/unix/classes/sun/awt/X11GraphicsConfig.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/unix/classes/sun/awt/X11GraphicsConfig.java	Wed Nov 01 10:00:38 2017 -0700
@@ -49,6 +49,7 @@
 import sun.java2d.loops.RenderLoops;
 import sun.java2d.loops.SurfaceType;
 import sun.java2d.loops.CompositeType;
+import sun.java2d.pipe.Region;
 import sun.java2d.x11.X11SurfaceData;
 import sun.awt.image.OffScreenImage;
 import sun.awt.image.SunVolatileImage;
@@ -265,11 +266,11 @@
     }
 
     public int scaleUp(int x) {
-        return x * getScale();
+        return Region.clipRound(x * (double)getScale());
     }
 
     public int scaleDown(int x) {
-        return x / getScale();
+        return Region.clipRound(x / (double)getScale());
     }
 
     /**
--- a/src/java.desktop/unix/legal/fontconfig.md	Wed Nov 01 16:45:28 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-## Fontconfig v2.5
-
-### Fontconfig License
-<pre>
-
-Copyright 2001,2003 Keith Packard
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that the
-above copyright notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting documentation, and that
-the name of Keith Packard not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior permission.
-Keith Packard makes no representations about the suitability of this software
-for any purpose.  It is provided "as is" without express or implied warranty.
-
-KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL KEITH
-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
-DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-</pre>
--- a/src/java.desktop/unix/native/common/awt/fontconfig.h	Wed Nov 01 16:45:28 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,941 +0,0 @@
-/*
- * $RCSId: xc/lib/fontconfig/fontconfig/fontconfig.h,v 1.30 2002/09/26 00:17:27 keithp Exp $
- *
- * Copyright © 2001 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  Keith Packard makes no
- * representations about the suitability of this software for any purpose.  It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _FONTCONFIG_H_
-#define _FONTCONFIG_H_
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <stdarg.h>
-
-#if defined(__GNUC__) && (__GNUC__ >= 4)
-#define FC_ATTRIBUTE_SENTINEL(x) __attribute__((__sentinel__(0)))
-#else
-#define FC_ATTRIBUTE_SENTINEL(x)
-#endif
-
-#ifndef FcPublic
-#define FcPublic
-#endif
-
-typedef unsigned char   FcChar8;
-typedef unsigned short  FcChar16;
-typedef unsigned int    FcChar32;
-typedef int             FcBool;
-
-/*
- * Current Fontconfig version number.  This same number
- * must appear in the fontconfig configure.in file. Yes,
- * it'a a pain to synchronize version numbers like this.
- */
-
-#define FC_MAJOR        2
-#define FC_MINOR        5
-#define FC_REVISION     0
-
-#define FC_VERSION      ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION))
-
-/*
- * Current font cache file format version
- * This is appended to the cache files so that multiple
- * versions of the library will peacefully coexist
- *
- * Change this value whenever the disk format for the cache file
- * changes in any non-compatible way.  Try to avoid such changes as
- * it means multiple copies of the font information.
- */
-
-#define FC_CACHE_VERSION    "2"
-
-#define FcTrue          1
-#define FcFalse         0
-
-#define FC_FAMILY           "family"            /* String */
-#define FC_STYLE            "style"             /* String */
-#define FC_SLANT            "slant"             /* Int */
-#define FC_WEIGHT           "weight"            /* Int */
-#define FC_SIZE             "size"              /* Double */
-#define FC_ASPECT           "aspect"            /* Double */
-#define FC_PIXEL_SIZE       "pixelsize"         /* Double */
-#define FC_SPACING          "spacing"           /* Int */
-#define FC_FOUNDRY          "foundry"           /* String */
-#define FC_ANTIALIAS        "antialias"         /* Bool (depends) */
-#define FC_HINTING          "hinting"           /* Bool (true) */
-#define FC_HINT_STYLE       "hintstyle"         /* Int */
-#define FC_VERTICAL_LAYOUT  "verticallayout"    /* Bool (false) */
-#define FC_AUTOHINT         "autohint"          /* Bool (false) */
-#define FC_GLOBAL_ADVANCE   "globaladvance"     /* Bool (true) */
-#define FC_WIDTH            "width"             /* Int */
-#define FC_FILE             "file"              /* String */
-#define FC_INDEX            "index"             /* Int */
-#define FC_FT_FACE          "ftface"            /* FT_Face */
-#define FC_RASTERIZER       "rasterizer"        /* String */
-#define FC_OUTLINE          "outline"           /* Bool */
-#define FC_SCALABLE         "scalable"          /* Bool */
-#define FC_SCALE            "scale"             /* double */
-#define FC_DPI              "dpi"               /* double */
-#define FC_RGBA             "rgba"              /* Int */
-#define FC_MINSPACE         "minspace"          /* Bool use minimum line spacing */
-#define FC_SOURCE           "source"            /* String (deprecated) */
-#define FC_CHARSET          "charset"           /* CharSet */
-#define FC_LANG             "lang"              /* String RFC 3066 langs */
-#define FC_FONTVERSION      "fontversion"       /* Int from 'head' table */
-#define FC_FULLNAME         "fullname"          /* String */
-#define FC_FAMILYLANG       "familylang"        /* String RFC 3066 langs */
-#define FC_STYLELANG        "stylelang"         /* String RFC 3066 langs */
-#define FC_FULLNAMELANG     "fullnamelang"      /* String RFC 3066 langs */
-#define FC_CAPABILITY       "capability"        /* String */
-#define FC_FONTFORMAT       "fontformat"        /* String */
-#define FC_EMBOLDEN         "embolden"          /* Bool - true if emboldening needed*/
-#define FC_EMBEDDED_BITMAP  "embeddedbitmap"    /* Bool - true to enable embedded bitmaps */
-#define FC_DECORATIVE       "decorative"        /* Bool - true if style is a decorative variant */
-
-#define FC_CACHE_SUFFIX             ".cache-"FC_CACHE_VERSION
-#define FC_DIR_CACHE_FILE           "fonts.cache-"FC_CACHE_VERSION
-#define FC_USER_CACHE_FILE          ".fonts.cache-"FC_CACHE_VERSION
-
-/* Adjust outline rasterizer */
-#define FC_CHAR_WIDTH       "charwidth" /* Int */
-#define FC_CHAR_HEIGHT      "charheight"/* Int */
-#define FC_MATRIX           "matrix"    /* FcMatrix */
-
-#define FC_WEIGHT_THIN              0
-#define FC_WEIGHT_EXTRALIGHT        40
-#define FC_WEIGHT_ULTRALIGHT        FC_WEIGHT_EXTRALIGHT
-#define FC_WEIGHT_LIGHT             50
-#define FC_WEIGHT_BOOK              75
-#define FC_WEIGHT_REGULAR           80
-#define FC_WEIGHT_NORMAL            FC_WEIGHT_REGULAR
-#define FC_WEIGHT_MEDIUM            100
-#define FC_WEIGHT_DEMIBOLD          180
-#define FC_WEIGHT_SEMIBOLD          FC_WEIGHT_DEMIBOLD
-#define FC_WEIGHT_BOLD              200
-#define FC_WEIGHT_EXTRABOLD         205
-#define FC_WEIGHT_ULTRABOLD         FC_WEIGHT_EXTRABOLD
-#define FC_WEIGHT_BLACK             210
-#define FC_WEIGHT_HEAVY             FC_WEIGHT_BLACK
-#define FC_WEIGHT_EXTRABLACK        215
-#define FC_WEIGHT_ULTRABLACK        FC_WEIGHT_EXTRABLACK
-
-#define FC_SLANT_ROMAN              0
-#define FC_SLANT_ITALIC             100
-#define FC_SLANT_OBLIQUE            110
-
-#define FC_WIDTH_ULTRACONDENSED     50
-#define FC_WIDTH_EXTRACONDENSED     63
-#define FC_WIDTH_CONDENSED          75
-#define FC_WIDTH_SEMICONDENSED      87
-#define FC_WIDTH_NORMAL             100
-#define FC_WIDTH_SEMIEXPANDED       113
-#define FC_WIDTH_EXPANDED           125
-#define FC_WIDTH_EXTRAEXPANDED      150
-#define FC_WIDTH_ULTRAEXPANDED      200
-
-#define FC_PROPORTIONAL             0
-#define FC_DUAL                     90
-#define FC_MONO                     100
-#define FC_CHARCELL                 110
-
-/* sub-pixel order */
-#define FC_RGBA_UNKNOWN     0
-#define FC_RGBA_RGB         1
-#define FC_RGBA_BGR         2
-#define FC_RGBA_VRGB        3
-#define FC_RGBA_VBGR        4
-#define FC_RGBA_NONE        5
-
-/* hinting style */
-#define FC_HINT_NONE        0
-#define FC_HINT_SLIGHT      1
-#define FC_HINT_MEDIUM      2
-#define FC_HINT_FULL        3
-
-typedef enum _FcType {
-    FcTypeVoid,
-    FcTypeInteger,
-    FcTypeDouble,
-    FcTypeString,
-    FcTypeBool,
-    FcTypeMatrix,
-    FcTypeCharSet,
-    FcTypeFTFace,
-    FcTypeLangSet
-} FcType;
-
-typedef struct _FcMatrix {
-    double xx, xy, yx, yy;
-} FcMatrix;
-
-#define FcMatrixInit(m) ((m)->xx = (m)->yy = 1, \
-                         (m)->xy = (m)->yx = 0)
-
-/*
- * A data structure to represent the available glyphs in a font.
- * This is represented as a sparse boolean btree.
- */
-
-typedef struct _FcCharSet FcCharSet;
-
-typedef struct _FcObjectType {
-    const char  *object;
-    FcType      type;
-} FcObjectType;
-
-typedef struct _FcConstant {
-    const FcChar8  *name;
-    const char  *object;
-    int         value;
-} FcConstant;
-
-typedef enum _FcResult {
-    FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId,
-    FcResultOutOfMemory
-} FcResult;
-
-typedef struct _FcPattern   FcPattern;
-
-typedef struct _FcLangSet   FcLangSet;
-
-typedef struct _FcValue {
-    FcType      type;
-    union {
-        const FcChar8   *s;
-        int             i;
-        FcBool          b;
-        double          d;
-        const FcMatrix  *m;
-        const FcCharSet *c;
-        void            *f;
-        const FcLangSet *l;
-    } u;
-} FcValue;
-
-typedef struct _FcFontSet {
-    int         nfont;
-    int         sfont;
-    FcPattern   **fonts;
-} FcFontSet;
-
-typedef struct _FcObjectSet {
-    int         nobject;
-    int         sobject;
-    const char  **objects;
-} FcObjectSet;
-
-typedef enum _FcMatchKind {
-    FcMatchPattern, FcMatchFont, FcMatchScan
-} FcMatchKind;
-
-typedef enum _FcLangResult {
-    FcLangEqual = 0,
-    FcLangDifferentCountry = 1,
-    FcLangDifferentTerritory = 1,
-    FcLangDifferentLang = 2
-} FcLangResult;
-
-typedef enum _FcSetName {
-    FcSetSystem = 0,
-    FcSetApplication = 1
-} FcSetName;
-
-typedef struct _FcAtomic FcAtomic;
-
-#if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
-#define _FCFUNCPROTOBEGIN extern "C" {  /* do not leave open across includes */
-#define _FCFUNCPROTOEND }
-#else
-#define _FCFUNCPROTOBEGIN
-#define _FCFUNCPROTOEND
-#endif
-
-typedef enum { FcEndianBig, FcEndianLittle } FcEndian;
-
-typedef struct _FcConfig    FcConfig;
-
-typedef struct _FcGlobalCache   FcFileCache;
-
-typedef struct _FcBlanks    FcBlanks;
-
-typedef struct _FcStrList   FcStrList;
-
-typedef struct _FcStrSet    FcStrSet;
-
-typedef struct _FcCache     FcCache;
-
-_FCFUNCPROTOBEGIN
-
-/* fcblanks.c */
-FcPublic FcBlanks *
-FcBlanksCreate (void);
-
-FcPublic void
-FcBlanksDestroy (FcBlanks *b);
-
-FcPublic FcBool
-FcBlanksAdd (FcBlanks *b, FcChar32 ucs4);
-
-FcPublic FcBool
-FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4);
-
-/* fccache.c */
-
-FcPublic const FcChar8 *
-FcCacheDir(const FcCache *c);
-
-FcPublic FcFontSet *
-FcCacheCopySet(const FcCache *c);
-
-FcPublic const FcChar8 *
-FcCacheSubdir (const FcCache *c, int i);
-
-FcPublic int
-FcCacheNumSubdir (const FcCache *c);
-
-FcPublic int
-FcCacheNumFont (const FcCache *c);
-
-FcPublic FcBool
-FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config);
-
-FcPublic FcBool
-FcDirCacheValid (const FcChar8 *cache_file);
-
-/* fccfg.c */
-FcPublic FcChar8 *
-FcConfigHome (void);
-
-FcPublic FcBool
-FcConfigEnableHome (FcBool enable);
-
-FcPublic FcChar8 *
-FcConfigFilename (const FcChar8 *url);
-
-FcPublic FcConfig *
-FcConfigCreate (void);
-
-FcPublic void
-FcConfigDestroy (FcConfig *config);
-
-FcPublic FcBool
-FcConfigSetCurrent (FcConfig *config);
-
-FcPublic FcConfig *
-FcConfigGetCurrent (void);
-
-FcPublic FcBool
-FcConfigUptoDate (FcConfig *config);
-
-FcPublic FcBool
-FcConfigBuildFonts (FcConfig *config);
-
-FcPublic FcStrList *
-FcConfigGetFontDirs (FcConfig   *config);
-
-FcPublic FcStrList *
-FcConfigGetConfigDirs (FcConfig   *config);
-
-FcPublic FcStrList *
-FcConfigGetConfigFiles (FcConfig    *config);
-
-FcPublic FcChar8 *
-FcConfigGetCache (FcConfig  *config);
-
-FcPublic FcBlanks *
-FcConfigGetBlanks (FcConfig *config);
-
-FcPublic FcStrList *
-FcConfigGetCacheDirs (FcConfig  *config);
-
-FcPublic int
-FcConfigGetRescanInterval (FcConfig *config);
-
-FcPublic FcBool
-FcConfigSetRescanInterval (FcConfig *config, int rescanInterval);
-
-FcPublic FcFontSet *
-FcConfigGetFonts (FcConfig      *config,
-                  FcSetName     set);
-
-FcPublic FcBool
-FcConfigAppFontAddFile (FcConfig    *config,
-                        const FcChar8  *file);
-
-FcPublic FcBool
-FcConfigAppFontAddDir (FcConfig     *config,
-                       const FcChar8   *dir);
-
-FcPublic void
-FcConfigAppFontClear (FcConfig      *config);
-
-FcPublic FcBool
-FcConfigSubstituteWithPat (FcConfig     *config,
-                           FcPattern    *p,
-                           FcPattern    *p_pat,
-                           FcMatchKind  kind);
-
-FcPublic FcBool
-FcConfigSubstitute (FcConfig    *config,
-                    FcPattern   *p,
-                    FcMatchKind kind);
-
-/* fccharset.c */
-FcPublic FcCharSet*
-FcCharSetCreate (void);
-
-/* deprecated alias for FcCharSetCreate */
-FcPublic FcCharSet *
-FcCharSetNew (void);
-
-FcPublic void
-FcCharSetDestroy (FcCharSet *fcs);
-
-FcPublic FcBool
-FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4);
-
-FcPublic FcCharSet*
-FcCharSetCopy (FcCharSet *src);
-
-FcPublic FcBool
-FcCharSetEqual (const FcCharSet *a, const FcCharSet *b);
-
-FcPublic FcCharSet*
-FcCharSetIntersect (const FcCharSet *a, const FcCharSet *b);
-
-FcPublic FcCharSet*
-FcCharSetUnion (const FcCharSet *a, const FcCharSet *b);
-
-FcPublic FcCharSet*
-FcCharSetSubtract (const FcCharSet *a, const FcCharSet *b);
-
-FcPublic FcBool
-FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4);
-
-FcPublic FcChar32
-FcCharSetCount (const FcCharSet *a);
-
-FcPublic FcChar32
-FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b);
-
-FcPublic FcChar32
-FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b);
-
-FcPublic FcBool
-FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b);
-
-#define FC_CHARSET_MAP_SIZE (256/32)
-#define FC_CHARSET_DONE ((FcChar32) -1)
-
-FcPublic FcChar32
-FcCharSetFirstPage (const FcCharSet *a,
-                    FcChar32        map[FC_CHARSET_MAP_SIZE],
-                    FcChar32        *next);
-
-FcPublic FcChar32
-FcCharSetNextPage (const FcCharSet  *a,
-                   FcChar32         map[FC_CHARSET_MAP_SIZE],
-                   FcChar32         *next);
-
-/*
- * old coverage API, rather hard to use correctly
- */
-
-FcPublic FcChar32
-FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result);
-
-/* fcdbg.c */
-FcPublic void
-FcValuePrint (const FcValue v);
-
-FcPublic void
-FcPatternPrint (const FcPattern *p);
-
-FcPublic void
-FcFontSetPrint (const FcFontSet *s);
-
-/* fcdefault.c */
-FcPublic void
-FcDefaultSubstitute (FcPattern *pattern);
-
-/* fcdir.c */
-FcPublic FcBool
-FcFileIsDir (const FcChar8 *file);
-
-FcPublic FcBool
-FcFileScan (FcFontSet       *set,
-            FcStrSet        *dirs,
-            FcFileCache     *cache,
-            FcBlanks        *blanks,
-            const FcChar8   *file,
-            FcBool          force);
-
-FcPublic FcBool
-FcDirScan (FcFontSet        *set,
-           FcStrSet         *dirs,
-           FcFileCache      *cache,
-           FcBlanks         *blanks,
-           const FcChar8    *dir,
-           FcBool           force);
-
-FcPublic FcBool
-FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
-
-FcPublic FcCache *
-FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file);
-
-FcPublic FcCache *
-FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config);
-
-FcPublic FcCache *
-FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat);
-
-FcPublic void
-FcDirCacheUnload (FcCache *cache);
-
-/* fcfreetype.c */
-FcPublic FcPattern *
-FcFreeTypeQuery (const FcChar8 *file, int id, FcBlanks *blanks, int *count);
-
-/* fcfs.c */
-
-FcPublic FcFontSet *
-FcFontSetCreate (void);
-
-FcPublic void
-FcFontSetDestroy (FcFontSet *s);
-
-FcPublic FcBool
-FcFontSetAdd (FcFontSet *s, FcPattern *font);
-
-/* fcinit.c */
-FcPublic FcConfig *
-FcInitLoadConfig (void);
-
-FcPublic FcConfig *
-FcInitLoadConfigAndFonts (void);
-
-FcPublic FcBool
-FcInit (void);
-
-FcPublic void
-FcFini (void);
-
-FcPublic int
-FcGetVersion (void);
-
-FcPublic FcBool
-FcInitReinitialize (void);
-
-FcPublic FcBool
-FcInitBringUptoDate (void);
-
-/* fclang.c */
-FcPublic FcStrSet *
-FcGetLangs (void);
-
-FcPublic const FcCharSet *
-FcLangGetCharSet (const FcChar8 *lang);
-
-FcPublic FcLangSet*
-FcLangSetCreate (void);
-
-FcPublic void
-FcLangSetDestroy (FcLangSet *ls);
-
-FcPublic FcLangSet*
-FcLangSetCopy (const FcLangSet *ls);
-
-FcPublic FcBool
-FcLangSetAdd (FcLangSet *ls, const FcChar8 *lang);
-
-FcPublic FcLangResult
-FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang);
-
-FcPublic FcLangResult
-FcLangSetCompare (const FcLangSet *lsa, const FcLangSet *lsb);
-
-FcPublic FcBool
-FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb);
-
-FcPublic FcBool
-FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb);
-
-FcPublic FcChar32
-FcLangSetHash (const FcLangSet *ls);
-
-/* fclist.c */
-FcPublic FcObjectSet *
-FcObjectSetCreate (void);
-
-FcPublic FcBool
-FcObjectSetAdd (FcObjectSet *os, const char *object);
-
-FcPublic void
-FcObjectSetDestroy (FcObjectSet *os);
-
-FcPublic FcObjectSet *
-FcObjectSetVaBuild (const char *first, va_list va);
-
-FcPublic FcObjectSet *
-FcObjectSetBuild (const char *first, ...) FC_ATTRIBUTE_SENTINEL(0);
-
-FcPublic FcFontSet *
-FcFontSetList (FcConfig     *config,
-               FcFontSet    **sets,
-               int          nsets,
-               FcPattern    *p,
-               FcObjectSet  *os);
-
-FcPublic FcFontSet *
-FcFontList (FcConfig    *config,
-            FcPattern   *p,
-            FcObjectSet *os);
-
-/* fcatomic.c */
-
-FcPublic FcAtomic *
-FcAtomicCreate (const FcChar8   *file);
-
-FcPublic FcBool
-FcAtomicLock (FcAtomic *atomic);
-
-FcPublic FcChar8 *
-FcAtomicNewFile (FcAtomic *atomic);
-
-FcPublic FcChar8 *
-FcAtomicOrigFile (FcAtomic *atomic);
-
-FcPublic FcBool
-FcAtomicReplaceOrig (FcAtomic *atomic);
-
-FcPublic void
-FcAtomicDeleteNew (FcAtomic *atomic);
-
-FcPublic void
-FcAtomicUnlock (FcAtomic *atomic);
-
-FcPublic void
-FcAtomicDestroy (FcAtomic *atomic);
-
-/* fcmatch.c */
-FcPublic FcPattern *
-FcFontSetMatch (FcConfig    *config,
-                FcFontSet   **sets,
-                int         nsets,
-                FcPattern   *p,
-                FcResult    *result);
-
-FcPublic FcPattern *
-FcFontMatch (FcConfig   *config,
-             FcPattern  *p,
-             FcResult   *result);
-
-FcPublic FcPattern *
-FcFontRenderPrepare (FcConfig       *config,
-                     FcPattern      *pat,
-                     FcPattern      *font);
-
-FcPublic FcFontSet *
-FcFontSetSort (FcConfig     *config,
-               FcFontSet    **sets,
-               int          nsets,
-               FcPattern    *p,
-               FcBool       trim,
-               FcCharSet    **csp,
-               FcResult     *result);
-
-FcPublic FcFontSet *
-FcFontSort (FcConfig     *config,
-            FcPattern    *p,
-            FcBool       trim,
-            FcCharSet    **csp,
-            FcResult     *result);
-
-FcPublic void
-FcFontSetSortDestroy (FcFontSet *fs);
-
-/* fcmatrix.c */
-FcPublic FcMatrix *
-FcMatrixCopy (const FcMatrix *mat);
-
-FcPublic FcBool
-FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2);
-
-FcPublic void
-FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b);
-
-FcPublic void
-FcMatrixRotate (FcMatrix *m, double c, double s);
-
-FcPublic void
-FcMatrixScale (FcMatrix *m, double sx, double sy);
-
-FcPublic void
-FcMatrixShear (FcMatrix *m, double sh, double sv);
-
-/* fcname.c */
-
-FcPublic FcBool
-FcNameRegisterObjectTypes (const FcObjectType *types, int ntype);
-
-FcPublic FcBool
-FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype);
-
-FcPublic const FcObjectType *
-FcNameGetObjectType (const char *object);
-
-FcPublic FcBool
-FcNameRegisterConstants (const FcConstant *consts, int nconsts);
-
-FcPublic FcBool
-FcNameUnregisterConstants (const FcConstant *consts, int nconsts);
-
-FcPublic const FcConstant *
-FcNameGetConstant (FcChar8 *string);
-
-FcPublic FcBool
-FcNameConstant (FcChar8 *string, int *result);
-
-FcPublic FcPattern *
-FcNameParse (const FcChar8 *name);
-
-FcPublic FcChar8 *
-FcNameUnparse (FcPattern *pat);
-
-/* fcpat.c */
-FcPublic FcPattern *
-FcPatternCreate (void);
-
-FcPublic FcPattern *
-FcPatternDuplicate (const FcPattern *p);
-
-FcPublic void
-FcPatternReference (FcPattern *p);
-
-FcPublic void
-FcValueDestroy (FcValue v);
-
-FcPublic FcBool
-FcValueEqual (FcValue va, FcValue vb);
-
-FcPublic FcValue
-FcValueSave (FcValue v);
-
-FcPublic void
-FcPatternDestroy (FcPattern *p);
-
-FcPublic FcBool
-FcPatternEqual (const FcPattern *pa, const FcPattern *pb);
-
-FcPublic FcBool
-FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os);
-
-FcPublic FcChar32
-FcPatternHash (const FcPattern *p);
-
-FcPublic FcBool
-FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append);
-
-FcPublic FcBool
-FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append);
-
-FcPublic FcResult
-FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v);
-
-FcPublic FcBool
-FcPatternDel (FcPattern *p, const char *object);
-
-FcPublic FcBool
-FcPatternRemove (FcPattern *p, const char *object, int id);
-
-FcPublic FcBool
-FcPatternAddInteger (FcPattern *p, const char *object, int i);
-
-FcPublic FcBool
-FcPatternAddDouble (FcPattern *p, const char *object, double d);
-
-FcPublic FcBool
-FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s);
-
-FcPublic FcBool
-FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s);
-
-FcPublic FcBool
-FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c);
-
-FcPublic FcBool
-FcPatternAddBool (FcPattern *p, const char *object, FcBool b);
-
-FcPublic FcBool
-FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls);
-
-FcPublic FcResult
-FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i);
-
-FcPublic FcResult
-FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d);
-
-FcPublic FcResult
-FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s);
-
-FcPublic FcResult
-FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s);
-
-FcPublic FcResult
-FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c);
-
-FcPublic FcResult
-FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b);
-
-FcPublic FcResult
-FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls);
-
-FcPublic FcPattern *
-FcPatternVaBuild (FcPattern *orig, va_list va);
-
-FcPublic FcPattern *
-FcPatternBuild (FcPattern *orig, ...) FC_ATTRIBUTE_SENTINEL(0);
-
-/* fcstr.c */
-
-FcPublic FcChar8 *
-FcStrCopy (const FcChar8 *s);
-
-FcPublic FcChar8 *
-FcStrCopyFilename (const FcChar8 *s);
-
-FcPublic FcChar8 *
-FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
-
-FcPublic void
-FcStrFree (FcChar8 *s);
-
-/* These are ASCII only, suitable only for pattern element names */
-#define FcIsUpper(c)    ((0101 <= (c) && (c) <= 0132))
-#define FcIsLower(c)    ((0141 <= (c) && (c) <= 0172))
-#define FcToLower(c)    (FcIsUpper(c) ? (c) - 0101 + 0141 : (c))
-
-FcPublic FcChar8 *
-FcStrDowncase (const FcChar8 *s);
-
-FcPublic int
-FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
-
-FcPublic int
-FcStrCmp (const FcChar8 *s1, const FcChar8 *s2);
-
-FcPublic const FcChar8 *
-FcStrStrIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
-
-FcPublic const FcChar8 *
-FcStrStr (const FcChar8 *s1, const FcChar8 *s2);
-
-FcPublic int
-FcUtf8ToUcs4 (const FcChar8 *src_orig,
-              FcChar32      *dst,
-              int           len);
-
-FcPublic FcBool
-FcUtf8Len (const FcChar8    *string,
-           int              len,
-           int              *nchar,
-           int              *wchar);
-
-#define FC_UTF8_MAX_LEN 6
-
-FcPublic int
-FcUcs4ToUtf8 (FcChar32  ucs4,
-              FcChar8   dest[FC_UTF8_MAX_LEN]);
-
-FcPublic int
-FcUtf16ToUcs4 (const FcChar8    *src_orig,
-               FcEndian         endian,
-               FcChar32         *dst,
-               int              len);       /* in bytes */
-
-FcPublic FcBool
-FcUtf16Len (const FcChar8   *string,
-            FcEndian        endian,
-            int             len,            /* in bytes */
-            int             *nchar,
-            int             *wchar);
-
-FcPublic FcChar8 *
-FcStrDirname (const FcChar8 *file);
-
-FcPublic FcChar8 *
-FcStrBasename (const FcChar8 *file);
-
-FcPublic FcStrSet *
-FcStrSetCreate (void);
-
-FcPublic FcBool
-FcStrSetMember (FcStrSet *set, const FcChar8 *s);
-
-FcPublic FcBool
-FcStrSetEqual (FcStrSet *sa, FcStrSet *sb);
-
-FcPublic FcBool
-FcStrSetAdd (FcStrSet *set, const FcChar8 *s);
-
-FcPublic FcBool
-FcStrSetAddFilename (FcStrSet *set, const FcChar8 *s);
-
-FcPublic FcBool
-FcStrSetDel (FcStrSet *set, const FcChar8 *s);
-
-FcPublic void
-FcStrSetDestroy (FcStrSet *set);
-
-FcPublic FcStrList *
-FcStrListCreate (FcStrSet *set);
-
-FcPublic FcChar8 *
-FcStrListNext (FcStrList *list);
-
-FcPublic void
-FcStrListDone (FcStrList *list);
-
-/* fcxml.c */
-FcPublic FcBool
-FcConfigParseAndLoad (FcConfig *config, const FcChar8 *file, FcBool complain);
-
-_FCFUNCPROTOEND
-
-#undef FC_ATTRIBUTE_SENTINEL
-
-
-#ifndef _FCINT_H_
-
-/*
- * Deprecated functions are placed here to help users fix their code without
- * digging through documentation
- */
-
-#define FcConfigGetRescanInverval   FcConfigGetRescanInverval_REPLACE_BY_FcConfigGetRescanInterval
-#define FcConfigSetRescanInverval   FcConfigSetRescanInverval_REPLACE_BY_FcConfigSetRescanInterval
-
-#endif
-
-#endif /* _FONTCONFIG_H_ */
--- a/src/java.desktop/unix/native/common/awt/fontpath.c	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/unix/native/common/awt/fontpath.c	Wed Nov 01 10:00:38 2017 -0700
@@ -578,7 +578,7 @@
 
 #include <dlfcn.h>
 
-#include "fontconfig.h"
+#include <fontconfig/fontconfig.h>
 
 
 static void* openFontConfig() {
@@ -1254,6 +1254,7 @@
                 && (strcmp((char*)fontformat, "TrueType") != 0)
 #if defined(__linux__) || defined(_AIX)
                 && (strcmp((char*)fontformat, "Type 1") != 0)
+                && (strcmp((char*)fontformat, "CFF") != 0)
 #endif
              ) {
                 continue;
--- a/src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,23 +22,48 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package sun.awt.windows;
 
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.image.*;
-import java.awt.peer.*;
-
-import java.beans.*;
+import java.awt.AWTEvent;
+import java.awt.AWTEventMulticaster;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dialog;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.Image;
+import java.awt.Insets;
+import java.awt.KeyboardFocusManager;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.SystemColor;
+import java.awt.Window;
+import java.awt.event.FocusEvent;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+import java.awt.geom.AffineTransform;
+import java.awt.image.DataBufferInt;
+import java.awt.peer.WindowPeer;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.LinkedList;
+import java.util.List;
 
-import java.util.*;
-import java.util.List;
-import sun.util.logging.PlatformLogger;
-import java.awt.geom.AffineTransform;
-import sun.awt.*;
-
+import sun.awt.AWTAccessor;
+import sun.awt.AppContext;
+import sun.awt.DisplayChangedListener;
+import sun.awt.SunToolkit;
+import sun.awt.Win32GraphicsConfig;
+import sun.awt.Win32GraphicsDevice;
+import sun.awt.Win32GraphicsEnvironment;
 import sun.java2d.pipe.Region;
 import sun.swing.SwingUtilities2;
+import sun.util.logging.PlatformLogger;
 
 public class WWindowPeer extends WPanelPeer implements WindowPeer,
        DisplayChangedListener
@@ -671,7 +696,7 @@
     public void print(Graphics g) {
         // We assume we print the whole frame,
         // so we expect no clip was set previously
-        Shape shape = AWTAccessor.getWindowAccessor().getShape((Window)target);
+        Shape shape = ((Window)target).getShape();
         if (shape != null) {
             g.setClip(shape);
         }
--- a/src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsDevice.cpp	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsDevice.cpp	Wed Nov 01 10:00:38 2017 -0700
@@ -632,22 +632,38 @@
 
 int AwtWin32GraphicsDevice::ScaleUpX(int x)
 {
-    return (int)ceil(x * scaleX);
+    return ClipRound(x * scaleX);
 }
 
 int AwtWin32GraphicsDevice::ScaleUpY(int y)
 {
-    return (int)ceil(y * scaleY);
+    return ClipRound(y * scaleY);
 }
 
 int AwtWin32GraphicsDevice::ScaleDownX(int x)
 {
-    return (int)ceil(x / scaleX);
+    return ClipRound(x / scaleX);
 }
 
 int AwtWin32GraphicsDevice::ScaleDownY(int y)
 {
-    return (int)ceil(y / scaleY);
+    return ClipRound(y / scaleY);
+}
+
+int AwtWin32GraphicsDevice::ClipRound(double value)
+{
+    value -= 0.5;
+    if (value < INT_MIN)
+    {
+        return INT_MIN;
+    }
+
+    if (value > INT_MAX)
+    {
+        return INT_MAX;
+    }
+
+    return (int)ceil(value);
 }
 
 void AwtWin32GraphicsDevice::InitDesktopScales()
--- a/src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsDevice.h	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsDevice.h	Wed Nov 01 10:00:38 2017 -0700
@@ -119,6 +119,7 @@
     float                   scaleY;
 
     static HDC              MakeDCFromMonitor(HMONITOR);
+    static int              ClipRound(double value);
 };
 
 #endif AWT_WIN32GRAPHICSDEVICE_H
--- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java	Wed Nov 01 10:00:38 2017 -0700
@@ -184,6 +184,7 @@
     private IOContext input = null;
     private boolean regenerateOnDeath = true;
     private boolean live = false;
+    private boolean interactiveModeBegun = false;
     private Options options;
 
     SourceCodeAnalysis analysis;
@@ -499,9 +500,13 @@
 
         @Override
         void msg(String key, Object... args) {
-            startmsg(key, args);
+            errormsg(key, args);
         }
 
+        /**
+         * Parse the command line options.
+         * @return the options as an Options object, or null if error
+         */
         @Override
         Options parse(OptionSet options) {
             if (options.has(argHelp)) {
@@ -541,7 +546,7 @@
             if (options.has(argStart)) {
                 List<String> sts = options.valuesOf(argStart);
                 if (options.has("no-startup")) {
-                    startmsg("jshell.err.opt.startup.conflict");
+                    msg("jshell.err.opt.startup.conflict");
                     return null;
                 }
                 initialStartup = Startup.fromFileList(sts, "--startup", new InitMessageHandler());
@@ -649,16 +654,6 @@
     }
 
     /**
-     * Base output for command output -- no pre- or post-fix
-     *
-     * @param printf format
-     * @param printf args
-     */
-    void rawout(String format, Object... args) {
-        cmdout.printf(format, args);
-    }
-
-    /**
      * Must show command output
      *
      * @param format printf format
@@ -666,17 +661,17 @@
      */
     @Override
     public void hard(String format, Object... args) {
-        rawout(prefix(format), args);
+        cmdout.printf(prefix(format), args);
     }
 
-    /**
+   /**
      * Error command output
      *
      * @param format printf format
      * @param args printf args
      */
     void error(String format, Object... args) {
-        rawout(prefixError(format), args);
+        (interactiveModeBegun? cmdout : cmderr).printf(prefixError(format), args);
     }
 
     /**
@@ -749,7 +744,8 @@
 
     /**
      * Add prefixing/postfixing to embedded newlines in a string,
-     * bracketing with prefix/postfix
+     * bracketing with prefix/postfix.  No prefixing when non-interactive.
+     * Result is expected to be the format for a printf.
      *
      * @param s the string to prefix
      * @param pre the string to prepend to each line
@@ -760,6 +756,10 @@
         if (s == null) {
             return "";
         }
+        if (!interactiveModeBegun) {
+            // messages expect to be new-line terminated (even when not prefixed)
+            return s + "%n";
+        }
         String pp = s.replaceAll("\\R", post + pre);
         if (pp.endsWith(post + pre)) {
             // prevent an extra prefix char and blank line when the string
@@ -810,21 +810,7 @@
      */
     @Override
     public void errormsg(String key, Object... args) {
-        if (isRunningInteractive()) {
-            rawout(prefixError(messageFormat(key, args)));
-        } else {
-            startmsg(key, args);
-        }
-    }
-
-    /**
-     * Print command-line error using resource bundle look-up, MessageFormat
-     *
-     * @param key the resource key
-     * @param args
-     */
-    void startmsg(String key, Object... args) {
-        cmderr.println(messageFormat(key, args));
+        error(messageFormat(key, args));
     }
 
     /**
@@ -847,7 +833,7 @@
                 LinkedHashMap::new));
         for (Entry<String, String> e : a2b.entrySet()) {
             hard("%s", e.getKey());
-            rawout(prefix(e.getValue(), feedback.getPre() + "\t", feedback.getPost()));
+            cmdout.printf(prefix(e.getValue(), feedback.getPre() + "\t", feedback.getPost()));
         }
     }
 
@@ -899,7 +885,10 @@
         replayableHistoryPrevious = ReplayableHistory.fromPrevious(prefs);
         // load snippet/command files given on command-line
         for (String loadFile : commandLineArgs.nonOptions()) {
-            runFile(loadFile, "jshell");
+            if (!runFile(loadFile, "jshell")) {
+                // Load file failed -- abort
+                return;
+            }
         }
         // if we survived that...
         if (regenerateOnDeath) {
@@ -909,6 +898,7 @@
         // check again, as feedback setting could have failed
         if (regenerateOnDeath) {
             // if we haven't died, and the feedback mode wants fluff, print welcome
+            interactiveModeBegun = true;
             if (feedback.shouldDisplayCommandFluff()) {
                 hardmsg("jshell.msg.welcome", version());
             }
@@ -994,7 +984,7 @@
 
         @Override
         public void errormsg(String messageKey, Object... args) {
-            startmsg(messageKey, args);
+            JShellTool.this.errormsg(messageKey, args);
         }
 
         @Override
@@ -1034,6 +1024,7 @@
         shutdownSubscription = state.onShutdown((JShell deadState) -> {
             if (deadState == state) {
                 hardmsg("jshell.msg.terminated");
+                fluffmsg("jshell.msg.terminated.restore");
                 live = false;
             }
         });
@@ -1056,10 +1047,6 @@
         currentNameSpace = mainNamespace;
     }
 
-    private boolean isRunningInteractive() {
-        return currentNameSpace != null && currentNameSpace == mainNamespace;
-    }
-
     //where -- one-time per run initialization of feedback modes
     private void initFeedback(String initMode) {
         // No fluff, no prefix, for init failures
@@ -1096,8 +1083,8 @@
         try (IOContext suin = new ScannerIOContext(new StringReader(start))) {
             run(suin);
         } catch (Exception ex) {
-            hardmsg("jshell.err.startup.unexpected.exception", ex);
-            ex.printStackTrace(cmdout);
+            errormsg("jshell.err.startup.unexpected.exception", ex);
+            ex.printStackTrace(cmderr);
         }
     }
 
@@ -1123,7 +1110,7 @@
             String incomplete = "";
             while (live) {
                 String prompt;
-                if (isRunningInteractive()) {
+                if (interactive()) {
                     prompt = testPrompt
                                     ? incomplete.isEmpty()
                                             ? "\u0005" //ENQ
@@ -1171,7 +1158,7 @@
     }
 
     private void addToReplayHistory(String s) {
-        if (isRunningInteractive()) {
+        if (!isCurrentlyRunningStartup) {
             replayableHistory.add(s);
         }
     }
@@ -2127,7 +2114,7 @@
                         fluff("Wrap debugging on");
                         break;
                     default:
-                        hard("Unknown debugging option: %c", ch);
+                        error("Unknown debugging option: %c", ch);
                         fluff("Use: 0 r g f c d e w");
                         return false;
                 }
@@ -2697,7 +2684,7 @@
                     }
                     currSrcs = nextSrcs;
                 } catch (IllegalStateException ex) {
-                    hardmsg("jshell.msg.resetting");
+                    errormsg("jshell.msg.resetting");
                     resetState();
                     currSrcs = new LinkedHashSet<>(); // re-process everything
                 }
@@ -2746,16 +2733,21 @@
     private boolean runFile(String filename, String context) {
         if (!filename.isEmpty()) {
             try {
-                Path path = toPathResolvingUserHome(filename);
-                Reader reader;
-                String resource;
-                if (!Files.exists(path) && (resource = getResource(filename)) != null) {
-                    // Not found as file, but found as resource
-                    reader = new StringReader(resource);
+                Scanner scanner;
+                if (!interactiveModeBegun && filename.equals("-")) {
+                    // - on command line: no interactive later, read from input
+                    regenerateOnDeath = false;
+                    scanner = new Scanner(cmdin);
                 } else {
-                    reader = new FileReader(path.toString());
+                    Path path = toPathResolvingUserHome(filename);
+                    String resource;
+                    scanner = new Scanner(
+                            (!Files.exists(path) && (resource = getResource(filename)) != null)
+                            ? new StringReader(resource) // Not found as file, but found as resource
+                            : new FileReader(path.toString())
+                    );
                 }
-                run(new ScannerIOContext(reader));
+                run(new ScannerIOContext(scanner));
                 return true;
             } catch (FileNotFoundException e) {
                 errormsg("jshell.err.file.not.found", context, filename, e.getMessage());
@@ -2841,7 +2833,7 @@
                 sb.append(a);
             }
             if (sb.length() > 0) {
-                rawout(prefix(sb.toString()));
+                hard(sb.toString());
             }
             return false;
         }
@@ -3175,11 +3167,11 @@
         if (ste.causeSnippet() == null) {
             // main event
             for (Diag d : diagnostics) {
-                hardmsg(d.isError()? "jshell.msg.error" : "jshell.msg.warning");
+                errormsg(d.isError()? "jshell.msg.error" : "jshell.msg.warning");
                 List<String> disp = new ArrayList<>();
                 displayDiagnostics(source, d, disp);
                 disp.stream()
-                        .forEach(l -> hard("%s", l));
+                        .forEach(l -> error("%s", l));
             }
 
             if (ste.status() != Status.REJECTED) {
@@ -3190,7 +3182,7 @@
                     } else if (ste.exception() instanceof UnresolvedReferenceException) {
                         printUnresolvedException((UnresolvedReferenceException) ste.exception());
                     } else {
-                        hard("Unexpected execution exception: %s", ste.exception());
+                        error("Unexpected execution exception: %s", ste.exception());
                         return true;
                     }
                 } else {
@@ -3242,7 +3234,7 @@
                             : lineNumber >= 0
                                     ? fileName + ":" + lineNumber
                                     : fileName;
-            hard("      at %s(%s)", sb, loc);
+            error("      at %s(%s)", sb, loc);
 
         }
     }
@@ -3253,9 +3245,9 @@
     //where
     void printEvalException(EvalException ex) {
         if (ex.getMessage() == null) {
-            hard("%s thrown", ex.getExceptionClassName());
+            error("%s thrown", ex.getExceptionClassName());
         } else {
-            hard("%s thrown: %s", ex.getExceptionClassName(), ex.getMessage());
+            error("%s thrown: %s", ex.getExceptionClassName(), ex.getMessage());
         }
         printStackTrace(ex.getStackTrace());
     }
@@ -3394,7 +3386,7 @@
                         resolution, unrcnt, errcnt,
                         name, type, value, unresolved, errorLines);
                 if (!resolutionErrors.trim().isEmpty()) {
-                    hard("    %s", resolutionErrors);
+                    error("    %s", resolutionErrors);
                 }
             } else if (interactive()) {
                 String display = feedback.format(fcase, action, update,
@@ -3625,7 +3617,6 @@
         scannerIn.close();
     }
 
-    @Override
     public int readUserInput() {
         return -1;
     }
@@ -3657,7 +3648,6 @@
     public void close() {
     }
 
-    @Override
     public int readUserInput() {
         return -1;
     }
--- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties	Wed Nov 01 10:00:38 2017 -0700
@@ -33,9 +33,8 @@
 jshell.err.opt.feedback.one = Only one feedback option (--feedback, -q, -s, or -v) may be used.
 jshell.err.opt.unknown = Unknown option: {0}
 
-jshell.msg.terminated =\
-State engine terminated.\n\
-Restore definitions with: /reload -restore
+jshell.msg.terminated = State engine terminated.
+jshell.msg.terminated.restore = Restore definitions with: /reload -restore
 
 jshell.msg.use.one.of = Use one of: {0}
 jshell.msg.see.classes.etc = See /types, /methods, /vars, or /list
@@ -189,7 +188,7 @@
    /help shortcuts
 
 help.usage = \
-Usage:   jshell <options> <load files>\n\
+Usage:   jshell <option>... <load file>...\n\
 where possible options include:\n\
 \    --class-path <path>   Specify where to find user class files\n\
 \    --module-path <path>  Specify where to find application modules\n\
@@ -213,7 +212,11 @@
 \    --version             Print version information and exit\n\
 \    --show-version        Print version information and continue\n\
 \    --help                Print this synopsis of standard options and exit\n\
-\    --help-extra, -X      Print help on non-standard options and exit\n
+\    --help-extra, -X      Print help on non-standard options and exit\n\
+A file argument may be a file name, or one of the predefined file names: DEFAULT,\n\
+PRINTING, or JAVASE.\n\
+A load file may also be "-" to indicate standard input, without interactive I/O.\n
+
 help.usage.x = \
 \    --add-exports <module>/<package>   Export specified module-private package to snippets\n\
 \    --execution <spec>                 Specify an alternate execution engine.\n\
--- a/src/jdk.jshell/share/classes/jdk/jshell/Eval.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/jdk.jshell/share/classes/jdk/jshell/Eval.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,6 +48,7 @@
 import java.io.IOException;
 import java.io.StringWriter;
 import java.io.Writer;
+import java.util.Arrays;
 import java.util.LinkedHashSet;
 import java.util.Set;
 import jdk.jshell.ExpressionToTypeInfo.ExpressionInfo;
@@ -100,6 +101,12 @@
 
     private final JShell state;
 
+    // The set of names of methods on Object
+    private final Set<String> objectMethods = Arrays
+            .stream(Object.class.getMethods())
+            .map(m -> m.getName())
+            .collect(toSet());
+
     Eval(JShell state) {
         this.state = state;
     }
@@ -528,10 +535,26 @@
     private List<Snippet> processMethod(String userSource, Tree unitTree, String compileSource, ParseTask pt) {
         TreeDependencyScanner tds = new TreeDependencyScanner();
         tds.scan(unitTree);
-        TreeDissector dis = TreeDissector.createByFirstClass(pt);
+        final TreeDissector dis = TreeDissector.createByFirstClass(pt);
+
+        final MethodTree mt = (MethodTree) unitTree;
+        final String name = mt.getName().toString();
+        if (objectMethods.contains(name)) {
+            // The name matches a method on Object, short of an overhaul, this
+            // fails, see 8187137.  Generate a descriptive error message
 
-        MethodTree mt = (MethodTree) unitTree;
-        String name = mt.getName().toString();
+            // The error position will be the position of the name, find it
+            long possibleStart = dis.getEndPosition(mt.getReturnType());
+            Range possibleRange = new Range((int) possibleStart,
+                    dis.getStartPosition(mt.getBody()));
+            String possibleNameSection = possibleRange.part(compileSource);
+            int offset = possibleNameSection.indexOf(name);
+            long start = offset < 0
+                    ? possibleStart // something wrong, punt
+                    : possibleStart + offset;
+
+            return compileFailResult(new DiagList(objectMethodNameDiag(name, start)), userSource, Kind.METHOD);
+        }
         String parameterTypes
                 = mt.getParameters()
                 .stream()
@@ -900,6 +923,47 @@
         return PREFIX_PATTERN.matcher(ste.getClassName()).find();
     }
 
+    /**
+     * Construct a diagnostic for a method name matching an Object method name
+     * @param name the method name
+     * @param nameStart the position within the source of the method name
+     * @return the generated diagnostic
+     */
+    private Diag objectMethodNameDiag(String name, long nameStart) {
+        return new Diag() {
+            @Override
+            public boolean isError() {
+                return true;
+            }
+
+            @Override
+            public long getPosition() {
+                return nameStart;
+            }
+
+            @Override
+            public long getStartPosition() {
+                return nameStart;
+            }
+
+            @Override
+            public long getEndPosition() {
+                return nameStart + name.length();
+            }
+
+            @Override
+            public String getCode() {
+                return "jdk.eval.error.object.method";
+            }
+
+            @Override
+            public String getMessage(Locale locale) {
+                return state.messageFormat("jshell.diag.object.method.fatal",
+                        String.join(" ", objectMethods));
+            }
+        };
+    }
+
     private DiagList modifierDiagnostics(ModifiersTree modtree,
             final TreeDissector dis, boolean isAbstractProhibited) {
 
--- a/src/jdk.jshell/share/classes/jdk/jshell/resources/l10n.properties	Wed Nov 01 16:45:28 2017 +0100
+++ b/src/jdk.jshell/share/classes/jdk/jshell/resources/l10n.properties	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 jshell.diag.modifier.plural.ignore = Modifiers {0} not permitted in top-level declarations, ignored
 jshell.diag.modifier.single.fatal = Modifier {0} not permitted in top-level declarations
 jshell.diag.modifier.single.ignore = Modifier {0} not permitted in top-level declarations, ignored
+jshell.diag.object.method.fatal = JShell method names must not match Object methods: {0}
 
 jshell.exc.null = Snippet must not be null
 jshell.exc.alien = Snippet not from this JShell: {0}
--- a/test/jdk/com/sun/awt/Translucency/WindowOpacity.java	Wed Nov 01 16:45:28 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,467 +0,0 @@
-/*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
-  @test %W% %E%
-  @key headful
-  @bug 6594131
-  @summary Tests the AWTUtilities.get/setWindowOpacity() methods
-  @author anthony.petrov@...: area=awt.toplevel
-  @modules java.desktop/com.sun.awt
-  @run main WindowOpacity
-*/
-
-import java.awt.*;
-import java.awt.event.*;
-
-import com.sun.awt.AWTUtilities;
-
-public class WindowOpacity
-{
-    //*** test-writer defined static variables go here ***
-
-   private static Robot robot;
-
-
-    private static void init()
-    {
-        //*** Create instructions for the user here ***
-        String[] instructions =
-        {
-            "This is an AUTOMATIC test, simply wait until it is done.",
-            "The result (passed or failed) will be shown in the",
-            "message window below."
-        };
-        Sysout.createDialog( );
-        Sysout.printInstructions( instructions );
-
-        if (!AWTUtilities.isTranslucencySupported(AWTUtilities.Translucency.TRANSLUCENT)) {
-            System.out.println("Either the Toolkit or the native system does not support controlling the window opacity level.");
-            pass();
-        }
-        try {
-            robot = new Robot();
-        }catch(Exception ex) {
-            ex.printStackTrace();
-            throw new RuntimeException ("Unexpected failure");
-        }
-
-        boolean passed;
-
-        Frame f = new Frame("Opacity test");
-        f.setUndecorated(true);
-
-        passed = false;
-        try {
-            AWTUtilities.getWindowOpacity(null);
-        } catch (NullPointerException e) {
-            passed = true;
-        }
-        if (!passed) {
-            fail("getWindowOpacity() allows passing null.");
-        }
-
-
-        passed = false;
-        try {
-            AWTUtilities.setWindowOpacity(null, 0.5f);
-        } catch (NullPointerException e) {
-            passed = true;
-        }
-        if (!passed) {
-            fail("setWindowOpacity() allows passing null.");
-        }
-
-
-        float curOpacity = AWTUtilities.getWindowOpacity(f);
-        if (curOpacity < 1.0f || curOpacity > 1.0f) {
-            fail("getWindowOpacity() reports the initial opacity level other than 1.0: " + curOpacity);
-        }
-
-
-
-        passed = false;
-        try {
-            AWTUtilities.setWindowOpacity(f, -0.5f);
-        } catch (IllegalArgumentException e) {
-            passed = true;
-        }
-        if (!passed) {
-            fail("setWindowOpacity() allows passing negative opacity level.");
-        }
-
-
-
-        passed = false;
-        try {
-            AWTUtilities.setWindowOpacity(f, 1.5f);
-        } catch (IllegalArgumentException e) {
-            passed = true;
-        }
-        if (!passed) {
-            fail("setWindowOpacity() allows passing opacity level greater than 1.0.");
-        }
-
-
-        AWTUtilities.setWindowOpacity(f, 0.5f);
-
-        curOpacity = AWTUtilities.getWindowOpacity(f);
-        if (curOpacity < 0.5f || curOpacity > 0.5f) {
-            fail("getWindowOpacity() reports the opacity level that differs from the value set with setWindowOpacity: " + curOpacity);
-        }
-
-
-        AWTUtilities.setWindowOpacity(f, 0.75f);
-
-        curOpacity = AWTUtilities.getWindowOpacity(f);
-        if (curOpacity < 0.75f || curOpacity > 0.75f) {
-            fail("getWindowOpacity() reports the opacity level that differs from the value set with setWindowOpacity the second time: " + curOpacity);
-        }
-
-
-        f.setBounds(100, 100, 300, 200);
-        f.setVisible(true);
-
-        robot.waitForIdle();
-
-        curOpacity = AWTUtilities.getWindowOpacity(f);
-        if (curOpacity < 0.75f || curOpacity > 0.75f) {
-            fail("getWindowOpacity() reports the opacity level that differs from the value set with setWindowOpacity before showing the frame: " + curOpacity);
-        }
-
-
-
-        AWTUtilities.setWindowOpacity(f, 0.5f);
-        robot.waitForIdle();
-
-        curOpacity = AWTUtilities.getWindowOpacity(f);
-        if (curOpacity < 0.5f || curOpacity > 0.5f) {
-            fail("getWindowOpacity() reports the opacity level that differs from the value set with setWindowOpacity after showing the frame: " + curOpacity);
-        }
-
-        WindowOpacity.pass();
-
-    }//End  init()
-
-
-
-    /*****************************************************
-     * Standard Test Machinery Section
-     * DO NOT modify anything in this section -- it's a
-     * standard chunk of code which has all of the
-     * synchronisation necessary for the test harness.
-     * By keeping it the same in all tests, it is easier
-     * to read and understand someone else's test, as
-     * well as insuring that all tests behave correctly
-     * with the test harness.
-     * There is a section following this for test-
-     * classes
-     ******************************************************/
-    private static boolean theTestPassed = false;
-    private static boolean testGeneratedInterrupt = false;
-    private static String failureMessage = "";
-
-    private static Thread mainThread = null;
-
-    private static int sleepTime = 300000;
-
-    // Not sure about what happens if multiple of this test are
-    //  instantiated in the same VM.  Being static (and using
-    //  static vars), it aint gonna work.  Not worrying about
-    //  it for now.
-    public static void main( String args[] ) throws InterruptedException
-    {
-        mainThread = Thread.currentThread();
-        try
-        {
-            init();
-        }
-        catch( TestPassedException e )
-        {
-            //The test passed, so just return from main and harness will
-            // interepret this return as a pass
-            return;
-        }
-        //At this point, neither test pass nor test fail has been
-        // called -- either would have thrown an exception and ended the
-        // test, so we know we have multiple threads.
-
-        //Test involves other threads, so sleep and wait for them to
-        // called pass() or fail()
-        try
-        {
-            Thread.sleep( sleepTime );
-            //Timed out, so fail the test
-            throw new RuntimeException( "Timed out after " + sleepTime/1000 + " seconds" );
-        }
-        catch (InterruptedException e)
-        {
-            //The test harness may have interrupted the test.  If so, rethrow the exception
-            // so that the harness gets it and deals with it.
-            if( ! testGeneratedInterrupt ) throw e;
-
-            //reset flag in case hit this code more than once for some reason (just safety)
-            testGeneratedInterrupt = false;
-
-            if ( theTestPassed == false )
-            {
-                throw new RuntimeException( failureMessage );
-            }
-        }
-
-    }//main
-
-    public static synchronized void setTimeoutTo( int seconds )
-    {
-        sleepTime = seconds * 1000;
-    }
-
-    public static synchronized void pass()
-    {
-        Sysout.println( "The test passed." );
-        Sysout.println( "The test is over, hit  Ctl-C to stop Java VM" );
-        //first check if this is executing in main thread
-        if ( mainThread == Thread.currentThread() )
-        {
-            //Still in the main thread, so set the flag just for kicks,
-            // and throw a test passed exception which will be caught
-            // and end the test.
-            theTestPassed = true;
-            throw new TestPassedException();
-        }
-        theTestPassed = true;
-        testGeneratedInterrupt = true;
-        mainThread.interrupt();
-    }//pass()
-
-    public static synchronized void fail()
-    {
-        //test writer didn't specify why test failed, so give generic
-        fail( "it just plain failed! :-)" );
-    }
-
-    public static synchronized void fail( String whyFailed )
-    {
-        Sysout.println( "The test failed: " + whyFailed );
-        Sysout.println( "The test is over, hit  Ctl-C to stop Java VM" );
-        //check if this called from main thread
-        if ( mainThread == Thread.currentThread() )
-        {
-            //If main thread, fail now 'cause not sleeping
-            throw new RuntimeException( whyFailed );
-        }
-        theTestPassed = false;
-        testGeneratedInterrupt = true;
-        failureMessage = whyFailed;
-        mainThread.interrupt();
-    }//fail()
-
-}// class WindowOpacity
-
-//This exception is used to exit from any level of call nesting
-// when it's determined that the test has passed, and immediately
-// end the test.
-class TestPassedException extends RuntimeException
-{
-}
-
-//*********** End Standard Test Machinery Section **********
-
-
-//************ Begin classes defined for the test ****************
-
-// if want to make listeners, here is the recommended place for them, then instantiate
-//  them in init()
-
-/* Example of a class which may be written as part of a test
-class NewClass implements anInterface
- {
-   static int newVar = 0;
-
-   public void eventDispatched(AWTEvent e)
-    {
-      //Counting events to see if we get enough
-      eventCount++;
-
-      if( eventCount == 20 )
-       {
-         //got enough events, so pass
-
-         WindowOpacity.pass();
-       }
-      else if( tries == 20 )
-       {
-         //tried too many times without getting enough events so fail
-
-         WindowOpacity.fail();
-       }
-
-    }// eventDispatched()
-
- }// NewClass class
-
-*/
-
-
-//************** End classes defined for the test *******************
-
-
-
-
-/****************************************************
- Standard Test Machinery
- DO NOT modify anything below -- it's a standard
-  chunk of code whose purpose is to make user
-  interaction uniform, and thereby make it simpler
-  to read and understand someone else's test.
- ****************************************************/
-
-/**
- This is part of the standard test machinery.
- It creates a dialog (with the instructions), and is the interface
-  for sending text messages to the user.
- To print the instructions, send an array of strings to Sysout.createDialog
-  WithInstructions method.  Put one line of instructions per array entry.
- To display a message for the tester to see, simply call Sysout.println
-  with the string to be displayed.
- This mimics System.out.println but works within the test harness as well
-  as standalone.
- */
-
-class Sysout
-{
-    private static TestDialog dialog;
-
-    public static void createDialogWithInstructions( String[] instructions )
-    {
-        dialog = new TestDialog( new Frame(), "Instructions" );
-        dialog.printInstructions( instructions );
-        dialog.setVisible(true);
-        println( "Any messages for the tester will display here." );
-    }
-
-    public static void createDialog( )
-    {
-        dialog = new TestDialog( new Frame(), "Instructions" );
-        String[] defInstr = { "Instructions will appear here. ", "" } ;
-        dialog.printInstructions( defInstr );
-        dialog.setVisible(true);
-        println( "Any messages for the tester will display here." );
-    }
-
-
-    public static void printInstructions( String[] instructions )
-    {
-        dialog.printInstructions( instructions );
-    }
-
-
-    public static void println( String messageIn )
-    {
-        dialog.displayMessage( messageIn );
-        System.out.println(messageIn);
-    }
-
-}// Sysout  class
-
-/**
-  This is part of the standard test machinery.  It provides a place for the
-   test instructions to be displayed, and a place for interactive messages
-   to the user to be displayed.
-  To have the test instructions displayed, see Sysout.
-  To have a message to the user be displayed, see Sysout.
-  Do not call anything in this dialog directly.
-  */
-class TestDialog extends Dialog
-{
-
-    TextArea instructionsText;
-    TextArea messageText;
-    int maxStringLength = 80;
-
-    //DO NOT call this directly, go through Sysout
-    public TestDialog( Frame frame, String name )
-    {
-        super( frame, name );
-        int scrollBoth = TextArea.SCROLLBARS_BOTH;
-        instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
-        add( "North", instructionsText );
-
-        messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
-        add("Center", messageText);
-
-        pack();
-
-        setVisible(true);
-    }// TestDialog()
-
-    //DO NOT call this directly, go through Sysout
-    public void printInstructions( String[] instructions )
-    {
-        //Clear out any current instructions
-        instructionsText.setText( "" );
-
-        //Go down array of instruction strings
-
-        String printStr, remainingStr;
-        for( int i=0; i < instructions.length; i++ )
-        {
-            //chop up each into pieces maxSringLength long
-            remainingStr = instructions[ i ];
-            while( remainingStr.length() > 0 )
-            {
-                //if longer than max then chop off first max chars to print
-                if( remainingStr.length() >= maxStringLength )
-                {
-                    //Try to chop on a word boundary
-                    int posOfSpace = remainingStr.
-                        lastIndexOf( ' ', maxStringLength - 1 );
-
-                    if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
-
-                    printStr = remainingStr.substring( 0, posOfSpace + 1 );
-                    remainingStr = remainingStr.substring( posOfSpace + 1 );
-                }
-                //else just print
-                else
-                {
-                    printStr = remainingStr;
-                    remainingStr = "";
-                }
-
-                instructionsText.append( printStr + "\n" );
-
-            }// while
-
-        }// for
-
-    }//printInstructions()
-
-    //DO NOT call this directly, go through Sysout
-    public void displayMessage( String messageIn )
-    {
-        messageText.append( messageIn + "\n" );
-        System.out.println(messageIn);
-    }
-
-}// TestDialog  class
--- a/test/jdk/java/awt/Window/ScreenLocation/ScreenLocationTest.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/test/jdk/java/awt/Window/ScreenLocation/ScreenLocationTest.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 /*
  * @test
  * @key headful
- * @bug 8011616
+ * @bug 8011616 8145795
  * @summary JWindow.getLocation and JWindow.getLocationOnScreen return different
  *          values on Unity
  * @author Semyon Sadetsky
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/Window/ShapedAndTranslucentWindows/WindowOpacity.java	Wed Nov 01 10:00:38 2017 -0700
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @key headful
+  @bug 6594131 8186617
+  @summary Tests the Window.get/setOpacity() methods
+*/
+
+import java.awt.AWTException;
+import java.awt.Frame;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.Robot;
+
+public class WindowOpacity {
+
+    public static void main(String[] args) throws Exception {
+        GraphicsDevice gd =
+                GraphicsEnvironment.getLocalGraphicsEnvironment()
+                        .getDefaultScreenDevice();
+        if (!gd.isWindowTranslucencySupported(
+                GraphicsDevice.WindowTranslucency.TRANSLUCENT)) {
+            System.out.println(
+                    "Either the Toolkit or the native system does not support"
+                            + " controlling the window opacity level.");
+            return;
+        }
+        Frame f = new Frame("Opacity test");
+        try {
+            test(f);
+        } finally {
+            f.dispose();
+        }
+    }
+
+    private static void test(final Frame f) throws AWTException {
+        boolean passed;
+
+        f.setUndecorated(true);
+        float curOpacity = f.getOpacity();
+        if (curOpacity < 1.0f || curOpacity > 1.0f) {
+            throw new RuntimeException(
+                    "getOpacity() reports the initial opacity level "
+                            + "other than 1.0: " + curOpacity);
+        }
+
+
+        passed = false;
+        try {
+            f.setOpacity(-0.5f);
+        } catch (IllegalArgumentException e) {
+            passed = true;
+        }
+        if (!passed) {
+            throw new RuntimeException(
+                    "setOpacity() allows passing negative opacity level.");
+        }
+
+
+        passed = false;
+        try {
+            f.setOpacity(1.5f);
+        } catch (IllegalArgumentException e) {
+            passed = true;
+        }
+        if (!passed) {
+            throw new RuntimeException(
+                    "setOpacity() allows passing opacity level greater than 1.0.");
+        }
+
+
+        f.setOpacity(0.5f);
+        curOpacity = f.getOpacity();
+        if (curOpacity < 0.5f || curOpacity > 0.5f) {
+            throw new RuntimeException(
+                    "setOpacity() reports the opacity level that "
+                            + "differs from the value set with "
+                            + "setWindowOpacity: " + curOpacity);
+        }
+
+
+        f.setOpacity(0.75f);
+        curOpacity = f.getOpacity();
+        if (curOpacity < 0.75f || curOpacity > 0.75f) {
+            throw new RuntimeException(
+                    "getOpacity() reports the opacity level that "
+                            + "differs from the value set with "
+                            + "setWindowOpacity the second time: "
+                            + curOpacity);
+        }
+
+
+        f.setBounds(100, 100, 300, 200);
+        f.setVisible(true);
+        Robot robot = new Robot();
+        robot.waitForIdle();
+
+        curOpacity = f.getOpacity();
+        if (curOpacity < 0.75f || curOpacity > 0.75f) {
+            throw new RuntimeException(
+                    "getOpacity() reports the opacity level that "
+                            + "differs from the value set with "
+                            + "setWindowOpacity before showing the frame: "
+                            + curOpacity);
+        }
+        f.setOpacity(0.5f);
+        robot.waitForIdle();
+        curOpacity = f.getOpacity();
+        if (curOpacity < 0.5f || curOpacity > 0.5f) {
+            throw new RuntimeException(
+                    "getOpacity() reports the opacity level that "
+                            + "differs from the value set with "
+                            + "setWindowOpacity after showing the frame: "
+                            + curOpacity);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/dnd/DnDTestWithHIDPI/DragTestWithHIDPI.java	Wed Nov 01 10:00:38 2017 -0700
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @key headful
+ * @bug 8159062
+ * @summary Tests DnD property with HIDPI scale set to non-interger value 2.5
+ * @run main/othervm -Dsun.java2d.uiScale=2.5 DragTestWithHIDPI
+ */
+
+import javax.swing.JList;
+import javax.swing.TransferHandler;
+import javax.swing.JFrame;
+import javax.swing.JComponent;
+import javax.swing.SwingUtilities;
+
+import java.awt.Robot;
+import java.awt.BorderLayout;
+import java.awt.Point;
+import java.awt.Dimension;
+import java.awt.MouseInfo;
+import java.awt.event.InputEvent;
+
+public class DragTestWithHIDPI extends TransferHandler {
+
+    private static boolean didDrag = false;
+    private static int threshold = 10;
+    private static int DEFAULT_DELAY = 550;
+
+    private Robot robot = null;
+    private static JList list = null;
+    private static Point listLocation = null;
+    private static Dimension listSize = null;
+    private static JFrame f = null;
+
+    private enum Direction {
+        RIGHT, LEFT, BOTTOM, TOP
+    }
+
+    public static void main(String[] args) throws Exception {
+        DragTestWithHIDPI test = new DragTestWithHIDPI();
+
+        // set the mouse move drag threshold
+        System.setProperty("awt.dnd.drag.threshold", String.valueOf(threshold));
+
+        test.createGUI();
+        test.doTest();
+        System.out.println("Test Passed");
+        test.disposeGUI();
+    }
+
+    public void exportAsDrag(JComponent comp, InputEvent e, int action) {
+        didDrag = true;
+    }
+
+    public DragTestWithHIDPI() {
+        super("foreground");
+    }
+
+    private void createGUI() throws Exception{
+        SwingUtilities.invokeAndWait(() -> {
+            String[] listData =
+                    new String[]{"Pacific Ocean", "Atlantic Ocean", "Indian Ocean",
+                            "Arctic Ocean"};
+            list = new JList(listData);
+            list.setDragEnabled(true);
+            list.setTransferHandler(new DragTestWithHIDPI());
+
+            f = new JFrame("DragTestWithHIDPI");
+            f.getContentPane().add(list, BorderLayout.CENTER);
+            f.pack();
+            f.toFront();
+            f.setVisible(true);
+
+            listLocation = list.getLocationOnScreen();
+            listSize = list.getSize();
+        });
+    }
+
+    private void disposeGUI () throws  Exception {
+        SwingUtilities.invokeAndWait(() -> {
+            f.dispose();
+        });
+    }
+
+    private void doTest() throws Exception {
+
+        robot = new Robot();
+        robot.waitForIdle();
+
+        for (Direction direction : Direction.values()) {
+            //Drag should not start only by moving (threshold - 1) pixels
+            didDrag = false;
+            test(threshold - 1, direction);
+            if (didDrag) {
+                disposeGUI();
+                throw new RuntimeException(
+                        "Shouldn't start drag until > " + threshold +
+                                " pixels " + " while moving " + direction);
+            }
+
+            // Drag should not start only by moving threshold pixels
+            didDrag = false;
+            test(threshold, direction);
+            if (didDrag) {
+                disposeGUI();
+                throw new RuntimeException(
+                        "Shouldn't start drag until > " + threshold +
+                                " pixels" + " while moving " + direction);
+            }
+
+            // Drag should start after moving threshold + 1 pixel
+            didDrag = false;
+            test(threshold + 1, direction);
+            if (!didDrag) {
+                disposeGUI();
+                throw new RuntimeException(
+                        "Should start drag after > " + threshold + " pixels" +
+                                " while moving " + direction);
+            }
+        }
+    }
+
+    private void test(int threshold, Direction direction) {
+        clickMouseOnList(InputEvent.BUTTON1_DOWN_MASK);
+        Point p = MouseInfo.getPointerInfo().getLocation();
+        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+        robot.delay(DEFAULT_DELAY);
+        glide(p, direction, threshold);
+        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+    }
+
+    private void glide(Point p, Direction direction, int toAdd) {
+        switch (direction) {
+            case RIGHT:
+                // move towards right
+                glide(p.x, p.y, p.x + toAdd, p.y);
+                break;
+            case LEFT:
+                // move towards left
+                glide(p.x, p.y, p.x - toAdd, p.y);
+                break;
+            case BOTTOM:
+                // move towards bottom
+                glide(p.x, p.y, p.x, p.y + toAdd);
+                break;
+            case TOP:
+                // move towards top
+                glide(p.x, p.y, p.x, p.y - toAdd);
+                break;
+
+        }
+    }
+
+    /*
+    Some utilities functions from JRobot class.
+     */
+    private void moveMouseToList() {
+        int x = listLocation.x + listSize.width/2;
+        int y = listLocation.y + listSize.height/2;
+        robot.mouseMove(x, y);
+        robot.delay(DEFAULT_DELAY);
+    }
+
+    private void clickMouse(int buttons) {
+        robot.mousePress(buttons);
+        robot.mouseRelease(buttons);
+        robot.delay(DEFAULT_DELAY);
+    }
+
+    private void clickMouseOnList(int buttons) {
+        moveMouseToList();
+        clickMouse(buttons);
+    }
+
+    private void glide(int x0, int y0, int x1, int y1) {
+        float dmax = (float)Math.max(Math.abs(x1 - x0), Math.abs(y1 - y0));
+        float dx = (x1 - x0) / dmax;
+        float dy = (y1 - y0) / dmax;
+
+        robot.mouseMove(x0, y0);
+        for (int i=1; i<=dmax; i++) {
+            robot.mouseMove((int)(x0 + dx*i), (int)(y0 + dy*i));
+        }
+        robot.delay(DEFAULT_DELAY);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/image/RescaleOp/RescaleOpExceptionTest.java	Wed Nov 01 10:00:38 2017 -0700
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8180501
+ * @summary Verify RescaleOp.filter() throws exception for different sized
+            source and destination.
+ * @run main RescaleOpExceptionTest
+ */
+
+import java.awt.image.BufferedImage;
+import static java.awt.image.BufferedImage.TYPE_INT_RGB;
+import java.awt.image.RescaleOp;
+import java.awt.image.WritableRaster;
+
+public class RescaleOpExceptionTest {
+
+    public static void main(String[] args) throws Exception {
+
+        RescaleOp op = new RescaleOp(1.0f, 0.0f, null);
+
+        BufferedImage srcI = new BufferedImage(1, 1, TYPE_INT_RGB);
+        BufferedImage dstI = new BufferedImage(1, 2, TYPE_INT_RGB);
+
+        boolean caughtIAE = false;
+        try {
+             op.filter(srcI, dstI);
+        } catch (IllegalArgumentException e) {
+            caughtIAE = true;
+        }
+        if (!caughtIAE) {
+            throw new RuntimeException("Expected IllegalArgumentException");
+        }
+
+        WritableRaster srcR = srcI.getRaster();
+        WritableRaster dstR = dstI.getRaster();
+
+        caughtIAE = false;
+        try {
+             op.filter(srcR, dstR);
+        } catch (IllegalArgumentException e) {
+            caughtIAE = true;
+        }
+        if (!caughtIAE) {
+            throw new RuntimeException("Expected IllegalArgumentException");
+        }
+    }
+}
--- a/test/jdk/javax/swing/JComponent/6683775/bug6683775.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/test/jdk/javax/swing/JComponent/6683775/bug6683775.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,19 +24,23 @@
 /*
  * @test
  * @key headful
- * @bug 6683775 6794764
- * @summary Painting artifacts is seen when panel is made setOpaque(false) for a translucent window
- * @author Alexander Potochkin
- * @modules java.desktop/com.sun.awt
- *          java.desktop/sun.awt
- * @run main bug6683775
+ * @bug 6683775 6794764 8186617
+ * @summary Painting artifacts is seen when panel is made setOpaque(false) for a
+ *          translucent window
  */
 
-import com.sun.awt.AWTUtilities;
+import java.awt.Color;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.Window;
+import java.awt.image.BufferedImage;
 
-import javax.swing.*;
-import java.awt.*;
-import java.awt.image.BufferedImage;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
 
 public class bug6683775 {
     static final int LOC = 100,
@@ -44,9 +48,8 @@
 
     public static void main(String[] args) throws Exception {
         GraphicsConfiguration gc = getGC();
-       if (!AWTUtilities.isTranslucencySupported(
-               AWTUtilities.Translucency.PERPIXEL_TRANSLUCENT)
-                || gc == null) {
+        if (gc == null || !gc.getDevice().isWindowTranslucencySupported(
+                GraphicsDevice.WindowTranslucency.PERPIXEL_TRANSLUCENT)) {
             return;
         }
         Robot robot = new Robot();
@@ -65,7 +68,7 @@
             JPanel p = new JPanel();
             p.setOpaque(false);
             testFrame.add(p);
-            AWTUtilities.setWindowOpaque(testFrame, false);
+            setOpaque(testFrame, false);
             testFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             testFrame.setBounds(LOC, LOC, SIZE, SIZE);
             testFrame.setVisible(true);
@@ -78,17 +81,28 @@
         BufferedImage capture =
                 robot.createScreenCapture(new Rectangle(LOC, LOC, SIZE, SIZE));
 
+        SwingUtilities.invokeAndWait(testFrame::dispose);
+
         int redRGB = Color.RED.getRGB();
         if (redRGB != capture.getRGB(SIZE/2, SIZE/2)) {
             throw new RuntimeException("Transparent frame is not transparent!");
         }
     }
 
+    public static void setOpaque(Window window, boolean opaque) {
+        Color bg = window.getBackground();
+        if (bg == null) {
+            bg = new Color(0, 0, 0, 0);
+        }
+        window.setBackground(new Color(bg.getRed(), bg.getGreen(), bg.getBlue(),
+                                       opaque ? 255 : 0));
+    }
+
     private static GraphicsConfiguration getGC() {
         GraphicsConfiguration transparencyCapableGC =
                 GraphicsEnvironment.getLocalGraphicsEnvironment()
                         .getDefaultScreenDevice().getDefaultConfiguration();
-        if (!AWTUtilities.isTranslucencyCapable(transparencyCapableGC)) {
+        if (!transparencyCapableGC.isTranslucencyCapable()) {
             transparencyCapableGC = null;
 
             GraphicsEnvironment env =
@@ -98,7 +112,7 @@
             for (int i = 0; i < devices.length && transparencyCapableGC == null; i++) {
                 GraphicsConfiguration[] configs = devices[i].getConfigurations();
                 for (int j = 0; j < configs.length && transparencyCapableGC == null; j++) {
-                    if (AWTUtilities.isTranslucencyCapable(configs[j])) {
+                    if (configs[j].isTranslucencyCapable()) {
                         transparencyCapableGC = configs[j];
                     }
                 }
--- a/test/jdk/javax/swing/JInternalFrame/6726866/bug6726866.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/test/jdk/javax/swing/JInternalFrame/6726866/bug6726866.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,15 +22,20 @@
  */
 
 /* @test
-   @bug 6726866
-   @summary Repainting artifacts when resizing or dragging JInternalFrames in non-opaque toplevel
-   @author Alexander Potochkin
+   @bug 6726866 8186617
+   @summary Repainting artifacts when resizing or dragging JInternalFrames in
+            non-opaque toplevel
    @run applet/manual=yesno bug6726866.html
 */
 
-import javax.swing.*;
-import java.awt.*;
-import java.lang.reflect.Method;
+import java.awt.Color;
+import java.awt.Window;
+
+import javax.swing.JApplet;
+import javax.swing.JDesktopPane;
+import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
+import javax.swing.JLabel;
 
 public class bug6726866 extends JApplet {
 
@@ -54,14 +59,12 @@
         frame.toFront();
     }
 
-    private void setWindowNonOpaque(Window w) {
-        try {
-            Class<?> c = Class.forName("com.sun.awt.AWTUtilities");
-            Method m = c.getMethod("setWindowOpaque", Window.class, boolean.class);
-            m.invoke(null, w, false);
+    public static void setWindowNonOpaque(Window window) {
+        Color bg = window.getBackground();
+        if (bg == null) {
+            bg = new Color(0, 0, 0, 0);
         }
-        catch (Exception e) {
-            e.printStackTrace();
-        }
+        window.setBackground(
+                new Color(bg.getRed(), bg.getGreen(), bg.getBlue(), 0));
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javax/swing/JList/ListSelectionModelTest.java	Wed Nov 01 10:00:38 2017 -0700
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @key headful
+ * @bug 6463710
+ * @summary Tests JListSelectionModel setSelection functionality
+ */
+
+import javax.swing.JList;
+import javax.swing.DefaultListModel;
+import javax.swing.ListSelectionModel;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager.LookAndFeelInfo;
+
+import static javax.swing.UIManager.getInstalledLookAndFeels;
+import static javax.swing.UIManager.setLookAndFeel;
+
+import java.util.Arrays;
+
+public class ListSelectionModelTest {
+
+    public static void main(String[] args) throws Exception {
+
+        final LookAndFeelInfo[] lookAndFeelInfoArray =
+                getInstalledLookAndFeels();
+
+        for (LookAndFeelInfo lookAndFeelInfo : lookAndFeelInfoArray) {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    try {
+                        CreateGUIAndTest(lookAndFeelInfo.getClassName());
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                        throw new RuntimeException("Exception while running test");
+                    }
+                }
+            });
+        }
+    }
+
+    static void CreateGUIAndTest(String lookAndFeel) throws Exception{
+        setLookAndFeel(lookAndFeel);
+        DefaultListModel listModel = new DefaultListModel();
+        for (int j = 0; j < 10; j++) {
+            listModel.add(j, "Item: " + j);
+        }
+
+        JList list = new JList(listModel);
+
+        ListSelectionModel selectionModel = list.getSelectionModel();
+        selectionModel.setSelectionMode(
+                ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+        selectionModel.setSelectionInterval(0, 2);
+        checkSelection(list, new int[]{0, 1, 2}, lookAndFeel);
+
+        selectionModel.addSelectionInterval(5, 7);
+        checkSelection(list, new int[]{0, 1, 2, 5, 6, 7}, lookAndFeel);
+
+        selectionModel
+                .setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
+        checkSelection(list, new int[]{0, 1, 2}, lookAndFeel);
+
+        selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        checkSelection(list, new int[]{0}, lookAndFeel);
+
+        selectionModel
+                .setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
+        selectionModel.addSelectionInterval(4, 5);
+        checkSelection(list, new int[]{4, 5}, lookAndFeel);
+
+        selectionModel.addSelectionInterval(0, 2);
+        checkSelection(list, new int[]{0, 1, 2}, lookAndFeel);
+
+        selectionModel.setSelectionMode(
+                ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+        selectionModel.addSelectionInterval(6, 7);
+        checkSelection(list, new int[]{0, 1, 2, 6, 7}, lookAndFeel);
+
+        System.out.println("Test passed for " + lookAndFeel);
+    }
+
+    static void checkSelection(JList list, int[] selectionArray,
+                               String lookAndFeel) throws RuntimeException {
+        int[] listSelection = list.getSelectedIndices();
+        if (listSelection.length != selectionArray.length) {
+            System.out.println("Expected: " + Arrays.toString(selectionArray));
+            System.out.println("Actual: " + Arrays.toString(listSelection));
+            throw new RuntimeException("Wrong selection for " + lookAndFeel);
+        }
+
+        Arrays.sort(listSelection);
+        Arrays.sort(selectionArray);
+
+        if (!Arrays.equals(listSelection, selectionArray)) {
+            System.out.println("Expected: " + Arrays.toString(selectionArray));
+            System.out.println("Actual: " + Arrays.toString(listSelection));
+            throw new RuntimeException("Wrong selection for " + lookAndFeel);
+        }
+    }
+}
--- a/test/jdk/javax/swing/JPopupMenu/7156657/bug7156657.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/test/jdk/javax/swing/JPopupMenu/7156657/bug7156657.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,23 +21,33 @@
  * questions.
  */
 
-import com.sun.awt.AWTUtilities;
-import sun.awt.SunToolkit;
-
-import javax.swing.*;
-import java.awt.*;
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.Window;
 import java.awt.image.BufferedImage;
 import java.util.concurrent.Callable;
 
+import javax.swing.JFrame;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.SwingUtilities;
+
+import sun.awt.SunToolkit;
+
 /*
    @test
-  @key headful
-   @bug 7156657
-   @summary Version 7 doesn't support translucent popup menus against a translucent window
+   @key headful
+   @bug 7156657 8186617
+   @summary Version 7 doesn't support translucent popup menus against a
+            translucent window
    @library ../../regtesthelpers
-   @author Pavel Porvatov
-   @modules java.desktop/com.sun.awt
-            java.desktop/sun.awt
+   @modules java.desktop/sun.awt
 */
 public class bug7156657 {
     private static JFrame lowerFrame;
@@ -54,8 +64,7 @@
             @Override
             public Boolean call() throws Exception {
                 frame = createFrame();
-
-                if (!AWTUtilities.isTranslucencyCapable(frame.getGraphicsConfiguration())) {
+                if (!frame.getGraphicsConfiguration().isTranslucencyCapable()) {
                     System.out.println("Translucency is not supported, the test skipped");
 
                     return true;
@@ -71,7 +80,7 @@
                 popupMenu.add(new TransparentMenuItem("2222"));
                 popupMenu.add(new TransparentMenuItem("3333"));
 
-                AWTUtilities.setWindowOpaque(frame, false);
+                setOpaque(frame, false);
                 JPanel pnContent = new JPanel();
                 pnContent.setBackground(new Color(255, 255, 255, 128));
                 frame.add(pnContent);
@@ -132,6 +141,14 @@
         System.out.println("The test passed");
     }
 
+    public static void setOpaque(Window window, boolean opaque) {
+        Color bg = window.getBackground();
+        if (bg == null) {
+            bg = new Color(0, 0, 0, 0);
+        }
+        window.setBackground(new Color(bg.getRed(), bg.getGreen(), bg.getBlue(),
+                                       opaque ? 255 : 0));
+    }
 
     private static JFrame createFrame() {
         JFrame result = new JFrame();
--- a/test/jdk/javax/swing/JTextPane/bug8025082.java	Wed Nov 01 16:45:28 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @key headful
- * @bug 8025082
- * @summary The behaviour of the highlight will be lost after clicking the set
- * button.
- * @run main bug8025082
- */
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.InputEvent;
-import javax.swing.*;
-
-public class bug8025082 {
-
-    private static JButton button;
-    private static JFrame frame;
-
-    public static void main(String[] args) throws Exception {
-        Robot robo = new Robot();
-        robo.delay(500);
-
-        SwingUtilities.invokeAndWait(new Runnable() {
-            public void run() {
-                createUI();
-            }
-        });
-
-        robo.waitForIdle();
-        Point point = getButtonLocationOnScreen();
-        robo.mouseMove(point.x, point.y);
-        robo.mousePress(InputEvent.BUTTON1_MASK);
-        robo.mouseRelease(InputEvent.BUTTON1_MASK);
-        robo.waitForIdle();
-
-        SwingUtilities.invokeAndWait(new Runnable() {
-            public void run() {
-                frame.dispose();
-            }
-        });
-    }
-
-    private static void createUI() {
-        frame = new JFrame();
-        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-        frame.setSize(500, 500);
-        JTextPane textpane = new JTextPane();
-        textpane.setText("Select Me");
-        textpane.selectAll();
-
-        JPanel panel = new JPanel(new BorderLayout());
-        panel.add(textpane, BorderLayout.CENTER);
-        button = new JButton("Press Me");
-        panel.add(button, BorderLayout.SOUTH);
-
-        button.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                if (!textpane.getCaret().isSelectionVisible()) {
-                    throw new RuntimeException("Highlight removed after "
-                            + "button click");
-                }
-            }
-        });
-
-        frame.getContentPane().add(panel);
-        frame.setLocationRelativeTo(null);
-        frame.setVisible(true);
-    }
-
-    private static Point getButtonLocationOnScreen() throws Exception {
-        final Point[] result = new Point[1];
-
-        SwingUtilities.invokeAndWait(new Runnable() {
-            @Override
-            public void run() {
-                Point point = button.getLocationOnScreen();
-                point.x += button.getWidth() / 2;
-                point.y += button.getHeight() / 2;
-                result[0] = point;
-            }
-        });
-        return result[0];
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javax/swing/text/DefaultCaret/HidingSelection/HidingSelectionTest.java	Wed Nov 01 10:00:38 2017 -0700
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.InputEvent;
+import java.awt.image.BufferedImage;
+
+/**
+ * @test
+ * @bug 8188081
+ * @summary  Text selection does not clear after focus is lost
+ * @run main HidingSelectionTest
+ */
+
+public class HidingSelectionTest {
+
+    private static JTextField field1;
+    private static JTextField field2;
+    private static JFrame frame;
+    private static Rectangle bounds;
+    private static JMenu menu;
+    private static JTextField anotherWindow;
+    private static Point menuLoc;
+    private static JFrame frame2;
+
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(() -> {
+            frame = new JFrame();
+            field1 = new JTextField("field1                       ");
+            field2 = new JTextField("field2                       ");
+            field1.setEditable(false);
+            field2.setEditable(false);
+            frame.getContentPane().setLayout(new FlowLayout());
+            frame.getContentPane().add(field1);
+            frame.getContentPane().add(field2);
+            JMenuBar menuBar = new JMenuBar();
+            menu = new JMenu("menu");
+            menu.add(new JMenuItem("item"));
+            menuBar.add(menu);
+            frame.setJMenuBar(menuBar);
+            frame.pack();
+            frame.setVisible(true);
+        });
+
+        Robot robot = new Robot();
+        robot.waitForIdle();
+        robot.delay(200);
+        SwingUtilities.invokeAndWait(() -> {
+            bounds = field2.getBounds();
+            bounds.setLocation(field2.getLocationOnScreen());
+        });
+        BufferedImage nosel = robot.createScreenCapture(bounds);
+
+        SwingUtilities.invokeAndWait(field2::requestFocus);
+        SwingUtilities.invokeAndWait(field2::selectAll);
+        robot.waitForIdle();
+        robot.delay(200);
+        BufferedImage sel = robot.createScreenCapture(bounds);
+
+        SwingUtilities.invokeAndWait(() -> {
+            menuLoc = menu.getLocationOnScreen();
+            menuLoc.translate(10, 10);
+        });
+        robot.mouseMove(menuLoc.x, menuLoc.y);
+        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+        robot.delay(50);
+        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+        robot.waitForIdle();
+        robot.delay(200);
+        if (!biEqual(robot.createScreenCapture(bounds), sel)) {
+            throw new RuntimeException("Test fails: menu hides selection");
+        }
+
+        SwingUtilities.invokeAndWait(
+                      MenuSelectionManager.defaultManager()::clearSelectedPath);
+        SwingUtilities.invokeAndWait(field1::requestFocus);
+        robot.waitForIdle();
+        robot.delay(200);
+        if (!biEqual(robot.createScreenCapture(bounds), nosel)) {
+            throw new RuntimeException(
+                    "Test fails: focus lost doesn't hide selection");
+        }
+
+        SwingUtilities.invokeAndWait(field2::requestFocus);
+        robot.waitForIdle();
+        SwingUtilities.invokeAndWait(() ->{
+            frame2 = new JFrame();
+            Point loc = frame.getLocationOnScreen();
+            loc.translate(0, frame.getHeight());
+            frame2.setLocation(loc);
+            anotherWindow = new JTextField("textField3");
+            frame2.add(anotherWindow);
+            frame2.pack();
+            frame2.setVisible(true);
+        });
+        robot.waitForIdle();
+        SwingUtilities.invokeAndWait(anotherWindow::requestFocus);
+        robot.waitForIdle();
+        robot.delay(200);
+        if (biEqual(robot.createScreenCapture(bounds), nosel)) {
+            throw new RuntimeException(
+                    "Test fails: switch window hides selection");
+        }
+
+        SwingUtilities.invokeAndWait(anotherWindow::selectAll);
+        robot.waitForIdle();
+        robot.delay(200);
+        if (biEqual(robot.createScreenCapture(bounds), sel)) {
+            throw new RuntimeException(
+                "Test fails: selection ownership is lost selection is shown");
+        }
+
+        SwingUtilities.invokeLater(frame2::dispose);
+        SwingUtilities.invokeLater(frame::dispose);
+    }
+
+    static boolean biEqual(BufferedImage i1, BufferedImage i2) {
+        if (i1.getWidth() == i2.getWidth() &&
+                                         i1.getHeight() == i2.getHeight()) {
+            for (int x = 0; x < i1.getWidth(); x++) {
+                for (int y = 0; y < i1.getHeight(); y++) {
+                    if (i1.getRGB(x, y) != i2.getRGB(x, y)) {
+                        return false;
+                    }
+                }
+            }
+            return true;
+        }
+        return false;
+    }
+}
--- a/test/langtools/jdk/jshell/MethodsTest.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/test/langtools/jdk/jshell/MethodsTest.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8080357 8167643
+ * @bug 8080357 8167643 8187359
  * @summary Tests for EvaluationState.methods
  * @build KullaTesting TestingInputStream ExpectedDiagnostic
  * @run testng MethodsTest
@@ -230,6 +230,24 @@
         assertActiveKeys();
     }
 
+    public void objectMethodNamedMethodsErrors() {
+        assertDeclareFail("boolean equals(double d1, double d2) {  return d1 == d2; }",
+                new ExpectedDiagnostic("jdk.eval.error.object.method", 8, 14, 8, -1, -1, Diagnostic.Kind.ERROR));
+        assertNumberOfActiveMethods(0);
+        assertActiveKeys();
+
+        assertDeclareFail("void          wait() { }",
+                new ExpectedDiagnostic("jdk.eval.error.object.method", 14, 18, 14, -1, -1, Diagnostic.Kind.ERROR));
+        assertNumberOfActiveMethods(0);
+        assertActiveKeys();
+
+        assertDeclareFail("  String   toString() throws NullPointerException{ }",
+                new ExpectedDiagnostic("jdk.eval.error.object.method", 11, 19, 11, -1, -1, Diagnostic.Kind.ERROR));
+        assertNumberOfActiveMethods(0);
+        assertActiveKeys();
+
+    }
+
 
     public void methodsAccessModifierIgnored() {
         Snippet f = methodKey(assertEval("public String f() {return null;}",
--- a/test/langtools/jdk/jshell/StartOptionTest.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/test/langtools/jdk/jshell/StartOptionTest.java	Wed Nov 01 10:00:38 2017 -0700
@@ -22,7 +22,7 @@
  */
 
 /*
- * @test 8151754 8080883 8160089 8170162 8166581 8172102 8171343 8178023
+ * @test 8151754 8080883 8160089 8170162 8166581 8172102 8171343 8178023 8186708 8179856
  * @summary Testing start-up options.
  * @modules jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
@@ -147,7 +147,7 @@
         for (String opt : new String[]{"-h", "--help"}) {
             start(s -> {
                 assertTrue(s.split("\n").length >= 7, "Not enough usage lines: " + s);
-                assertTrue(s.startsWith("Usage:   jshell <options>"), "Unexpect usage start: " + s);
+                assertTrue(s.startsWith("Usage:   jshell <option>..."), "Unexpect usage start: " + s);
                 assertTrue(s.contains("--show-version"), "Expected help: " + s);
                 assertFalse(s.contains("Welcome"), "Unexpected start: " + s);
             }, null, null, opt);
@@ -172,6 +172,38 @@
               s -> assertEquals(s.trim(), "Unknown option: unknown"), "--unknown");
     }
 
+    /**
+     * Test that input is read with "-" and there is no extra output.
+     * @throws Exception
+     */
+    public void testHypenFile() throws Exception {
+        cmdInStream = new ByteArrayInputStream("System.out.print(\"Hello\");\n".getBytes());
+        startWithUserOutput("", "Hello", "", "-");
+        cmdInStream = new ByteArrayInputStream("System.out.print(\"Hello\");\n".getBytes());
+        startWithUserOutput("", "Hello", "", "-", "-");
+        Compiler compiler = new Compiler();
+        Path path = compiler.getPath("markload.jsh");
+        compiler.writeToFile(path, "System.out.print(\"===\");");
+        cmdInStream = new ByteArrayInputStream("System.out.print(\"Hello\");\n".getBytes());
+        startWithUserOutput("", "===Hello===", "", path.toString(), "-", path.toString());
+        // check that errors go to standard error
+        cmdInStream = new ByteArrayInputStream(") Foobar".getBytes());
+        start(
+                s -> assertEquals(s.trim(), "", "cmdout: empty"),
+                s -> assertEquals(s.trim(), "", "userout: empty"),
+                s -> assertTrue(s.contains("illegal start of expression"),
+                            "cmderr: illegal start of expression"),
+                "-");
+    }
+
+    /**
+     * Test that non-existent load file sends output to stderr and does not start (no welcome).
+     * @throws Exception
+     */
+    public void testUnknownLoadFile() throws Exception {
+        start("", "File 'UNKNOWN' for 'jshell' is not found.", "UNKNOWN");
+    }
+
     public void testStartup() throws Exception {
         Compiler compiler = new Compiler();
         Path p = compiler.getPath("file.txt");
--- a/test/langtools/jdk/jshell/ToolBasicTest.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/test/langtools/jdk/jshell/ToolBasicTest.java	Wed Nov 01 10:00:38 2017 -0700
@@ -45,7 +45,6 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import java.util.Locale;
 import java.util.Scanner;
 import java.util.function.BiFunction;
 import java.util.function.Consumer;
@@ -408,10 +407,6 @@
                 (a) -> assertCommand(a, "x", "x ==> 20.0"),
                 (a) -> assertCommand(a, "a", "a ==> 10.0")
         );
-        Path unknown = compiler.getPath("UNKNOWN.jar");
-        test(Locale.ROOT, true, new String[]{unknown.toString()},
-                "|  File '" + unknown
-                + "' for 'jshell' is not found.");
     }
 
     public void testReset() {
--- a/test/langtools/jdk/jshell/ToolProviderTest.java	Wed Nov 01 16:45:28 2017 +0100
+++ b/test/langtools/jdk/jshell/ToolProviderTest.java	Wed Nov 01 10:00:38 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
+import java.nio.file.Path;
 import java.util.ServiceLoader;
 import java.util.function.Consumer;
 import javax.tools.Tool;
@@ -34,7 +35,7 @@
 
 /*
  * @test
- * @bug 8170044 8171343
+ * @bug 8170044 8171343 8179856
  * @summary Test ServiceLoader launching of jshell tool
  * @modules jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
@@ -97,4 +98,21 @@
                 null, null,
                 "--show-version");
     }
+    /**
+     * Test that input is read with "-" and there is no extra output.
+     * @throws Exception
+     */
+    @Override
+    public void testHypenFile() throws Exception {
+        cmdInStream = new ByteArrayInputStream("System.out.print(\"Hello\");\n".getBytes());
+        start("Hello", "", "-");
+        cmdInStream = new ByteArrayInputStream("System.out.print(\"Hello\");\n".getBytes());
+        start("Hello", "", "-", "-");
+        Compiler compiler = new Compiler();
+        Path path = compiler.getPath("markload.jsh");
+        compiler.writeToFile(path, "System.out.print(\"===\");");
+        cmdInStream = new ByteArrayInputStream("System.out.print(\"Hello\");\n".getBytes());
+        start("===Hello===", "", path.toString(), "-", path.toString());
+    }
+
 }