All available locales are detected and replaced at build time in work/control/build/bsd-amd64/gensrc/sun/util/LocaleDataMetaInfo.java. With JDK 1.6 and patchset 3 the result is always " ben sun/text/resources/ | arn sun/text/resources/ " and is definitely wrong. http://lists.freebsd.org/pipermail/freebsd-java/2007-December/007027.html Fix: There are 2 files j2se/make/java/java/localegen.sh and j2se/make/java/java/genlocales.gmk that are responsible for detecting and generating the list of available locales. All locales are formattet in genlocales.gmk and stored in a temporary file where one line should be one locale and seperated with newlines. I have found that this does not work because '\n' is interpreted as string and not as an escape character (newline) so the format of the file is wrong and causes the error. @$(ECHO) $(subst .properties,'\n',$(Euro_Resources_properties)) > $@.tmp.euro; @$(ECHO) $(subst .java,'\n',$(Euro_Resources_java)) >> $@.tmp.euro; The second part is localegen.sh where this temporary file is read ... localelist=`$NAWK -F$1_ '{print $2}' $2 | sort` The second parameter of nawk contains a $ and is not escaped so it gets replaced by the shell and not passed thru to nawk as it was expected. My attached fix is more like a workaround because it uses sed to reformat the badly formattet tempory file of locales. Patch attached with submission follows: How-To-Repeat: Locale.getAvailableLocales() returns an String array with: "ben", "arn", "sun/text/resources/" 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")); } }
Responsible Changed From-To: freebsd-java->glewis Over to maintainer.
glewis 2008-02-03 18:46:26 UTC FreeBSD ports repository Modified files: java/jdk16 Makefile Added files: java/jdk16/files patch-j2se-java-localegen.sh Log: . Fix locale generation and hence locale handling in general. PR: 119397 Submitted by: Bernhard Froehlich <decke@bluelife.at> Revision Changes Path 1.154 +1 -1 ports/java/jdk16/Makefile 1.1 +15 -0 ports/java/jdk16/files/patch-j2se-java-localegen.sh (new) _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed Committed. Thanks!