Merge
authorprr
Fri, 13 Apr 2018 09:04:18 -0700
changeset 49697 59c4713c5d21
parent 49696 508e9f6632fd (diff)
parent 49683 fcff2daa6b1e (current diff)
child 49698 4c0c018a953f
Merge
make/lib/Awt2dLibraries.gmk
src/hotspot/share/gc/g1/concurrentMarkThread.cpp
src/hotspot/share/gc/g1/concurrentMarkThread.hpp
src/hotspot/share/gc/g1/concurrentMarkThread.inline.hpp
src/hotspot/share/gc/g1/g1CardLiveData.cpp
src/hotspot/share/gc/g1/g1CardLiveData.hpp
src/hotspot/share/gc/g1/g1CardLiveData.inline.hpp
src/java.security.jgss/unix/native/libj2gss/NativeFunc.c
src/java.security.jgss/unix/native/libj2gss/NativeFunc.h
test/jdk/ProblemList.txt
test/langtools/tools/javac/diags/examples/PreviewPlural/Bar.java
test/langtools/tools/javac/diags/examples/PreviewPluralAdditional/Bar.java
--- a/make/lib/Awt2dLibraries.gmk	Fri Apr 13 16:23:56 2018 +0100
+++ b/make/lib/Awt2dLibraries.gmk	Fri Apr 13 09:04:18 2018 -0700
@@ -619,6 +619,10 @@
   BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing
 endif
 
+# LDFLAGS clarification:
+#   Filter relevant linker flags disallowing unresolved symbols as we cannot
+#   build-time decide to which library to link against (libawt_headless or
+#   libawt_xawt). See JDK-8196516 for details.
 $(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
     NAME := fontmanager, \
     SRC := $(LIBFONTMANAGER_SRC), \
@@ -644,7 +648,8 @@
         truncwarn wvarhidenmem wvarhidemem wbadlkginit identexpected \
         hidevf w_novirtualdescr arrowrtn2, \
     DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146 4334 4819 4101, \
-    LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
+    LDFLAGS := $(subst -Xlinker -z -Xlinker defs,, \
+        $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB))) $(LDFLAGS_CXX_JDK) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
     LIBS := $(BUILD_LIBFONTMANAGER_FONTLIB), \
--- a/src/java.base/windows/native/launcher/java.manifest	Fri Apr 13 16:23:56 2018 +0100
+++ b/src/java.base/windows/native/launcher/java.manifest	Fri Apr 13 09:04:18 2018 -0700
@@ -36,8 +36,10 @@
 
   <!-- Indicate JDK is high-dpi aware. -->
   <asmv3:application>
-    <asmv3:windowsSettings  xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
-       <dpiAware>true/PM</dpiAware>
+    <asmv3:windowsSettings xmlns:dpi1="http://schemas.microsoft.com/SMI/2005/WindowsSettings"
+                           xmlns:dpi2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
+      <dpi1:dpiAware>true/PM</dpi1:dpiAware>
+      <dpi2:dpiAwareness>PerMonitorV2, PerMonitor, system</dpi2:dpiAwareness>
     </asmv3:windowsSettings>
   </asmv3:application>
 
--- a/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenUtilities.java	Fri Apr 13 16:23:56 2018 +0100
+++ b/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenUtilities.java	Fri Apr 13 09:04:18 2018 -0700
@@ -37,8 +37,7 @@
  * 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 {@code com.sun.awt.AWTUtilities}
- * class which adds additional functionality to AWT Windows, without adding new API to the
+ * attached to them. It adds additional functionality to AWT Windows, without adding new API to the
  * {@link java.awt.Window} class.
  *
  * Full screen operations can only be performed on top-level {@link Window}s that are also {@link RootPaneContainer}s.
--- a/src/java.desktop/macosx/classes/com/apple/eawt/event/GestureUtilities.java	Fri Apr 13 16:23:56 2018 +0100
+++ b/src/java.desktop/macosx/classes/com/apple/eawt/event/GestureUtilities.java	Fri Apr 13 09:04:18 2018 -0700
@@ -33,8 +33,7 @@
  * 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 {@code com.sun.awt.AWTUtilities}
