ClassLoader.getPackages()

David M. Lloyd david.lloyd at redhat.com
Mon May 21 08:55:32 PDT 2012


On 03/05/2012 04:44 PM, David M. Lloyd wrote:
> The JavaDoc for ClassLoader.getPackages() says:
>
>   protected Package[] getPackages()
>
>   Returns all of the Packages defined by this class loader and its ancestors.
>
>   Returns:
>     The array of Package objects defined by this ClassLoader
>
> The intention appears to be that the class loader returns all the
> packages visible to it. However, it also assumes a strict parent/child
> hierarchy of class loaders.
>
> My question is, how does the Jigsaw project interpret this method? Does
> it return only Packages known to it and the parent class loader(s)
> (which presumably includes only the "null" class loader)? Or does it
> also include the Packages from its dependencies (i.e. the complete set
> of visible Packages)?

I was wondering if there were any new insights into the answer to this 
question.

-- 
- DML



More information about the jigsaw-dev mailing list