Wrong locales in JDK 1.6 (patchset 3)
Bernhard Froehlich
decke at bluelife.at
Sat Dec 29 14:30:24 PST 2007
Hi,
I've run into a problem with localization in jdk1.6 (patchset 3) at least on
FreeBSD 6.2/AMD64 and 7.0/AMD64. With jdk 1.6 Locale.getAvailableLocales()
returns only 3 locales: "ben", "arn", "sun/text/resources/".
Yeah that looks buggy so i started so search and found that
sun.util.LocaleDataMetaInfo.getSupportedLocaleString("sun.text.resources.FormatData")
returns " ben sun/text/resources/ | arn sun/text/resources/ " which is a
formatted string with all available locales that were hardcoded/replaced at
build time so the cause is somewhere in the build scripts.
That string is build by j2se/make/java/java/localegen.sh and genlocales.gmk
but i haven't yet found the bug itself.
Can anyone confirm that this is a bug?
import java.util.Locale;
import sun.util.LocaleDataMetaInfo;
public class LocaleDebug
{
public static void main(String[] args)
{
Locale[] locales = Locale.getAvailableLocales();
for(int i=0; i < locales.length; i++)
System.out.println(locales[i]);
System.out.println("sun.text.resources.FormatData -> " +
LocaleDataMetaInfo.getSupportedLocaleString("sun.text.resources.FormatData"));
}
}
More information about the freebsd-java
mailing list