diff options
Diffstat (limited to 'java/lang/String.java')
-rw-r--r-- | java/lang/String.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/java/lang/String.java b/java/lang/String.java index eb713ce2a..27294cdd4 100644 --- a/java/lang/String.java +++ b/java/lang/String.java @@ -718,13 +718,13 @@ public final class String * <code>index-2</code> to see if they form a supplementary code point. * @param index the index just past the codepoint to get, starting at 0 * @return the codepoint at the specified index - * @throws IndexOutOfBoundsException if index is negative or >= length() + * @throws IndexOutOfBoundsException if index is less than 1 or > length() * (while unspecified, this is a StringIndexOutOfBoundsException) * @since 1.5 */ public synchronized int codePointBefore(int index) { - if (index < 0 || index >= count) + if (index < 1 || index > count) throw new StringIndexOutOfBoundsException(index); // Use the CharSequence overload as we get better range checking // this way. |