From e4ccb5c14e590a7acb60983e237efa57fd353631 Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Thu, 31 May 2018 18:51:21 +0100 Subject: Android patch: ticket: 13801: Doc change in BreakIterator http://bugs.icu-project.org/trac/ticket/13801 - Discourage modification on CharacterIterator after setText Bug: 80456574 Test: m docs Merged-In: I44e6c834fe06a8898e4683398fea072d66c59880 Change-Id: I44e6c834fe06a8898e4683398fea072d66c59880 (cherry picked from commit 410d5a5ce44e3885b04e331e3cb488ec49d1a45b) --- android_icu4j/src/main/java/android/icu/text/BreakIterator.java | 5 ++++- icu4j/main/classes/core/src/com/ibm/icu/text/BreakIterator.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/android_icu4j/src/main/java/android/icu/text/BreakIterator.java b/android_icu4j/src/main/java/android/icu/text/BreakIterator.java index 3e391f672..8a3c9db63 100644 --- a/android_icu4j/src/main/java/android/icu/text/BreakIterator.java +++ b/android_icu4j/src/main/java/android/icu/text/BreakIterator.java @@ -82,7 +82,10 @@ import android.icu.util.ULocale; * * BreakIterator accesses the text it analyzes through a CharacterIterator, which makes * it possible to use BreakIterator to analyze text in any text-storage vehicle that - * provides a CharacterIterator interface. + * provides a CharacterIterator interface. When BreakIterator.setText(CharacterIterator) or + * getText() was called, the CharacterIterator must not be modified, or else the BreakIterator + * behavior is undefined. In particular, call BreakIterator.setText(), + * not CharacterIterator.setText(). * * Note: Some types of BreakIterator can take a long time to create, and * instances of BreakIterator are not currently cached by the system. For diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/BreakIterator.java b/icu4j/main/classes/core/src/com/ibm/icu/text/BreakIterator.java index 451b8c0ea..a458ad354 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/text/BreakIterator.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/text/BreakIterator.java @@ -81,7 +81,10 @@ import com.ibm.icu.util.ULocale; * * BreakIterator accesses the text it analyzes through a CharacterIterator, which makes * it possible to use BreakIterator to analyze text in any text-storage vehicle that - * provides a CharacterIterator interface. + * provides a CharacterIterator interface. When BreakIterator.setText(CharacterIterator) or + * getText() was called, the CharacterIterator must not be modified, or else the BreakIterator + * behavior is undefined. In particular, call BreakIterator.setText(), + * not CharacterIterator.setText(). * * Note: Some types of BreakIterator can take a long time to create, and * instances of BreakIterator are not currently cached by the system. For -- cgit v1.2.3