classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Currency question


From: Mark Wielaard
Subject: [cp-patches] Currency question
Date: Thu, 20 Jan 2005 11:35:20 +0100

Hi,

I started on improving the exception message of Currency to figure out
what goes wrong in this case:
http://brutus.apache.org/gump/kaffe/msv/xsdlib/gump_work/build_msv_xsdlib.html
"java.lang.IllegalArgumentException: The specified country code is
invalid"

So I would propose this patch:

--- java/util/Currency.java     17 Jan 2005 00:59:42 -0000      1.11
+++ java/util/Currency.java     20 Jan 2005 10:24:01 -0000
@@ -169,7 +169,8 @@
     if (countryCode.equals(""))
       {
         throw new
-         IllegalArgumentException("The specified country code is invalid");
+         IllegalArgumentException("Invalid (empty) country code for locale:"
+                                  + loc);
       }
     /* Construct the key for the currency */
     currencyKey = countryCode + ".currency";

But reading the code a bit more it seems that this case is similar to
when the countryCode for an Locale is null. What would be the
best/expected approach here?

Cheers,

Mark

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]