src/share/classes/com/sun/tools/javac/parser/JavadocTokenizer.java

changeset 1409
33abf479f202
parent 1282
3468519d9b45
child 1529
950d8195a5a4
equal deleted inserted replaced
1408:b486794d160d 1409:33abf479f202
232 // less than pos. Since docPosns is a list of pairs of integers 232 // less than pos. Since docPosns is a list of pairs of integers
233 // we must make sure the index is always even. 233 // we must make sure the index is always even.
234 // If we find an exact match for pos, the other item in the pair 234 // If we find an exact match for pos, the other item in the pair
235 // gives the source pos; otherwise, compute the source position 235 // gives the source pos; otherwise, compute the source position
236 // relative to the best match found in the array. 236 // relative to the best match found in the array.
237 if (pos == Position.NOPOS)
238 return Position.NOPOS;
237 if (pos < 0 || pos >= docComment.length()) 239 if (pos < 0 || pos >= docComment.length())
238 throw new StringIndexOutOfBoundsException(); 240 throw new StringIndexOutOfBoundsException(String.valueOf(pos));
239 if (docPosns == null) 241 if (docPosns == null)
240 return -1; 242 return Position.NOPOS;
241 int start = 0; 243 int start = 0;
242 int end = docPosns.length; 244 int end = docPosns.length;
243 while (start < end - 2) { 245 while (start < end - 2) {
244 // find an even index midway between start and end 246 // find an even index midway between start and end
245 int index = ((start + end) / 4) * 2; 247 int index = ((start + end) / 4) * 2;

mercurial