提交 e5b3d5d5 编写于 作者: A asaha

Merge

......@@ -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
......
......@@ -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) {
......
......@@ -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() {
......
......@@ -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) {
......
/*
* 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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册