JDK-7146550 : [macosx] DnD test failure in createCompatibleWritableRaster()
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86
  • Submitted: 2012-02-17
  • Updated: 2012-06-20
  • Resolved: 2012-06-20
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.
JDK 7 JDK 8
7u6 b13Fixed 8Fixed
Related Reports
Relates :  
Description
In 7124373 there are mentioned 2 tests failing with a similar exception. Now, first of them runs OK in b11 after a fix to 7124373 but not the second.

It is 
java/awt/dnd/ImageDecoratedDnDNegative/ImageDecoratedDnDNegative 
and it still fails in b11 with quite the same

Exception in thread "AWT-EventQueue-0" 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.CImage$Creator.createFromImage(CImage.java:101)
 at sun.lwawt.macosx.CPlatformWindow.getImageForTarget(CPlatformWindow.java:734)
 at sun.lwawt.macosx.CPlatformWindow.updateIconImages(CPlatformWindow.java:541)
 at sun.lwawt.macosx.CPlatformWindow.setVisible(CPlatformWindow.java:506)
 at sun.lwawt.LWWindowPeer$1.run(LWWindowPeer.java:273)
 at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
 at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
 at java.awt.EventQueue.access$000(EventQueue.java:101)
 at java.awt.EventQueue$3.run(EventQueue.java:666)
 at java.awt.EventQueue$3.run(EventQueue.java:664)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
 at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
 at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:240)
 at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:157)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:146)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:142)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:134)
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

Comments
SUGGESTED FIX http://cr.openjdk.java.net/~bae/7146550/7u6/webrev.00/
25-05-2012

EVALUATION See jdk8 subCR for detailed description of the fix.
25-05-2012

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.
07-03-2012