Changed behaviour of ResourceBundle#getBundle()
Alan Bateman
Alan.Bateman at oracle.com
Tue Feb 14 11:37:32 UTC 2017
On 14/02/2017 11:15, Martin Lehmann wrote:
> Hi Alan,
>
> thanks for that explanation.
>
> If I understand this correctly: Assume that I have two modules M and N , both containing eg a properties file and both files need to get encapsulated. Then M and N have to choose *different* package names for where to put the file, right? Because of split package problem...?!
>
> Isn't Jigsaw's default to "encapsulate all" (so anything which is not explicitely exported or opened is per default encapsulated)? Why is this not also the default for resources in the unnamed package or in a "not-a-package place"? Sounds incosistent to me.
>
A named module contains a set of named packages. Only resources with
names that map to those packages can be encapsulated, there is no
support in the design for encapsulating other random resources that
aren't in any of the module's packages. So resources in locations like
the top-level directory of a JAR file or META-INF/mumble can never be
encapsulated because these locations to not map to packages in a named
module.
For the M and N example then if they both contain the same package
(assuming not-exported) then the only restriction is that they cannot be
defined to the same class loader.
-Alan
More information about the jigsaw-dev
mailing list