Buggy code:
static final int DEFAULT_BACKGROUND = 1 ; Vector colorTable = new Vector ( ) ; boolean WriteUnicode ; public RTFWriter ( int start , int length ) { } public void close ( ) { } int getColorIndex ( Color color , int defaultIndex ) { } 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 , StyleRange [ ] styles , Color lineBackground ) { } } 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 ) { } } interface LineCache { public void calculate ( int startLine , int lineCount ) { } public int getWidth ( ) { } public void redrawReset ( int startLine , int lineCount , boolean calculateMaxWidth ) { } public void reset ( int startLine , int lineCount , boolean calculateMaxWidth ) { } public void textChanged ( int startOffset , int newLineCount , int replaceLineCount , int newCharCount , int replaceCharCount ) { } } class ContentWidthCache implements StyledText . LineCache { StyledText parent ; int [ ] lineWidth ; StyledTextContent content ; int lineCount ; int maxWidth ; int maxWidthLineIndex ; public ContentWidthCache ( StyledText parent , StyledTextContent content ) { } public void calculate ( int startLine , int lineCount ) { } void calculateVisible ( int startLine , int newLineCount ) { } int contentWidth ( String line , int lineOffset ) { } void expandLines ( int numLines ) { } public int getWidth ( ) { } void linesChanged ( int startLine , int delta ) { } public void redrawReset ( int startLine , int lineCount , boolean calculateMaxWidth ) { } public void reset ( int startLine , int lineCount , boolean calculateMaxWidth ) { } public void textChanged ( int startOffset , int newLineCount , int replaceLineCount , int newCharCount , int replaceCharCount ) { } } class WordWrapCache implements StyledText . LineCache { StyledText parent ; WrappedContent visualContent ; public WordWrapCache ( StyledText parent , WrappedContent content ) { } public void calculate ( int startLine , int lineCount ) { } public int getWidth ( ) { } public void redrawReset ( int startLine , int lineCount , boolean calculateMaxWidth ) { } public void reset ( int startLine , int lineCount , boolean calculateMaxWidth ) { } public void textChanged ( int startOffset , int newLineCount , int replaceLineCount , int newCharCount , int replaceCharCount ) { } } public StyledText ( Composite parent , int style ) { } public void addExtendedModifyListener ( ExtendedModifyListener extendedModifyListener ) { } public void setKeyBinding ( int key , int action ) { } public void addBidiSegmentListener ( BidiSegmentListener listener ) { } public void addLineBackgroundListener ( LineBackgroundListener listener ) { } public void addLineStyleListener ( LineStyleListener listener ) { } public void addModifyListener ( ModifyListener modifyListener ) { } public void addSelectionListener ( SelectionListener listener ) { } public void addVerifyKeyListener ( VerifyKeyListener listener ) { } public void addVerifyListener ( VerifyListener verifyListener ) { } public void append ( String string ) { } void calculateContentWidth ( ) { } void calculateScrollBars ( ) { } void calculateTopIndex ( ) { } static int checkStyle ( int style ) { if ( ( style & ( SWT . SINGLE ) ) != 0 ) { <START_BUG> style &= ~ ( ( ( SWT . H_SCROLL ) | ( SWT . V_SCROLL ) ) | ( SWT . WRAP ) ) ; <END_BUG> } else { style |= SWT . MULTI ; } return style ; } void claimBottomFreeSpace ( ) { } void claimRightFreeSpace ( ) { } void clearMargin ( GC gc , Color background , Rectangle clientArea , int y ) { } void clearSelection ( boolean sendEvent ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } public void copy ( ) { } String getModelDelimitedText ( String text ) { } void createKeyBindings ( ) { } void createCaretBitmaps ( ) { } public void cut ( ) { } void doAutoScroll ( Event event ) { } void doAutoScroll ( int direction ) { } void doBackspace ( ) { } void doContent ( char key ) { } void doContentEnd ( ) { } void doContentStart ( ) { } void doCursorPrevious ( ) { } void doCursorNext ( ) { } void doDelete ( ) { } void doDeleteWordNext ( ) { } void doDeleteWordPrevious ( ) { } int doLineDown ( ) { } void doLineEnd ( ) { } void doLineStart ( ) { } int doLineUp ( ) { } void doMouseLocationChange ( int x , int y , boolean select ) { } void doMouseSelection ( ) { } int doMouseWordSelect ( int x , int newCaretOffset , int line ) { } void doPageDown ( boolean select ) { } void doPageEnd ( ) { } void doPageStart ( ) { } void doPageUp ( ) { } void doSelection ( int direction ) { }

Fix:
style &= ~ ( ( ( ( SWT . H_SCROLL ) | ( SWT . V_SCROLL ) ) | ( SWT . WRAP ) ) | ( SWT . MULTI ) ) ;