[GR-69494] Support for build-time initialization of HijrahChronology in Native Image #12123
+99
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
HijrahChronology
is configured via 1) a default resource shipped with the JDK and 2) via user-supplied properties files dropped into$JAVA_HOME/conf/chronology
. This is a challenge for the native image initialization strategy. Currently, we initializeHijrahChronology
at run time, which requires the default resource to be registered at build time and-Djava.home=
to be set at run time (even if no extra configuration is needed, see #11410). This is not really practical. Instead, this PR makesHijrahChronology
build-time initialized and ensures that all required configuration (resources and extra properties files) are read during the build and are no longer needed at run time.This comes at the cost that
HijrahChronology
can no longer be configured at run time. On the other hand, dropping properties files into$JAVA_HOME
is something that many users cannot do anyways (e.g., because it is read-only), so requiring this to be done at image build time seems like a viable compromise.