diff options
author | doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-12-19 17:03:15 +0000 |
---|---|---|
committer | doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-12-19 17:03:15 +0000 |
commit | 6fec1adc6432eeafcdea2ab165989e170cb6e64e (patch) | |
tree | 9b478aacc6b13f1beadacec2ade096dcb732af53 /libjava/classpath/java/lang/String.java | |
parent | abae7d71da9352babb77917224e837ffdfa118be (diff) | |
download | ppe42-gcc-6fec1adc6432eeafcdea2ab165989e170cb6e64e.tar.gz ppe42-gcc-6fec1adc6432eeafcdea2ab165989e170cb6e64e.zip |
2012-12-19 Matthias Klose <doko@ubuntu.com>
Import GNU Classpath (20121202).
* Regenerate class and header files.
* Regenerate auto* files.
* sources.am, gcj/javaprims.h: Regenerate.
* gnu/java/nio/FileLockImpl.java (close): New override.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194618 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/java/lang/String.java')
-rw-r--r-- | libjava/classpath/java/lang/String.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libjava/classpath/java/lang/String.java b/libjava/classpath/java/lang/String.java index 45c0daff673..27294cdd4eb 100644 --- a/libjava/classpath/java/lang/String.java +++ b/libjava/classpath/java/lang/String.java @@ -705,6 +705,8 @@ public final class String */ public synchronized int codePointAt(int index) { + if (index < 0 || index >= count) + throw new StringIndexOutOfBoundsException(index); // Use the CharSequence overload as we get better range checking // this way. return Character.codePointAt(this, index); @@ -716,12 +718,14 @@ 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 < 1 || index > count) + throw new StringIndexOutOfBoundsException(index); // Use the CharSequence overload as we get better range checking // this way. return Character.codePointBefore(this, index); |