Bug 25946 - Inconsistency between different getAvaliableLocales() vs. getDefaultLocale()
Summary: Inconsistency between different getAvaliableLocales() vs. getDefaultLocale()
Status: NEW
Alias: None
Product: classpath
Classification: Unclassified
Component: classpath (show other bugs)
Version: 0.20
: P3 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-24 16:47 UTC by Endre Stølsvik
Modified: 2006-05-18 16:28 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-05-18 16:28:56


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Endre Stølsvik 2006-01-24 16:47:31 UTC
The different getAvailableLocales() output different information.

This code:
  System.out.println("Locale.getAvailableLocales(): ["+Arrays.asList(Locale.getAvailableLocales())+"].");
  System.out.println("NumberFormat.getAvailableLocales(): ["+Arrays.asList(NumberFormat.getAvailableLocales())+"].");
  System.out.println("DateFormat.getAvailableLocales(): ["+Arrays.asList(DateFormat.getAvailableLocales())+"].");
  System.out.println("Default Locale: ["+Locale.getDefault()+"].");

Outputs:
  Locale.getAvailableLocales(): [[en, fr, de, ga]].
  NumberFormat.getAvailableLocales(): [[en_US]].
  DateFormat.getAvailableLocales(): [[en_US]].
  Default Locale: [en_US].

So, the single locale that the NumberFormat and DateFormat returns as "available" is not listed in the Locale class's available locales. This was slightly annoying for my application, that assumed that the formatters' available-ness was a subset of Locale's.

But one thing that might anyway be a bug, is that the "Default Locale" when asking Locale, is a locale that Locale doesn't report when asked for its available locales.