changeset 7105:339db617ff3b

RT-37224: Make SwingFXUtils.installFwEventQueue() and removeFwEventQueue() private Reviewed-by: snorthov
author Anthony Petrov <anthony.petrov@oracle.com>
date Thu, 22 May 2014 13:28:34 +0400
parents e4e9bbcaf688
children d0ccd8cdfa58
files modules/graphics/src/main/java/com/sun/javafx/application/PlatformImpl.java modules/swing/src/main/java/javafx/embed/swing/SwingFXUtils.java
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/javafx/application/PlatformImpl.java	Thu May 22 09:27:09 2014 +0200
+++ b/modules/graphics/src/main/java/com/sun/javafx/application/PlatformImpl.java	Thu May 22 13:28:34 2014 +0400
@@ -228,7 +228,11 @@
         //Use reflection in case we are running compact profile
         try {
             Class swingFXUtilsClass = Class.forName("javafx.embed.swing.SwingFXUtils");
-            Method installFwEventQueue = swingFXUtilsClass.getMethod(methodName);
+            Method installFwEventQueue = swingFXUtilsClass.getDeclaredMethod(methodName);
+            AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+                installFwEventQueue.setAccessible(true);
+                return null;
+            });
 
             waitForStart();
             installFwEventQueue.invoke(null);
--- a/modules/swing/src/main/java/javafx/embed/swing/SwingFXUtils.java	Thu May 22 09:27:09 2014 +0200
+++ b/modules/swing/src/main/java/javafx/embed/swing/SwingFXUtils.java	Thu May 22 13:28:34 2014 +0400
@@ -269,12 +269,12 @@
     }
 
     //Called with reflection from PlatformImpl to avoid dependency
-    public static void installFwEventQueue() {
+    private static void installFwEventQueue() {
         AWTAccessor.getEventQueueAccessor().setFwDispatcher(getEventQueue(), new FXDispatcher());
     }
 
     //Called with reflection from PlatformImpl to avoid dependency
-    public static void removeFwEventQueue() {
+    private static void removeFwEventQueue() {
         AWTAccessor.getEventQueueAccessor().setFwDispatcher(getEventQueue(), null);
     }
 }