Buggy code:
; static final char [ ] charArray_d = new char [ ] { 'd' } ; static final char [ ] charArray_e = new char [ ] { 'e' } ; static final char [ ] charArray_f = new char [ ] { 'f' } ; static final char [ ] charArray_g = new char [ ] { 'g' } ; static final char [ ] charArray_h = new char [ ] { 'h' } ; static final char [ ] charArray_i = new char [ ] { 'i' } ; static final char [ ] charArray_j = new char [ ] { 'j' } ; static final char [ ] charArray_k = new char [ ] { 'k' } ; static final char [ ] charArray_l = new char [ ] { 'l' } ; static final char [ ] charArray_m = new char [ ] { 'm' } ; static final char [ ] charArray_n = new char [ ] { 'n' } ; static final char [ ] charArray_o = new char [ ] { 'o' } ; static final char [ ] charArray_p = new char [ ] { 'p' } ; static final char [ ] charArray_q = new char [ ] { 'q' } ; static final char [ ] charArray_r = new char [ ] { 'r' } ; static final char [ ] charArray_s = new char [ ] { 's' } ; static final char [ ] charArray_t = new char [ ] { 't' } ; static final char [ ] charArray_u = new char [ ] { 'u' } ; static final char [ ] charArray_v = new char [ ] { 'v' } ; 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 = 6 ; public final char [ ] [ ] [ ] [ ] charArray_length = new char [ Scanner . OptimizedLength ] [ Scanner . TableSize ] [ Scanner . InternalTableSize ] [ ] ; int currentLineNr = - 1 ; int previousLineNr = - 1 ; NLSLine currentLine = null ; List lines = new ArrayList ( ) ; public static final String TAG_PREFIX = "////$NON-NLS-" ; public static final int TAG_PREFIX_LENGTH = Scanner . TAG_PREFIX . length ( ) ; public static final String TAG_POSTFIX = "$" ; public static final int TAG_POSTFIX_LENGTH = Scanner . TAG_POSTFIX . length ( ) ; public StringLiteral [ ] nonNLSStrings = null ; public boolean checkNonExternalizedStringLiterals = true ; public boolean wasNonExternalizedStringLiteral = false ; static int newEntry2 = 0 ; static int newEntry3 = 0 ; static int newEntry4 = 0 ; static int newEntry5 = 0 ; static int newEntry6 = 0 ; 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 Scanner ( ) { } public Scanner ( boolean tokenizeComments , boolean tokenizeWhiteSpace ) { } public final boolean atEnd ( ) { } public char [ ] getCurrentIdentifierSource ( ) { } public final char [ ] getCurrentTokenSource ( ) { } public final char [ ] getCurrentTokenSourceString ( ) { } public final int getLineEnd ( int lineNumber ) { } public final int getLineStart ( int lineNumber ) { } public final boolean getNextChar ( char testedChar ) { } public final int getNextChar ( char testedChar1 , char testedChar2 ) { } public final boolean getNextCharAsDigit ( ) { } public final boolean getNextCharAsDigit ( int radix ) { } public boolean getNextCharAsJavaIdentifierPart ( ) { } public int getNextToken ( ) throws InvalidInputException { } public final void getNextUnicodeChar ( ) throws IndexOutOfBoundsException , InvalidInputException { } public final void jumpOverMethodBody ( ) { } public final boolean jumpOverUnicodeWhiteSpace ( ) throws InvalidInputException { } public final int [ ] lineEnds ( ) { } final char [ ] optimizedCurrentTokenSource1 ( ) { } final char [ ] optimizedCurrentTokenSource2 ( ) { } final char [ ] optimizedCurrentTokenSource3 ( ) { } final char [ ] optimizedCurrentTokenSource4 ( ) { } final char [ ] optimizedCurrentTokenSource5 ( ) { } final char [ ] optimizedCurrentTokenSource6 ( ) { } public final void pushLineSeparator ( ) throws InvalidInputException { } public final void pushUnicodeLineSeparator ( ) { } public final void recordComment ( boolean isJavadoc ) { } public void resetTo ( int begin , int end ) { diet = false ; initialPosition = startPosition = currentPosition = begin ; <START_BUG> eofPosition = end + 1 ; <END_BUG> commentPtr = - 1 ; } public final void scanEscapeCharacter ( ) throws InvalidInputException { } public int scanIdentifierOrKeyword ( ) throws InvalidInputException { } public int scanNumber ( boolean dotPrefix ) throws InvalidInputException { } public final int searchLineNumber ( int position ) { } public final void setSourceBuffer ( char [ ] sourceString ) { } public String toString ( ) { } public final String toStringAction ( int act ) { } public Scanner ( boolean tokenizeComments , boolean tokenizeWhiteSpace , boolean checkNonExternalizedStringLiterals ) { } public Scanner ( boolean tokenizeComments , boolean tokenizeWhiteSpace , boolean checkNonExternalizedStringLiterals , boolean assertMode ) { } private void checkNonExternalizeString ( ) throws InvalidInputException { } private void parseTags ( NLSLine line ) throws InvalidInputException { } }

Fix:
eofPosition = ( end < ( Integer . MAX_VALUE ) ) ? end + 1 : end ;