Review request for 7142780: [macosx] Font2DTest demo throws NPE

Andrew Brygin andrew.brygin at oracle.com
Mon Feb 6 01:07:48 PST 2012


Hello,

please take a look to a fix for CR 7142780:

http://cr.openjdk.java.net/~bae/7142780/webrev/

The Font2DTest creates a bogus image in order to get a blank cursor
(FontPanel.java, lines 495 - 498). This image can not be loaded and triggers
an error when MediaTracker tries to prepare the image. As soon as the error
is detected, the conversion of toolkit image to CImage is aborted, and the
CImage.Creator.createFromImage returns null. So, CCustomCursor.getImageData
need to be modified in order to be able to handle a null result of the 
createFormImage.

However, in order to avoid numerous calls to createFromImage in case of 
faulty
image, we can check the status of image loading in the constructor, and 
set a flag
to indicate whether given image can be used as a cursor.

Thanks,
Andrew


More information about the macosx-port-dev mailing list