Buggy code:
public void layout ( boolean changed , boolean all ) { } public void layout ( Control [ ] changed ) { } void markLayout ( boolean changed , boolean all ) { } Point minimumSize ( int wHint , int hHint , boolean changed ) { } boolean redrawChildren ( ) { } void releaseChildren ( boolean destroy ) { } void releaseWidget ( ) { } void removeControl ( Control control ) { } void resizeChildren ( ) { } boolean resizeChildren ( boolean defer , WINDOWPOS [ ] pwp ) { } void resizeEmbeddedHandle ( int embeddedHandle , int width , int height ) { } void sendResize ( ) { } public void setBackgroundMode ( int mode ) { } boolean setFixedFocus ( ) { } public boolean setFocus ( ) { } public void setLayout ( Layout layout ) { } public void setLayoutDeferred ( boolean defer ) { } public void setTabList ( Control [ ] tabList ) { } void setResizeChildren ( boolean resize ) { } boolean setTabGroupFocus ( ) { } String toolTipText ( NMTTDISPINFO hdr ) { } boolean translateMnemonic ( Event event , Control control ) { } boolean translateTraversal ( MSG msg ) { } void updateBackgroundColor ( ) { } void updateBackgroundImage ( ) { } void updateBackgroundMode ( ) { } void updateFont ( Font oldFont , Font newFont ) { } void updateLayout ( boolean resize , boolean all ) { } int widgetStyle ( ) { } LRESULT WM_ERASEBKGND ( int wParam , int lParam ) { } LRESULT WM_GETDLGCODE ( int wParam , int lParam ) { } LRESULT WM_GETFONT ( int wParam , int lParam ) { } LRESULT WM_LBUTTONDOWN ( int wParam , int lParam ) { } LRESULT WM_NCPAINT ( int wParam , int lParam ) { } LRESULT WM_NOTIFY ( int wParam , int lParam ) { if ( ! ( OS . IsWinCE ) ) { NMHDR hdr = new NMHDR ( ) ; OS . MoveMemory ( hdr , lParam , sizeof ) ; switch ( hdr . code ) { case OS . TTN_SHOW : case OS . TTN_POP : { int hwndParent = hdr . hwndFrom ; do { hwndParent = OS . GetParent ( hwndParent ) ; if ( hwndParent == 0 ) break ; int bits = OS . GetWindowLong ( hwndParent , GWL_EXSTYLE ) ; if ( ( bits & ( OS . WS_EX_TOPMOST ) ) != 0 ) break ; } while ( true ) ; if ( hwndParent != 0 ) break ; display . lockActiveWindow = true ; int flags = ( ( OS . SWP_NOACTIVATE ) | ( OS . SWP_NOMOVE ) ) | ( OS . SWP_NOSIZE ) ; int hwndInsertAfter = ( ( hdr . code ) == ( OS . TTN_SHOW ) ) ? OS . HWND_TOPMOST : OS . HWND_NOTOPMOST ; SetWindowPos ( hdr . hwndFrom , hwndInsertAfter , 0 , 0 , 0 , 0 , flags ) ; display . lockActiveWindow = false ; break ; } case OS . TTN_GETDISPINFOA : case OS . TTN_GETDISPINFOW : { NMTTDISPINFO lpnmtdi ; if ( ( hdr . code ) == ( OS . TTN_GETDISPINFOA ) ) { lpnmtdi = new NMTTDISPINFOA ( ) ; OS . MoveMemory ( ( ( NMTTDISPINFOA ) ( lpnmtdi ) ) , lParam , NMTTDISPINFOA . sizeof ) ; } else { lpnmtdi = new NMTTDISPINFOW ( ) ; OS . MoveMemory ( ( ( NMTTDISPINFOW ) ( lpnmtdi ) ) , lParam , NMTTDISPINFOW . sizeof ) ; } String string = toolTipText ( lpnmtdi ) ; if ( string != null ) { Shell shell = getShell ( ) ; string = Display . withCrLf ( string ) ; int length = string . length ( ) ; char [ ] chars = new char [ length + 1 ] ; string . getChars ( 0 , length , chars , 0 ) ; int hwnd = hdr . idFrom ; if ( ( hwnd != 0 ) && ( ( ( lpnmtdi . uFlags ) & ( OS . TTF_IDISHWND ) ) != 0 ) ) { Control control = display . getControl ( hwnd ) ; if ( control != null ) { if ( ( ( control . getStyle ( ) ) & ( SWT . RIGHT_TO_LEFT ) ) != 0 ) { lpnmtdi . uFlags |= OS . TTF_RTLREADING ; } else { lpnmtdi . uFlags &= ~ ( OS . TTF_RTLREADING ) ; } } } if ( ( hdr . code ) == ( OS . TTN_GETDISPINFOA ) ) { byte [ ] bytes = new byte [ ( chars . length ) * 2 ] ; <START_BUG> OS . WideCharToMultiByte ( CP_ACP , 0 , chars , chars . length , bytes , bytes . length , null , null ) ; <END_BUG> shell . setToolTipText ( lpnmtdi , bytes ) ; OS . MoveMemory ( lParam , ( ( NMTTDISPINFOA ) ( lpnmtdi ) ) , NMTTDISPINFOA . sizeof ) ; } else { shell . setToolTipText ( lpnmtdi , chars ) ; OS . MoveMemory ( lParam , ( ( NMTTDISPINFOW ) ( lpnmtdi ) ) , NMTTDISPINFOW . sizeof ) ; } return LRESULT . ZERO ; } break ; } } } return super . WM_NOTIFY ( wParam , lParam ) ; } LRESULT WM_PARENTNOTIFY ( int wParam , int lParam ) { } LRESULT WM_PAINT ( int wParam , int lParam ) { } LRESULT WM_PRINTCLIENT ( int wParam , int lParam ) { } LRESULT WM_SETFONT ( int wParam , int lParam ) { } LRESULT WM_SIZE ( int wParam , int lParam ) { } LRESULT WM_SYSCOLORCHANGE ( int wParam , int lParam ) { } LRESULT WM_SYSCOMMAND ( int wParam , int lParam ) { } LRESULT wmNCPaint ( int hwnd , int wParam , int lParam ) { } }

Fix:
OS . WideCharToMultiByte ( getCodePage ( ) , 0 , chars , chars . length , bytes , bytes . length , null , null ) ;