diff --git a/icu4c/source/common/unicode/edits.h b/icu4c/source/common/unicode/edits.h index 244347f2e6e..f69cd8db366 100644 --- a/icu4c/source/common/unicode/edits.h +++ b/icu4c/source/common/unicode/edits.h @@ -378,7 +378,10 @@ public: * not counting unchanged spans * @stable ICU 59 */ - int32_t replacementIndex() const { return replIndex; } + int32_t replacementIndex() const { + // TODO: Throw an exception if we aren't in a change edit? + return replIndex; + } /** * The start index of the current span in the destination string; the span has length diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/Edits.java b/icu4j/main/classes/core/src/com/ibm/icu/text/Edits.java index 4c1d98897bc..d8394321e57 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/text/Edits.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/text/Edits.java @@ -805,7 +805,10 @@ public final class Edits { * spans * @stable ICU 59 */ - public int replacementIndex() { return replIndex; } + public int replacementIndex() { + // TODO: Throw an exception if we aren't in a change edit? + return replIndex; + } /** * The start index of the current span in the destination string; the span has length