Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8308754 Class-File API (Preview)
  3. JDK-8308842

Consolidate exceptions thrown from Class-File API

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Fixed
    • P4
    • 21
    • None
    • core-libs

    Description

      Class-File API actually throws wide variety of exceptions based on the actual situation. Complete error handling code must cover `IndexOutOfBoundsException`, `IllegalStateException` and `IllegalArgumentException`.

      Based on previous discussions we decided to consolidate on `IllegalArgumentException` with possible sub-classes.

      It allows easy common error handling in majority of use case, however it allows also to distinguish source of the error when needed (for example `javap` needs to know if the exception comes from constant poll or not).

      Newly introduced `ConstantPoolException` will extend `IllegalArgumentException` to indicate the source of the problem is in constant pool.

      More sub-classes of `IllegalArgumentException` may be introduced later as needed and without disruption of the existing error handlers.

      Attachments

        Issue Links

          Activity

            People

              asotona Adam Sotona
              asotona Adam Sotona
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: