summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/java/util/Currency.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/java/util/Currency.java')
-rw-r--r--libjava/classpath/java/util/Currency.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/libjava/classpath/java/util/Currency.java b/libjava/classpath/java/util/Currency.java
index a0933eca2f6..b5da13c37f1 100644
--- a/libjava/classpath/java/util/Currency.java
+++ b/libjava/classpath/java/util/Currency.java
@@ -273,6 +273,11 @@ public final class Currency
throw new
NullPointerException("The locale or its country is null.");
}
+
+ /* Check that country of locale given is valid. */
+ if (country.length() != 2)
+ throw new IllegalArgumentException();
+
/* Attempt to get the currency from the cache */
String code = (String) countryMap.get(country);
if (code == null)
OpenPOWER on IntegriCloud