- * class which adds additional functionality to AWT Windows, without adding new API to the
+ * attached to them. It adds additional functionality to AWT Windows, without adding new API to the
  * {@link java.awt.Window} class.
  *
  * To add a {@link GestureListener} to a top-level Swing window, use the {@link JRootPane} of the
--- a/src/java.desktop/share/classes/com/sun/awt/AWTUtilities.java	Fri Apr 13 16:23:56 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,500 +0,0 @@
-/*
- * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.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;
-
-import sun.awt.AWTAccessor;
-import sun.awt.SunToolkit;
-
-/**
- * A collection of utility methods for AWT.
- *
- * The functionality provided by the static methods of the class includes:
- * <ul>
- * <li>Setting shapes on top-level windows
- * <li>Setting a constant alpha value for each pixel of a top-level window
- * <li>Making a window non-opaque, after that it paints only explicitly
- * painted pixels on the screen, with arbitrary alpha values for every pixel.
- * <li>Setting a 'mixing-cutout' shape for a component.
- * </ul>
- * <p>
- * A "top-level window" is an instance of the {@code Window} class (or its
- * descendant, such as {@code JFrame}).
- * <p>
- * Some of the mentioned features may not be supported by the native platform.
- * To determine whether a particular feature is supported, the user must use
- * the {@code isTranslucencySupported()} method of the class passing a desired
- * translucency kind (a member of the {@code Translucency} enum) as an
- * argument.
- * <p>
- * The per-pixel alpha feature also requires the user to create her/his
- * windows using a translucency-capable graphics configuration.
- * The {@code isTranslucencyCapable()} method must
- * be used to verify whether any given GraphicsConfiguration supports
- * the translucency effects.
- * <p>
- * <b>WARNING</b>: This class is an implementation detail and only meant
- * for limited use outside of the core platform. This API may change
- * 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 {
-
-    /**
-     * The AWTUtilities class should not be instantiated
-     */
-    private AWTUtilities() {
-    }
-
-    /** Kinds of translucency supported by the underlying system.
-     *  @see #isTranslucencySupported
-     */
-    public static enum Translucency {
-        /**
-         * Represents support in the underlying system for windows each pixel
-         * of which is guaranteed to be either completely opaque, with
-         * an alpha value of 1.0, or completely transparent, with an alpha
-         * value of 0.0.
-         */
-        PERPIXEL_TRANSPARENT,
-
-        /**
-         * Represents support in the underlying system for windows all of
-         * the pixels of which have the same alpha value between or including
-         * 0.0 and 1.0.
-         */
-        TRANSLUCENT,
-
-        /**
-         * Represents support in the underlying system for windows that
-         * contain or might contain pixels with arbitrary alpha values
-         * between and including 0.0 and 1.0.
-         */
-        PERPIXEL_TRANSLUCENT;
-    }
-
-
-    /**
-     * Returns whether the given level of translucency is supported by
-     * the underlying system.
-     *
-     * Note that this method may sometimes return the value
-     * indicating that the particular level is supported, but
-     * the native windowing system may still not support the
-     * given level of translucency (due to the bugs in
-     * the windowing system).
-     *
-     * @param translucencyKind a kind of translucency support
-     *                         (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:
-                return isWindowShapingSupported();
-            case TRANSLUCENT:
-                return isWindowOpacitySupported();
-            case PERPIXEL_TRANSLUCENT:
-                return isWindowTranslucencySupported();
-        }
-        return false;
-    }
-
-
-    /**
-     * Returns whether the windowing system supports changing the opacity
-     * value of top-level windows.
-     * Note that this method may sometimes return true, but the native
-     * windowing system may still not support the concept of
-     * translucency (due to the bugs in the windowing system).
-     */
-    private static boolean isWindowOpacitySupported() {
-        Toolkit curToolkit = Toolkit.getDefaultToolkit();
-        if (!(curToolkit instanceof SunToolkit)) {
-            return false;
-        }
-        return ((SunToolkit)curToolkit).isWindowOpacitySupported();
-    }
-
-    /**
-     * Set the opacity of the window. The opacity is at the range [0..1].
-     * Note that setting the opacity level of 0 may or may not disable
-     * the mouse event handling on this window. This is
-     * a platform-dependent behavior.
-     *
-     * In order for this method to enable the translucency effect,
-     * the isTranslucencySupported() method should indicate that the
-     * TRANSLUCENT level of translucency is supported.
-     *
-     * <p>Also note that the window must not be in the full-screen mode
-     * when setting the opacity value &lt; 1.0f. Otherwise
-     * the IllegalArgumentException is thrown.
-     *
-     * @param window the window to set the opacity level to
-     * @param opacity the opacity level to set to the window
-     * @throws NullPointerException if the window argument is null
-     * @throws IllegalArgumentException if the opacity is out of
-     *                                  the range [0..1]
-     * @throws IllegalArgumentException if the window is in full screen mode,
-     *                                  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.");
-        }
-        window.setOpacity(opacity);
-    }
-
-    /**
-     * Get the opacity of the window. If the opacity has not
-     * yet being set, this method returns 1.0.
-     *
-     * @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 window.getOpacity();
-    }
-
-    /**
-     * Returns whether the windowing system supports changing the shape
-     * of top-level windows.
-     * 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)) {
-            return false;
-        }
-        return ((SunToolkit)curToolkit).isWindowShapingSupported();
-    }
-
-    /**
-     * Returns an object that implements the Shape interface and represents
-     * the shape previously set with the call to the setWindowShape() method.
-     * If no shape has been set yet, or the shape has been reset to null,
-     * this method returns null.
-     *
-     * @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 window.getShape();
-    }
-
-    /**
-     * Sets a shape for the given window.
-     * If the shape argument is null, this methods restores
-     * the default shape making the window rectangular.
-     * <p>Note that in order to set a shape, the window must be undecorated.
-     * If the window is decorated, this method ignores the {@code shape}
-     * argument and resets the shape to null.
-     * <p>Also note that the window must not be in the full-screen mode
-     * when setting a non-null shape. Otherwise the IllegalArgumentException
-     * is thrown.
-     * <p>Depending on the platform, the method may return without
-     * effecting the shape of the window if the window has a non-null warning
-     * string ({@link Window#getWarningString()}). In this case the passed
-     * shape object is ignored.
-     *
-     * @param window the window to set the shape to
-     * @param shape the shape to set to the window
-     * @throws NullPointerException if the window argument is null
-     * @throws IllegalArgumentException if the window is in full screen mode,
-     *                                  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.");
-        }
-        window.setShape(shape);
-    }
-
-    private static boolean isWindowTranslucencySupported() {
-        /*
-         * Per-pixel alpha is supported if all the conditions are TRUE:
-         *    1. The toolkit is a sort of SunToolkit
-         *    2. The toolkit supports translucency in general
-         *        (isWindowTranslucencySupported())
-         *    3. There's at least one translucency-capable
-         *        GraphicsConfiguration
-         */
-
-        Toolkit curToolkit = Toolkit.getDefaultToolkit();
-        if (!(curToolkit instanceof SunToolkit)) {
-            return false;
-        }
-
-        if (!((SunToolkit)curToolkit).isWindowTranslucencySupported()) {
-            return false;
-        }
-
-        GraphicsEnvironment env =
-            GraphicsEnvironment.getLocalGraphicsEnvironment();
-
-        // If the default GC supports translucency return true.
-        // It is important to optimize the verification this way,
-        // see CR 6661196 for more details.
-        if (isTranslucencyCapable(env.getDefaultScreenDevice()
-                    .getDefaultConfiguration()))
-        {
-            return true;
-        }
-
-        // ... otherwise iterate through all the GCs.
-        GraphicsDevice[] devices = env.getScreenDevices();
-
-        for (int i = 0; i < devices.length; i++) {
-            GraphicsConfiguration[] configs = devices[i].getConfigurations();
-            for (int j = 0; j < configs.length; j++) {
-                if (isTranslucencyCapable(configs[j])) {
-                    return true;
-                }
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Enables the per-pixel alpha support for the given window.
-     * Once the window becomes non-opaque (the isOpaque is set to false),
-     * the drawing sub-system is starting to respect the alpha value of each
-     * separate pixel. If a pixel gets painted with alpha color component
-     * equal to zero, it becomes visually transparent, if the alpha of the
-     * pixel is equal to 255, the pixel is fully opaque. Interim values
-     * of the alpha color component make the pixel semi-transparent (i.e.
-     * translucent).
-     * <p>Note that in order for the window to support the per-pixel alpha
-     * mode, the window must be created using the GraphicsConfiguration
-     * for which the {@link #isTranslucencyCapable}
-     * method returns true.
-     * <p>Also note that some native systems enable the per-pixel translucency
-     * mode for any window created using the translucency-compatible
-     * graphics configuration. However, it is highly recommended to always
-     * invoke the setWindowOpaque() method for these windows, at least for
-     * the sake of cross-platform compatibility reasons.
-     * <p>Also note that the window must not be in the full-screen mode
-     * when making it non-opaque. Otherwise the IllegalArgumentException
-     * is thrown.
-     * <p>If the window is a {@code Frame} or a {@code Dialog}, the window must
-     * be undecorated prior to enabling the per-pixel translucency effect (see
-     * {@link Frame#setUndecorated} and/or {@link Dialog#setUndecorated}).
-     * If the window becomes decorated through a subsequent call to the
-     * corresponding {@code setUndecorated()} method, the per-pixel
-     * translucency effect will be disabled and the opaque property reset to
-     * {@code true}.
-     * <p>Depending on the platform, the method may return without
-     * effecting the opaque property of the window if the window has a non-null
-     * warning string ({@link Window#getWarningString()}). In this case
-     * the passed 'isOpaque' value is ignored.
-     *
-     * @param window the window to set the shape to
-     * @param isOpaque whether the window must be opaque (true),
-     *                 or translucent (false)
-     * @throws NullPointerException if the window argument is null
-     * @throws IllegalArgumentException if the window uses
-     *                                  a GraphicsConfiguration for which the
-     *                                  {@code isTranslucencyCapable()}
-     *                                  method returns false
-     * @throws IllegalArgumentException if the window is in full screen mode,
-     *                                  and the isOpaque is false
-     * @throws IllegalArgumentException if the window is decorated and the
-     * 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(
-                    "The window argument should not be null.");
-        }
-        if (!isOpaque && !isTranslucencySupported(Translucency.PERPIXEL_TRANSLUCENT)) {
-            throw new UnsupportedOperationException(
-                    "The PERPIXEL_TRANSLUCENT translucency kind is not supported");
-        }
-        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));
-    }
-
-    /**
-     * Returns whether the window is opaque or translucent.
-     *
-     * @param window the window to set the shape to
-     * @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(
-                    "The window argument should not be null.");
-        }
-
-        return window.isOpaque();
-    }
-
-    /**
-     * Verifies whether a given GraphicsConfiguration supports
-     * the PERPIXEL_TRANSLUCENT kind of translucency.
-     * All windows that are intended to be used with the {@link #setWindowOpaque}
-     * method must be created using a GraphicsConfiguration for which this method
-     * returns true.
-     * <p>Note that some native systems enable the per-pixel translucency
-     * mode for any window created using a translucency-capable
-     * graphics configuration. However, it is highly recommended to always
-     * invoke the setWindowOpaque() method for these windows, at least
-     * for the sake of cross-platform compatibility reasons.
-     *
-     * @param gc GraphicsConfiguration
-     * @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");
-        }
-        /*
-        return gc.isTranslucencyCapable();
-        */
-        Toolkit curToolkit = Toolkit.getDefaultToolkit();
-        if (!(curToolkit instanceof SunToolkit)) {
-            return false;
-        }
-        return ((SunToolkit)curToolkit).isTranslucencyCapable(gc);
-    }
-
-    /**
-     * Sets a 'mixing-cutout' shape for the given component.
-     *
-     * By default a lightweight component is treated as an opaque rectangle for
-     * the purposes of the Heavyweight/Lightweight Components Mixing feature.
-     * This method enables developers to set an arbitrary shape to be cut out
-     * from heavyweight components positioned underneath the lightweight
-     * component in the z-order.
-     * <p>
-     * The {@code shape} argument may have the following values:
-     * <ul>
-     * <li>{@code null} - reverts the default cutout shape (the rectangle equal
-     * to the component's {@code getBounds()})
-     * <li><i>empty-shape</i> - does not cut out anything from heavyweight
-     * components. This makes the given lightweight component effectively
-     * transparent. Note that descendants of the lightweight component still
-     * affect the shapes of heavyweight components.  An example of an
-     * <i>empty-shape</i> is {@code new Rectangle()}.
-     * <li><i>non-empty-shape</i> - the given shape will be cut out from
-     * heavyweight components.
-     * </ul>
-     * <p>
-     * The most common example when the 'mixing-cutout' shape is needed is a
-     * glass pane component. The {@link JRootPane#setGlassPane} method
-     * automatically sets the <i>empty-shape</i> as the 'mixing-cutout' shape
-     * for the given glass pane component.  If a developer needs some other
-     * 'mixing-cutout' shape for the glass pane (which is rare), this must be
-     * changed manually after installing the glass pane to the root pane.
-     * <p>
-     * Note that the 'mixing-cutout' shape neither affects painting, nor the
-     * mouse events handling for the given component. It is used exclusively
-     * for the purposes of the Heavyweight/Lightweight Components Mixing
-     * feature.
-     *
-     * @param component the component that needs non-default
-     * '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(forRemoval = true, since = "9")
-    public static void setComponentMixingCutoutShape(Component component,
-            Shape shape)
-    {
-        if (component == null) {
-            throw new NullPointerException(
-                    "The component argument should not be null.");
-        }
-
-        component.setMixingCutoutShape(shape);
-    }
-}
-
--- a/src/java.desktop/share/classes/javax/swing/JViewport.java	Fri Apr 13 16:23:56 2018 +0100
+++ b/src/java.desktop/share/classes/javax/swing/JViewport.java	Fri Apr 13 09:04:18 2018 -0700
@@ -61,7 +61,7 @@
  * <p>
  * <b>NOTE:</b>We have implemented a faster scrolling algorithm that
  * does not require a buffer to draw in. The algorithm works as follows:
- * <ol><li>The view and parent view and checked to see if they are
+ * <ol><li>The view and parent view are checked to see if they are
  * <code>JComponents</code>,
  * if they aren't, stop and repaint the whole viewport.
  * <li>If the viewport is obscured by an ancestor, stop and repaint the whole
--- a/src/java.desktop/share/classes/sun/awt/image/BufImgSurfaceData.java	Fri Apr 13 16:23:56 2018 +0100
+++ b/src/java.desktop/share/classes/sun/awt/image/BufImgSurfaceData.java	Fri Apr 13 09:04:18 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
 
 package sun.awt.image;
 
-import java.awt.Color;
 import java.awt.Rectangle;
 import java.awt.GraphicsConfiguration;
 import java.awt.image.ColorModel;
@@ -38,9 +37,6 @@
 
 import sun.java2d.SurfaceData;
 import sun.java2d.SunGraphics2D;
-import sun.java2d.StateTrackable;
-import sun.java2d.StateTrackable.*;
-import sun.java2d.StateTracker;
 import sun.java2d.loops.SurfaceType;
 import sun.java2d.loops.CompositeType;
 import sun.java2d.loops.RenderLoops;
@@ -446,8 +442,6 @@
         // their pixels are immediately retrievable anyway.
     }
 
-    private static native void freeNativeICMData(long pData);
-
     /**
      * Returns destination Image associated with this SurfaceData.
      */
@@ -471,13 +465,5 @@
         private ICMColorData(long pData) {
             this.pData = pData;
         }
-
-        @SuppressWarnings("deprecation")
-        public void finalize() {
-            if (pData != 0L) {
-                BufImgSurfaceData.freeNativeICMData(pData);
-                pData = 0L;
-            }
-        }
     }
 }
