Relates :
|
|
Relates :
|
|
Relates :
|
Some issues with the current implementations were brought up during review of 8060130: http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-October/029085.html Currently there's no possibility of preventing name collisions of packages defined in different classloaders, e.g., a Package can be defined in an ancestral classloader at any time (or in a child classloader as the result of a race), while ClassLoader.getPackages effectively hides packages defined in ancestral classloaders when there are name collisions with packages defined in the current classloader. The most straightforward solution seems to be to return all distinct packages, regardless of name uniqueness, as suggested by Mandy Chung (http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-October/029146.html). It would also seem that the restriction on package definition in child classloaders should be loosened so that we only check the locally defined packages in ClassLoader.definePackage.
|