Buggy code:
public class Combo extends Composite { int menuHandle ; int textLimit = Combo . LIMIT ; String lastText = "" ; 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 ) { } static int checkStyle ( int style ) { } void checkSelection ( ) { } protected void checkSubclass ( ) { } public void clearSelection ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } public void copy ( ) { } void copy ( char [ ] buffer ) { } void createHandle ( ) { } public void cut ( ) { } public void deselect ( int index ) { } public void deselectAll ( ) { } public String getItem ( int index ) { } public int getItemCount ( ) { } public int getItemHeight ( ) { } public String [ ] getItems ( ) { } int getMininumHeight ( ) { } public int getOrientation ( ) { } public Point getSelection ( ) { } public int getSelectionIndex ( ) { } public String getText ( ) { } char [ ] getText ( int start , int end ) { int result ; int [ ] ptr = new int [ 1 ] ; if ( ( ( style ) & ( SWT . READ_ONLY ) ) != 0 ) { int index = ( OS . GetControlValue ( handle ) ) - 1 ; result = OS . CopyMenuItemTextAsCFString ( menuHandle , ( ( short ) ( index + 1 ) ) , ptr ) ; } else { int [ ] actualSize = new int [ 1 ] ; result = OS . GetControlData ( handle , ( ( short ) ( kHIComboBoxEditTextPart ) ) , kControlEditTextCFStringTag , 4 , ptr , actualSize ) ; } if ( result != ( OS . noErr ) ) return new char [ 0 ] ; CFRange range = new CFRange ( ) ; range . location = start ; if ( end == ( - 1 ) ) { int length = OS . CFStringGetLength ( ptr [ 0 ] ) ; range . length = length - start ; } else { <START_BUG> range . length = ( end - start ) + 1 ; <END_BUG> } char [ ] buffer = new char [ range . length ] ; OS . CFStringGetCharacters ( ptr [ 0 ] , range , buffer ) ; OS . CFRelease ( ptr [ 0 ] ) ; return buffer ; } public int getTextHeight ( ) { } public int getTextLimit ( ) { } public int getVisibleItemCount ( ) { } void hookEvents ( ) { } public int indexOf ( String string ) { } public int indexOf ( String string , int start ) { } String getClipboardText ( ) { } int getCharCount ( ) { } Rect getInset ( ) { } int kEventControlActivate ( int nextHandler , int theEvent , int userData ) { } int kEventProcessCommand ( int nextHandler , int theEvent , int userData ) { } int kEventRawKeyPressed ( int nextHandler , int theEvent , int userData ) { } int kEventControlSetFocusPart ( int nextHandler , int theEvent , int userData ) { } int kEventTextInputUnicodeForKeyEvent ( int nextHandler , int theEvent , int userData ) { } public void paste ( ) { } 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 ) { } boolean sendKeyEvent ( int type , Event event ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize , boolean events ) { } public void setItem ( int index , String string ) { } public void setItems ( String [ ] items ) { } 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 ) { } String verifyText ( String string , int start , int end , Event keyEvent ) { } }

Fix:
range . length = end - start ;