RFR: 8153654: Update jdeps to be multi-release jar aware

Steve Drach steve.drach at oracle.com
Fri Sep 16 20:30:54 UTC 2016


> This looks good.  Thanks for the update.
> 
> Minor comments below and you can make the change before you push (no need for a new webrev).
> 
> MultiReleaseException.java 
>    key and msg should be final fields

Done.

> 
> VersionHelper.java
>   nameToVersion can simply be Map<String,Integer> (I missed this last round)

It should be <String,String>, see line 43 of VersionHelper.

> 
>   63     public static void add(JarFile jarfile, JarEntry e, ClassFile cf) throws ConstantPoolException {
> 
> - can you break “throws …” to the next line.

Done

> 
>   56                 String name = cf.getName().replace('/', '.');
>   57                 nameToVersion.put(name, version);
> 
> Can you add a check to make sure the version is the same if the entry is present; otherwise, throw InternalError.  This will catch any unexpected code path.

That’s a good idea, but is InternalError the right one?  The spec is a bit ambiguous but implies to me that it’s a JVM error since it’s a subclass of VirtualMachineError.  How about just using the MultiReleaseException?

> 
> Mandy



More information about the core-libs-dev mailing list