ClassLoader.getPackages()

David M. Lloyd david.lloyd at redhat.com
Mon Mar 5 14:44:42 PST 2012


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)?

-- 
- DML



More information about the jigsaw-dev mailing list