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

ResourceBundleControlProvider no more usable

XMLWordPrintable

    • 9
    • generic
    • generic

      FULL PRODUCT VERSION :
      java version "9.0.1"
      Java(TM) SE Runtime Environment (build 9.0.1+11)
      Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      java.util.spi.ResourceBundleControlProvider made possible to plug some custom logic to load the resource bundles in Java 8.

      In Java 9 and with named modules this is no more possible without changing all the code making impossible to migrate some code and to cover the same features (before you were able to switch the way bundles were loaded without modifying caller code).

      This is a huge regression blocking Java 9 migrating and there is no real reason it is not possible. Can you please ensure it is still possible to override the way the bundles are loaded without any code change?

      I didn't find any valid reason to have the isNamed test injava.util.ResourceBundle#getDefaultControl(java.lang.Module, java.lang.String) and it would be fixing the regressin to remove the test and always call ResourceBundleControlProviderHolder.getControl.

      Thanks,
      Romain

      REGRESSION. Last worked in version 8u162

      ADDITIONAL REGRESSION INFORMATION:
      Implement a ResourceBundleControlProvider hardcoding a custom bundle in provider.jar, then create a module (module.jar) using java.util.ResourceBundle#getBundle(java.lang.String) for instance and name this module. Run module.jar code with whatever JVM setup and see that the custom bundle is never loaded.


      REPRODUCIBILITY :
      This bug can be reproduced always.

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

              Created:
              Updated:
              Resolved: