Review Request: JDK-8166860 Add magic number to jmod file
mandy.chung at oracle.com
Thu Sep 29 04:56:02 UTC 2016
The change adds a magic number in jmod file to enable future revision of the JMOD format. It's currently a zip file and may change in a future release. JmodFile opens the file to validate the magic header and version. Module path, module reader, jlink are updated in this patch. This implementation opens zip file as well to support look up of a named entry. There isn’t any simple way to avoid opening the jmod file twice unless it digs into the ZipFile internals. Since jmod is not performance critical (not supported at runtime) and pure Java modules can be packaged as modular JARs, I go with this approach and can look into it when this becomes a real issue.
More information about the jigsaw-dev