JDK-2224942 : [macosx] DnD test failure in createCompatibleWritableRaster()
  • Type: Backport
  • Backport of: JDK-7146550
  • Component: client-libs
  • Sub-Component: 2d
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2012-05-25
  • Updated: 2013-05-23
  • 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
7u6Fixed 8 b43Fixed
Comments
EVALUATION DnD code does not check whether a toolkit image is ready to be painted into a buffer. We have to do this check in order to get correct image dimension. Suggested fix just delegates the conversion of toolkit image into a CImage instance to a helper class CImage.Creator. This helper class provides two ways to convert a toolkit image int CImage: - immediate conversion: returns valid CImage only if toolkit image has valid dimension, and null otherwise. Immediate conversion works fine for toolkit images which are prepared in advance, or are based on memory image source. - normal conversion: a toolkit image is prepared for rendering using a media tracker. We can not use the normal conversion in case of DnD, because broken toolkit image (whose producer never updates the image state for any reasons) can cause a hang in the DnD the code (test in question implements such scenario). If supplied drag image can not be conversed to CImage (either an exception is thrown or it is not ready, i.e. a result of conversion is null for any reasons) the InvalidDnDOperationException is thrown in order to notify user about the problem with drag image. Note that such approach is already used on windows platform, so with this fix, macosx behaves in a uniform way with windows. Beside this, this fix pushes the drag image (an instance of CImage) down to native DnD machinery in order to be able to display drag images.
25-05-2012

SUGGESTED FIX http://cr.openjdk.java.net/~bae/7146550/webrev.01/
25-05-2012