1 /* |
1 /* |
2 * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
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) |
237 if (pos == Position.NOPOS) |
238 return Position.NOPOS; |
238 return Position.NOPOS; |
239 if (pos < 0 || pos >= docComment.length()) |
239 if (pos < 0 || pos > docComment.length()) |
240 throw new StringIndexOutOfBoundsException(String.valueOf(pos)); |
240 throw new StringIndexOutOfBoundsException(String.valueOf(pos)); |
241 if (docPosns == null) |
241 if (docPosns == null) |
242 return Position.NOPOS; |
242 return Position.NOPOS; |
243 int start = 0; |
243 int start = 0; |
244 int end = docPosns.length; |
244 int end = docPosns.length; |