--- a/src/java.desktop/share/native/libawt/awt/image/BufImgSurfaceData.c	Fri Apr 13 16:23:56 2018 +0100
+++ b/src/java.desktop/share/native/libawt/awt/image/BufImgSurfaceData.c	Fri Apr 13 09:04:18 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
 #include "jni_util.h"
 /* Define uintptr_t */
 #include "gdefs.h"
+#include "Disposer.h"
 
 /**
  * This include file contains support code for loops using the
@@ -80,19 +81,6 @@
 }
 
 /*
- * Class:     sun_java2d_SurfaceData
- * Method:    freeNativeICMData
- * Signature: (Ljava/awt/image/IndexColorModel;)V
- */
-JNIEXPORT void JNICALL
-Java_sun_awt_image_BufImgSurfaceData_freeNativeICMData
-    (JNIEnv *env, jclass sd, jlong pData)
-{
-    ColorData *cdata = (ColorData*)jlong_to_ptr(pData);
-    freeICMColorData(cdata);
-}
-
-/*
  * Class:     sun_awt_image_BufImgSurfaceData
  * Method:    initOps
  * Signature: (Ljava/lang/Object;IIIII)V
@@ -140,6 +128,15 @@
 }
 
 /*
+ * Releases native structures associated with BufImgSurfaceData.ICMColorData.
+ */
+static void BufImg_Dispose_ICMColorData(JNIEnv *env, jlong pData)
+{
+    ColorData *cdata = (ColorData*)jlong_to_ptr(pData);
+    freeICMColorData(cdata);
+}
+
+/*
  * Method for disposing native BufImgSD
  */
 static void BufImg_Dispose(JNIEnv *env, SurfaceDataOps *ops)
