summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2012-10-30 19:55:39 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2012-10-30 19:55:39 +0000
commit2f2203bd748429389d7a06e3f278b2bef36718bb (patch)
treee0df2d13a7df85871571f428e837c36682c6d560
parentfffc5f315111381d4bfe7678b4aa8fe37c2f6b21 (diff)
downloadclasspath-2f2203bd748429389d7a06e3f278b2bef36718bb.tar.gz
PR55140: Addition of exception to codePointBefore breaks OpenJDK GenerateBreakIteratorData tool
2012-10-30 Andrew John Hughes <gnu_andrew@member.fsf.org> PR classpath/55140 * NEWS: List fix. * java/lang/String.java: (codePointBefore(int)): Fix index check to match spec. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
-rw-r--r--ChangeLog7
-rw-r--r--NEWS1
-rw-r--r--java/lang/String.java4
3 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f9fb3bd04..03acce8eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-10-30 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ PR classpath/55140
+ * NEWS: List fix.
+ * java/lang/String.java:
+ (codePointBefore(int)): Fix index check to match spec.
+
2012-10-16 Ivan Maidanski <ivmai@mail.ru>
* java/util/Collections.java:
diff --git a/NEWS b/NEWS
index 13e7aea0d..0a7884a6f 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ New in release 0.99.1 (XXX XX, 2012)
- PR42551: Avoid overwriting length of message when computing length representation.
- PR44208: Ensure a handle for the enum is registered before its constant.
- PR41689: javax.security.sasl.CREDIENTIALS field is missing
+ - PR55140: Addition of exception to codePointBefore breaks OpenJDK GenerateBreakIteratorData tool
New in release 0.99 (Feb 15, 2012)
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 &gt;= length()
+ * @throws IndexOutOfBoundsException if index is less than 1 or &gt; 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.