RFR: 8114827: JDK 9 multi-release enabled jar tool
Chris Hegarty
chris.hegarty at oracle.com
Tue Jun 7 15:16:31 UTC 2016
Hi Steve,
> On 2 Jun 2016, at 02:02, Steve Drach <steve.drach at oracle.com> wrote:
>
> Hi,
>
> Please review the following changeset that makes it easier to create multi-release jar files with jar tool.
>
> webrev: http://cr.openjdk.java.net/~sdrach/8114827/webrev.01/
> issue: https://bugs.openjdk.java.net/browse/JDK-8114827
I think this looks good. Some specific comments:
1) Can you please check the line lengths of filesMapToFiles and filesToEntryNames
2) String[] files = filesMap.get(0); // base entries only, can be null
You can use filesMap.get(BASE_VERSION); here
3) // Do we think this is a multi-release jar?
boolean isMultiRelease;
Maybe a comment like: “True if --release has been specified, and there are some
release specific files” ??
4) EntryName en = new EntryName(path,version);
^^ missing space
5) In expand(…) you could 'String entryName = entry.entryname;' just after
the creation of the new Entry, to avoid the many field accesses, as well
as for readability.
6) Can we get away with dropping the legacy interface help update? It looks a bit odd.
> The changeset is the implementation of a new command line option, —release n, that indicates all following files and directories are placed in the META-INF/versions/n directory of a multi-release jar file. The new command line syntax is
>
> jar [OPTION...] [ [--release VERSION] [-C dir] files] …
>
> An example is
>
> jar --create --file mr.jar README -C foo classes --release 9 -C foo9 classes Foo.class
Nice.
> This will put README and all the files under foo/classes in the base (or root) directory of a jar file and put Foo.class and all the files under foo9/classes in the META-INF/versions/9 directory of the jar file.
-Chris.
More information about the core-libs-dev
mailing list