Buggy code:
StyledTextContent copyContent ( StyledTextContent original ) { } void dispose ( ) { } void init ( ) { } void print ( ) { } void printDecoration ( int page , boolean header ) { } void printDecorationSegment ( String segment , int alignment , int page , boolean header ) { } void printLine ( int paintX , int paintY , GC gc , Color foreground , Color background , TextLayout layout ) { } public void run ( ) { } } class RTFWriter extends StyledText . TextWriter { static final int DEFAULT_FOREGROUND = 0 ; static final int DEFAULT_BACKGROUND = 1 ; Vector colorTable ; Vector fontTable ; boolean WriteUnicode ; public RTFWriter ( int start , int length ) { } public void close ( ) { } int getColorIndex ( Color color , int defaultIndex ) { } int getFontIndex ( Font font ) { } void setUnicode ( ) { } void write ( String string , int start , int end ) { } void writeHeader ( ) { } public void writeLine ( String line , int lineOffset ) { } public void writeLineDelimiter ( String lineDelimiter ) { } void writeStyledLine ( String line , int lineOffset , int [ ] ranges , StyleRange [ ] styles , Color lineBackground , int indent , int alignment , boolean justify ) { } } class TextWriter { private StringBuffer buffer ; private int startOffset ; private int endOffset ; private boolean isClosed = false ; public TextWriter ( int start , int length ) { } public void close ( ) { } public int getCharCount ( ) { } public int getStart ( ) { } public boolean isClosed ( ) { } public String toString ( ) { } void write ( String string ) { } void write ( String string , int offset ) { } void write ( int i ) { } void write ( char i ) { } public void writeLine ( String line , int lineOffset ) { } public void writeLineDelimiter ( String lineDelimiter ) { } } public StyledText ( Composite parent , int style ) { } public void addExtendedModifyListener ( ExtendedModifyListener extendedModifyListener ) { } public void addBidiSegmentListener ( BidiSegmentListener listener ) { } public void addLineBackgroundListener ( LineBackgroundListener listener ) { } public void addLineStyleListener ( LineStyleListener listener ) { } public void addModifyListener ( ModifyListener modifyListener ) { } public void addPaintObjectListener ( PaintObjectListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } public void addVerifyKeyListener ( VerifyKeyListener listener ) { } public void addVerifyListener ( VerifyListener verifyListener ) { } public void append ( String string ) { } void calculateScrollBars ( ) { } void calculateTopIndex ( int delta ) { } static int checkStyle ( int style ) { } void claimBottomFreeSpace ( ) { } void claimRightFreeSpace ( ) { } void clearSelection ( boolean sendEvent ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { checkWidget ( ) ; int lineCount = ( ( ( getStyle ( ) ) & ( SWT . SINGLE ) ) != 0 ) ? 1 : content . getLineCount ( ) ; int width = 0 ; int height = 0 ; if ( ( wHint == ( SWT . DEFAULT ) ) || ( hHint == ( SWT . DEFAULT ) ) ) { Display display = getDisplay ( ) ; int maxHeight = display . getClientArea ( ) . height ; for ( int lineIndex = 0 ; lineIndex < lineCount ; lineIndex ++ ) { TextLayout layout = renderer . getTextLayout ( lineIndex ) ; if ( wordWrap ) layout . setWidth ( ( wHint == 0 ? 1 : wHint ) ) ; Rectangle rect = layout . getBounds ( ) ; height += rect . height ; width = Math . max ( width , rect . width ) ; renderer . disposeTextLayout ( layout ) ; <START_BUG> if ( ( isFixedLineHeight ( ) ) && ( height < maxHeight ) ) <END_BUG> break ; } if ( isFixedLineHeight ( ) ) { height = lineCount * ( renderer . getLineHeight ( ) ) ; } } if ( width == 0 ) width = StyledText . DEFAULT_WIDTH ; if ( height == 0 ) height = StyledText . DEFAULT_HEIGHT ; if ( wHint != ( SWT . DEFAULT ) ) width = wHint ; if ( hHint != ( SWT . DEFAULT ) ) height = hHint ; int wTrim = ( ( leftMargin ) + ( rightMargin ) ) + ( getCaretWidth ( ) ) ; int hTrim = ( topMargin ) + ( bottomMargin ) ; Rectangle rect = computeTrim ( 0 , 0 , ( width + wTrim ) , ( height + hTrim ) ) ; return new Point ( rect . width , rect . height ) ; } public void copy ( ) { } public void copy ( int clipboardType ) { } public int getAlignment ( ) { } int getAvailableHeightAbove ( int height ) { } int getAvailableHeightBellow ( int height ) { } String getModelDelimitedText ( String text ) { } void createKeyBindings ( ) { } void createCaretBitmaps ( ) { } public void cut ( ) { } boolean detectDrag ( int x , int y , int button ) { } void doAutoScroll ( Event event ) { } void doAutoScroll ( int direction , int distance ) { } void doBackspace ( ) { } void doContent ( char key ) { } void doContentEnd ( ) { } void doContentStart ( ) { } void doCursorPrevious ( ) { } void doCursorNext ( ) { } void doDelete ( ) { } void doDeleteWordNext ( ) { } void doDeleteWordPrevious ( ) { } void doLineDown ( boolean select ) { }

Fix:
if ( ( isFixedLineHeight ( ) ) && ( height > maxHeight ) )