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

Add a mechanism to configure custom variants in HijrahChronology

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 15
    • core-libs
    • None
    • behavioral
    • minimal
    • Java API, File or wire format
    • SE

      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}.

            naoto Naoto Sato
            webbuggrp Webbug Group
            Roger Riggs
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: