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

jdeps does not report some exceptions correctly

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 18
    • 18
    • tools
    • b26

    Backports

      Description

        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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved: