Buggy code:
public class Combo extends Composite { int textLimit = Combo . LIMIT ; boolean receivingFocus ; NSRange selectionRange ; public static final int LIMIT ; public Combo ( Composite parent , int style ) { } public void add ( String string ) { } public void add ( String string , int index ) { } public void addModifyListener ( ModifyListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } public void addVerifyListener ( VerifyListener listener ) { } boolean becomeFirstResponder ( int id , int sel ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public void clearSelection ( ) { } void comboBoxSelectionDidChange ( int id , int sel , int notification ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } public void copy ( ) { } void createHandle ( ) { } public void cut ( ) { } Color defaultBackground ( ) { } NSFont defaultNSFont ( ) { } Color defaultForeground ( ) { } void deregister ( ) { } public void deselect ( int index ) { } public void deselectAll ( ) { } boolean dragDetect ( int x , int y , boolean filter , boolean [ ] consume ) { } int getCharCount ( ) { } public String getItem ( int index ) { } public int getItemCount ( ) { } public int getItemHeight ( ) { } public String [ ] getItems ( ) { } public boolean getListVisible ( ) { } int getMininumHeight ( ) { } public int getOrientation ( ) { } public Point getSelection ( ) { } public int getSelectionIndex ( ) { checkWidget ( ) ; if ( ( ( style ) & ( SWT . READ_ONLY ) ) != 0 ) { return ( ( int ) ( ( ( NSPopUpButton ) ( view ) ) . indexOfSelectedItem ( ) ) ) ; } else { <START_BUG> return indexOf ( getText ( ) ) ; <END_BUG> } } public String getText ( ) { } char [ ] getText ( int start , int end ) { } public int getTextHeight ( ) { } public int getTextLimit ( ) { } public int getVisibleItemCount ( ) { } public int indexOf ( String string ) { } public int indexOf ( String string , int start ) { } void insertEditText ( String string ) { } boolean isEventView ( int id ) { } void mouseDown ( int id , int sel , int theEvent ) { } public void paste ( ) { } void register ( ) { } void releaseWidget ( ) { } public void remove ( int index ) { } public void remove ( int start , int end ) { } public void remove ( String string ) { } public void removeAll ( ) { } public void removeModifyListener ( ModifyListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void removeVerifyListener ( VerifyListener listener ) { } public void select ( int index ) { } void sendSelection ( ) { } boolean sendKeyEvent ( NSEvent nsEvent , int type ) { } void updateBackground ( ) { } void setBounds ( int x , int y , int width , int height , boolean move , boolean resize ) { } void setForeground ( float [ ] color ) { } public void setItem ( int index , String string ) { } public void setItems ( String [ ] items ) { } public void setListVisible ( boolean visible ) { } public void setOrientation ( int orientation ) { } public void setSelection ( Point selection ) { } public void setText ( String string ) { } void setText ( String string , boolean notify ) { } public void setTextLimit ( int limit ) { } public void setVisibleItemCount ( int count ) { } boolean shouldChangeTextInRange_replacementString ( int id , int sel , int affectedCharRange , int replacementString ) { } void textViewDidChangeSelection ( int id , int sel , int aNotification ) { } void textDidChange ( int id , int sel , int aNotification ) { } NSRange textView_willChangeSelectionFromCharacterRange_toCharacterRange ( int id , int sel , int aTextView , int oldSelectedCharRange , int newSelectedCharRange ) { } String verifyText ( String string , int start , int end , NSEvent keyEvent ) { } }

Fix:
return ( ( int ) ( ( ( NSComboBox ) ( view ) ) . indexOfSelectedItem ( ) ) ) ;