changeset 9766:5b64910ad0b7

8156591: IllegalAccessError in JFXPanel after fix for JDK-8080395 Reviewed-by: prr
author kcr
date Mon, 09 May 2016 16:32:38 -0700
parents db27fc0c6b8b
children 6618e541bac7
files modules/swing/src/main/java/javafx/embed/swing/JFXPanel.java
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/modules/swing/src/main/java/javafx/embed/swing/JFXPanel.java	Mon May 09 13:34:34 2016 +1200
+++ b/modules/swing/src/main/java/javafx/embed/swing/JFXPanel.java	Mon May 09 16:32:38 2016 -0700
@@ -76,7 +76,6 @@
 import java.lang.reflect.Method;
 import java.util.concurrent.atomic.AtomicInteger;
 import sun.awt.AppContext;
-import sun.awt.CausedFocusEvent;
 import sun.awt.SunToolkit;
 import sun.java2d.SunGraphics2D;
 import sun.java2d.SurfaceData;
@@ -592,14 +591,19 @@
         int focusCause = (focused ? AbstractEvents.FOCUSEVENT_ACTIVATED :
                                       AbstractEvents.FOCUSEVENT_DEACTIVATED);
 
+        // FIXME: JDK-8156592 -- replace this with FocusEvent.getCause()
+        // which is now public API, once we update to using a newer JDK.
+        // NOTE: the focusCause is unused at present.
+        /*
         if (focused && (e instanceof CausedFocusEvent)) {
-            CausedFocusEvent ce = (CausedFocusEvent)e;
+            CausedFocusEvent ce = (CausedFocusEvent) e;
             if (ce.getCause() == CausedFocusEvent.Cause.TRAVERSAL_FORWARD) {
                 focusCause = AbstractEvents.FOCUSEVENT_TRAVERSED_FORWARD;
-                        } else if (ce.getCause() == sun.awt.CausedFocusEvent.Cause.TRAVERSAL_BACKWARD) {
+            } else if (ce.getCause() == sun.awt.CausedFocusEvent.Cause.TRAVERSAL_BACKWARD) {
                 focusCause = AbstractEvents.FOCUSEVENT_TRAVERSED_BACKWARD;
-                        }
-                    }
+            }
+        }
+        */
         stagePeer.setFocused(focused, focusCause);
     }