Revision: 355
Author: tfenne
Date: 2006-08-01 14:08:18 -0700 (Tue, 01 Aug 2006)
ViewCVS: http://svn.sourceforge.net/stripes/?rev=355&view=rev
Log Message:
-----------
Fix for STS-230: IllegalArgumentException in NumberTypeConverterSupport if
locale is missing language
Modified Paths:
--------------
trunk/stripes/src/net/sourceforge/stripes/validation/NumberTypeConverterSupport.java
Modified:
trunk/stripes/src/net/sourceforge/stripes/validation/NumberTypeConverterSupport.java
===================================================================
---
trunk/stripes/src/net/sourceforge/stripes/validation/NumberTypeConverterSupport.java
2006-08-01 03:39:30 UTC (rev 354)
+++
trunk/stripes/src/net/sourceforge/stripes/validation/NumberTypeConverterSupport.java
2006-08-01 21:08:18 UTC (rev 355)
@@ -35,7 +35,12 @@
public void setLocale(Locale locale) {
this.locale = locale;
this.formats = getNumberFormats();
- this.currencySymbol =
Currency.getInstance(getLocale()).getSymbol(getLocale());
+
+ // Use the appropriate currency symbol if our locale has a country,
otherwise try the dollar sign!
+ if (locale.getCountry() != null && !"".equals(locale.getCountry()))
+ this.currencySymbol =
Currency.getInstance(locale).getSymbol(locale);
+ else
+ this.currencySymbol = "$";
}
/** Returns the Locale set on the object using setLocale(). */
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development