jdk/src/share/classes/java/awt/Dialog.java
changeset 12645 e0d32945f6ab
parent 9202 164591974d77
child 12661 6cf8b7116579
--- a/jdk/src/share/classes/java/awt/Dialog.java	Fri May 04 21:25:08 2012 +0400
+++ b/jdk/src/share/classes/java/awt/Dialog.java	Thu May 10 20:05:12 2012 +0400
@@ -1037,7 +1037,7 @@
                 predictedFocusOwner = getMostRecentFocusOwner();
                 if (conditionalShow(predictedFocusOwner, time)) {
                     modalFilter = ModalEventFilter.createFilterForDialog(this);
-                    Conditional cond = new Conditional() {
+                    final Conditional cond = new Conditional() {
                         @Override
                         public boolean evaluate() {
                             return windowClosingException == null;
@@ -1067,7 +1067,12 @@
 
                     modalityPushed();
                     try {
-                        EventQueue eventQueue = Toolkit.getDefaultToolkit().getSystemEventQueue();
+                        final EventQueue eventQueue = AccessController.doPrivileged(
+                            new PrivilegedAction<EventQueue>() {
+                                public EventQueue run() {
+                                    return Toolkit.getDefaultToolkit().getSystemEventQueue();
+                                }
+                        });
                         secondaryLoop = eventQueue.createSecondaryLoop(cond, modalFilter, 0);
                         if (!secondaryLoop.enter()) {
                             secondaryLoop = null;