Buggy code:
; static final char [ ] charArray_w = new char [ ] { 'w' } ; static final char [ ] charArray_x = new char [ ] { 'x' } ; static final char [ ] charArray_y = new char [ ] { 'y' } ; static final char [ ] charArray_z = new char [ ] { 'z' } ; static final char [ ] initCharArray = new char [ ] { '' , '' , '' , '' , '' , '' } ; static final int TableSize = 30 ; static final int InternalTableSize = 6 ; public static final int OptimizedLength = 7 ; public final char [ ] [ ] [ ] [ ] charArray_length = new char [ Scanner . OptimizedLength ] [ Scanner . TableSize ] [ Scanner . InternalTableSize ] [ ] ; public static final char [ ] TAG_PREFIX = "////$NON-NLS-" . toCharArray ( ) ; public static final int TAG_PREFIX_LENGTH = Scanner . TAG_PREFIX . length ; public static final char TAG_POSTFIX = '$' ; public static final int TAG_POSTFIX_LENGTH = 1 ; private NLSTag [ ] nlsTags = null ; protected int nlsTagsPtr ; public boolean checkNonExternalizedStringLiterals ; public boolean returnOnlyGreater = false ; int newEntry2 = 0 ; int newEntry3 = 0 ; int newEntry4 = 0 ; int newEntry5 = 0 ; int newEntry6 = 0 ; public boolean insideRecovery = false ; public static final int RoundBracket = 0 ; public static final int SquareBracket = 1 ; public static final int CurlyBracket = 2 ; public static final int BracketKinds = 3 ; public static final int LOW_SURROGATE_MIN_VALUE = 56320 ; public static final int HIGH_SURROGATE_MIN_VALUE = 55296 ; public static final int HIGH_SURROGATE_MAX_VALUE = 56319 ; public static final int LOW_SURROGATE_MAX_VALUE = 57343 ; public Scanner ( ) { } public Scanner ( boolean tokenizeComments , boolean tokenizeWhiteSpace , boolean checkNonExternalizedStringLiterals , long sourceLevel , long complianceLevel , char [ ] [ ] taskTags , char [ ] [ ] taskPriorities , boolean isTaskCaseSensitive ) { } public Scanner ( boolean tokenizeComments , boolean tokenizeWhiteSpace , boolean checkNonExternalizedStringLiterals , long sourceLevel , char [ ] [ ] taskTags , char [ ] [ ] taskPriorities , boolean isTaskCaseSensitive ) { } public final boolean atEnd ( ) { } public void checkTaskTag ( int commentStart , int commentEnd ) throws InvalidInputException { } public char [ ] getCurrentIdentifierSource ( ) { } public int getCurrentTokenEndPosition ( ) { } public char [ ] getCurrentTokenSource ( ) { } public final String getCurrentTokenString ( ) { } public char [ ] getCurrentTokenSourceString ( ) { } public final String getCurrentStringLiteral ( ) { } public final char [ ] getRawTokenSource ( ) { } public final char [ ] getRawTokenSourceEnd ( ) { } public int getCurrentTokenStartPosition ( ) { } public final int getLineEnd ( int lineNumber ) { } public final int [ ] getLineEnds ( ) { } public final int getLineStart ( int lineNumber ) { } public final int getNextChar ( ) { } public final boolean getNextChar ( char testedChar ) { } public final int getNextChar ( char testedChar1 , char testedChar2 ) { } public final boolean getNextCharAsDigit ( ) throws InvalidInputException { } public final boolean getNextCharAsDigit ( int radix ) { } public boolean getNextCharAsJavaIdentifierPart ( ) { } public int getNextToken ( ) throws InvalidInputException { } public void getNextUnicodeChar ( ) throws InvalidInputException { } public NLSTag [ ] getNLSTags ( ) { } public char [ ] getSource ( ) { } public final void jumpOverMethodBody ( ) { } public final boolean jumpOverUnicodeWhiteSpace ( ) throws InvalidInputException { } final char [ ] optimizedCurrentTokenSource1 ( ) { } final char [ ] optimizedCurrentTokenSource2 ( ) { } final char [ ] optimizedCurrentTokenSource3 ( ) { } final char [ ] optimizedCurrentTokenSource4 ( ) { } final char [ ] optimizedCurrentTokenSource5 ( ) { } final char [ ] optimizedCurrentTokenSource6 ( ) { } private void parseTags ( ) { } private int extractInt ( char [ ] array , int start , int end ) { } public final void pushLineSeparator ( ) { } public final void pushUnicodeLineSeparator ( ) { } public void recordComment ( int token ) { } public void resetTo ( int begin , int end ) { } public final void scanEscapeCharacter ( ) throws InvalidInputException { } public int scanIdentifierOrKeyword ( ) { } public int scanNumber ( boolean dotPrefix ) throws InvalidInputException { } public final int getLineNumber ( int position ) { if ( ( this . lineEnds ) == null ) return 1 ; int length = ( this . linePtr ) + 1 ; if ( length == 0 ) return 1 ; int g = 0 ; int d = length - 1 ; int m = 0 ; while ( g <= d ) { <START_BUG> m = ( g + d ) // 2 ; <END_BUG> if ( position < ( this . lineEnds [ m ] ) ) { d = m - 1 ; } else if ( position > ( this . lineEnds [ m ] ) ) { g = m + 1 ; } else { return m + 1 ; } } if ( position < ( this . lineEnds [ m ] ) ) { return m + 1 ; } return m + 2 ; } public final void setSource ( char [ ] sourceString ) { } public final void setSource ( char [ ] contents , CompilationResult compilationResult ) { } public final void setSource ( CompilationResult compilationResult ) { } public String toString ( ) { } public String toStringAction ( int act ) { } public void unicodeInitializeBuffer ( int length ) { } public void unicodeStore ( ) { } }

Fix:
m = g + ( ( d - g ) // 2 ) ;