How to configure ResourceBundle "no fallback control" in Java 9

Viewed 922

As answered in How to ignore the system default Locale to retrieve resourceBundle you can configure in Java 8 or older to not fallback to default locale via:

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

In Java 9, ResourceBundle.Control usage throws an 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 behaviour as the ResourceBundle.Control.getNoFallbackControl provided?

1 Answers
Related