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

javax.lang.model APIs throws CompletionFailure or a subtype of CompletionFailure.

    XMLWordPrintable

Details

    • b04
    • generic
    • generic
    • Verified

    Description

      Elements.getEnclosedElements(...) throws com.sun.tools.javac.code.ClassFinder$BadClassFile, a subtype of CompletionError, which in turn is subtype of RuntimeException, an unchecked exception. This is a surprise to the clients of these APIs, and it is not possible to realistically handle this without resorting to accessing javac internal API.

      The APIs when it encounters CompletionError or BadClassFile should return back an ErrorType or it should declare an exception in the API contract, that can be caught and handled.

      This is a problem for javadoc please see JDK-8187422

      Attachments

        Issue Links

          Activity

            People

              jlahoda Jan Lahoda
              ksrini Kumar Srinivasan
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: