diff options
author | Narayan Kamath <narayan@google.com> | 2014-09-05 10:38:01 +0100 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2014-09-05 11:56:17 +0100 |
commit | 87e82b7e4d81bfe955a2a2bd4ddf6eb6cc3995e0 (patch) | |
tree | c0db3c94375ba9b117d44f25cb70f25a43d986b5 /luni | |
parent | ae45925d3a59ae3eb72d70e305d2c1dab5ef6d17 (diff) | |
download | libcore-87e82b7e4d81bfe955a2a2bd4ddf6eb6cc3995e0.zip libcore-87e82b7e4d81bfe955a2a2bd4ddf6eb6cc3995e0.tar.gz libcore-87e82b7e4d81bfe955a2a2bd4ddf6eb6cc3995e0.tar.bz2 |
DecimalFormatSymbols with a null locale should throw.
We left this out when manually auditing the list of classes
that don't throw and silently use the default (like Calendar)
vs those that do. See bugs 16938922 and 15849709.
bug: 17394277
(cherry picked from commit fba9a7e32be3a80df36fe7b3f6ee839b68f35d2e)
Change-Id: I84ae39442b4ba69296f3e85344fa4d7936ecbb81
Diffstat (limited to 'luni')
-rw-r--r-- | luni/src/main/java/java/text/DecimalFormatSymbols.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/luni/src/main/java/java/text/DecimalFormatSymbols.java b/luni/src/main/java/java/text/DecimalFormatSymbols.java index 6e25c1b..fba2d6e 100644 --- a/luni/src/main/java/java/text/DecimalFormatSymbols.java +++ b/luni/src/main/java/java/text/DecimalFormatSymbols.java @@ -81,6 +81,10 @@ public class DecimalFormatSymbols implements Cloneable, Serializable { * the locale. */ public DecimalFormatSymbols(Locale locale) { + if (locale == null) { + throw new NullPointerException("locale == null"); + } + locale = LocaleData.mapInvalidAndNullLocales(locale); LocaleData localeData = LocaleData.get(locale); this.zeroDigit = localeData.zeroDigit; |