Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8209381

Default CDS classlist generation should run with an explicit locale setting

XMLWordPrintable

    • b25

        The default classlist is generated make/GenerateLinkOptData.gmk:

        $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXE_SUFFIX) $(CLASSLIST_JAR)
            $(call MakeDir, $(LINK_OPT_DIR))
            $(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $@))
            $(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $(JLI_TRACE_FILE)))
            $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@.raw \
                -Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true \
                -cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
                build.tools.classlist.HelloClasslist \
                $(LOG_DEBUG) 2>&1 > $(JLI_TRACE_FILE)
            $(GREP) -v HelloClasslist $@.raw > $@

        It just runs a simple HelloWorld app and dumps whatever class that was loaded (except for HelloClasslist). The classes that are loaded may depend on the current locale setting (e.g., sun/util/resources/cldr/provider/CLDRLocaleDataMetaInfo is loaded only for certain locales).

        In order to produce a predictable classlist, we should run the above command with explicit settings of -Duser.language, -Duser.country, and/or -Duser.variant.

        (See https://stackoverflow.com/questions/8809098/how-do-i-set-the-default-locale-for-my-jvm)

              erikj Erik Joelsson
              iklam Ioi Lam
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: