Buggy code:
commitCount = 0 ; if ( event . doit ) { Display display = this . display ; display . lastKey = 0 ; display . lastVirtual = display . lastNull = display . lastDead = false ; length = chars . length ( ) ; for ( int i = 0 ; i < length ; i ++ ) { char c = chars . charAt ( i ) ; display . lastAscii = c ; event = new Event ( ) ; event . character = c ; parent . sendEvent ( KeyDown , event ) ; } } } if ( ( lParam & ( OS . GCS_COMPSTR ) ) == 0 ) return LRESULT . ONE ; } buffer = null ; if ( ( lParam & ( OS . GCS_COMPSTR ) ) != 0 ) { int length = OS . ImmGetCompositionString ( hIMC , GCS_COMPSTR , null , 0 ) ; if ( length > 0 ) { buffer = new TCHAR ( codePage , ( length // ( TCHAR . sizeof ) ) ) ; OS . ImmGetCompositionString ( hIMC , GCS_COMPSTR , buffer , length ) ; if ( ( lParam & ( OS . GCS_CURSORPOS ) ) != 0 ) { caretOffset = OS . ImmGetCompositionString ( hIMC , GCS_CURSORPOS , null , 0 ) ; } int [ ] clauses = null ; if ( ( lParam & ( OS . GCS_COMPCLAUSE ) ) != 0 ) { length = OS . ImmGetCompositionStringW ( hIMC , GCS_COMPCLAUSE , ( ( int [ ] ) ( null ) ) , 0 ) ; if ( length > 0 ) { clauses = new int [ length // 4 ] ; OS . ImmGetCompositionStringW ( hIMC , GCS_COMPCLAUSE , clauses , length ) ; } } if ( ( ( lParam & ( OS . GCS_COMPATTR ) ) != 0 ) && ( clauses != null ) ) { length = OS . ImmGetCompositionStringA ( hIMC , GCS_COMPATTR , ( ( byte [ ] ) ( null ) ) , 0 ) ; if ( length > 0 ) { byte [ ] attrs = new byte [ length ] ; OS . ImmGetCompositionStringA ( hIMC , GCS_COMPATTR , attrs , length ) ; length = ( clauses . length ) - 1 ; ranges = new int [ length * 2 ] ; styles = new TextStyle [ length ] ; int layout = OS . GetKeyboardLayout ( 0 ) ; short langID = ( ( short ) ( OS . LOWORD ( layout ) ) ) ; TF_DISPLAYATTRIBUTE attr = null ; TextStyle style = null ; for ( int i = 0 ; i < length ; i ++ ) { ranges [ ( i * 2 ) ] = clauses [ i ] ; ranges [ ( ( i * 2 ) + 1 ) ] = ( clauses [ ( i + 1 ) ] ) - 1 ; styles [ i ] = style = new TextStyle ( ) ; attr = getDisplayAttribute ( langID , attrs [ clauses [ i ] ] ) ; if ( attr != null ) { switch ( attr . crText . type ) { case OS . TF_CT_COLORREF : style . foreground = Color . win32_new ( display , attr . crText . cr ) ; break ; case OS . TF_CT_SYSCOLOR : int colorRef = OS . GetSysColor ( attr . crText . cr ) ; style . foreground = Color . win32_new ( display , colorRef ) ; break ; } switch ( attr . crBk . type ) { case OS . TF_CT_COLORREF : style . background = Color . win32_new ( display , attr . crBk . cr ) ; break ; case OS . TF_CT_SYSCOLOR : int colorRef = OS . GetSysColor ( attr . crBk . cr ) ; style . background = Color . win32_new ( display , colorRef ) ; break ; } switch ( attr . crLine . type ) { case OS . TF_CT_COLORREF : style . underlineColor = Color . win32_new ( display , attr . crLine . cr ) ; break ; case OS . TF_CT_SYSCOLOR : int colorRef = OS . GetSysColor ( attr . crLine . cr ) ; style . underlineColor = Color . win32_new ( display , colorRef ) ; break ; } style . underline = ( attr . lsStyle ) != ( OS . TF_LS_NONE ) ; switch ( attr . lsStyle ) { case OS . TF_LS_SQUIGGLE : <START_BUG> style . underlineStyle = SWT . UNDERLINE_ERROR ; <END_BUG> break ; case OS . TF_LS_DASH : style . underlineStyle = IME . UNDERLINE_IME_DASH ; break ; case OS . TF_LS_DOT : style . underlineStyle = IME . UNDERLINE_IME_DOT ; break ; case OS . TF_LS_SOLID : style . underlineStyle = ( attr . fBoldLine ) ? IME . UNDERLINE_IME_THICK : SWT . UNDERLINE_SINGLE ; break ; } } } } } } OS . ImmReleaseContext ( hwnd , hIMC ) ; } int end = ( startOffset ) + ( text . length ( ) ) ; if ( ( startOffset ) == ( - 1 ) ) { Event event = new Event ( ) ; event . detail = SWT . COMPOSITION_SELECTION ; sendEvent ( ImeComposition , event ) ; startOffset = event . start ; end = event . end ; } Event event = new Event ( ) ; event . detail = SWT . COMPOSITION_CHANGED ; event . start = startOffset ; event . end = end ; event . text = text = ( buffer != null ) ? buffer . toString ( ) : "" ; sendEvent ( ImeComposition , event ) ; if ( ( text . length ( ) ) == 0 ) { startOffset = - 1 ; ranges = null ; styles = null ; }

Fix:
style . underlineStyle = SWT . UNDERLINE_SQUIGGLE ;