diff options
author | asaha <none@none> | 2014-05-28 12:45:12 -0700 |
---|---|---|
committer | asaha <none@none> | 2014-05-28 12:45:12 -0700 |
commit | f3fd0613432ea7f2cb13a810f4480c402ccb62ea (patch) | |
tree | 4e248a9344741a659c94d77229cc9ccfade71b6a | |
parent | 6a183300bf2687420cc74250b53422b14372c798 (diff) | |
parent | aa101321874bcdea4c60daddbd1929d3d49e2c23 (diff) |
Merge
-rw-r--r-- | .hgtags | 1 | ||||
-rw-r--r-- | src/windows/classes/sun/awt/windows/ThemeReader.java | 32 | ||||
-rw-r--r-- | src/windows/classes/sun/awt/windows/WToolkit.java | 11 | ||||
-rw-r--r-- | src/windows/classes/sun/awt/windows/WWindowPeer.java | 1 | ||||
-rw-r--r-- | test/java/lang/SecurityManager/CheckPackageAccess.java | 7 |
5 files changed, 38 insertions, 14 deletions
@@ -279,6 +279,7 @@ dc8eb8ba138a53df4cc80f6379ed25ef20644667 jdk8u11-b06 69ea8bc3ce29eda152d9c2ebea91a9ce233bde9e jdk8u11-b07 bec9dcd4c06358154cce431c4b70da56530827de jdk8u11-b08 801e730c85eb822ac3b00466b32d42e089cb7233 jdk8u11-b09 +105753f0465e534e3664d0935016f5a0d061829d jdk8u11-b10 9543b632ab87368c887d8b29b21157ebb44228d0 jdk8u20-b02 5a9f04957f826ce23639479c9791c7d8fd282b01 jdk8u20-b03 c347889445c1153f11aaa56092d44a911e497454 jdk8u20-b04 diff --git a/src/windows/classes/sun/awt/windows/ThemeReader.java b/src/windows/classes/sun/awt/windows/ThemeReader.java index 632489964..3bd048a05 100644 --- a/src/windows/classes/sun/awt/windows/ThemeReader.java +++ b/src/windows/classes/sun/awt/windows/ThemeReader.java @@ -60,18 +60,12 @@ public final class ThemeReader { new ReentrantReadWriteLock(); private static final Lock readLock = readWriteLock.readLock(); private static final Lock writeLock = readWriteLock.writeLock(); + private static volatile boolean valid = false; static void flush() { - writeLock.lock(); - try { - // Close old themes. - for (Long value : widgetToTheme.values()) { - closeTheme(value.longValue()); - } - widgetToTheme.clear(); - } finally { - writeLock.unlock(); - } + // Could be called on Toolkit thread, so do not try to aquire locks + // to avoid deadlock with theme initialization + valid = false; } public static native boolean isThemed(); @@ -98,6 +92,24 @@ public final class ThemeReader { // returns theme value // this method should be invoked with readLock locked private static Long getTheme(String widget) { + if (!valid) { + readLock.unlock(); + writeLock.lock(); + try { + if (!valid) { + // Close old themes. + for (Long value : widgetToTheme.values()) { + closeTheme(value); + } + widgetToTheme.clear(); + valid = true; + } + } finally { + readLock.lock(); + writeLock.unlock(); + } + } + // mostly copied from the javadoc for ReentrantReadWriteLock Long theme = widgetToTheme.get(widget); if (theme == null) { diff --git a/src/windows/classes/sun/awt/windows/WToolkit.java b/src/windows/classes/sun/awt/windows/WToolkit.java index 702e71d98..5a72c9d87 100644 --- a/src/windows/classes/sun/awt/windows/WToolkit.java +++ b/src/windows/classes/sun/awt/windows/WToolkit.java @@ -929,7 +929,16 @@ public final class WToolkit extends SunToolkit implements Runnable { * Windows doesn't always send WM_SETTINGCHANGE when it should. */ private void windowsSettingChange() { - EventQueue.invokeLater(this::updateProperties); + if (AppContext.getAppContext() == null) { + // We cannot post the update to any EventQueue. Listeners will + // be called on EDTs by DesktopPropertyChangeSupport + updateProperties(); + } else { + // Cannot update on Toolkit thread. + // DesktopPropertyChangeSupport will call listeners on Toolkit + // thread if it has AppContext (standalone mode) + EventQueue.invokeLater(this::updateProperties); + } } private synchronized void updateProperties() { diff --git a/src/windows/classes/sun/awt/windows/WWindowPeer.java b/src/windows/classes/sun/awt/windows/WWindowPeer.java index 33f27ac56..128415252 100644 --- a/src/windows/classes/sun/awt/windows/WWindowPeer.java +++ b/src/windows/classes/sun/awt/windows/WWindowPeer.java @@ -452,6 +452,7 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, @SuppressWarnings("unchecked") public static long[] getActiveWindowHandles() { AppContext appContext = AppContext.getAppContext(); + if (appContext == null) return null; synchronized (appContext) { List<WWindowPeer> l = (List<WWindowPeer>)appContext.get(ACTIVE_WINDOWS_KEY); if (l == null) { diff --git a/test/java/lang/SecurityManager/CheckPackageAccess.java b/test/java/lang/SecurityManager/CheckPackageAccess.java index a8e75896a..8935b666b 100644 --- a/test/java/lang/SecurityManager/CheckPackageAccess.java +++ b/test/java/lang/SecurityManager/CheckPackageAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 6741606 7146431 8000450 8019830 8022945 + * @bug 6741606 7146431 8000450 8019830 8022945 8027144 8041633 * @summary Make sure all restricted packages listed in the package.access * property in the java.security file are blocked * @run main/othervm CheckPackageAccess @@ -84,7 +84,8 @@ public class CheckPackageAccess { "org.jcp.xml.dsig.internal.", "jdk.internal.", "jdk.nashorn.internal.", - "jdk.nashorn.tools." + "jdk.nashorn.tools.", + "com.sun.activation.registries." }; public static void main(String[] args) throws Exception { |