EVALUATION
The stack trace in the description is not accurate. In fact it looks like following:
java.lang.IllegalArgumentException: Width (-1) and height (-1) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016)
at java.awt.image.BufferedImage.<init>(BufferedImage.java:357)
at sun.lwawt.macosx.CDragSourceContextPeer.startDrag(CDragSourceContextPeer.java:145)
at sun.awt.dnd.SunDragSourceContextPeer.startDrag(SunDragSourceContextPeer.java:134)
at sun.lwawt.macosx.CDragSourceContextPeer.startDrag(CDragSourceContextPeer.java:84)
at java.awt.dnd.DragSource.startDrag(DragSource.java:321)
at java.awt.dnd.DragSource.startDrag(DragSource.java:396)
at java.awt.dnd.DragGestureEvent.startDrag(DragGestureEvent.java:291)
at DnDSource.dragGestureRecognized(DnDSource.java:103)
at java.awt.dnd.DragGestureRecognizer.fireDragGestureRecognized(DragGestureRecognizer.java:359)
at sun.lwawt.macosx.CMouseDragGestureRecognizer.mouseDragged(CMouseDragGestureRecognizer.java:139)
at java.awt.Component.processMouseMotionEvent(Component.java:6553)
at java.awt.Component.processEvent(Component.java:6274)
at java.awt.Button.processEvent(Button.java:380)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:703)
at java.awt.EventQueue.access$000(EventQueue.java:102)
at java.awt.EventQueue$3.run(EventQueue.java:662)
at java.awt.EventQueue$3.run(EventQueue.java:660)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:676)
at java.awt.EventQueue$4.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:673)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)
The problem is caused by a code in CDragSourceContextPeer which converts java images
(ToolkitImage and BufferedImage) to CImage and it's native representation, which does not
take into account the peculiarity of ToolkitImage which need to be prepared in advance.
This particular problem can be resolved by delegating image conversion to the helper class
CImage.Creator. See suggested change:
http://cr.openjdk.java.net/~bae/7146550/webrev/
However, this change does not resolve the problem completely: even if CImage instance
is created correctly, the drag operation does not start, and the test in question
fails anyway. In order to provide complete solution, we need to investigate what breaks
the DnD operation on native layer.
|