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

11.1.2: assert statement should be recognized as causing an exception

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 20
    • 19
    • specification

    Description

      An `assert` statement (14.10) can complete abruptly by throwing an AssertionError, which is an "exception" in the terminology of ch.11. Other than `throw`, `assert` is the only kind of statement whose execution explicitly introduces an exception, yet 11.1.2 is silent about `assert` as the reason for an exception. None of the 11.1.2 text about "abnormal execution condition" or "asynchronous exception" covers `assert`.

      Recommend the following text be inserted as the second bullet:

      -----
      - An enabled `assert` statement was executed, and evaluation of its boolean expression evaluated to `false` (14.10).
      -----

      Attachments

        Activity

          People

            gbierman Gavin Bierman
            abuckley Alex Buckley
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: