Buggy code:
public class Button extends Control { String text = "" ; Image image ; Image image2 ; ImageList imageList ; boolean ignoreMouse ; static final int ButtonProc ; static final TCHAR ButtonClass = new TCHAR ( 0 , "BUTTON" , true ) ; static final char [ ] SCROLLBAR = new char [ ] { 'S' , 'C' , 'R' , 'O' , 'L' , 'L' , 'B' , 'A' , 'R' , 0 } ; static final int CHECK_WIDTH ; static final int CHECK_HEIGHT ; static final int ICON_WIDTH = 128 ; static final int ICON_HEIGHT = 128 ; public Button ( Composite parent , int style ) { } void _setImage ( Image image ) { if ( ( ( OS . COMCTL32_MAJOR ) >= 6 ) && ( OS . IsAppThemed ( ) ) ) { OS . SendMessage ( handle , BCM_SETIMAGELIST , 0 , 0 ) ; if ( ( imageList ) != null ) imageList . dispose ( ) ; imageList = null ; if ( image != null ) { <START_BUG> imageList = new ImageList ( ) ; <END_BUG> imageList . add ( image ) ; BUTTON_IMAGELIST buttonImageList = new BUTTON_IMAGELIST ( ) ; buttonImageList . himl = imageList . getHandle ( ) ; if ( ( ( style ) & ( SWT . LEFT ) ) != 0 ) buttonImageList . uAlign = OS . BUTTON_IMAGELIST_ALIGN_LEFT ; if ( ( ( style ) & ( SWT . CENTER ) ) != 0 ) buttonImageList . uAlign = OS . BUTTON_IMAGELIST_ALIGN_CENTER ; if ( ( ( style ) & ( SWT . RIGHT ) ) != 0 ) buttonImageList . uAlign = OS . BUTTON_IMAGELIST_ALIGN_RIGHT ; TCHAR buffer = new TCHAR ( getCodePage ( ) , "" , true ) ; OS . SetWindowText ( handle , buffer ) ; OS . SendMessage ( handle , BCM_SETIMAGELIST , 0 , buttonImageList ) ; } else { TCHAR buffer = new TCHAR ( getCodePage ( ) , text , true ) ; OS . SetWindowText ( handle , buffer ) ; OS . SendMessage ( handle , BCM_SETIMAGELIST , 0 , 0 ) ; } } else { if ( ( image2 ) != null ) image2 . dispose ( ) ; image2 = null ; int hImage = 0 ; int imageBits = 0 ; int fImageType = 0 ; if ( image != null ) { switch ( image . type ) { case SWT . BITMAP : { Rectangle rect = image . getBounds ( ) ; ImageData data = image . getImageData ( ) ; switch ( data . getTransparencyType ( ) ) { case SWT . TRANSPARENCY_PIXEL : if ( ( ( rect . width ) <= ( Button . ICON_WIDTH ) ) && ( ( rect . height ) <= ( Button . ICON_HEIGHT ) ) ) { image2 = new Image ( display , data , data . getTransparencyMask ( ) ) ; hImage = image2 . handle ; imageBits = OS . BS_ICON ; fImageType = OS . IMAGE_ICON ; break ; } case SWT . TRANSPARENCY_ALPHA : image2 = new Image ( display , rect . width , rect . height ) ; GC gc = new GC ( image2 ) ; gc . setBackground ( getBackground ( ) ) ; gc . fillRectangle ( rect ) ; gc . drawImage ( image , 0 , 0 ) ; gc . dispose ( ) ; hImage = image2 . handle ; imageBits = OS . BS_BITMAP ; fImageType = OS . IMAGE_BITMAP ; break ; case SWT . TRANSPARENCY_NONE : hImage = image . handle ; imageBits = OS . BS_BITMAP ; fImageType = OS . IMAGE_BITMAP ; break ; } break ; } case SWT . ICON : { hImage = image . handle ; imageBits = OS . BS_ICON ; fImageType = OS . IMAGE_ICON ; break ; } } if ( ( ( style ) & ( SWT . RIGHT_TO_LEFT ) ) != 0 ) { if ( ( ! ( OS . IsWinCE ) ) && ( ( OS . WIN32_VERSION ) >= ( OS . VERSION ( 4 , 10 ) ) ) ) { Rectangle rect = image . getBounds ( ) ; int hDC = OS . GetDC ( handle ) ; int dstHdc = OS . CreateCompatibleDC ( hDC ) ; int hBitmap = OS . CreateCompatibleBitmap ( hDC , rect . width , rect . height ) ; int oldBitmap = OS . SelectObject ( dstHdc , hBitmap ) ; OS . SetLayout ( dstHdc , LAYOUT_RTL ) ; if ( fImageType == ( OS . IMAGE_BITMAP ) ) { int srcHdc = OS . CreateCompatibleDC ( hDC ) ; int oldSrcBitmap = OS . SelectObject ( srcHdc , hImage ) ; OS . SetLayout ( dstHdc , 0 ) ; OS . BitBlt ( dstHdc , 0 , 0 , rect . width , rect . height , srcHdc , 0 , 0 , SRCCOPY ) ; OS . SelectObject ( srcHdc , oldSrcBitmap ) ; OS . DeleteDC ( srcHdc ) ; } else { int newBrush = OS . CreateSolidBrush ( getBackgroundPixel ( ) ) ; int oldBrush = OS . SelectObject ( dstHdc , newBrush ) ; OS . PatBlt ( dstHdc , 0 , 0 , rect . width , rect . height , PATCOPY ) ; OS . DrawIconEx ( dstHdc , 0 , 0 , hImage , 0 , 0 , 0 , 0 , DI_NORMAL ) ; OS . SelectObject ( dstHdc , oldBrush ) ; OS . DeleteObject ( newBrush ) ; } OS . SelectObject ( dstHdc , oldBitmap ) ; OS . DeleteDC ( dstHdc ) ; OS . ReleaseDC ( handle , hDC ) ; if ( ( image2 ) != null ) image2 . dispose ( ) ; image2 = Image . win32_new ( display , BITMAP , hBitmap ) ;

Fix:
imageList = new ImageList ( ( ( style ) & ( SWT . RIGHT_TO_LEFT ) ) ) ;