]> granicus.if.org Git - icu/commitdiff
ICU-21116 Fix ListFormatterTest on Android
authorVictor Chang <vichang@google.com>
Tue, 12 Jan 2021 11:59:13 +0000 (11:59 +0000)
committerShane F. Carr <shane@unicode.org>
Wed, 13 Jan 2021 06:38:37 +0000 (00:38 -0600)
Android ignores assert statement by default.
The test also failed when running with ant and on OpenJDK runtime
on release-67-1. But no longer fails on master branch.

icu4j/main/classes/core/src/com/ibm/icu/impl/FormattedValueStringBuilderImpl.java

index 0c82d263254f417245c1c08f427a1599a438a939..43f0c4df1762ff5b8c03705b38c8cd8b3879c1ef 100644 (file)
@@ -144,7 +144,8 @@ public class FormattedValueStringBuilderImpl {
                     int end = i - self.zero;
                     // Handle span fields; don't trim them
                     if (currField instanceof SpanFieldPlaceholder) {
-                        assert handleSpan(currField, cfpos, fieldStart, end);
+                        boolean handleResult = handleSpan(currField, cfpos, fieldStart, end);
+                        assert handleResult;
                         return true;
                     }
                     // Grouping separators can be whitespace; don't throw them out!