@@ -373,6 +370,7 @@
             }
 
             (*env)->SetObjectField(env, bisdo->icm, colorDataID, colorData);
+            Disposer_AddRecord(env, colorData, BufImg_Dispose_ICMColorData, pData);
         }
     }
 
--- a/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java	Fri Apr 13 16:23:56 2018 +0100
+++ b/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java	Fri Apr 13 09:04:18 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,6 +47,7 @@
 import sun.awt.AWTAutoShutdown;
 import sun.awt.AWTPermissions;
 import sun.awt.AppContext;
+import sun.awt.DisplayChangedListener;
 import sun.awt.LightweightFrame;
 import sun.awt.SunToolkit;
 import sun.awt.util.ThreadGroupUtils;
@@ -802,9 +803,10 @@
     public native int getMaximumCursorColors();
 
     static void paletteChanged() {
-        ((Win32GraphicsEnvironment)GraphicsEnvironment
-        .getLocalGraphicsEnvironment())
-        .paletteChanged();
+        Object lge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        if (lge instanceof DisplayChangedListener) {
+            ((DisplayChangedListener) lge).paletteChanged();
+        }
     }
 
     /*
@@ -816,9 +818,10 @@
         EventQueue.invokeLater(new Runnable() {
             @Override
             public void run() {
-                ((Win32GraphicsEnvironment)GraphicsEnvironment
-                .getLocalGraphicsEnvironment())
-                .displayChanged();
+                Object lge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+                if (lge instanceof DisplayChangedListener) {
+                    ((DisplayChangedListener) lge).displayChanged();
+                }
             }
         });
     }
--- a/test/jdk/ProblemList.txt	Fri Apr 13 16:23:56 2018 +0100
+++ b/test/jdk/ProblemList.txt	Fri Apr 13 09:04:18 2018 -0700
@@ -171,7 +171,6 @@
 java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java 6990210 generic-all
 java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html 4931413 windows-all
 java/awt/FullScreen/FullScreenInsets/FullScreenInsets.java 7019055 windows-all
-java/awt/FullScreen/UninitializedDisplayModeChangeTest/UninitializedDisplayModeChangeTest.java 8198335 windows-all
 java/awt/Focus/8013611/JDK8013611.java 8175366 windows-all,macosx-all
 java/awt/Focus/6378278/InputVerifierTest.java 8198616 macosx-all
 java/awt/Focus/6382144/EndlessLoopTest.java 8198617 macosx-all
--- a/test/jdk/java/awt/FullScreen/UninitializedDisplayModeChangeTest/UninitializedDisplayModeChangeTest.java	Fri Apr 13 16:23:56 2018 +0100
+++ b/test/jdk/java/awt/FullScreen/UninitializedDisplayModeChangeTest/UninitializedDisplayModeChangeTest.java	Fri Apr 13 09:04:18 2018 -0700
@@ -23,12 +23,13 @@
 
 /**
  * @test
- * @bug 6358034 6568560 8198613
+ * @bug 6358034 6568560 8198613 8198335
  * @key headful
  * @summary Tests that no exception is thrown when display mode is changed
  *          externally
  * @compile UninitializedDisplayModeChangeTest.java DisplayModeChanger.java
  * @run main/othervm UninitializedDisplayModeChangeTest
+ * @run main/othervm -Djava.awt.headless=true UninitializedDisplayModeChangeTest
  */
 
 import java.awt.EventQueue;
