Buggy code:
public class Text extends Scrollable { int txnObject ; int txnFrameID ; int frameHandle ; int textLimit = Text . LIMIT ; int tabs = 8 ; ControlEditTextSelectionRec selection ; char echoCharacter ; boolean doubleClick ; String hiddenText ; String message ; public static final int LIMIT ; public static final String DELIMITER ; static final char PASSWORD = '•' ; public Text ( Composite parent , int style ) { } 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 ) { } int callPaintEventHandler ( int control , int damageRgn , int visibleRgn , int theEvent , int nextHandler ) { } int callFocusEventHandler ( int nextHandler , int theEvent ) { } public void clearSelection ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { checkWidget ( ) ; int width = 0 ; int height = 0 ; if ( ( txnObject ) == 0 ) { if ( ( ( style ) & ( SWT . RIGHT ) ) != 0 ) { OS . SetControlData ( handle , kControlEntireControl , kControlEditTextSingleLineTag , 1 , new byte [ ] { 1 } ) ; } Rect rect = new Rect ( ) ; OS . GetBestControlRect ( handle , rect , null ) ; if ( ( ( style ) & ( SWT . RIGHT ) ) != 0 ) { OS . SetControlData ( handle , kControlEntireControl , kControlEditTextSingleLineTag , 1 , new byte [ ] { 0 } ) ; } width = ( rect . right ) - ( rect . left ) ; height = ( rect . bottom ) - ( rect . top ) ; if ( ( ( style ) & ( SWT . SEARCH ) ) != 0 ) { int [ ] ptr1 = new int [ 1 ] ; OS . GetControlData ( handle , ( ( short ) ( kControlEntireControl ) ) , kControlEditTextCFStringTag , 4 , ptr1 , null ) ; Point size1 = textExtent ( ptr1 [ 0 ] , 0 ) ; if ( ( ptr1 [ 0 ] ) != 0 ) OS . CFRelease ( ptr1 [ 0 ] ) ; width = size1 . x ; } } else { int [ ] oDataHandle = new int [ 1 ] ; OS . TXNGetData ( txnObject , kTXNStartOffset , kTXNEndOffset , oDataHandle ) ; if ( ( oDataHandle [ 0 ] ) != 0 ) { int length = OS . GetHandleSize ( oDataHandle [ 0 ] ) ; int str = 0 ; if ( length != 0 ) { int [ ] ptr = new int [ 1 ] ; OS . HLock ( oDataHandle [ 0 ] ) ; OS . memmove ( ptr , oDataHandle [ 0 ] , 4 ) ; str = OS . CFStringCreateWithCharacters ( kCFAllocatorDefault , ptr [ 0 ] , ( length // 2 ) ) ; OS . HUnlock ( oDataHandle [ 0 ] ) ; } OS . DisposeHandle ( oDataHandle [ 0 ] ) ; <START_BUG> Point size = textExtent ( str , ( wHint == ( SWT . DEFAULT ) ? 0 : wHint ) ) ; <END_BUG> if ( str != 0 ) OS . CFRelease ( str ) ; width = size . x ; height = size . y ; } } if ( width <= 0 ) width = DEFAULT_WIDTH ; if ( height <= 0 ) height = DEFAULT_HEIGHT ; if ( wHint != ( SWT . DEFAULT ) ) width = wHint ; if ( hHint != ( SWT . DEFAULT ) ) height = hHint ; Rectangle trim = computeTrim ( 0 , 0 , width , height ) ; width = trim . width ; height = trim . height ; return new Point ( width , height ) ; } public Rectangle computeTrim ( int x , int y , int width , int height ) { } public void copy ( ) { } void createHandle ( ) { } ScrollBar createScrollBar ( int style ) { } void createWidget ( ) { } public void cut ( ) { } Color defaultBackground ( ) { } Color defaultForeground ( ) { } void deregister ( ) { } boolean dragDetect ( int x , int y , boolean filter , boolean [ ] consume ) { } int focusPart ( ) { } public int getCaretLineNumber ( ) { } public Point getCaretLocation ( ) { } public int getCaretPosition ( ) { } public int getCharCount ( ) { } public boolean getDoubleClickEnabled ( ) { } public char getEchoChar ( ) { } public boolean getEditable ( ) { } Rect getInset ( ) { } public int getLineCount ( ) { } public String getLineDelimiter ( ) { } public int getLineHeight ( ) { } public int getOrientation ( ) { } public String getMessage ( ) { } int getPosition ( int x , int y ) { } public int getPosition ( Point point ) { } public Point getSelection ( ) { } public int getSelectionCount ( ) { } public String getSelectionText ( ) { } public int getTabs ( ) { } public String getText ( ) { } public String getText ( int start , int end ) { } char [ ] getEditText ( int start , int end ) { } public int getTextLimit ( ) { } public int getTopIndex ( ) { } public int getTopPixel ( ) { } String getTXNText ( int iStartOffset , int iEndOffset ) { } void hookEvents ( ) { } Rect inset ( ) { }

Fix:
Point size = textExtent ( str , ( ( wHint != ( SWT . DEFAULT ) ) && ( ( ( style ) & ( SWT . WRAP ) ) != 0 ) ? wHint : 0 ) ) ;