Summary
Make java.time.chrono.HijrahChronology
capable of allowing custom variations of Hijirah calendar types
Problem
In its class description, it reads that the class can load custom configurations, but in reality, it requires to replace the contents of /java/time/chrono/hijrah-config-islamic-umalqura.properties
resource in the java.base
module, and replace the module with --patch-module
. This is far less convenient, and properties file other than for "islamic-umalqura" cannot be utilized, despite that the spec describes so.
Solution
Change java.time.chrono.HijrahChronology
to look for Hijrah custom configurations, and make them available with Chronology.of()
method. The name of the configuration properties follows the existing one in its @implNote
section. The location of properties files is <JAVA_HOME>/conf/chronology
.
Because of the change in the naming convention, the name of the existing built-in properties resource for islamic-umalqura
calendar will change from "hijrah-config-islamic-umalqura.properties"
to "hijrah-config-Hijrah-umalqura_islamic-umalqura.properties"
.
Specification
Add the following paragraph at the end of @implNote
section:
* <p>
* Additional variants may be added by providing configuration properties files in {@code <JAVA_HOME>/conf/chronology} directory. The properties
* files should follow the naming convention of {@code hijrah-config-<chronology id>_<calendar type>.properties}.
- csr of
-
JDK-8187987 Add a mechanism to configure custom variants in HijrahChronology
- Resolved