Re: RFR: 8114827: JDK 9 multi-release enabled jar tool

2016-06-07 Thread Chris Hegarty
Hi Steve,


> On 2 Jun 2016, at 02:02, Steve Drach  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.

Re: RFR: 8114827: JDK 9 multi-release enabled jar tool

2016-06-02 Thread Alan Bateman

On 02/06/2016 02:02, Steve Drach 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

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

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.
I don't have time to do a detailed look at the code but `--release 9 -C 
 ...` looks quite good. It does mean mixing of option styles.


One thing to check is that the `jar -help` output is clean. It looks 
like it might wrap which can look messy (the usage output from `jlink` 
had to be cleaned up recent months on this specific point).


On terminology then then usage has "versioned area" in one place, 
"versioned directory" in another. I thought the JarFile javadoc was 
using "versioned section" at one point but I don't see it now. Anyway, 
just pointing this out to make sure that it is consistent.


-Alan




RFR: 8114827: JDK 9 multi-release enabled jar tool

2016-06-01 Thread Steve Drach
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

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

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.