--- a/jdk/src/share/classes/java/awt/Toolkit.java Mon Apr 07 00:31:06 2014 +0200
+++ b/jdk/src/share/classes/java/awt/Toolkit.java Thu Apr 24 21:09:05 2014 +0400
@@ -2568,23 +2568,30 @@
public void firePropertyChange(final PropertyChangeEvent evt) {
Object oldValue = evt.getOldValue();
Object newValue = evt.getNewValue();
+ String propertyName = evt.getPropertyName();
if (oldValue != null && newValue != null && oldValue.equals(newValue)) {
return;
}
+ Runnable updater = new Runnable() {
+ public void run() {
+ PropertyChangeSupport pcs = (PropertyChangeSupport)
+ AppContext.getAppContext().get(PROP_CHANGE_SUPPORT_KEY);
+ if (null != pcs) {
+ pcs.firePropertyChange(evt);
+ }
+ }
+ };
+ final AppContext currentAppContext = AppContext.getAppContext();
for (AppContext appContext : AppContext.getAppContexts()) {
if (null == appContext || appContext.isDisposed()) {
continue;
}
- final PeerEvent e = new PeerEvent(source,
- () -> {
- PropertyChangeSupport pcs = (PropertyChangeSupport)
- AppContext.getAppContext().get(PROP_CHANGE_SUPPORT_KEY);
- if (null != pcs) {
- pcs.firePropertyChange(evt);
- }
- },
- PeerEvent.ULTIMATE_PRIORITY_EVENT);
- SunToolkit.postEvent(appContext, e);
+ if (currentAppContext == appContext) {
+ updater.run();
+ } else {
+ final PeerEvent e = new PeerEvent(source, updater, PeerEvent.ULTIMATE_PRIORITY_EVENT);
+ SunToolkit.postEvent(appContext, e);
+ }
}
}
}