From b55bbd25a9f4275e5cb3b5c17aef829757bf9ccf Mon Sep 17 00:00:00 2001 From: Mark Davis Date: Fri, 4 Mar 2011 23:56:24 +0000 Subject: [PATCH] ICU-8175 Added note to clarify that j-1 is safe. X-SVN-Rev: 29546 --- icu4j/main/classes/core/src/com/ibm/icu/lang/CharSequences.java | 1 + 1 file changed, 1 insertion(+) diff --git a/icu4j/main/classes/core/src/com/ibm/icu/lang/CharSequences.java b/icu4j/main/classes/core/src/com/ibm/icu/lang/CharSequences.java index ecf6d52389..2bb2fe6cc1 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/lang/CharSequences.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/lang/CharSequences.java @@ -275,6 +275,7 @@ public class CharSequences { if (cp >= 0xDC00 && cp <= 0xDFFF && i != 0 ) { // hand-code for speed char last = (char) result[j-1]; if (last >= 0xD800 && last <= 0xDBFF) { + // Note: j-1 is safe, because j can only be zero if i is zero. But i!=0 in this block. result[j-1] = Character.toCodePoint(last, cp); continue; }