Buggy code:
, new int [ ] { OS . GDK_KP_3 , SWT . KEYPAD_3 } , new int [ ] { OS . GDK_KP_4 , SWT . KEYPAD_4 } , new int [ ] { OS . GDK_KP_5 , SWT . KEYPAD_5 } , new int [ ] { OS . GDK_KP_6 , SWT . KEYPAD_6 } , new int [ ] { OS . GDK_KP_7 , SWT . KEYPAD_7 } , new int [ ] { OS . GDK_KP_8 , SWT . KEYPAD_8 } , new int [ ] { OS . GDK_KP_9 , SWT . KEYPAD_9 } , new int [ ] { OS . GDK_KP_Equal , SWT . KEYPAD_EQUAL } , new int [ ] { OS . GDK_Caps_Lock , SWT . CAPS_LOCK } , new int [ ] { OS . GDK_Num_Lock , SWT . NUM_LOCK } , new int [ ] { OS . GDK_Scroll_Lock , SWT . SCROLL_LOCK } , new int [ ] { OS . GDK_Pause , SWT . PAUSE } , new int [ ] { OS . GDK_Break , SWT . BREAK } , new int [ ] { OS . GDK_Print , SWT . PRINT_SCREEN } , new int [ ] { OS . GDK_Help , SWT . HELP } } ; static Display Default ; static Display [ ] Displays = new Display [ 4 ] ; static final String PACKAGE_PREFIX = "org.eclipse.swt.widgets." ; static final Class OS_LOCK ; static final int MAJOR = 2 ; static final int MINOR = 0 ; static final int MICRO = 6 ; Object data ; String [ ] keys ; Object [ ] values ; int borderTrimWidth = 4 ; int borderTrimHeight = 4 ; int resizeTrimWidth = 6 ; int resizeTrimHeight = 6 ; int titleBorderTrimWidth = 5 ; int titleBorderTrimHeight = 28 ; int titleResizeTrimWidth = 6 ; int titleResizeTrimHeight = 29 ; int titleTrimWidth = 0 ; int titleTrimHeight = 23 ; boolean ignoreTrim ; String windowManager ; static void setDevice ( Device device ) { } public Display ( ) { } public Display ( DeviceData data ) { } public void addFilter ( int eventType , Listener listener ) { } void addGdkEvent ( int event ) { } public void addListener ( int eventType , Listener listener ) { } void addMouseHoverTimeout ( int handle ) { } void addPopup ( Menu menu ) { } void addWidget ( int handle , Widget widget ) { } public void asyncExec ( Runnable runnable ) { } public void beep ( ) { } protected void checkDevice ( ) { } static synchronized void checkDisplay ( Thread thread , boolean multiple ) { } int checkIfEventProc ( int display , int xEvent , int userData ) { } protected void checkSubclass ( ) { } public void close ( ) { } protected void create ( DeviceData data ) { } synchronized void createDisplay ( DeviceData data ) { } Image createImage ( String name ) { } static int createPixbuf ( Image image ) { int [ ] w = new int [ 1 ] ; int [ ] h = new int [ 1 ] ; OS . gdk_drawable_get_size ( image . pixmap , w , h ) ; int colormap = OS . gdk_colormap_get_system ( ) ; int pixbuf ; <START_BUG> boolean hasMask = ( image . mask ) != 0 ; <END_BUG> if ( hasMask ) { pixbuf = OS . gdk_pixbuf_new ( GDK_COLORSPACE_RGB , true , 8 , w [ 0 ] , h [ 0 ] ) ; if ( pixbuf == 0 ) SWT . error ( ERROR_NO_HANDLES ) ; OS . gdk_pixbuf_get_from_drawable ( pixbuf , image . pixmap , colormap , 0 , 0 , 0 , 0 , w [ 0 ] , h [ 0 ] ) ; int maskPixbuf = OS . gdk_pixbuf_new ( GDK_COLORSPACE_RGB , false , 8 , w [ 0 ] , h [ 0 ] ) ; if ( maskPixbuf == 0 ) SWT . error ( ERROR_NO_HANDLES ) ; OS . gdk_pixbuf_get_from_drawable ( maskPixbuf , image . mask , 0 , 0 , 0 , 0 , 0 , w [ 0 ] , h [ 0 ] ) ; int stride = OS . gdk_pixbuf_get_rowstride ( pixbuf ) ; int pixels = OS . gdk_pixbuf_get_pixels ( pixbuf ) ; byte [ ] line = new byte [ stride ] ; int maskStride = OS . gdk_pixbuf_get_rowstride ( maskPixbuf ) ; int maskPixels = OS . gdk_pixbuf_get_pixels ( maskPixbuf ) ; byte [ ] maskLine = new byte [ maskStride ] ; for ( int y = 0 ; y < ( h [ 0 ] ) ; y ++ ) { int offset = pixels + ( y * stride ) ; OS . memmove ( line , offset , stride ) ; int maskOffset = maskPixels + ( y * maskStride ) ; OS . memmove ( maskLine , maskOffset , maskStride ) ; for ( int x = 0 ; x < ( w [ 0 ] ) ; x ++ ) { if ( ( maskLine [ ( x * 3 ) ] ) == 0 ) { line [ ( ( x * 4 ) + 3 ) ] = 0 ; } } OS . memmove ( offset , line , stride ) ; } OS . g_object_unref ( maskPixbuf ) ; } else { ImageData data = image . getImageData ( ) ; boolean hasAlpha = ( data . getTransparencyType ( ) ) == ( SWT . TRANSPARENCY_ALPHA ) ; pixbuf = OS . gdk_pixbuf_new ( GDK_COLORSPACE_RGB , hasAlpha , 8 , w [ 0 ] , h [ 0 ] ) ; if ( pixbuf == 0 ) SWT . error ( ERROR_NO_HANDLES ) ;

Fix:
boolean hasMask = ( ( image . mask ) != 0 ) && ( ( OS . gdk_drawable_get_depth ( image . mask ) ) == 1 ) ;