JDK-8178299 : Drag and Drop throws AssertionError for TreeView within JFXPanel
  • Type: Bug
  • Component: javafx
  • Sub-Component: swing
  • Affected Version: 8,9
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: other
  • CPU: x86
  • Submitted: 2017-04-06
  • Updated: 2018-09-06
  • Resolved: 2017-08-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 10.0.15063]

A DESCRIPTION OF THE PROBLEM :
I'm experiencing an exception whenever I try to drag and drop using a TreeView, embedded within a JFXPanel used within a Netbeans RCP application. It looks to me when I start the app and try to drag, I get no problem the first drag, but every drag afterwards I get an exception. 

java.lang.AssertionError
	at com.sun.javafx.tk.quantum.EmbeddedSceneDnD.createDragboard(EmbeddedSceneDnD.java:134)
	at com.sun.javafx.tk.quantum.EmbeddedScene.createDragboard(EmbeddedScene.java:115)
	at javafx.scene.Scene$DnDGesture.createDragboard(Scene.java:3288)
	at javafx.scene.Scene$DnDGesture.startDrag(Scene.java:3261)
	at javafx.scene.Scene$DnDGesture.access$8500(Scene.java:2909)
	at javafx.scene.Scene.startDragAndDrop(Scene.java:5776)
	at javafx.scene.Node.startDragAndDrop(Node.java:2214)
	at blue.ui.core.score.layers.soundObject.UserSoundObjectLibrary.lambda$null$0(UserSoundObjectLibrary.java:101)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	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:198)
	at javafx.scene.Scene$DnDGesture.fireEvent(Scene.java:2933)
	at javafx.scene.Scene$DnDGesture.process(Scene.java:3012)
	at javafx.scene.Scene$DnDGesture.access$8200(Scene.java:2909)
	at javafx.scene.Scene$MouseHandler.process(Scene.java:3773)
	at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
	at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
	at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
	at com.sun.javafx.tk.quantum.EmbeddedScene.lambda$null$294(EmbeddedScene.java:256)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.tk.quantum.EmbeddedScene.lambda$mouseEvent$295(EmbeddedScene.java:244)
	at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
[catch] at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
	at com.sun.glass.ui.win.WinApplication._runLoop(WinApplication.java)
	at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
	at java.lang.Thread.run(Thread.java:745)

I have tried using different TransferModes, as mentioned in http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8088234 , but it always fails for me.  (My exception stack is also different from what is mentioned in the other bug.)





ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.AssertionError
	at com.sun.javafx.tk.quantum.EmbeddedSceneDnD.createDragboard(EmbeddedSceneDnD.java:134)
	at com.sun.javafx.tk.quantum.EmbeddedScene.createDragboard(EmbeddedScene.java:115)
	at javafx.scene.Scene$DnDGesture.createDragboard(Scene.java:3288)
	at javafx.scene.Scene$DnDGesture.startDrag(Scene.java:3261)
	at javafx.scene.Scene$DnDGesture.access$8500(Scene.java:2909)
	at javafx.scene.Scene.startDragAndDrop(Scene.java:5776)
	at javafx.scene.Node.startDragAndDrop(Node.java:2214)
	at blue.ui.core.score.layers.soundObject.UserSoundObjectLibrary.lambda$null$0(UserSoundObjectLibrary.java:101)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	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:198)
	at javafx.scene.Scene$DnDGesture.fireEvent(Scene.java:2933)
	at javafx.scene.Scene$DnDGesture.process(Scene.java:3012)
	at javafx.scene.Scene$DnDGesture.access$8200(Scene.java:2909)
	at javafx.scene.Scene$MouseHandler.process(Scene.java:3773)
	at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
	at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
	at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
	at com.sun.javafx.tk.quantum.EmbeddedScene.lambda$null$294(EmbeddedScene.java:256)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.tk.quantum.EmbeddedScene.lambda$mouseEvent$295(EmbeddedScene.java:244)
	at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
[catch] at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
	at com.sun.glass.ui.win.WinApplication._runLoop(WinApplication.java)
	at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
	at java.lang.Thread.run(Thread.java:745)

REPRODUCIBILITY :
This bug can be reproduced always.


Comments
Cannot reproduce the assertion even when run with -ea in Intellij with 9b179 and jfx10 when dragged from netbeans to app.
30-08-2017

Additional Information from submitter: FYI: Following up the thread, I found that disabling assertions for the following classes was enough to be able to move forward with developing drag and drop within my primary program: run.args.extra=-J-da:com.sun.javafx.tk.quantum.EmbeddedSceneDnD -J-da:javafx.embed.swing.SwingDnD (Note this uses the -J flags required for Netbeans RCP apps)
20-04-2017

PFA reproducible test case [TestJFXDragAndDrop.zip] and RCP APPLICATION LOG [RCP_App_Log.txt] received from reporter
11-04-2017

The DnD operations appear to work correctly when running without assertions enabled, so I suspect that the solution may be as simple as just removing the bad assertions.
07-04-2017

Workaround: run with assertions disabled (which is the default if you don't specify -ea).
07-04-2017

8: FAIL 8u121: FAIL 9-ea+164: FAIL
07-04-2017

I can trivially reproduce this when running the test program using 'java -ea'
07-04-2017

The stack trace is from a failed assertion; assertion checks are only enabled when running java with the "-ea" option. As an aside, such assertion checks in library code such as the JavaFX runtime are not usually a good idea so we should revisit them and either eliminate them or change them to runtime checks.
07-04-2017

Could not reproduce the issue using attached testcase [JFxPanelTest2.java]. Verified in 8u121 using Netbeans IDE 8.2 (Windows 10) Requested reporter for Netbeans version PFA testcase [JFxPanelTest2.java]
07-04-2017