--- a/test/jdk/java/awt/event/SequencedEvent/SequencedEventTest.java	Fri Apr 13 16:23:56 2018 +0100
+++ b/test/jdk/java/awt/event/SequencedEvent/SequencedEventTest.java	Fri Apr 13 09:04:18 2018 -0700
@@ -25,7 +25,8 @@
  * @test
  * @bug 8152974
  * @key headful
- * @summary AWT hang occurrs when sequenced events arrive out of sequence
+ * @modules java.desktop/sun.awt
+ * @summary AWT hang occurs when sequenced events arrive out of sequence
  * @run main SequencedEventTest
  */
 import sun.awt.AppContext;
@@ -84,7 +85,8 @@
                     peekEvent(java.awt.event.FocusEvent.FOCUS_LAST + 1);
 
             if (ev != null)
-                throw new RuntimeException("Test case failed!");
+                throw new RuntimeException("Test case failed, since all the sequenced events" +
+                "are not flushed!" + ev);
         } catch (InterruptedException e) {
             throw new RuntimeException("Test case failed." + e.getMessage());
         }
@@ -163,7 +165,7 @@
              */
             Class<? extends AWTEvent> seqClass = (Class<? extends AWTEvent>) Class.forName("java.awt.SequencedEvent");
             Constructor<? extends AWTEvent> seqConst = seqClass.getConstructor(AWTEvent.class);
