Buggy code:
public void setEnabled ( boolean enabled ) { } public boolean isEnabled ( ) { } protected void clearInput ( ) { } public void sendMessageLine ( String line ) { } public void disconnected ( ) { } protected CTabItem getTabItem ( String targetName ) { } protected void doJoinRoom ( final IChatRoomInfo roomInfo , final String password ) { } class ChatRoom implements IChatRoomInvitationListener , KeyListener { private IChatRoomContainer chatRoomContainer ; private ChatRoomManagerView . ChatRoomTab chatRoomTab ; private IChatRoomMessageSender chatRoomMessageSender ; private IUser localUser ; private TableViewer chatRoomParticipantViewer = null ; private ArrayList options ; private int maximumCyclingOptions = 5 ; private int prefixLength ; private int choice = 0 ; private int nickRemainder ; private int caret ; private char nickCompletionSuffix = ':' ; private boolean isCycling = false ; private boolean isAtStart = false ; private CTabItem itemSelected = null ; private Text getInputText ( ) { } private StyledText getOutputText ( ) { } ChatRoom ( IChatRoomContainer container , ChatRoomManagerView . ChatRoomTab tabItem ) { } private SelectionListener scrollSelectionListener = new SelectionListener ( ) { public void widgetDefaultSelected ( SelectionEvent e ) { } public void widgetSelected ( SelectionEvent e ) { } } ; protected void makeTabItemBold ( ) { } protected void makeTabItemNormal ( ) { } protected void changeTabItem ( boolean bold ) { } public void handleMessage ( final ID fromID , final String messageBody ) { } public void handleInvitationReceived ( ID roomID , ID from , String subject , String body ) { } public void keyPressed ( KeyEvent e ) { } public void keyReleased ( KeyEvent e ) { } protected void handleKeyPressed ( KeyEvent evt ) { Text inputText = getInputText ( ) ; if ( ( evt . character ) == ( SWT . CR ) ) { if ( ( inputText . getText ( ) . trim ( ) . length ( ) ) > 0 ) handleTextInput ( inputText . getText ( ) ) ; clearInput ( ) ; evt . doit = false ; isCycling = false ; } else if ( ( evt . character ) == ( SWT . TAB ) ) { evt . doit = false ; int pos = inputText . getCaretPosition ( ) ; if ( pos == 0 ) return ; String text = inputText . getText ( ) ; if ( isCycling ) { if ( ( choice ) == ( options . size ( ) ) ) { choice = 0 ; } String append = ( ( ( String ) ( options . get ( ( ( choice ) ++ ) ) ) ) . substring ( prefixLength ) ) + ( isAtStart ? ( nickCompletionSuffix ) + "<seq2seq4repair_space>" : "<seq2seq4repair_space>" ) ; inputText . setText ( ( ( ( text . substring ( 0 , caret ) ) + append ) + ( text . substring ( ( ( caret ) + ( nickRemainder ) ) ) ) ) ) ; nickRemainder = append . length ( ) ; inputText . setSelection ( ( ( caret ) + ( nickRemainder ) ) , ( ( caret ) + ( nickRemainder ) ) ) ; } else { int count = pos - 1 ; while ( ( count > ( - 1 ) ) && ( ! ( Character . isWhitespace ( text . charAt ( count ) ) ) ) ) { count -- ; } count ++ ; options . clear ( ) ; String prefix = text . substring ( count , pos ) ; isAtStart = count == 0 ; if ( prefix . trim ( ) . equals ( "" ) ) { return ; } TableItem [ ] participants = chatRoomParticipantViewer . getTable ( ) . getItems ( ) ; for ( int i = 0 ; i < ( participants . length ) ; i ++ ) { if ( participants [ i ] . getText ( ) . startsWith ( prefix ) ) { <START_BUG> options . add ( participants [ i ] ) ; <END_BUG> } } if ( options . isEmpty ( ) ) return ; prefixLength = prefix . length ( ) ; if ( ( options . size ( ) ) == 1 ) { String nickname = ( ( String ) ( options . get ( 0 ) ) ) ; nickname = nickname . substring ( prefixLength ) ; inputText . insert ( ( nickname + ( isAtStart ? ( nickCompletionSuffix ) + "<seq2seq4repair_space>" : "<seq2seq4repair_space>" ) ) ) ; } else if ( ( options . size ( ) ) <= ( maximumCyclingOptions ) ) { isCycling = true ; caret = pos ; choice = 0 ; String nickname = ( options . get ( ( ( choice ) ++ ) ) ) + ( isAtStart ? ( nickCompletionSuffix ) + "<seq2seq4repair_space>" : "<seq2seq4repair_space>" ) ; nickname = nickname . substring ( prefixLength ) ; inputText . insert ( nickname ) ; nickRemainder = nickname . length ( ) ; } else { StringBuffer choices = new StringBuffer ( ) ; synchronized ( choices ) { for ( int i = 0 ; i < ( options . size ( ) ) ; i ++ ) { choices . append ( options . get ( i ) ) . append ( '<seq2seq4repair_space>' ) ; } choices . delete ( ( ( choices . length ( ) ) - 1 ) , choices . length ( ) ) ; } appendText ( getOutputText ( ) , new ChatLine ( choices . toString ( ) ) ) ; } } } else { isCycling = false ; } } protected void handleKeyReleased ( KeyEvent evt ) { } protected void handleTextInput ( String text ) { } protected void chatRoomDisconnect ( ) { }

Fix:
options . add ( participants [ i ] . getText ( ) ) ;