Buggy code:
int oldStart ; int oldEnd ; boolean doubleClick ; boolean ignoreModify ; boolean ignoreVerify ; boolean ignoreCharacter ; String message ; public static final int LIMIT ; public static final String DELIMITER ; static final int EditProc ; static final TCHAR EditClass = new TCHAR ( 0 , "EDIT" , true ) ; public Text ( Composite parent , int style ) { } int callWindowProc ( int hwnd , int msg , int wParam , int lParam ) { } void createHandle ( ) { } public void addModifyListener ( ModifyListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } public void addVerifyListener ( VerifyListener listener ) { } public void append ( String string ) { } static int checkStyle ( int style ) { } public void clearSelection ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } public void copy ( ) { } void createWidget ( ) { } public void cut ( ) { } int defaultBackground ( ) { } boolean dragDetect ( int hwnd , int x , int y , boolean filter , boolean [ ] detect , boolean [ ] consume ) { } void fixAlignment ( ) { } public int getBorderWidth ( ) { } public int getCaretLineNumber ( ) { } public Point getCaretLocation ( ) { } public int getCaretPosition ( ) { } public int getCharCount ( ) { } public boolean getDoubleClickEnabled ( ) { } public char getEchoChar ( ) { } public boolean getEditable ( ) { } public int getLineCount ( ) { } public String getLineDelimiter ( ) { } public int getLineHeight ( ) { } public int getOrientation ( ) { } public String getMessage ( ) { } int getPosition ( Point point ) { } public Point getSelection ( ) { } public int getSelectionCount ( ) { } public String getSelectionText ( ) { } public int getTabs ( ) { } int getTabWidth ( int tabs ) { } public String getText ( ) { } public String getText ( int start , int end ) { } public int getTextLimit ( ) { } public int getTopIndex ( ) { } public int getTopPixel ( ) { } public void insert ( String string ) { } int mbcsToWcsPos ( int mbcsPos ) { } public void paste ( ) { } void releaseWidget ( ) { } public void removeModifyListener ( ModifyListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void removeVerifyListener ( VerifyListener listener ) { } public void selectAll ( ) { } boolean sendKeyEvent ( int type , int msg , int wParam , int lParam , Event event ) { } void setBounds ( int x , int y , int width , int height , int flags ) { } void setDefaultFont ( ) { } public void setDoubleClickEnabled ( boolean doubleClick ) { } public void setEchoChar ( char echo ) { } public void setEditable ( boolean editable ) { } public void setFont ( Font font ) { } void setMargins ( ) { } public void setMessage ( String message ) { } public void setOrientation ( int orientation ) { } public void setSelection ( int start ) { } public void setSelection ( int start , int end ) { } public void setRedraw ( boolean redraw ) { } public void setSelection ( Point selection ) { } public void setTabs ( int tabs ) { } void setTabStops ( int tabs ) { } public void setText ( String string ) { } public void setTextLimit ( int limit ) { } public void setTopIndex ( int index ) { } public void showSelection ( ) { } String verifyText ( String string , int start , int end , Event keyEvent ) { } int wcsToMbcsPos ( int wcsPos ) { } int widgetStyle ( ) { } TCHAR windowClass ( ) { } int windowProc ( ) { } int windowProc ( int hwnd , int msg , int wParam , int lParam ) { } LRESULT WM_CHAR ( int wParam , int lParam ) { if ( ignoreCharacter ) return null ; LRESULT result = super . WM_CHAR ( wParam , lParam ) ; if ( result != null ) return result ; switch ( ( ( int ) ( wParam ) ) ) { case SWT . DEL : if ( ( OS . GetKeyState ( VK_CONTROL ) ) < 0 ) { return LRESULT . ZERO ; } } if ( ( ( style ) & ( SWT . SINGLE ) ) != 0 ) { switch ( ( ( int ) ( wParam ) ) ) { case SWT . CR : <START_BUG> postEvent ( DefaultSelection ) ; <END_BUG> case SWT . TAB : case SWT . ESC : return LRESULT . ZERO ; } } return result ; } LRESULT WM_CLEAR ( int wParam , int lParam ) { } LRESULT WM_CUT ( int wParam , int lParam ) { } LRESULT WM_ERASEBKGND ( int wParam , int lParam ) { } LRESULT WM_GETDLGCODE ( int wParam , int lParam ) { } LRESULT WM_IME_CHAR ( int wParam , int lParam ) { } LRESULT WM_LBUTTONDBLCLK ( int wParam , int lParam ) { } LRESULT WM_LBUTTONDOWN ( int wParam , int lParam ) { } LRESULT WM_PASTE ( int wParam , int lParam ) { } LRESULT WM_UNDO ( int wParam , int lParam ) { } LRESULT wmClipboard ( int msg , int wParam , int lParam ) { } LRESULT wmColorChild ( int wParam , int lParam ) { } LRESULT wmCommandChild ( int wParam , int lParam ) { } }

Fix:
sendSelectionEvent ( DefaultSelection ) ;