How to configure ResourceBundle "no fallback" in Java 9

As pointed out in StackOverflow question , you can tweak in Java 8 or older to not deviate from the default language:

ResourceBundle.getBundle("MyResources",
  new Locale("en", "US"),
  ResourceBundle.Control.getNoFallbackControl(ResourceBundle.Control.FORMAT_PROPERTIES))

      

In Java 9, ResourceBundle.Control uses throw UnsupportedOperationException

when used in named modules: ResourceBundle.Control

is not supported in named modules.

How do I implement / configure a custom "MyResourcesProvider [Impl]" to achieve the same behavior as ResourceBundle.Control.getNoFallbackControl

?

+3


source to share





All Articles