Buggy code:
void doContent ( char key ) { } void doContentEnd ( ) { } void doContentStart ( ) { } void doCursorPrevious ( ) { } void doCursorNext ( ) { } void doDelete ( ) { } void doDeleteWordNext ( ) { } void doDeleteWordPrevious ( ) { } void doLineDown ( boolean select ) { } void doLineEnd ( ) { } void doLineStart ( ) { } void doLineUp ( boolean select ) { } void doMouseLocationChange ( int x , int y , boolean select ) { } void doMouseSelection ( ) { } int doMouseWordSelect ( int x , int newCaretOffset , int line ) { } void doPageDown ( boolean select , int height ) { } void doPageEnd ( ) { } void doPageStart ( ) { } void doPageUp ( boolean select , int height ) { } void doSelection ( int direction ) { } void doSelectionCursorNext ( ) { } void doSelectionCursorPrevious ( ) { } void doSelectionLineDown ( ) { } void doSelectionLineUp ( ) { } void doSelectionPageDown ( int pixels ) { } void doSelectionPageUp ( int pixels ) { } void doSelectionWordNext ( ) { } void doSelectionWordPrevious ( ) { } void doVisualPrevious ( ) { } void doVisualNext ( ) { } void doWordNext ( ) { } void doWordPrevious ( ) { } void endAutoScroll ( ) { } public Color getBackground ( ) { } public int getBaseline ( ) { } public int getBaseline ( int offset ) { } public boolean getBidiColoring ( ) { } int getBottomIndex ( ) { } Rectangle getBoundsAtOffset ( int offset ) { } public int getCaretOffset ( ) { } int getCaretWidth ( ) { } Object getClipboardContent ( int clipboardType ) { } int getClusterNext ( int offset , int lineIndex ) { } int getClusterPrevious ( int offset , int lineIndex ) { } public StyledTextContent getContent ( ) { } public boolean getDragDetect ( ) { } public boolean getDoubleClickEnabled ( ) { } public boolean getEditable ( ) { } public Color getForeground ( ) { } int getHorizontalIncrement ( ) { } public int getHorizontalIndex ( ) { } public int getHorizontalPixel ( ) { } public int getIndent ( ) { } public boolean getJustify ( ) { } public int getKeyBinding ( int key ) { } public int getCharCount ( ) { } public int getLineAlignment ( int index ) { } public int getLineAtOffset ( int offset ) { } public Color getLineBackground ( int index ) { } public Bullet getLineBullet ( int index ) { } StyledTextEvent getLineBackgroundData ( int lineOffset , String line ) { } public int getLineCount ( ) { } int getLineCountWhole ( ) { } public String getLineDelimiter ( ) { } public int getLineHeight ( ) { } public int getLineHeight ( int offset ) { } public int getLineIndent ( int index ) { } public boolean getLineJustify ( int index ) { } public int getLineSpacing ( ) { } StyledTextEvent getLineStyleData ( int lineOffset , String line ) { } public int getLinePixel ( int lineIndex ) { } public int getLineIndex ( int y ) { } public Point getLocationAtOffset ( int offset ) { } public int getOffsetAtLine ( int lineIndex ) { } public int getOffsetAtLocation ( Point point ) { } int getOffsetAtPoint ( int x , int y ) { } int getOffsetAtPoint ( int x , int y , int lineIndex ) { } int getOffsetAtPoint ( int x , int y , int [ ] trailing ) { if ( ( ( y + ( getVerticalScrollOffset ( ) ) ) < 0 ) || ( ( x + ( horizontalScrollOffset ) ) < 0 ) ) { <START_BUG> SWT . error ( ERROR_INVALID_ARGUMENT ) ; <END_BUG> } int bottomIndex = getPartialBottomIndex ( ) ; int height = getLinePixel ( ( bottomIndex + 1 ) ) ; if ( y > height ) { return - 1 ; } int lineIndex = getLineIndex ( y ) ; int lineOffset = content . getOffsetAtLine ( lineIndex ) ; TextLayout layout = renderer . getTextLayout ( lineIndex ) ; x += ( horizontalScrollOffset ) - ( leftMargin ) ; y -= getLinePixel ( lineIndex ) ; int offset = layout . getOffset ( x , y , trailing ) ; Rectangle rect = layout . getLineBounds ( layout . getLineIndex ( offset ) ) ; renderer . disposeTextLayout ( layout ) ; if ( ( ( rect . x ) <= x ) && ( x <= ( ( rect . x ) + ( rect . width ) ) ) ) { return offset + lineOffset ; } return - 1 ; } public int getOrientation ( ) { } int getPartialBottomIndex ( ) { } int getPartialTopIndex ( ) { } String getPlatformDelimitedText ( StyledText . TextWriter writer ) { } public int [ ] getRanges ( ) { } public int [ ] getRanges ( int start , int length ) { } public Point getSelection ( ) { } public Point getSelectionRange ( ) { } public Color getSelectionBackground ( ) { } public int getSelectionCount ( ) { } public Color getSelectionForeground ( ) { } public String getSelectionText ( ) { } public int getStyle ( ) { } int [ ] getBidiSegments ( int lineOffset , String line ) { } int [ ] getBidiSegmentsCompatibility ( String line , int lineOffset ) { } public StyleRange getStyleRangeAtOffset ( int offset ) { } public StyleRange [ ] getStyleRanges ( ) { } public StyleRange [ ] getStyleRanges ( boolean includeRanges ) { } public StyleRange [ ] getStyleRanges ( int start , int length ) { } public StyleRange [ ] getStyleRanges ( int start , int length , boolean includeRanges ) { } public int getTabs ( ) { }

Fix:
return - 1 ;