Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8277123

jdeps does not report some exceptions correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 18
    • 18
    • tools
    • b26

        Found through this stack overflow question: https://stackoverflow.com/q/69943899

        If e.g. a MultiReleaseException is thrown from VersionHelper.java:60 [1], it will be wrapped in an ExecutionException, and then re-wrapped in an Error in DependencyFinder.java:271 [2].

        As a result, the main logic for reporting errors in JdepsTask::run will not recognize the exception and report the error properly [3], resulting in a stack trace with an empty exception message instead (like in the SO question).

        Perhaps the cause of the ExecutionException at [2] should be re-thrown instead of wrapping it in an Error.

        See https://bugs.openjdk.java.net/browse/JDK-8277165 for a reproducer.

        [1] : https://github.com/openjdk/jdk/blob/master/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/VersionHelper.java#L60
        [2] : https://github.com/openjdk/jdk/blob/master/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/DependencyFinder.java#L270
        [3] : https://github.com/openjdk/jdk/blob/master/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java#L549

              mchung Mandy Chung (Inactive)
              jvernee Jorn Vernee
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: