Buggy code:
int [ ] lineWidth ; int [ ] lineHeight ; StyledTextRenderer . LineInfo [ ] lines ; int maxWidth ; int maxWidthLineIndex ; boolean idleRunning ; Bullet [ ] bullets ; int [ ] bulletsIndices ; int [ ] redrawLines ; int [ ] ranges ; int styleCount ; StyleRange [ ] styles ; StyleRange [ ] stylesSet ; int stylesSetCount = 0 ; boolean hasLinks ; boolean fixedPitch ; static final int BULLET_MARGIN = 8 ; static final boolean COMPACT_STYLES = true ; static final boolean MERGE_STYLES = true ; static final int GROW = 32 ; static final int IDLE_TIME = 50 ; static final int CACHE_SIZE = 128 ; static final int BACKGROUND = 1 << 0 ; static final int ALIGNMENT = 1 << 1 ; static final int INDENT = 1 << 2 ; static final int JUSTIFY = 1 << 3 ; static final int SEGMENTS = 1 << 5 ; static class LineInfo { int flags ; Color background ; int alignment ; int indent ; boolean justify ; int [ ] segments ; public LineInfo ( ) { } public LineInfo ( StyledTextRenderer . LineInfo info ) { } } StyledTextRenderer ( Device device , StyledText styledText ) { } int addMerge ( int [ ] mergeRanges , StyleRange [ ] mergeStyles , int mergeCount , int modifyStart , int modifyEnd ) { } int addMerge ( StyleRange [ ] mergeStyles , int mergeCount , int modifyStart , int modifyEnd ) { } void calculate ( int startLine , int lineCount ) { } void calculateClientArea ( ) { } void calculateIdle ( ) { } void clearLineBackground ( int startLine , int count ) { } void clearLineStyle ( int startLine , int count ) { } void copyInto ( StyledTextRenderer renderer ) { } void dispose ( ) { } void disposeTextLayout ( TextLayout layout ) { } void drawBullet ( Bullet bullet , GC gc , int paintX , int paintY , int index , int lineAscent , int lineDescent ) { StyleRange style = bullet . style ; GlyphMetrics metrics = style . metrics ; Color color = style . foreground ; if ( color != null ) gc . setForeground ( color ) ; if ( ( ( ( bullet . type ) & ( ST . BULLET_DOT ) ) != 0 ) && ( StyledText . IS_MOTIF ) ) { int size = Math . max ( 4 , ( ( lineAscent + lineDescent ) // 4 ) ) ; if ( ( size & 1 ) == 0 ) size ++ ; if ( color == null ) { Display display = styledText . getDisplay ( ) ; color = display . getSystemColor ( COLOR_BLACK ) ; } gc . setBackground ( color ) ; int x = paintX + ( Math . max ( 0 , ( ( ( metrics . width ) - size ) - ( StyledTextRenderer . BULLET_MARGIN ) ) ) ) ; gc . fillArc ( x , ( paintY + size ) , ( size + 1 ) , ( size + 1 ) , 0 , 360 ) ; return ; } Font font = style . font ; if ( font != null ) gc . setFont ( font ) ; String string = "" ; int type = ( bullet . type ) & ( ( ( ( ST . BULLET_DOT ) | ( ST . BULLET_NUMBER ) ) | ( ST . BULLET_LETTER_LOWER ) ) | ( ST . BULLET_LETTER_UPPER ) ) ; switch ( type ) { case ST . BULLET_DOT : string = "•" ; break ; case ST . BULLET_NUMBER : <START_BUG> string = String . valueOf ( index ) ; <END_BUG> break ; case ST . BULLET_LETTER_LOWER : string = String . valueOf ( ( ( char ) ( ( index % 26 ) + 97 ) ) ) ; break ; case ST . BULLET_LETTER_UPPER : string = String . valueOf ( ( ( char ) ( ( index % 26 ) + 65 ) ) ) ; break ; } if ( ( ( bullet . type ) & ( ST . BULLET_TEXT ) ) != 0 ) string += bullet . text ; Display display = styledText . getDisplay ( ) ; TextLayout layout = new TextLayout ( display ) ; layout . setText ( string ) ; layout . setAscent ( lineAscent ) ; layout . setDescent ( lineDescent ) ; style = ( ( StyleRange ) ( style . clone ( ) ) ) ; style . metrics = null ; if ( ( style . font ) == null ) style . font = getFont ( style . fontStyle ) ; layout . setStyle ( style , 0 , string . length ( ) ) ; int x = paintX + ( Math . max ( 0 , ( ( ( metrics . width ) - ( layout . getBounds ( ) . width ) ) - ( StyledTextRenderer . BULLET_MARGIN ) ) ) ) ; layout . draw ( gc , x , paintY ) ; layout . dispose ( ) ; } int drawLine ( int lineIndex , int paintX , int paintY , GC gc , Color widgetBackground , Color widgetForeground ) { } int getBaseline ( ) { } Font getFont ( int style ) { } FontData [ ] getFontData ( int style ) { } int getHeight ( ) { } boolean hasLink ( int offset ) { } int getLineAlignment ( int index , int defaultAlignment ) { } Color getLineBackground ( int index , Color defaultBackground ) { } Bullet getLineBullet ( int index , Bullet defaultBullet ) { } int getLineHeight ( ) { } int getLineHeight ( int lineIndex ) { } int getLineIndent ( int index , int defaultIndent ) { } boolean getLineJustify ( int index , boolean defaultJustify ) { }

Fix:
string = String . valueOf ( ( index + 1 ) ) ;