Issue Details (XML | Word | Printable)

Key: LANG-328
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Emmanuel Bourg
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Lang

LocaleUtils.toLocale() rejects strings with only language+variant

Created: 16/Apr/07 11:11 PM   Updated: 08/Aug/07 03:54 PM
Return to search
Component/s: None
Affects Version/s: 2.3
Fix Version/s: 2.4

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works LANG-328.patch 2007-05-01 11:49 PM Henri Yandell 1 kB

Resolution Date: 01/May/07 11:50 PM


 Description  « Hide
LocaleUtils.toLocale() throws an exception on strings containing a language and a variant but no country code. For example : fr__POSIX

This string can be produced with the JDK by instanciating a Locale with an empty string for the country : new Locale("fr", "", "POSIX").toString(). According to the javadoc for the Locale class a variant is allowed with just a language code or just a country code.

Commons Configuration handles this case in its PropertyConverter.toLocale() method. I'd like to replace our implementation by the one provided by LocaleUtils, but our tests fail due to this case.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #534277 Tue May 01 23:50:01 UTC 2007 bayard Applying unit test/fix for LANG-328
Files Changed
MODIFY /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/LocaleUtilsTest.java
MODIFY /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java