-            seqConst.setAccessible(true);;
+            seqConst.setAccessible(true);
             return seqConst.newInstance(wrapMe);
         } catch (Throwable err) {
             throw new RuntimeException("Unable to instantiate SequencedEvent",err);
--- a/test/jdk/sun/java2d/marlin/ClipShapeTest.java	Fri Apr 13 16:23:56 2018 +0100
+++ b/test/jdk/sun/java2d/marlin/ClipShapeTest.java	Fri Apr 13 09:04:18 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,14 +58,14 @@
  * for paths made of either 9 lines, 4 quads, 2 cubics (random)
  * Note: Use the argument -slow to run more intensive tests (too much time)
  *
- * @run main/othervm/timeout=120 -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine ClipShapeTest -poly
- * @run main/othervm/timeout=240 -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine ClipShapeTest -poly -doDash
- * @run main/othervm/timeout=120 -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine ClipShapeTest -cubic
- * @run main/othervm/timeout=240 -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine ClipShapeTest -cubic -doDash
- * @run main/othervm/timeout=120 -Dsun.java2d.renderer=sun.java2d.marlin.DMarlinRenderingEngine ClipShapeTest -poly
- * @run main/othervm/timeout=240 -Dsun.java2d.renderer=sun.java2d.marlin.DMarlinRenderingEngine ClipShapeTest -poly -doDash
- * @run main/othervm/timeout=120 -Dsun.java2d.renderer=sun.java2d.marlin.DMarlinRenderingEngine ClipShapeTest -cubic
- * @run main/othervm/timeout=240 -Dsun.java2d.renderer=sun.java2d.marlin.DMarlinRenderingEngine ClipShapeTest -cubic -doDash
+ * @run main/othervm/timeout=300 -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine ClipShapeTest -poly
+ * @run main/othervm/timeout=300 -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine ClipShapeTest -poly -doDash
+ * @run main/othervm/timeout=300 -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine ClipShapeTest -cubic
+ * @run main/othervm/timeout=300 -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine ClipShapeTest -cubic -doDash
+ * @run main/othervm/timeout=300 -Dsun.java2d.renderer=sun.java2d.marlin.DMarlinRenderingEngine ClipShapeTest -poly
+ * @run main/othervm/timeout=300 -Dsun.java2d.renderer=sun.java2d.marlin.DMarlinRenderingEngine ClipShapeTest -poly -doDash
+ * @run main/othervm/timeout=300 -Dsun.java2d.renderer=sun.java2d.marlin.DMarlinRenderingEngine ClipShapeTest -cubic
+ * @run main/othervm/timeout=300 -Dsun.java2d.renderer=sun.java2d.marlin.DMarlinRenderingEngine ClipShapeTest -cubic -doDash
 */
 public final class ClipShapeTest {