Buggy code:
int callWindowProc ( int hwnd , int msg , int wParam , int lParam ) { } void checkBuffered ( ) { } boolean checkData ( TreeItem item , boolean redraw ) { } boolean checkData ( TreeItem item , int index , boolean redraw ) { } boolean checkHandle ( int hwnd ) { } boolean checkScroll ( int hItem ) { } protected void checkSubclass ( ) { } public void clear ( int index , boolean all ) { } void clear ( int hItem , TVITEM tvItem ) { } public void clearAll ( boolean all ) { } void clearAll ( int hItem , TVITEM tvItem , boolean all ) { } int CompareFunc ( int lParam1 , int lParam2 , int lParamSort ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { } void createHeaderToolTips ( ) { } void createItem ( TreeColumn column , int index ) { } void createItem ( TreeItem item , int hParent , int hInsertAfter , int hItem ) { } void createItemToolTips ( ) { } void createParent ( ) { } void createWidget ( ) { } int defaultBackground ( ) { } void deregister ( ) { } void deselect ( int hItem , TVITEM tvItem , int hIgnoreItem ) { } public void deselectAll ( ) { } void destroyItem ( TreeColumn column ) { } void destroyItem ( TreeItem item , int hItem ) { } void enableDrag ( boolean enabled ) { } void enableWidget ( boolean enabled ) { } int findIndex ( int hFirstItem , int hItem ) { } Widget findItem ( int hItem ) { } int findItem ( int hFirstItem , int index ) { } TreeItem getFocusItem ( ) { } public int getGridLineWidth ( ) { } public int getHeaderHeight ( ) { } public boolean getHeaderVisible ( ) { } Point getImageSize ( ) { } public TreeColumn getColumn ( int index ) { } public int getColumnCount ( ) { } public int [ ] getColumnOrder ( ) { } public TreeColumn [ ] getColumns ( ) { } public TreeItem getItem ( int index ) { } TreeItem getItem ( NMTVCUSTOMDRAW nmcd ) { } 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 ( ) { } int getNextSelection ( int hItem , TVITEM tvItem ) { } public TreeItem getParentItem ( ) { } int getSelection ( int hItem , TVITEM tvItem , TreeItem [ ] selection , int index , int count , boolean bigSelection , boolean all ) { } public TreeItem [ ] getSelection ( ) { } public int getSelectionCount ( ) { } public TreeColumn getSortColumn ( ) { } int getSortColumnPixel ( ) { int pixel = ( OS . IsWindowEnabled ( handle ) ) ? getBackgroundPixel ( ) : OS . GetSysColor ( COLOR_3DFACE ) ; int red = pixel & 255 ; int green = ( pixel & 65280 ) > > 8 ; int blue = ( pixel & 16711680 ) > > 16 ; if ( ( ( red > 240 ) && ( green > 240 ) ) && ( blue > 240 ) ) { red -= 8 ; green -= 8 ; blue -= 8 ; } else { red = Math . min ( 255 , ( ( red // 10 ) + red ) ) ; green = Math . min ( 255 , ( ( green // 10 ) + green ) ) ; blue = Math . min ( 255 , ( ( blue // 10 ) + blue ) ) ; } <START_BUG> return ( ( 33554432 | ( red & 255 ) ) | ( ( green & 255 ) << 8 ) ) | ( ( blue & 255 ) << 16 ) ; <END_BUG> } public int getSortDirection ( ) { } public TreeItem getTopItem ( ) { } int imageIndex ( Image image , int index ) { } int imageIndexHeader ( Image image ) { } public int indexOf ( TreeColumn column ) { } public int indexOf ( TreeItem item ) { } boolean isItemSelected ( NMTVCUSTOMDRAW nmcd ) { } void register ( ) { } void releaseItem ( int hItem , TVITEM tvItem , boolean release ) { } void releaseItems ( int hItem , TVITEM tvItem ) { } void releaseHandle ( ) { } void releaseChildren ( boolean destroy ) { } void releaseWidget ( ) { } public void removeAll ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void removeTreeListener ( TreeListener listener ) { } public void setInsertMark ( TreeItem item , boolean before ) { } public void setItemCount ( int count ) { } void setItemCount ( int count , int hParent , int hItem ) { } void setItemHeight ( int itemHeight ) { } public void setLinesVisible ( boolean show ) { } int scrolledHandle ( ) { } void select ( int hItem , TVITEM tvItem ) { } public void selectAll ( ) { } void setBackgroundImage ( int hBitmap ) { } void setBackgroundPixel ( int pixel ) { } void setBounds ( int x , int y , int width , int height , int flags ) { } void setCursor ( ) { } public void setColumnOrder ( int [ ] order ) { } void setCheckboxImageList ( ) { } public void setFont ( Font font ) { } void setForegroundPixel ( int pixel ) { } public void setHeaderVisible ( boolean show ) { }

Fix:
return ( ( red & 255 ) | ( ( green & 255 ) << 8 ) ) | ( ( blue & 255 ) << 16 ) ;