Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8119206

ClassCastException while showing ContextMenu

XMLWordPrintable

      When I navigate a context menu on OS X with Java 8.0-b82 it leads to the following exception:

      2013-03-22 09:59:21.109 java[8982:707] java.lang.ClassCastException: javafx.scene.control.Separator cannot be cast to com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContainer
      at com.sun.javafx.scene.control.skin.ContextMenuContent.updateVisualItems(ContextMenuContent.java:244)
      at com.sun.javafx.scene.control.skin.ContextMenuContent.updateItems(ContextMenuContent.java:177)
      at com.sun.javafx.scene.control.skin.ContextMenuContent.access$000(ContextMenuContent.java:90)
      at com.sun.javafx.scene.control.skin.ContextMenuContent$1.invalidated(ContextMenuContent.java:118)
      at javafx.beans.WeakInvalidationListener.invalidated(WeakInvalidationListener.java:81)
      at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:339)
      at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
      at javafx.beans.property.ReadOnlyBooleanWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyBooleanWrapper.java:177)
      at javafx.beans.property.ReadOnlyBooleanWrapper$ReadOnlyPropertyImpl.access$100(ReadOnlyBooleanWrapper.java:147)
      at javafx.beans.property.ReadOnlyBooleanWrapper.fireValueChangedEvent(ReadOnlyBooleanWrapper.java:143)
      at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:108)
      at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:141)
      at javafx.stage.Window.setShowing(Window.java:784)
      at javafx.stage.Window.hide(Window.java:809)
      at javafx.stage.PopupWindow.hide(PopupWindow.java:424)
      at javafx.scene.control.ContextMenu.hide(ContextMenu.java:294)
      at javafx.stage.PopupWindow.doAutoHide(PopupWindow.java:521)
      at javafx.stage.PopupWindow$PopupEventRedirector.handleFocusUngrabEvent(PopupWindow.java:745)
      at javafx.stage.PopupWindow$PopupEventRedirector.handleRedirectedEvent(PopupWindow.java:682)
      at com.sun.javafx.event.EventRedirector.dispatchCapturingEvent(EventRedirector.java:106)
      at com.sun.javafx.event.CompositeEventDispatcher.dispatchCapturingEvent(CompositeEventDispatcher.java:43)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:52)
      at com.sun.javafx.event.EventRedirector.redirectEvent(EventRedirector.java:124)
      at com.sun.javafx.event.EventRedirector.dispatchCapturingEvent(EventRedirector.java:103)
      at com.sun.javafx.event.CompositeEventDispatcher.dispatchCapturingEvent(CompositeEventDispatcher.java:43)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:52)
      at com.sun.javafx.event.EventRedirector.redirectEvent(EventRedirector.java:124)
      at com.sun.javafx.event.EventRedirector.dispatchCapturingEvent(EventRedirector.java:103)
      at com.sun.javafx.event.CompositeEventDispatcher.dispatchCapturingEvent(CompositeEventDispatcher.java:43)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:52)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:113)
      at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
      at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
      at javafx.event.Event.fireEvent(Event.java:202)
      at com.sun.javafx.stage.WindowPeerListener.focusUngrab(WindowPeerListener.java:97)
      at com.sun.javafx.tk.quantum.GlassWindowEventHandler.run(GlassWindowEventHandler.java:79)
      at com.sun.javafx.tk.quantum.GlassWindowEventHandler.run(GlassWindowEventHandler.java:37)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.tk.quantum.GlassWindowEventHandler.handleWindowEvent(GlassWindowEventHandler.java:118)
      at com.sun.glass.ui.Window.handleWindowEvent(Window.java:1202)
      at com.sun.glass.ui.Window.notifyFocusUngrab(Window.java:1186)
      2013-03-22 09:59:21.136 java[8982:707] (
      0 CoreFoundation 0x00007fff95329b06 __exceptionPreprocess + 198
      1 libobjc.A.dylib 0x00007fff8f0353f0 objc_exception_throw + 43
      2 CoreFoundation 0x00007fff953bdf49 -[NSException raise] + 9
      3 JavaNativeFoundation 0x000000019c3c6c3f JNFCallStaticVoidMethod + 213
      4 libawt_lwawt.dylib 0x00000001a2fc5275 +[ApplicationDelegate _notifyJava:] + 119
      5 CoreFoundation 0x00007fff952dbeda _CFXNotificationPost + 2554
      6 Foundation 0x00007fff8bbbce26 -[NSNotificationCenter postNotificationName:object:userInfo:] + 64
      7 AppKit 0x00007fff940b9ba8 -[NSApplication sendEvent:] + 2997
      8 AppKit 0x00007fff93fd024a -[NSApplication run] + 636
      9 libglass.dylib 0x000000019c50f862 -[GlassApplication runLoop:] + 1698
      10 Foundation 0x00007fff8bc06d3a __NSThreadPerformPerform + 225
      11 CoreFoundation 0x00007fff952a8b31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
      12 CoreFoundation 0x00007fff952a8455 __CFRunLoopDoSources0 + 245
      13 CoreFoundation 0x00007fff952cb7f5 __CFRunLoopRun + 789
      14 CoreFoundation 0x00007fff952cb0e2 CFRunLoopRunSpecific + 290
      15 java 0x000000010c1bb709 CreateExecutionEnvironment + 871
      16 java 0x000000010c1b76ac JLI_Launch + 1952
      17 java 0x000000010c1bd6c7 main + 101
      18 java 0x000000010c1b6f04 start + 52
      )

            jgiles Jonathan Giles
            swpalmer Scott Palmer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: