diff options
author | Elliott Hughes <enh@google.com> | 2014-11-18 16:42:51 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2014-11-18 16:42:51 -0800 |
commit | 099eddad18ef2fff2b995f661b8abde2d35fd539 (patch) | |
tree | 168af07303cecf9b2ff6715116ace079c914cc0f /luni/src/main/java/libcore | |
parent | 2f629d3eff3e73b64efdc95b90446d1ff8d4e831 (diff) | |
download | libcore-099eddad18ef2fff2b995f661b8abde2d35fd539.zip libcore-099eddad18ef2fff2b995f661b8abde2d35fd539.tar.gz libcore-099eddad18ef2fff2b995f661b8abde2d35fd539.tar.bz2 |
Improve backward compatibility of plurals formatting.
icu4c's behavior changed such that it now looks at the absolute value of the
input. For now, preserve compatibility by treating all negative numbers as
being case OTHER.
Bug: 18429565
Bug: https://code.google.com/p/android/issues/detail?id=78962
Change-Id: I1e98af973f408c8809071c15d07d4fd585d77e4c
Diffstat (limited to 'luni/src/main/java/libcore')
-rw-r--r-- | luni/src/main/java/libcore/icu/NativePluralRules.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/luni/src/main/java/libcore/icu/NativePluralRules.java b/luni/src/main/java/libcore/icu/NativePluralRules.java index dbcf089..f9fe74b 100644 --- a/luni/src/main/java/libcore/icu/NativePluralRules.java +++ b/luni/src/main/java/libcore/icu/NativePluralRules.java @@ -55,6 +55,10 @@ public final class NativePluralRules { * to the first rule that matches the given value. */ public int quantityForInt(int value) { + // Pre-L compatibility. http://b/18429565. + if (value < 0) { + return OTHER; + } return quantityForIntImpl(address, value); } |