diff -r b486794d160d -r 33abf479f202 src/share/classes/com/sun/tools/javac/parser/JavadocTokenizer.java --- a/src/share/classes/com/sun/tools/javac/parser/JavadocTokenizer.java Wed Nov 14 16:41:51 2012 -0800 +++ b/src/share/classes/com/sun/tools/javac/parser/JavadocTokenizer.java Wed Nov 14 17:23:10 2012 -0800 @@ -234,10 +234,12 @@ // If we find an exact match for pos, the other item in the pair // gives the source pos; otherwise, compute the source position // relative to the best match found in the array. + if (pos == Position.NOPOS) + return Position.NOPOS; if (pos < 0 || pos >= docComment.length()) - throw new StringIndexOutOfBoundsException(); + throw new StringIndexOutOfBoundsException(String.valueOf(pos)); if (docPosns == null) - return -1; + return Position.NOPOS; int start = 0; int end = docPosns.length; while (start < end - 2) {