Buggy code:
public class Tree extends Composite { TreeItem [ ] items ; TreeColumn [ ] columns ; int hwndParent ; int hwndHeader ; int hAnchor ; ImageList imageList ; boolean dragStarted ; boolean gestureCompleted ; boolean ignoreSelect ; boolean ignoreExpand ; boolean ignoreDeselect ; boolean ignoreResize ; boolean lockSelection ; boolean oldSelected ; boolean newSelected ; boolean linesVisible ; boolean customDraw ; boolean printClient ; static final int INSET = 3 ; static final int GRID_WIDTH = 1 ; static final int HEADER_MARGIN = 10 ; static final int TreeProc ; static final TCHAR TreeClass = new TCHAR ( 0 , OS . WC_TREEVIEW , true ) ; static final char [ ] BUTTON = new char [ ] { 'B' , 'U' , 'T' , 'T' , 'O' , 'N' , 0 } ; public Tree ( Composite parent , int style ) { } static int checkStyle ( int style ) { } int _getBackgroundPixel ( ) { } void _setBackgroundPixel ( int pixel ) { } public void addSelectionListener ( SelectionListener listener ) { } public void addTreeListener ( TreeListener listener ) { } int borderHandle ( ) { } int callWindowProc ( int hwnd , int msg , int wParam , int lParam ) { } boolean checkHandle ( int hwnd ) { } boolean checkScroll ( int hItem ) { } protected void checkSubclass ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { } void createItem ( TreeColumn column , int index ) { } void createItem ( TreeItem item , int hParent , int hInsertAfter ) { } void createParent ( ) { } void createWidget ( ) { } int defaultBackground ( ) { } void deregister ( ) { } public void deselectAll ( ) { } void destroyItem ( TreeColumn column ) { } void destroyItem ( TreeItem item ) { } void enableWidget ( boolean enabled ) { } Widget findItem ( int id ) { } int getBackgroundPixel ( ) { } int getForegroundPixel ( ) { } public int getGridLineWidth ( ) { } public int getHeaderHeight ( ) { } public boolean getHeaderVisible ( ) { } Point getImageSize ( ) { } public TreeColumn getColumn ( int index ) { } public int getColumnCount ( ) { } public TreeColumn [ ] getColumns ( ) { } public TreeItem getItem ( int index ) { } public TreeItem getItem ( Point point ) { } public int getItemCount ( ) { } int getItemCount ( int hItem ) { } public int getItemHeight ( ) { } public TreeItem [ ] getItems ( ) { } TreeItem [ ] getItems ( int hTreeItem ) { } public boolean getLinesVisible ( ) { } public TreeItem getParentItem ( ) { } public TreeItem [ ] getSelection ( ) { } public int getSelectionCount ( ) { } public TreeItem getTopItem ( ) { } int imageIndex ( Image image ) { if ( image == null ) return OS . I_IMAGENONE ; if ( ( imageList ) == null ) { int hOldList = OS . SendMessage ( handle , TVM_GETIMAGELIST , TVSIL_NORMAL , 0 ) ; if ( hOldList != 0 ) OS . ImageList_Destroy ( hOldList ) ; Rectangle bounds = image . getBounds ( ) ; <START_BUG> imageList = display . getImageList ( new Point ( bounds . width , bounds . height ) ) ; <END_BUG> int index = imageList . indexOf ( image ) ; if ( index == ( - 1 ) ) index = imageList . add ( image ) ; int hImageList = imageList . getHandle ( ) ; OS . SendMessage ( handle , TVM_SETIMAGELIST , TVSIL_NORMAL , hImageList ) ; if ( ( hwndHeader ) != 0 ) { OS . SendMessage ( hwndHeader , HDM_SETIMAGELIST , 0 , hImageList ) ; } updateScrollBar ( ) ; return index ; } int index = imageList . indexOf ( image ) ; if ( index != ( - 1 ) ) return index ; return imageList . add ( image ) ; } int indexOf ( int hItem , int hChild ) { } public int indexOf ( TreeColumn column ) { } public int indexOf ( TreeItem item ) { } void register ( ) { } boolean releaseItem ( TreeItem item , TVITEM tvItem ) { } void releaseItems ( TreeItem [ ] nodes , TVITEM tvItem ) { } void releaseHandle ( ) { } void releaseWidget ( ) { } public void removeAll ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void removeTreeListener ( TreeListener listener ) { } public void setInsertMark ( TreeItem item , boolean before ) { } public void setLinesVisible ( boolean show ) { } int scrolledHandle ( ) { } public void selectAll ( ) { } void setBackgroundPixel ( int pixel ) { } void setBounds ( int x , int y , int width , int height , int flags ) { } void setCursor ( ) { } void setCheckboxImageList ( ) { } void setForegroundPixel ( int pixel ) { } public void setHeaderVisible ( boolean show ) { } public void setRedraw ( boolean redraw ) { } void setScrollWidth ( ) { } public void setSelection ( TreeItem [ ] items ) { } public void setTopItem ( TreeItem item ) { } void showItem ( int hItem ) { } public void showColumn ( TreeColumn column ) { } public void showItem ( TreeItem item ) { } public void showSelection ( ) { } void showWidget ( boolean visible ) { } String toolTipText ( NMTTDISPINFO hdr ) { } int topHandle ( ) { } void updateScrollBar ( ) { } int widgetStyle ( ) { } TCHAR windowClass ( ) { } int windowProc ( ) { }

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