RFR: Superfluous classes archive created for modules with no files

Chris Hegarty chris.hegarty at oracle.com
Wed Feb 15 03:49:36 PST 2012


Hi,

There is an incorrect assertion in the SimpleLibrary resource location 
code, loadContent(). Essentially it expects an installed module to 
always have a 'classes' archive. This may not always be the case, e.g. 
'jdk' & 'jdk.jre'.

This wasn't noticed before, at least in the system library, as modules 
installed using 'jmod install -L <lib> classes' actually creates an 
empty classes jar archive. Example,
    >: ../bin/jmod create -L m.lib
    >: ../bin/jmod install -L m.lib ../modules/jdk/classes jdk
    >: ls m.lib/jdk/8-ea
    .        ..       classes  index    info
    >: unzip -l m.lib/jdk/8-ea/classes
    Archive:  m.lib/jdk/8-ea/classes
    warning [m.lib/jdk/8-ea/classes]:  zipfile is empty

This is not the case when the module is install from the jmod file, i.e. 
no 'classes' archive is created if there are no classes or resources in 
the jmod file. Example,
    >: ../bin/jmod create -L m.lib
    >: ../bin/jmod install -L m.lib ../jigsaw-pkgs/jmod/jdk at 8-ea.jmod
    >: ls m.lib/jdk/8-ea
    .      ..     index  info

The solution is to simply remove the incorrect assertion and change the 
installer so that it only creates a 'classes' archive if it is needed.

http://cr.openjdk.java.net/~chegar/jigsaw/classless_webrev.00/webrev/

Thanks,
-Chris.



More information about the jigsaw-dev mailing list