changeset 3225:ec4b255124a5

Automated merge with ssh://jfxsrc.us.oracle.com//javafx/8.0/MASTER/jfx/rt
author kcr
date Fri, 08 Feb 2013 13:14:55 -0800
parents 591738b789c3 debbe2155882
children b23f70501d49
files javafx-ui-common/src/com/sun/javafx/css/StyleManager.java javafx-ui-common/src/javafx/stage/Window.java javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ContextMenuContent.java
diffstat 3 files changed, 25 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-common/src/com/sun/javafx/css/StyleManager.java	Thu Feb 07 19:00:13 2013 -0500
+++ b/javafx-ui-common/src/com/sun/javafx/css/StyleManager.java	Fri Feb 08 13:14:55 2013 -0800
@@ -969,7 +969,14 @@
 
         clearCache();
         
-        final Iterator<Window> windows = Window.impl_getWindows();
+        final Iterator<Window> windows =
+                AccessController.doPrivileged(
+                        new PrivilegedAction<Iterator<Window>>() {
+                            @Override
+                            public Iterator<Window> run() {
+                                return Window.impl_getWindows();
+                            }
+                        });
         while (windows.hasNext()) {
             final Window window = windows.next();
             final Scene scene = window.getScene();
--- a/javafx-ui-common/src/javafx/stage/Window.java	Thu Feb 07 19:00:13 2013 -0500
+++ b/javafx-ui-common/src/javafx/stage/Window.java	Fri Feb 08 13:14:55 2013 -0800
@@ -24,9 +24,9 @@
  */
 package javafx.stage;
 
+import java.security.AllPermission;
 import java.security.AccessControlContext;
 import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.Iterator;
 
 import javafx.beans.property.DoubleProperty;
@@ -107,14 +107,12 @@
     @Deprecated
     @NoInit
     public static Iterator<Window> impl_getWindows() {
-        final Iterator iterator = AccessController.doPrivileged(
-            new PrivilegedAction<Iterator>() {
-                @Override public Iterator run() {
-                    return windowQueue.iterator();
-                }
-            }
-        );
-        return iterator;
+        final SecurityManager securityManager = System.getSecurityManager();
+        if (securityManager != null) {
+            securityManager.checkPermission(new AllPermission());
+        }
+
+        return (Iterator<Window>) windowQueue.iterator();
     }
 
     private final AccessControlContext acc = AccessController.getContext();
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ContextMenuContent.java	Thu Feb 07 19:00:13 2013 -0500
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ContextMenuContent.java	Fri Feb 08 13:14:55 2013 -0800
@@ -29,6 +29,8 @@
 
 package com.sun.javafx.scene.control.skin;
 
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -579,7 +581,14 @@
                 // of its content, then do nothing similar to the submenu case.
                 // walk thru all windows open to see if if this context menu is
                 // the owner window for another context menu, if so return.
-                Iterator<Window> iter = Window.impl_getWindows(); 
+                final Iterator<Window> iter =
+                        AccessController.doPrivileged(
+                                new PrivilegedAction<Iterator<Window>>() {
+                                    @Override
+                                    public Iterator<Window> run() {
+                                        return Window.impl_getWindows();
+                                    }
+                                });
                 while(iter.hasNext()) {
                     Window w = iter.next();
                     if (w instanceof ContextMenu && !(contextMenu == w)) {