Buggy code:
public class ToolItem extends Item { ToolBar parent ; Control control ; String toolTipText ; Image disabledImage ; Image hotImage ; Image disabledImage2 ; int id ; public ToolItem ( ToolBar parent , int style ) { } public ToolItem ( ToolBar parent , int style , int index ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } void click ( boolean dropDown ) { } Image createDisabledImage ( Image image , Color color ) { } public Rectangle getBounds ( ) { } public Control getControl ( ) { } public Image getDisabledImage ( ) { } public boolean getEnabled ( ) { } public Image getHotImage ( ) { } public ToolBar getParent ( ) { } public boolean getSelection ( ) { } public String getToolTipText ( ) { } public int getWidth ( ) { } public boolean isEnabled ( ) { } void releaseChild ( ) { } void releaseWidget ( ) { } void releaseImages ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } void resizeControl ( ) { } void selectRadio ( ) { } public void setControl ( Control control ) { } public void setEnabled ( boolean enabled ) { } public void setDisabledImage ( Image image ) { } public void setHotImage ( Image image ) { } public void setImage ( Image image ) { } boolean setRadioSelection ( boolean value ) { } public void setSelection ( boolean selected ) { } public void setText ( String string ) { } public void setToolTipText ( String string ) { } public void setWidth ( int width ) { } void updateImages ( boolean enabled ) { int hwnd = parent . handle ; TBBUTTONINFO info = new TBBUTTONINFO ( ) ; info . cbSize = TBBUTTONINFO . sizeof ; info . dwMask = OS . TBIF_IMAGE ; OS . SendMessage ( hwnd , TB_GETBUTTONINFO , id , info ) ; if ( ( ( info . iImage ) == ( OS . I_IMAGENONE ) ) && ( ( image ) == null ) ) return ; ImageList imageList = parent . getImageList ( ) ; ImageList hotImageList = parent . getHotImageList ( ) ; ImageList disabledImageList = parent . getDisabledImageList ( ) ; if ( ( info . iImage ) == ( OS . I_IMAGENONE ) ) { Rectangle bounds = image . getBounds ( ) ; if ( imageList == null ) <START_BUG> imageList = display . getImageListTooBar ( bounds . width , bounds . height ) ; <END_BUG> if ( disabledImageList == null ) { disabledImageList = display . getImageListToolBarDisabled ( bounds . width , bounds . height ) ; } if ( hotImageList == null ) { hotImageList = display . getImageListToolBarHot ( bounds . width , bounds . height ) ; } Image disabled = disabledImage ; if ( ( disabledImage ) == null ) { if ( ( disabledImage2 ) != null ) disabledImage2 . dispose ( ) ; disabledImage2 = null ; disabled = image ; if ( ! enabled ) { Color color = parent . getBackground ( ) ; disabled = disabledImage2 = createDisabledImage ( image , color ) ; } } Image image2 = image ; Image hot = hotImage ; if ( ( ( style ) & ( ( SWT . CHECK ) | ( SWT . RADIO ) ) ) != 0 ) { if ( ! enabled ) image2 = hot = disabled ; } info . iImage = imageList . add ( image2 ) ; disabledImageList . add ( disabled ) ; hotImageList . add ( ( hot != null ? hot : image2 ) ) ; parent . setImageList ( imageList ) ; parent . setDisabledImageList ( disabledImageList ) ; parent . setHotImageList ( hotImageList ) ; } else { Image disabled = null ; if ( disabledImageList != null ) { if ( ( image ) != null ) { if ( ( disabledImage2 ) != null ) disabledImage2 . dispose ( ) ; disabledImage2 = null ; disabled = disabledImage ; if ( ( disabledImage ) == null ) { disabled = image ; if ( ! enabled ) { Color color = parent . getBackground ( ) ; disabled = disabledImage2 = createDisabledImage ( image , color ) ; } } } disabledImageList . put ( info . iImage , disabled ) ; } Image image2 = image ; Image hot = hotImage ; if ( ( ( style ) & ( ( SWT . CHECK ) | ( SWT . RADIO ) ) ) != 0 ) { if ( ! enabled ) image2 = hot = disabled ; } if ( imageList != null ) imageList . put ( info . iImage , image2 ) ; if ( hotImageList != null ) { hotImageList . put ( info . iImage , ( hot != null ? hot : image2 ) ) ; } if ( ( image ) == null ) info . iImage = OS . I_IMAGENONE ; } info . dwMask |= OS . TBIF_SIZE ; info . cx = 0 ; OS . SendMessage ( hwnd , TB_SETBUTTONINFO , id , info ) ; parent . layoutItems ( ) ; } int widgetStyle ( ) { } LRESULT wmCommandChild ( int wParam , int lParam ) { } }

Fix:
imageList = display . getImageListToolBar ( bounds . width , bounds . height ) ;