RFR: 8080608: Missing archive name from jdeps -v -e output if no dependency on other JAR

Mandy Chung mandy.chung at oracle.com
Tue May 19 23:44:24 UTC 2015

On 05/19/2015 10:02 AM, Daniel Fuchs wrote:
> Hi,
> Please find below a patch for jdeps:
> http://cr.openjdk.java.net/~dfuchs/webrev_8080608/webrev.00/
> https://bugs.openjdk.java.net/browse/JDK-8080608
> :
> The fix will make sure that jdeps prints instead:
> indirect2.jar -> dist/unsafe.jar
>    use.indirect2.UseUnsafeIndirectly2 -> use.unsafe.UseUnsafeClass 
> unsafe.jar
> unsafe.jar -> dist/unsafe.jar
>    use.unsafe.UseClassWithUnsafe -> use.unsafe.UseUnsafeClass unsafe.jar

A dependency from unsafe.jar to itself is redundant and thus was 
excluded from the returned value of the requires method.  Maybe better 
just to output without any dependence like this:

    use.unsafe.UseClassWithUnsafe -> use.unsafe.UseUnsafeClass unsafe.jar


  147 if (result.requires.isEmpty() && type == Type.VERBOSE && hasDependences(source)) {
    Is type == Type.VERBOSE necessary?  If hasDependences(source)  returns true,
    "unsafe.jar" is missing for non-verbose mode I assume.

  This long line should be broken into multiple lines.

Maybe good to initialize Stream<Archive> to handle the empty and
non-empty case to avoid duplicate code line 148-149:
    final ArchiveDeps result = results.get(source);
    Stream<Archive> reqs = result.requires().stream();
    if (result.requires().isEmpty()&& hasDependences(source)) {
        reqs = Stream.of(source);

I haven't reviewed the tests.  They are named as closure.  Are these 
tests for the new jdeps enhancement that you are thinking?


More information about the core-libs-dev mailing list